diff --git a/BUILD.gn b/BUILD.gn index 7c186c58..f50c122 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -708,17 +708,6 @@ ] } -# TODO(GYP_GONE): This target exists for compatibility with GYP for the -# builders that specify targets in the recipes directly. -# Ideally it should not exist, and the builders should be specifying -# more specific targets (or 'All') via the source-side -# //testing/buildbot/*.json files. We should simply delete this target -# and update any recipes that are using it. -group("chromium_builder_tests") { - testonly = true - deps = [] -} - # TODO(GYP_GONE): Figure out if we really need this target or if there's # some better way to specify things. if (is_win) {
diff --git a/DEPS b/DEPS index fc06943..b78888e 100644 --- a/DEPS +++ b/DEPS
@@ -40,11 +40,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': '01eb360ce063ee8df4109f22fc779d7eb69583ae', + 'skia_revision': '6b59bf424c9d9d8a72d3c002871f143e6aff623e', # 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': '2c2e365f52d98d12f040c30b0f48654811d2e392', + 'v8_revision': '389ea8091864d6c04455217efb52f4d4337d4985', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -64,7 +64,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': 'a173900b19e158130df049dd1c31b7494baefffd', + 'pdfium_revision': 'cb50b5fd0d52bc5766da4173f385dac52cf0b8be', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling openmax_dl # and whatever else without interference from each other. @@ -96,7 +96,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '6d102fd0828209a8f9c0fb39eab1e846f3114e84', + 'catapult_revision': '68c788088273e9d6ff8bb38a5b2c11dca4e4f666', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -166,7 +166,7 @@ Var('chromium_git') + '/external/leveldb.git' + '@' + 'a53934a3ae1244679f812d998a4f16f2c7f309a6', 'src/third_party/snappy/src': - Var('chromium_git') + '/external/github.com/google/snappy.git' + '@' + '8b60aac4fdbbb8f1dcce778accb5c04136c3a908', + Var('chromium_git') + '/external/github.com/google/snappy.git' + '@' + '513df5fb5a2d51146f409141f9eb8736935cc486', 'src/tools/gyp': Var('chromium_git') + '/external/gyp.git' + '@' + 'eb296f67da078ec01f5e3a9ea9cdc6d26d680161', @@ -208,7 +208,7 @@ Var('chromium_git') + '/webm/libvpx.git' + '@' + 'ec4afbf74a4beebadee3e1b15b43c5d4e3d3bd1c', 'src/third_party/ffmpeg': - Var('chromium_git') + '/chromium/third_party/ffmpeg.git' + '@' + '88c555e9e69e6f82f0674912596c1be1b30c6add', + Var('chromium_git') + '/chromium/third_party/ffmpeg.git' + '@' + 'ddb09a0d5aaf6aacf846355b7629953b2496b8ea', 'src/third_party/usrsctp/usrsctplib': Var('chromium_git') + '/external/github.com/sctplab/usrsctp' + '@' + '2f6478eb8d40f1766a96b5b033ed26c0c2244589', @@ -235,7 +235,7 @@ Var('chromium_git') + '/native_client/src/third_party/scons-2.0.1.git' + '@' + '1c1550e17fc26355d08627fbdec13d8291227067', 'src/third_party/webrtc': - Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + '675c61ecddf34a2073b0715adf15205fa3d42856', # commit position 18836 + Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + '67a934da896a180a4bd5ea6fa4e687102cdd4bc7', # commit position 18875 'src/third_party/openmax_dl': Var('chromium_git') + '/external/webrtc/deps/third_party/openmax.git' + '@' + Var('openmax_dl_revision'),
diff --git a/android_webview/browser/aw_contents.cc b/android_webview/browser/aw_contents.cc index ef985d22..1cd3605 100644 --- a/android_webview/browser/aw_contents.cc +++ b/android_webview/browser/aw_contents.cc
@@ -43,6 +43,7 @@ #include "base/bind.h" #include "base/callback.h" #include "base/command_line.h" +#include "base/json/json_writer.h" #include "base/location.h" #include "base/memory/memory_pressure_listener.h" #include "base/memory/ptr_util.h" @@ -134,6 +135,16 @@ base::subtle::Atomic32 g_instance_count = 0; +void JavaScriptResultCallbackForTesting( + const ScopedJavaGlobalRef<jobject>& callback, + const base::Value* result) { + JNIEnv* env = base::android::AttachCurrentThread(); + std::string json; + base::JSONWriter::Write(*result, &json); + ScopedJavaLocalRef<jstring> j_json = ConvertUTF8ToJavaString(env, json); + Java_AwContents_onEvaluateJavaScriptResultForTesting(env, j_json, callback); +} + } // namespace // static @@ -1435,18 +1446,31 @@ return Java_AwContents_getErrorUiType(env, obj); } -void AwContents::CallProceedOnInterstitialForTesting( +void AwContents::EvaluateJavaScriptOnInterstitialForTesting( JNIEnv* env, - const base::android::JavaParamRef<jobject>& obj) { - DCHECK(web_contents_->GetInterstitialPage()); - web_contents_->GetInterstitialPage()->Proceed(); -} + const base::android::JavaParamRef<jobject>& obj, + const base::android::JavaParamRef<jstring>& script, + const base::android::JavaParamRef<jobject>& callback) { + content::InterstitialPage* interstitial = + web_contents_->GetInterstitialPage(); + DCHECK(interstitial); -void AwContents::CallDontProceedOnInterstitialForTesting( - JNIEnv* env, - const base::android::JavaParamRef<jobject>& obj) { - DCHECK(web_contents_->GetInterstitialPage()); - web_contents_->GetInterstitialPage()->DontProceed(); + if (!callback) { + // No callback requested. + interstitial->GetMainFrame()->ExecuteJavaScriptForTests( + ConvertJavaStringToUTF16(env, script)); + return; + } + + // Secure the Java callback in a scoped object and give ownership of it to the + // base::Callback. + ScopedJavaGlobalRef<jobject> j_callback; + j_callback.Reset(env, callback); + RenderFrameHost::JavaScriptResultCallback js_callback = + base::Bind(&JavaScriptResultCallbackForTesting, j_callback); + + interstitial->GetMainFrame()->ExecuteJavaScriptForTests( + ConvertJavaStringToUTF16(env, script), js_callback); } void AwContents::OnRenderProcessGone(int child_process_id) {
diff --git a/android_webview/browser/aw_contents.h b/android_webview/browser/aw_contents.h index f731590..7084b18 100644 --- a/android_webview/browser/aw_contents.h +++ b/android_webview/browser/aw_contents.h
@@ -367,12 +367,11 @@ bool CanShowInterstitial() override; int GetErrorUiType() override; - void CallProceedOnInterstitialForTesting( + void EvaluateJavaScriptOnInterstitialForTesting( JNIEnv* env, - const base::android::JavaParamRef<jobject>& obj); - void CallDontProceedOnInterstitialForTesting( - JNIEnv* env, - const base::android::JavaParamRef<jobject>& obj); + const base::android::JavaParamRef<jobject>& obj, + const base::android::JavaParamRef<jstring>& script, + const base::android::JavaParamRef<jobject>& callback); // AwRenderProcessGoneDelegate overrides void OnRenderProcessGone(int child_process_id) override;
diff --git a/android_webview/browser/aw_safe_browsing_blocking_page.cc b/android_webview/browser/aw_safe_browsing_blocking_page.cc index 1ed0424..62e858e 100644 --- a/android_webview/browser/aw_safe_browsing_blocking_page.cc +++ b/android_webview/browser/aw_safe_browsing_blocking_page.cc
@@ -7,6 +7,8 @@ #include "android_webview/browser/aw_browser_context.h" #include "android_webview/browser/aw_safe_browsing_ui_manager.h" #include "android_webview/browser/net/aw_url_request_context_getter.h" +#include "components/safe_browsing/browser/threat_details.h" +#include "components/safe_browsing/triggers/trigger_manager.h" #include "components/security_interstitials/content/security_interstitial_controller_client.h" #include "components/security_interstitials/content/unsafe_resource.h" #include "components/security_interstitials/core/base_safe_browsing_error_ui.h" @@ -36,7 +38,8 @@ main_frame_url, unsafe_resources, std::move(controller_client), - display_options) { + display_options), + threat_details_in_progress_(false) { if (errorUiType == ErrorUiType::QUIET_SMALL || errorUiType == ErrorUiType::QUIET_GIANT) { set_sb_error_ui(base::MakeUnique<SafeBrowsingQuietErrorUI>( @@ -46,9 +49,22 @@ errorUiType == ErrorUiType::QUIET_GIANT)); } - // TODO(timvolodine): invoke TriggerManager::StartCollectingThreatDetails(), - // (via AwBrowserContext, e.g. - // AwBrowserContext::FromWebContents(web_contents)), crbug.com/731747. + if (unsafe_resources.size() == 1 && + ShouldReportThreatDetails(unsafe_resources[0].threat_type)) { + AwBrowserContext* aw_browser_context = + AwBrowserContext::FromWebContents(web_contents); + // TODO(timvolodine): create a proper history service; currently the + // HistoryServiceFactory lives in the chrome/ layer and relies on Profile + // which we don't have in Android WebView (crbug.com/731744). + threat_details_in_progress_ = + aw_browser_context->GetSafeBrowsingTriggerManager() + ->StartCollectingThreatDetails( + safe_browsing::SafeBrowsingTriggerType::SECURITY_INTERSTITIAL, + web_contents, unsafe_resources[0], + aw_browser_context->GetAwURLRequestContext(), + /*history_service*/ nullptr, + sb_error_ui()->get_error_display_options()); + } } // static @@ -93,4 +109,29 @@ } } +void AwSafeBrowsingBlockingPage::FinishThreatDetails( + const base::TimeDelta& delay, + bool did_proceed, + int num_visits) { + // Not all interstitials collect threat details, e.g. when not opted in. + if (!threat_details_in_progress_) + return; + + // Finish computing threat details. TriggerManager will decide if it is safe + // to send the report. + AwBrowserContext* aw_browser_context = + AwBrowserContext::FromWebContents(web_contents()); + bool report_sent = + aw_browser_context->GetSafeBrowsingTriggerManager() + ->FinishCollectingThreatDetails( + safe_browsing::SafeBrowsingTriggerType::SECURITY_INTERSTITIAL, + web_contents(), delay, did_proceed, num_visits, + sb_error_ui()->get_error_display_options()); + + if (report_sent) { + controller()->metrics_helper()->RecordUserInteraction( + security_interstitials::MetricsHelper::EXTENDED_REPORTING_IS_ENABLED); + } +} + } // namespace android_webview
diff --git a/android_webview/browser/aw_safe_browsing_blocking_page.h b/android_webview/browser/aw_safe_browsing_blocking_page.h index 8b597bd..0569f866 100644 --- a/android_webview/browser/aw_safe_browsing_blocking_page.h +++ b/android_webview/browser/aw_safe_browsing_blocking_page.h
@@ -40,6 +40,18 @@ controller_client, const BaseSafeBrowsingErrorUI::SBErrorDisplayOptions& display_options, ErrorUiType errorUiType); + + // Called when the interstitial is going away. If there is a + // pending threat details object, we look at the user's + // preferences, and if the option to send threat details is + // enabled, the report is scheduled to be sent on the |ui_manager_|. + void FinishThreatDetails(const base::TimeDelta& delay, + bool did_proceed, + int num_visits) override; + + // Whether ThreatDetails collection is in progress as part of this + // interstitial. + bool threat_details_in_progress_; }; } // namespace android_webview
diff --git a/android_webview/common/crash_reporter/crash_keys.cc b/android_webview/common/crash_reporter/crash_keys.cc index 1099d10..7453366e 100644 --- a/android_webview/common/crash_reporter/crash_keys.cc +++ b/android_webview/common/crash_reporter/crash_keys.cc
@@ -126,6 +126,9 @@ {"swdh_set_hosted_version_host_pid", kSmallSize}, {"swdh_set_hosted_version_is_new_process", kSmallSize}, {"swdh_set_hosted_version_restart_count", kSmallSize}, + + // Temporary for https://crbug.com/685996. + {"user-cloud-policy-manager-connect-trace", kMediumSize}, }; // This dynamic set of keys is used for sets of key value pairs when gathering
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java index 53bbd560..b6b311df 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -3010,15 +3010,28 @@ } @VisibleForTesting - public void callProceedOnInterstitial() { - if (isDestroyedOrNoOperation(NO_WARN)) return; - nativeCallProceedOnInterstitialForTesting(mNativeAwContents); + public void evaluateJavaScriptOnInterstitialForTesting( + String script, final ValueCallback<String> callback) { + if (TRACE) Log.i(TAG, "%s evaluateJavascriptOnInterstitial=%s", this, script); + if (isDestroyedOrNoOperation(WARN)) return; + JavaScriptCallback jsCallback = null; + if (callback != null) { + jsCallback = new JavaScriptCallback() { + @Override + public void handleJavaScriptResult(String jsonResult) { + callback.onReceiveValue(jsonResult); + } + }; + } + + // mWebContents.evaluateJavaScript(script, jsCallback); + nativeEvaluateJavaScriptOnInterstitialForTesting(mNativeAwContents, script, jsCallback); } - @VisibleForTesting - public void callDontProceedOnInterstitial() { - if (isDestroyedOrNoOperation(NO_WARN)) return; - nativeCallDontProceedOnInterstitialForTesting(mNativeAwContents); + @CalledByNative + private static void onEvaluateJavaScriptResultForTesting( + String jsonResult, JavaScriptCallback callback) { + callback.handleJavaScriptResult(jsonResult); } // ------------------------------------------------------------------------------------------- @@ -3483,8 +3496,8 @@ private static native void nativeSetShouldDownloadFavicons(); private static native void nativeUpdateDefaultLocale(String locale, String localeList); - private native void nativeCallProceedOnInterstitialForTesting(long nativeAwContents); - private native void nativeCallDontProceedOnInterstitialForTesting(long nativeAwContents); + private native void nativeEvaluateJavaScriptOnInterstitialForTesting( + long nativeAwContents, String script, JavaScriptCallback jsCallback); private native void nativeSetJavaPeers(long nativeAwContents, AwContents awContents, AwWebContentsDelegate webViewWebContentsDelegate, AwContentsClientBridge contentsClientBridge, AwContentsIoThreadClient ioThreadClient,
diff --git a/android_webview/java/src/org/chromium/android_webview/policy/AwPolicyProvider.java b/android_webview/java/src/org/chromium/android_webview/policy/AwPolicyProvider.java index 0f3d46d..49d8787 100644 --- a/android_webview/java/src/org/chromium/android_webview/policy/AwPolicyProvider.java +++ b/android_webview/java/src/org/chromium/android_webview/policy/AwPolicyProvider.java
@@ -25,14 +25,17 @@ @Override public void notifySettingsAvailable(Bundle newAppRestrictions) { - Bundle filteredRestrictions = new Bundle(); + Bundle filteredRestrictions = null; + if (newAppRestrictions != null) { + filteredRestrictions = new Bundle(); - for (String key : newAppRestrictions.keySet()) { - if (!key.startsWith(POLICY_PREFIX)) continue; + for (String key : newAppRestrictions.keySet()) { + if (!key.startsWith(POLICY_PREFIX)) continue; - filteredRestrictions.putSerializable( - key.substring(POLICY_PREFIX.length()), newAppRestrictions.getSerializable(key)); + filteredRestrictions.putSerializable(key.substring(POLICY_PREFIX.length()), + newAppRestrictions.getSerializable(key)); + } } super.notifySettingsAvailable(filteredRestrictions); } -} \ No newline at end of file +}
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java index 0031980f..78598bf 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java
@@ -10,6 +10,7 @@ import android.graphics.Color; import android.support.test.filters.SmallTest; import android.view.ViewGroup; +import android.webkit.ValueCallback; import org.chromium.android_webview.AwBrowserContext; import org.chromium.android_webview.AwContents; @@ -26,6 +27,7 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.test.util.CallbackHelper; import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.InMemorySharedPreferences; import org.chromium.components.safe_browsing.SafeBrowsingApiBridge; @@ -204,6 +206,18 @@ } } + private static class JavaScriptHelper extends CallbackHelper { + private String mValue; + + public void setValue(String s) { + mValue = s; + } + + public String getValue() { + return mValue; + } + } + @Override public void setUp() throws Exception { super.setUp(); @@ -253,24 +267,61 @@ waitForVisualStateCallback(mAwContents); } - private void proceedThroughInterstitial() { + private void evaluateJavaScriptOnInterstitialOnUiThread( + final String script, final ValueCallback<String> callback) { ThreadUtils.runOnUiThread(new Runnable() { @Override public void run() { - mAwContents.callProceedOnInterstitial(); + mAwContents.evaluateJavaScriptOnInterstitialForTesting(script, callback); } }); } - private void dontProceedThroughInterstitial() { - ThreadUtils.runOnUiThread(new Runnable() { + private void waitForInterstitialToLoad() throws Exception { + final String script = "document.readyState;"; + final JavaScriptHelper helper = new JavaScriptHelper(); + + final ValueCallback<String> callback = new ValueCallback<String>() { @Override - public void run() { - mAwContents.callDontProceedOnInterstitial(); + public void onReceiveValue(String value) { + helper.setValue(value); + helper.notifyCalled(); + } + }; + + final String expected = "\"complete\""; + CriteriaHelper.pollInstrumentationThread(new Criteria() { + @Override + public boolean isSatisfied() { + try { + final int count = helper.getCallCount(); + evaluateJavaScriptOnInterstitialOnUiThread(script, callback); + helper.waitForCallback(count); + return expected.equals(helper.getValue()); + } catch (Exception e) { + throw new RuntimeException(e); + } } }); } + private void clickBackToSafety() { + final String script = "document.getElementById('primary-button').click();"; + evaluateJavaScriptOnInterstitialOnUiThread(script, null); + } + + private void clickVisitUnsafePageQuietInterstitial() { + final String script = "document.getElementById('details-link').click();" + + "document.getElementById('proceed-link').click();"; + evaluateJavaScriptOnInterstitialOnUiThread(script, null); + } + + private void clickVisitUnsafePage() { + final String script = "document.getElementById('details-button').click();" + + "document.getElementById('proceed-link').click();"; + evaluateJavaScriptOnInterstitialOnUiThread(script, null); + } + private void waitForInterstitialToChangeTitle() { CriteriaHelper.pollUiThread(new Criteria() { @Override @@ -362,6 +413,7 @@ loadPathAndWaitForInterstitial(IFRAME_HTML_PATH); assertGreenPageNotShowing(); assertTargetPageNotShowing(IFRAME_EMBEDDER_BACKGROUND_COLOR); + // Assume that we are rendering the interstitial, since we see neither the previous page nor // the target page } @@ -372,7 +424,8 @@ public void testSafeBrowsingProceedThroughInterstitialForMainFrame() throws Throwable { int pageFinishedCount = mContentsClient.getOnPageFinishedHelper().getCallCount(); loadPathAndWaitForInterstitial(MALWARE_HTML_PATH); - proceedThroughInterstitial(); + waitForInterstitialToLoad(); + clickVisitUnsafePage(); mContentsClient.getOnPageFinishedHelper().waitForCallback(pageFinishedCount); assertTargetPageHasLoaded(MALWARE_PAGE_BACKGROUND_COLOR); } @@ -380,10 +433,11 @@ @SmallTest @Feature({"AndroidWebView"}) @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) - public void testSafeBrowsingCanProceedThroughInterstitialForSubresource() throws Throwable { + public void testSafeBrowsingProceedThroughInterstitialForSubresource() throws Throwable { int pageFinishedCount = mContentsClient.getOnPageFinishedHelper().getCallCount(); loadPathAndWaitForInterstitial(IFRAME_HTML_PATH); - proceedThroughInterstitial(); + waitForInterstitialToLoad(); + clickVisitUnsafePage(); mContentsClient.getOnPageFinishedHelper().waitForCallback(pageFinishedCount); assertTargetPageHasLoaded(IFRAME_EMBEDDER_BACKGROUND_COLOR); } @@ -392,10 +446,12 @@ @Feature({"AndroidWebView"}) @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingDontProceedCausesNetworkErrorForMainFrame() throws Throwable { + loadGreenPage(); loadPathAndWaitForInterstitial(MALWARE_HTML_PATH); OnReceivedError2Helper errorHelper = mContentsClient.getOnReceivedError2Helper(); int errorCount = errorHelper.getCallCount(); - dontProceedThroughInterstitial(); + waitForInterstitialToLoad(); + clickBackToSafety(); errorHelper.waitForCallback(errorCount); assertEquals( ErrorCodeConversionHelper.ERROR_UNSAFE_RESOURCE, errorHelper.getError().errorCode); @@ -407,11 +463,13 @@ @SmallTest @Feature({"AndroidWebView"}) @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) + @DisabledTest(message = "crbug/737820") public void testSafeBrowsingDontProceedCausesNetworkErrorForSubresource() throws Throwable { loadPathAndWaitForInterstitial(IFRAME_HTML_PATH); OnReceivedError2Helper errorHelper = mContentsClient.getOnReceivedError2Helper(); int errorCount = errorHelper.getCallCount(); - dontProceedThroughInterstitial(); + waitForInterstitialToLoad(); + clickBackToSafety(); errorHelper.waitForCallback(errorCount); assertEquals( ErrorCodeConversionHelper.ERROR_UNSAFE_RESOURCE, errorHelper.getError().errorCode); @@ -428,7 +486,28 @@ final String originalTitle = getTitleOnUiThread(mAwContents); loadPathAndWaitForInterstitial(MALWARE_HTML_PATH); waitForInterstitialToChangeTitle(); - dontProceedThroughInterstitial(); + waitForInterstitialToLoad(); + clickBackToSafety(); + + // Make sure we navigate back to previous page + CriteriaHelper.pollUiThread(new Criteria() { + @Override + public boolean isSatisfied() { + return originalTitle.equals(mAwContents.getTitle()); + } + }); + } + + @SmallTest + @Feature({"AndroidWebView"}) + @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) + public void testSafeBrowsingDontProceedNavigatesBackForSubResource() throws Throwable { + loadGreenPage(); + final String originalTitle = getTitleOnUiThread(mAwContents); + loadPathAndWaitForInterstitial(IFRAME_HTML_PATH); + waitForInterstitialToChangeTitle(); + waitForInterstitialToLoad(); + clickBackToSafety(); // Make sure we navigate back to previous page CriteriaHelper.pollUiThread(new Criteria() { @@ -511,7 +590,8 @@ mAwContents.setCanShowBigInterstitial(false); int pageFinishedCount = mContentsClient.getOnPageFinishedHelper().getCallCount(); loadPathAndWaitForInterstitial(PHISHING_HTML_PATH); - proceedThroughInterstitial(); + waitForInterstitialToLoad(); + clickVisitUnsafePageQuietInterstitial(); mContentsClient.getOnPageFinishedHelper().waitForCallback(pageFinishedCount); assertTargetPageHasLoaded(PHISHING_PAGE_BACKGROUND_COLOR); }
diff --git a/android_webview/test/embedded_test_server/BUILD.gn b/android_webview/test/embedded_test_server/BUILD.gn index e9b2f3af..f9d6dbf9 100644 --- a/android_webview/test/embedded_test_server/BUILD.gn +++ b/android_webview/test/embedded_test_server/BUILD.gn
@@ -57,6 +57,8 @@ ":aw_java_test_native_support", "//net:test_support", ] + configs -= [ "//build/config/android:hide_all_but_jni_onload" ] + configs += [ "//build/config/android:hide_all_but_jni" ] } android_apk("aw_net_test_support_apk") {
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 274baf2a..f20c23b 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -375,6 +375,8 @@ "system/ime_menu/ime_menu_tray.h", "system/keyboard_brightness/keyboard_brightness_controller.cc", "system/keyboard_brightness/keyboard_brightness_controller.h", + "system/keyboard_brightness/tray_keyboard_brightness.cc", + "system/keyboard_brightness/tray_keyboard_brightness.h", "system/keyboard_brightness_control_delegate.h", "system/locale/locale_notification_controller.cc", "system/locale/locale_notification_controller.h", @@ -1209,6 +1211,7 @@ "system/enterprise/tray_enterprise_unittest.cc", "system/ime/tray_ime_chromeos_unittest.cc", "system/ime_menu/ime_menu_tray_unittest.cc", + "system/keyboard_brightness/tray_keyboard_brightness_unittest.cc", "system/lock_screen_action/lock_screen_action_tray_unittest.cc", "system/media_security/multi_profile_media_tray_item_unittest.cc", "system/network/network_icon_unittest.cc",
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index 42523a3..562904f5 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd
@@ -683,6 +683,9 @@ <message name="IDS_ASH_STATUS_TRAY_BRIGHTNESS" desc="The accessible text for the brightness slider."> Brightness </message> + <message name="IDS_ASH_STATUS_TRAY_KEYBOARD_BRIGHTNESS" desc="The accessible text for the keyboard brightness slider."> + Keyboard brightness + </message> <message name="IDS_ASH_STATUS_TRAY_AUDIO" desc="The label used in audio detailed page bottom header of ash tray pop up."> Audio settings </message>
diff --git a/ash/metrics/user_metrics_action.h b/ash/metrics/user_metrics_action.h index d713c113..6ac048fdf 100644 --- a/ash/metrics/user_metrics_action.h +++ b/ash/metrics/user_metrics_action.h
@@ -21,7 +21,6 @@ UMA_ACCEL_PREVWINDOW_F5, UMA_ACCEL_RESTART_POWER_BUTTON, UMA_ACCEL_SHUT_DOWN_POWER_BUTTON, - UMA_CLOSE_THROUGH_CONTEXT_MENU, UMA_DESKTOP_SWITCH_TASK, UMA_DRAG_MAXIMIZE_LEFT, UMA_DRAG_MAXIMIZE_RIGHT, @@ -68,19 +67,7 @@ UMA_STATUS_AREA_DETAILED_NETWORK_VIEW, UMA_STATUS_AREA_DETAILED_SMS_VIEW, UMA_STATUS_AREA_DETAILED_VPN_VIEW, - UMA_STATUS_AREA_DISABLE_AUTO_CLICK, - UMA_STATUS_AREA_DISABLE_CARET_HIGHLIGHT, - UMA_STATUS_AREA_DISABLE_HIGH_CONTRAST, - UMA_STATUS_AREA_DISABLE_HIGHLIGHT_KEYBOARD_FOCUS, - UMA_STATUS_AREA_DISABLE_HIGHLIGHT_MOUSE_CURSOR, - UMA_STATUS_AREA_DISABLE_LARGE_CURSOR, - UMA_STATUS_AREA_DISABLE_MAGNIFIER, - UMA_STATUS_AREA_DISABLE_MONO_AUDIO, - UMA_STATUS_AREA_DISABLE_SPOKEN_FEEDBACK, - UMA_STATUS_AREA_DISABLE_STICKY_KEYS, - UMA_STATUS_AREA_DISABLE_TAP_DRAGGING, UMA_STATUS_AREA_DISABLE_WIFI, - UMA_STATUS_AREA_DISABLE_VIRTUAL_KEYBOARD, UMA_STATUS_AREA_DISPLAY_DEFAULT_SELECTED, UMA_STATUS_AREA_DISPLAY_DEFAULT_SHOW_SETTINGS, UMA_STATUS_AREA_DISPLAY_NOTIFICATION_CREATED, @@ -88,19 +75,7 @@ UMA_STATUS_AREA_DISPLAY_NOTIFICATION_SHOW_SETTINGS, UMA_STATUS_AREA_DRIVE_CANCEL_OPERATION, UMA_STATUS_AREA_DRIVE_SETTINGS, - UMA_STATUS_AREA_ENABLE_AUTO_CLICK, - UMA_STATUS_AREA_ENABLE_CARET_HIGHLIGHT, - UMA_STATUS_AREA_ENABLE_HIGH_CONTRAST, - UMA_STATUS_AREA_ENABLE_HIGHLIGHT_KEYBOARD_FOCUS, - UMA_STATUS_AREA_ENABLE_HIGHLIGHT_MOUSE_CURSOR, - UMA_STATUS_AREA_ENABLE_LARGE_CURSOR, - UMA_STATUS_AREA_ENABLE_MAGNIFIER, - UMA_STATUS_AREA_ENABLE_MONO_AUDIO, - UMA_STATUS_AREA_ENABLE_SPOKEN_FEEDBACK, - UMA_STATUS_AREA_ENABLE_STICKY_KEYS, - UMA_STATUS_AREA_ENABLE_TAP_DRAGGING, UMA_STATUS_AREA_ENABLE_WIFI, - UMA_STATUS_AREA_ENABLE_VIRTUAL_KEYBOARD, UMA_STATUS_AREA_MENU_OPENED, UMA_STATUS_AREA_NETWORK_JOIN_OTHER_CLICKED, UMA_STATUS_AREA_NETWORK_SETTINGS_OPENED, @@ -119,7 +94,6 @@ UMA_STATUS_AREA_VPN_SETTINGS_OPENED, // Track different window close actions in tablet mode. - UMA_TABLET_WINDOW_CLOSE_THROUGH_CONTXT_MENU, UMA_TABLET_WINDOW_CLOSE_THROUGH_CAPTION_BUTTON, UMA_TABLET_WINDOW_CLOSE_THROUGH_OVERVIEW_CLOSE_BUTTON,
diff --git a/ash/metrics/user_metrics_recorder.cc b/ash/metrics/user_metrics_recorder.cc index 1734a3d..0bf56dd 100644 --- a/ash/metrics/user_metrics_recorder.cc +++ b/ash/metrics/user_metrics_recorder.cc
@@ -217,9 +217,6 @@ case UMA_ACCEL_SHUT_DOWN_POWER_BUTTON: RecordAction(UserMetricsAction("Accel_ShutDown_PowerButton")); break; - case UMA_CLOSE_THROUGH_CONTEXT_MENU: - RecordAction(UserMetricsAction("CloseFromContextMenu")); - break; case UMA_DESKTOP_SWITCH_TASK: RecordAction(UserMetricsAction("Desktop_SwitchTask")); task_switch_metrics_recorder_.OnTaskSwitch(TaskSwitchSource::DESKTOP); @@ -361,44 +358,6 @@ case UMA_STATUS_AREA_DETAILED_VPN_VIEW: RecordAction(UserMetricsAction("StatusArea_VPN_Detailed")); break; - case UMA_STATUS_AREA_DISABLE_AUTO_CLICK: - RecordAction(UserMetricsAction("StatusArea_AutoClickDisabled")); - break; - case UMA_STATUS_AREA_DISABLE_CARET_HIGHLIGHT: - RecordAction(UserMetricsAction("StatusArea_CaretHighlightDisabled")); - break; - case UMA_STATUS_AREA_DISABLE_HIGH_CONTRAST: - RecordAction(UserMetricsAction("StatusArea_HighContrastDisabled")); - break; - case UMA_STATUS_AREA_DISABLE_HIGHLIGHT_KEYBOARD_FOCUS: - RecordAction( - UserMetricsAction("StatusArea_HighlightKeyboardFocusDisabled")); - break; - case UMA_STATUS_AREA_DISABLE_HIGHLIGHT_MOUSE_CURSOR: - RecordAction( - UserMetricsAction("StatusArea_HighlightMouseCursorDisabled")); - break; - case UMA_STATUS_AREA_DISABLE_LARGE_CURSOR: - RecordAction(UserMetricsAction("StatusArea_LargeCursorDisabled")); - break; - case UMA_STATUS_AREA_DISABLE_MAGNIFIER: - RecordAction(UserMetricsAction("StatusArea_MagnifierDisabled")); - break; - case UMA_STATUS_AREA_DISABLE_MONO_AUDIO: - RecordAction(UserMetricsAction("StatusArea_MonoAudioDisabled")); - break; - case UMA_STATUS_AREA_DISABLE_SPOKEN_FEEDBACK: - RecordAction(UserMetricsAction("StatusArea_SpokenFeedbackDisabled")); - break; - case UMA_STATUS_AREA_DISABLE_STICKY_KEYS: - RecordAction(UserMetricsAction("StatusArea_StickyKeysDisabled")); - break; - case UMA_STATUS_AREA_DISABLE_TAP_DRAGGING: - RecordAction(UserMetricsAction("StatusArea_TapDraggingDisabled")); - break; - case UMA_STATUS_AREA_DISABLE_VIRTUAL_KEYBOARD: - RecordAction(UserMetricsAction("StatusArea_VirtualKeyboardDisabled")); - break; case UMA_STATUS_AREA_DISPLAY_DEFAULT_SELECTED: RecordAction(UserMetricsAction("StatusArea_Display_Default_Selected")); break; @@ -427,43 +386,6 @@ case UMA_STATUS_AREA_DRIVE_SETTINGS: RecordAction(UserMetricsAction("StatusArea_Drive_Settings")); break; - case UMA_STATUS_AREA_ENABLE_AUTO_CLICK: - RecordAction(UserMetricsAction("StatusArea_AutoClickEnabled")); - break; - case UMA_STATUS_AREA_ENABLE_CARET_HIGHLIGHT: - RecordAction(UserMetricsAction("StatusArea_CaretHighlightEnabled")); - break; - case UMA_STATUS_AREA_ENABLE_HIGH_CONTRAST: - RecordAction(UserMetricsAction("StatusArea_HighContrastEnabled")); - break; - case UMA_STATUS_AREA_ENABLE_HIGHLIGHT_KEYBOARD_FOCUS: - RecordAction( - UserMetricsAction("StatusArea_HighlightKeyboardFocusEnabled")); - break; - case UMA_STATUS_AREA_ENABLE_HIGHLIGHT_MOUSE_CURSOR: - RecordAction(UserMetricsAction("StatusArea_HighlightMouseCursorEnabled")); - break; - case UMA_STATUS_AREA_ENABLE_LARGE_CURSOR: - RecordAction(UserMetricsAction("StatusArea_LargeCursorEnabled")); - break; - case UMA_STATUS_AREA_ENABLE_MAGNIFIER: - RecordAction(UserMetricsAction("StatusArea_MagnifierEnabled")); - break; - case UMA_STATUS_AREA_ENABLE_MONO_AUDIO: - RecordAction(UserMetricsAction("StatusArea_MonoAudioEnabled")); - break; - case UMA_STATUS_AREA_ENABLE_SPOKEN_FEEDBACK: - RecordAction(UserMetricsAction("StatusArea_SpokenFeedbackEnabled")); - break; - case UMA_STATUS_AREA_ENABLE_STICKY_KEYS: - RecordAction(UserMetricsAction("StatusArea_StickyKeysEnabled")); - break; - case UMA_STATUS_AREA_ENABLE_TAP_DRAGGING: - RecordAction(UserMetricsAction("StatusArea_TapDraggingEnabled")); - break; - case UMA_STATUS_AREA_ENABLE_VIRTUAL_KEYBOARD: - RecordAction(UserMetricsAction("StatusArea_VirtualKeyboardEnabled")); - break; case UMA_STATUS_AREA_ENABLE_WIFI: RecordAction(UserMetricsAction("StatusArea_Network_WifiEnabled")); break; @@ -515,9 +437,6 @@ case UMA_STATUS_AREA_VPN_SETTINGS_OPENED: RecordAction(UserMetricsAction("StatusArea_VPN_Settings")); break; - case UMA_TABLET_WINDOW_CLOSE_THROUGH_CONTXT_MENU: - RecordAction(UserMetricsAction("Tablet_WindowCloseFromContextMenu")); - break; case UMA_TABLET_WINDOW_CLOSE_THROUGH_CAPTION_BUTTON: RecordAction(UserMetricsAction("Tablet_WindowCloseFromCaptionButton")); break;
diff --git a/ash/resources/vector_icons/BUILD.gn b/ash/resources/vector_icons/BUILD.gn index f1dbd573..9e5568b 100644 --- a/ash/resources/vector_icons/BUILD.gn +++ b/ash/resources/vector_icons/BUILD.gn
@@ -152,6 +152,8 @@ "system_menu_info.icon", "system_menu_keyboard.1x.icon", "system_menu_keyboard.icon", + "system_menu_keyboard_brightness.1x.icon", + "system_menu_keyboard_brightness.icon", "system_menu_lock.1x.icon", "system_menu_lock.icon", "system_menu_mouse.1x.icon",
diff --git a/ash/resources/vector_icons/system_menu_keyboard_brightness.1x.icon b/ash/resources/vector_icons/system_menu_keyboard_brightness.1x.icon new file mode 100644 index 0000000..1b97e21 --- /dev/null +++ b/ash/resources/vector_icons/system_menu_keyboard_brightness.1x.icon
@@ -0,0 +1,60 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +CANVAS_DIMENSIONS, 20, +MOVE_TO, 0, 0, +R_H_LINE_TO, 20, +R_V_LINE_TO, 20, +H_LINE_TO, 0, +V_LINE_TO, 0, +CLOSE, +R_MOVE_TO, 0, 0, +R_H_LINE_TO, 20, +R_V_LINE_TO, 20, +H_LINE_TO, 0, +V_LINE_TO, 0, +CLOSE, +MOVE_TO, 6.95f, 13, +R_H_LINE_TO, 6.09f, +R_CUBIC_TO, 0.18f, 0, 0.35f, 0.11f, 0.43f, 0.28f, +R_LINE_TO, 0.48f, 1, +R_CUBIC_TO, 0.12f, 0.25f, 0.02f, 0.55f, -0.21f, 0.67f, +R_CUBIC_TO, -0.07f, 0.04f, -0.14f, 0.05f, -0.21f, 0.05f, +H_LINE_TO, 6.48f, +CUBIC_TO, 6.21f, 15, 6, 14.78f, 6, 14.5f, +R_CUBIC_TO, 0, -0.08f, 0.02f, -0.15f, 0.05f, -0.22f, +R_LINE_TO, 0.48f, -1, +R_CUBIC_TO, 0.08f, -0.17f, 0.25f, -0.28f, 0.43f, -0.28f, +CLOSE, +MOVE_TO, 6, 7.38f, +LINE_TO, 4.71f, 8.56f, +LINE_TO, 3.09f, 7.06f, +R_LINE_TO, 1.28f, -1.18f, +LINE_TO, 6, 7.38f, +CLOSE, +MOVE_TO, 3.46f, 11, +R_V_LINE_TO, 2, +H_LINE_TO, 1, +R_V_LINE_TO, -2, +R_H_LINE_TO, 2.46f, +CLOSE, +MOVE_TO, 11, 4, +R_V_LINE_TO, 2.22f, +H_LINE_TO, 9, +V_LINE_TO, 4, +R_H_LINE_TO, 2, +CLOSE, +R_MOVE_TO, 5.91f, 3.07f, +R_LINE_TO, -1.63f, 1.5f, +LINE_TO, 14, 7.38f, +R_LINE_TO, 1.63f, -1.5f, +R_LINE_TO, 1.28f, 1.18f, +CLOSE, +MOVE_TO, 16.54f, 11, +H_LINE_TO, 19, +R_V_LINE_TO, 2, +R_H_LINE_TO, -2.45f, +R_V_LINE_TO, -2, +CLOSE, +END
diff --git a/ash/resources/vector_icons/system_menu_keyboard_brightness.icon b/ash/resources/vector_icons/system_menu_keyboard_brightness.icon new file mode 100644 index 0000000..2316beb --- /dev/null +++ b/ash/resources/vector_icons/system_menu_keyboard_brightness.icon
@@ -0,0 +1,60 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +CANVAS_DIMENSIONS, 40, +MOVE_TO, 0, 0, +R_H_LINE_TO, 40, +R_V_LINE_TO, 40, +H_LINE_TO, 0, +V_LINE_TO, 0, +CLOSE, +R_MOVE_TO, 0, 0, +R_H_LINE_TO, 40, +R_V_LINE_TO, 40, +H_LINE_TO, 0, +V_LINE_TO, 0, +CLOSE, +MOVE_TO, 13.62f, 27, +R_H_LINE_TO, 12.76f, +R_CUBIC_TO, 0.38f, 0, 0.73f, 0.21f, 0.89f, 0.55f, +R_LINE_TO, 1, 2, +R_CUBIC_TO, 0.25f, 0.49f, 0.05f, 1.09f, -0.45f, 1.34f, +R_CUBIC_TO, -0.14f, 0.07f, -0.29f, 0.11f, -0.45f, 0.11f, +H_LINE_TO, 12.62f, +R_CUBIC_TO, -0.55f, 0, -1, -0.45f, -1, -1, +R_CUBIC_TO, 0, -0.15f, 0.04f, -0.31f, 0.11f, -0.45f, +R_LINE_TO, 1, -2, +R_CUBIC_TO, 0.17f, -0.34f, 0.52f, -0.55f, 0.89f, -0.55f, +CLOSE, +R_MOVE_TO, -1.72f, -11.54f, +R_LINE_TO, -2.19f, 2.12f, +LINE_TO, 6.94f, 14.89f, +R_LINE_TO, 2.18f, -2.12f, +R_LINE_TO, 2.78f, 2.7f, +CLOSE, +R_MOVE_TO, -4.27f, 8.53f, +V_LINE_TO, 27, +H_LINE_TO, 3, +R_V_LINE_TO, -3.01f, +R_H_LINE_TO, 4.64f, +CLOSE, +MOVE_TO, 21.55f, 9, +R_V_LINE_TO, 4.44f, +R_H_LINE_TO, -3.09f, +V_LINE_TO, 9, +R_H_LINE_TO, 3.09f, +CLOSE, +R_MOVE_TO, 11.51f, 5.89f, +R_LINE_TO, -2.77f, 2.7f, +R_LINE_TO, -2.18f, -2.12f, +R_LINE_TO, 2.77f, -2.7f, +R_LINE_TO, 2.18f, 2.12f, +CLOSE, +R_MOVE_TO, -0.7f, 9.1f, +H_LINE_TO, 37, +V_LINE_TO, 27, +R_H_LINE_TO, -4.64f, +R_V_LINE_TO, -3.01f, +CLOSE, +END
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc index a6e92da..e6aa47ef 100644 --- a/ash/shelf/shelf_layout_manager_unittest.cc +++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -1633,8 +1633,7 @@ window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); EXPECT_EQ(SHELF_BACKGROUND_MAXIMIZED, GetShelfWidget()->GetBackgroundType()); - Shell::Get()->lock_state_controller()->StartLockAnimationAndLockImmediately( - false); + Shell::Get()->lock_state_controller()->StartLockAnimationAndLockImmediately(); EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, GetShelfWidget()->GetBackgroundType()); }
diff --git a/ash/shutdown_controller.cc b/ash/shutdown_controller.cc index d9543f9..d4db1493 100644 --- a/ash/shutdown_controller.cc +++ b/ash/shutdown_controller.cc
@@ -4,8 +4,11 @@ #include "ash/shutdown_controller.h" +#include <utility> + #include "ash/shell.h" #include "ash/shell_delegate.h" +#include "ash/shutdown_reason.h" #include "base/sys_info.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power_manager_client.h" @@ -16,13 +19,18 @@ ShutdownController::~ShutdownController() {} -void ShutdownController::ShutDownOrReboot() { +void ShutdownController::ShutDownOrReboot(ShutdownReason reason) { // For developers on Linux desktop just exit the app. if (!base::SysInfo::IsRunningOnChromeOS()) { Shell::Get()->shell_delegate()->Exit(); return; } + if (reason == ShutdownReason::POWER_BUTTON) { + Shell::Get()->metrics()->RecordUserMetricsAction( + UMA_ACCEL_SHUT_DOWN_POWER_BUTTON); + } + // On real Chrome OS hardware the power manager handles shutdown. using chromeos::DBusThreadManager; if (reboot_on_shutdown_)
diff --git a/ash/shutdown_controller.h b/ash/shutdown_controller.h index c44e28a..d9bf176c 100644 --- a/ash/shutdown_controller.h +++ b/ash/shutdown_controller.h
@@ -13,6 +13,8 @@ namespace ash { +enum class ShutdownReason; + // Handles actual device shutdown by making requests to powerd over D-Bus. // Caches the DeviceRebootOnShutdown device policy sent from Chrome over mojo. class ASH_EXPORT ShutdownController @@ -26,7 +28,7 @@ // Shuts down or reboots based on the current DeviceRebootOnShutdown policy. // Does not trigger the shutdown fade-out animation. For animated shutdown // use ShellPort::RequestShutdown(). Virtual for testing. - virtual void ShutDownOrReboot(); + virtual void ShutDownOrReboot(ShutdownReason reason); // Binds the mojom::ShutdownController interface request to this object. void BindRequest(mojom::ShutdownControllerRequest request);
diff --git a/ash/shutdown_reason.h b/ash/shutdown_reason.h new file mode 100644 index 0000000..03085b4 --- /dev/null +++ b/ash/shutdown_reason.h
@@ -0,0 +1,19 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_SHUTDOWN_REASON_H_ +#define ASH_SHUTDOWN_REASON_H_ + +namespace ash { + +enum class ShutdownReason { + UNKNOWN, // Reason unknown or not applicable. + POWER_BUTTON, // User pressed the (physical) power button. + LOGIN_SHUT_DOWN_BUTTON, // User pressed the login screen shut down button. + TRAY_SHUT_DOWN_BUTTON, // User pressed the tray shut down button. +}; + +} // namespace ash + +#endif // ASH_SHUTDOWN_REASON_H_
diff --git a/ash/system/ime_menu/ime_menu_tray.cc b/ash/system/ime_menu/ime_menu_tray.cc index 0942091..df15493 100644 --- a/ash/system/ime_menu/ime_menu_tray.cc +++ b/ash/system/ime_menu/ime_menu_tray.cc
@@ -176,11 +176,13 @@ // The view that contains buttons shown on the bottom of IME menu. class ImeButtonsView : public views::View, public views::ButtonListener { public: - explicit ImeButtonsView(ImeMenuTray* ime_menu_tray) - : ime_menu_tray_(ime_menu_tray) { + ImeButtonsView(ImeMenuTray* ime_menu_tray, + bool show_emoji, + bool show_handwriting, + bool show_voice) { DCHECK(ime_menu_tray_); - Init(); + Init(show_emoji, show_handwriting, show_voice); } ~ImeButtonsView() override {} @@ -214,7 +216,7 @@ } private: - void Init() { + void Init(bool show_emoji, bool show_handwriting, bool show_voice) { auto* box_layout = new views::BoxLayout(views::BoxLayout::kHorizontal); box_layout->set_minimum_cross_axis_size(kTrayPopupItemMinHeight); SetLayoutManager(box_layout); @@ -225,20 +227,26 @@ kMenuExtraMarginFromLeftEdge))); const int right_border = 1; - emoji_button_ = - CreateImeMenuButton(this, kImeMenuEmoticonIcon, - IDS_ASH_STATUS_TRAY_IME_EMOJI, right_border); - AddChildView(emoji_button_); + if (show_emoji) { + emoji_button_ = + CreateImeMenuButton(this, kImeMenuEmoticonIcon, + IDS_ASH_STATUS_TRAY_IME_EMOJI, right_border); + AddChildView(emoji_button_); + } - handwriting_button_ = - CreateImeMenuButton(this, kImeMenuWriteIcon, - IDS_ASH_STATUS_TRAY_IME_HANDWRITING, right_border); - AddChildView(handwriting_button_); + if (show_handwriting) { + handwriting_button_ = CreateImeMenuButton( + this, kImeMenuWriteIcon, IDS_ASH_STATUS_TRAY_IME_HANDWRITING, + right_border); + AddChildView(handwriting_button_); + } - voice_button_ = - CreateImeMenuButton(this, kImeMenuMicrophoneIcon, - IDS_ASH_STATUS_TRAY_IME_VOICE, right_border); - AddChildView(voice_button_); + if (show_voice) { + voice_button_ = + CreateImeMenuButton(this, kImeMenuMicrophoneIcon, + IDS_ASH_STATUS_TRAY_IME_VOICE, right_border); + AddChildView(voice_button_); + } settings_button_ = CreateImeMenuButton(this, kSystemMenuSettingsIcon, IDS_ASH_STATUS_TRAY_IME_SETTINGS, 0); @@ -286,6 +294,9 @@ force_show_keyboard_(false), keyboard_suppressed_(false), show_bubble_after_keyboard_hidden_(false), + emoji_enabled_(false), + handwriting_enabled_(false), + voice_enabled_(false), weak_ptr_factory_(this) { DCHECK(ime_controller_); SetInkDropMode(InkDropMode::ON); @@ -336,8 +347,8 @@ bubble_view->set_anchor_view_insets(GetBubbleAnchorInsets()); // Add a title item with a separator on the top of the IME menu. - bubble_view->AddChildView( - new ImeTitleView(!ShouldShowEmojiHandwritingVoiceButtons())); + bool show_bottom_buttons = ShouldShowBottomButtons(); + bubble_view->AddChildView(new ImeTitleView(!show_bottom_buttons)); // Adds IME list to the bubble. ime_list_view_ = new ImeMenuListView(nullptr); @@ -345,8 +356,10 @@ ImeListView::SHOW_SINGLE_IME); bubble_view->AddChildView(ime_list_view_); - if (ShouldShowEmojiHandwritingVoiceButtons()) - bubble_view->AddChildView(new ImeButtonsView(this)); + if (show_bottom_buttons) { + bubble_view->AddChildView(new ImeButtonsView( + this, emoji_enabled_, handwriting_enabled_, voice_enabled_)); + } bubble_.reset(new TrayBubbleWrapper(this, bubble_view)); SetIsActive(true); @@ -404,16 +417,31 @@ } } -bool ImeMenuTray::ShouldShowEmojiHandwritingVoiceButtons() const { +bool ImeMenuTray::ShouldShowBottomButtons() { // Emoji, handwriting and voice input is not supported for these cases: // 1) features::kEHVInputOnImeMenu is not enabled. // 2) third party IME extensions. // 3) login/lock screen. // 4) password input client. - return InputMethodManager::Get() && - InputMethodManager::Get()->IsEmojiHandwritingVoiceOnImeMenuEnabled() && - !ime_controller_->current_ime().third_party && - !IsInLoginOrLockScreen() && !IsInPasswordInputContext(); + InputMethodManager* input_method_manager = InputMethodManager::Get(); + bool should_show_buttom_buttoms = + input_method_manager && + input_method_manager->IsEmojiHandwritingVoiceOnImeMenuEnabled() && + !ime_controller_->current_ime().third_party && !IsInLoginOrLockScreen() && + !IsInPasswordInputContext(); + + if (!should_show_buttom_buttoms) { + emoji_enabled_ = handwriting_enabled_ = voice_enabled_ = false; + return false; + } + + emoji_enabled_ = input_method_manager->GetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_EMOJI); + handwriting_enabled_ = input_method_manager->GetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_HANDWRITING); + voice_enabled_ = input_method_manager->GetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_VOICE); + return emoji_enabled_ || handwriting_enabled_ || voice_enabled_; } bool ImeMenuTray::ShouldShowKeyboardToggle() const {
diff --git a/ash/system/ime_menu/ime_menu_tray.h b/ash/system/ime_menu/ime_menu_tray.h index 27351b6c..ac4f3761 100644 --- a/ash/system/ime_menu/ime_menu_tray.h +++ b/ash/system/ime_menu/ime_menu_tray.h
@@ -52,7 +52,7 @@ // Returns true if the menu should show emoji, handwriting and voice buttons // on the bottom. Otherwise, the menu will show a 'Customize...' bottom row // for non-MD UI, and a Settings button in the title row for MD. - bool ShouldShowEmojiHandwritingVoiceButtons() const; + bool ShouldShowBottomButtons(); // Returns whether the virtual keyboard toggle should be shown in shown in the // opt-in IME menu. @@ -112,6 +112,9 @@ bool force_show_keyboard_; bool keyboard_suppressed_; bool show_bubble_after_keyboard_hidden_; + bool emoji_enabled_; + bool handwriting_enabled_; + bool voice_enabled_; base::WeakPtrFactory<ImeMenuTray> weak_ptr_factory_;
diff --git a/ash/system/ime_menu/ime_menu_tray_unittest.cc b/ash/system/ime_menu/ime_menu_tray_unittest.cc index a73eb10..fde99c0 100644 --- a/ash/system/ime_menu/ime_menu_tray_unittest.cc +++ b/ash/system/ime_menu/ime_menu_tray_unittest.cc
@@ -24,6 +24,8 @@ #include "ui/views/controls/label.h" using base::UTF8ToUTF16; +using chromeos::input_method::InputMethodManager; +using chromeos::input_method::MockInputMethodManager; namespace ash { namespace { @@ -62,6 +64,15 @@ // Returns true if the IME menu bubble has been shown. bool IsBubbleShown() { return GetTray()->IsImeMenuBubbleShown(); } + // Returns true if emoji palatte is enabled for the current keyboard. + bool IsEmojiEnabled() { return GetTray()->emoji_enabled_; } + + // Returns true if handwirting input is enabled for the current keyboard. + bool IsHandwritingEnabled() { return GetTray()->handwriting_enabled_; } + + // Returns true if voice input is enabled for the current keyboard. + bool IsVoiceEnabled() { return GetTray()->voice_enabled_; } + // Verifies the IME menu list has been updated with the right IME list. void ExpectValidImeList(const std::vector<mojom::ImeInfo>& expected_imes, const mojom::ImeInfo& expected_current_ime) { @@ -299,22 +310,72 @@ EXPECT_FALSE(accessibility_delegate->IsVirtualKeyboardEnabled()); } -TEST_F(ImeMenuTrayTest, ShowEmojiHandwritingVoiceButtons) { +TEST_F(ImeMenuTrayTest, ShouldShowBottomButtons) { FocusInInputContext(ui::TEXT_INPUT_TYPE_TEXT); - EXPECT_FALSE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons()); + EXPECT_FALSE(GetTray()->ShouldShowBottomButtons()); + EXPECT_FALSE(IsEmojiEnabled()); + EXPECT_FALSE(IsHandwritingEnabled()); + EXPECT_FALSE(IsVoiceEnabled()); - chromeos::input_method::InputMethodManager* input_method_manager = - chromeos::input_method::InputMethodManager::Get(); + InputMethodManager* input_method_manager = InputMethodManager::Get(); EXPECT_FALSE(input_method_manager); - chromeos::input_method::InputMethodManager::Initialize( - new chromeos::input_method::MockInputMethodManager); - input_method_manager = chromeos::input_method::InputMethodManager::Get(); + InputMethodManager::Initialize(new MockInputMethodManager); + input_method_manager = InputMethodManager::Get(); EXPECT_TRUE(input_method_manager && input_method_manager->IsEmojiHandwritingVoiceOnImeMenuEnabled()); - EXPECT_TRUE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons()); + EXPECT_TRUE(input_method_manager->GetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_EMOJI)); + EXPECT_TRUE(input_method_manager->GetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_HANDWRITING)); + EXPECT_TRUE(input_method_manager->GetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_VOICE)); + EXPECT_TRUE(GetTray()->ShouldShowBottomButtons()); + EXPECT_TRUE(IsEmojiEnabled()); + EXPECT_TRUE(IsHandwritingEnabled()); + EXPECT_TRUE(IsVoiceEnabled()); FocusInInputContext(ui::TEXT_INPUT_TYPE_PASSWORD); - EXPECT_FALSE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons()); + EXPECT_FALSE(GetTray()->ShouldShowBottomButtons()); + EXPECT_FALSE(IsEmojiEnabled()); + EXPECT_FALSE(IsHandwritingEnabled()); + EXPECT_FALSE(IsVoiceEnabled()); +} + +TEST_F(ImeMenuTrayTest, ShouldShowBottomButtonsSeperate) { + FocusInInputContext(ui::TEXT_INPUT_TYPE_TEXT); + InputMethodManager* input_method_manager = InputMethodManager::Get(); + InputMethodManager::Initialize(new MockInputMethodManager); + input_method_manager = InputMethodManager::Get(); + EXPECT_TRUE(input_method_manager && + input_method_manager->IsEmojiHandwritingVoiceOnImeMenuEnabled()); + + // Sets emoji disabled. + input_method_manager->SetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_EMOJI, false); + EXPECT_FALSE(input_method_manager->GetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_EMOJI)); + EXPECT_TRUE(GetTray()->ShouldShowBottomButtons()); + EXPECT_FALSE(IsEmojiEnabled()); + EXPECT_TRUE(IsHandwritingEnabled()); + EXPECT_TRUE(IsVoiceEnabled()); + + // Sets emoji enabled, but voice and handwriting disabled. + input_method_manager->SetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_EMOJI, true); + input_method_manager->SetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_VOICE, false); + input_method_manager->SetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_HANDWRITING, false); + EXPECT_TRUE(input_method_manager->GetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_EMOJI)); + EXPECT_FALSE(input_method_manager->GetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_VOICE)); + EXPECT_FALSE(input_method_manager->GetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_HANDWRITING)); + EXPECT_TRUE(GetTray()->ShouldShowBottomButtons()); + EXPECT_TRUE(IsEmojiEnabled()); + EXPECT_FALSE(IsHandwritingEnabled()); + EXPECT_FALSE(IsVoiceEnabled()); } } // namespace ash
diff --git a/ash/system/keyboard_brightness/tray_keyboard_brightness.cc b/ash/system/keyboard_brightness/tray_keyboard_brightness.cc new file mode 100644 index 0000000..2a13dc8c --- /dev/null +++ b/ash/system/keyboard_brightness/tray_keyboard_brightness.cc
@@ -0,0 +1,164 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/system/keyboard_brightness/tray_keyboard_brightness.h" + +#include <algorithm> + +#include "ash/resources/vector_icons/vector_icons.h" +#include "ash/shell.h" +#include "ash/shell_observer.h" +#include "ash/shell_port.h" +#include "ash/strings/grit/ash_strings.h" +#include "ash/system/keyboard_brightness_control_delegate.h" +#include "ash/system/tray/tray_constants.h" +#include "ash/system/tray/tray_popup_utils.h" +#include "ash/system/tray/tri_view.h" +#include "base/bind.h" +#include "base/strings/utf_string_conversions.h" +#include "base/threading/thread_task_runner_handle.h" +#include "chromeos/dbus/dbus_thread_manager.h" +#include "chromeos/dbus/power_manager_client.h" +#include "ui/base/resource/resource_bundle.h" +#include "ui/display/display.h" +#include "ui/gfx/image/image.h" +#include "ui/gfx/paint_vector_icon.h" +#include "ui/views/border.h" +#include "ui/views/controls/image_view.h" +#include "ui/views/controls/label.h" +#include "ui/views/controls/slider.h" +#include "ui/views/layout/fill_layout.h" +#include "ui/views/view.h" + +namespace ash { +namespace tray { + +namespace { + +// A slider that ignores inputs. +class ReadOnlySlider : public views::Slider { + public: + ReadOnlySlider() : Slider(nullptr) {} + + private: + // views::View: + bool OnMousePressed(const ui::MouseEvent& event) override { return false; } + bool OnMouseDragged(const ui::MouseEvent& event) override { return false; } + void OnMouseReleased(const ui::MouseEvent& event) override {} + bool OnKeyPressed(const ui::KeyEvent& event) override { return false; } + + // ui::EventHandler: + void OnGestureEvent(ui::GestureEvent* event) override {} +}; + +} // namespace + +class KeyboardBrightnessView : public ShellObserver, public views::View { + public: + explicit KeyboardBrightnessView(double initial_percent); + + // |percent| is in the range [0.0, 100.0]. + void SetKeyboardBrightnessPercent(double percent); + + // ShellObserver: + void OnMaximizeModeStarted() override; + void OnMaximizeModeEnded() override; + + private: + // views::View: + void OnBoundsChanged(const gfx::Rect& old_bounds) override; + + ReadOnlySlider* slider_; + + DISALLOW_COPY_AND_ASSIGN(KeyboardBrightnessView); +}; + +KeyboardBrightnessView::KeyboardBrightnessView(double initial_percent) { + SetLayoutManager(new views::FillLayout); + // Use CreateMultiTargetRowView() instead of CreateDefaultRowView() because + // that's what the audio row uses and we want the two rows to layout with the + // same insets. + TriView* tri_view = TrayPopupUtils::CreateMultiTargetRowView(); + AddChildView(tri_view); + + ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); + views::ImageView* icon = TrayPopupUtils::CreateMainImageView(); + icon->SetImage( + gfx::CreateVectorIcon(kSystemMenuKeyboardBrightnessIcon, kMenuIconColor)); + tri_view->AddView(TriView::Container::START, icon); + + slider_ = new ReadOnlySlider(); + slider_->SetBorder(views::CreateEmptyBorder( + gfx::Insets(0, kTrayPopupSliderHorizontalPadding))); + slider_->SetValue(static_cast<float>(initial_percent / 100.0)); + slider_->SetAccessibleName( + rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_KEYBOARD_BRIGHTNESS)); + tri_view->AddView(TriView::Container::CENTER, slider_); + tri_view->SetContainerVisible(TriView::Container::END, false); +} + +void KeyboardBrightnessView::SetKeyboardBrightnessPercent(double percent) { + slider_->SetValue(static_cast<float>(percent / 100.0)); +} + +void KeyboardBrightnessView::OnMaximizeModeStarted() { + SetVisible(true); +} + +void KeyboardBrightnessView::OnMaximizeModeEnded() { + SetVisible(false); +} + +void KeyboardBrightnessView::OnBoundsChanged(const gfx::Rect& old_bounds) { + int w = width() - slider_->x(); + slider_->SetSize(gfx::Size(w, slider_->height())); +} + +} // namespace tray + +TrayKeyboardBrightness::TrayKeyboardBrightness(SystemTray* system_tray) + : SystemTrayItem(system_tray, UMA_DISPLAY_BRIGHTNESS), + weak_ptr_factory_(this) { + chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver( + this); +} + +TrayKeyboardBrightness::~TrayKeyboardBrightness() { + chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver( + this); +} + +views::View* TrayKeyboardBrightness::CreateDetailedView(LoginStatus status) { + CHECK(!brightness_view_); + brightness_view_ = new tray::KeyboardBrightnessView(current_percent_); + return brightness_view_; +} + +void TrayKeyboardBrightness::OnDetailedViewDestroyed() { + brightness_view_ = nullptr; +} + +void TrayKeyboardBrightness::UpdateAfterLoginStatusChange(LoginStatus status) {} + +bool TrayKeyboardBrightness::ShouldShowShelf() const { + return false; +} + +void TrayKeyboardBrightness::KeyboardBrightnessChanged(int level, + bool user_initiated) { + current_percent_ = static_cast<double>(level); + + if (brightness_view_) + brightness_view_->SetKeyboardBrightnessPercent(current_percent_); + + if (!user_initiated) + return; + + if (brightness_view_ && brightness_view_->visible()) + SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); + else + ShowDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); +} + +} // namespace ash
diff --git a/ash/system/keyboard_brightness/tray_keyboard_brightness.h b/ash/system/keyboard_brightness/tray_keyboard_brightness.h new file mode 100644 index 0000000..31ad86c --- /dev/null +++ b/ash/system/keyboard_brightness/tray_keyboard_brightness.h
@@ -0,0 +1,52 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_SYSTEM_KEYBOARD_BRIGHTNESS_TRAY_KEYBOARD_BRIGHTNESS_H_ +#define ASH_SYSTEM_KEYBOARD_BRIGHTNESS_TRAY_KEYBOARD_BRIGHTNESS_H_ + +#include "ash/system/tray/system_tray_item.h" +#include "base/macros.h" +#include "base/memory/weak_ptr.h" +#include "chromeos/dbus/power_manager_client.h" + +namespace ash { +namespace tray { +class KeyboardBrightnessView; +} + +// Manages a detailed view containing a readonly slider for the keyboard +// backlight brightness. This is used in a bubble and not displayed elsewhere. +class ASH_EXPORT TrayKeyboardBrightness + : public SystemTrayItem, + public chromeos::PowerManagerClient::Observer { + public: + explicit TrayKeyboardBrightness(SystemTray* system_tray); + ~TrayKeyboardBrightness() override; + + private: + friend class TrayKeyboardBrightnessTest; + + // Overridden from SystemTrayItem. + views::View* CreateDetailedView(LoginStatus status) override; + void OnDetailedViewDestroyed() override; + void UpdateAfterLoginStatusChange(LoginStatus status) override; + bool ShouldShowShelf() const override; + + // Overriden from PowerManagerClient::Observer. + void KeyboardBrightnessChanged(int level, bool user_initiated) override; + + tray::KeyboardBrightnessView* brightness_view_ = nullptr; + + // Keyboard brightness level in the range [0.0, 100.0] that we've heard about + // most recently. + double current_percent_ = 100.0; + + base::WeakPtrFactory<TrayKeyboardBrightness> weak_ptr_factory_; + + DISALLOW_COPY_AND_ASSIGN(TrayKeyboardBrightness); +}; + +} // namespace ash + +#endif // ASH_SYSTEM_KEYBOARD_BRIGHTNESS_TRAY_KEYBOARD_BRIGHTNESS_H_
diff --git a/ash/system/keyboard_brightness/tray_keyboard_brightness_unittest.cc b/ash/system/keyboard_brightness/tray_keyboard_brightness_unittest.cc new file mode 100644 index 0000000..ecc0383a --- /dev/null +++ b/ash/system/keyboard_brightness/tray_keyboard_brightness_unittest.cc
@@ -0,0 +1,65 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/system/keyboard_brightness/tray_keyboard_brightness.h" + +#include <memory> + +#include "ash/shell.h" +#include "ash/system/tray/system_tray_delegate.h" +#include "ash/system/tray/system_tray_item.h" +#include "ash/test/ash_test_base.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" +#include "ui/views/view.h" + +namespace ash { + +class TrayKeyboardBrightnessTest : public test::AshTestBase { + public: + TrayKeyboardBrightnessTest() {} + ~TrayKeyboardBrightnessTest() override {} + + protected: + views::View* CreateDetailedView() { + TrayKeyboardBrightness tray(nullptr); + // The login status doesn't matter here; supply any random value. + return tray.CreateDetailedView(LoginStatus::USER); + } + + private: + DISALLOW_COPY_AND_ASSIGN(TrayKeyboardBrightnessTest); +}; + +// Tests that when the detailed view is initially created that its +// KeyboardBrightnessView is created as visible. +TEST_F(TrayKeyboardBrightnessTest, CreateDetailedView) { + std::unique_ptr<views::View> tray(CreateDetailedView()); + EXPECT_TRUE(tray->visible()); +} + +// Tests that when the detailed view is created during MaximizeMode that its +// KeyboardBrightnessView is visible. +TEST_F(TrayKeyboardBrightnessTest, CreateDetailedViewDuringMaximizeMode) { + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); + std::unique_ptr<views::View> tray(CreateDetailedView()); + EXPECT_TRUE(tray->visible()); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); +} + +// Tests that the enabling of MaximizeMode has no affect on the visibility of a +// previously created KeyboardBrightnessView that belongs to a detailed view. +TEST_F(TrayKeyboardBrightnessTest, + DetailedViewVisibilityChangesDuringMaximizeMode) { + std::unique_ptr<views::View> tray(CreateDetailedView()); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); + EXPECT_TRUE(tray->visible()); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); + EXPECT_TRUE(tray->visible()); +} + +} // namespace ash
diff --git a/ash/system/night_light/night_light_controller.cc b/ash/system/night_light/night_light_controller.cc index e84b5ce..8578c8c1 100644 --- a/ash/system/night_light/night_light_controller.cc +++ b/ash/system/night_light/night_light_controller.cc
@@ -30,11 +30,13 @@ // The duration of the temperature change animation for // AnimationDurationType::kShort. -constexpr int kManualAnimationDurationSec = 2; +constexpr base::TimeDelta kManualAnimationDuration = + base::TimeDelta::FromSeconds(1); // The duration of the temperature change animation for // AnimationDurationType::kLong. -constexpr int kAutomaticAnimationDurationSec = 20; +constexpr base::TimeDelta kAutomaticAnimationDuration = + base::TimeDelta::FromSeconds(20); class NightLightControllerDelegateImpl : public NightLightController::Delegate { public: @@ -259,12 +261,10 @@ } void NightLightController::RefreshLayersTemperature() { - ApplyColorTemperatureToLayers( - GetEnabled() ? GetColorTemperature() : 0.0f, - base::TimeDelta::FromSeconds(animation_duration_ == - AnimationDuration::kShort - ? kManualAnimationDurationSec - : kAutomaticAnimationDurationSec)); + ApplyColorTemperatureToLayers(GetEnabled() ? GetColorTemperature() : 0.0f, + animation_duration_ == AnimationDuration::kShort + ? kManualAnimationDuration + : kAutomaticAnimationDuration); // Reset the animation type back to manual to consume any automatically set // animations.
diff --git a/ash/system/power/tablet_power_button_controller.cc b/ash/system/power/tablet_power_button_controller.cc index fafda54..8ca8cfa 100644 --- a/ash/system/power/tablet_power_button_controller.cc +++ b/ash/system/power/tablet_power_button_controller.cc
@@ -9,6 +9,7 @@ #include "ash/session/session_controller.h" #include "ash/shell.h" #include "ash/shell_delegate.h" +#include "ash/shutdown_reason.h" #include "ash/wm/lock_state_controller.h" #include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "base/command_line.h" @@ -451,7 +452,7 @@ } void TabletPowerButtonController::OnShutdownTimeout() { - controller_->StartShutdownAnimation(); + controller_->StartShutdownAnimation(ShutdownReason::POWER_BUTTON); } void TabletPowerButtonController::LockScreenIfRequired() {
diff --git a/ash/system/tiles/tiles_default_view.cc b/ash/system/tiles/tiles_default_view.cc index d5cfdc40..9b5bd50 100644 --- a/ash/system/tiles/tiles_default_view.cc +++ b/ash/system/tiles/tiles_default_view.cc
@@ -10,6 +10,7 @@ #include "ash/session/session_controller.h" #include "ash/shell.h" #include "ash/shutdown_controller.h" +#include "ash/shutdown_reason.h" #include "ash/strings/grit/ash_strings.h" #include "ash/system/night_light/night_light_controller.h" #include "ash/system/night_light/night_light_toggle_button.h" @@ -134,7 +135,8 @@ ->RequestLockScreen(); } else if (sender == power_button_) { Shell::Get()->metrics()->RecordUserMetricsAction(UMA_TRAY_SHUT_DOWN); - Shell::Get()->lock_state_controller()->RequestShutdown(); + Shell::Get()->lock_state_controller()->RequestShutdown( + ShutdownReason::TRAY_SHUT_DOWN_BUTTON); } }
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc index 77cc034..3f7634f7 100644 --- a/ash/system/tray/system_tray.cc +++ b/ash/system/tray/system_tray.cc
@@ -28,6 +28,7 @@ #include "ash/system/display_scale/tray_scale.h" #include "ash/system/enterprise/tray_enterprise.h" #include "ash/system/ime/tray_ime_chromeos.h" +#include "ash/system/keyboard_brightness/tray_keyboard_brightness.h" #include "ash/system/media_security/multi_profile_media_tray_item.h" #include "ash/system/network/tray_network.h" #include "ash/system/network/tray_vpn.h" @@ -265,6 +266,7 @@ tray_scale_ = new TrayScale(this); AddTrayItem(base::WrapUnique(tray_scale_)); AddTrayItem(base::MakeUnique<TrayBrightness>(this)); + AddTrayItem(base::MakeUnique<TrayKeyboardBrightness>(this)); AddTrayItem(base::MakeUnique<TrayCapsLock>(this)); if (NightLightController::IsFeatureEnabled()) { tray_night_light_ = new TrayNightLight(this);
diff --git a/ash/system/tray/tray_constants.cc b/ash/system/tray/tray_constants.cc index 77ce01f..eb6cdae 100644 --- a/ash/system/tray/tray_constants.cc +++ b/ash/system/tray/tray_constants.cc
@@ -47,6 +47,7 @@ const int kTrayPopupPaddingBetweenItems = 10; const int kTrayPopupButtonEndMargin = 10; const int kTrayPopupLabelHorizontalPadding = 4; +const int kTrayPopupSliderHorizontalPadding = 16; const int kTrayPopupItemMinHeight = 48; const int kTrayPopupItemMinStartWidth = 48; const int kTrayPopupItemMinEndWidth =
diff --git a/ash/system/tray/tray_constants.h b/ash/system/tray/tray_constants.h index 620cfec..dd0c18d1 100644 --- a/ash/system/tray/tray_constants.h +++ b/ash/system/tray/tray_constants.h
@@ -49,10 +49,15 @@ extern const int kTrayPopupPaddingHorizontal; extern const int kTrayPopupPaddingBetweenItems; extern const int kTrayPopupButtonEndMargin; + // The padding used on the left and right of labels. This applies to all labels // in the system menu. extern const int kTrayPopupLabelHorizontalPadding; +// The horizontal padding used to properly lay out a slider in a TriView +// container with a FillLayout (such as a volume notification bubble). +extern const int kTrayPopupSliderHorizontalPadding; + // The minimum/default height of the rows in the system tray menu. extern const int kTrayPopupItemMinHeight;
diff --git a/ash/system/tray/tray_popup_utils.cc b/ash/system/tray/tray_popup_utils.cc index 6b7c328..0f987e7 100644 --- a/ash/system/tray/tray_popup_utils.cc +++ b/ash/system/tray/tray_popup_utils.cc
@@ -235,7 +235,8 @@ views::Slider* TrayPopupUtils::CreateSlider(views::SliderListener* listener) { views::Slider* slider = new views::Slider(listener); - slider->SetBorder(views::CreateEmptyBorder(gfx::Insets(0, 16))); + slider->SetBorder(views::CreateEmptyBorder( + gfx::Insets(0, kTrayPopupSliderHorizontalPadding))); return slider; }
diff --git a/ash/system/tray_accessibility.cc b/ash/system/tray_accessibility.cc index 331c990..76364e60 100644 --- a/ash/system/tray_accessibility.cc +++ b/ash/system/tray_accessibility.cc
@@ -9,7 +9,6 @@ #include "ash/accessibility_delegate.h" #include "ash/accessibility_types.h" -#include "ash/metrics/user_metrics_recorder.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/session/session_controller.h" #include "ash/shell.h" @@ -24,6 +23,7 @@ #include "ash/system/tray/tray_item_more.h" #include "ash/system/tray/tray_popup_utils.h" #include "ash/system/tray/tri_view.h" +#include "base/metrics/user_metrics.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/image/image.h" #include "ui/gfx/paint_vector_icon.h" @@ -232,73 +232,73 @@ void AccessibilityDetailedView::HandleViewClicked(views::View* view) { AccessibilityDelegate* delegate = Shell::Get()->accessibility_delegate(); - UserMetricsAction user_action; + using base::RecordAction; + using base::UserMetricsAction; if (view == spoken_feedback_view_) { - user_action = delegate->IsSpokenFeedbackEnabled() - ? UMA_STATUS_AREA_DISABLE_SPOKEN_FEEDBACK - : UMA_STATUS_AREA_ENABLE_SPOKEN_FEEDBACK; + RecordAction(delegate->IsSpokenFeedbackEnabled() + ? UserMetricsAction("StatusArea_SpokenFeedbackDisabled") + : UserMetricsAction("StatusArea_SpokenFeedbackEnabled")); delegate->ToggleSpokenFeedback(A11Y_NOTIFICATION_NONE); } else if (view == high_contrast_view_) { - user_action = delegate->IsHighContrastEnabled() - ? UMA_STATUS_AREA_DISABLE_HIGH_CONTRAST - : UMA_STATUS_AREA_ENABLE_HIGH_CONTRAST; + RecordAction(delegate->IsHighContrastEnabled() + ? UserMetricsAction("StatusArea_HighContrastDisabled") + : UserMetricsAction("StatusArea_HighContrastEnabled")); delegate->ToggleHighContrast(); } else if (view == screen_magnifier_view_) { - user_action = delegate->IsMagnifierEnabled() - ? UMA_STATUS_AREA_DISABLE_MAGNIFIER - : UMA_STATUS_AREA_ENABLE_MAGNIFIER; + RecordAction(delegate->IsMagnifierEnabled() + ? UserMetricsAction("StatusArea_MagnifierDisabled") + : UserMetricsAction("StatusArea_MagnifierEnabled")); delegate->SetMagnifierEnabled(!delegate->IsMagnifierEnabled()); } else if (large_cursor_view_ && view == large_cursor_view_) { - user_action = delegate->IsLargeCursorEnabled() - ? UMA_STATUS_AREA_DISABLE_LARGE_CURSOR - : UMA_STATUS_AREA_ENABLE_LARGE_CURSOR; + RecordAction(delegate->IsLargeCursorEnabled() + ? UserMetricsAction("StatusArea_LargeCursorDisabled") + : UserMetricsAction("StatusArea_LargeCursorEnabled")); delegate->SetLargeCursorEnabled(!delegate->IsLargeCursorEnabled()); } else if (autoclick_view_ && view == autoclick_view_) { - user_action = delegate->IsAutoclickEnabled() - ? UMA_STATUS_AREA_DISABLE_AUTO_CLICK - : UMA_STATUS_AREA_ENABLE_AUTO_CLICK; + RecordAction(delegate->IsAutoclickEnabled() + ? UserMetricsAction("StatusArea_AutoClickDisabled") + : UserMetricsAction("StatusArea_AutoClickEnabled")); delegate->SetAutoclickEnabled(!delegate->IsAutoclickEnabled()); } else if (virtual_keyboard_view_ && view == virtual_keyboard_view_) { - user_action = delegate->IsVirtualKeyboardEnabled() - ? UMA_STATUS_AREA_DISABLE_VIRTUAL_KEYBOARD - : UMA_STATUS_AREA_ENABLE_VIRTUAL_KEYBOARD; + RecordAction(delegate->IsVirtualKeyboardEnabled() + ? UserMetricsAction("StatusArea_VirtualKeyboardDisabled") + : UserMetricsAction("StatusArea_VirtualKeyboardEnabled")); delegate->SetVirtualKeyboardEnabled(!delegate->IsVirtualKeyboardEnabled()); } else if (caret_highlight_view_ && view == caret_highlight_view_) { - user_action = delegate->IsCaretHighlightEnabled() - ? UMA_STATUS_AREA_DISABLE_CARET_HIGHLIGHT - : UMA_STATUS_AREA_ENABLE_CARET_HIGHLIGHT; + RecordAction(delegate->IsCaretHighlightEnabled() + ? UserMetricsAction("StatusArea_CaretHighlightDisabled") + : UserMetricsAction("StatusArea_CaretHighlightEnabled")); delegate->SetCaretHighlightEnabled(!delegate->IsCaretHighlightEnabled()); } else if (mono_audio_view_ && view == mono_audio_view_) { - user_action = delegate->IsMonoAudioEnabled() - ? UMA_STATUS_AREA_DISABLE_MONO_AUDIO - : UMA_STATUS_AREA_ENABLE_MONO_AUDIO; + RecordAction(delegate->IsMonoAudioEnabled() + ? UserMetricsAction("StatusArea_MonoAudioDisabled") + : UserMetricsAction("StatusArea_MonoAudioEnabled")); delegate->SetMonoAudioEnabled(!delegate->IsMonoAudioEnabled()); } else if (highlight_mouse_cursor_view_ && view == highlight_mouse_cursor_view_) { - user_action = delegate->IsCursorHighlightEnabled() - ? UMA_STATUS_AREA_DISABLE_HIGHLIGHT_MOUSE_CURSOR - : UMA_STATUS_AREA_ENABLE_HIGHLIGHT_MOUSE_CURSOR; + RecordAction( + delegate->IsCursorHighlightEnabled() + ? UserMetricsAction("StatusArea_HighlightMouseCursorDisabled") + : UserMetricsAction("StatusArea_HighlightMouseCursorEnabled")); delegate->SetCursorHighlightEnabled(!delegate->IsCursorHighlightEnabled()); } else if (highlight_keyboard_focus_view_ && view == highlight_keyboard_focus_view_) { - user_action = delegate->IsFocusHighlightEnabled() - ? UMA_STATUS_AREA_DISABLE_HIGHLIGHT_KEYBOARD_FOCUS - : UMA_STATUS_AREA_ENABLE_HIGHLIGHT_KEYBOARD_FOCUS; + RecordAction( + delegate->IsFocusHighlightEnabled() + ? UserMetricsAction("StatusArea_HighlightKeyboardFocusDisabled") + : UserMetricsAction("StatusArea_HighlightKeyboardFocusEnabled")); delegate->SetFocusHighlightEnabled(!delegate->IsFocusHighlightEnabled()); } else if (sticky_keys_view_ && view == sticky_keys_view_) { - user_action = delegate->IsStickyKeysEnabled() - ? UMA_STATUS_AREA_DISABLE_STICKY_KEYS - : UMA_STATUS_AREA_ENABLE_STICKY_KEYS; + RecordAction(delegate->IsStickyKeysEnabled() + ? UserMetricsAction("StatusArea_StickyKeysDisabled") + : UserMetricsAction("StatusArea_StickyKeysEnabled")); delegate->SetStickyKeysEnabled(!delegate->IsStickyKeysEnabled()); } else if (tap_dragging_view_ && view == tap_dragging_view_) { - user_action = delegate->IsTapDraggingEnabled() - ? UMA_STATUS_AREA_DISABLE_TAP_DRAGGING - : UMA_STATUS_AREA_ENABLE_TAP_DRAGGING; + RecordAction(delegate->IsTapDraggingEnabled() + ? UserMetricsAction("StatusArea_TapDraggingDisabled") + : UserMetricsAction("StatusArea_TapDraggingEnabled")); delegate->SetTapDraggingEnabled(!delegate->IsTapDraggingEnabled()); - } else { - return; } - Shell::Get()->metrics()->RecordUserMetricsAction(user_action); } void AccessibilityDetailedView::HandleButtonPressed(views::Button* sender,
diff --git a/ash/wm/lock_state_controller.cc b/ash/wm/lock_state_controller.cc index 215776d..6276e81 100644 --- a/ash/wm/lock_state_controller.cc +++ b/ash/wm/lock_state_controller.cc
@@ -17,6 +17,7 @@ #include "ash/shell_delegate.h" #include "ash/shell_port.h" #include "ash/shutdown_controller.h" +#include "ash/shutdown_reason.h" #include "ash/wm/session_state_animator.h" #include "ash/wm/session_state_animator_impl.h" #include "base/bind.h" @@ -87,24 +88,29 @@ Shell::GetPrimaryRootWindow()->GetHost()->RemoveObserver(this); } -void LockStateController::StartLockAnimation(bool shutdown_after_lock) { +void LockStateController::StartLockAnimation() { if (animating_lock_) return; - shutdown_after_lock_ = shutdown_after_lock; can_cancel_lock_animation_ = true; StartCancellablePreLockAnimation(); } -void LockStateController::StartShutdownAnimation() { +void LockStateController::StartLockThenShutdownAnimation( + ShutdownReason shutdown_reason) { + shutdown_after_lock_ = true; + shutdown_reason_ = shutdown_reason; + StartLockAnimation(); +} + +void LockStateController::StartShutdownAnimation(ShutdownReason reason) { + shutdown_reason_ = reason; StartCancellableShutdownAnimation(); } -void LockStateController::StartLockAnimationAndLockImmediately( - bool shutdown_after_lock) { +void LockStateController::StartLockAnimationAndLockImmediately() { if (animating_lock_) return; - shutdown_after_lock_ = shutdown_after_lock; StartImmediatePreLockAnimation(true /* request_lock_on_completion */); } @@ -160,11 +166,12 @@ StartImmediatePreLockAnimation(false /* request_lock_on_completion */); } -void LockStateController::RequestShutdown() { +void LockStateController::RequestShutdown(ShutdownReason reason) { if (shutting_down_) return; shutting_down_ = true; + shutdown_reason_ = reason; ShellPort* port = ShellPort::Get(); port->HideCursor(); @@ -301,10 +308,8 @@ void LockStateController::OnRealPowerTimeout() { VLOG(1) << "OnRealPowerTimeout"; DCHECK(shutting_down_); - Shell::Get()->metrics()->RecordUserMetricsAction( - UMA_ACCEL_SHUT_DOWN_POWER_BUTTON); // Shut down or reboot based on device policy. - shutdown_controller_->ShutDownOrReboot(); + shutdown_controller_->ShutDownOrReboot(shutdown_reason_); } void LockStateController::StartCancellableShutdownAnimation() {
diff --git a/ash/wm/lock_state_controller.h b/ash/wm/lock_state_controller.h index e7be3dea..fb23bc7 100644 --- a/ash/wm/lock_state_controller.h +++ b/ash/wm/lock_state_controller.h
@@ -9,6 +9,7 @@ #include "ash/ash_export.h" #include "ash/session/session_observer.h" +#include "ash/shutdown_reason.h" #include "ash/wm/session_state_animator.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" @@ -20,6 +21,7 @@ namespace ash { class ShutdownController; +enum class ShutdownReason; namespace test { class LockStateControllerTestApi; @@ -55,18 +57,19 @@ ~LockStateController() override; // Starts locking (with slow animation) that can be cancelled. + void StartLockAnimation(); + + // Starts locking (with slow animation) that can be cancelled. // After locking and |kLockToShutdownTimeoutMs| StartShutdownAnimation() - // will be called unless CancelShutdownAnimation() is called, if - // |shutdown_after_lock| is true. - void StartLockAnimation(bool shutdown_after_lock); + // will be called unless CancelShutdownAnimation() is called. + // |shutdown_reason| gives the reason for shutdown. + void StartLockThenShutdownAnimation(ShutdownReason shutdown_reason); // Starts shutting down (with slow animation) that can be cancelled. - void StartShutdownAnimation(); + void StartShutdownAnimation(ShutdownReason reason); - // Starts usual lock animation, but locks immediately. After locking and - // |kLockToShutdownTimeoutMs| StartShutdownAnimation() will be called unless - // CancelShutdownAnimation() is called, if |shutdown_after_lock| is true. - void StartLockAnimationAndLockImmediately(bool shutdown_after_lock); + // Starts usual lock animation, but locks immediately. + void StartLockAnimationAndLockImmediately(); // Returns true if we have requested system to lock, but haven't received // confirmation yet. @@ -92,7 +95,7 @@ // Displays the shutdown animation and requests a system shutdown or system // restart depending on the the state of the |RebootOnShutdown| device policy. - void RequestShutdown(); + void RequestShutdown(ShutdownReason reason); // Called when ScreenLocker is ready to close, but not yet destroyed. // Can be used to display "hiding" animations on unlock. @@ -188,6 +191,9 @@ // Are we in the process of shutting the machine down? bool shutting_down_ = false; + // The reason (e.g. user action) for a pending shutdown. + ShutdownReason shutdown_reason_ = ShutdownReason::UNKNOWN; + // Indicates whether controller should proceed to (cancellable) shutdown after // locking. bool shutdown_after_lock_ = false;
diff --git a/ash/wm/lock_state_controller_unittest.cc b/ash/wm/lock_state_controller_unittest.cc index e2111158..e498c91 100644 --- a/ash/wm/lock_state_controller_unittest.cc +++ b/ash/wm/lock_state_controller_unittest.cc
@@ -11,6 +11,7 @@ #include "ash/session/session_controller.h" #include "ash/shell.h" #include "ash/shutdown_controller.h" +#include "ash/shutdown_reason.h" #include "ash/test/ash_test_base.h" #include "ash/test/lock_state_controller_test_api.h" #include "ash/test/test_screenshot_delegate.h" @@ -54,7 +55,9 @@ private: // ShutdownController: - void ShutDownOrReboot() override { num_shutdown_requests_++; } + void ShutDownOrReboot(ShutdownReason reason) override { + num_shutdown_requests_++; + } int num_shutdown_requests_ = 0; @@ -819,7 +822,8 @@ TEST_F(LockStateControllerTest, RequestShutdownFromLoginScreen) { Initialize(false, LoginStatus::NOT_LOGGED_IN); - lock_state_controller_->RequestShutdown(); + lock_state_controller_->RequestShutdown( + ShutdownReason::LOGIN_SHUT_DOWN_BUTTON); ExpectShutdownAnimationStarted(); Advance(SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN); @@ -843,7 +847,8 @@ Advance(SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN); ExpectPostLockAnimationFinished(); - lock_state_controller_->RequestShutdown(); + lock_state_controller_->RequestShutdown( + ShutdownReason::LOGIN_SHUT_DOWN_BUTTON); ExpectShutdownAnimationStarted(); Advance(SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN);
diff --git a/ash/wm/power_button_controller.cc b/ash/wm/power_button_controller.cc index efbdbca2..555108cf 100644 --- a/ash/wm/power_button_controller.cc +++ b/ash/wm/power_button_controller.cc
@@ -9,6 +9,7 @@ #include "ash/public/cpp/shell_window_ids.h" #include "ash/session/session_controller.h" #include "ash/shell.h" +#include "ash/shutdown_reason.h" #include "ash/system/audio/tray_audio.h" #include "ash/system/power/tablet_power_button_controller.h" #include "ash/system/tray/system_tray.h" @@ -103,9 +104,9 @@ if (session_controller->CanLockScreen() && !session_controller->IsUserSessionBlocked() && !lock_state_controller_->LockRequested()) { - lock_state_controller_->StartLockAnimationAndLockImmediately(false); + lock_state_controller_->StartLockAnimationAndLockImmediately(); } else { - lock_state_controller_->RequestShutdown(); + lock_state_controller_->RequestShutdown(ShutdownReason::POWER_BUTTON); } } } else { // !has_legacy_power_button_ @@ -116,9 +117,11 @@ if (session_controller->CanLockScreen() && !session_controller->IsUserSessionBlocked()) { - lock_state_controller_->StartLockAnimation(true); + lock_state_controller_->StartLockThenShutdownAnimation( + ShutdownReason::POWER_BUTTON); } else { - lock_state_controller_->StartShutdownAnimation(); + lock_state_controller_->StartShutdownAnimation( + ShutdownReason::POWER_BUTTON); } } else { // Button is up. if (lock_state_controller_->CanCancelLockAnimation()) @@ -148,7 +151,7 @@ return; if (down) - lock_state_controller_->StartLockAnimation(false); + lock_state_controller_->StartLockAnimation(); else lock_state_controller_->CancelLockAnimation(); }
diff --git a/base/BUILD.gn b/base/BUILD.gn index 9e1e77a..a617f10 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -599,6 +599,8 @@ "nix/xdg_util.h", "numerics/checked_math.h", "numerics/checked_math_impl.h", + "numerics/clamped_math.h", + "numerics/clamped_math_impl.h", "numerics/safe_conversions.h", "numerics/safe_conversions_impl.h", "numerics/safe_math.h", @@ -1021,8 +1023,6 @@ "trace_event/trace_event_impl.h", "trace_event/trace_event_memory_overhead.cc", "trace_event/trace_event_memory_overhead.h", - "trace_event/trace_event_synthetic_delay.cc", - "trace_event/trace_event_synthetic_delay.h", "trace_event/trace_event_system_stats_monitor.cc", "trace_event/trace_event_system_stats_monitor.h", "trace_event/trace_log.cc", @@ -2032,6 +2032,7 @@ "file_version_info_win_unittest.cc", "files/dir_reader_posix_unittest.cc", "files/file_descriptor_watcher_posix_unittest.cc", + "files/file_enumerator_unittest.cc", "files/file_locking_unittest.cc", "files/file_path_unittest.cc", "files/file_path_watcher_unittest.cc", @@ -2258,7 +2259,6 @@ "trace_event/trace_event_argument_unittest.cc", "trace_event/trace_event_filter_test_utils.cc", "trace_event/trace_event_filter_test_utils.h", - "trace_event/trace_event_synthetic_delay_unittest.cc", "trace_event/trace_event_system_stats_monitor_unittest.cc", "trace_event/trace_event_unittest.cc", "tracked_objects_unittest.cc",
diff --git a/base/allocator/partition_allocator/page_allocator.cc b/base/allocator/partition_allocator/page_allocator.cc index bb737b3..7becd92e 100644 --- a/base/allocator/partition_allocator/page_allocator.cc +++ b/base/allocator/partition_allocator/page_allocator.cc
@@ -13,6 +13,10 @@ #include "base/logging.h" #include "build/build_config.h" +#if defined(OS_MACOSX) +#include <mach/mach.h> +#endif + #if defined(OS_POSIX) #include <errno.h> @@ -61,10 +65,19 @@ if (!ret) s_allocPageErrorCode = GetLastError(); #else + +#if defined(OS_MACOSX) + // Use a custom tag to make it easier to distinguish partition alloc regions + // in vmmap. + int fd = VM_MAKE_TAG(254); +#else + int fd = -1; +#endif + int access_flag = page_accessibility == PageAccessible ? (PROT_READ | PROT_WRITE) : PROT_NONE; - ret = mmap(hint, length, access_flag, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); + ret = mmap(hint, length, access_flag, MAP_ANONYMOUS | MAP_PRIVATE, fd, 0); if (ret == MAP_FAILED) { s_allocPageErrorCode = errno; ret = 0;
diff --git a/base/android/jni_generator/SampleForTests_jni.golden b/base/android/jni_generator/SampleForTests_jni.golden index 7b384252..e50583ab 100644 --- a/base/android/jni_generator/SampleForTests_jni.golden +++ b/base/android/jni_generator/SampleForTests_jni.golden
@@ -482,24 +482,35 @@ }, }; +// TODO(agrieve): Remove these empty registration functions and functions +// calling them. https://crbug.com/683256. static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(false)) - return true; + return true; +} - const int kMethodsInnerClassSize = arraysize(kMethodsInnerClass); +} // namespace android +} // namespace base + +JNI_REGISTRATION_EXPORT bool + RegisterNative_org_chromium_example_jni_1generator_SampleForTests(JNIEnv* + env) { + + const int kMethodsInnerClassSize = + arraysize(base::android::kMethodsInnerClass); if (env->RegisterNatives(InnerClass_clazz(env), - kMethodsInnerClass, + base::android::kMethodsInnerClass, kMethodsInnerClassSize) < 0) { jni_generator::HandleRegistrationError( env, InnerClass_clazz(env), __FILE__); return false; } - const int kMethodsSampleForTestsSize = arraysize(kMethodsSampleForTests); + const int kMethodsSampleForTestsSize = + arraysize(base::android::kMethodsSampleForTests); if (env->RegisterNatives(SampleForTests_clazz(env), - kMethodsSampleForTests, + base::android::kMethodsSampleForTests, kMethodsSampleForTestsSize) < 0) { jni_generator::HandleRegistrationError( env, SampleForTests_clazz(env), __FILE__); @@ -509,7 +520,4 @@ return true; } -} // namespace android -} // namespace base - #endif // org_chromium_example_jni_generator_SampleForTests_JNI
diff --git a/base/android/jni_generator/jni_exception_list.gni b/base/android/jni_generator/jni_exception_list.gni new file mode 100644 index 0000000..a990cc2 --- /dev/null +++ b/base/android/jni_generator/jni_exception_list.gni
@@ -0,0 +1,16 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//device/vr/features/features.gni") + +jni_exception_files = [ + "//base/android/java/src/org/chromium/base/library_loader/LegacyLinker.java", + "//base/android/java/src/org/chromium/base/library_loader/Linker.java", + "//base/android/java/src/org/chromium/base/library_loader/ModernLinker.java", +] + +# Exclude it from JNI registration if VR is not enabled. +if (!enable_vr) { + jni_exception_files += [ "//chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java" ] +}
diff --git a/base/android/jni_generator/jni_generator.py b/base/android/jni_generator/jni_generator.py index 3818009..8249fc9e 100755 --- a/base/android/jni_generator/jni_generator.py +++ b/base/android/jni_generator/jni_generator.py
@@ -401,7 +401,7 @@ def IsMainDexJavaClass(contents): - """Returns "true" if the class is annotated with "@MainDex", "false" if not. + """Returns True if the class is annotated with "@MainDex", False if not. JNI registration doesn't always need to be completed for non-browser processes since most Java code is only used by the browser process. Classes that are @@ -409,8 +409,17 @@ to force JNI registration. """ re_maindex = re.compile(r'@MainDex[\s\S]*class({|[\s\S]*{)') - found = re.search(re_maindex, contents) - return 'true' if found else 'false' + return bool(re.search(re_maindex, contents)) + + +def GetBinaryClassName(fully_qualified_class): + """Returns a string concatenating the Java package and class.""" + return fully_qualified_class.replace('_', '_1').replace('/', '_') + + +def GetRegistrationFunctionName(fully_qualified_class): + """Returns the register name with a given class.""" + return 'RegisterNative_' + GetBinaryClassName(fully_qualified_class) def GetStaticCastForReturnType(return_type): @@ -620,7 +629,6 @@ is_constructor=True)] self.called_by_natives = MangleCalledByNatives(self.jni_params, self.called_by_natives) - self.constant_fields = [] re_constant_field = re.compile('.*?public static final int (?P<name>.*?);') re_constant_field_value = re.compile( @@ -673,13 +681,12 @@ jni_namespace = ExtractJNINamespace(contents) or options.namespace natives = ExtractNatives(contents, options.ptr_type) called_by_natives = ExtractCalledByNatives(self.jni_params, contents) - maindex = IsMainDexJavaClass(contents) if len(natives) == 0 and len(called_by_natives) == 0: raise SyntaxError('Unable to find any JNI methods for %s.' % fully_qualified_class) inl_header_file_generator = InlHeaderFileGenerator( jni_namespace, fully_qualified_class, natives, called_by_natives, [], - self.jni_params, options, maindex) + self.jni_params, options) self.content = inl_header_file_generator.GetContent() @classmethod @@ -715,8 +722,7 @@ """Generates an inline header file for JNI integration.""" def __init__(self, namespace, fully_qualified_class, natives, - called_by_natives, constant_fields, jni_params, options, - maindex='false'): + called_by_natives, constant_fields, jni_params, options): self.namespace = namespace self.fully_qualified_class = fully_qualified_class self.class_name = self.fully_qualified_class.split('/')[-1] @@ -724,7 +730,6 @@ self.called_by_natives = called_by_natives self.header_guard = fully_qualified_class.replace('/', '_') + '_JNI' self.constant_fields = constant_fields - self.maindex = maindex self.jni_params = jni_params self.options = options @@ -766,8 +771,9 @@ // Step 3: RegisterNatives. $JNI_NATIVE_METHODS -$REGISTER_NATIVES +$REGISTER_NATIVES_EMPTY $CLOSE_NAMESPACE +$REGISTER_NATIVES #endif // ${HEADER_GUARD} """) @@ -779,8 +785,9 @@ 'METHOD_STUBS': self.GetMethodStubsString(), 'OPEN_NAMESPACE': self.GetOpenNamespaceString(), 'JNI_NATIVE_METHODS': self.GetJNINativeMethodsString(), - 'REGISTER_NATIVES': self.GetRegisterNativesString(), + 'REGISTER_NATIVES_EMPTY': self.GetOriginalRegisterNativesString(), 'CLOSE_NAMESPACE': self.GetCloseNamespaceString(), + 'REGISTER_NATIVES': self.GetRegisterNativesString(), 'HEADER_GUARD': self.header_guard, 'INCLUDES': self.GetIncludesString(), } @@ -829,14 +836,19 @@ return '\n'.join(ret) def SubstituteNativeMethods(self, template): - """Substitutes JAVA_CLASS and KMETHODS in the provided template.""" + """Substitutes NAMESPACE, JAVA_CLASS and KMETHODS in the provided + template.""" ret = [] all_classes = self.GetUniqueClasses(self.natives) all_classes[self.class_name] = self.fully_qualified_class for clazz in all_classes: kmethods = self.GetKMethodsString(clazz) + namespace_str = '' + if self.namespace: + namespace_str = self.namespace + '::' if kmethods: - values = {'JAVA_CLASS': clazz, + values = {'NAMESPACE': namespace_str, + 'JAVA_CLASS': clazz, 'KMETHODS': kmethods} ret += [template.substitute(values)] if not ret: return '' @@ -853,32 +865,38 @@ """) return self.SubstituteNativeMethods(template) + # TODO(agrieve): Remove this function when deleting original registers. + # https://crbug.com/683256. + def GetOriginalRegisterNativesString(self): + """Return the code for original RegisterNatives""" + natives = self.GetRegisterNativesImplString() + if not natives: + return '' + + return """ +// TODO(agrieve): Remove these empty registration functions and functions +// calling them. https://crbug.com/683256. +static bool RegisterNativesImpl(JNIEnv* env) { + return true; +} +""" + def GetRegisterNativesString(self): """Returns the code for RegisterNatives.""" natives = self.GetRegisterNativesImplString() if not natives: return '' - template = Template("""\ -${REGISTER_NATIVES_SIGNATURE} { -${EARLY_EXIT} +JNI_REGISTRATION_EXPORT bool ${REGISTER_NAME}(JNIEnv* env) { ${NATIVES} return true; } """) - signature = 'static bool RegisterNativesImpl(JNIEnv* env)' - early_exit = '' - if self.options.native_exports_optional: - early_exit = """\ - if (jni_generator::ShouldSkipJniRegistration(%s)) - return true; -""" % self.maindex - - values = {'REGISTER_NATIVES_SIGNATURE': signature, - 'EARLY_EXIT': early_exit, - 'NATIVES': natives, - } - + values = { + 'REGISTER_NAME': + GetRegistrationFunctionName(self.fully_qualified_class), + 'NATIVES': natives + } return template.substitute(values) def GetRegisterNativesImplString(self): @@ -887,10 +905,11 @@ return '' template = Template("""\ - const int kMethods${JAVA_CLASS}Size = arraysize(kMethods${JAVA_CLASS}); + const int kMethods${JAVA_CLASS}Size = + arraysize(${NAMESPACE}kMethods${JAVA_CLASS}); if (env->RegisterNatives(${JAVA_CLASS}_clazz(env), - kMethods${JAVA_CLASS}, + ${NAMESPACE}kMethods${JAVA_CLASS}, kMethods${JAVA_CLASS}Size) < 0) { jni_generator::HandleRegistrationError( env, ${JAVA_CLASS}_clazz(env), __FILE__); @@ -974,7 +993,7 @@ """ template = Template("Java_${JAVA_NAME}_native${NAME}") - java_name = self.fully_qualified_class.replace('_', '_1').replace('/', '_') + java_name = GetBinaryClassName(self.fully_qualified_class) if native.java_class_name: java_name += '_00024' + native.java_class_name @@ -1314,19 +1333,21 @@ print e sys.exit(1) if output_file: - if not os.path.exists(os.path.dirname(os.path.abspath(output_file))): - os.makedirs(os.path.dirname(os.path.abspath(output_file))) - if options.optimize_generation and os.path.exists(output_file): - with file(output_file, 'r') as f: - existing_content = f.read() - if existing_content == content: - return - with file(output_file, 'w') as f: - f.write(content) + WriteOutput(output_file, content) else: print content +def WriteOutput(output_file, content): + if os.path.exists(output_file): + with open(output_file) as f: + existing_content = f.read() + if existing_content == content: + return + with open(output_file, 'w') as f: + f.write(content) + + def GetScriptName(): script_components = os.path.abspath(sys.argv[0]).split(os.path.sep) base_index = 0 @@ -1363,10 +1384,6 @@ option_parser.add_option('--output_dir', help='The output directory. Must be used with ' '--input') - option_parser.add_option('--optimize_generation', type="int", - default=0, help='Whether we should optimize JNI ' - 'generation by not regenerating files if they have ' - 'not changed.') option_parser.add_option('--script_name', default=GetScriptName(), help='The name of this script in the generated ' 'header.')
diff --git a/base/android/jni_generator/jni_generator_helper.h b/base/android/jni_generator/jni_generator_helper.h index 3062806..53629a657 100644 --- a/base/android/jni_generator/jni_generator_helper.h +++ b/base/android/jni_generator/jni_generator_helper.h
@@ -30,6 +30,13 @@ #define JNI_GENERATOR_EXPORT extern "C" __attribute__((visibility("default"))) #endif +// Used to export JNI registration functions. +#if defined(COMPONENT_BUILD) +#define JNI_REGISTRATION_EXPORT __attribute__((visibility("default"))) +#else +#define JNI_REGISTRATION_EXPORT +#endif + namespace jni_generator { inline void HandleRegistrationError(JNIEnv* env, @@ -42,12 +49,14 @@ base::android::CheckException(env); } +// TODO(estevenson): Remove this function since all natives are registered +// together. Currently gvr-android-sdk stil calls it. +// https://crbug.com/664306. inline bool ShouldSkipJniRegistration(bool is_maindex_class) { switch (base::android::GetJniRegistrationType()) { case base::android::ALL_JNI_REGISTRATION: return false; case base::android::NO_JNI_REGISTRATION: - // TODO(estevenson): Change this to a DCHECK. return true; case base::android::SELECTIVE_JNI_REGISTRATION: return !is_maindex_class;
diff --git a/base/android/jni_generator/jni_generator_tests.py b/base/android/jni_generator/jni_generator_tests.py index d667a47..41e617f 100755 --- a/base/android/jni_generator/jni_generator_tests.py +++ b/base/android/jni_generator/jni_generator_tests.py
@@ -967,33 +967,6 @@ test_options) self.assertGoldenTextEquals(h.GetContent()) - def testMainDexFile(self): - test_data = """ - package org.chromium.example.jni_generator; - - @MainDex - class Test { - private static native int nativeStaticMethod(long nativeTest, int arg1); - } - """ - options = TestOptions() - jni_from_java = jni_generator.JNIFromJavaSource( - test_data, 'org/chromium/foo/Bar', options) - self.assertGoldenTextEquals(jni_from_java.GetContent()) - - def testNonMainDexFile(self): - test_data = """ - package org.chromium.example.jni_generator; - - class Test { - private static native int nativeStaticMethod(long nativeTest, int arg1); - } - """ - options = TestOptions() - jni_from_java = jni_generator.JNIFromJavaSource( - test_data, 'org/chromium/foo/Bar', options) - self.assertGoldenTextEquals(jni_from_java.GetContent()) - def testMainDexAnnotation(self): mainDexEntries = [ '@MainDex public class Test {', @@ -1021,7 +994,7 @@ '@MainDex public class Test extends Testable<java.io.Serializable> {', ] for entry in mainDexEntries: - self.assertEquals("true", IsMainDexJavaClass(entry)) + self.assertEquals(True, IsMainDexJavaClass(entry)) def testNoMainDexAnnotation(self): noMainDexEntries = [ @@ -1031,7 +1004,7 @@ 'public class Test extends BaseTest {' ] for entry in noMainDexEntries: - self.assertEquals("false", IsMainDexJavaClass(entry)) + self.assertEquals(False, IsMainDexJavaClass(entry)) def testNativeExportsOnlyOption(self): test_data = """
diff --git a/base/android/jni_generator/jni_registration_generator.py b/base/android/jni_generator/jni_registration_generator.py new file mode 100755 index 0000000..a7ede2db --- /dev/null +++ b/base/android/jni_generator/jni_registration_generator.py
@@ -0,0 +1,180 @@ +#!/usr/bin/env python +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Generate JNI registration entry points + +Creates a header file with two static functions: RegisterMainDexNatives() and +RegisterNonMainDexNatives(). Together, these will use manual JNI registration +to register all native methods that exist within an application.""" + +import argparse +import jni_generator +import os +import string +import sys +from util import build_utils + + +def GenerateJNIHeader(java_file_paths, output_file, args): + """Generate a header file including two registration functions. + + Forward declares all JNI registration functions created by jni_generator.py. + Calls the functions in RegisterMainDexNatives() if they are main dex. And + calls them in RegisterNonMainDexNatives() if they are non-main dex. + + Args: + java_file_paths: A list of java file paths. + output_file: A relative path to output file. + args: All input arguments. + """ + registration_dict = { + 'FORWARD_DECLARATIONS': '', + 'REGISTER_MAIN_DEX_NATIVES': '', + 'REGISTER_NON_MAIN_DEX_NATIVES': '' + } + # Sort the file list to make sure the order is deterministic. + java_file_paths.sort() + for path in java_file_paths: + if path in args.no_register_java: + continue + with open(path) as f: + contents = f.read() + natives = jni_generator.ExtractNatives(contents, 'long') + if len(natives) == 0: + continue + fully_qualified_class = jni_generator.ExtractFullyQualifiedJavaClassName( + path, contents) + main_dex = jni_generator.IsMainDexJavaClass(contents) + header_generator = HeaderGenerator( + fully_qualified_class, registration_dict, main_dex) + registration_dict = header_generator.GetContent() + + header_content = CreateFromDict(registration_dict) + if output_file: + jni_generator.WriteOutput(output_file, header_content) + else: + print header_content + + +def CreateFromDict(registration_dict): + """Returns the content of the header file.""" + + template = string.Template("""\ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + + +// This file is autogenerated by +// base/android/jni_generator/jni_registration_generator.py +// Please do not change its content. + +#ifndef HEADER_GUARD +#define HEADER_GUARD + +#include <jni.h> + +#include "base/android/jni_generator/jni_generator_helper.h" +#include "base/android/jni_int_wrapper.h" + +// Step 1: Forward declaration. +${FORWARD_DECLARATIONS} + +// Step 2: Main dex and non-main dex registration functions. + +bool RegisterMainDexNatives(JNIEnv* env) { +${REGISTER_MAIN_DEX_NATIVES} + + return true; +} + +bool RegisterNonMainDexNatives(JNIEnv* env) { +${REGISTER_NON_MAIN_DEX_NATIVES} + + return true; +} + +#endif // HEADER_GUARD +""") + if len(registration_dict['FORWARD_DECLARATIONS']) == 0: + return '' + return jni_generator.WrapOutput(template.substitute(registration_dict)) + + +class HeaderGenerator(object): + """Generates an inline header file for JNI registration.""" + + def __init__(self, fully_qualified_class, registration_dict, main_dex): + self.fully_qualified_class = fully_qualified_class + self.class_name = self.fully_qualified_class.split('/')[-1] + self.registration_dict = registration_dict + self.main_dex = main_dex + + def GetContent(self): + self._AddForwardDeclaration() + self._AddRegisterNatives() + return self.registration_dict + + def _AddForwardDeclaration(self): + """Add the content of the forward declaration to the dictionary.""" + template = string.Template('JNI_REGISTRATION_EXPORT bool ${METHOD_NAME}(' + 'JNIEnv* env);\n') + value = { + 'METHOD_NAME': + jni_generator.GetRegistrationFunctionName( + self.fully_qualified_class) + } + self.registration_dict['FORWARD_DECLARATIONS'] += template.substitute(value) + + def _AddRegisterNatives(self): + """Add the body of the RegisterNativesImpl method to the dictionary.""" + template = string.Template(""" +if (!${REGISTER_NAME}(env)) + return false; +""") + value = { + 'REGISTER_NAME': + jni_generator.GetRegistrationFunctionName( + self.fully_qualified_class) + } + register_body = template.substitute(value) + if self.main_dex: + self.registration_dict['REGISTER_MAIN_DEX_NATIVES'] += register_body + else: + self.registration_dict['REGISTER_NON_MAIN_DEX_NATIVES'] += register_body + + +def main(argv): + arg_parser = argparse.ArgumentParser() + build_utils.AddDepfileOption(arg_parser) + + arg_parser.add_argument('--sources_files', + help='A list of .sources files which contain Java ' + 'file paths. Must be used with --output.') + arg_parser.add_argument('--output', + help='The output file path.') + arg_parser.add_argument('--no_register_java', + help='A list of Java files which should be ignored ' + 'by the parser.') + args = arg_parser.parse_args(build_utils.ExpandFileArgs(argv[1:])) + args.sources_files = build_utils.ParseGnList(args.sources_files) + + if args.sources_files: + java_file_paths = [] + for f in args.sources_files: + # java_file_paths stores each Java file path as a string. + java_file_paths += build_utils.ReadSourcesList(f) + else: + print '\nError: Must specify --sources_files.' + return 1 + output_file = args.output + GenerateJNIHeader(java_file_paths, output_file, args) + + if args.depfile: + build_utils.WriteDepfile(args.depfile, output_file) + + +if __name__ == '__main__': + sys.exit(main(sys.argv))
diff --git a/base/android/jni_generator/testInnerClassNatives.golden b/base/android/jni_generator/testInnerClassNatives.golden index 20b8830..363f916 100644 --- a/base/android/jni_generator/testInnerClassNatives.golden +++ b/base/android/jni_generator/testInnerClassNatives.golden
@@ -51,11 +51,16 @@ }, }; +// TODO(agrieve): Remove these empty registration functions and functions +// calling them. https://crbug.com/683256. static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(false)) - return true; + return true; +} - const int kMethodsMyInnerClassSize = arraysize(kMethodsMyInnerClass); +JNI_REGISTRATION_EXPORT bool RegisterNative_org_chromium_TestJni(JNIEnv* env) { + + const int kMethodsMyInnerClassSize = + arraysize(kMethodsMyInnerClass); if (env->RegisterNatives(MyInnerClass_clazz(env), kMethodsMyInnerClass,
diff --git a/base/android/jni_generator/testInnerClassNativesBothInnerAndOuter.golden b/base/android/jni_generator/testInnerClassNativesBothInnerAndOuter.golden index 67352e7..6c07b58 100644 --- a/base/android/jni_generator/testInnerClassNativesBothInnerAndOuter.golden +++ b/base/android/jni_generator/testInnerClassNativesBothInnerAndOuter.golden
@@ -67,9 +67,13 @@ "I", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeInit) }, }; +// TODO(agrieve): Remove these empty registration functions and functions +// calling them. https://crbug.com/683256. static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(false)) - return true; + return true; +} + +JNI_REGISTRATION_EXPORT bool RegisterNative_org_chromium_TestJni(JNIEnv* env) { const int kMethodsMyOtherInnerClassSize = arraysize(kMethodsMyOtherInnerClass); @@ -82,7 +86,8 @@ return false; } - const int kMethodsTestJniSize = arraysize(kMethodsTestJni); + const int kMethodsTestJniSize = + arraysize(kMethodsTestJni); if (env->RegisterNatives(TestJni_clazz(env), kMethodsTestJni,
diff --git a/base/android/jni_generator/testInnerClassNativesMultiple.golden b/base/android/jni_generator/testInnerClassNativesMultiple.golden index 7807efa..add5ac9 100644 --- a/base/android/jni_generator/testInnerClassNativesMultiple.golden +++ b/base/android/jni_generator/testInnerClassNativesMultiple.golden
@@ -74,9 +74,13 @@ }, }; +// TODO(agrieve): Remove these empty registration functions and functions +// calling them. https://crbug.com/683256. static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(false)) - return true; + return true; +} + +JNI_REGISTRATION_EXPORT bool RegisterNative_org_chromium_TestJni(JNIEnv* env) { const int kMethodsMyOtherInnerClassSize = arraysize(kMethodsMyOtherInnerClass); @@ -89,7 +93,8 @@ return false; } - const int kMethodsMyInnerClassSize = arraysize(kMethodsMyInnerClass); + const int kMethodsMyInnerClassSize = + arraysize(kMethodsMyInnerClass); if (env->RegisterNatives(MyInnerClass_clazz(env), kMethodsMyInnerClass,
diff --git a/base/android/jni_generator/testMainDexFile.golden b/base/android/jni_generator/testMainDexFile.golden deleted file mode 100644 index cbb2a7d..0000000 --- a/base/android/jni_generator/testMainDexFile.golden +++ /dev/null
@@ -1,67 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is autogenerated by -// base/android/jni_generator/jni_generator.py -// For -// org/chromium/foo/Bar - -#ifndef org_chromium_foo_Bar_JNI -#define org_chromium_foo_Bar_JNI - -#include <jni.h> - -#include "base/android/jni_generator/jni_generator_helper.h" - -#include "base/android/jni_int_wrapper.h" - -// Step 1: forward declarations. -namespace { -const char kBarClassPath[] = "org/chromium/foo/Bar"; -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_Bar_clazz __attribute__((unused)) = 0; -#define Bar_clazz(env) base::android::LazyGetClass(env, kBarClassPath, &g_Bar_clazz) - -} // namespace - -// Step 2: method stubs. -JNI_GENERATOR_EXPORT jint Java_org_chromium_foo_Bar_nativeStaticMethod(JNIEnv* - env, jobject jcaller, - jlong nativeTest, - jint arg1) { - Test* native = reinterpret_cast<Test*>(nativeTest); - CHECK_NATIVE_PTR(env, jcaller, native, "StaticMethod", 0); - return native->StaticMethod(env, base::android::JavaParamRef<jobject>(env, - jcaller), arg1); -} - -// Step 3: RegisterNatives. - -static const JNINativeMethod kMethodsBar[] = { - { "nativeStaticMethod", -"(" -"J" -"I" -")" -"I", reinterpret_cast<void*>(Java_org_chromium_foo_Bar_nativeStaticMethod) }, -}; - -static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(true)) - return true; - - const int kMethodsBarSize = arraysize(kMethodsBar); - - if (env->RegisterNatives(Bar_clazz(env), - kMethodsBar, - kMethodsBarSize) < 0) { - jni_generator::HandleRegistrationError( - env, Bar_clazz(env), __FILE__); - return false; - } - - return true; -} - -#endif // org_chromium_foo_Bar_JNI
diff --git a/base/android/jni_generator/testMultipleJNIAdditionalImport.golden b/base/android/jni_generator/testMultipleJNIAdditionalImport.golden index 0eecb5a..03aac48e 100644 --- a/base/android/jni_generator/testMultipleJNIAdditionalImport.golden +++ b/base/android/jni_generator/testMultipleJNIAdditionalImport.golden
@@ -75,11 +75,16 @@ "V", reinterpret_cast<void*>(Java_org_chromium_foo_Foo_nativeDoSomething) }, }; +// TODO(agrieve): Remove these empty registration functions and functions +// calling them. https://crbug.com/683256. static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(false)) - return true; + return true; +} - const int kMethodsFooSize = arraysize(kMethodsFoo); +JNI_REGISTRATION_EXPORT bool RegisterNative_org_chromium_foo_Foo(JNIEnv* env) { + + const int kMethodsFooSize = + arraysize(kMethodsFoo); if (env->RegisterNatives(Foo_clazz(env), kMethodsFoo,
diff --git a/base/android/jni_generator/testNatives.golden b/base/android/jni_generator/testNatives.golden index 3362c928..0bfbe04 100644 --- a/base/android/jni_generator/testNatives.golden +++ b/base/android/jni_generator/testNatives.golden
@@ -320,11 +320,16 @@ }, }; +// TODO(agrieve): Remove these empty registration functions and functions +// calling them. https://crbug.com/683256. static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(false)) - return true; + return true; +} - const int kMethodsTestJniSize = arraysize(kMethodsTestJni); +JNI_REGISTRATION_EXPORT bool RegisterNative_org_chromium_TestJni(JNIEnv* env) { + + const int kMethodsTestJniSize = + arraysize(kMethodsTestJni); if (env->RegisterNatives(TestJni_clazz(env), kMethodsTestJni,
diff --git a/base/android/jni_generator/testNativesLong.golden b/base/android/jni_generator/testNativesLong.golden index ec029ce3..201a066 100644 --- a/base/android/jni_generator/testNativesLong.golden +++ b/base/android/jni_generator/testNativesLong.golden
@@ -46,11 +46,16 @@ "V", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeDestroy) }, }; +// TODO(agrieve): Remove these empty registration functions and functions +// calling them. https://crbug.com/683256. static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(false)) - return true; + return true; +} - const int kMethodsTestJniSize = arraysize(kMethodsTestJni); +JNI_REGISTRATION_EXPORT bool RegisterNative_org_chromium_TestJni(JNIEnv* env) { + + const int kMethodsTestJniSize = + arraysize(kMethodsTestJni); if (env->RegisterNatives(TestJni_clazz(env), kMethodsTestJni,
diff --git a/base/android/jni_generator/testNonMainDexFile.golden b/base/android/jni_generator/testNonMainDexFile.golden deleted file mode 100644 index 533241e..0000000 --- a/base/android/jni_generator/testNonMainDexFile.golden +++ /dev/null
@@ -1,67 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is autogenerated by -// base/android/jni_generator/jni_generator.py -// For -// org/chromium/foo/Bar - -#ifndef org_chromium_foo_Bar_JNI -#define org_chromium_foo_Bar_JNI - -#include <jni.h> - -#include "base/android/jni_generator/jni_generator_helper.h" - -#include "base/android/jni_int_wrapper.h" - -// Step 1: forward declarations. -namespace { -const char kBarClassPath[] = "org/chromium/foo/Bar"; -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_Bar_clazz __attribute__((unused)) = 0; -#define Bar_clazz(env) base::android::LazyGetClass(env, kBarClassPath, &g_Bar_clazz) - -} // namespace - -// Step 2: method stubs. -JNI_GENERATOR_EXPORT jint Java_org_chromium_foo_Bar_nativeStaticMethod(JNIEnv* - env, jobject jcaller, - jlong nativeTest, - jint arg1) { - Test* native = reinterpret_cast<Test*>(nativeTest); - CHECK_NATIVE_PTR(env, jcaller, native, "StaticMethod", 0); - return native->StaticMethod(env, base::android::JavaParamRef<jobject>(env, - jcaller), arg1); -} - -// Step 3: RegisterNatives. - -static const JNINativeMethod kMethodsBar[] = { - { "nativeStaticMethod", -"(" -"J" -"I" -")" -"I", reinterpret_cast<void*>(Java_org_chromium_foo_Bar_nativeStaticMethod) }, -}; - -static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(false)) - return true; - - const int kMethodsBarSize = arraysize(kMethodsBar); - - if (env->RegisterNatives(Bar_clazz(env), - kMethodsBar, - kMethodsBarSize) < 0) { - jni_generator::HandleRegistrationError( - env, Bar_clazz(env), __FILE__); - return false; - } - - return true; -} - -#endif // org_chromium_foo_Bar_JNI
diff --git a/base/android/jni_generator/testSingleJNIAdditionalImport.golden b/base/android/jni_generator/testSingleJNIAdditionalImport.golden index ef618da8..a367ae7 100644 --- a/base/android/jni_generator/testSingleJNIAdditionalImport.golden +++ b/base/android/jni_generator/testSingleJNIAdditionalImport.golden
@@ -69,11 +69,16 @@ "V", reinterpret_cast<void*>(Java_org_chromium_foo_Foo_nativeDoSomething) }, }; +// TODO(agrieve): Remove these empty registration functions and functions +// calling them. https://crbug.com/683256. static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(false)) - return true; + return true; +} - const int kMethodsFooSize = arraysize(kMethodsFoo); +JNI_REGISTRATION_EXPORT bool RegisterNative_org_chromium_foo_Foo(JNIEnv* env) { + + const int kMethodsFooSize = + arraysize(kMethodsFoo); if (env->RegisterNatives(Foo_clazz(env), kMethodsFoo,
diff --git a/base/bind_internal.h b/base/bind_internal.h index c27c34f3..5aab7f40 100644 --- a/base/bind_internal.h +++ b/base/bind_internal.h
@@ -482,7 +482,8 @@ template <typename Functor, typename... BoundArgs> struct MakeBindStateTypeImpl<false, Functor, BoundArgs...> { - static_assert(!HasRefCountedTypeAsRawPtr<BoundArgs...>::value, + static_assert(!HasRefCountedTypeAsRawPtr< + typename std::decay<BoundArgs>::type...>::value, "A parameter is a refcounted type and needs scoped_refptr."); using Type = BindState<typename std::decay<Functor>::type, typename std::decay<BoundArgs>::type...>; @@ -498,7 +499,8 @@ static_assert( !std::is_array<typename std::remove_reference<Receiver>::type>::value, "First bound argument to a method cannot be an array."); - static_assert(!HasRefCountedTypeAsRawPtr<BoundArgs...>::value, + static_assert(!HasRefCountedTypeAsRawPtr< + typename std::decay<BoundArgs>::type...>::value, "A parameter is a refcounted type and needs scoped_refptr."); private:
diff --git a/base/bind_unittest.nc b/base/bind_unittest.nc index 3752b08..61835be 100644 --- a/base/bind_unittest.nc +++ b/base/bind_unittest.nc
@@ -173,7 +173,7 @@ method_bound_to_array_cb.Run(); } -#elif defined(NCTEST_NO_RAW_PTR_FOR_REFCOUNTED_TYPES) // [r"fatal error: static_assert failed \"A parameter is a refcounted type and needs scoped_refptr.\""] +#elif defined(NCTEST_NO_RVALUE_RAW_PTR_FOR_REFCOUNTED_TYPES) // [r"fatal error: static_assert failed \"A parameter is a refcounted type and needs scoped_refptr.\""] // Refcounted types should not be bound as a raw pointer. void WontCompile() { @@ -185,6 +185,15 @@ Bind(&VoidPolymorphic1<HasRef*>, &for_raw_ptr); } +#elif defined(NCTEST_NO_LVALUE_RAW_PTR_FOR_REFCOUNTED_TYPES) // [r"fatal error: static_assert failed \"A parameter is a refcounted type and needs scoped_refptr.\""] + +// Refcounted types should not be bound as a raw pointer. +void WontCompile() { + HasRef* for_raw_ptr = nullptr; + Callback<void()> ref_count_as_raw_ptr = + Bind(&VoidPolymorphic1<HasRef*>, for_raw_ptr); +} + #elif defined(NCTEST_WEAKPTR_BIND_MUST_RETURN_VOID) // [r"fatal error: static_assert failed \"weak_ptrs can only bind to methods without return values\""] // WeakPtrs cannot be bound to methods with return types.
diff --git a/base/files/file_enumerator.cc b/base/files/file_enumerator.cc index 9749980..dfa277a 100644 --- a/base/files/file_enumerator.cc +++ b/base/files/file_enumerator.cc
@@ -18,4 +18,9 @@ !(INCLUDE_DOT_DOT & file_type_)); } +bool FileEnumerator::IsTypeMatched(bool is_dir) const { + return (file_type_ & + (is_dir ? FileEnumerator::DIRECTORIES : FileEnumerator::FILES)) != 0; +} + } // namespace base
diff --git a/base/files/file_enumerator.h b/base/files/file_enumerator.h index 7cac8dd..4f3ee57 100644 --- a/base/files/file_enumerator.h +++ b/base/files/file_enumerator.h
@@ -84,6 +84,17 @@ #endif }; + // Search policy for intermediate folders. + enum class FolderSearchPolicy { + // Recursive search will pass through folders whose names match the + // pattern. Inside each one, all files will be returned. Folders with names + // that do not match the pattern will be ignored within their interior. + MATCH_ONLY, + // Recursive search will pass through every folder and perform pattern + // matching inside each one. + ALL, + }; + // |root_path| is the starting directory to search for. It may or may not end // in a slash. // @@ -101,9 +112,6 @@ // since the underlying code uses OS-specific matching routines. In general, // Windows matching is less featureful than others, so test there first. // If unspecified, this will match all files. - // NOTE: the pattern only matches the contents of root_path, not files in - // recursive subdirectories. - // TODO(erikkay): Fix the pattern matching to work at all levels. FileEnumerator(const FilePath& root_path, bool recursive, int file_type); @@ -111,6 +119,11 @@ bool recursive, int file_type, const FilePath::StringType& pattern); + FileEnumerator(const FilePath& root_path, + bool recursive, + int file_type, + const FilePath::StringType& pattern, + FolderSearchPolicy folder_search_policy); ~FileEnumerator(); // Returns the next file or an empty string if there are no more results. @@ -127,28 +140,27 @@ // Returns true if the given path should be skipped in enumeration. bool ShouldSkip(const FilePath& path); + bool IsTypeMatched(bool is_dir) const; + + bool IsPatternMatched(const FilePath& src) const; + #if defined(OS_WIN) // True when find_data_ is valid. - bool has_find_data_; + bool has_find_data_ = false; WIN32_FIND_DATA find_data_; - HANDLE find_handle_; + HANDLE find_handle_ = INVALID_HANDLE_VALUE; #elif defined(OS_POSIX) - - // Read the filenames in source into the vector of DirectoryEntryInfo's - static bool ReadDirectory(std::vector<FileInfo>* entries, - const FilePath& source, bool show_links); - // The files in the current directory std::vector<FileInfo> directory_entries_; // The next entry to use from the directory_entries_ vector size_t current_directory_entry_; #endif - FilePath root_path_; - bool recursive_; - int file_type_; - FilePath::StringType pattern_; // Empty when we want to find everything. + const bool recursive_; + const int file_type_; + FilePath::StringType pattern_; + const FolderSearchPolicy folder_search_policy_; // A stack that keeps track of which subdirectories we still need to // enumerate in the breadth-first search.
diff --git a/base/files/file_enumerator_posix.cc b/base/files/file_enumerator_posix.cc index a1b4949..bc5c3cc5 100644 --- a/base/files/file_enumerator_posix.cc +++ b/base/files/file_enumerator_posix.cc
@@ -8,12 +8,29 @@ #include <errno.h> #include <fnmatch.h> #include <stdint.h> +#include <string.h> #include "base/logging.h" #include "base/threading/thread_restrictions.h" #include "build/build_config.h" namespace base { +namespace { + +void GetStat(const FilePath& path, bool show_links, struct stat* st) { + DCHECK(st); + const int res = show_links ? lstat(path.value().c_str(), st) + : stat(path.value().c_str(), st); + if (res < 0) { + // Print the stat() error message unless it was ENOENT and we're following + // symlinks. + if (!(errno == ENOENT && !show_links)) + DPLOG(ERROR) << "Couldn't stat" << path.value(); + memset(st, 0, sizeof(*st)); + } +} + +} // namespace // FileEnumerator::FileInfo ---------------------------------------------------- @@ -42,31 +59,36 @@ FileEnumerator::FileEnumerator(const FilePath& root_path, bool recursive, int file_type) - : current_directory_entry_(0), - root_path_(root_path), - recursive_(recursive), - file_type_(file_type) { - // INCLUDE_DOT_DOT must not be specified if recursive. - DCHECK(!(recursive && (INCLUDE_DOT_DOT & file_type_))); - pending_paths_.push(root_path); -} + : FileEnumerator(root_path, + recursive, + file_type, + FilePath::StringType(), + FolderSearchPolicy::MATCH_ONLY) {} FileEnumerator::FileEnumerator(const FilePath& root_path, bool recursive, int file_type, const FilePath::StringType& pattern) + : FileEnumerator(root_path, + recursive, + file_type, + pattern, + FolderSearchPolicy::MATCH_ONLY) {} + +FileEnumerator::FileEnumerator(const FilePath& root_path, + bool recursive, + int file_type, + const FilePath::StringType& pattern, + FolderSearchPolicy folder_search_policy) : current_directory_entry_(0), root_path_(root_path), recursive_(recursive), file_type_(file_type), - pattern_(root_path.Append(pattern).value()) { + pattern_(pattern), + folder_search_policy_(folder_search_policy) { // INCLUDE_DOT_DOT must not be specified if recursive. DCHECK(!(recursive && (INCLUDE_DOT_DOT & file_type_))); - // The Windows version of this code appends the pattern to the root_path, - // potentially only matching against items in the top-most directory. - // Do the same here. - if (pattern.empty()) - pattern_ = FilePath::StringType(); + pending_paths_.push(root_path); } @@ -74,6 +96,8 @@ } FilePath FileEnumerator::Next() { + base::ThreadRestrictions::AssertIOAllowed(); + ++current_directory_entry_; // While we've exhausted the entries in the current directory, do the next @@ -85,29 +109,66 @@ root_path_ = root_path_.StripTrailingSeparators(); pending_paths_.pop(); - std::vector<FileInfo> entries; - if (!ReadDirectory(&entries, root_path_, file_type_ & SHOW_SYM_LINKS)) + DIR* dir = opendir(root_path_.value().c_str()); + if (!dir) continue; directory_entries_.clear(); + +#if defined(OS_FUCHSIA) + // Fuchsia does not support .. on the file system server side, see + // https://fuchsia.googlesource.com/docs/+/master/dotdot.md and + // https://crbug.com/735540. However, for UI purposes, having the parent + // directory show up in directory listings makes sense, so we add it here to + // match the expectation on other operating systems. In cases where this + // is useful it should be resolvable locally. + FileInfo dotdot; + dotdot.stat_.st_mode = S_IFDIR; + dotdot.filename_ = FilePath(".."); + directory_entries_->push_back(dotdot); +#endif // OS_FUCHSIA + current_directory_entry_ = 0; - for (std::vector<FileInfo>::const_iterator i = entries.begin(); - i != entries.end(); ++i) { - FilePath full_path = root_path_.Append(i->filename_); - if (ShouldSkip(full_path)) + struct dirent* dent; + while ((dent = readdir(dir))) { + FileInfo info; + info.filename_ = FilePath(dent->d_name); + + if (ShouldSkip(info.filename_)) continue; - if (pattern_.size() && - fnmatch(pattern_.c_str(), full_path.value().c_str(), FNM_NOESCAPE)) + const bool is_pattern_matched = IsPatternMatched(info.filename_); + + // MATCH_ONLY policy enumerates files and directories which matching + // pattern only. So we can early skip further checks. + if (folder_search_policy_ == FolderSearchPolicy::MATCH_ONLY && + !is_pattern_matched) continue; - if (recursive_ && S_ISDIR(i->stat_.st_mode)) + // Do not call OS stat/lstat if there is no sense to do it. If pattern is + // not matched (file will not appear in results) and search is not + // recursive (possible directory will not be added to pending paths) - + // there is no sense to obtain item below. + if (!recursive_ && !is_pattern_matched) + continue; + + const FilePath full_path = root_path_.Append(info.filename_); + GetStat(full_path, file_type_ & SHOW_SYM_LINKS, &info.stat_); + + const bool is_dir = S_ISDIR(info.stat_.st_mode); + + if (recursive_ && is_dir) pending_paths_.push(full_path); - if ((S_ISDIR(i->stat_.st_mode) && (file_type_ & DIRECTORIES)) || - (!S_ISDIR(i->stat_.st_mode) && (file_type_ & FILES))) - directory_entries_.push_back(*i); + if (is_pattern_matched && IsTypeMatched(is_dir)) + directory_entries_.push_back(std::move(info)); } + closedir(dir); + + // MATCH_ONLY policy enumerates files in matched subfolders by "*" pattern. + // ALL policy enumerates files in all subfolders by origin pattern. + if (folder_search_policy_ == FolderSearchPolicy::MATCH_ONLY) + pattern_.clear(); } return root_path_.Append( @@ -118,51 +179,9 @@ return directory_entries_[current_directory_entry_]; } -bool FileEnumerator::ReadDirectory(std::vector<FileInfo>* entries, - const FilePath& source, bool show_links) { - base::ThreadRestrictions::AssertIOAllowed(); - DIR* dir = opendir(source.value().c_str()); - if (!dir) - return false; - -#if defined(OS_FUCHSIA) - // Fuchsia does not support .. on the file system server side, see - // https://fuchsia.googlesource.com/docs/+/master/dotdot.md and - // https://crbug.com/735540. However, for UI purposes, having the parent - // directory show up in directory listings makes sense, so we add it here to - // match the expectation on other operating systems. In cases where this - // is useful it should be resolvable locally. - FileInfo dotdot; - dotdot.stat_.st_mode = S_IFDIR; - dotdot.filename_ = FilePath(".."); - entries->push_back(dotdot); -#endif // OS_FUCHSIA - - struct dirent* dent; - while ((dent = readdir(dir))) { - FileInfo info; - info.filename_ = FilePath(dent->d_name); - - FilePath full_name = source.Append(dent->d_name); - int ret; - if (show_links) - ret = lstat(full_name.value().c_str(), &info.stat_); - else - ret = stat(full_name.value().c_str(), &info.stat_); - if (ret < 0) { - // Print the stat() error message unless it was ENOENT and we're - // following symlinks. - if (!(errno == ENOENT && !show_links)) { - DPLOG(ERROR) << "Couldn't stat " - << source.Append(dent->d_name).value(); - } - memset(&info.stat_, 0, sizeof(info.stat_)); - } - entries->push_back(info); - } - - closedir(dir); - return true; +bool FileEnumerator::IsPatternMatched(const FilePath& path) const { + return pattern_.empty() || + !fnmatch(pattern_.c_str(), path.value().c_str(), FNM_NOESCAPE); } } // namespace base
diff --git a/base/files/file_enumerator_unittest.cc b/base/files/file_enumerator_unittest.cc new file mode 100644 index 0000000..5faa80f7 --- /dev/null +++ b/base/files/file_enumerator_unittest.cc
@@ -0,0 +1,312 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/files/file_enumerator.h" + +#include <deque> +#include <utility> +#include <vector> + +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/files/scoped_temp_dir.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +using testing::ElementsAre; +using testing::IsEmpty; +using testing::UnorderedElementsAre; + +namespace base { +namespace { + +const FilePath::StringType kEmptyPattern; + +const std::vector<FileEnumerator::FolderSearchPolicy> kFolderSearchPolicies{ + FileEnumerator::FolderSearchPolicy::MATCH_ONLY, + FileEnumerator::FolderSearchPolicy::ALL}; + +std::deque<FilePath> RunEnumerator( + const FilePath& root_path, + bool recursive, + int file_type, + const FilePath::StringType& pattern, + FileEnumerator::FolderSearchPolicy folder_search_policy) { + std::deque<FilePath> rv; + FileEnumerator enumerator(root_path, recursive, file_type, pattern, + folder_search_policy); + for (auto file = enumerator.Next(); !file.empty(); file = enumerator.Next()) + rv.emplace_back(std::move(file)); + return rv; +} + +bool CreateDummyFile(const FilePath& path) { + return WriteFile(path, "42", sizeof("42")) == sizeof("42"); +} + +} // namespace + +TEST(FileEnumerator, NotExistingPath) { + const FilePath path = FilePath::FromUTF8Unsafe("some_not_existing_path"); + ASSERT_FALSE(PathExists(path)); + + for (auto policy : kFolderSearchPolicies) { + const auto files = RunEnumerator( + path, true, FileEnumerator::FILES & FileEnumerator::DIRECTORIES, + FILE_PATH_LITERAL(""), policy); + EXPECT_THAT(files, IsEmpty()); + } +} + +TEST(FileEnumerator, EmptyFolder) { + ScopedTempDir temp_dir; + ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); + + for (auto policy : kFolderSearchPolicies) { + const auto files = + RunEnumerator(temp_dir.GetPath(), true, + FileEnumerator::FILES & FileEnumerator::DIRECTORIES, + kEmptyPattern, policy); + EXPECT_THAT(files, IsEmpty()); + } +} + +TEST(FileEnumerator, SingleFileInFolderForFileSearch) { + ScopedTempDir temp_dir; + ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); + + const FilePath& path = temp_dir.GetPath(); + const FilePath file = path.AppendASCII("test.txt"); + ASSERT_TRUE(CreateDummyFile(file)); + + for (auto policy : kFolderSearchPolicies) { + const auto files = RunEnumerator( + temp_dir.GetPath(), true, FileEnumerator::FILES, kEmptyPattern, policy); + EXPECT_THAT(files, ElementsAre(file)); + } +} + +TEST(FileEnumerator, SingleFileInFolderForDirSearch) { + ScopedTempDir temp_dir; + ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); + + const FilePath& path = temp_dir.GetPath(); + ASSERT_TRUE(CreateDummyFile(path.AppendASCII("test.txt"))); + + for (auto policy : kFolderSearchPolicies) { + const auto files = RunEnumerator(path, true, FileEnumerator::DIRECTORIES, + kEmptyPattern, policy); + EXPECT_THAT(files, IsEmpty()); + } +} + +TEST(FileEnumerator, SingleFileInFolderWithFiltering) { + ScopedTempDir temp_dir; + ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); + + const FilePath& path = temp_dir.GetPath(); + const FilePath file = path.AppendASCII("test.txt"); + ASSERT_TRUE(CreateDummyFile(file)); + + for (auto policy : kFolderSearchPolicies) { + auto files = RunEnumerator(path, true, FileEnumerator::FILES, + FILE_PATH_LITERAL("*.txt"), policy); + EXPECT_THAT(files, ElementsAre(file)); + + files = RunEnumerator(path, true, FileEnumerator::FILES, + FILE_PATH_LITERAL("*.pdf"), policy); + EXPECT_THAT(files, IsEmpty()); + } +} + +TEST(FileEnumerator, TwoFilesInFolder) { + ScopedTempDir temp_dir; + ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); + + const FilePath& path = temp_dir.GetPath(); + const FilePath foo_txt = path.AppendASCII("foo.txt"); + const FilePath bar_txt = path.AppendASCII("bar.txt"); + ASSERT_TRUE(CreateDummyFile(foo_txt)); + ASSERT_TRUE(CreateDummyFile(bar_txt)); + + for (auto policy : kFolderSearchPolicies) { + auto files = RunEnumerator(path, true, FileEnumerator::FILES, + FILE_PATH_LITERAL("*.txt"), policy); + EXPECT_THAT(files, UnorderedElementsAre(foo_txt, bar_txt)); + + files = RunEnumerator(path, true, FileEnumerator::FILES, + FILE_PATH_LITERAL("foo*"), policy); + EXPECT_THAT(files, ElementsAre(foo_txt)); + + files = RunEnumerator(path, true, FileEnumerator::FILES, + FILE_PATH_LITERAL("*.pdf"), policy); + EXPECT_THAT(files, IsEmpty()); + + files = + RunEnumerator(path, true, FileEnumerator::FILES, kEmptyPattern, policy); + EXPECT_THAT(files, UnorderedElementsAre(foo_txt, bar_txt)); + } +} + +TEST(FileEnumerator, SingleFolderInFolderForFileSearch) { + ScopedTempDir temp_dir; + ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); + + const FilePath& path = temp_dir.GetPath(); + + ScopedTempDir temp_subdir; + ASSERT_TRUE(temp_subdir.CreateUniqueTempDirUnderPath(path)); + + for (auto policy : kFolderSearchPolicies) { + const auto files = + RunEnumerator(path, true, FileEnumerator::FILES, kEmptyPattern, policy); + EXPECT_THAT(files, IsEmpty()); + } +} + +TEST(FileEnumerator, SingleFolderInFolderForDirSearch) { + ScopedTempDir temp_dir; + ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); + + const FilePath& path = temp_dir.GetPath(); + + ScopedTempDir temp_subdir; + ASSERT_TRUE(temp_subdir.CreateUniqueTempDirUnderPath(path)); + + for (auto policy : kFolderSearchPolicies) { + const auto files = RunEnumerator(path, true, FileEnumerator::DIRECTORIES, + kEmptyPattern, policy); + EXPECT_THAT(files, ElementsAre(temp_subdir.GetPath())); + } +} + +TEST(FileEnumerator, TwoFoldersInFolder) { + ScopedTempDir temp_dir; + ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); + + const FilePath& path = temp_dir.GetPath(); + + const FilePath subdir_foo = path.AppendASCII("foo"); + const FilePath subdir_bar = path.AppendASCII("bar"); + ASSERT_TRUE(CreateDirectory(subdir_foo)); + ASSERT_TRUE(CreateDirectory(subdir_bar)); + + for (auto policy : kFolderSearchPolicies) { + auto files = RunEnumerator(path, true, FileEnumerator::DIRECTORIES, + kEmptyPattern, policy); + EXPECT_THAT(files, UnorderedElementsAre(subdir_foo, subdir_bar)); + + files = RunEnumerator(path, true, FileEnumerator::DIRECTORIES, + FILE_PATH_LITERAL("foo"), policy); + EXPECT_THAT(files, ElementsAre(subdir_foo)); + } +} + +TEST(FileEnumerator, FolderAndFileInFolder) { + ScopedTempDir temp_dir; + ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); + + const FilePath& path = temp_dir.GetPath(); + + ScopedTempDir temp_subdir; + ASSERT_TRUE(temp_subdir.CreateUniqueTempDirUnderPath(path)); + const FilePath file = path.AppendASCII("test.txt"); + ASSERT_TRUE(CreateDummyFile(file)); + + for (auto policy : kFolderSearchPolicies) { + auto files = + RunEnumerator(path, true, FileEnumerator::FILES, kEmptyPattern, policy); + EXPECT_THAT(files, ElementsAre(file)); + + files = RunEnumerator(path, true, FileEnumerator::DIRECTORIES, + kEmptyPattern, policy); + EXPECT_THAT(files, ElementsAre(temp_subdir.GetPath())); + + files = RunEnumerator(path, true, + FileEnumerator::FILES | FileEnumerator::DIRECTORIES, + kEmptyPattern, policy); + EXPECT_THAT(files, UnorderedElementsAre(file, temp_subdir.GetPath())); + } +} + +TEST(FileEnumerator, FilesInParentFolderAlwaysFirst) { + ScopedTempDir temp_dir; + ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); + + const FilePath& path = temp_dir.GetPath(); + + ScopedTempDir temp_subdir; + ASSERT_TRUE(temp_subdir.CreateUniqueTempDirUnderPath(path)); + const FilePath foo_txt = path.AppendASCII("foo.txt"); + const FilePath bar_txt = temp_subdir.GetPath().AppendASCII("bar.txt"); + ASSERT_TRUE(CreateDummyFile(foo_txt)); + ASSERT_TRUE(CreateDummyFile(bar_txt)); + + for (auto policy : kFolderSearchPolicies) { + const auto files = + RunEnumerator(path, true, FileEnumerator::FILES, kEmptyPattern, policy); + EXPECT_THAT(files, ElementsAre(foo_txt, bar_txt)); + } +} + +TEST(FileEnumerator, FileInSubfolder) { + ScopedTempDir temp_dir; + ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); + + const FilePath subdir = temp_dir.GetPath().AppendASCII("subdir"); + ASSERT_TRUE(CreateDirectory(subdir)); + + const FilePath file = subdir.AppendASCII("test.txt"); + ASSERT_TRUE(CreateDummyFile(file)); + + for (auto policy : kFolderSearchPolicies) { + auto files = RunEnumerator(temp_dir.GetPath(), true, FileEnumerator::FILES, + kEmptyPattern, policy); + EXPECT_THAT(files, ElementsAre(file)); + + files = RunEnumerator(temp_dir.GetPath(), false, FileEnumerator::FILES, + kEmptyPattern, policy); + EXPECT_THAT(files, IsEmpty()); + } +} + +TEST(FileEnumerator, FilesInSubfoldersWithFiltering) { + ScopedTempDir temp_dir; + ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); + + const FilePath test_txt = temp_dir.GetPath().AppendASCII("test.txt"); + const FilePath subdir_foo = temp_dir.GetPath().AppendASCII("foo_subdir"); + const FilePath subdir_bar = temp_dir.GetPath().AppendASCII("bar_subdir"); + const FilePath foo_test = subdir_foo.AppendASCII("test.txt"); + const FilePath foo_foo = subdir_foo.AppendASCII("foo.txt"); + const FilePath foo_bar = subdir_foo.AppendASCII("bar.txt"); + const FilePath bar_test = subdir_bar.AppendASCII("test.txt"); + const FilePath bar_foo = subdir_bar.AppendASCII("foo.txt"); + const FilePath bar_bar = subdir_bar.AppendASCII("bar.txt"); + ASSERT_TRUE(CreateDummyFile(test_txt)); + ASSERT_TRUE(CreateDirectory(subdir_foo)); + ASSERT_TRUE(CreateDirectory(subdir_bar)); + ASSERT_TRUE(CreateDummyFile(foo_test)); + ASSERT_TRUE(CreateDummyFile(foo_foo)); + ASSERT_TRUE(CreateDummyFile(foo_bar)); + ASSERT_TRUE(CreateDummyFile(bar_test)); + ASSERT_TRUE(CreateDummyFile(bar_foo)); + ASSERT_TRUE(CreateDummyFile(bar_bar)); + + auto files = + RunEnumerator(temp_dir.GetPath(), true, + FileEnumerator::FILES | FileEnumerator::DIRECTORIES, + FILE_PATH_LITERAL("foo*"), + FileEnumerator::FolderSearchPolicy::MATCH_ONLY); + EXPECT_THAT(files, + UnorderedElementsAre(subdir_foo, foo_test, foo_foo, foo_bar)); + + files = RunEnumerator(temp_dir.GetPath(), true, + FileEnumerator::FILES | FileEnumerator::DIRECTORIES, + FILE_PATH_LITERAL("foo*"), + FileEnumerator::FolderSearchPolicy::ALL); + EXPECT_THAT(files, UnorderedElementsAre(subdir_foo, foo_foo, bar_foo)); +} + +} // namespace base
diff --git a/base/files/file_enumerator_win.cc b/base/files/file_enumerator_win.cc index e629cc2..826e293 100644 --- a/base/files/file_enumerator_win.cc +++ b/base/files/file_enumerator_win.cc
@@ -4,6 +4,7 @@ #include "base/files/file_enumerator.h" +#include <shlwapi.h> #include <stdint.h> #include <string.h> @@ -12,6 +13,25 @@ namespace base { +namespace { + +FilePath BuildSearchFilter(FileEnumerator::FolderSearchPolicy policy, + const FilePath& root_path, + const FilePath::StringType& pattern) { + // MATCH_ONLY policy filters incoming files by pattern on OS side. ALL policy + // collects all files and filters them manually. + switch (policy) { + case FileEnumerator::FolderSearchPolicy::MATCH_ONLY: + return root_path.Append(pattern); + case FileEnumerator::FolderSearchPolicy::ALL: + return root_path.Append(L"*"); + } + NOTREACHED(); + return {}; +} + +} // namespace + // FileEnumerator::FileInfo ---------------------------------------------------- FileEnumerator::FileInfo::FileInfo() { @@ -44,25 +64,31 @@ FileEnumerator::FileEnumerator(const FilePath& root_path, bool recursive, int file_type) - : has_find_data_(false), - find_handle_(INVALID_HANDLE_VALUE), - recursive_(recursive), - file_type_(file_type) { - // INCLUDE_DOT_DOT must not be specified if recursive. - DCHECK(!(recursive && (INCLUDE_DOT_DOT & file_type_))); - memset(&find_data_, 0, sizeof(find_data_)); - pending_paths_.push(root_path); -} + : FileEnumerator(root_path, + recursive, + file_type, + FilePath::StringType(), + FolderSearchPolicy::MATCH_ONLY) {} FileEnumerator::FileEnumerator(const FilePath& root_path, bool recursive, int file_type, const FilePath::StringType& pattern) - : has_find_data_(false), - find_handle_(INVALID_HANDLE_VALUE), - recursive_(recursive), + : FileEnumerator(root_path, + recursive, + file_type, + pattern, + FolderSearchPolicy::MATCH_ONLY) {} + +FileEnumerator::FileEnumerator(const FilePath& root_path, + bool recursive, + int file_type, + const FilePath::StringType& pattern, + FolderSearchPolicy folder_search_policy) + : recursive_(recursive), file_type_(file_type), - pattern_(pattern) { + pattern_(!pattern.empty() ? pattern : L"*"), + folder_search_policy_(folder_search_policy) { // INCLUDE_DOT_DOT must not be specified if recursive. DCHECK(!(recursive && (INCLUDE_DOT_DOT & file_type_))); memset(&find_data_, 0, sizeof(find_data_)); @@ -94,21 +120,12 @@ pending_paths_.pop(); // Start a new find operation. - FilePath src = root_path_; - - if (pattern_.empty()) - src = src.Append(L"*"); // No pattern = match everything. - else - src = src.Append(pattern_); - - // Use a "large fetch" which should speed up large enumerations (we seldom - // abort in the middle). + const FilePath src = + BuildSearchFilter(folder_search_policy_, root_path_, pattern_); find_handle_ = FindFirstFileEx(src.value().c_str(), FindExInfoBasic, // Omit short name. - &find_data_, - FindExSearchNameMatch, - NULL, - FIND_FIRST_EX_LARGE_FETCH); + &find_data_, FindExSearchNameMatch, + nullptr, FIND_FIRST_EX_LARGE_FETCH); has_find_data_ = true; } else { // Search for the next file/directory. @@ -121,41 +138,58 @@ if (INVALID_HANDLE_VALUE == find_handle_) { has_find_data_ = false; - // This is reached when we have finished a directory and are advancing to - // the next one in the queue. We applied the pattern (if any) to the files - // in the root search directory, but for those directories which were - // matched, we want to enumerate all files inside them. This will happen - // when the handle is empty. - pattern_ = FilePath::StringType(); - - continue; - } - - FilePath cur_file(find_data_.cFileName); - if (ShouldSkip(cur_file)) - continue; - - // Construct the absolute filename. - cur_file = root_path_.Append(find_data_.cFileName); - - if (find_data_.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - if (recursive_) { - // If |cur_file| is a directory, and we are doing recursive searching, - // add it to pending_paths_ so we scan it after we finish scanning this - // directory. However, don't do recursion through reparse points or we - // may end up with an infinite cycle. - DWORD attributes = GetFileAttributes(cur_file.value().c_str()); - if (!(attributes & FILE_ATTRIBUTE_REPARSE_POINT)) - pending_paths_.push(cur_file); + // MATCH_ONLY policy clears pattern for matched subfolders. ALL policy + // applies pattern for all subfolders. + if (folder_search_policy_ == FolderSearchPolicy::MATCH_ONLY) { + // This is reached when we have finished a directory and are advancing + // to the next one in the queue. We applied the pattern (if any) to the + // files in the root search directory, but for those directories which + // were matched, we want to enumerate all files inside them. This will + // happen when the handle is empty. + pattern_ = L"*"; } - if (file_type_ & FileEnumerator::DIRECTORIES) - return cur_file; - } else if (file_type_ & FileEnumerator::FILES) { - return cur_file; - } - } + continue; + } + + const FilePath filename(find_data_.cFileName); + if (ShouldSkip(filename)) + continue; + + const bool is_dir = + (find_data_.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; + const FilePath abs_path = root_path_.Append(filename); + + // Check if directory should be processed recursive. + if (is_dir && recursive_) { + // If |cur_file| is a directory, and we are doing recursive searching, + // add it to pending_paths_ so we scan it after we finish scanning this + // directory. However, don't do recursion through reparse points or we + // may end up with an infinite cycle. + DWORD attributes = GetFileAttributes(abs_path.value().c_str()); + if (!(attributes & FILE_ATTRIBUTE_REPARSE_POINT)) + pending_paths_.push(abs_path); + } + + if (IsTypeMatched(is_dir) && IsPatternMatched(filename)) + return abs_path; + } return FilePath(); } +bool FileEnumerator::IsPatternMatched(const FilePath& src) const { + switch (folder_search_policy_) { + case FolderSearchPolicy::MATCH_ONLY: + // MATCH_ONLY policy filters by pattern on search request, so all found + // files already fits to pattern. + return true; + case FolderSearchPolicy::ALL: + // ALL policy enumerates all files, we need to check pattern match + // manually. + return PathMatchSpec(src.value().c_str(), pattern_.c_str()) == TRUE; + } + NOTREACHED(); + return false; +} + } // namespace base
diff --git a/base/memory/raw_scoped_refptr_mismatch_checker.h b/base/memory/raw_scoped_refptr_mismatch_checker.h index 5dbc183..f480e07 100644 --- a/base/memory/raw_scoped_refptr_mismatch_checker.h +++ b/base/memory/raw_scoped_refptr_mismatch_checker.h
@@ -25,6 +25,9 @@ template <typename T> struct NeedsScopedRefptrButGetsRawPtr { + static_assert(!std::is_reference<T>::value, + "NeedsScopedRefptrButGetsRawPtr requires non-reference type."); + enum { // Human readable translation: you needed to be a scoped_refptr if you are a // raw pointer type and are convertible to a RefCounted(Base|ThreadSafeBase)
diff --git a/base/memory/ref_counted.cc b/base/memory/ref_counted.cc index ec082ba..e1558f4 100644 --- a/base/memory/ref_counted.cc +++ b/base/memory/ref_counted.cc
@@ -28,6 +28,15 @@ #endif } +#if !defined(ARCH_CPU_X86_FAMILY) +bool RefCountedThreadSafeBase::Release() const { + return ReleaseImpl(); +} +void RefCountedThreadSafeBase::AddRef() const { + AddRefImpl(); +} +#endif + #if DCHECK_IS_ON() bool RefCountedBase::CalledOnValidSequence() const { return sequence_checker_.CalledOnValidSequence() ||
diff --git a/base/memory/ref_counted.h b/base/memory/ref_counted.h index 743dbabd..ae9b6f01 100644 --- a/base/memory/ref_counted.h +++ b/base/memory/ref_counted.h
@@ -142,7 +142,31 @@ ~RefCountedThreadSafeBase(); - void AddRef() const { +// Release and AddRef are suitable for inlining on X86 because they generate +// very small code sequences. On other platforms (ARM), it causes a size +// regression and is probably not worth it. +#if defined(ARCH_CPU_X86_FAMILY) + // Returns true if the object should self-delete. + bool Release() const { return ReleaseImpl(); } + void AddRef() const { AddRefImpl(); } +#else + // Returns true if the object should self-delete. + bool Release() const; + void AddRef() const; +#endif + + private: + template <typename U> + friend scoped_refptr<U> base::AdoptRef(U*); + + void Adopted() const { +#if DCHECK_IS_ON() + DCHECK(needs_adopt_ref_); + needs_adopt_ref_ = false; +#endif + } + + ALWAYS_INLINE void AddRefImpl() const { #if DCHECK_IS_ON() DCHECK(!in_dtor_); DCHECK(!needs_adopt_ref_) @@ -153,8 +177,7 @@ AtomicRefCountInc(&ref_count_); } - // Returns true if the object should self-delete. - bool Release() const { + ALWAYS_INLINE bool ReleaseImpl() const { #if DCHECK_IS_ON() DCHECK(!in_dtor_); DCHECK(!AtomicRefCountIsZero(&ref_count_)); @@ -168,17 +191,6 @@ return false; } - private: - template <typename U> - friend scoped_refptr<U> base::AdoptRef(U*); - - void Adopted() const { -#if DCHECK_IS_ON() - DCHECK(needs_adopt_ref_); - needs_adopt_ref_ = false; -#endif - } - mutable AtomicRefCount ref_count_{0}; #if DCHECK_IS_ON() mutable bool needs_adopt_ref_ = false;
diff --git a/base/message_loop/message_pump_fuchsia.cc b/base/message_loop/message_pump_fuchsia.cc index 7d8b547b..fc47815 100644 --- a/base/message_loop/message_pump_fuchsia.cc +++ b/base/message_loop/message_pump_fuchsia.cc
@@ -169,13 +169,14 @@ controller->watcher_->OnFileCanWriteWithoutBlocking(controller->fd_); if (!controller_was_destroyed) controller->watcher_->OnFileCanReadWithoutBlocking(controller->fd_); - if (!controller_was_destroyed) - controller->was_destroyed_ = nullptr; } else if (events & MXIO_EVT_WRITABLE) { controller->watcher_->OnFileCanWriteWithoutBlocking(controller->fd_); } else if (events & MXIO_EVT_READABLE) { controller->watcher_->OnFileCanReadWithoutBlocking(controller->fd_); } + if (!controller_was_destroyed) { + controller->was_destroyed_ = nullptr; + } if (!controller_was_destroyed && controller->persistent_) { controller->WaitBegin(); }
diff --git a/base/metrics/field_trial.cc b/base/metrics/field_trial.cc index f3c16d2..dddc291 100644 --- a/base/metrics/field_trial.cc +++ b/base/metrics/field_trial.cc
@@ -14,6 +14,8 @@ #include "base/logging.h" #include "base/metrics/field_trial_param_associator.h" #include "base/process/memory.h" +#include "base/process/process_handle.h" +#include "base/process/process_info.h" #include "base/rand_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" @@ -1142,6 +1144,17 @@ if (!base::StringToInt(tokens[0], &field_trial_handle)) return SharedMemoryHandle(); RawHandle handle = reinterpret_cast<RawHandle>(field_trial_handle); +#if defined(OS_WIN) + if (base::IsCurrentProcessElevated()) { + // base::LaunchElevatedProcess doesn't have a way to duplicate the handle, + // but this process can since by definition it's not sandboxed. + base::ProcessId parent_pid = base::GetParentProcessId(GetCurrentProcess()); + HANDLE parent_handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, parent_pid); + DuplicateHandle(parent_handle, handle, GetCurrentProcess(), &handle, 0, + FALSE, DUPLICATE_SAME_ACCESS); + CloseHandle(parent_handle); + } +#endif base::UnguessableToken guid; if (!DeserializeGUIDFromStringPieces(tokens[1], tokens[2], &guid))
diff --git a/base/numerics/README.md b/base/numerics/README.md new file mode 100644 index 0000000..d89df9ea --- /dev/null +++ b/base/numerics/README.md
@@ -0,0 +1,260 @@ +# `base/numerics` + +This directory contains templates providing well-defined semantics for safely +handling a variety of numeric operations, including most common arithmetic +operations and conversions. + +The public API is broken out into the following header files: + +* `checked_math.h` contains the `CheckedNumeric` template class and helper + functions for performing arithmetic and conversion operations that detect + errors and boundary conditions (e.g. overflow, truncation, etc.). +* `clamped_math.h` contains the `ClampedNumeric` template class and + helper functions for performing fast, clamped (i.e. non-sticky saturating) + arithmetic operations and conversions. +* `safe_conversions.h` contains the `StrictNumeric` template class and + a collection of custom casting templates and helper functions for safely + converting between a range of numeric types. +* `safe_math.h` includes all of the previously mentioned headers. + +*** aside +**Note:** The `Numeric` template types implicitly convert from C numeric types +and `Numeric` templates that are convertable to an underlying C numeric type. +The conversion priority for `Numeric` type coercions is: + +* `StrictNumeric` coerces to `ClampedNumeric` and `CheckedNumeric` +* `ClampedNumeric` coerces to `CheckedNumeric` +*** + +[TOC] + +## Conversion functions and `StrictNumeric<>` in `safe_conversions.h` + +This header includes a collection of helper `constexpr` templates for safely +performing a range of conversions, assignments, and tests. + +### Safe casting templates + +* `as_signed()` - Returns the supplied integral value as a signed type of + the same width. +* `as_unsigned()` - Returns the supplied integral value as an unsigned type + of the same width. +* `checked_cast<>()` - Analogous to `static_cast<>` for numeric types, except + that by default it will trigger a crash on an out-of-bounds conversion (e.g. + overflow, underflow, NaN to integral) or a compile error if the conversion + error can be detected at compile time. The crash handler can be overridden + to perform a behavior other than crashing. +* `saturated_cast<>()` - Analogous to `static_cast` for numeric types, except + that it returns a saturated result when the specified numeric conversion + would otherwise overflow or underflow. An NaN source returns 0 by + default, but can be overridden to return a different result. +* `strict_cast<>()` - Analogous to `static_cast` for numeric types, except + this causes a compile failure if the destination type is not large + enough to contain any value in the source type. It performs no runtime + checking and thus introduces no runtime overhead. + +### Other helper and conversion functions + +* `IsValueInRangeForNumericType<>()` - A convenience function that returns + true if the type supplied to the template parameter can represent the value + passed as an argument to the function. +* `IsValueNegative()` - A convenience function that will accept any + arithmetic type as an argument and will return whether the value is less + than zero. Unsigned types always return false. +* `SafeUnsignedAbs()` - Returns the absolute value of the supplied integer + parameter as an unsigned result (thus avoiding an overflow if the value + is the signed, two's complement minimum). + +### `StrictNumeric<>` + +`StrictNumeric<>` is a wrapper type that performs assignments and copies via +the `strict_cast` template, and can perform valid arithmetic comparisons +across any range of arithmetic types. `StrictNumeric` is the return type for +values extracted from a `CheckedNumeric` class instance. The raw numeric value +is extracted via `static_cast` to the underlying type or any type with +sufficient range to represent the underlying type. + +* `MakeStrictNum()` - Creates a new `StrictNumeric` from the underlying type + of the supplied arithmetic or StrictNumeric type. +* `SizeT` - Alias for `StrictNumeric<size_t>`. + +## `CheckedNumeric<>` in `checked_math.h` + +`CheckedNumeric<>` implements all the logic and operators for detecting integer +boundary conditions such as overflow, underflow, and invalid conversions. +The `CheckedNumeric` type implicitly converts from floating point and integer +data types, and contains overloads for basic arithmetic operations (i.e.: `+`, +`-`, `*`, `/` for all types and `%`, `<<`, `>>`, `&`, `|`, `^` for integers). +Type promotions are a slightly modified version of the [standard C/C++ numeric +promotions +](http://en.cppreference.com/w/cpp/language/implicit_conversion#Numeric_promotions) +with the two differences being that there is no default promotion to int +and bitwise logical operations always return an unsigned of the wider type. + +### Members + +The unary negation, increment, and decrement operators are supported, along +with the following unary arithmetic methods, which return a new +`CheckedNumeric` as a result of the operation: + +* `Abs()` - Absolute value. +* `UnsignedAbs()` - Absolute value as an equal-width unsigned underlying type + (valid for only integral types). +* `Max()` - Returns whichever is greater of the current instance or argument. + The underlying return type is whichever has the greatest magnitude. +* `Min()` - Returns whichever is lowest of the current instance or argument. + The underlying return type is whichever has can represent the lowest + number in the smallest width (e.g. int8_t over unsigned, int over + int8_t, and float over int). + +The following are for converting `CheckedNumeric` instances: + +* `type` - The underlying numeric type. +* `AssignIfValid()` - Assigns the underlying value to the supplied + destination pointer if the value is currently valid and within the + range supported by the destination type. Returns true on success. +* `Cast<>()` - Instance method returning a `CheckedNumeric` derived from + casting the current instance to a `CheckedNumeric` of the supplied + destination type. + +*** aside +The following member functions return a `StrictNumeric`, which is valid for +comparison and assignment operations, but will trigger a compile failure on +attempts to assign to a type of insufficient range. The underlying value can +be extracted by an explicit `static_cast` to the underlying type or any type +with sufficient range to represent the underlying type. +*** + +* `IsValid()` - Returns true if the underlying numeric value is valid (i.e. + has not wrapped or saturated and is not the result of an invalid + conversion). +* `ValueOrDie()` - Returns the underlying value. If the state is not valid + this call will trigger a crash by default (but may be overridden by + supplying an alternate handler to the template). +* `ValueOrDefault()` - Returns the current value, or the supplied default if + the state is not valid (but will not crash). + +**Comparison operators are explicitly not provided** for `CheckedNumeric` +types because they could result in a crash if the type is not in a valid state. +Patterns like the following should be used instead: + +```cpp +CheckedNumeric<size_t> checked_size = untrusted_input_value; +checked_size += HEADER LENGTH; +if (checked_size.IsValid() && checked_size.ValueOrDie() < buffer_size) { + \\ Do stuff on success... +} else { + \\ Handle an error... +} +``` + +### Non-member helper functions + +The following variadic convenience functions, which accept standard arithmetic +or `CheckedNumeric` types, perform arithmetic operations, and return a +`CheckedNumeric` result. The supported functions are: + +* `CheckAdd()` - Addition. +* `CheckSub()` - Subtraction. +* `CheckMul()` - Multiplication. +* `CheckDiv()` - Division. +* `CheckMod()` - Modulus (integer only). +* `CheckLsh()` - Left integer shift (integer only). +* `CheckRsh()` - Right integer shift (integer only). +* `CheckAnd()` - Bitwise AND (integer only with unsigned result). +* `CheckOr()` - Bitwise OR (integer only with unsigned result). +* `CheckXor()` - Bitwise XOR (integer only with unsigned result). +* `CheckMax()` - Maximum of supplied arguments. +* `CheckMin()` - Minimum of supplied arguments. + +The following wrapper functions can be used to avoid the template +disambiguator syntax when converting a destination type. + +* `IsValidForType<>()` in place of: `a.template IsValid<>()` +* `ValueOrDieForType<>()` in place of: `a.template ValueOrDie<>()` +* `ValueOrDefaultForType<>()` in place of: `a.template ValueOrDefault<>()` + +The following general utility methods is are useful for converting from +arithmetic types to `CheckedNumeric` types: + +* `MakeCheckedNum()` - Creates a new `CheckedNumeric` from the underlying type + of the supplied arithmetic or directly convertible type. + +## `ClampedNumeric<>` in `clamped_math.h` + +`ClampedNumeric<>` implements all the logic and operators for clamped +(non-sticky saturating) arithmetic operations and conversions. The +`ClampedNumeric` type implicitly converts back and forth between floating point +and integer data types, saturating on assignment as appropriate. It contains +overloads for basic arithmetic operations (i.e.: `+`, `-`, `*`, `/` for +all types and `%`, `<<`, `>>`, `&`, `|`, `^` for integers) along with comparison +operators for arithmetic types of any size. Type promotions are a slightly +modified version of the [standard C/C++ numeric promotions +](http://en.cppreference.com/w/cpp/language/implicit_conversion#Numeric_promotions) +with the two differences being that there is no default promotion to int and +bitwise logical operations always return an unsigned of the wider type. + +*** aside +Most arithmetic operations saturate normally, to the numeric limit in the +direction of the sign. The potentially unusual cases are: + +* **Division:** Division by zero returns the saturated limit in the direction + of sign of the dividend (first argument). The one exception is 0/0, which + returns zero (although logically is NaN). +* **Modulus:** Division by zero returns the dividend (first argument). +* **Left shift:** Non-zero values saturate in the direction of the signed + limit (max/min), even for shifts larger than the bit width. 0 shifted any + amount results in 0. +* **Right shift:** Negative values saturate to -1. Positive or 0 saturates + to 0. +* **Bitwise operations:** No saturation; bit pattern is identical to + non-saturated bitwise operations. +*** + +### Members + +The unary negation, increment, and decrement operators are supported, along +with the following unary arithmetic methods, which return a new +`ClampedNumeric` as a result of the operation: + +* `Abs()` - Absolute value. +* `UnsignedAbs()` - Absolute value as an equal-width unsigned underlying type + (valid for only integral types). +* `Max()` - Returns whichever is greater of the current instance or argument. + The underlying return type is whichever has the greatest magnitude. +* `Min()` - Returns whichever is lowest of the current instance or argument. + The underlying return type is whichever has can represent the lowest + number in the smallest width (e.g. int8_t over unsigned, int over + int8_t, and float over int). + +The following are for converting `ClampedNumeric` instances: + +* `type` - The underlying numeric type. +* `Cast<>()` - Instance method returning a `ClampedNumeric` derived from + casting the current instance to a `ClampedNumeric` of the supplied + destination type. + +### Non-member helper functions + +The following variadic convenience functions, which accept standard arithmetic +or `ClampedNumeric` types, perform arithmetic operations, and return a +`ClampedNumeric` result. The supported functions are: + +* `ClampAdd()` - Addition. +* `ClampSub()` - Subtraction. +* `ClampMul()` - Multiplication. +* `ClampDiv()` - Division. +* `ClampMod()` - Modulus (integer only). +* `ClampLsh()` - Left integer shift (integer only). +* `ClampRsh()` - Right integer shift (integer only). +* `ClampAnd()` - Bitwise AND (integer only with unsigned result). +* `ClampOr()` - Bitwise OR (integer only with unsigned result). +* `ClampXor()` - Bitwise XOR (integer only with unsigned result). +* `ClampMax()` - Maximum of supplied arguments. +* `ClampMin()` - Minimum of supplied arguments. + +The following is a general utility method that is useful for converting +to a `ClampedNumeric` type: + +* `MakeClampedNum()` - Creates a new `ClampedNumeric` from the underlying type + of the supplied arithmetic or directly convertible type.
diff --git a/base/numerics/checked_math.h b/base/numerics/checked_math.h index 00a88e3a..1f8ea9d 100644 --- a/base/numerics/checked_math.h +++ b/base/numerics/checked_math.h
@@ -15,82 +15,6 @@ namespace base { namespace internal { -// CheckedNumeric<> implements all the logic and operators for detecting integer -// boundary conditions such as overflow, underflow, and invalid conversions. -// The CheckedNumeric type implicitly converts from floating point and integer -// data types, and contains overloads for basic arithmetic operations (i.e.: +, -// -, *, / for all types and %, <<, >>, &, |, ^ for integers). Type promotions -// are a slightly modified version of the standard C arithmetic rules with the -// two differences being that there is no default promotion to int and bitwise -// logical operations always return an unsigned of the wider type. -// -// You may also use one of the variadic convenience functions, which accept -// standard arithmetic or CheckedNumeric types, perform arithmetic operations, -// and return a CheckedNumeric result. The supported functions are: -// CheckAdd() - Addition. -// CheckSub() - Subtraction. -// CheckMul() - Multiplication. -// CheckDiv() - Division. -// CheckMod() - Modulous (integer only). -// CheckLsh() - Left integer shift (integer only). -// CheckRsh() - Right integer shift (integer only). -// CheckAnd() - Bitwise AND (integer only with unsigned result). -// CheckOr() - Bitwise OR (integer only with unsigned result). -// CheckXor() - Bitwise XOR (integer only with unsigned result). -// CheckMax() - Maximum of supplied arguments. -// CheckMin() - Minimum of supplied arguments. -// -// The unary negation, increment, and decrement operators are supported, along -// with the following unary arithmetic methods, which return a new -// CheckedNumeric as a result of the operation: -// Abs() - Absolute value. -// UnsignedAbs() - Absolute value as an equal-width unsigned underlying type -// (valid for only integral types). -// Max() - Returns whichever is greater of the current instance or argument. -// The underlying return type is whichever has the greatest magnitude. -// Min() - Returns whichever is lowest of the current instance or argument. -// The underlying return type is whichever has can represent the lowest -// number in the smallest width (e.g. int8_t over unsigned, int over -// int8_t, and float over int). -// -// The following methods convert from CheckedNumeric to standard numeric values: -// AssignIfValid() - Assigns the underlying value to the supplied destination -// pointer if the value is currently valid and within the range -// supported by the destination type. Returns true on success. -// **************************************************************************** -// * WARNING: All of the following functions return a StrictNumeric, which * -// * is valid for comparison and assignment operations, but will trigger a * -// * compile failure on attempts to assign to a type of insufficient range. * -// **************************************************************************** -// IsValid() - Returns true if the underlying numeric value is valid (i.e. has -// has not wrapped and is not the result of an invalid conversion). -// ValueOrDie() - Returns the underlying value. If the state is not valid this -// call will crash on a CHECK. -// ValueOrDefault() - Returns the current value, or the supplied default if the -// state is not valid (will not trigger a CHECK). -// -// The following wrapper functions can be used to avoid the template -// disambiguator syntax when converting a destination type. -// IsValidForType<>() in place of: a.template IsValid<Dst>() -// ValueOrDieForType<>() in place of: a.template ValueOrDie() -// ValueOrDefaultForType<>() in place of: a.template ValueOrDefault(default) -// -// The following are general utility methods that are useful for converting -// between arithmetic types and CheckedNumeric types: -// CheckedNumeric::Cast<Dst>() - Instance method returning a CheckedNumeric -// derived from casting the current instance to a CheckedNumeric of -// the supplied destination type. -// MakeCheckedNum() - Creates a new CheckedNumeric from the underlying type of -// the supplied arithmetic, CheckedNumeric, or StrictNumeric type. -// -// Comparison operations are explicitly not supported because they could result -// in a crash on an unexpected CHECK condition. You should use patterns like the -// following for comparisons: -// CheckedNumeric<size_t> checked_size = untrusted_input_value; -// checked_size += HEADER LENGTH; -// if (checked_size.IsValid() && checked_size.ValueOrDie() < buffer_size) -// Do stuff... - template <typename T> class CheckedNumeric { static_assert(std::is_arithmetic<T>::value, @@ -377,8 +301,8 @@ template <template <typename, typename, typename> class M, typename L, typename R> -CheckedNumeric<typename MathWrapper<M, L, R>::type> ChkMathOp(const L lhs, - const R rhs) { +CheckedNumeric<typename MathWrapper<M, L, R>::type> CheckMathOp(const L lhs, + const R rhs) { using Math = typename MathWrapper<M, L, R>::math; return CheckedNumeric<typename Math::result_type>::template MathOp<M>(lhs, rhs); @@ -390,10 +314,10 @@ typename R, typename... Args> CheckedNumeric<typename ResultType<M, L, R, Args...>::type> -ChkMathOp(const L lhs, const R rhs, const Args... args) { - auto tmp = ChkMathOp<M>(lhs, rhs); - return tmp.IsValid() ? ChkMathOp<M>(tmp, args...) - : decltype(ChkMathOp<M>(tmp, args...))(tmp); +CheckMathOp(const L lhs, const R rhs, const Args... args) { + auto tmp = CheckMathOp<M>(lhs, rhs); + return tmp.IsValid() ? CheckMathOp<M>(tmp, args...) + : decltype(CheckMathOp<M>(tmp, args...))(tmp); } BASE_NUMERIC_ARITHMETIC_OPERATORS(Checked, Check, Add, +, +=)
diff --git a/base/numerics/checked_math_impl.h b/base/numerics/checked_math_impl.h index 0492d1d..bf3a3077 100644 --- a/base/numerics/checked_math_impl.h +++ b/base/numerics/checked_math_impl.h
@@ -182,17 +182,19 @@ return !__builtin_mul_overflow(x, y, result); #endif using Promotion = typename FastIntegerArithmeticPromotion<T, U>::type; + // Verify the destination type can hold the result (always true for 0). + if (!(IsValueInRangeForNumericType<Promotion>(x) && + IsValueInRangeForNumericType<Promotion>(y)) && + x && y) { + return false; + } Promotion presult; - // Fail if either operand is out of range for the promoted type. - // TODO(jschuh): This could be made to work for a broader range of values. - bool is_valid = IsValueInRangeForNumericType<Promotion>(x) && - IsValueInRangeForNumericType<Promotion>(y); - + bool is_valid = true; if (IsIntegerArithmeticSafe<Promotion, T, U>::value) { presult = static_cast<Promotion>(x) * static_cast<Promotion>(y); } else { - is_valid &= CheckedMulImpl(static_cast<Promotion>(x), - static_cast<Promotion>(y), &presult); + is_valid = CheckedMulImpl(static_cast<Promotion>(x), + static_cast<Promotion>(y), &presult); } *result = static_cast<V>(presult); return is_valid && IsValueInRangeForNumericType<V>(presult); @@ -242,7 +244,7 @@ template <typename T> bool CheckedModImpl(T x, T y, T* result) { static_assert(std::is_integral<T>::value, "Type must be integral"); - if (y > 0) { + if (y) { *result = static_cast<T>(x % y); return true; } @@ -283,15 +285,15 @@ using result_type = T; template <typename V> static bool Do(T x, U shift, V* result) { - using ShiftType = typename std::make_unsigned<T>::type; - static const ShiftType kBitWidth = IntegerBitsPlusSign<T>::value; - const ShiftType real_shift = static_cast<ShiftType>(shift); // Signed shift is not legal on negative values. - if (!IsValueNegative(x) && real_shift < kBitWidth) { + if (!IsValueNegative(x) && + as_unsigned(shift) < IntegerBitsPlusSign<T>::value) { // Just use a multiplication because it's easy. // TODO(jschuh): This could probably be made more efficient. - if (!std::is_signed<T>::value || real_shift != kBitWidth - 1) - return CheckedMulOp<T, T>::Do(x, static_cast<T>(1) << shift, result); + if (!std::is_signed<T>::value || + as_unsigned(shift) < std::numeric_limits<T>::digits) + return CheckedMulOp<T, T>::Do(x, T(1) << shift, result); + *result = 0; return !x; // Special case zero for a full width signed shift. } return false; @@ -313,8 +315,7 @@ template <typename V> static bool Do(T x, U shift, V* result) { // Use the type conversion push negative values out of range. - using ShiftType = typename std::make_unsigned<T>::type; - if (static_cast<ShiftType>(shift) < IntegerBitsPlusSign<T>::value) { + if (as_unsigned(shift) < IntegerBitsPlusSign<T>::value) { T tmp = x >> shift; *result = static_cast<V>(tmp); return IsValueInRangeForNumericType<V>(tmp);
diff --git a/base/numerics/clamped_math.h b/base/numerics/clamped_math.h new file mode 100644 index 0000000..d2c4f298 --- /dev/null +++ b/base/numerics/clamped_math.h
@@ -0,0 +1,266 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef BASE_NUMERICS_CLAMPED_MATH_H_ +#define BASE_NUMERICS_CLAMPED_MATH_H_ + +#include <stddef.h> + +#include <limits> +#include <type_traits> + +#include "base/numerics/clamped_math_impl.h" + +namespace base { +namespace internal { + +template <typename T> +class ClampedNumeric { + static_assert(std::is_arithmetic<T>::value, + "ClampedNumeric<T>: T must be a numeric type."); + + public: + using type = T; + + constexpr ClampedNumeric() : value_(0) {} + + // Copy constructor. + template <typename Src> + constexpr ClampedNumeric(const ClampedNumeric<Src>& rhs) + : value_(saturated_cast<T>(rhs.value_)) {} + + template <typename Src> + friend class ClampedNumeric; + + // This is not an explicit constructor because we implicitly upgrade regular + // numerics to ClampedNumerics to make them easier to use. + template <typename Src> + constexpr ClampedNumeric(Src value) // NOLINT(runtime/explicit) + : value_(saturated_cast<T>(value)) { + static_assert(std::is_arithmetic<Src>::value, "Argument must be numeric."); + } + + // This is not an explicit constructor because we want a seamless conversion + // from StrictNumeric types. + template <typename Src> + constexpr ClampedNumeric( + StrictNumeric<Src> value) // NOLINT(runtime/explicit) + : value_(saturated_cast<T>(static_cast<Src>(value))) {} + + // Returns a ClampedNumeric of the specified type, cast from the current + // ClampedNumeric, and saturated to the destination type. + template <typename Dst> + constexpr ClampedNumeric<typename UnderlyingType<Dst>::type> Cast() const { + return *this; + } + + // Prototypes for the supported arithmetic operator overloads. + template <typename Src> + ClampedNumeric& operator+=(const Src rhs); + template <typename Src> + ClampedNumeric& operator-=(const Src rhs); + template <typename Src> + ClampedNumeric& operator*=(const Src rhs); + template <typename Src> + ClampedNumeric& operator/=(const Src rhs); + template <typename Src> + ClampedNumeric& operator%=(const Src rhs); + template <typename Src> + ClampedNumeric& operator<<=(const Src rhs); + template <typename Src> + ClampedNumeric& operator>>=(const Src rhs); + template <typename Src> + ClampedNumeric& operator&=(const Src rhs); + template <typename Src> + ClampedNumeric& operator|=(const Src rhs); + template <typename Src> + ClampedNumeric& operator^=(const Src rhs); + + constexpr ClampedNumeric operator-() const { + return ClampedNumeric<T>( + // The negation of two's complement int min is int min, so that's the + // only overflow case we have to check for. + std::is_signed<T>::value + ? ((std::is_floating_point<T>::value || + NegateWrapper(value_) != std::numeric_limits<T>::lowest()) + ? NegateWrapper(value_) + : std::numeric_limits<T>::max()) + : T(0)); // Clamped unsigned negation is always zero. + } + + constexpr ClampedNumeric operator~() const { + return ClampedNumeric<decltype(InvertWrapper(T()))>(InvertWrapper(value_)); + } + + constexpr ClampedNumeric Abs() const { + return ClampedNumeric<T>( + // The negation of two's complement int min is int min, so that's the + // only overflow case we have to check for. + (!std::is_signed<T>::value || std::is_floating_point<T>::value || + AbsWrapper(value_) != std::numeric_limits<T>::lowest()) + ? AbsWrapper(value_) + : std::numeric_limits<T>::max()); + } + + template <typename U> + constexpr ClampedNumeric<typename MathWrapper<ClampedMaxOp, T, U>::type> Max( + const U rhs) const { + using result_type = typename MathWrapper<ClampedMaxOp, T, U>::type; + return ClampedNumeric<result_type>( + ClampedMaxOp<T, U>(value_, Wrapper<U>::value(rhs))); + } + + template <typename U> + constexpr ClampedNumeric<typename MathWrapper<ClampedMinOp, T, U>::type> Min( + const U rhs) const { + using result_type = typename MathWrapper<ClampedMinOp, T, U>::type; + return ClampedNumeric<result_type>( + ClampedMinOp<T, U>(value_, Wrapper<U>::value(rhs))); + } + + // This function is available only for integral types. It returns an unsigned + // integer of the same width as the source type, containing the absolute value + // of the source, and properly handling signed min. + constexpr ClampedNumeric<typename UnsignedOrFloatForSize<T>::type> + UnsignedAbs() const { + return ClampedNumeric<typename UnsignedOrFloatForSize<T>::type>( + SafeUnsignedAbs(value_)); + } + + ClampedNumeric& operator++() { + *this += 1; + return *this; + } + + ClampedNumeric operator++(int) { + ClampedNumeric value = *this; + *this += 1; + return value; + } + + ClampedNumeric& operator--() { + *this -= 1; + return *this; + } + + ClampedNumeric operator--(int) { + ClampedNumeric value = *this; + *this -= 1; + return value; + } + + // These perform the actual math operations on the ClampedNumerics. + // Binary arithmetic operations. + template <template <typename, typename, typename> class M, + typename L, + typename R> + static ClampedNumeric MathOp(const L lhs, const R rhs) { + using Math = typename MathWrapper<M, L, R>::math; + return ClampedNumeric<T>( + Math::template Do<T>(Wrapper<L>::value(lhs), Wrapper<R>::value(rhs))); + } + + // Assignment arithmetic operations. + template <template <typename, typename, typename> class M, typename R> + ClampedNumeric& MathOp(const R rhs) { + using Math = typename MathWrapper<M, T, R>::math; + *this = + ClampedNumeric<T>(Math::template Do<T>(value_, Wrapper<R>::value(rhs))); + return *this; + } + + template <typename Dst> + constexpr operator Dst() const { + return saturated_cast<typename ArithmeticOrUnderlyingEnum<Dst>::type>( + value_); + } + + private: + T value_; + + // These wrappers allow us to handle state the same way for both + // ClampedNumeric and POD arithmetic types. + template <typename Src> + struct Wrapper { + static constexpr Src value(Src value) { + return static_cast<typename UnderlyingType<Src>::type>(value); + } + }; +}; + +// Convience wrapper to return a new ClampedNumeric from the provided arithmetic +// or ClampedNumericType. +template <typename T> +constexpr ClampedNumeric<typename UnderlyingType<T>::type> MakeClampedNum( + const T value) { + return value; +} + +// Overload the ostream output operator to make logging work nicely. +template <typename T> +std::ostream& operator<<(std::ostream& os, const ClampedNumeric<T>& value) { + os << static_cast<T>(value); + return os; +} + +// These implement the variadic wrapper for the math operations. +template <template <typename, typename, typename> class M, + typename L, + typename R> +ClampedNumeric<typename MathWrapper<M, L, R>::type> ClampMathOp(const L lhs, + const R rhs) { + using Math = typename MathWrapper<M, L, R>::math; + return ClampedNumeric<typename Math::result_type>::template MathOp<M>(lhs, + rhs); +} + +// General purpose wrapper template for arithmetic operations. +template <template <typename, typename, typename> class M, + typename L, + typename R, + typename... Args> +ClampedNumeric<typename ResultType<M, L, R, Args...>::type> +ClampMathOp(const L lhs, const R rhs, const Args... args) { + return ClampMathOp<M>(ClampMathOp<M>(lhs, rhs), args...); +} + +BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Add, +, +=) +BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Sub, -, -=) +BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Mul, *, *=) +BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Div, /, /=) +BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Mod, %, %=) +BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Lsh, <<, <<=) +BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Rsh, >>, >>=) +BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, And, &, &=) +BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Or, |, |=) +BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Xor, ^, ^=) +BASE_NUMERIC_ARITHMETIC_VARIADIC(Clamped, Clamp, Max) +BASE_NUMERIC_ARITHMETIC_VARIADIC(Clamped, Clamp, Min) +BASE_NUMERIC_COMPARISON_OPERATORS(Clamped, IsLess, <); +BASE_NUMERIC_COMPARISON_OPERATORS(Clamped, IsLessOrEqual, <=); +BASE_NUMERIC_COMPARISON_OPERATORS(Clamped, IsGreater, >); +BASE_NUMERIC_COMPARISON_OPERATORS(Clamped, IsGreaterOrEqual, >=); +BASE_NUMERIC_COMPARISON_OPERATORS(Clamped, IsEqual, ==); +BASE_NUMERIC_COMPARISON_OPERATORS(Clamped, IsNotEqual, !=); + +} // namespace internal + +using internal::ClampedNumeric; +using internal::MakeClampedNum; +using internal::ClampMax; +using internal::ClampMin; +using internal::ClampAdd; +using internal::ClampSub; +using internal::ClampMul; +using internal::ClampDiv; +using internal::ClampMod; +using internal::ClampLsh; +using internal::ClampRsh; +using internal::ClampAnd; +using internal::ClampOr; +using internal::ClampXor; + +} // namespace base + +#endif // BASE_NUMERICS_CLAMPED_MATH_H_
diff --git a/base/numerics/clamped_math_impl.h b/base/numerics/clamped_math_impl.h new file mode 100644 index 0000000..7f8035c --- /dev/null +++ b/base/numerics/clamped_math_impl.h
@@ -0,0 +1,290 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef BASE_NUMERICS_CLAMPED_MATH_IMPL_H_ +#define BASE_NUMERICS_CLAMPED_MATH_IMPL_H_ + +#include <stddef.h> +#include <stdint.h> + +#include <climits> +#include <cmath> +#include <cstdlib> +#include <limits> +#include <type_traits> + +#include "base/numerics/checked_math.h" +#include "base/numerics/safe_conversions.h" +#include "base/numerics/safe_math_shared_impl.h" + +namespace base { +namespace internal { + +// This provides a small optimization that generates more compact code when one +// of the components in an operation is a compile-time constant. +template <typename T> +constexpr bool IsCompileTimeConstant(const T v) { +#if defined(__clang__) || defined(__GNUC__) + return __builtin_constant_p(v); +#else + return false; +#endif +} + +// This is a wrapper to generate return the max or min for a supplied type. +// If the argument is false, the returned value is the maximum. If true the +// returned value is the minimum. +template <typename T> +constexpr T GetMaxOrMin(bool is_min) { + // For both signed and unsigned math the bit pattern for minimum is really + // just one plus the maximum. However, we have to cast to unsigned to ensure + // we get well-defined overflow semantics. + return as_unsigned(std::numeric_limits<T>::max()) + is_min; +} + +template <typename T, typename U, class Enable = void> +struct ClampedAddOp {}; + +template <typename T, typename U> +struct ClampedAddOp<T, + U, + typename std::enable_if<std::is_integral<T>::value && + std::is_integral<U>::value>::type> { + using result_type = typename MaxExponentPromotion<T, U>::type; + template <typename V = result_type> + static V Do(T x, U y) { + V result; + return CheckedAddOp<T, U>::Do(x, y, &result) + ? result + // Prefer a compile-time constant (if we have one). + : GetMaxOrMin<V>(IsCompileTimeConstant(x) ? IsValueNegative(x) + : IsValueNegative(y)); + } +}; + +template <typename T, typename U, class Enable = void> +struct ClampedSubOp {}; + +template <typename T, typename U> +struct ClampedSubOp<T, + U, + typename std::enable_if<std::is_integral<T>::value && + std::is_integral<U>::value>::type> { + using result_type = typename MaxExponentPromotion<T, U>::type; + template <typename V = result_type> + static V Do(T x, U y) { + V result; + return CheckedSubOp<T, U>::Do(x, y, &result) + ? result + // Prefer a compile-time constant (if we have one). + : GetMaxOrMin<V>(IsCompileTimeConstant(x) ? IsValueNegative(x) + : !IsValueNegative(y)); + } +}; + +template <typename T, typename U, class Enable = void> +struct ClampedMulOp {}; + +template <typename T, typename U> +struct ClampedMulOp<T, + U, + typename std::enable_if<std::is_integral<T>::value && + std::is_integral<U>::value>::type> { + using result_type = typename MaxExponentPromotion<T, U>::type; + template <typename V = result_type> + static V Do(T x, U y) { + V result; + return CheckedMulOp<T, U>::Do(x, y, &result) + ? result + : GetMaxOrMin<V>(IsValueNegative(x) ^ IsValueNegative(y)); + } +}; + +template <typename T, typename U, class Enable = void> +struct ClampedDivOp {}; + +template <typename T, typename U> +struct ClampedDivOp<T, + U, + typename std::enable_if<std::is_integral<T>::value && + std::is_integral<U>::value>::type> { + using result_type = typename MaxExponentPromotion<T, U>::type; + template <typename V = result_type> + static V Do(T x, U y) { + V result = SaturationDefaultLimits<V>::NaN(); + return !x || CheckedDivOp<T, U>::Do(x, y, &result) + ? result + : GetMaxOrMin<V>(IsValueNegative(x) ^ IsValueNegative(y)); + } +}; + +template <typename T, typename U, class Enable = void> +struct ClampedModOp {}; + +template <typename T, typename U> +struct ClampedModOp<T, + U, + typename std::enable_if<std::is_integral<T>::value && + std::is_integral<U>::value>::type> { + using result_type = typename MaxExponentPromotion<T, U>::type; + template <typename V = result_type> + static V Do(T x, U y) { + V result; + return CheckedModOp<T, U>::Do(x, y, &result) ? result : x; + } +}; + +template <typename T, typename U, class Enable = void> +struct ClampedLshOp {}; + +// Left shift. Non-zero values saturate in the direction of the sign. A zero +// shifted by any value always results in zero. +// Note: This class template supports left shifting negative values. +template <typename T, typename U> +struct ClampedLshOp<T, + U, + typename std::enable_if<std::is_integral<T>::value && + std::is_integral<U>::value>::type> { + using result_type = T; + template <typename V = result_type> + static V Do(T x, U shift) { + static_assert(!std::is_signed<U>::value, "Shift value must be unsigned."); + V result = x; + return (shift < std::numeric_limits<T>::digits && + CheckedMulOp<T, T>::Do(x, T(1) << shift, &result)) + ? result + : (x ? GetMaxOrMin<V>(IsValueNegative(x)) : 0); + } +}; + +template <typename T, typename U, class Enable = void> +struct ClampedRshOp {}; + +// Right shift. Negative values saturate to -1. Positive or 0 saturates to 0. +template <typename T, typename U> +struct ClampedRshOp<T, + U, + typename std::enable_if<std::is_integral<T>::value && + std::is_integral<U>::value>::type> { + using result_type = T; + template <typename V = result_type> + static V Do(T x, U shift) { + static_assert(!std::is_signed<U>::value, "Shift value must be unsigned."); + return shift < IntegerBitsPlusSign<T>::value + ? saturated_cast<V>(x >> shift) + // Signed right shift is odd, because it saturates to -1 or 0. + : as_unsigned(V(0)) - IsValueNegative(x); + } +}; + +template <typename T, typename U, class Enable = void> +struct ClampedAndOp {}; + +template <typename T, typename U> +struct ClampedAndOp<T, + U, + typename std::enable_if<std::is_integral<T>::value && + std::is_integral<U>::value>::type> { + using result_type = typename std::make_unsigned< + typename MaxExponentPromotion<T, U>::type>::type; + template <typename V> + static constexpr V Do(T x, U y) { + return static_cast<result_type>(x) & static_cast<result_type>(y); + } +}; + +template <typename T, typename U, class Enable = void> +struct ClampedOrOp {}; + +// For simplicity we promote to unsigned integers. +template <typename T, typename U> +struct ClampedOrOp<T, + U, + typename std::enable_if<std::is_integral<T>::value && + std::is_integral<U>::value>::type> { + using result_type = typename std::make_unsigned< + typename MaxExponentPromotion<T, U>::type>::type; + template <typename V> + static constexpr V Do(T x, U y) { + return static_cast<result_type>(x) | static_cast<result_type>(y); + } +}; + +template <typename T, typename U, class Enable = void> +struct ClampedXorOp {}; + +// For simplicity we support only unsigned integers. +template <typename T, typename U> +struct ClampedXorOp<T, + U, + typename std::enable_if<std::is_integral<T>::value && + std::is_integral<U>::value>::type> { + using result_type = typename std::make_unsigned< + typename MaxExponentPromotion<T, U>::type>::type; + template <typename V> + static constexpr V Do(T x, U y) { + return static_cast<result_type>(x) ^ static_cast<result_type>(y); + } +}; + +template <typename T, typename U, class Enable = void> +struct ClampedMaxOp {}; + +template <typename T, typename U> +struct ClampedMaxOp< + T, + U, + typename std::enable_if<std::is_arithmetic<T>::value && + std::is_arithmetic<U>::value>::type> { + using result_type = typename MaxExponentPromotion<T, U>::type; + template <typename V = result_type> + static constexpr V Do(T x, U y) { + return IsGreater<T, U>::Test(x, y) ? saturated_cast<V>(x) + : saturated_cast<V>(y); + } +}; + +template <typename T, typename U, class Enable = void> +struct ClampedMinOp {}; + +template <typename T, typename U> +struct ClampedMinOp< + T, + U, + typename std::enable_if<std::is_arithmetic<T>::value && + std::is_arithmetic<U>::value>::type> { + using result_type = typename LowestValuePromotion<T, U>::type; + template <typename V = result_type> + static constexpr V Do(T x, U y) { + return IsLess<T, U>::Test(x, y) ? saturated_cast<V>(x) + : saturated_cast<V>(y); + } +}; + +// This is just boilerplate that wraps the standard floating point arithmetic. +// A macro isn't the nicest solution, but it beats rewriting these repeatedly. +#define BASE_FLOAT_ARITHMETIC_OPS(NAME, OP) \ + template <typename T, typename U> \ + struct Clamped##NAME##Op< \ + T, U, \ + typename std::enable_if<std::is_floating_point<T>::value || \ + std::is_floating_point<U>::value>::type> { \ + using result_type = typename MaxExponentPromotion<T, U>::type; \ + template <typename V = result_type> \ + static constexpr V Do(T x, U y) { \ + return saturated_cast<V>(x OP y); \ + } \ + }; + +BASE_FLOAT_ARITHMETIC_OPS(Add, +) +BASE_FLOAT_ARITHMETIC_OPS(Sub, -) +BASE_FLOAT_ARITHMETIC_OPS(Mul, *) +BASE_FLOAT_ARITHMETIC_OPS(Div, /) + +#undef BASE_FLOAT_ARITHMETIC_OPS + +} // namespace internal +} // namespace base + +#endif // BASE_NUMERICS_CLAMPED_MATH_IMPL_H_
diff --git a/base/numerics/safe_conversions.h b/base/numerics/safe_conversions.h index b0ec279..c85e7c3 100644 --- a/base/numerics/safe_conversions.h +++ b/base/numerics/safe_conversions.h
@@ -15,38 +15,6 @@ namespace base { -// The following are helper constexpr template functions and classes for safely -// performing a range of conversions, assignments, and tests: -// -// checked_cast<> - Analogous to static_cast<> for numeric types, except -// that it CHECKs that the specified numeric conversion will not overflow -// or underflow. NaN source will always trigger a CHECK. -// The default CHECK triggers a crash, but the handler can be overriden. -// saturated_cast<> - Analogous to static_cast<> for numeric types, except -// that it returns a saturated result when the specified numeric conversion -// would otherwise overflow or underflow. An NaN source returns 0 by -// default, but can be overridden to return a different result. -// strict_cast<> - Analogous to static_cast<> for numeric types, except that -// it will cause a compile failure if the destination type is not large -// enough to contain any value in the source type. It performs no runtime -// checking and thus introduces no runtime overhead. -// IsValueInRangeForNumericType<>() - A convenience function that returns true -// if the type supplied to the template parameter can represent the value -// passed as an argument to the function. -// IsValueNegative<>() - A convenience function that will accept any arithmetic -// type as an argument and will return whether the value is less than zero. -// Unsigned types always return false. -// SafeUnsignedAbs() - Returns the absolute value of the supplied integer -// parameter as an unsigned result (thus avoiding an overflow if the value -// is the signed, two's complement minimum). -// StrictNumeric<> - A wrapper type that performs assignments and copies via -// the strict_cast<> template, and can perform valid arithmetic comparisons -// across any range of arithmetic types. StrictNumeric is the return type -// for values extracted from a CheckedNumeric class instance. The raw -// arithmetic value is extracted via static_cast to the underlying type. -// MakeStrictNum() - Creates a new StrictNumeric from the underlying type of -// the supplied arithmetic or StrictNumeric type. - // Convenience function that returns true if the supplied value is in range // for the destination type. template <typename Dst, typename Src> @@ -82,21 +50,47 @@ : CheckHandler::template HandleFailure<Dst>(); } +// as_signed<> returns the supplied integral value (or integral castable +// Numeric template) cast as a signed integral of equivalent precision. +// I.e. it's mostly an alias for: static_cast<std::make_signed<T>::type>(t) +template <typename Src> +constexpr typename std::make_signed< + typename base::internal::UnderlyingType<Src>::type>::type +as_signed(const Src value) { + static_assert(std::is_integral<decltype(as_signed(value))>::value, + "Argument must be a signed or unsigned integer type."); + return static_cast<decltype(as_signed(value))>(value); +} + +// as_unsigned<> returns the supplied integral value (or integral castable +// Numeric template) cast as an unsigned integral of equivalent precision. +// I.e. it's mostly an alias for: static_cast<std::make_unsigned<T>::type>(t) +template <typename Src> +constexpr typename std::make_unsigned< + typename base::internal::UnderlyingType<Src>::type>::type +as_unsigned(const Src value) { + static_assert(std::is_integral<decltype(as_unsigned(value))>::value, + "Argument must be a signed or unsigned integer type."); + return static_cast<decltype(as_unsigned(value))>(value); +} + // Default boundaries for integral/float: max/infinity, lowest/-infinity, 0/NaN. +// You may provide your own limits (e.g. to saturated_cast) so long as you +// implement all of the static constexpr member functions in the class below. template <typename T> -struct SaturationDefaultHandler { +struct SaturationDefaultLimits : public std::numeric_limits<T> { static constexpr T NaN() { return std::numeric_limits<T>::has_quiet_NaN ? std::numeric_limits<T>::quiet_NaN() : T(); } - static constexpr T max() { return std::numeric_limits<T>::max(); } + using std::numeric_limits<T>::max; static constexpr T Overflow() { return std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() : std::numeric_limits<T>::max(); } - static constexpr T lowest() { return std::numeric_limits<T>::lowest(); } + using std::numeric_limits<T>::lowest; static constexpr T Underflow() { return std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() * -1 @@ -124,8 +118,7 @@ // overflow or underflow, and NaN assignment to an integral will return 0. // All boundary condition behaviors can be overriden with a custom handler. template <typename Dst, - template <typename> - class SaturationHandler = SaturationDefaultHandler, + template <typename> class SaturationHandler = SaturationDefaultLimits, typename Src> constexpr Dst saturated_cast(Src value) { using SrcType = typename UnderlyingType<Src>::type; @@ -238,24 +231,23 @@ return os; } -#define STRICT_COMPARISON_OP(NAME, OP) \ - template <typename L, typename R, \ - typename std::enable_if< \ - internal::IsStrictOp<L, R>::value>::type* = nullptr> \ - constexpr bool operator OP(const L lhs, const R rhs) { \ - return SafeCompare<NAME, typename UnderlyingType<L>::type, \ - typename UnderlyingType<R>::type>(lhs, rhs); \ +#define BASE_NUMERIC_COMPARISON_OPERATORS(CLASS, NAME, OP) \ + template <typename L, typename R, \ + typename std::enable_if< \ + internal::Is##CLASS##Op<L, R>::value>::type* = nullptr> \ + constexpr bool operator OP(const L lhs, const R rhs) { \ + return SafeCompare<NAME, typename UnderlyingType<L>::type, \ + typename UnderlyingType<R>::type>(lhs, rhs); \ } -STRICT_COMPARISON_OP(IsLess, <); -STRICT_COMPARISON_OP(IsLessOrEqual, <=); -STRICT_COMPARISON_OP(IsGreater, >); -STRICT_COMPARISON_OP(IsGreaterOrEqual, >=); -STRICT_COMPARISON_OP(IsEqual, ==); -STRICT_COMPARISON_OP(IsNotEqual, !=); +BASE_NUMERIC_COMPARISON_OPERATORS(Strict, IsLess, <); +BASE_NUMERIC_COMPARISON_OPERATORS(Strict, IsLessOrEqual, <=); +BASE_NUMERIC_COMPARISON_OPERATORS(Strict, IsGreater, >); +BASE_NUMERIC_COMPARISON_OPERATORS(Strict, IsGreaterOrEqual, >=); +BASE_NUMERIC_COMPARISON_OPERATORS(Strict, IsEqual, ==); +BASE_NUMERIC_COMPARISON_OPERATORS(Strict, IsNotEqual, !=); -#undef STRICT_COMPARISON_OP -}; +}; // namespace internal using internal::strict_cast; using internal::saturated_cast;
diff --git a/base/numerics/safe_conversions_impl.h b/base/numerics/safe_conversions_impl.h index aef7135..713b8ef 100644 --- a/base/numerics/safe_conversions_impl.h +++ b/base/numerics/safe_conversions_impl.h
@@ -549,6 +549,7 @@ using type = typename ArithmeticOrUnderlyingEnum<T>::type; static const bool is_numeric = std::is_arithmetic<type>::value; static const bool is_checked = false; + static const bool is_clamped = false; static const bool is_strict = false; }; @@ -590,14 +591,17 @@ struct IsClampedOp { static const bool value = UnderlyingType<L>::is_numeric && UnderlyingType<R>::is_numeric && - (UnderlyingType<L>::is_clamped || UnderlyingType<R>::is_clamped); + (UnderlyingType<L>::is_clamped || UnderlyingType<R>::is_clamped) && + !(UnderlyingType<L>::is_checked || UnderlyingType<R>::is_checked); }; template <typename L, typename R> struct IsStrictOp { static const bool value = UnderlyingType<L>::is_numeric && UnderlyingType<R>::is_numeric && - (UnderlyingType<L>::is_strict || UnderlyingType<R>::is_strict); + (UnderlyingType<L>::is_strict || UnderlyingType<R>::is_strict) && + !(UnderlyingType<L>::is_checked || UnderlyingType<R>::is_checked) && + !(UnderlyingType<L>::is_clamped || UnderlyingType<R>::is_clamped); }; template <typename L, typename R>
diff --git a/base/numerics/safe_math.h b/base/numerics/safe_math.h index 810a13a..e30be90 100644 --- a/base/numerics/safe_math.h +++ b/base/numerics/safe_math.h
@@ -1,4 +1,4 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. +// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,6 +6,7 @@ #define BASE_NUMERICS_SAFE_MATH_H_ #include "base/numerics/checked_math.h" +#include "base/numerics/clamped_math.h" #include "base/numerics/safe_conversions.h" #endif // BASE_NUMERICS_SAFE_MATH_H_
diff --git a/base/numerics/safe_math_shared_impl.h b/base/numerics/safe_math_shared_impl.h index 3e75bfec..c243e2636 100644 --- a/base/numerics/safe_math_shared_impl.h +++ b/base/numerics/safe_math_shared_impl.h
@@ -118,26 +118,27 @@ template <typename L, typename R, typename... Args> \ CLASS##Numeric<typename ResultType<CLASS##OP_NAME##Op, L, R, Args...>::type> \ CL_ABBR##OP_NAME(const L lhs, const R rhs, const Args... args) { \ - return ChkMathOp<CLASS##OP_NAME##Op, L, R, Args...>(lhs, rhs, args...); \ + return CL_ABBR##MathOp<CLASS##OP_NAME##Op, L, R, Args...>(lhs, rhs, \ + args...); \ } #define BASE_NUMERIC_ARITHMETIC_OPERATORS(CLASS, CL_ABBR, OP_NAME, OP, CMP_OP) \ - /* Binary arithmetic operator for all CheckedNumeric operations. */ \ + /* Binary arithmetic operator for all CLASS##Numeric operations. */ \ template <typename L, typename R, \ - typename std::enable_if<IsCheckedOp<L, R>::value>::type* = \ + typename std::enable_if<Is##CLASS##Op<L, R>::value>::type* = \ nullptr> \ - CheckedNumeric<typename MathWrapper<CLASS##OP_NAME##Op, L, R>::type> \ + CLASS##Numeric<typename MathWrapper<CLASS##OP_NAME##Op, L, R>::type> \ operator OP(const L lhs, const R rhs) { \ return decltype(lhs OP rhs)::template MathOp<CLASS##OP_NAME##Op>(lhs, \ rhs); \ } \ - /* Assignment arithmetic operator implementation from CheckedNumeric. */ \ + /* Assignment arithmetic operator implementation from CLASS##Numeric. */ \ template <typename L> \ template <typename R> \ - CheckedNumeric<L>& CheckedNumeric<L>::operator CMP_OP(const R rhs) { \ + CLASS##Numeric<L>& CLASS##Numeric<L>::operator CMP_OP(const R rhs) { \ return MathOp<CLASS##OP_NAME##Op>(rhs); \ } \ - /* Variadic arithmetic functions that return CheckedNumeric. */ \ + /* Variadic arithmetic functions that return CLASS##Numeric. */ \ BASE_NUMERIC_ARITHMETIC_VARIADIC(CLASS, CL_ABBR, OP_NAME) } // namespace internal
diff --git a/base/numerics/safe_numerics_unittest.cc b/base/numerics/safe_numerics_unittest.cc index ec6d003..9fd9e8f 100644 --- a/base/numerics/safe_numerics_unittest.cc +++ b/base/numerics/safe_numerics_unittest.cc
@@ -22,10 +22,12 @@ using std::numeric_limits; using base::CheckedNumeric; +using base::ClampedNumeric; using base::IsValidForType; using base::ValueOrDieForType; using base::ValueOrDefaultForType; using base::MakeCheckedNum; +using base::MakeClampedNum; using base::CheckMax; using base::CheckMin; using base::CheckAdd; @@ -35,9 +37,20 @@ using base::CheckMod; using base::CheckLsh; using base::CheckRsh; +using base::ClampMax; +using base::ClampMin; +using base::ClampAdd; +using base::ClampSub; +using base::ClampMul; +using base::ClampDiv; +using base::ClampMod; +using base::ClampLsh; +using base::ClampRsh; +using base::as_unsigned; using base::checked_cast; using base::IsValueInRangeForNumericType; using base::IsValueNegative; +using base::SaturationDefaultLimits; using base::SizeT; using base::StrictNumeric; using base::MakeStrictNum; @@ -131,6 +144,17 @@ U GetNumericValueForTest(const CheckedNumeric<U>& src) { return src.state_.value(); } + +template <typename U> +U GetNumericValueForTest(const ClampedNumeric<U>& src) { + return static_cast<U>(src); +} + +template <typename U> +U GetNumericValueForTest(const U& src) { + return src; +} + } // namespace internal. } // namespace base. @@ -145,6 +169,36 @@ } }; +template <typename T> +constexpr T GetValue(const T& src) { + return src; +} + +template <typename T, typename U> +constexpr T GetValueAsDest(const U& src) { + return static_cast<T>(src); +} + +template <typename T> +constexpr T GetValue(const CheckedNumeric<T>& src) { + return src.template ValueOrDie<T, LogOnFailure>(); +} + +template <typename T, typename U> +constexpr T GetValueAsDest(const CheckedNumeric<U>& src) { + return src.template ValueOrDie<T, LogOnFailure>(); +} + +template <typename T> +constexpr T GetValue(const ClampedNumeric<T>& src) { + return static_cast<T>(src); +} + +template <typename T, typename U> +constexpr T GetValueAsDest(const ClampedNumeric<U>& src) { + return static_cast<T>(src); +} + // Helper macros to wrap displaying the conversion types and line numbers. #define TEST_EXPECTED_VALIDITY(expected, actual) \ EXPECT_EQ(expected, (actual).template Cast<Dst>().IsValid()) \ @@ -156,12 +210,7 @@ // We have to handle promotions, so infer the underlying type below from actual. #define TEST_EXPECTED_VALUE(expected, actual) \ - EXPECT_EQ(static_cast<typename std::decay<decltype(actual)>::type::type>( \ - expected), \ - ((actual) \ - .template ValueOrDie< \ - typename std::decay<decltype(actual)>::type::type, \ - LogOnFailure>())) \ + EXPECT_EQ(GetValue(expected), GetValueAsDest<decltype(expected)>(actual)) \ << "Result test: Value " << GetNumericValueForTest(actual) << " as " \ << dst << " on line " << line @@ -190,18 +239,34 @@ typename std::enable_if<numeric_limits<Dst>::is_integer && numeric_limits<Dst>::is_signed, int>::type = 0) { - using DstLimits = numeric_limits<Dst>; + using DstLimits = SaturationDefaultLimits<Dst>; TEST_EXPECTED_FAILURE(-CheckedNumeric<Dst>(DstLimits::lowest())); TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::lowest()).Abs()); TEST_EXPECTED_VALUE(1, CheckedNumeric<Dst>(-1).Abs()); TEST_EXPECTED_VALUE(DstLimits::max(), MakeCheckedNum(-DstLimits::max()).Abs()); + TEST_EXPECTED_VALUE(DstLimits::Overflow(), + -ClampedNumeric<Dst>(DstLimits::lowest())); + TEST_EXPECTED_VALUE(DstLimits::Overflow(), + ClampedNumeric<Dst>(DstLimits::lowest()).Abs()); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(-1).Abs()); + TEST_EXPECTED_VALUE(DstLimits::max(), + MakeClampedNum(-DstLimits::max()).Abs()); + TEST_EXPECTED_SUCCESS(CheckedNumeric<Dst>(DstLimits::max()) + -1); TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::lowest()) + -1); TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::lowest()) + DstLimits::lowest()); + TEST_EXPECTED_VALUE(DstLimits::max() - 1, + ClampedNumeric<Dst>(DstLimits::max()) + -1); + TEST_EXPECTED_VALUE(DstLimits::Underflow(), + ClampedNumeric<Dst>(DstLimits::lowest()) + -1); + TEST_EXPECTED_VALUE( + DstLimits::Underflow(), + ClampedNumeric<Dst>(DstLimits::lowest()) + DstLimits::lowest()); + TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::lowest()) - 1); TEST_EXPECTED_SUCCESS(CheckedNumeric<Dst>(DstLimits::lowest()) - -1); TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::max()) - @@ -209,7 +274,20 @@ TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::lowest()) - DstLimits::max()); + TEST_EXPECTED_VALUE(DstLimits::Underflow(), + ClampedNumeric<Dst>(DstLimits::lowest()) - 1); + TEST_EXPECTED_VALUE(DstLimits::lowest() + 1, + ClampedNumeric<Dst>(DstLimits::lowest()) - -1); + TEST_EXPECTED_VALUE( + DstLimits::Overflow(), + ClampedNumeric<Dst>(DstLimits::max()) - DstLimits::lowest()); + TEST_EXPECTED_VALUE( + DstLimits::Underflow(), + ClampedNumeric<Dst>(DstLimits::lowest()) - DstLimits::max()); + TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::lowest()) * 2); + TEST_EXPECTED_VALUE(DstLimits::Underflow(), + ClampedNumeric<Dst>(DstLimits::lowest()) * 2); TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::lowest()) / -1); TEST_EXPECTED_VALUE(0, CheckedNumeric<Dst>(-1) / 2); @@ -222,19 +300,42 @@ CheckedNumeric<Dst>(DstLimits::lowest()) * Dst(1)); TEST_EXPECTED_VALUE(DstLimits::lowest(), CheckedNumeric<Dst>(1) * Dst(DstLimits::lowest())); - TEST_EXPECTED_VALUE(DstLimits::lowest(), - MakeCheckedNum(DstLimits::lowest()).UnsignedAbs()); + TEST_EXPECTED_VALUE( + typename std::make_unsigned<Dst>::type(0) - DstLimits::lowest(), + MakeCheckedNum(DstLimits::lowest()).UnsignedAbs()); TEST_EXPECTED_VALUE(DstLimits::max(), MakeCheckedNum(DstLimits::max()).UnsignedAbs()); TEST_EXPECTED_VALUE(0, CheckedNumeric<Dst>(0).UnsignedAbs()); TEST_EXPECTED_VALUE(1, CheckedNumeric<Dst>(1).UnsignedAbs()); TEST_EXPECTED_VALUE(1, CheckedNumeric<Dst>(-1).UnsignedAbs()); + TEST_EXPECTED_VALUE(DstLimits::Overflow(), + ClampedNumeric<Dst>(DstLimits::lowest()) / -1); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(-1) / 2); + TEST_EXPECTED_VALUE(DstLimits::Overflow(), + ClampedNumeric<Dst>(DstLimits::lowest()) * -1); + TEST_EXPECTED_VALUE(DstLimits::max(), + ClampedNumeric<Dst>(DstLimits::lowest() + 1) * Dst(-1)); + TEST_EXPECTED_VALUE(DstLimits::max(), + ClampedNumeric<Dst>(-1) * Dst(DstLimits::lowest() + 1)); + TEST_EXPECTED_VALUE(DstLimits::lowest(), + ClampedNumeric<Dst>(DstLimits::lowest()) * Dst(1)); + TEST_EXPECTED_VALUE(DstLimits::lowest(), + ClampedNumeric<Dst>(1) * Dst(DstLimits::lowest())); + TEST_EXPECTED_VALUE( + typename std::make_unsigned<Dst>::type(0) - DstLimits::lowest(), + MakeClampedNum(DstLimits::lowest()).UnsignedAbs()); + TEST_EXPECTED_VALUE(DstLimits::max(), + MakeClampedNum(DstLimits::max()).UnsignedAbs()); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(0).UnsignedAbs()); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(1).UnsignedAbs()); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(-1).UnsignedAbs()); + // Modulus is legal only for integers. TEST_EXPECTED_VALUE(0, CheckedNumeric<Dst>() % 1); TEST_EXPECTED_VALUE(0, CheckedNumeric<Dst>(1) % 1); TEST_EXPECTED_VALUE(-1, CheckedNumeric<Dst>(-1) % 2); - TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(-1) % -2); + TEST_EXPECTED_VALUE(-1, CheckedNumeric<Dst>(-1) % -2); TEST_EXPECTED_VALUE(0, CheckedNumeric<Dst>(DstLimits::lowest()) % 2); TEST_EXPECTED_VALUE(1, CheckedNumeric<Dst>(DstLimits::max()) % 2); // Test all the different modulus combinations. @@ -266,6 +367,44 @@ 0, CheckedNumeric<Dst>(1) >> (IntegerBitsPlusSign<Dst>::value - 1)); TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(1) >> negative_one); + // Modulus is legal only for integers. + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>() % 1); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(1) % 1); + TEST_EXPECTED_VALUE(-1, ClampedNumeric<Dst>(-1) % 2); + TEST_EXPECTED_VALUE(-1, ClampedNumeric<Dst>(-1) % -2); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(DstLimits::lowest()) % 2); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(DstLimits::max()) % 2); + // Test all the different modulus combinations. + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(1) % ClampedNumeric<Dst>(1)); + TEST_EXPECTED_VALUE(0, 1 % ClampedNumeric<Dst>(1)); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(1) % 1); + ClampedNumeric<Dst> clamped_dst = 1; + TEST_EXPECTED_VALUE(0, clamped_dst %= 1); + TEST_EXPECTED_VALUE(Dst(1), ClampedNumeric<Dst>(1) % 0); + // Test bit shifts. + TEST_EXPECTED_VALUE(DstLimits::Overflow(), + ClampedNumeric<Dst>(1) + << (IntegerBitsPlusSign<Dst>::value - 1U)); + TEST_EXPECTED_VALUE(Dst(0), ClampedNumeric<Dst>(0) + << (IntegerBitsPlusSign<Dst>::value + 0U)); + TEST_EXPECTED_VALUE(DstLimits::Overflow(), + ClampedNumeric<Dst>(DstLimits::max()) << 1U); + TEST_EXPECTED_VALUE( + static_cast<Dst>(1) << (IntegerBitsPlusSign<Dst>::value - 2U), + ClampedNumeric<Dst>(1) << (IntegerBitsPlusSign<Dst>::value - 2U)); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(0) + << (IntegerBitsPlusSign<Dst>::value - 1U)); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(1) << 0U); + TEST_EXPECTED_VALUE(2, ClampedNumeric<Dst>(1) << 1U); + TEST_EXPECTED_VALUE( + 0, ClampedNumeric<Dst>(1) >> (IntegerBitsPlusSign<Dst>::value + 0U)); + TEST_EXPECTED_VALUE( + 0, ClampedNumeric<Dst>(1) >> (IntegerBitsPlusSign<Dst>::value - 1U)); + TEST_EXPECTED_VALUE( + -1, ClampedNumeric<Dst>(-1) >> (IntegerBitsPlusSign<Dst>::value - 1U)); + TEST_EXPECTED_VALUE(-1, ClampedNumeric<Dst>(DstLimits::lowest()) >> + (IntegerBitsPlusSign<Dst>::value - 0U)); + TestStrictPointerMath<Dst>(); } @@ -277,7 +416,7 @@ typename std::enable_if<numeric_limits<Dst>::is_integer && !numeric_limits<Dst>::is_signed, int>::type = 0) { - using DstLimits = numeric_limits<Dst>; + using DstLimits = SaturationDefaultLimits<Dst>; TEST_EXPECTED_SUCCESS(-CheckedNumeric<Dst>(DstLimits::lowest())); TEST_EXPECTED_SUCCESS(CheckedNumeric<Dst>(DstLimits::lowest()).Abs()); TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::lowest()) + -1); @@ -296,6 +435,29 @@ TEST_EXPECTED_VALUE(0, CheckedNumeric<Dst>(0).UnsignedAbs()); TEST_EXPECTED_VALUE(1, CheckedNumeric<Dst>(1).UnsignedAbs()); + TEST_EXPECTED_VALUE(0, -ClampedNumeric<Dst>(DstLimits::lowest())); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(DstLimits::lowest()).Abs()); + TEST_EXPECTED_VALUE(DstLimits::Underflow(), + ClampedNumeric<Dst>(DstLimits::lowest()) + -1); + TEST_EXPECTED_VALUE(DstLimits::Underflow(), + ClampedNumeric<Dst>(DstLimits::lowest()) - 1); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(DstLimits::lowest()) * 2); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(1) / 2); + TEST_EXPECTED_VALUE(0, + ClampedNumeric<Dst>(DstLimits::lowest()).UnsignedAbs()); + TEST_EXPECTED_VALUE( + as_unsigned( + std::numeric_limits<typename std::make_signed<Dst>::type>::lowest()), + ClampedNumeric<typename std::make_signed<Dst>::type>( + std::numeric_limits<typename std::make_signed<Dst>::type>::lowest()) + .UnsignedAbs()); + TEST_EXPECTED_VALUE(DstLimits::lowest(), + MakeClampedNum(DstLimits::lowest()).UnsignedAbs()); + TEST_EXPECTED_VALUE(DstLimits::max(), + MakeClampedNum(DstLimits::max()).UnsignedAbs()); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(0).UnsignedAbs()); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(1).UnsignedAbs()); + // Modulus is legal only for integers. TEST_EXPECTED_VALUE(0, CheckedNumeric<Dst>() % 1); TEST_EXPECTED_VALUE(0, CheckedNumeric<Dst>(1) % 1); @@ -350,6 +512,57 @@ CheckedNumeric<Dst>(0) ^ static_cast<Dst>(-1)); TEST_EXPECTED_VALUE(DstLimits::max(), ~CheckedNumeric<Dst>(0)); + // Modulus is legal only for integers. + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>() % 1); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(1) % 1); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(1) % 2); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(DstLimits::lowest()) % 2); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(DstLimits::max()) % 2); + // Test all the different modulus combinations. + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(1) % ClampedNumeric<Dst>(1)); + TEST_EXPECTED_VALUE(0, 1 % ClampedNumeric<Dst>(1)); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(1) % 1); + ClampedNumeric<Dst> clamped_dst = 1; + TEST_EXPECTED_VALUE(0, clamped_dst %= 1); + // Test that div by 0 is avoided but returns invalid result. + TEST_EXPECTED_VALUE(Dst(1), ClampedNumeric<Dst>(1) % 0); + // Test bit shifts. + TEST_EXPECTED_VALUE(DstLimits::Overflow(), + ClampedNumeric<Dst>(1) + << as_unsigned(IntegerBitsPlusSign<Dst>::value)); + TEST_EXPECTED_VALUE(Dst(0), ClampedNumeric<Dst>(0) << as_unsigned( + IntegerBitsPlusSign<Dst>::value)); + TEST_EXPECTED_VALUE(DstLimits::Overflow(), + ClampedNumeric<Dst>(DstLimits::max()) << 1U); + TEST_EXPECTED_VALUE( + static_cast<Dst>(1) << (IntegerBitsPlusSign<Dst>::value - 1U), + ClampedNumeric<Dst>(1) << (IntegerBitsPlusSign<Dst>::value - 1U)); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(1) << 0U); + TEST_EXPECTED_VALUE(2, ClampedNumeric<Dst>(1) << 1U); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(1) >> + as_unsigned(IntegerBitsPlusSign<Dst>::value)); + TEST_EXPECTED_VALUE( + 0, ClampedNumeric<Dst>(1) >> (IntegerBitsPlusSign<Dst>::value - 1U)); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(1) & 1); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(1) & 0); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(0) & 1); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(1) & 0); + TEST_EXPECTED_VALUE(std::numeric_limits<Dst>::max(), + MakeClampedNum(DstLimits::max()) & -1); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(1) | 1); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(1) | 0); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(0) | 1); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(0) | 0); + TEST_EXPECTED_VALUE(std::numeric_limits<Dst>::max(), + ClampedNumeric<Dst>(0) | static_cast<Dst>(-1)); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(1) ^ 1); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(1) ^ 0); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(0) ^ 1); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(0) ^ 0); + TEST_EXPECTED_VALUE(std::numeric_limits<Dst>::max(), + ClampedNumeric<Dst>(0) ^ static_cast<Dst>(-1)); + TEST_EXPECTED_VALUE(DstLimits::max(), ~ClampedNumeric<Dst>(0)); + TestStrictPointerMath<Dst>(); } @@ -359,7 +572,7 @@ const char* dst, int line, typename std::enable_if<numeric_limits<Dst>::is_iec559, int>::type = 0) { - using DstLimits = numeric_limits<Dst>; + using DstLimits = SaturationDefaultLimits<Dst>; TEST_EXPECTED_SUCCESS(-CheckedNumeric<Dst>(DstLimits::lowest())); TEST_EXPECTED_SUCCESS(CheckedNumeric<Dst>(DstLimits::lowest()).Abs()); @@ -378,12 +591,39 @@ TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::lowest()) * 2); TEST_EXPECTED_VALUE(-0.5, CheckedNumeric<Dst>(-1.0) / 2); + + TEST_EXPECTED_VALUE(DstLimits::max(), + -ClampedNumeric<Dst>(DstLimits::lowest())); + + TEST_EXPECTED_VALUE(DstLimits::max(), + ClampedNumeric<Dst>(DstLimits::lowest()).Abs()); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(-1).Abs()); + + TEST_EXPECTED_VALUE(DstLimits::lowest() - 1, + ClampedNumeric<Dst>(DstLimits::lowest()) + -1); + TEST_EXPECTED_VALUE(DstLimits::max() + 1, + ClampedNumeric<Dst>(DstLimits::max()) + 1); + TEST_EXPECTED_VALUE( + DstLimits::Underflow(), + ClampedNumeric<Dst>(DstLimits::lowest()) + DstLimits::lowest()); + + TEST_EXPECTED_VALUE( + DstLimits::Overflow(), + ClampedNumeric<Dst>(DstLimits::max()) - DstLimits::lowest()); + TEST_EXPECTED_VALUE( + DstLimits::Underflow(), + ClampedNumeric<Dst>(DstLimits::lowest()) - DstLimits::max()); + + TEST_EXPECTED_VALUE(DstLimits::Underflow(), + ClampedNumeric<Dst>(DstLimits::lowest()) * 2); + + TEST_EXPECTED_VALUE(-0.5, ClampedNumeric<Dst>(-1.0) / 2); } // Generic arithmetic tests. template <typename Dst> static void TestArithmetic(const char* dst, int line) { - using DstLimits = numeric_limits<Dst>; + using DstLimits = SaturationDefaultLimits<Dst>; EXPECT_EQ(true, CheckedNumeric<Dst>().IsValid()); EXPECT_EQ(false, @@ -417,6 +657,27 @@ checked_dst = 1; TEST_EXPECTED_VALUE(1, checked_dst /= 1); + TEST_EXPECTED_VALUE(2, ClampedNumeric<Dst>(1) + ClampedNumeric<Dst>(1)); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(1) - ClampedNumeric<Dst>(1)); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(1) * ClampedNumeric<Dst>(1)); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(1) / ClampedNumeric<Dst>(1)); + TEST_EXPECTED_VALUE(2, 1 + ClampedNumeric<Dst>(1)); + TEST_EXPECTED_VALUE(0, 1 - ClampedNumeric<Dst>(1)); + TEST_EXPECTED_VALUE(1, 1 * ClampedNumeric<Dst>(1)); + TEST_EXPECTED_VALUE(1, 1 / ClampedNumeric<Dst>(1)); + TEST_EXPECTED_VALUE(2, ClampedNumeric<Dst>(1) + 1); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(1) - 1); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(1) * 1); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(1) / 1); + ClampedNumeric<Dst> clamped_dst = 1; + TEST_EXPECTED_VALUE(2, clamped_dst += 1); + clamped_dst = 1; + TEST_EXPECTED_VALUE(0, clamped_dst -= 1); + clamped_dst = 1; + TEST_EXPECTED_VALUE(1, clamped_dst *= 1); + clamped_dst = 1; + TEST_EXPECTED_VALUE(1, clamped_dst /= 1); + // Generic negation. if (DstLimits::is_signed) { TEST_EXPECTED_VALUE(0, -CheckedNumeric<Dst>()); @@ -424,6 +685,12 @@ TEST_EXPECTED_VALUE(1, -CheckedNumeric<Dst>(-1)); TEST_EXPECTED_VALUE(static_cast<Dst>(DstLimits::max() * -1), -CheckedNumeric<Dst>(DstLimits::max())); + + TEST_EXPECTED_VALUE(0, -ClampedNumeric<Dst>()); + TEST_EXPECTED_VALUE(-1, -ClampedNumeric<Dst>(1)); + TEST_EXPECTED_VALUE(1, -ClampedNumeric<Dst>(-1)); + TEST_EXPECTED_VALUE(static_cast<Dst>(DstLimits::max() * -1), + -ClampedNumeric<Dst>(DstLimits::max())); } // Generic absolute value. @@ -432,6 +699,11 @@ TEST_EXPECTED_VALUE(DstLimits::max(), CheckedNumeric<Dst>(DstLimits::max()).Abs()); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>().Abs()); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(1).Abs()); + TEST_EXPECTED_VALUE(DstLimits::max(), + ClampedNumeric<Dst>(DstLimits::max()).Abs()); + // Generic addition. TEST_EXPECTED_VALUE(1, (CheckedNumeric<Dst>() + 1)); TEST_EXPECTED_VALUE(2, (CheckedNumeric<Dst>(1) + 1)); @@ -441,6 +713,15 @@ TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::max()) + DstLimits::max()); + TEST_EXPECTED_VALUE(1, (ClampedNumeric<Dst>() + 1)); + TEST_EXPECTED_VALUE(2, (ClampedNumeric<Dst>(1) + 1)); + if (numeric_limits<Dst>::is_signed) + TEST_EXPECTED_VALUE(0, (ClampedNumeric<Dst>(-1) + 1)); + TEST_EXPECTED_VALUE(DstLimits::lowest() + 1, + ClampedNumeric<Dst>(DstLimits::lowest()) + 1); + TEST_EXPECTED_VALUE(DstLimits::Overflow(), + ClampedNumeric<Dst>(DstLimits::max()) + DstLimits::max()); + // Generic subtraction. TEST_EXPECTED_VALUE(0, (CheckedNumeric<Dst>(1) - 1)); TEST_EXPECTED_SUCCESS(CheckedNumeric<Dst>(DstLimits::max()) - 1); @@ -451,6 +732,17 @@ TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::max()) - -1); } + TEST_EXPECTED_VALUE(0, (ClampedNumeric<Dst>(1) - 1)); + TEST_EXPECTED_VALUE(DstLimits::max() - 1, + ClampedNumeric<Dst>(DstLimits::max()) - 1); + if (numeric_limits<Dst>::is_signed) { + TEST_EXPECTED_VALUE(-1, (ClampedNumeric<Dst>() - 1)); + TEST_EXPECTED_VALUE(-2, (ClampedNumeric<Dst>(-1) - 1)); + } else { + TEST_EXPECTED_VALUE(DstLimits::max(), + ClampedNumeric<Dst>(DstLimits::max()) - -1); + } + // Generic multiplication. TEST_EXPECTED_VALUE(0, (CheckedNumeric<Dst>() * 1)); TEST_EXPECTED_VALUE(1, (CheckedNumeric<Dst>(1) * 1)); @@ -467,6 +759,22 @@ TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::max()) * DstLimits::max()); + TEST_EXPECTED_VALUE(0, (ClampedNumeric<Dst>() * 1)); + TEST_EXPECTED_VALUE(1, (ClampedNumeric<Dst>(1) * 1)); + TEST_EXPECTED_VALUE(0, (ClampedNumeric<Dst>(0) * 0)); + if (numeric_limits<Dst>::is_signed) { + TEST_EXPECTED_VALUE(0, (ClampedNumeric<Dst>(-1) * 0)); + TEST_EXPECTED_VALUE(0, (ClampedNumeric<Dst>(0) * -1)); + TEST_EXPECTED_VALUE(-2, (ClampedNumeric<Dst>(-1) * 2)); + } else { + TEST_EXPECTED_VALUE(DstLimits::Underflow(), + ClampedNumeric<Dst>(DstLimits::max()) * -2); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(DstLimits::max()) * + ClampedNumeric<uintmax_t>(-2)); + } + TEST_EXPECTED_VALUE(DstLimits::Overflow(), + ClampedNumeric<Dst>(DstLimits::max()) * DstLimits::max()); + // Generic division. TEST_EXPECTED_VALUE(0, CheckedNumeric<Dst>() / 1); TEST_EXPECTED_VALUE(1, CheckedNumeric<Dst>(1) / 1); @@ -474,6 +782,17 @@ CheckedNumeric<Dst>(DstLimits::lowest()) / 2); TEST_EXPECTED_VALUE(DstLimits::max() / 2, CheckedNumeric<Dst>(DstLimits::max()) / 2); + TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(1) / 0); + + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>() / 1); + TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(1) / 1); + TEST_EXPECTED_VALUE(DstLimits::lowest() / 2, + ClampedNumeric<Dst>(DstLimits::lowest()) / 2); + TEST_EXPECTED_VALUE(DstLimits::max() / 2, + ClampedNumeric<Dst>(DstLimits::max()) / 2); + TEST_EXPECTED_VALUE(DstLimits::Overflow(), ClampedNumeric<Dst>(1) / 0); + TEST_EXPECTED_VALUE(DstLimits::Underflow(), ClampedNumeric<Dst>(-1) / 0); + TEST_EXPECTED_VALUE(0, ClampedNumeric<Dst>(0) / 0); TestSpecializedArithmetic<Dst>(dst, line); } @@ -605,8 +924,8 @@ template <typename Dst, typename Src> struct TestNumericConversion<Dst, Src, SIGN_PRESERVING_VALUE_PRESERVING> { static void Test(const char *dst, const char *src, int line) { - using SrcLimits = numeric_limits<Src>; - using DstLimits = numeric_limits<Dst>; + using SrcLimits = SaturationDefaultLimits<Src>; + using DstLimits = SaturationDefaultLimits<Dst>; // Integral to floating. static_assert((DstLimits::is_iec559 && SrcLimits::is_integer) || // Not floating to integral and... @@ -622,18 +941,26 @@ TestStrictComparison<Dst, Src>(); const CheckedNumeric<Dst> checked_dst = SrcLimits::max(); + const ClampedNumeric<Dst> clamped_dst = SrcLimits::max(); TEST_EXPECTED_SUCCESS(checked_dst); + TEST_EXPECTED_VALUE(Dst(SrcLimits::max()), clamped_dst); if (MaxExponent<Dst>::value > MaxExponent<Src>::value) { if (MaxExponent<Dst>::value >= MaxExponent<Src>::value * 2 - 1) { // At least twice larger type. TEST_EXPECTED_SUCCESS(SrcLimits::max() * checked_dst); - + TEST_EXPECTED_VALUE(SrcLimits::max() * clamped_dst, + Dst(SrcLimits::max()) * SrcLimits::max()); } else { // Larger, but not at least twice as large. TEST_EXPECTED_FAILURE(SrcLimits::max() * checked_dst); TEST_EXPECTED_SUCCESS(checked_dst + 1); + TEST_EXPECTED_VALUE(DstLimits::Overflow(), + SrcLimits::max() * clamped_dst); + TEST_EXPECTED_VALUE(Dst(SrcLimits::max()) + Dst(1), + clamped_dst + Dst(1)); } } else { // Same width type. TEST_EXPECTED_FAILURE(checked_dst + 1); + TEST_EXPECTED_VALUE(DstLimits::Overflow(), clamped_dst + Dst(1)); } TEST_EXPECTED_RANGE(RANGE_VALID, SrcLimits::max()); @@ -653,8 +980,8 @@ template <typename Dst, typename Src> struct TestNumericConversion<Dst, Src, SIGN_PRESERVING_NARROW> { static void Test(const char *dst, const char *src, int line) { - using SrcLimits = numeric_limits<Src>; - using DstLimits = numeric_limits<Dst>; + using SrcLimits = SaturationDefaultLimits<Src>; + using DstLimits = SaturationDefaultLimits<Dst>; static_assert(SrcLimits::is_signed == DstLimits::is_signed, "Destination and source sign must be the same"); static_assert(MaxExponent<Dst>::value <= MaxExponent<Src>::value, @@ -664,9 +991,14 @@ const CheckedNumeric<Dst> checked_dst; TEST_EXPECTED_FAILURE(checked_dst + SrcLimits::max()); - TEST_EXPECTED_VALUE(1, checked_dst + static_cast<Src>(1)); + TEST_EXPECTED_VALUE(1, checked_dst + Src(1)); TEST_EXPECTED_FAILURE(checked_dst - SrcLimits::max()); + const ClampedNumeric<Dst> clamped_dst; + TEST_EXPECTED_VALUE(DstLimits::Overflow(), clamped_dst + SrcLimits::max()); + TEST_EXPECTED_VALUE(1, clamped_dst + Src(1)); + TEST_EXPECTED_VALUE(DstLimits::Underflow(), clamped_dst - SrcLimits::max()); + TEST_EXPECTED_RANGE(RANGE_OVERFLOW, SrcLimits::max()); TEST_EXPECTED_RANGE(RANGE_VALID, static_cast<Src>(1)); if (SrcLimits::is_iec559) { @@ -689,10 +1021,12 @@ } } else if (SrcLimits::is_signed) { TEST_EXPECTED_VALUE(-1, checked_dst - static_cast<Src>(1)); + TEST_EXPECTED_VALUE(-1, clamped_dst - static_cast<Src>(1)); TEST_EXPECTED_RANGE(RANGE_UNDERFLOW, SrcLimits::lowest()); TEST_EXPECTED_RANGE(RANGE_VALID, static_cast<Src>(-1)); } else { TEST_EXPECTED_FAILURE(checked_dst - static_cast<Src>(1)); + TEST_EXPECTED_VALUE(Dst(0), clamped_dst - static_cast<Src>(1)); TEST_EXPECTED_RANGE(RANGE_VALID, SrcLimits::lowest()); } } @@ -701,8 +1035,8 @@ template <typename Dst, typename Src> struct TestNumericConversion<Dst, Src, SIGN_TO_UNSIGN_WIDEN_OR_EQUAL> { static void Test(const char *dst, const char *src, int line) { - using SrcLimits = numeric_limits<Src>; - using DstLimits = numeric_limits<Dst>; + using SrcLimits = SaturationDefaultLimits<Src>; + using DstLimits = SaturationDefaultLimits<Dst>; static_assert(MaxExponent<Dst>::value >= MaxExponent<Src>::value, "Destination must be equal or wider than source."); static_assert(SrcLimits::is_signed, "Source must be signed"); @@ -713,8 +1047,17 @@ const CheckedNumeric<Dst> checked_dst; TEST_EXPECTED_VALUE(SrcLimits::max(), checked_dst + SrcLimits::max()); TEST_EXPECTED_FAILURE(checked_dst + static_cast<Src>(-1)); + TEST_EXPECTED_SUCCESS(checked_dst * static_cast<Src>(-1)); TEST_EXPECTED_FAILURE(checked_dst + SrcLimits::lowest()); + const ClampedNumeric<Dst> clamped_dst; + TEST_EXPECTED_VALUE(SrcLimits::max(), clamped_dst + SrcLimits::max()); + TEST_EXPECTED_VALUE(DstLimits::Underflow(), + clamped_dst + static_cast<Src>(-1)); + TEST_EXPECTED_VALUE(0, clamped_dst * static_cast<Src>(-1)); + TEST_EXPECTED_VALUE(DstLimits::Underflow(), + clamped_dst + SrcLimits::lowest()); + TEST_EXPECTED_RANGE(RANGE_UNDERFLOW, SrcLimits::lowest()); TEST_EXPECTED_RANGE(RANGE_VALID, SrcLimits::max()); TEST_EXPECTED_RANGE(RANGE_VALID, static_cast<Src>(1)); @@ -725,8 +1068,8 @@ template <typename Dst, typename Src> struct TestNumericConversion<Dst, Src, SIGN_TO_UNSIGN_NARROW> { static void Test(const char *dst, const char *src, int line) { - using SrcLimits = numeric_limits<Src>; - using DstLimits = numeric_limits<Dst>; + using SrcLimits = SaturationDefaultLimits<Src>; + using DstLimits = SaturationDefaultLimits<Dst>; static_assert(MaxExponent<Dst>::value < MaxExponent<Src>::value, "Destination must be narrower than source."); static_assert(SrcLimits::is_signed, "Source must be signed."); @@ -740,12 +1083,20 @@ TEST_EXPECTED_FAILURE(checked_dst + static_cast<Src>(-1)); TEST_EXPECTED_FAILURE(checked_dst + SrcLimits::lowest()); + const ClampedNumeric<Dst> clamped_dst; + TEST_EXPECTED_VALUE(1, clamped_dst + static_cast<Src>(1)); + TEST_EXPECTED_VALUE(DstLimits::Overflow(), clamped_dst + SrcLimits::max()); + TEST_EXPECTED_VALUE(DstLimits::Underflow(), + clamped_dst + static_cast<Src>(-1)); + TEST_EXPECTED_VALUE(DstLimits::Underflow(), + clamped_dst + SrcLimits::lowest()); + TEST_EXPECTED_RANGE(RANGE_OVERFLOW, SrcLimits::max()); TEST_EXPECTED_RANGE(RANGE_VALID, static_cast<Src>(1)); TEST_EXPECTED_RANGE(RANGE_UNDERFLOW, static_cast<Src>(-1)); // Additional saturation tests. - EXPECT_EQ(DstLimits::max(), saturated_cast<Dst>(SrcLimits::max())) << src; + EXPECT_EQ(DstLimits::max(), saturated_cast<Dst>(SrcLimits::max())); EXPECT_EQ(DstLimits::lowest(), saturated_cast<Dst>(SrcLimits::lowest())); if (SrcLimits::is_iec559) { @@ -776,8 +1127,8 @@ template <typename Dst, typename Src> struct TestNumericConversion<Dst, Src, UNSIGN_TO_SIGN_NARROW_OR_EQUAL> { static void Test(const char *dst, const char *src, int line) { - using SrcLimits = numeric_limits<Src>; - using DstLimits = numeric_limits<Dst>; + using SrcLimits = SaturationDefaultLimits<Src>; + using DstLimits = SaturationDefaultLimits<Dst>; static_assert(MaxExponent<Dst>::value <= MaxExponent<Src>::value, "Destination must be narrower or equal to source."); static_assert(!SrcLimits::is_signed, "Source must be unsigned."); @@ -790,6 +1141,11 @@ TEST_EXPECTED_FAILURE(checked_dst + SrcLimits::max()); TEST_EXPECTED_VALUE(SrcLimits::lowest(), checked_dst + SrcLimits::lowest()); + const ClampedNumeric<Dst> clamped_dst; + TEST_EXPECTED_VALUE(1, clamped_dst + static_cast<Src>(1)); + TEST_EXPECTED_VALUE(DstLimits::Overflow(), clamped_dst + SrcLimits::max()); + TEST_EXPECTED_VALUE(SrcLimits::lowest(), clamped_dst + SrcLimits::lowest()); + TEST_EXPECTED_RANGE(RANGE_VALID, SrcLimits::lowest()); TEST_EXPECTED_RANGE(RANGE_OVERFLOW, SrcLimits::max()); TEST_EXPECTED_RANGE(RANGE_VALID, static_cast<Src>(1)); @@ -1167,20 +1523,41 @@ } TEST(SafeNumerics, VariadicNumericOperations) { - auto a = CheckAdd(1, 2UL, MakeCheckedNum(3LL), 4).ValueOrDie(); - EXPECT_EQ(static_cast<decltype(a)::type>(10), a); - auto b = CheckSub(MakeCheckedNum(20.0), 2UL, 4).ValueOrDie(); - EXPECT_EQ(static_cast<decltype(b)::type>(14.0), b); - auto c = CheckMul(20.0, MakeCheckedNum(1), 5, 3UL).ValueOrDie(); - EXPECT_EQ(static_cast<decltype(c)::type>(300.0), c); - auto d = CheckDiv(20.0, 2.0, MakeCheckedNum(5LL), -4).ValueOrDie(); - EXPECT_EQ(static_cast<decltype(d)::type>(-.5), d); - auto e = CheckMod(MakeCheckedNum(20), 3).ValueOrDie(); - EXPECT_EQ(static_cast<decltype(e)::type>(2), e); - auto f = CheckLsh(1, MakeCheckedNum(2)).ValueOrDie(); - EXPECT_EQ(static_cast<decltype(f)::type>(4), f); - auto g = CheckRsh(4, MakeCheckedNum(2)).ValueOrDie(); - EXPECT_EQ(static_cast<decltype(g)::type>(1), g); - auto h = CheckRsh(CheckAdd(1, 1, 1, 1), CheckSub(4, 2)).ValueOrDie(); - EXPECT_EQ(static_cast<decltype(h)::type>(1), h); + { // Synthetic scope to avoid variable naming collisions. + auto a = CheckAdd(1, 2UL, MakeCheckedNum(3LL), 4).ValueOrDie(); + EXPECT_EQ(static_cast<decltype(a)::type>(10), a); + auto b = CheckSub(MakeCheckedNum(20.0), 2UL, 4).ValueOrDie(); + EXPECT_EQ(static_cast<decltype(b)::type>(14.0), b); + auto c = CheckMul(20.0, MakeCheckedNum(1), 5, 3UL).ValueOrDie(); + EXPECT_EQ(static_cast<decltype(c)::type>(300.0), c); + auto d = CheckDiv(20.0, 2.0, MakeCheckedNum(5LL), -4).ValueOrDie(); + EXPECT_EQ(static_cast<decltype(d)::type>(-.5), d); + auto e = CheckMod(MakeCheckedNum(20), 3).ValueOrDie(); + EXPECT_EQ(static_cast<decltype(e)::type>(2), e); + auto f = CheckLsh(1, MakeCheckedNum(2)).ValueOrDie(); + EXPECT_EQ(static_cast<decltype(f)::type>(4), f); + auto g = CheckRsh(4, MakeCheckedNum(2)).ValueOrDie(); + EXPECT_EQ(static_cast<decltype(g)::type>(1), g); + auto h = CheckRsh(CheckAdd(1, 1, 1, 1), CheckSub(4, 2)).ValueOrDie(); + EXPECT_EQ(static_cast<decltype(h)::type>(1), h); + } + + { + auto a = ClampAdd(1, 2UL, MakeClampedNum(3LL), 4); + EXPECT_EQ(static_cast<decltype(a)::type>(10), a); + auto b = ClampSub(MakeClampedNum(20.0), 2UL, 4); + EXPECT_EQ(static_cast<decltype(b)::type>(14.0), b); + auto c = ClampMul(20.0, MakeClampedNum(1), 5, 3UL); + EXPECT_EQ(static_cast<decltype(c)::type>(300.0), c); + auto d = ClampDiv(20.0, 2.0, MakeClampedNum(5LL), -4); + EXPECT_EQ(static_cast<decltype(d)::type>(-.5), d); + auto e = ClampMod(MakeClampedNum(20), 3); + EXPECT_EQ(static_cast<decltype(e)::type>(2), e); + auto f = ClampLsh(1, MakeClampedNum(2U)); + EXPECT_EQ(static_cast<decltype(f)::type>(4), f); + auto g = ClampRsh(4, MakeClampedNum(2U)); + EXPECT_EQ(static_cast<decltype(g)::type>(1), g); + auto h = ClampRsh(ClampAdd(1, 1, 1, 1), ClampSub(4U, 2)); + EXPECT_EQ(static_cast<decltype(h)::type>(1), h); + } }
diff --git a/base/process/process_info.h b/base/process/process_info.h index fe03b90..5138e247 100644 --- a/base/process/process_info.h +++ b/base/process/process_info.h
@@ -31,6 +31,10 @@ // Returns the integrity level of the process. Returns INTEGRITY_UNKNOWN in the // case of an underlying system failure. BASE_EXPORT IntegrityLevel GetCurrentProcessIntegrityLevel(); + +// Determines whether the current process is elevated. +BASE_EXPORT bool IsCurrentProcessElevated(); + #endif // defined(OS_WIN) } // namespace base
diff --git a/base/process/process_info_win.cc b/base/process/process_info_win.cc index 8c4b36cb..0678083 100644 --- a/base/process/process_info_win.cc +++ b/base/process/process_info_win.cc
@@ -13,6 +13,17 @@ namespace base { +namespace { + +HANDLE GetCurrentProcessToken() { + HANDLE process_token; + OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &process_token); + DCHECK(process_token != NULL && process_token != INVALID_HANDLE_VALUE); + return process_token; +} + +} // namespace + // static const Time CurrentProcessInfo::CreationTime() { FILETIME creation_time = {}; @@ -27,16 +38,11 @@ } IntegrityLevel GetCurrentProcessIntegrityLevel() { - HANDLE process_token; - if (!::OpenProcessToken(::GetCurrentProcess(), - TOKEN_QUERY | TOKEN_QUERY_SOURCE, &process_token)) { - return INTEGRITY_UNKNOWN; - } - win::ScopedHandle scoped_process_token(process_token); + base::win::ScopedHandle scoped_process_token(GetCurrentProcessToken()); DWORD token_info_length = 0; - if (::GetTokenInformation(process_token, TokenIntegrityLevel, nullptr, 0, - &token_info_length) || + if (::GetTokenInformation(scoped_process_token.Get(), TokenIntegrityLevel, + nullptr, 0, &token_info_length) || ::GetLastError() != ERROR_INSUFFICIENT_BUFFER) { return INTEGRITY_UNKNOWN; } @@ -44,8 +50,9 @@ auto token_label_bytes = MakeUnique<char[]>(token_info_length); TOKEN_MANDATORY_LABEL* token_label = reinterpret_cast<TOKEN_MANDATORY_LABEL*>(token_label_bytes.get()); - if (!::GetTokenInformation(process_token, TokenIntegrityLevel, token_label, - token_info_length, &token_info_length)) { + if (!::GetTokenInformation(scoped_process_token.Get(), TokenIntegrityLevel, + token_label, token_info_length, + &token_info_length)) { return INTEGRITY_UNKNOWN; } @@ -69,4 +76,19 @@ return INTEGRITY_UNKNOWN; } +bool IsCurrentProcessElevated() { + base::win::ScopedHandle scoped_process_token(GetCurrentProcessToken()); + + // Unlike TOKEN_ELEVATION_TYPE which returns TokenElevationTypeDefault when + // UAC is turned off, TOKEN_ELEVATION returns whether the process is elevated. + DWORD size; + TOKEN_ELEVATION elevation; + if (!GetTokenInformation(scoped_process_token.Get(), TokenElevation, + &elevation, sizeof(elevation), &size)) { + PLOG(ERROR) << "GetTokenInformation() failed"; + return false; + } + return !!elevation.TokenIsElevated; +} + } // namespace base
diff --git a/base/synchronization/waitable_event_unittest.cc b/base/synchronization/waitable_event_unittest.cc index 3aa1af16..e1d2683 100644 --- a/base/synchronization/waitable_event_unittest.cc +++ b/base/synchronization/waitable_event_unittest.cc
@@ -35,6 +35,25 @@ EXPECT_TRUE(event.TimedWait(TimeDelta::FromMilliseconds(10))); } +TEST(WaitableEventTest, ManualInitiallySignaled) { + WaitableEvent event(WaitableEvent::ResetPolicy::MANUAL, + WaitableEvent::InitialState::SIGNALED); + + EXPECT_TRUE(event.IsSignaled()); + EXPECT_TRUE(event.IsSignaled()); + + event.Reset(); + + EXPECT_FALSE(event.IsSignaled()); + EXPECT_FALSE(event.IsSignaled()); + + event.Signal(); + + event.Wait(); + EXPECT_TRUE(event.IsSignaled()); + EXPECT_TRUE(event.IsSignaled()); +} + TEST(WaitableEventTest, AutoBasics) { WaitableEvent event(WaitableEvent::ResetPolicy::AUTOMATIC, WaitableEvent::InitialState::NOT_SIGNALED); @@ -57,6 +76,19 @@ EXPECT_TRUE(event.TimedWait(TimeDelta::FromMilliseconds(10))); } +TEST(WaitableEventTest, AutoInitiallySignaled) { + WaitableEvent event(WaitableEvent::ResetPolicy::AUTOMATIC, + WaitableEvent::InitialState::SIGNALED); + + EXPECT_TRUE(event.IsSignaled()); + EXPECT_FALSE(event.IsSignaled()); + + event.Signal(); + + EXPECT_TRUE(event.IsSignaled()); + EXPECT_FALSE(event.IsSignaled()); +} + TEST(WaitableEventTest, WaitManyShortcut) { WaitableEvent* ev[5]; for (unsigned i = 0; i < 5; ++i) {
diff --git a/base/synchronization/waitable_event_watcher_unittest.cc b/base/synchronization/waitable_event_watcher_unittest.cc index 713ecb8e..c44c1cb 100644 --- a/base/synchronization/waitable_event_watcher_unittest.cc +++ b/base/synchronization/waitable_event_watcher_unittest.cc
@@ -29,26 +29,29 @@ #endif }; -const int kNumTestingMessageLoops = arraysize(testing_message_loops); - void QuitWhenSignaled(WaitableEvent* event) { MessageLoop::current()->QuitWhenIdle(); } class DecrementCountContainer { public: - explicit DecrementCountContainer(int* counter) : counter_(counter) { - } + explicit DecrementCountContainer(int* counter) : counter_(counter) {} void OnWaitableEventSignaled(WaitableEvent* object) { // NOTE: |object| may be already deleted. --(*counter_); } + private: int* counter_; }; -void RunTest_BasicSignal(MessageLoop::Type message_loop_type) { - MessageLoop message_loop(message_loop_type); +} // namespace + +class WaitableEventWatcherTest + : public testing::TestWithParam<MessageLoop::Type> {}; + +TEST_P(WaitableEventWatcherTest, BasicSignal) { + MessageLoop message_loop(GetParam()); // A manual-reset event that is not yet signaled. WaitableEvent event(WaitableEvent::ResetPolicy::MANUAL, @@ -62,8 +65,8 @@ RunLoop().Run(); } -void RunTest_BasicCancel(MessageLoop::Type message_loop_type) { - MessageLoop message_loop(message_loop_type); +TEST_P(WaitableEventWatcherTest, BasicCancel) { + MessageLoop message_loop(GetParam()); // A manual-reset event that is not yet signaled. WaitableEvent event(WaitableEvent::ResetPolicy::MANUAL, @@ -76,8 +79,8 @@ watcher.StopWatching(); } -void RunTest_CancelAfterSet(MessageLoop::Type message_loop_type) { - MessageLoop message_loop(message_loop_type); +TEST_P(WaitableEventWatcherTest, CancelAfterSet) { + MessageLoop message_loop(GetParam()); // A manual-reset event that is not yet signaled. WaitableEvent event(WaitableEvent::ResetPolicy::MANUAL, @@ -104,7 +107,7 @@ EXPECT_EQ(1, counter); } -void RunTest_OutlivesMessageLoop(MessageLoop::Type message_loop_type) { +TEST_P(WaitableEventWatcherTest, OutlivesMessageLoop) { // Simulate a MessageLoop that dies before an WaitableEventWatcher. This // ordinarily doesn't happen when people use the Thread class, but it can // happen when people use the Singleton pattern or atexit. @@ -113,15 +116,56 @@ { WaitableEventWatcher watcher; { - MessageLoop message_loop(message_loop_type); + MessageLoop message_loop(GetParam()); watcher.StartWatching(&event, BindOnce(&QuitWhenSignaled)); } } } -void RunTest_DeleteUnder(MessageLoop::Type message_loop_type, - bool delay_after_delete) { +TEST_P(WaitableEventWatcherTest, SignaledAtStart) { + MessageLoop message_loop(GetParam()); + + WaitableEvent event(WaitableEvent::ResetPolicy::MANUAL, + WaitableEvent::InitialState::SIGNALED); + + WaitableEventWatcher watcher; + watcher.StartWatching(&event, BindOnce(&QuitWhenSignaled)); + + RunLoop().Run(); +} + +TEST_P(WaitableEventWatcherTest, StartWatchingInCallback) { + MessageLoop message_loop(GetParam()); + + WaitableEvent event(WaitableEvent::ResetPolicy::MANUAL, + WaitableEvent::InitialState::NOT_SIGNALED); + + WaitableEventWatcher watcher; + watcher.StartWatching( + &event, BindOnce( + [](WaitableEventWatcher* watcher, WaitableEvent* event) { + // |event| is manual, so the second watcher will run + // immediately. + watcher->StartWatching(event, BindOnce(&QuitWhenSignaled)); + }, + &watcher)); + + event.Signal(); + + RunLoop().Run(); +} + +// To help detect errors around deleting WaitableEventWatcher, an additional +// bool parameter is used to test sleeping between watching and deletion. +class WaitableEventWatcherDeletionTest + : public testing::TestWithParam<std::tuple<MessageLoop::Type, bool>> {}; + +TEST_P(WaitableEventWatcherDeletionTest, DeleteUnder) { + MessageLoop::Type message_loop_type; + bool delay_after_delete; + std::tie(message_loop_type, delay_after_delete) = GetParam(); + // Delete the WaitableEvent out from under the Watcher. This is explictly // allowed by the interface. @@ -148,8 +192,11 @@ } } -void RunTest_SignalAndDelete(MessageLoop::Type message_loop_type, - bool delay_after_delete) { +TEST_P(WaitableEventWatcherDeletionTest, SignalAndDelete) { + MessageLoop::Type message_loop_type; + bool delay_after_delete; + std::tie(message_loop_type, delay_after_delete) = GetParam(); + // Signal and immediately delete the WaitableEvent out from under the Watcher. MessageLoop message_loop(message_loop_type); @@ -179,46 +226,14 @@ } } -} // namespace +INSTANTIATE_TEST_CASE_P(, + WaitableEventWatcherTest, + testing::ValuesIn(testing_message_loops)); -//----------------------------------------------------------------------------- - -TEST(WaitableEventWatcherTest, BasicSignal) { - for (int i = 0; i < kNumTestingMessageLoops; i++) { - RunTest_BasicSignal(testing_message_loops[i]); - } -} - -TEST(WaitableEventWatcherTest, BasicCancel) { - for (int i = 0; i < kNumTestingMessageLoops; i++) { - RunTest_BasicCancel(testing_message_loops[i]); - } -} - -TEST(WaitableEventWatcherTest, CancelAfterSet) { - for (int i = 0; i < kNumTestingMessageLoops; i++) { - RunTest_CancelAfterSet(testing_message_loops[i]); - } -} - -TEST(WaitableEventWatcherTest, OutlivesMessageLoop) { - for (int i = 0; i < kNumTestingMessageLoops; i++) { - RunTest_OutlivesMessageLoop(testing_message_loops[i]); - } -} - -TEST(WaitableEventWatcherTest, DeleteUnder) { - for (int i = 0; i < kNumTestingMessageLoops; i++) { - RunTest_DeleteUnder(testing_message_loops[i], false); - RunTest_DeleteUnder(testing_message_loops[i], true); - } -} - -TEST(WaitableEventWatcherTest, SignalAndDelete) { - for (int i = 0; i < kNumTestingMessageLoops; i++) { - RunTest_SignalAndDelete(testing_message_loops[i], false); - RunTest_SignalAndDelete(testing_message_loops[i], true); - } -} +INSTANTIATE_TEST_CASE_P( + , + WaitableEventWatcherDeletionTest, + testing::Combine(testing::ValuesIn(testing_message_loops), + testing::Bool())); } // namespace base
diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc index 76fa0d4..cd64bda 100644 --- a/base/test/launcher/test_launcher.cc +++ b/base/test/launcher/test_launcher.cc
@@ -21,6 +21,7 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" +#include "base/numerics/safe_conversions.h" #include "base/process/kill.h" #include "base/process/launch.h" #include "base/run_loop.h" @@ -33,6 +34,7 @@ #include "base/strings/stringize_macros.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "base/sys_info.h" #include "base/test/gtest_util.h" #include "base/test/launcher/test_launcher_tracer.h" #include "base/test/launcher/test_results_tracker.h" @@ -803,22 +805,6 @@ if (command_line->HasSwitch(switches::kTestLauncherForceRunBrokenTests)) force_run_broken_tests_ = true; - if (command_line->HasSwitch(switches::kTestLauncherJobs)) { - size_t jobs = 0U; - if (!StringToSizeT(command_line->GetSwitchValueASCII( - switches::kTestLauncherJobs), &jobs) || - !jobs) { - LOG(ERROR) << "Invalid value for " << switches::kTestLauncherJobs; - return false; - } - - parallel_jobs_ = jobs; - } else if (command_line->HasSwitch(kGTestFilterFlag) && !BotModeEnabled()) { - // Do not run jobs in parallel by default if we are running a subset of - // the tests and if bot mode is off. - parallel_jobs_ = 1U; - } - fprintf(stdout, "Using %" PRIuS " parallel jobs.\n", parallel_jobs_); fflush(stdout); if (parallel_jobs_ > 1U) { @@ -1199,6 +1185,31 @@ return worker_thread_->task_runner(); } +size_t NumParallelJobs() { + CommandLine* command_line = CommandLine::ForCurrentProcess(); + CommandLine::SwitchMap switches = command_line->GetSwitches(); + + size_t jobs = 0U; + + if (command_line->HasSwitch(kGTestFilterFlag) && !BotModeEnabled()) { + // Do not run jobs in parallel by default if we are running a subset of + // the tests and if bot mode is off. + return 1U; + } else if (command_line->HasSwitch(switches::kTestLauncherJobs)) { + if (!StringToSizeT( + command_line->GetSwitchValueASCII(switches::kTestLauncherJobs), + &jobs) || + !jobs) { + LOG(ERROR) << "Invalid value for " << switches::kTestLauncherJobs; + return 0U; + } + + return jobs; + } + + return base::checked_cast<size_t>(SysInfo::NumberOfProcessors()); +} + std::string GetTestOutputSnippet(const TestResult& result, const std::string& full_output) { size_t run_pos = full_output.find(std::string("[ RUN ] ") +
diff --git a/base/test/launcher/test_launcher.h b/base/test/launcher/test_launcher.h index 52288b1..dd69846 100644 --- a/base/test/launcher/test_launcher.h +++ b/base/test/launcher/test_launcher.h
@@ -244,6 +244,9 @@ DISALLOW_COPY_AND_ASSIGN(TestLauncher); }; +// Return the number of parallel jobs to use, or 0U in case of error. +size_t NumParallelJobs(); + // Extract part from |full_output| that applies to |result|. std::string GetTestOutputSnippet(const TestResult& result, const std::string& full_output);
diff --git a/base/test/launcher/unit_test_launcher.cc b/base/test/launcher/unit_test_launcher.cc index 65531a2..28a50d3 100644 --- a/base/test/launcher/unit_test_launcher.cc +++ b/base/test/launcher/unit_test_launcher.cc
@@ -183,7 +183,7 @@ } int LaunchUnitTestsInternal(const RunTestSuiteCallback& run_test_suite, - int default_jobs, + size_t parallel_jobs, int default_batch_limit, bool use_job_objects, const Closure& gtest_init) { @@ -246,7 +246,7 @@ DefaultUnitTestPlatformDelegate platform_delegate; UnitTestLauncherDelegate delegate( &platform_delegate, batch_limit, use_job_objects); - base::TestLauncher launcher(&delegate, default_jobs); + base::TestLauncher launcher(&delegate, parallel_jobs); bool success = launcher.Run(); fprintf(stdout, "Tests took %" PRId64 " seconds.\n", @@ -455,40 +455,33 @@ char** argv, const RunTestSuiteCallback& run_test_suite) { CommandLine::Init(argc, argv); - return LaunchUnitTestsInternal( - run_test_suite, - SysInfo::NumberOfProcessors(), - kDefaultTestBatchLimit, - true, - Bind(&InitGoogleTestChar, &argc, argv)); + size_t parallel_jobs = NumParallelJobs(); + if (parallel_jobs == 0U) { + return 1; + } + return LaunchUnitTestsInternal(run_test_suite, parallel_jobs, + kDefaultTestBatchLimit, true, + Bind(&InitGoogleTestChar, &argc, argv)); } int LaunchUnitTestsSerially(int argc, char** argv, const RunTestSuiteCallback& run_test_suite) { CommandLine::Init(argc, argv); - return LaunchUnitTestsInternal( - run_test_suite, - 1, - kDefaultTestBatchLimit, - true, - Bind(&InitGoogleTestChar, &argc, argv)); + return LaunchUnitTestsInternal(run_test_suite, 1U, kDefaultTestBatchLimit, + true, Bind(&InitGoogleTestChar, &argc, argv)); } -int LaunchUnitTestsWithOptions( - int argc, - char** argv, - int default_jobs, - int default_batch_limit, - bool use_job_objects, - const RunTestSuiteCallback& run_test_suite) { +int LaunchUnitTestsWithOptions(int argc, + char** argv, + size_t parallel_jobs, + int default_batch_limit, + bool use_job_objects, + const RunTestSuiteCallback& run_test_suite) { CommandLine::Init(argc, argv); - return LaunchUnitTestsInternal( - run_test_suite, - default_jobs, - default_batch_limit, - use_job_objects, - Bind(&InitGoogleTestChar, &argc, argv)); + return LaunchUnitTestsInternal(run_test_suite, parallel_jobs, + default_batch_limit, use_job_objects, + Bind(&InitGoogleTestChar, &argc, argv)); } #if defined(OS_WIN) @@ -498,12 +491,13 @@ const RunTestSuiteCallback& run_test_suite) { // Windows CommandLine::Init ignores argv anyway. CommandLine::Init(argc, NULL); - return LaunchUnitTestsInternal( - run_test_suite, - SysInfo::NumberOfProcessors(), - kDefaultTestBatchLimit, - use_job_objects, - Bind(&InitGoogleTestWChar, &argc, argv)); + size_t parallel_jobs = NumParallelJobs(); + if (parallel_jobs == 0U) { + return 1; + } + return LaunchUnitTestsInternal(run_test_suite, parallel_jobs, + kDefaultTestBatchLimit, use_job_objects, + Bind(&InitGoogleTestWChar, &argc, argv)); } #endif // defined(OS_WIN)
diff --git a/base/test/launcher/unit_test_launcher.h b/base/test/launcher/unit_test_launcher.h index 2e6b813..91abcfb 100644 --- a/base/test/launcher/unit_test_launcher.h +++ b/base/test/launcher/unit_test_launcher.h
@@ -29,17 +29,16 @@ const RunTestSuiteCallback& run_test_suite); // Launches unit tests in given test suite. Returns exit code. -// |default_jobs| is the default number of parallel test jobs. +// |parallel_jobs| is the number of parallel test jobs. // |default_batch_limit| is the default size of test batch // (use 0 to disable batching). // |use_job_objects| determines whether to use job objects. -int LaunchUnitTestsWithOptions( - int argc, - char** argv, - int default_jobs, - int default_batch_limit, - bool use_job_objects, - const RunTestSuiteCallback& run_test_suite); +int LaunchUnitTestsWithOptions(int argc, + char** argv, + size_t parallel_jobs, + int default_batch_limit, + bool use_job_objects, + const RunTestSuiteCallback& run_test_suite); #if defined(OS_WIN) // Launches unit tests in given test suite. Returns exit code.
diff --git a/base/trace_event/trace_config.cc b/base/trace_event/trace_config.cc index e2e7b8f..b2ffec1 100644 --- a/base/trace_event/trace_config.cc +++ b/base/trace_event/trace_config.cc
@@ -248,10 +248,6 @@ return *this; } -const TraceConfig::StringList& TraceConfig::GetSyntheticDelayValues() const { - return category_filter_.synthetic_delays(); -} - std::string TraceConfig::ToString() const { std::unique_ptr<DictionaryValue> dict = ToDict(); std::string json;
diff --git a/base/trace_event/trace_config.h b/base/trace_event/trace_config.h index 13b2f5f0..2e7f6c0 100644 --- a/base/trace_event/trace_config.h +++ b/base/trace_event/trace_config.h
@@ -127,8 +127,6 @@ // All the same rules apply above, so for example, having both included and // excluded categories in the same list would not be supported. // - // Category filters can also be used to configure synthetic delays. - // // |trace_options_string| is a comma-delimited list of trace options. // Possible options are: "record-until-full", "record-continuously", // "record-as-much-as-possible", "trace-to-console", "enable-systrace" and @@ -154,15 +152,6 @@ // would disable everything but webkit; and use default options. // Example: TraceConfig("-webkit", ""); // would enable everything but webkit; and use default options. - // Example: TraceConfig("DELAY(gpu.PresentingFrame;16)", ""); - // would make swap buffers always take at least 16 ms; and use - // default options. - // Example: TraceConfig("DELAY(gpu.PresentingFrame;16;oneshot)", ""); - // would make swap buffers take at least 16 ms the first time it is - // called; and use default options. - // Example: TraceConfig("DELAY(gpu.PresentingFrame;16;alternating)", ""); - // would make swap buffers take at least 16 ms every other time it - // is called; and use default options. TraceConfig(StringPiece category_filter_string, StringPiece trace_options_string); @@ -182,7 +171,6 @@ // "inc_pattern*", // "disabled-by-default-memory-infra"], // "excluded_categories": ["excluded", "exc_pattern*"], - // "synthetic_delays": ["test.Delay1;16", "test.Delay2;32"], // "memory_dump_config": { // "triggers": [ // { @@ -207,9 +195,6 @@ TraceConfig& operator=(const TraceConfig& rhs); - // Return a list of the synthetic delays specified in this category filter. - const StringList& GetSyntheticDelayValues() const; - TraceRecordMode GetTraceRecordMode() const { return record_mode_; } bool IsSystraceEnabled() const { return enable_systrace_; } bool IsArgumentFilterEnabled() const { return enable_argument_filter_; }
diff --git a/base/trace_event/trace_config_category_filter.cc b/base/trace_event/trace_config_category_filter.cc index 234db18..e430dd8 100644 --- a/base/trace_event/trace_config_category_filter.cc +++ b/base/trace_event/trace_config_category_filter.cc
@@ -18,9 +18,6 @@ namespace { const char kIncludedCategoriesParam[] = "included_categories"; const char kExcludedCategoriesParam[] = "excluded_categories"; -const char kSyntheticDelaysParam[] = "synthetic_delays"; - -const char kSyntheticDelayCategoryFilterPrefix[] = "DELAY("; } TraceConfigCategoryFilter::TraceConfigCategoryFilter() {} @@ -29,8 +26,7 @@ const TraceConfigCategoryFilter& other) : included_categories_(other.included_categories_), disabled_categories_(other.disabled_categories_), - excluded_categories_(other.excluded_categories_), - synthetic_delays_(other.synthetic_delays_) {} + excluded_categories_(other.excluded_categories_) {} TraceConfigCategoryFilter::~TraceConfigCategoryFilter() {} @@ -39,7 +35,6 @@ included_categories_ = rhs.included_categories_; disabled_categories_ = rhs.disabled_categories_; excluded_categories_ = rhs.excluded_categories_; - synthetic_delays_ = rhs.synthetic_delays_; return *this; } @@ -51,19 +46,7 @@ // Ignore empty categories. if (category.empty()) continue; - // Synthetic delays are of the form 'DELAY(delay;option;option;...)'. - if (StartsWith(category, kSyntheticDelayCategoryFilterPrefix, - CompareCase::SENSITIVE) && - category.back() == ')') { - StringPiece synthetic_category = category.substr( - strlen(kSyntheticDelayCategoryFilterPrefix), - category.size() - strlen(kSyntheticDelayCategoryFilterPrefix) - 1); - size_t name_length = synthetic_category.find(';'); - if (name_length != std::string::npos && name_length > 0 && - name_length != synthetic_category.size() - 1) { - synthetic_delays_.push_back(synthetic_category.as_string()); - } - } else if (category.front() == '-') { + if (category.front() == '-') { // Excluded categories start with '-'. // Remove '-' from category string. excluded_categories_.push_back(category.substr(1).as_string()); @@ -82,8 +65,6 @@ SetCategoriesFromIncludedList(*category_list); if (dict.GetList(kExcludedCategoriesParam, &category_list)) SetCategoriesFromExcludedList(*category_list); - if (dict.GetList(kSyntheticDelaysParam, &category_list)) - SetSyntheticDelaysFromList(*category_list); } bool TraceConfigCategoryFilter::IsCategoryGroupEnabled( @@ -176,16 +157,12 @@ excluded_categories_.insert(excluded_categories_.end(), config.excluded_categories_.begin(), config.excluded_categories_.end()); - synthetic_delays_.insert(synthetic_delays_.end(), - config.synthetic_delays_.begin(), - config.synthetic_delays_.end()); } void TraceConfigCategoryFilter::Clear() { included_categories_.clear(); disabled_categories_.clear(); excluded_categories_.clear(); - synthetic_delays_.clear(); } void TraceConfigCategoryFilter::ToDict(DictionaryValue* dict) const { @@ -194,7 +171,6 @@ disabled_categories_.end()); AddCategoriesToDict(categories, kIncludedCategoriesParam, dict); AddCategoriesToDict(excluded_categories_, kExcludedCategoriesParam, dict); - AddCategoriesToDict(synthetic_delays_, kSyntheticDelaysParam, dict); } std::string TraceConfigCategoryFilter::ToFilterString() const { @@ -202,7 +178,6 @@ WriteCategoryFilterString(included_categories_, &filter_string, true); WriteCategoryFilterString(disabled_categories_, &filter_string, true); WriteCategoryFilterString(excluded_categories_, &filter_string, false); - WriteCategoryFilterString(synthetic_delays_, &filter_string); return filter_string; } @@ -232,21 +207,6 @@ } } -void TraceConfigCategoryFilter::SetSyntheticDelaysFromList( - const ListValue& list) { - for (size_t i = 0; i < list.GetSize(); ++i) { - std::string delay; - if (!list.GetString(i, &delay)) - continue; - // Synthetic delays are of the form "delay;option;option;...". - size_t name_length = delay.find(';'); - if (name_length != std::string::npos && name_length > 0 && - name_length != delay.size() - 1) { - synthetic_delays_.push_back(delay); - } - } -} - void TraceConfigCategoryFilter::AddCategoriesToDict( const StringList& categories, const char* param, @@ -274,20 +234,6 @@ } } -void TraceConfigCategoryFilter::WriteCategoryFilterString( - const StringList& delays, - std::string* out) const { - bool prepend_comma = !out->empty(); - int token_cnt = 0; - for (const std::string& category : delays) { - if (token_cnt > 0 || prepend_comma) - StringAppendF(out, ","); - StringAppendF(out, "%s%s)", kSyntheticDelayCategoryFilterPrefix, - category.c_str()); - ++token_cnt; - } -} - // static bool TraceConfigCategoryFilter::IsCategoryNameAllowed(StringPiece str) { return !str.empty() && str.front() != ' ' && str.back() != ' ';
diff --git a/base/trace_event/trace_config_category_filter.h b/base/trace_event/trace_config_category_filter.h index 0d7dba0..0140c1d 100644 --- a/base/trace_event/trace_config_category_filter.h +++ b/base/trace_event/trace_config_category_filter.h
@@ -57,12 +57,10 @@ const StringList& included_categories() const { return included_categories_; } const StringList& excluded_categories() const { return excluded_categories_; } - const StringList& synthetic_delays() const { return synthetic_delays_; } private: void SetCategoriesFromIncludedList(const ListValue& included_list); void SetCategoriesFromExcludedList(const ListValue& excluded_list); - void SetSyntheticDelaysFromList(const ListValue& list); void AddCategoriesToDict(const StringList& categories, const char* param, @@ -71,13 +69,10 @@ void WriteCategoryFilterString(const StringList& values, std::string* out, bool included) const; - void WriteCategoryFilterString(const StringList& delays, - std::string* out) const; StringList included_categories_; StringList disabled_categories_; StringList excluded_categories_; - StringList synthetic_delays_; }; } // namespace trace_event
diff --git a/base/trace_event/trace_config_unittest.cc b/base/trace_event/trace_config_unittest.cc index 76377011..30f82f9 100644 --- a/base/trace_event/trace_config_unittest.cc +++ b/base/trace_event/trace_config_unittest.cc
@@ -60,8 +60,7 @@ "}" "]" "}," - "\"record_mode\":\"record-continuously\"," - "\"synthetic_delays\":[\"test.Delay1;16\",\"test.Delay2;32\"]" + "\"record_mode\":\"record-continuously\"" "}"; void CheckDefaultTraceConfigBehavior(const TraceConfig& tc) { @@ -186,10 +185,6 @@ EXPECT_STREQ("included,disabled-by-default-cc", config.ToCategoryFilterString().c_str()); - config = TraceConfig("DELAY(test.Delay1;16),included", ""); - EXPECT_STREQ("included,DELAY(test.Delay1;16)", - config.ToCategoryFilterString().c_str()); - // From both trace options and category filter strings config = TraceConfig("", ""); EXPECT_EQ(RECORD_UNTIL_FULL, config.GetTraceRecordMode()); @@ -245,19 +240,6 @@ EXPECT_STREQ("arbitrary-category", config.ToCategoryFilterString().c_str()); EXPECT_STREQ("record-until-full,enable-systrace", config.ToTraceOptionsString().c_str()); - - const char* const configs[] = { - "", - "DELAY(", - "DELAY(;", - "DELAY(;)", - "DELAY(test.Delay)", - "DELAY(test.Delay;)" - }; - for (size_t i = 0; i < arraysize(configs); i++) { - TraceConfig tc(configs[i], ""); - EXPECT_EQ(0u, tc.GetSyntheticDelayValues().size()); - } } TEST(TraceConfigTest, ConstructDefaultTraceConfig) { @@ -366,11 +348,11 @@ EXPECT_EQ(RECORD_CONTINUOUSLY, custom_tc.GetTraceRecordMode()); EXPECT_TRUE(custom_tc.IsSystraceEnabled()); EXPECT_TRUE(custom_tc.IsArgumentFilterEnabled()); - EXPECT_STREQ("included,inc_pattern*," - "disabled-by-default-cc,disabled-by-default-memory-infra," - "-excluded,-exc_pattern*," - "DELAY(test.Delay1;16),DELAY(test.Delay2;32)", - custom_tc.ToCategoryFilterString().c_str()); + EXPECT_STREQ( + "included,inc_pattern*," + "disabled-by-default-cc,disabled-by-default-memory-infra," + "-excluded,-exc_pattern*", + custom_tc.ToCategoryFilterString().c_str()); } TEST(TraceConfigTest, TraceConfigFromValidString) { @@ -391,8 +373,7 @@ "\"included_categories\":[\"included\"," "\"inc_pattern*\"," "\"disabled-by-default-cc\"]," - "\"record_mode\":\"record-continuously\"," - "\"synthetic_delays\":[\"test.Delay1;16\",\"test.Delay2;32\"]" + "\"record_mode\":\"record-continuously\"" "}"; TraceConfig tc(config_string); @@ -400,9 +381,10 @@ EXPECT_EQ(RECORD_CONTINUOUSLY, tc.GetTraceRecordMode()); EXPECT_TRUE(tc.IsSystraceEnabled()); EXPECT_TRUE(tc.IsArgumentFilterEnabled()); - EXPECT_STREQ("included,inc_pattern*,disabled-by-default-cc,-excluded," - "-exc_pattern*,DELAY(test.Delay1;16),DELAY(test.Delay2;32)", - tc.ToCategoryFilterString().c_str()); + EXPECT_STREQ( + "included,inc_pattern*,disabled-by-default-cc,-excluded," + "-exc_pattern*", + tc.ToCategoryFilterString().c_str()); EXPECT_TRUE(tc.category_filter().IsCategoryEnabled("included")); EXPECT_TRUE(tc.category_filter().IsCategoryEnabled("inc_pattern_category")); @@ -424,12 +406,7 @@ EXPECT_TRUE(tc.IsCategoryGroupEnabled("included,excluded")); EXPECT_FALSE(tc.IsCategoryGroupEnabled("excluded,exc_pattern_category")); - EXPECT_TRUE(tc.IsCategoryGroupEnabled("included,DELAY(test.Delay1;16)")); - EXPECT_FALSE(tc.IsCategoryGroupEnabled("DELAY(test.Delay1;16)")); - - EXPECT_EQ(2u, tc.GetSyntheticDelayValues().size()); - EXPECT_STREQ("test.Delay1;16", tc.GetSyntheticDelayValues()[0].c_str()); - EXPECT_STREQ("test.Delay2;32", tc.GetSyntheticDelayValues()[1].c_str()); + EXPECT_TRUE(tc.IsCategoryGroupEnabled("included")); EXPECT_EQ(tc.event_filters().size(), 1u); const TraceConfig::EventFilterConfig& event_filter = tc.event_filters()[0]; @@ -524,21 +501,16 @@ CheckDefaultTraceConfigBehavior(tc); const char invalid_config_string[] = - "{" + "{" "\"enable_systrace\":1," "\"excluded_categories\":[\"excluded\"]," "\"included_categories\":\"not a list\"," - "\"record_mode\":\"arbitrary-mode\"," - "\"synthetic_delays\":[\"test.Delay1;16\"," - "\"invalid-delay\"," - "\"test.Delay2;32\"]" - "}"; + "\"record_mode\":\"arbitrary-mode\"" + "}"; tc = TraceConfig(invalid_config_string); EXPECT_EQ(RECORD_UNTIL_FULL, tc.GetTraceRecordMode()); EXPECT_FALSE(tc.IsSystraceEnabled()); EXPECT_FALSE(tc.IsArgumentFilterEnabled()); - EXPECT_STREQ("-excluded,DELAY(test.Delay1;16),DELAY(test.Delay2;32)", - tc.ToCategoryFilterString().c_str()); const char invalid_config_string_2[] = "{" @@ -565,13 +537,6 @@ "\"record_mode\":\"record-until-full\"" "}", tc.ToString().c_str()); - - tc = TraceConfig("DELAY(test.Delay1;16)", ""); - tc2 = TraceConfig("DELAY(test.Delay2;32)", ""); - tc.Merge(tc2); - EXPECT_EQ(2u, tc.GetSyntheticDelayValues().size()); - EXPECT_STREQ("test.Delay1;16", tc.GetSyntheticDelayValues()[0].c_str()); - EXPECT_STREQ("test.Delay2;32", tc.GetSyntheticDelayValues()[1].c_str()); } TEST(TraceConfigTest, IsCategoryGroupEnabled) {
diff --git a/base/trace_event/trace_event_synthetic_delay.cc b/base/trace_event/trace_event_synthetic_delay.cc deleted file mode 100644 index cfae743..0000000 --- a/base/trace_event/trace_event_synthetic_delay.cc +++ /dev/null
@@ -1,235 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/macros.h" -#include "base/memory/singleton.h" -#include "base/third_party/dynamic_annotations/dynamic_annotations.h" -#include "base/trace_event/trace_event_synthetic_delay.h" - -namespace { -const int kMaxSyntheticDelays = 32; -} // namespace - -namespace base { -namespace trace_event { - -TraceEventSyntheticDelayClock::TraceEventSyntheticDelayClock() {} -TraceEventSyntheticDelayClock::~TraceEventSyntheticDelayClock() {} - -class TraceEventSyntheticDelayRegistry : public TraceEventSyntheticDelayClock { - public: - static TraceEventSyntheticDelayRegistry* GetInstance(); - - TraceEventSyntheticDelay* GetOrCreateDelay(const char* name); - void ResetAllDelays(); - - // TraceEventSyntheticDelayClock implementation. - TimeTicks Now() override; - - private: - TraceEventSyntheticDelayRegistry(); - - friend struct DefaultSingletonTraits<TraceEventSyntheticDelayRegistry>; - - Lock lock_; - TraceEventSyntheticDelay delays_[kMaxSyntheticDelays]; - TraceEventSyntheticDelay dummy_delay_; - subtle::Atomic32 delay_count_; - - DISALLOW_COPY_AND_ASSIGN(TraceEventSyntheticDelayRegistry); -}; - -TraceEventSyntheticDelay::TraceEventSyntheticDelay() - : mode_(STATIC), begin_count_(0), trigger_count_(0), clock_(NULL) {} - -TraceEventSyntheticDelay::~TraceEventSyntheticDelay() {} - -TraceEventSyntheticDelay* TraceEventSyntheticDelay::Lookup( - const std::string& name) { - return TraceEventSyntheticDelayRegistry::GetInstance()->GetOrCreateDelay( - name.c_str()); -} - -void TraceEventSyntheticDelay::Initialize( - const std::string& name, - TraceEventSyntheticDelayClock* clock) { - name_ = name; - clock_ = clock; -} - -void TraceEventSyntheticDelay::SetTargetDuration(TimeDelta target_duration) { - AutoLock lock(lock_); - target_duration_ = target_duration; - trigger_count_ = 0; - begin_count_ = 0; -} - -void TraceEventSyntheticDelay::SetMode(Mode mode) { - AutoLock lock(lock_); - mode_ = mode; -} - -void TraceEventSyntheticDelay::SetClock(TraceEventSyntheticDelayClock* clock) { - AutoLock lock(lock_); - clock_ = clock; -} - -void TraceEventSyntheticDelay::Begin() { - // Note that we check for a non-zero target duration without locking to keep - // things quick for the common case when delays are disabled. Since the delay - // calculation is done with a lock held, it will always be correct. The only - // downside of this is that we may fail to apply some delays when the target - // duration changes. - ANNOTATE_BENIGN_RACE(&target_duration_, "Synthetic delay duration"); - if (!target_duration_.ToInternalValue()) - return; - - TimeTicks start_time = clock_->Now(); - { - AutoLock lock(lock_); - if (++begin_count_ != 1) - return; - end_time_ = CalculateEndTimeLocked(start_time); - } -} - -void TraceEventSyntheticDelay::BeginParallel(TimeTicks* out_end_time) { - // See note in Begin(). - ANNOTATE_BENIGN_RACE(&target_duration_, "Synthetic delay duration"); - if (!target_duration_.ToInternalValue()) { - *out_end_time = TimeTicks(); - return; - } - - TimeTicks start_time = clock_->Now(); - { - AutoLock lock(lock_); - *out_end_time = CalculateEndTimeLocked(start_time); - } -} - -void TraceEventSyntheticDelay::End() { - // See note in Begin(). - ANNOTATE_BENIGN_RACE(&target_duration_, "Synthetic delay duration"); - if (!target_duration_.ToInternalValue()) - return; - - TimeTicks end_time; - { - AutoLock lock(lock_); - if (!begin_count_ || --begin_count_ != 0) - return; - end_time = end_time_; - } - if (!end_time.is_null()) - ApplyDelay(end_time); -} - -void TraceEventSyntheticDelay::EndParallel(TimeTicks end_time) { - if (!end_time.is_null()) - ApplyDelay(end_time); -} - -TimeTicks TraceEventSyntheticDelay::CalculateEndTimeLocked( - TimeTicks start_time) { - if (mode_ == ONE_SHOT && trigger_count_++) - return TimeTicks(); - else if (mode_ == ALTERNATING && trigger_count_++ % 2) - return TimeTicks(); - return start_time + target_duration_; -} - -void TraceEventSyntheticDelay::ApplyDelay(TimeTicks end_time) { - TRACE_EVENT0("synthetic_delay", name_.c_str()); - while (clock_->Now() < end_time) { - // Busy loop. - } -} - -TraceEventSyntheticDelayRegistry* -TraceEventSyntheticDelayRegistry::GetInstance() { - return Singleton< - TraceEventSyntheticDelayRegistry, - LeakySingletonTraits<TraceEventSyntheticDelayRegistry> >::get(); -} - -TraceEventSyntheticDelayRegistry::TraceEventSyntheticDelayRegistry() - : delay_count_(0) {} - -TraceEventSyntheticDelay* TraceEventSyntheticDelayRegistry::GetOrCreateDelay( - const char* name) { - // Try to find an existing delay first without locking to make the common case - // fast. - int delay_count = subtle::Acquire_Load(&delay_count_); - for (int i = 0; i < delay_count; ++i) { - if (!strcmp(name, delays_[i].name_.c_str())) - return &delays_[i]; - } - - AutoLock lock(lock_); - delay_count = subtle::Acquire_Load(&delay_count_); - for (int i = 0; i < delay_count; ++i) { - if (!strcmp(name, delays_[i].name_.c_str())) - return &delays_[i]; - } - - DCHECK(delay_count < kMaxSyntheticDelays) - << "must increase kMaxSyntheticDelays"; - if (delay_count >= kMaxSyntheticDelays) - return &dummy_delay_; - - delays_[delay_count].Initialize(std::string(name), this); - subtle::Release_Store(&delay_count_, delay_count + 1); - return &delays_[delay_count]; -} - -TimeTicks TraceEventSyntheticDelayRegistry::Now() { - return TimeTicks::Now(); -} - -void TraceEventSyntheticDelayRegistry::ResetAllDelays() { - AutoLock lock(lock_); - int delay_count = subtle::Acquire_Load(&delay_count_); - for (int i = 0; i < delay_count; ++i) { - delays_[i].SetTargetDuration(TimeDelta()); - delays_[i].SetClock(this); - } -} - -void ResetTraceEventSyntheticDelays() { - TraceEventSyntheticDelayRegistry::GetInstance()->ResetAllDelays(); -} - -} // namespace trace_event -} // namespace base - -namespace trace_event_internal { - -ScopedSyntheticDelay::ScopedSyntheticDelay(const char* name, - base::subtle::AtomicWord* impl_ptr) - : delay_impl_(GetOrCreateDelay(name, impl_ptr)) { - delay_impl_->BeginParallel(&end_time_); -} - -ScopedSyntheticDelay::~ScopedSyntheticDelay() { - delay_impl_->EndParallel(end_time_); -} - -base::trace_event::TraceEventSyntheticDelay* GetOrCreateDelay( - const char* name, - base::subtle::AtomicWord* impl_ptr) { - base::trace_event::TraceEventSyntheticDelay* delay_impl = - reinterpret_cast<base::trace_event::TraceEventSyntheticDelay*>( - base::subtle::Acquire_Load(impl_ptr)); - if (!delay_impl) { - delay_impl = - base::trace_event::TraceEventSyntheticDelayRegistry::GetInstance() - ->GetOrCreateDelay(name); - base::subtle::Release_Store( - impl_ptr, reinterpret_cast<base::subtle::AtomicWord>(delay_impl)); - } - return delay_impl; -} - -} // namespace trace_event_internal
diff --git a/base/trace_event/trace_event_synthetic_delay.h b/base/trace_event/trace_event_synthetic_delay.h deleted file mode 100644 index e86f9eee..0000000 --- a/base/trace_event/trace_event_synthetic_delay.h +++ /dev/null
@@ -1,164 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// The synthetic delay framework makes it possible to dynamically inject -// arbitrary delays into into different parts of the codebase. This can be used, -// for instance, for testing various task scheduling algorithms. -// -// The delays are specified in terms of a target duration for a given block of -// code. If the code executes faster than the duration, the thread is made to -// sleep until the deadline is met. -// -// Code can be instrumented for delays with two sets of macros. First, for -// delays that should apply within a scope, use the following macro: -// -// TRACE_EVENT_SYNTHETIC_DELAY("cc.LayerTreeHost.DrawAndSwap"); -// -// For delaying operations that span multiple scopes, use: -// -// TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("cc.Scheduler.BeginMainFrame"); -// ... -// TRACE_EVENT_SYNTHETIC_DELAY_END("cc.Scheduler.BeginMainFrame"); -// -// Here BEGIN establishes the start time for the delay and END executes the -// delay based on the remaining time. If BEGIN is called multiple times in a -// row, END should be called a corresponding number of times. Only the last -// call to END will have an effect. -// -// Note that a single delay may begin on one thread and end on another. This -// implies that a single delay cannot not be applied in several threads at once. - -#ifndef BASE_TRACE_EVENT_TRACE_EVENT_SYNTHETIC_DELAY_H_ -#define BASE_TRACE_EVENT_TRACE_EVENT_SYNTHETIC_DELAY_H_ - -#include "base/atomicops.h" -#include "base/macros.h" -#include "base/synchronization/lock.h" -#include "base/time/time.h" -#include "base/trace_event/trace_event.h" - -// Apply a named delay in the current scope. -#define TRACE_EVENT_SYNTHETIC_DELAY(name) \ - static base::subtle::AtomicWord INTERNAL_TRACE_EVENT_UID(impl_ptr) = 0; \ - trace_event_internal::ScopedSyntheticDelay INTERNAL_TRACE_EVENT_UID(delay)( \ - name, &INTERNAL_TRACE_EVENT_UID(impl_ptr)); - -// Begin a named delay, establishing its timing start point. May be called -// multiple times as long as the calls to TRACE_EVENT_SYNTHETIC_DELAY_END are -// balanced. Only the first call records the timing start point. -#define TRACE_EVENT_SYNTHETIC_DELAY_BEGIN(name) \ - do { \ - static base::subtle::AtomicWord impl_ptr = 0; \ - trace_event_internal::GetOrCreateDelay(name, &impl_ptr)->Begin(); \ - } while (false) - -// End a named delay. The delay is applied only if this call matches the -// first corresponding call to TRACE_EVENT_SYNTHETIC_DELAY_BEGIN with the -// same delay. -#define TRACE_EVENT_SYNTHETIC_DELAY_END(name) \ - do { \ - static base::subtle::AtomicWord impl_ptr = 0; \ - trace_event_internal::GetOrCreateDelay(name, &impl_ptr)->End(); \ - } while (false) - -namespace base { -namespace trace_event { - -// Time source for computing delay durations. Used for testing. -class TRACE_EVENT_API_CLASS_EXPORT TraceEventSyntheticDelayClock { - public: - TraceEventSyntheticDelayClock(); - virtual ~TraceEventSyntheticDelayClock(); - virtual base::TimeTicks Now() = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(TraceEventSyntheticDelayClock); -}; - -// Single delay point instance. -class TRACE_EVENT_API_CLASS_EXPORT TraceEventSyntheticDelay { - public: - enum Mode { - STATIC, // Apply the configured delay every time. - ONE_SHOT, // Apply the configured delay just once. - ALTERNATING // Apply the configured delay every other time. - }; - - // Returns an existing named delay instance or creates a new one with |name|. - static TraceEventSyntheticDelay* Lookup(const std::string& name); - - void SetTargetDuration(TimeDelta target_duration); - void SetMode(Mode mode); - void SetClock(TraceEventSyntheticDelayClock* clock); - - // Begin the delay, establishing its timing start point. May be called - // multiple times as long as the calls to End() are balanced. Only the first - // call records the timing start point. - void Begin(); - - // End the delay. The delay is applied only if this call matches the first - // corresponding call to Begin() with the same delay. - void End(); - - // Begin a parallel instance of the delay. Several parallel instances may be - // active simultaneously and will complete independently. The computed end - // time for the delay is stored in |out_end_time|, which should later be - // passed to EndParallel(). - void BeginParallel(base::TimeTicks* out_end_time); - - // End a previously started parallel delay. |end_time| is the delay end point - // computed by BeginParallel(). - void EndParallel(base::TimeTicks end_time); - - private: - TraceEventSyntheticDelay(); - ~TraceEventSyntheticDelay(); - friend class TraceEventSyntheticDelayRegistry; - - void Initialize(const std::string& name, - TraceEventSyntheticDelayClock* clock); - base::TimeTicks CalculateEndTimeLocked(base::TimeTicks start_time); - void ApplyDelay(base::TimeTicks end_time); - - Lock lock_; - Mode mode_; - std::string name_; - int begin_count_; - int trigger_count_; - base::TimeTicks end_time_; - base::TimeDelta target_duration_; - TraceEventSyntheticDelayClock* clock_; - - DISALLOW_COPY_AND_ASSIGN(TraceEventSyntheticDelay); -}; - -// Set the target durations of all registered synthetic delay points to zero. -TRACE_EVENT_API_CLASS_EXPORT void ResetTraceEventSyntheticDelays(); - -} // namespace trace_event -} // namespace base - -namespace trace_event_internal { - -// Helper class for scoped delays. Do not use directly. -class TRACE_EVENT_API_CLASS_EXPORT ScopedSyntheticDelay { - public: - explicit ScopedSyntheticDelay(const char* name, - base::subtle::AtomicWord* impl_ptr); - ~ScopedSyntheticDelay(); - - private: - base::trace_event::TraceEventSyntheticDelay* delay_impl_; - base::TimeTicks end_time_; - - DISALLOW_COPY_AND_ASSIGN(ScopedSyntheticDelay); -}; - -// Helper for registering delays. Do not use directly. -TRACE_EVENT_API_CLASS_EXPORT base::trace_event::TraceEventSyntheticDelay* - GetOrCreateDelay(const char* name, base::subtle::AtomicWord* impl_ptr); - -} // namespace trace_event_internal - -#endif // BASE_TRACE_EVENT_TRACE_EVENT_SYNTHETIC_DELAY_H_
diff --git a/base/trace_event/trace_event_synthetic_delay_unittest.cc b/base/trace_event/trace_event_synthetic_delay_unittest.cc deleted file mode 100644 index 97a4580b..0000000 --- a/base/trace_event/trace_event_synthetic_delay_unittest.cc +++ /dev/null
@@ -1,157 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/trace_event/trace_event_synthetic_delay.h" - -#include <stdint.h> - -#include "base/macros.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace base { -namespace trace_event { -namespace { - -const int kTargetDurationMs = 100; -// Allow some leeway in timings to make it possible to run these tests with a -// wall clock time source too. -const int kShortDurationMs = 10; - -} // namespace - -class TraceEventSyntheticDelayTest : public testing::Test, - public TraceEventSyntheticDelayClock { - public: - TraceEventSyntheticDelayTest() {} - ~TraceEventSyntheticDelayTest() override { ResetTraceEventSyntheticDelays(); } - - // TraceEventSyntheticDelayClock implementation. - base::TimeTicks Now() override { - AdvanceTime(base::TimeDelta::FromMilliseconds(kShortDurationMs / 10)); - return now_; - } - - TraceEventSyntheticDelay* ConfigureDelay(const char* name) { - TraceEventSyntheticDelay* delay = TraceEventSyntheticDelay::Lookup(name); - delay->SetClock(this); - delay->SetTargetDuration( - base::TimeDelta::FromMilliseconds(kTargetDurationMs)); - return delay; - } - - void AdvanceTime(base::TimeDelta delta) { now_ += delta; } - - int64_t TestFunction() { - base::TimeTicks start = Now(); - { TRACE_EVENT_SYNTHETIC_DELAY("test.Delay"); } - return (Now() - start).InMilliseconds(); - } - - int64_t AsyncTestFunctionBegin() { - base::TimeTicks start = Now(); - { TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("test.AsyncDelay"); } - return (Now() - start).InMilliseconds(); - } - - int64_t AsyncTestFunctionEnd() { - base::TimeTicks start = Now(); - { TRACE_EVENT_SYNTHETIC_DELAY_END("test.AsyncDelay"); } - return (Now() - start).InMilliseconds(); - } - - private: - base::TimeTicks now_; - - DISALLOW_COPY_AND_ASSIGN(TraceEventSyntheticDelayTest); -}; - -TEST_F(TraceEventSyntheticDelayTest, StaticDelay) { - TraceEventSyntheticDelay* delay = ConfigureDelay("test.Delay"); - delay->SetMode(TraceEventSyntheticDelay::STATIC); - EXPECT_GE(TestFunction(), kTargetDurationMs); -} - -TEST_F(TraceEventSyntheticDelayTest, OneShotDelay) { - TraceEventSyntheticDelay* delay = ConfigureDelay("test.Delay"); - delay->SetMode(TraceEventSyntheticDelay::ONE_SHOT); - EXPECT_GE(TestFunction(), kTargetDurationMs); - EXPECT_LT(TestFunction(), kShortDurationMs); - - delay->SetTargetDuration( - base::TimeDelta::FromMilliseconds(kTargetDurationMs)); - EXPECT_GE(TestFunction(), kTargetDurationMs); -} - -TEST_F(TraceEventSyntheticDelayTest, AlternatingDelay) { - TraceEventSyntheticDelay* delay = ConfigureDelay("test.Delay"); - delay->SetMode(TraceEventSyntheticDelay::ALTERNATING); - EXPECT_GE(TestFunction(), kTargetDurationMs); - EXPECT_LT(TestFunction(), kShortDurationMs); - EXPECT_GE(TestFunction(), kTargetDurationMs); - EXPECT_LT(TestFunction(), kShortDurationMs); -} - -TEST_F(TraceEventSyntheticDelayTest, AsyncDelay) { - ConfigureDelay("test.AsyncDelay"); - EXPECT_LT(AsyncTestFunctionBegin(), kShortDurationMs); - EXPECT_GE(AsyncTestFunctionEnd(), kTargetDurationMs / 2); -} - -TEST_F(TraceEventSyntheticDelayTest, AsyncDelayExceeded) { - ConfigureDelay("test.AsyncDelay"); - EXPECT_LT(AsyncTestFunctionBegin(), kShortDurationMs); - AdvanceTime(base::TimeDelta::FromMilliseconds(kTargetDurationMs)); - EXPECT_LT(AsyncTestFunctionEnd(), kShortDurationMs); -} - -TEST_F(TraceEventSyntheticDelayTest, AsyncDelayNoActivation) { - ConfigureDelay("test.AsyncDelay"); - EXPECT_LT(AsyncTestFunctionEnd(), kShortDurationMs); -} - -TEST_F(TraceEventSyntheticDelayTest, AsyncDelayNested) { - ConfigureDelay("test.AsyncDelay"); - EXPECT_LT(AsyncTestFunctionBegin(), kShortDurationMs); - EXPECT_LT(AsyncTestFunctionBegin(), kShortDurationMs); - EXPECT_LT(AsyncTestFunctionEnd(), kShortDurationMs); - EXPECT_GE(AsyncTestFunctionEnd(), kTargetDurationMs / 2); -} - -TEST_F(TraceEventSyntheticDelayTest, AsyncDelayUnbalanced) { - ConfigureDelay("test.AsyncDelay"); - EXPECT_LT(AsyncTestFunctionBegin(), kShortDurationMs); - EXPECT_GE(AsyncTestFunctionEnd(), kTargetDurationMs / 2); - EXPECT_LT(AsyncTestFunctionEnd(), kShortDurationMs); - - EXPECT_LT(AsyncTestFunctionBegin(), kShortDurationMs); - EXPECT_GE(AsyncTestFunctionEnd(), kTargetDurationMs / 2); -} - -TEST_F(TraceEventSyntheticDelayTest, ResetDelays) { - ConfigureDelay("test.Delay"); - ResetTraceEventSyntheticDelays(); - EXPECT_LT(TestFunction(), kShortDurationMs); -} - -TEST_F(TraceEventSyntheticDelayTest, BeginParallel) { - TraceEventSyntheticDelay* delay = ConfigureDelay("test.AsyncDelay"); - base::TimeTicks end_times[2]; - base::TimeTicks start_time = Now(); - - delay->BeginParallel(&end_times[0]); - EXPECT_FALSE(end_times[0].is_null()); - - delay->BeginParallel(&end_times[1]); - EXPECT_FALSE(end_times[1].is_null()); - - delay->EndParallel(end_times[0]); - EXPECT_GE((Now() - start_time).InMilliseconds(), kTargetDurationMs); - - start_time = Now(); - delay->EndParallel(end_times[1]); - EXPECT_LT((Now() - start_time).InMilliseconds(), kShortDurationMs); -} - -} // namespace trace_event -} // namespace base
diff --git a/base/trace_event/trace_event_unittest.cc b/base/trace_event/trace_event_unittest.cc index 5b68c4ef..8dbf716 100644 --- a/base/trace_event/trace_event_unittest.cc +++ b/base/trace_event/trace_event_unittest.cc
@@ -36,7 +36,6 @@ #include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event_filter.h" #include "base/trace_event/trace_event_filter_test_utils.h" -#include "base/trace_event/trace_event_synthetic_delay.h" #include "base/values.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -2943,49 +2942,6 @@ } } -TEST_F(TraceEventTestFixture, ConfigureSyntheticDelays) { - BeginSpecificTrace("DELAY(test.Delay;0.05)"); - - base::TimeTicks start = base::TimeTicks::Now(); - { - TRACE_EVENT_SYNTHETIC_DELAY("test.Delay"); - } - base::TimeDelta duration = base::TimeTicks::Now() - start; - EXPECT_GE(duration.InMilliseconds(), 50); - - EndTraceAndFlush(); -} - -TEST_F(TraceEventTestFixture, BadSyntheticDelayConfigurations) { - const char* const filters[] = { - "", - "DELAY(", - "DELAY(;", - "DELAY(;)", - "DELAY(test.Delay)", - "DELAY(test.Delay;)" - }; - for (size_t i = 0; i < arraysize(filters); i++) { - BeginSpecificTrace(filters[i]); - EndTraceAndFlush(); - TraceConfig trace_config = TraceLog::GetInstance()->GetCurrentTraceConfig(); - EXPECT_EQ(0u, trace_config.GetSyntheticDelayValues().size()); - } -} - -TEST_F(TraceEventTestFixture, SyntheticDelayConfigurationMerging) { - TraceConfig config1("DELAY(test.Delay1;16)", ""); - TraceConfig config2("DELAY(test.Delay2;32)", ""); - config1.Merge(config2); - EXPECT_EQ(2u, config1.GetSyntheticDelayValues().size()); -} - -TEST_F(TraceEventTestFixture, SyntheticDelayConfigurationToString) { - const char filter[] = "DELAY(test.Delay;16;oneshot)"; - TraceConfig config(filter, ""); - EXPECT_EQ(filter, config.ToCategoryFilterString()); -} - TEST_F(TraceEventTestFixture, TraceFilteringMode) { const char config_json[] = "{"
diff --git a/base/trace_event/trace_log.cc b/base/trace_event/trace_log.cc index c22efce..87e48fca 100644 --- a/base/trace_event/trace_log.cc +++ b/base/trace_event/trace_log.cc
@@ -42,7 +42,6 @@ #include "base/trace_event/process_memory_dump.h" #include "base/trace_event/trace_buffer.h" #include "base/trace_event/trace_event.h" -#include "base/trace_event/trace_event_synthetic_delay.h" #include "build/build_config.h" #if defined(OS_WIN) @@ -523,35 +522,6 @@ } } -void TraceLog::UpdateSyntheticDelaysFromTraceConfig() { - ResetTraceEventSyntheticDelays(); - const TraceConfig::StringList& delays = - trace_config_.GetSyntheticDelayValues(); - TraceConfig::StringList::const_iterator ci; - for (ci = delays.begin(); ci != delays.end(); ++ci) { - StringTokenizer tokens(*ci, ";"); - if (!tokens.GetNext()) - continue; - TraceEventSyntheticDelay* delay = - TraceEventSyntheticDelay::Lookup(tokens.token()); - while (tokens.GetNext()) { - std::string token = tokens.token(); - char* duration_end; - double target_duration = strtod(token.c_str(), &duration_end); - if (duration_end != token.c_str()) { - delay->SetTargetDuration(TimeDelta::FromMicroseconds( - static_cast<int64_t>(target_duration * 1e6))); - } else if (token == "static") { - delay->SetMode(TraceEventSyntheticDelay::STATIC); - } else if (token == "oneshot") { - delay->SetMode(TraceEventSyntheticDelay::ONE_SHOT); - } else if (token == "alternating") { - delay->SetMode(TraceEventSyntheticDelay::ALTERNATING); - } - } - } -} - void TraceLog::GetKnownCategoryGroups( std::vector<std::string>* category_groups) { for (const auto& category : CategoryRegistry::GetAllCategories()) { @@ -636,7 +606,6 @@ num_traces_recorded_++; UpdateCategoryRegistry(); - UpdateSyntheticDelaysFromTraceConfig(); dispatching_to_observer_list_ = true; observer_list = enabled_state_observer_list_;
diff --git a/base/trace_event/trace_log.h b/base/trace_event/trace_log.h index 0a13df6..b5ebc4f6 100644 --- a/base/trace_event/trace_log.h +++ b/base/trace_event/trace_log.h
@@ -364,10 +364,6 @@ void CreateFiltersForTraceConfig(); - // Configure synthetic delays based on the values set in the current - // trace config. - void UpdateSyntheticDelaysFromTraceConfig(); - InternalTraceOptions GetInternalOptionsFromTraceConfig( const TraceConfig& config);
diff --git a/build/android/adb_install_apk.py b/build/android/adb_install_apk.py index fd8b8d7..f17143a 100755 --- a/build/android/adb_install_apk.py +++ b/build/android/adb_install_apk.py
@@ -115,12 +115,12 @@ timeout=args.timeout) except (device_errors.CommandFailedError, device_errors.DeviceUnreachableError): - logging.exception('Failed to install %s', args.apk_name) + logging.exception('Failed to install %s', apk) if blacklist: blacklist.Extend([str(device)], reason='install_failure') logging.warning('Blacklisting %s', str(device)) except device_errors.CommandTimeoutError: - logging.exception('Timed out while installing %s', args.apk_name) + logging.exception('Timed out while installing %s', apk) if blacklist: blacklist.Extend([str(device)], reason='install_timeout') logging.warning('Blacklisting %s', str(device))
diff --git a/build/android/gradle/generate_gradle.py b/build/android/gradle/generate_gradle.py index e7bf827..ba2311a 100755 --- a/build/android/gradle/generate_gradle.py +++ b/build/android/gradle/generate_gradle.py
@@ -211,7 +211,7 @@ def JavaFiles(self): if self._java_files is None: - java_sources_file = self.Gradle().get('java_sources_file') + java_sources_file = self.DepsInfo().get('java_sources_file') java_files = [] if java_sources_file: java_sources_file = _RebasePath(java_sources_file)
diff --git a/build/android/gyp/package_resources.py b/build/android/gyp/package_resources.py index 8782122..a8cfcc7 100755 --- a/build/android/gyp/package_resources.py +++ b/build/android/gyp/package_resources.py
@@ -366,7 +366,7 @@ package_command = _ConstructMostAaptArgs(options) - output_paths = [ options.apk_path ] + output_paths = [options.apk_path] if options.create_density_splits: for _, dst_path in _GenerateDensitySplitPaths(options.apk_path): @@ -375,9 +375,9 @@ _GenerateLanguageSplitOutputPaths(options.apk_path, options.language_splits)) - input_paths = [ options.android_manifest ] + options.resource_zips + input_paths = [options.android_manifest] + options.resource_zips - input_strings = [] + input_strings = [options.exclude_xxxhdpi] + options.xxxhdpi_whitelist input_strings.extend(package_command) # The md5_check.py doesn't count file path in md5 intentionally,
diff --git a/build/android/gyp/write_build_config.py b/build/android/gyp/write_build_config.py index c085176..6eab4b2 100755 --- a/build/android/gyp/write_build_config.py +++ b/build/android/gyp/write_build_config.py
@@ -413,7 +413,7 @@ gradle['android_manifest'] = options.android_manifest if options.type in ('java_binary', 'java_library', 'android_apk'): if options.java_sources_file: - gradle['java_sources_file'] = options.java_sources_file + deps_info['java_sources_file'] = options.java_sources_file if options.bundled_srcjars: gradle['bundled_srcjars'] = ( build_utils.ParseGnList(options.bundled_srcjars)) @@ -436,6 +436,14 @@ gradle['dependent_java_projects'].append(c['path']) + if options.type == 'android_apk': + config['jni'] = {} + all_java_sources = [c['java_sources_file'] for c in all_library_deps + if 'java_sources_file' in c] + if options.java_sources_file: + all_java_sources.append(options.java_sources_file) + config['jni']['all_source'] = all_java_sources + if (options.type in ('java_binary', 'java_library')): deps_info['requires_android'] = options.requires_android deps_info['supports_android'] = options.supports_android
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni index 38032b768..ceffd063 100644 --- a/build/config/android/rules.gni +++ b/build/config/android/rules.gni
@@ -192,7 +192,6 @@ "--depfile", rebase_path(depfile, root_build_dir), "--input_file={{source}}", - "--optimize_generation=1", "--ptr_type=long", "--output_dir", rebase_path(jni_output_dir, root_build_dir), @@ -302,7 +301,6 @@ rebase_path(jar_file, root_build_dir), "--input_file", class, - "--optimize_generation=1", "--ptr_type=long", "--output_dir", rebase_path(jni_output_dir, root_build_dir), @@ -334,6 +332,61 @@ } } + # Declare a jni registration target. + # + # This target generates a header file calling JNI registration functions + # created by generate_jni and generate_jar_jni. + # + # See base/android/jni_generator/jni_registration_generator.py for more info + # about the format of the header file. + # + # Variables + # target: The Apk target to generate registrations for. + # output: Path to the generated .h file. + # exception_files: List of .java files that should be ignored when searching + # for native methods. (optional) + # + # Example + # generate_jni_registration("chrome_jni_registration") { + # target = ":chrome_public_apk" + # output = "$root_gen_dir/chrome/browser/android/${target_name}.h" + # exception_files = [ + # "//base/android/java/src/org/chromium/base/library_loader/LegacyLinker.java", + # "//base/android/java/src/org/chromium/base/library_loader/Linker.java", + # "//base/android/java/src/org/chromium/base/library_loader/ModernLinker.java", + # ] + # } + template("generate_jni_registration") { + action(target_name) { + forward_variables_from(invoker, [ "testonly" ]) + _build_config = get_label_info(invoker.target, "target_gen_dir") + "/" + + get_label_info(invoker.target, "name") + ".build_config" + _rebased_build_config = rebase_path(_build_config, root_build_dir) + + _rebase_exception_java_files = + rebase_path(invoker.exception_files, root_build_dir) + + script = "//base/android/jni_generator/jni_registration_generator.py" + deps = [ + "${invoker.target}__build_config", + ] + inputs = [ + _build_config, + ] + outputs = [ + invoker.output, + ] + + args = [ + # This is a list of .sources files. + "--sources_files=@FileArg($_rebased_build_config:jni:all_source)", + "--output", + rebase_path(invoker.output, root_build_dir), + "--no_register_java=$_rebase_exception_java_files", + ] + } + } + # Declare a target for c-preprocessor-generated java files # # NOTE: For generating Java conterparts to enums prefer using the java_cpp_enum
diff --git a/build/config/c++/c++.gni b/build/config/c++/c++.gni index 5a62670a..4ab97d8 100644 --- a/build/config/c++/c++.gni +++ b/build/config/c++/c++.gni
@@ -4,20 +4,10 @@ import("//build/config/sanitizers/sanitizers.gni") -if (current_toolchain != default_toolchain) { - use_custom_libcxx = false -} - declare_args() { # Use libc++ (buildtools/third_party/libc++ and # buildtools/third_party/libc++abi) instead of stdlibc++ as standard # library. - # TODO(thomasanderson): Clean up this complex condition. The - # is_tsan, is_msan, and (use_libfuzzer && !is_mac), clauses can be - # removed since they are only used on non-CrOs Linux. is_ubsan can - # probably also be removed for the same reason. - use_custom_libcxx = - (is_linux && !is_chromeos && (!is_chromecast || is_cast_desktop_build)) || - is_tsan || is_msan || is_ubsan || is_ubsan_security || - (use_libfuzzer && !is_mac) || use_afl + use_custom_libcxx = (is_linux && !is_chromeos && + (!is_chromecast || is_cast_desktop_build)) || is_msan }
diff --git a/build/config/ios/dummy.py b/build/config/ios/dummy.py new file mode 100644 index 0000000..b23b7da --- /dev/null +++ b/build/config/ios/dummy.py
@@ -0,0 +1,15 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Empty script that does nothing and return success error code. + +This script is used by some gn targets that pretend creating some output +but instead depend on another target creating the output indirectly (in +general this output is a directory that is used as input by a bundle_data +target). + +It ignores all parameters and terminate with a success error code. It +does the same thing as the unix command "true", but gn can only invoke +python scripts. +"""
diff --git a/build/config/ios/imageset.gni b/build/config/ios/imageset.gni new file mode 100644 index 0000000..22677a4b --- /dev/null +++ b/build/config/ios/imageset.gni
@@ -0,0 +1,114 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This template declares a bundle_data target that references an .imageset +# so that it is compiled to the asset catalog of the generated bundle. +# +# The create_bundle target requires that all .imageset are part of an +# .xcasset bundle. This requirement comes from actool that only receives +# the path to the .xcasset bundle directory and not to the individual +# .imageset directories. +# +# The requirement is a bit problematic as it prevents compiling only a +# subset of the .imageset that are contained in a .xcasset. This template +# fixes that by instead copying the content of the .imageset to temporary +# .xcasset directory (below $root_out_dir) and defining a bundle_data +# target that refers to those copies (this is efficient as the "copy" is +# implemented by hardlinking if possible on macOS). +# +# Since the create_data target will only refer to the .xcasset directory +# and additional "action" target that runs a dummy script is defined. It +# does nothing but pretends to generate the .xcassets directory (while +# it is really created as a side-effect of the "copy" step). This allows +# to workaround the check in "gn" that all inputs below $root_out_dir have +# to be outputs of another target with a public dependency path. +# +# This template also ensures that the file are only copied once when the +# build targets multiple architectures at the same time (aka "fat build"). +# +# Arguments +# +# sources: +# required, list of strings, paths to the file contained in the +# .imageset directory; this must contain the Contents.json file +# and all the image referenced by it (not enforced by the template). +# +template("imageset") { + assert(defined(invoker.sources) && invoker.sources != [], + "sources must be defined and not empty for $target_name") + + if (current_toolchain != default_toolchain) { + group(target_name) { + public_deps = [ + ":$target_name($default_toolchain)", + ] + } + } else { + _copy_target_name = target_name + "__copy" + _fake_target_name = target_name + "__fake" + _data_target_name = target_name + + foreach(_source, invoker.sources) { + _dir = get_path_info(_source, "dir") + assert(get_path_info(_dir, "extension") == "imageset", + "$_source dirname must have .imageset extension") + } + + _sources = invoker.sources + _imageset_dir = get_path_info(get_path_info(_sources[0], "dir"), "file") + _xcassets_dir = "$target_gen_dir/$target_name.xcassets" + + copy(_copy_target_name) { + # Forward "deps", "public_deps" and "testonly" in case some of the + # source files are generated. + forward_variables_from(invoker, + [ + "deps", + "public_deps", + "testonly", + ]) + + visibility = [ ":$_fake_target_name" ] + sources = _sources + outputs = [ + "$_xcassets_dir/$_imageset_dir/{{source_file_part}}", + ] + } + + action(_fake_target_name) { + forward_variables_from(invoker, [ "testonly" ]) + + visibility = [ ":$_data_target_name" ] + script = "//build/config/ios/dummy.py" + sources = _sources + outputs = [ + "$_xcassets_dir", + ] + public_deps = [ + ":$_copy_target_name", + ] + args = rebase_path(sources, root_build_dir) + + rebase_path(outputs, root_build_dir) + } + + bundle_data(_data_target_name) { + forward_variables_from(invoker, + "*", + [ + "deps", + "outputs", + "public_deps", + "sources", + ]) + + sources = get_target_outputs(":$_copy_target_name") + outputs = [ + "{{bundle_resources_dir}}/{{source_file_part}}", + ] + public_deps = [ + ":$_fake_target_name", + ] + } + } +}
diff --git a/build/config/jumbo.gni b/build/config/jumbo.gni new file mode 100644 index 0000000..baf19f1 --- /dev/null +++ b/build/config/jumbo.gni
@@ -0,0 +1,146 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/split_static_library.gni") # When someone uses that target_type + +declare_args() { + # If true, use a jumbo build (files compiled together) to speed up + # compilation. + use_jumbo_build = false + + # A target to exclude from jumbo builds, for optimal round trip time + # when frequently changing a single cpp file. + jumbo_build_excluded = "" + + # How many files to group at most. Smaller numbers give more + # parallellism, higher numbers give less total CPU usage. Higher + # numbers also give longer single-file recompilation times. + # + # Recommendations: + # Higher numbers than 200 does not reduce wall clock compile times + # for 4 cores or less. + # 200 uses 8% less total CPU than 100 when compiling content and 10% + # less wall clock when compiling with 4 cores. + jumbo_file_merge_limit = 200 +} + +# Use this to generate a target which merges sources if possible to +# compile much faster. +# +# Special values. +# +# target_type +# The kind of target to build. For example the string +# "static_library". +# +# always_build_jumbo +# If set and set to true, then use jumbo compile even when it is +# globally disabled. Otherwise it has no effect. +# +# never_build_jumbo +# If set and set to true, then do not jumbo compile even if it is +# globally enabled. Otherwise it has no effect. +# +# jumbo_excluded_sources +# If set to a list of files, those files will not be merged with +# the rest. This can be necessary if merging the files causes +# compilation issues and fixing the issues is impractical. +template("jumbo_target") { + use_jumbo_build_for_target = use_jumbo_build + if (defined(invoker.always_build_jumbo) && invoker.always_build_jumbo) { + use_jumbo_build_for_target = true + } + if (defined(invoker.never_build_jumbo) && invoker.never_build_jumbo) { + use_jumbo_build_for_target = false + } + if (target_name == jumbo_build_excluded) { + use_jumbo_build_for_target = false + } + + excluded_sources = [] + if (defined(invoker.jumbo_excluded_sources)) { + excluded_sources += invoker.jumbo_excluded_sources + } + + invoker_sources = invoker.sources + gen_target_dir = get_path_info(invoker_sources[0], "gen_dir") + assert(excluded_sources != [] || true) # Prevent "unused variable". + assert(gen_target_dir != "") # Prevent "unused variable". + + if (use_jumbo_build_for_target) { + jumbo_files = [] + + # Split the sources list into chunks that are not excessively large + files_per_chunk = jumbo_file_merge_limit + current_file_index = 0 + next_chunk_start = 0 + next_chunk_number = 1 + foreach(source_file, invoker.sources) { + if (current_file_index == next_chunk_start) { + jumbo_files += [ "$gen_target_dir/" + target_name + "_jumbo_" + + next_chunk_number + ".cc" ] + next_chunk_number += 1 + next_chunk_start += files_per_chunk + } + current_file_index += 1 + } + + merge_action_name = target_name + "__jumbo_merge" + + # Create an action that calls a script that merges all the source files. + action(merge_action_name) { + script = "//build/config/merge_for_jumbo.py" + response_file_contents = + rebase_path(invoker.sources - excluded_sources, gen_target_dir) + outputs = jumbo_files + args = [ "--outputs" ] + rebase_path(outputs, root_build_dir) + + [ "--file-list={{response_file_name}}" ] + } + } + + target_type = invoker.target_type + if (use_jumbo_build_for_target && target_type == "split_static_library") { + # Meaningless and also impossible if split_count > len(jumbo_files) + target_type = "static_library" + + # Prevent "unused variable" warning. + assert(!defined(invoker.split_count) || invoker.split_count > 0) + } + + # Perform the actual operation, either on the original sources or + # the sources post-jumbo merging. + target(target_type, target_name) { + deps = [] + if (defined(invoker.deps)) { + deps += invoker.deps + } + + # Take everything else not handled above from the invoker. + variables_to_not_forward = [ "deps" ] + if (use_jumbo_build_for_target) { + deps += [ ":" + merge_action_name ] + variables_to_not_forward += [ "sources" ] + assert(jumbo_files != []) + sources = jumbo_files + excluded_sources + + # Need to keep the headers in sources so that dependency checks + # work, and we need to keep Objective-C code since they + # cannot be merged into a cc file (FIXME). + foreach(source_file, invoker.sources) { + source_ext = get_path_info(source_file, "extension") + if (source_ext == "h" || source_ext == "mm") { + sources += [ source_file ] + } + } + } + forward_variables_from(invoker, "*", variables_to_not_forward) + } +} + +set_defaults("jumbo_target") { + # This sets the default list of configs when the content_source_set target + # is defined. The default_compiler_configs comes from BUILDCONFIG.gn and + # is the list normally applied to static libraries and source sets. + configs = default_compiler_configs +}
diff --git a/build/config/merge_for_jumbo.py b/build/config/merge_for_jumbo.py new file mode 100755 index 0000000..f6eb87dc --- /dev/null +++ b/build/config/merge_for_jumbo.py
@@ -0,0 +1,62 @@ +#!/usr/bin/env python +# +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""This script creates a "jumbo" file which merges all incoming files +for compiling. + +""" + +from __future__ import print_function + +import argparse + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--outputs", nargs="+", required=True, + help='List of output files to split input into') + parser.add_argument("--file-list", required=True) + parser.add_argument("--verbose", action="store_true") + args = parser.parse_args() + + output_count = len(args.outputs) + + lines = [] + # If written with gn |write_file| each file is on its own line. + with open(args.file_list) as file_list_file: + lines = [line.strip() for line in file_list_file if line.strip()] + # If written with gn |response_file_contents| the files are space separated. + inputs = [] + for line in lines: + inputs.extend(line.split()) + input_count = len(inputs) + + written_inputs = 0 + for output_index, output_file in enumerate(args.outputs): + # TODO: Check if the file is right already and then do not update it. + with open(output_file, "w") as out: + out.write("/* This is a Jumbo file. Don't edit. */\n\n") + out.write("/* Generated with merge_for_jumbo.py. */\n\n") + input_limit = (output_index + 1) * input_count / output_count + while written_inputs < input_limit: + filename = inputs[written_inputs] + written_inputs += 1 + # The source list includes headers which should not be + # compiled, and Objective C files which will be special cased + # later since they will not compile correctly if included in a + # C++ file. We will just skip them here for now. + if filename.endswith((".h", ".mm")): + continue + + out.write("#include \"%s\"\n" % filename) + + if args.verbose: + print("Generated %s (%d files) based on %s" % (str(args.outputs), + written_inputs, + args.file_list)) + +if __name__ == "__main__": + main()
diff --git a/build/fuchsia/test_runner.py b/build/fuchsia/test_runner.py index a46ccba1..e2c832a8 100755 --- a/build/fuchsia/test_runner.py +++ b/build/fuchsia/test_runner.py
@@ -136,8 +136,8 @@ if int(os.environ.get('CHROME_HEADLESS', 0)) != 0: # When running on bots (without KVM) execution is quite slow. The test # launcher times out a subprocess after 45s which can be too short. Make the - # timeout 10x longer. - autorun_file.write(' --test-launcher-timeout=450000') + # timeout twice as long. + autorun_file.write(' --test-launcher-timeout=90000') if test_launcher_filter_file: test_launcher_filter_file = os.path.normpath( os.path.join(output_directory, test_launcher_filter_file))
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc index 7a1c775f..27cf2a19 100644 --- a/cc/layers/layer.cc +++ b/cc/layers/layer.cc
@@ -826,7 +826,7 @@ auto& scroll_tree = layer_tree_host_->property_trees()->scroll_tree; auto* scroll_node = scroll_tree.Node(scroll_tree_index_); if (was_scrollable && scroll_node) - scroll_node->scroll_clip_layer_bounds = inputs_.scroll_container_bounds; + scroll_node->container_bounds = inputs_.scroll_container_bounds; else SetPropertyTreesNeedRebuild();
diff --git a/cc/layers/layer.h b/cc/layers/layer.h index 3f5c50e..b63ad10 100644 --- a/cc/layers/layer.h +++ b/cc/layers/layer.h
@@ -218,7 +218,7 @@ void SetScrollOffsetFromImplSide(const gfx::ScrollOffset& scroll_offset); // Marks this layer as being scrollable and needing an associated scroll node. - // The scroll node's bounds and scroll_clip_layer_bounds will be kept in sync + // The scroll node's bounds and container_bounds will be kept in sync // with this layer. Once scrollable, a Layer cannot become un-scrollable. void SetScrollable(const gfx::Size& scroll_container_bounds); gfx::Size scroll_container_bounds() const {
diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h index 65c190f2..87891ce 100644 --- a/cc/layers/layer_impl.h +++ b/cc/layers/layer_impl.h
@@ -296,8 +296,8 @@ gfx::Vector2dF ScrollBy(const gfx::Vector2dF& scroll); // Marks this layer as being scrollable and needing an associated scroll node. - // The scroll node's bounds and scroll_clip_layer_bounds will be kept in sync - // with this layer. + // The scroll node's bounds and container_bounds will be kept in sync with + // this layer. void SetScrollable(const gfx::Size& bounds); gfx::Size scroll_container_bounds() const { return scroll_container_bounds_; } bool scrollable() const { return scrollable_; }
diff --git a/cc/paint/paint_op_buffer.h b/cc/paint/paint_op_buffer.h index 6a899c2..d3cba68a2 100644 --- a/cc/paint/paint_op_buffer.h +++ b/cc/paint/paint_op_buffer.h
@@ -9,6 +9,7 @@ #include <string> +#include "base/debug/alias.h" #include "base/logging.h" #include "base/memory/aligned_memory.h" #include "cc/base/math_util.h" @@ -901,8 +902,17 @@ while (*this && target_idx_ != op_idx_) { PaintOp* op = **this; uint32_t type = op->type; + uint32_t skip = op->skip; + + // Sanity checks. + base::debug::Alias(&type); + base::debug::Alias(&skip); CHECK_LE(type, static_cast<uint32_t>(PaintOpType::LastPaintOpType)); - ptr_ += op->skip; + // This is here for debugging crbug.com/738182. + CHECK_LE(static_cast<size_t>(ptr_ - buffer_->data_.get() + skip), + buffer_->used_); + + ptr_ += skip; op_idx_++; }
diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc index ee5c3b7..f9f55d0 100644 --- a/cc/scheduler/scheduler.cc +++ b/cc/scheduler/scheduler.cc
@@ -516,12 +516,11 @@ deadline_ = begin_impl_frame_tracker_.Current().frame_time + begin_impl_frame_tracker_.Current().interval; break; - case SchedulerStateMachine:: - BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED_ON_READY_TO_DRAW: + case SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED: // We are blocked because we are waiting for ReadyToDraw signal. We would // post deadline after we received ReadyToDraw singal. TRACE_EVENT1("cc", "Scheduler::ScheduleBeginImplFrameDeadline", - "deadline_mode", "blocked_on_ready_to_draw"); + "deadline_mode", "blocked"); return; }
diff --git a/cc/scheduler/scheduler_settings.cc b/cc/scheduler/scheduler_settings.cc index 07386d0..c7c53da 100644 --- a/cc/scheduler/scheduler_settings.cc +++ b/cc/scheduler/scheduler_settings.cc
@@ -32,6 +32,8 @@ state->SetInteger("background_frame_interval", background_frame_interval.InMicroseconds()); state->SetBoolean("enable_latency_recovery", enable_latency_recovery); + state->SetBoolean("wait_for_all_pipeline_stages_before_draw", + wait_for_all_pipeline_stages_before_draw); return std::move(state); }
diff --git a/cc/scheduler/scheduler_settings.h b/cc/scheduler/scheduler_settings.h index eaf3799..fd923f4 100644 --- a/cc/scheduler/scheduler_settings.h +++ b/cc/scheduler/scheduler_settings.h
@@ -26,13 +26,13 @@ SchedulerSettings(const SchedulerSettings& other); ~SchedulerSettings(); - bool use_external_begin_frame_source = false; bool main_frame_while_submit_frame_throttled_enabled = false; bool main_frame_before_activation_enabled = false; bool commit_to_active_tree = false; bool timeout_and_draw_when_animation_checkerboards = true; bool using_synchronous_renderer_compositor = false; bool enable_latency_recovery = true; + bool wait_for_all_pipeline_stages_before_draw = false; int maximum_number_of_failed_draws_before_draw_is_forced = 3; base::TimeDelta background_frame_interval = base::TimeDelta::FromSeconds(1);
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc index 0f5df578..f8602b2 100644 --- a/cc/scheduler/scheduler_state_machine.cc +++ b/cc/scheduler/scheduler_state_machine.cc
@@ -66,8 +66,8 @@ return "BEGIN_IMPL_FRAME_DEADLINE_MODE_REGULAR"; case BEGIN_IMPL_FRAME_DEADLINE_MODE_LATE: return "BEGIN_IMPL_FRAME_DEADLINE_MODE_LATE"; - case BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED_ON_READY_TO_DRAW: - return "BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED_ON_READY_TO_DRAW"; + case BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED: + return "BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED"; } NOTREACHED(); return "???"; @@ -222,7 +222,8 @@ pending_tree_is_ready_for_activation_); state->SetBoolean("active_tree_needs_first_draw", active_tree_needs_first_draw_); - state->SetBoolean("wait_for_ready_to_draw", wait_for_ready_to_draw_); + state->SetBoolean("active_tree_is_ready_to_draw", + active_tree_is_ready_to_draw_); state->SetBoolean("did_create_and_initialize_first_layer_tree_frame_sink", did_create_and_initialize_first_layer_tree_frame_sink_); state->SetString("tree_priority", TreePriorityToString(tree_priority_)); @@ -347,9 +348,11 @@ if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE) return false; - // Wait for active tree to be rasterized before drawing in browser compositor. - if (wait_for_ready_to_draw_) { - DCHECK(settings_.commit_to_active_tree); + // Wait for ready to draw in full-pipeline mode or the browser compositor's + // commit-to-active-tree mode. + if ((settings_.wait_for_all_pipeline_stages_before_draw || + settings_.commit_to_active_tree) && + !active_tree_is_ready_to_draw_) { return false; } @@ -728,7 +731,9 @@ pending_tree_is_ready_for_activation_ = false; last_begin_frame_sequence_number_pending_tree_was_fresh_ = last_begin_frame_sequence_number_begin_main_frame_sent_; - wait_for_ready_to_draw_ = settings_.commit_to_active_tree; + // Wait for the new pending tree to become ready to draw, which may happen + // before or after activation. + active_tree_is_ready_to_draw_ = false; } // Update state related to forced draws. @@ -1095,10 +1100,8 @@ if (settings_.using_synchronous_renderer_compositor) { // No deadline for synchronous compositor. return BEGIN_IMPL_FRAME_DEADLINE_MODE_NONE; - } else if (wait_for_ready_to_draw_) { - // In browser compositor, wait for active tree to be rasterized. - DCHECK(settings_.commit_to_active_tree); - return BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED_ON_READY_TO_DRAW; + } else if (ShouldBlockDeadlineIndefinitely()) { + return BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED; } else if (ShouldTriggerBeginImplFrameDeadlineImmediately()) { return BEGIN_IMPL_FRAME_DEADLINE_MODE_IMMEDIATE; } else if (needs_redraw_) { @@ -1123,6 +1126,11 @@ if (IsDrawThrottled()) return false; + // In full-pipe mode, we just gave all pipeline stages a chance to contribute. + // We shouldn't wait any longer in any case - even if there are no updates. + if (settings_.wait_for_all_pipeline_stages_before_draw) + return true; + if (active_tree_needs_first_draw_) return true; @@ -1144,6 +1152,33 @@ return false; } +bool SchedulerStateMachine::ShouldBlockDeadlineIndefinitely() const { + if (!settings_.wait_for_all_pipeline_stages_before_draw && + !settings_.commit_to_active_tree) { + return false; + } + + // Avoid blocking when invisible / frame sink lost / can't draw, i.e. when + // PendingDrawsShouldBeAborted is true. + if (PendingDrawsShouldBeAborted()) + return false; + + // Wait for all pipeline stages. + if (ShouldSendBeginMainFrame()) + return true; + + if (begin_main_frame_state_ != BEGIN_MAIN_FRAME_STATE_IDLE) + return true; + + if (has_pending_tree_) + return true; + + if (!active_tree_is_ready_to_draw_) + return true; + + return false; +} + bool SchedulerStateMachine::IsDrawThrottled() const { return pending_submit_frames_ >= kMaxPendingSubmitFrames; } @@ -1158,7 +1193,6 @@ main_thread_missed_last_deadline_ = false; did_prepare_tiles_ = false; - wait_for_ready_to_draw_ = false; } void SchedulerStateMachine::SetBeginFrameSourcePaused(bool paused) { @@ -1288,7 +1322,6 @@ return; layer_tree_frame_sink_state_ = LAYER_TREE_FRAME_SINK_NONE; needs_redraw_ = false; - wait_for_ready_to_draw_ = false; } void SchedulerStateMachine::NotifyReadyToActivate() { @@ -1297,7 +1330,7 @@ } void SchedulerStateMachine::NotifyReadyToDraw() { - wait_for_ready_to_draw_ = false; + active_tree_is_ready_to_draw_ = true; } void SchedulerStateMachine::DidCreateAndInitializeLayerTreeFrameSink() {
diff --git a/cc/scheduler/scheduler_state_machine.h b/cc/scheduler/scheduler_state_machine.h index bbd7323..45bd7f9 100644 --- a/cc/scheduler/scheduler_state_machine.h +++ b/cc/scheduler/scheduler_state_machine.h
@@ -74,7 +74,7 @@ BEGIN_IMPL_FRAME_DEADLINE_MODE_IMMEDIATE, BEGIN_IMPL_FRAME_DEADLINE_MODE_REGULAR, BEGIN_IMPL_FRAME_DEADLINE_MODE_LATE, - BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED_ON_READY_TO_DRAW, + BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED, }; static const char* BeginImplFrameDeadlineModeToString( BeginImplFrameDeadlineMode mode); @@ -315,6 +315,7 @@ bool CouldCreatePendingTree() const; bool ShouldTriggerBeginImplFrameDeadlineImmediately() const; + bool ShouldBlockDeadlineIndefinitely() const; // True if we need to force activations to make forward progress. // TODO(sunnyps): Rename this to ShouldAbortCurrentFrame or similar. @@ -404,7 +405,7 @@ bool defer_commits_ = false; bool video_needs_begin_frames_ = false; bool last_commit_had_no_updates_ = false; - bool wait_for_ready_to_draw_ = false; + bool active_tree_is_ready_to_draw_ = true; bool did_draw_in_last_frame_ = false; bool did_submit_in_last_frame_ = false; bool needs_impl_side_invalidation_ = false;
diff --git a/cc/scheduler/scheduler_state_machine_unittest.cc b/cc/scheduler/scheduler_state_machine_unittest.cc index 77b1648f5..b45e7537 100644 --- a/cc/scheduler/scheduler_state_machine_unittest.cc +++ b/cc/scheduler/scheduler_state_machine_unittest.cc
@@ -2756,5 +2756,114 @@ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); } +TEST(SchedulerStateMachineTest, TestFullPipelineMode) { + SchedulerSettings scheduler_settings; + scheduler_settings.wait_for_all_pipeline_stages_before_draw = true; + StateMachine state(scheduler_settings); + SET_UP_STATE(state) + + // Start clean and set commit. + state.SetNeedsBeginMainFrame(); + + // Begin the frame. + state.OnBeginImplFrame(0, 10); + // Deadline immediately enters blocking mode, because we need a main frame. + EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED, + state.CurrentBeginImplFrameDeadlineMode()); + EXPECT_ACTION_UPDATE_STATE( + SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME); + EXPECT_MAIN_FRAME_STATE(SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT); + EXPECT_FALSE(state.NeedsCommit()); + EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); + // We are blocking on the main frame. + EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED, + state.CurrentBeginImplFrameDeadlineMode()); + + // Tell the scheduler the frame finished. + state.NotifyBeginMainFrameStarted(); + state.NotifyReadyToCommit(); + EXPECT_MAIN_FRAME_STATE( + SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_READY_TO_COMMIT); + // We are blocking on commit. + EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED, + state.CurrentBeginImplFrameDeadlineMode()); + // Commit. + EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT); + // We are blocking on activation. + EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED, + state.CurrentBeginImplFrameDeadlineMode()); + + // Ready to activate, but not draw. + state.NotifyReadyToActivate(); + EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE); + EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); + // We are blocking on ready to draw. + EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED, + state.CurrentBeginImplFrameDeadlineMode()); + + // Ready to draw triggers immediate deadline. + state.NotifyReadyToDraw(); + EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_IMMEDIATE, + state.CurrentBeginImplFrameDeadlineMode()); + + state.OnBeginImplFrameDeadline(); + EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE); + state.DidSubmitCompositorFrame(); + EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); + // In full-pipe mode, CompositorFrameAck should always arrive before any + // subsequent BeginFrame. + state.DidReceiveCompositorFrameAck(); + EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); + + // Request a redraw without main frame. + state.SetNeedsRedraw(true); + + // Redraw should happen immediately since there is no pending tree and active + // tree is ready to draw. + state.OnBeginImplFrame(0, 11); + EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); + EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_IMMEDIATE, + state.CurrentBeginImplFrameDeadlineMode()); + + // Redraw on impl-side only. + state.OnBeginImplFrameDeadline(); + EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE); + EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); + state.DidSubmitCompositorFrame(); + EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); + // In full-pipe mode, CompositorFrameAck should always arrive before any + // subsequent BeginFrame. + state.DidReceiveCompositorFrameAck(); + EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); + + // Request a redraw on active frame and a main frame. + state.SetNeedsRedraw(true); + state.SetNeedsBeginMainFrame(); + + state.OnBeginImplFrame(0, 12); + EXPECT_ACTION_UPDATE_STATE( + SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME); + EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); + // Blocked on main frame. + EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED, + state.CurrentBeginImplFrameDeadlineMode()); + + // Even with SMOOTHNESS_TAKES_PRIORITY, we don't prioritize impl thread and we + // should wait for main frame. + state.SetTreePrioritiesAndScrollState( + SMOOTHNESS_TAKES_PRIORITY, + ScrollHandlerState::SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER); + EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_BLOCKED, + state.CurrentBeginImplFrameDeadlineMode()); + + // Abort commit and ensure that we don't block anymore. + state.NotifyBeginMainFrameStarted(); + state.BeginMainFrameAborted(CommitEarlyOutReason::FINISHED_NO_UPDATES); + EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); + EXPECT_MAIN_FRAME_STATE(SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_IDLE); + EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_IMMEDIATE, + state.CurrentBeginImplFrameDeadlineMode()); +} + } // namespace } // namespace cc
diff --git a/cc/surfaces/display_scheduler.cc b/cc/surfaces/display_scheduler.cc index e6a5336..28e329f8 100644 --- a/cc/surfaces/display_scheduler.cc +++ b/cc/surfaces/display_scheduler.cc
@@ -16,7 +16,8 @@ DisplayScheduler::DisplayScheduler(BeginFrameSource* begin_frame_source, base::SingleThreadTaskRunner* task_runner, - int max_pending_swaps) + int max_pending_swaps, + bool wait_for_all_surfaces_before_draw) : client_(nullptr), begin_frame_source_(begin_frame_source), task_runner_(task_runner), @@ -31,6 +32,7 @@ next_swap_id_(1), pending_swaps_(0), max_pending_swaps_(max_pending_swaps), + wait_for_all_surfaces_before_draw_(wait_for_all_surfaces_before_draw), observing_begin_frame_source_(false), weak_ptr_factory_(this) { begin_frame_deadline_closure_ = base::Bind( @@ -314,50 +316,88 @@ void DisplayScheduler::OnSurfaceWillDraw(const SurfaceId& surface_id) {} -base::TimeTicks DisplayScheduler::DesiredBeginFrameDeadlineTime() { +base::TimeTicks DisplayScheduler::DesiredBeginFrameDeadlineTime() const { + switch (AdjustedBeginFrameDeadlineMode()) { + case BeginFrameDeadlineMode::kImmediate: + return base::TimeTicks(); + case BeginFrameDeadlineMode::kRegular: + return current_begin_frame_args_.deadline; + case BeginFrameDeadlineMode::kLate: + return current_begin_frame_args_.frame_time + + current_begin_frame_args_.interval; + case BeginFrameDeadlineMode::kNone: + return base::TimeTicks::Max(); + default: + NOTREACHED(); + return base::TimeTicks(); + } +} + +DisplayScheduler::BeginFrameDeadlineMode +DisplayScheduler::AdjustedBeginFrameDeadlineMode() const { + BeginFrameDeadlineMode mode = DesiredBeginFrameDeadlineMode(); + + // In blocking mode, late and regular deadline should not apply. Wait + // indefinitely instead. + if (wait_for_all_surfaces_before_draw_ && + (mode == BeginFrameDeadlineMode::kRegular || + mode == BeginFrameDeadlineMode::kLate)) { + return BeginFrameDeadlineMode::kNone; + } + + return mode; +} + +DisplayScheduler::BeginFrameDeadlineMode +DisplayScheduler::DesiredBeginFrameDeadlineMode() const { if (output_surface_lost_) { TRACE_EVENT_INSTANT0("cc", "Lost output surface", TRACE_EVENT_SCOPE_THREAD); - return base::TimeTicks(); + return BeginFrameDeadlineMode::kImmediate; } if (pending_swaps_ >= max_pending_swaps_) { TRACE_EVENT_INSTANT0("cc", "Swap throttled", TRACE_EVENT_SCOPE_THREAD); - return current_begin_frame_args_.frame_time + - current_begin_frame_args_.interval; - } - - if (!needs_draw_) { - TRACE_EVENT_INSTANT0("cc", "No damage yet", TRACE_EVENT_SCOPE_THREAD); - return current_begin_frame_args_.frame_time + - current_begin_frame_args_.interval; + return BeginFrameDeadlineMode::kLate; } if (root_surface_resources_locked_) { TRACE_EVENT_INSTANT0("cc", "Root surface resources locked", TRACE_EVENT_SCOPE_THREAD); - return current_begin_frame_args_.frame_time + - current_begin_frame_args_.interval; + return BeginFrameDeadlineMode::kLate; } - bool all_surfaces_ready = - !has_pending_surfaces_ && root_surface_id_.is_valid(); - if (all_surfaces_ready && !expecting_root_surface_damage_because_of_resize_) { + bool all_surfaces_ready = !has_pending_surfaces_ && + root_surface_id_.is_valid() && + !expecting_root_surface_damage_because_of_resize_; + + // When no draw is needed, only allow an early deadline in full-pipe mode. + // This way, we can unblock the BeginFrame in full-pipe mode if no draw is + // necessary, but accommodate damage as a result of missed BeginFrames from + // clients otherwise. + bool allow_early_deadline_without_draw = wait_for_all_surfaces_before_draw_; + + if (all_surfaces_ready && + (needs_draw_ || allow_early_deadline_without_draw)) { TRACE_EVENT_INSTANT0("cc", "All active surfaces ready", TRACE_EVENT_SCOPE_THREAD); - return base::TimeTicks(); + return BeginFrameDeadlineMode::kImmediate; + } + + if (!needs_draw_) { + TRACE_EVENT_INSTANT0("cc", "No damage yet", TRACE_EVENT_SCOPE_THREAD); + return BeginFrameDeadlineMode::kLate; } // TODO(mithro): Be smarter about resize deadlines. if (expecting_root_surface_damage_because_of_resize_) { TRACE_EVENT_INSTANT0("cc", "Entire display damaged", TRACE_EVENT_SCOPE_THREAD); - return current_begin_frame_args_.frame_time + - current_begin_frame_args_.interval; + return BeginFrameDeadlineMode::kLate; } TRACE_EVENT_INSTANT0("cc", "More damage expected soon", TRACE_EVENT_SCOPE_THREAD); - return current_begin_frame_args_.deadline; + return BeginFrameDeadlineMode::kRegular; } void DisplayScheduler::ScheduleBeginFrameDeadline() { @@ -385,8 +425,14 @@ // Schedule the deadline. begin_frame_deadline_task_time_ = desired_deadline; begin_frame_deadline_task_.Cancel(); - begin_frame_deadline_task_.Reset(begin_frame_deadline_closure_); + if (begin_frame_deadline_task_time_ == base::TimeTicks::Max()) { + TRACE_EVENT_INSTANT0("cc", "Using infinite deadline", + TRACE_EVENT_SCOPE_THREAD); + return; + } + + begin_frame_deadline_task_.Reset(begin_frame_deadline_closure_); base::TimeDelta delta = std::max(base::TimeDelta(), desired_deadline - base::TimeTicks::Now()); task_runner_->PostDelayedTask(FROM_HERE,
diff --git a/cc/surfaces/display_scheduler.h b/cc/surfaces/display_scheduler.h index 4a69a5c..c98fbab6 100644 --- a/cc/surfaces/display_scheduler.h +++ b/cc/surfaces/display_scheduler.h
@@ -39,7 +39,8 @@ public: DisplayScheduler(BeginFrameSource* begin_frame_source, base::SingleThreadTaskRunner* task_runner, - int max_pending_swaps); + int max_pending_swaps, + bool wait_for_all_surfaces_before_draw = false); ~DisplayScheduler() override; void SetClient(DisplaySchedulerClient* client); @@ -73,7 +74,10 @@ void OnSurfaceWillDraw(const SurfaceId& surface_id) override; protected: - base::TimeTicks DesiredBeginFrameDeadlineTime(); + enum class BeginFrameDeadlineMode { kImmediate, kRegular, kLate, kNone }; + base::TimeTicks DesiredBeginFrameDeadlineTime() const; + BeginFrameDeadlineMode AdjustedBeginFrameDeadlineMode() const; + BeginFrameDeadlineMode DesiredBeginFrameDeadlineMode() const; virtual void ScheduleBeginFrameDeadline(); bool AttemptDrawAndSwap(); void OnBeginFrameDeadline(); @@ -115,6 +119,7 @@ int next_swap_id_; int pending_swaps_; int max_pending_swaps_; + bool wait_for_all_surfaces_before_draw_; bool observing_begin_frame_source_;
diff --git a/cc/surfaces/display_scheduler_unittest.cc b/cc/surfaces/display_scheduler_unittest.cc index 92f161dba..2bc7f07 100644 --- a/cc/surfaces/display_scheduler_unittest.cc +++ b/cc/surfaces/display_scheduler_unittest.cc
@@ -71,8 +71,12 @@ TestDisplayScheduler(BeginFrameSource* begin_frame_source, SurfaceManager* surface_manager, base::SingleThreadTaskRunner* task_runner, - int max_pending_swaps) - : DisplayScheduler(begin_frame_source, task_runner, max_pending_swaps), + int max_pending_swaps, + bool wait_for_all_surfaces_before_draw) + : DisplayScheduler(begin_frame_source, + task_runner, + max_pending_swaps, + wait_for_all_surfaces_before_draw), scheduler_begin_frame_deadline_count_(0) {} base::TimeTicks DesiredBeginFrameDeadlineTimeForTest() { @@ -108,13 +112,14 @@ class DisplaySchedulerTest : public testing::Test { public: - DisplaySchedulerTest() + explicit DisplaySchedulerTest(bool wait_for_all_surfaces_before_draw = false) : fake_begin_frame_source_(0.f, false), task_runner_(new base::NullTaskRunner), scheduler_(&fake_begin_frame_source_, &surface_manager_, task_runner_.get(), - kMaxPendingSwaps) { + kMaxPendingSwaps, + wait_for_all_surfaces_before_draw) { now_src_.Advance(base::TimeDelta::FromMicroseconds(10000)); surface_manager_.AddObserver(&scheduler_); scheduler_.SetClient(&client_); @@ -288,7 +293,7 @@ scheduler_.DesiredBeginFrameDeadlineTimeForTest()); scheduler_.BeginFrameDeadlineForTest(); - // SurfaceDamage with |!has_damage| triggers early deadline if other damage + // Surface damage with |!has_damage| triggers early deadline if other damage // exists. AdvanceTimeAndBeginFrameForTest({sid1, sid2}); EXPECT_LT(now_src().NowTicks(), @@ -303,7 +308,7 @@ scheduler_.DesiredBeginFrameDeadlineTimeForTest()); scheduler_.BeginFrameDeadlineForTest(); - // SurfaceDamage with |!has_damage| does not trigger early deadline if no + // Surface damage with |!has_damage| does not trigger early deadline if no // other damage exists. AdvanceTimeAndBeginFrameForTest({sid1}); EXPECT_LT(now_src().NowTicks(), @@ -319,7 +324,7 @@ AdvanceTimeAndBeginFrameForTest(std::vector<SurfaceId>()); EXPECT_FALSE(scheduler_.inside_begin_frame_deadline_interval()); - // SurfaceDamage with |!display_damaged| does not affect needs_draw and + // Surface damage with |!display_damaged| does not affect needs_draw and // scheduler stays idle. scheduler_.ProcessSurfaceDamage(sid1, AckForCurrentBeginFrame(), false); EXPECT_FALSE(scheduler_.inside_begin_frame_deadline_interval()); @@ -334,6 +339,86 @@ scheduler_.BeginFrameDeadlineForTest(); } +class DisplaySchedulerWaitForAllSurfacesTest : public DisplaySchedulerTest { + public: + DisplaySchedulerWaitForAllSurfacesTest() + : DisplaySchedulerTest(true /* wait_for_all_surfaces_before_draw */) {} +}; + +TEST_F(DisplaySchedulerWaitForAllSurfacesTest, WaitForAllSurfacesBeforeDraw) { + SurfaceId root_surface_id( + kArbitraryFrameSinkId, + LocalSurfaceId(1, base::UnguessableToken::Create())); + SurfaceId sid1(kArbitraryFrameSinkId, + LocalSurfaceId(2, base::UnguessableToken::Create())); + SurfaceId sid2(kArbitraryFrameSinkId, + LocalSurfaceId(3, base::UnguessableToken::Create())); + + scheduler_.SetVisible(true); + scheduler_.SetNewRootSurface(root_surface_id); + + // Set surface1 as active via SurfaceDamageExpected(). + AdvanceTimeAndBeginFrameForTest({sid1}); + + // Deadline is blocked indefinitely until surface 1 is damaged. + EXPECT_EQ(base::TimeTicks::Max(), + scheduler_.DesiredBeginFrameDeadlineTimeForTest()); + + // Damage only from surface 2 (inactive) does not change deadline. + SurfaceDamaged(sid2); + EXPECT_TRUE(scheduler_.has_pending_surfaces()); + EXPECT_EQ(base::TimeTicks::Max(), + scheduler_.DesiredBeginFrameDeadlineTimeForTest()); + + // Damage from surface 1 triggers deadline immediately. + SurfaceDamaged(sid1); + EXPECT_FALSE(scheduler_.has_pending_surfaces()); + EXPECT_GE(now_src().NowTicks(), + scheduler_.DesiredBeginFrameDeadlineTimeForTest()); + scheduler_.BeginFrameDeadlineForTest(); + + // Surface damage with |!has_damage| triggers immediate deadline if other + // damage exists. + AdvanceTimeAndBeginFrameForTest({sid1, sid2}); + EXPECT_EQ(base::TimeTicks::Max(), + scheduler_.DesiredBeginFrameDeadlineTimeForTest()); + SurfaceDamaged(sid2); + EXPECT_EQ(base::TimeTicks::Max(), + scheduler_.DesiredBeginFrameDeadlineTimeForTest()); + BeginFrameAck ack = AckForCurrentBeginFrame(); + ack.has_damage = false; + scheduler_.ProcessSurfaceDamage(sid1, ack, false); + EXPECT_GE(now_src().NowTicks(), + scheduler_.DesiredBeginFrameDeadlineTimeForTest()); + scheduler_.BeginFrameDeadlineForTest(); + + // Surface damage with |!has_damage| also triggers immediate deadline even if + // no other damage exists. + AdvanceTimeAndBeginFrameForTest({sid1}); + EXPECT_EQ(base::TimeTicks::Max(), + scheduler_.DesiredBeginFrameDeadlineTimeForTest()); + ack = AckForCurrentBeginFrame(); + ack.has_damage = false; + scheduler_.ProcessSurfaceDamage(sid1, ack, false); + EXPECT_GE(now_src().NowTicks(), + scheduler_.DesiredBeginFrameDeadlineTimeForTest()); + scheduler_.BeginFrameDeadlineForTest(); + + // System should be idle now because we had a frame without damage. Restore it + // to active state (DisplayScheduler observing BeginFrames) for the next test. + AdvanceTimeAndBeginFrameForTest(std::vector<SurfaceId>()); + EXPECT_FALSE(scheduler_.inside_begin_frame_deadline_interval()); + SurfaceDamaged(sid1); + scheduler_.BeginFrameDeadlineForTest(); + + // BeginFrame without expected surface damage triggers immediate deadline. + AdvanceTimeAndBeginFrameForTest(std::vector<SurfaceId>()); + EXPECT_TRUE(scheduler_.inside_begin_frame_deadline_interval()); + EXPECT_GE(now_src().NowTicks(), + scheduler_.DesiredBeginFrameDeadlineTimeForTest()); + scheduler_.BeginFrameDeadlineForTest(); +} + TEST_F(DisplaySchedulerTest, OutputSurfaceLost) { SurfaceId root_surface_id( kArbitraryFrameSinkId,
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc index f7210f02..bfcad8e 100644 --- a/cc/trees/layer_tree_host_common_unittest.cc +++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -10065,7 +10065,6 @@ ScrollNode* property_tree_root = expected_scroll_tree.Node(0); property_tree_root->id = kRootPropertyTreeNodeId; property_tree_root->parent_id = ScrollTree::kInvalidNodeId; - property_tree_root->owning_layer_id = Layer::INVALID_ID; property_tree_root->scrollable = false; property_tree_root->main_thread_scrolling_reasons = MainThreadScrollingReason::kNotScrollingOnMain; @@ -10076,7 +10075,6 @@ ScrollNode scroll_root1; scroll_root1.id = 1; scroll_root1.bounds = root1->bounds(); - scroll_root1.owning_layer_id = root1->id(); scroll_root1.user_scrollable_horizontal = true; scroll_root1.user_scrollable_vertical = true; scroll_root1.transform_id = root1->transform_tree_index(); @@ -10085,12 +10083,11 @@ // The node owned by parent2 ScrollNode scroll_parent2; scroll_parent2.id = 2; - scroll_parent2.owning_layer_id = parent2->id(); scroll_parent2.element_id = parent2->element_id(); scroll_parent2.scrollable = true; scroll_parent2.main_thread_scrolling_reasons = parent2->main_thread_scrolling_reasons(); - scroll_parent2.scroll_clip_layer_bounds = root1->bounds(); + scroll_parent2.container_bounds = root1->bounds(); scroll_parent2.bounds = parent2->bounds(); scroll_parent2.max_scroll_offset_affected_by_page_scale = true; scroll_parent2.scrolls_inner_viewport = true; @@ -10102,7 +10099,6 @@ // The node owned by child6 ScrollNode scroll_child6; scroll_child6.id = 3; - scroll_child6.owning_layer_id = child6->id(); scroll_child6.main_thread_scrolling_reasons = child6->main_thread_scrolling_reasons(); scroll_child6.should_flatten = true; @@ -10114,10 +10110,9 @@ // The node owned by child7, child7 also owns a transform node ScrollNode scroll_child7; scroll_child7.id = 4; - scroll_child7.owning_layer_id = child7->id(); scroll_child7.element_id = child7->element_id(); scroll_child7.scrollable = true; - scroll_child7.scroll_clip_layer_bounds = parent3->bounds(); + scroll_child7.container_bounds = parent3->bounds(); scroll_child7.bounds = child7->bounds(); scroll_child7.user_scrollable_horizontal = true; scroll_child7.user_scrollable_vertical = true; @@ -10127,10 +10122,9 @@ // The node owned by grand_child11, grand_child11 also owns a transform node ScrollNode scroll_grand_child11; scroll_grand_child11.id = 5; - scroll_grand_child11.owning_layer_id = grand_child11->id(); scroll_grand_child11.element_id = grand_child11->element_id(); scroll_grand_child11.scrollable = true; - scroll_grand_child11.scroll_clip_layer_bounds = child8->bounds(); + scroll_grand_child11.container_bounds = child8->bounds(); scroll_grand_child11.user_scrollable_horizontal = true; scroll_grand_child11.user_scrollable_vertical = true; scroll_grand_child11.transform_id = grand_child11->transform_tree_index(); @@ -10139,7 +10133,6 @@ // The node owned by parent5 ScrollNode scroll_parent5; scroll_parent5.id = 8; - scroll_parent5.owning_layer_id = parent5->id(); scroll_parent5.non_fast_scrollable_region = gfx::Rect(0, 0, 50, 50); scroll_parent5.bounds = gfx::Size(10, 10); scroll_parent5.should_flatten = true;
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 5018686..3a1744a4 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -2894,8 +2894,9 @@ (settings_.is_layer_tree_for_subframe || (!scrolling_node->scrolls_outer_viewport && !scrolling_node->scrolls_inner_viewport))) { - int size = scrolling_node->scroll_clip_layer_bounds.GetCheckedArea() - .ValueOrDefault(std::numeric_limits<int>::max()); + const auto& container_bounds = scrolling_node->container_bounds; + int size = container_bounds.GetCheckedArea().ValueOrDefault( + std::numeric_limits<int>::max()); DCHECK_GT(size, 0); if (IsWheelBasedScroll(type)) { UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Scroll.ScrollerSize.OnScroll_Wheel", @@ -3037,10 +3038,6 @@ scroll_tree.current_scroll_offset(scroll_node->element_id); gfx::ScrollOffset target_offset = scroll_tree.ClampScrollOffsetToLimits( current_offset + gfx::ScrollOffset(delta), scroll_node); - DCHECK_EQ( - ElementId( - active_tree()->LayerById(scroll_node->owning_layer_id)->element_id()), - scroll_node->element_id); // Start the animation one full frame in. Without any offset, the animation // doesn't start until next frame, increasing latency, and preventing our @@ -4215,11 +4212,6 @@ ScrollNode* scroll_node, const gfx::Vector2dF& scroll_delta, base::TimeDelta delayed_by) { - DCHECK_EQ( - ElementId( - active_tree()->LayerById(scroll_node->owning_layer_id)->element_id()), - scroll_node->element_id); - return mutator_host_->ImplOnlyScrollAnimationUpdateTarget( scroll_node->element_id, scroll_delta, active_tree_->property_trees()->scroll_tree.MaxScrollOffset(
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index 84ca462..ee162b3 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc
@@ -214,8 +214,7 @@ gfx::ScrollOffset current_offset = scroll_tree.current_scroll_offset(scrolling_element_id); gfx::SizeF scrolling_size(scroll_node->bounds); - gfx::SizeF bounds_size( - scroll_tree.scroll_clip_layer_bounds(scroll_node->id)); + gfx::SizeF bounds_size(scroll_tree.container_bounds(scroll_node->id)); bool is_viewport_scrollbar = scroll_node->scrolls_inner_viewport || scroll_node->scrolls_outer_viewport; @@ -223,7 +222,7 @@ if (scroll_node->scrolls_inner_viewport) { // Add offset and bounds contribution of outer viewport. current_offset += OuterViewportScrollLayer()->CurrentScrollOffset(); - gfx::SizeF outer_viewport_bounds(scroll_tree.scroll_clip_layer_bounds( + gfx::SizeF outer_viewport_bounds(scroll_tree.container_bounds( OuterViewportScrollLayer()->scroll_tree_index())); bounds_size.SetToMin(outer_viewport_bounds); @@ -234,7 +233,7 @@ } else { // Add offset and bounds contribution of inner viewport. current_offset += InnerViewportScrollLayer()->CurrentScrollOffset(); - gfx::SizeF inner_viewport_bounds(scroll_tree.scroll_clip_layer_bounds( + gfx::SizeF inner_viewport_bounds(scroll_tree.container_bounds( InnerViewportScrollLayer()->scroll_tree_index())); bounds_size.SetToMin(inner_viewport_bounds); } @@ -643,18 +642,6 @@ ElementId old_element_id = old_node ? old_node->element_id : ElementId(); ElementId new_element_id = node ? node->element_id : ElementId(); - -#if DCHECK_IS_ON() - // In SPv2 scrolling is driven solely by element id and - // layer/element-id maps should not be required. - if (!settings().use_layer_lists) { - int old_layer_id = old_node ? old_node->owning_layer_id : Layer::INVALID_ID; - int new_layer_id = node ? node->owning_layer_id : Layer::INVALID_ID; - DCHECK(old_layer_id == LayerIdByElementId(old_element_id)); - DCHECK(new_layer_id == LayerIdByElementId(new_element_id)); - } -#endif - if (old_element_id == new_element_id) return;
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc index 6f2fcdd..d6325ba 100644 --- a/cc/trees/property_tree.cc +++ b/cc/trees/property_tree.cc
@@ -376,8 +376,7 @@ gfx::RectF clip( scroll_position, - gfx::SizeF(property_trees.scroll_tree.scroll_clip_layer_bounds( - scroll_node->id))); + gfx::SizeF(property_trees.scroll_tree.container_bounds(scroll_node->id))); gfx::Vector2dF ancestor_sticky_box_offset; if (sticky_data->nearest_node_shifting_sticky_box != @@ -1251,7 +1250,7 @@ scaled_scroll_bounds.SetSize(std::floor(scaled_scroll_bounds.width()), std::floor(scaled_scroll_bounds.height())); - gfx::Size clip_layer_bounds = scroll_clip_layer_bounds(scroll_node->id); + gfx::Size clip_layer_bounds = container_bounds(scroll_node->id); gfx::ScrollOffset max_offset( scaled_scroll_bounds.width() - clip_layer_bounds.width(), @@ -1278,25 +1277,23 @@ layer_tree_impl->DidAnimateScrollOffset(); } -gfx::Size ScrollTree::scroll_clip_layer_bounds(int scroll_node_id) const { +gfx::Size ScrollTree::container_bounds(int scroll_node_id) const { const ScrollNode* scroll_node = Node(scroll_node_id); - gfx::Size scroll_clip_layer_bounds = scroll_node->scroll_clip_layer_bounds; + gfx::Size container_bounds = scroll_node->container_bounds; - gfx::Vector2dF scroll_clip_layer_bounds_delta; + gfx::Vector2dF container_bounds_delta; if (scroll_node->scrolls_inner_viewport) { - scroll_clip_layer_bounds_delta.Add( + container_bounds_delta.Add( property_trees()->inner_viewport_container_bounds_delta()); } else if (scroll_node->scrolls_outer_viewport) { - scroll_clip_layer_bounds_delta.Add( + container_bounds_delta.Add( property_trees()->outer_viewport_container_bounds_delta()); } - gfx::Vector2d delta = gfx::ToCeiledVector2d(scroll_clip_layer_bounds_delta); - scroll_clip_layer_bounds.SetSize( - scroll_clip_layer_bounds.width() + delta.x(), - scroll_clip_layer_bounds.height() + delta.y()); + gfx::Vector2d delta = gfx::ToCeiledVector2d(container_bounds_delta); + container_bounds.Enlarge(delta.x(), delta.y()); - return scroll_clip_layer_bounds; + return container_bounds; } ScrollNode* ScrollTree::CurrentlyScrollingNode() {
diff --git a/cc/trees/property_tree.h b/cc/trees/property_tree.h index 2171043..a9610cbb8 100644 --- a/cc/trees/property_tree.h +++ b/cc/trees/property_tree.h
@@ -400,7 +400,7 @@ int scroll_tree_index, const gfx::ScrollOffset& scroll_offset, LayerTreeImpl* layer_tree_impl); - gfx::Size scroll_clip_layer_bounds(int scroll_node_id) const; + gfx::Size container_bounds(int scroll_node_id) const; ScrollNode* CurrentlyScrollingNode(); const ScrollNode* CurrentlyScrollingNode() const; #if DCHECK_IS_ON()
diff --git a/cc/trees/property_tree_builder.cc b/cc/trees/property_tree_builder.cc index af37d72..e65cd755 100644 --- a/cc/trees/property_tree_builder.cc +++ b/cc/trees/property_tree_builder.cc
@@ -1027,7 +1027,6 @@ data_for_children->scroll_tree_parent = node_id; } else { ScrollNode node; - node.owning_layer_id = layer->id(); node.scrollable = scrollable; node.main_thread_scrolling_reasons = main_thread_scrolling_reasons; node.non_fast_scrollable_region = layer->non_fast_scrollable_region(); @@ -1042,7 +1041,7 @@ } node.bounds = layer->bounds(); - node.scroll_clip_layer_bounds = layer->scroll_container_bounds(); + node.container_bounds = layer->scroll_container_bounds(); node.offset_to_transform_parent = layer->offset_to_transform_parent(); node.should_flatten = layer->should_flatten_transform_from_property_tree(); node.user_scrollable_horizontal = UserScrollableHorizontal(layer);
diff --git a/cc/trees/proxy_impl.cc b/cc/trees/proxy_impl.cc index 2a7e31a..a837a8a33 100644 --- a/cc/trees/proxy_impl.cc +++ b/cc/trees/proxy_impl.cc
@@ -15,7 +15,6 @@ #include "base/memory/ptr_util.h" #include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event_argument.h" -#include "base/trace_event/trace_event_synthetic_delay.h" #include "cc/base/devtools_instrumentation.h" #include "cc/benchmarks/benchmark_instrumentation.h" #include "cc/input/browser_controls_offset_manager.h" @@ -639,8 +638,6 @@ } DrawResult ProxyImpl::DrawInternal(bool forced_draw) { - TRACE_EVENT_SYNTHETIC_DELAY("cc.Draw"); - DCHECK(IsImplThread()); DCHECK(layer_tree_host_impl_.get());
diff --git a/cc/trees/proxy_main.cc b/cc/trees/proxy_main.cc index 7549d9d..9628d47 100644 --- a/cc/trees/proxy_main.cc +++ b/cc/trees/proxy_main.cc
@@ -10,7 +10,6 @@ #include "base/memory/ptr_util.h" #include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event_argument.h" -#include "base/trace_event/trace_event_synthetic_delay.h" #include "cc/base/completion_event.h" #include "cc/base/devtools_instrumentation.h" #include "cc/benchmarks/benchmark_instrumentation.h" @@ -127,7 +126,6 @@ base::TimeTicks begin_main_frame_start_time = base::TimeTicks::Now(); - TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("cc.BeginMainFrame"); DCHECK(IsMainThread()); DCHECK_EQ(NO_PIPELINE_STAGE, current_pipeline_stage_); @@ -214,8 +212,6 @@ return; } - TRACE_EVENT_SYNTHETIC_DELAY_END("cc.BeginMainFrame"); - bool can_cancel_this_commit = final_pipeline_stage_ < COMMIT_PIPELINE_STAGE && !begin_main_frame_state->evicted_ui_resources;
diff --git a/cc/trees/scroll_node.cc b/cc/trees/scroll_node.cc index 3c8bcf78d..17d73bf 100644 --- a/cc/trees/scroll_node.cc +++ b/cc/trees/scroll_node.cc
@@ -15,7 +15,6 @@ ScrollNode::ScrollNode() : id(ScrollTree::kInvalidNodeId), parent_id(ScrollTree::kInvalidNodeId), - owning_layer_id(Layer::INVALID_ID), main_thread_scrolling_reasons( MainThreadScrollingReason::kNotScrollingOnMain), scrollable(false), @@ -31,12 +30,10 @@ bool ScrollNode::operator==(const ScrollNode& other) const { return id == other.id && parent_id == other.parent_id && - owning_layer_id == other.owning_layer_id && scrollable == other.scrollable && main_thread_scrolling_reasons == other.main_thread_scrolling_reasons && non_fast_scrollable_region == other.non_fast_scrollable_region && - scroll_clip_layer_bounds == other.scroll_clip_layer_bounds && - bounds == other.bounds && + container_bounds == other.container_bounds && bounds == other.bounds && max_scroll_offset_affected_by_page_scale == other.max_scroll_offset_affected_by_page_scale && scrolls_inner_viewport == other.scrolls_inner_viewport && @@ -51,10 +48,8 @@ void ScrollNode::AsValueInto(base::trace_event::TracedValue* value) const { value->SetInteger("id", id); value->SetInteger("parent_id", parent_id); - value->SetInteger("owning_layer_id", owning_layer_id); value->SetBoolean("scrollable", scrollable); - MathUtil::AddToTracedValue("scroll_clip_layer_bounds", - scroll_clip_layer_bounds, value); + MathUtil::AddToTracedValue("container_bounds", container_bounds, value); MathUtil::AddToTracedValue("bounds", bounds, value); MathUtil::AddToTracedValue("offset_to_transform_parent", offset_to_transform_parent, value);
diff --git a/cc/trees/scroll_node.h b/cc/trees/scroll_node.h index 60b3293..e9b1d7da 100644 --- a/cc/trees/scroll_node.h +++ b/cc/trees/scroll_node.h
@@ -27,22 +27,15 @@ // The node index of the parent node in the scroll tree node vector. int parent_id; - // The layer id that corresponds to the layer contents that are scrolled. - // Unlike |id|, this id is stable across frames that don't change the - // composited layer list. - // TODO(pdr): This is no longer used and can be removed. - int owning_layer_id; - uint32_t main_thread_scrolling_reasons; Region non_fast_scrollable_region; - // Size of the clipped area, not including non-overlay scrollbars. Overlay - // scrollbars do not affect the clipped area. - // TODO(pdr): Rename this to scroll_container_bounds. - gfx::Size scroll_clip_layer_bounds; + // Size of the container area that the contents scrolls in, not including + // non-overlay scrollbars. Overlay scrollbars do not affect these bounds. + gfx::Size container_bounds; - // Bounds of the overflow scrolling area. + // Size of the content that is scrolled within the container bounds. gfx::Size bounds; // This is used for subtrees that should not be scrolled independently. For
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn index d8fe989..1c3aa01 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn
@@ -1765,6 +1765,7 @@ # find the native side functions. if (is_android && is_component_build) { deps += [ + "//device/gamepad", "//device/generic_sensor", "//device/sensors", ]
diff --git a/chrome/VERSION b/chrome/VERSION index 60373ca..0bb1b4c 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=61 MINOR=0 -BUILD=3146 +BUILD=3149 PATCH=0
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index b80a1d6f..c59688c1 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//base/android/jni_generator/jni_exception_list.gni") import("//build/config/android/config.gni") import("//build/config/android/rules.gni") import("//build/util/process_version.gni") @@ -672,6 +673,7 @@ "../browser/android/chrome_entry_point.cc", ] deps = [ + ":chrome_jni_registration($default_toolchain)", "//build/config:exe_and_shlib_deps", "//chrome:chrome_android_core", ] @@ -696,8 +698,22 @@ } # Ensure that .pak files are built only once (build them in the default -# toolchain). +# toolchain). The central header file calling JNI registration functions +# is generated from Java code so it just needs to be generated once. if (current_toolchain == default_toolchain) { + generate_jni_registration("chrome_jni_registration") { + target = ":chrome_public_apk" + output = "$root_gen_dir/chrome/browser/android/${target_name}.h" + exception_files = jni_exception_files + } + + generate_jni_registration("chrome_sync_shell_jni_registration") { + testonly = true + target = ":chrome_sync_shell_apk" + output = "$root_gen_dir/chrome/browser/android/${target_name}.h" + exception_files = jni_exception_files + } + if (enable_resource_whitelist_generation) { generate_resource_whitelist("monochrome_resource_whitelist") { # Always use the 32-bit library's whitelist since the 64-bit one is @@ -793,12 +809,13 @@ shared_library("chrome_sync_shell") { testonly = true sources = [ - "../browser/android/chrome_entry_point.cc", + "../browser/android/chrome_sync_shell_entry_point.cc", "../browser/android/chrome_sync_shell_main_delegate.cc", "../browser/android/chrome_sync_shell_main_delegate.h", "../browser/android/chrome_sync_shell_main_delegate_initializer.cc", ] deps = [ + ":chrome_sync_shell_jni_registration($default_toolchain)", "//build/config:exe_and_shlib_deps", "//chrome:chrome_android_core", "//components/sync", @@ -879,6 +896,9 @@ apk_name = "ChromeSyncShell" shared_libraries = [ ":chrome_sync_shell" ] + # This exists here rather than in chrome_sync_shell_test_apk for JNI + # registration to be able to find the native side functions. + java_files = [ "sync_shell/javatests/src/org/chromium/chrome/browser/sync/FakeServerHelper.java" ] deps = [ ":chrome_sync_shell_apk_template_resources", @@ -886,6 +906,7 @@ # but that code is stripped out via proguard. Adding this deps adds # usages and prevents removal of the proto code. "//components/sync:test_support_proto_java", + "//third_party/android_protobuf:protobuf_nano_javalib", ] } @@ -979,11 +1000,23 @@ } } -android_library("chrome_sync_shell_test_apk_java") { - testonly = true - - # From java_sources.jni. - java_files = sync_shell_test_java_sources +instrumentation_test_apk("chrome_sync_shell_test_apk") { + apk_name = "ChromeSyncShellTest" + apk_under_test = ":chrome_sync_shell_apk" + android_manifest = chrome_sync_shell_test_apk_manifest + android_manifest_dep = ":chrome_sync_shell_test_apk_manifest" + java_files = [ + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/AutofillTest.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/BookmarksTest.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/FirstRunTest.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/GmsCoreSyncListenerTest.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/OpenTabsTest.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncCustomizationFragmentTest.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncTest.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncTestBase.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/TypedUrlsTest.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/ui/PassphraseTypeDialogFragmentTest.java", + ] deps = [ "//base:base_java", @@ -999,21 +1032,9 @@ "//components/sync/android:sync_java", "//content/public/android:content_java", "//content/public/test/android:content_java_test_support", - "//third_party/android_protobuf:protobuf_nano_javalib", "//third_party/android_support_test_runner:runner_java", "//third_party/android_tools:android_support_v7_appcompat_java", "//ui/android:ui_java", ] -} - -instrumentation_test_apk("chrome_sync_shell_test_apk") { - apk_name = "ChromeSyncShellTest" - apk_under_test = ":chrome_sync_shell_apk" - android_manifest = chrome_sync_shell_test_apk_manifest - android_manifest_dep = ":chrome_sync_shell_test_apk_manifest" - deps = [ - ":chrome_sync_shell_test_apk_java", - "//third_party/android_support_test_runner:runner_java", - ] proguard_enabled = !is_java_debug }
diff --git a/chrome/android/chrome_public_apk_tmpl.gni b/chrome/android/chrome_public_apk_tmpl.gni index 566de37..9f8ad322 100644 --- a/chrome/android/chrome_public_apk_tmpl.gni +++ b/chrome/android/chrome_public_apk_tmpl.gni
@@ -40,6 +40,15 @@ template("chrome_public_apk_tmpl") { android_apk(target_name) { forward_variables_from(invoker, "*") + exclude_xxxhdpi = true + + # Whitelist rationale in https://crbug.com/691733. + xxxhdpi_whitelist = [ + "*shadow*", # Combination of gradient & transparency cause pixelation. + "*.9.*", # Most nine-patches contain shadows. + "*ic_file_download_white*", # Bottom edge seems misaligned. + "*ic_lock.*", # Bottom edge seems misaligned. + ] _native_lib_file = rebase_path("$root_gen_dir/CHROME_VERSION.json", root_out_dir) native_lib_version_arg = "@FileArg($_native_lib_file:full-quoted)"
diff --git a/chrome/android/java/res/drawable/ic_play_circle_filled.xml b/chrome/android/java/res/drawable/ic_play_circle_filled.xml new file mode 100644 index 0000000..16b55480 --- /dev/null +++ b/chrome/android/java/res/drawable/ic_play_circle_filled.xml
@@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2017 The Chromium Authors. All rights reserved. + Use of this source code is governed by a BSD-style license that can be + found in the LICENSE file. --> + +<vector + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + tools:targetApi="21" + android:width="48dp" + android:height="48dp" + android:viewportWidth="48" + android:viewportHeight="48"> + + <path + android:fillColor="@color/light_normal_color" + android:pathData="M 12.056472 11.781177 H 35.94353 V 36.218824 H 12.056472 V 11.781177 Z" /> + <path + android:fillColor="@color/default_primary_color" + android:pathData="M 24,0 C 10.74,0 0,10.74 0,24 0,37.26 10.74,48 24,48 37.26,48 48,37.26 48,24 +48,10.74 37.26,0 24,0 z M 19.2,34.8 V 13.2 L 33.6,24 19.2,34.8 z" /> +</vector>
diff --git a/chrome/android/java/res/drawable/ic_snippet_thumbnail_placeholder.xml b/chrome/android/java/res/drawable/ic_snippet_thumbnail_placeholder.xml index 0b4f3f0d..5b97abe 100644 --- a/chrome/android/java/res/drawable/ic_snippet_thumbnail_placeholder.xml +++ b/chrome/android/java/res/drawable/ic_snippet_thumbnail_placeholder.xml
@@ -11,9 +11,9 @@ android:viewportWidth="72" android:viewportHeight="72"> - <path android:fillColor="@color/snippets_thumbnail_placeholder_bg" + <path android:fillColor="@color/default_primary_color" android:pathData="M0,0 L72,0 L72,71.9997 L0,71.9997 Z" /> - <path android:fillColor="@color/snippets_thumbnail_placeholder_fg" + <path android:fillColor="@color/light_normal_color" android:pathData="M45,42.9997 L45,28.9997 C45,27.8997,44.1,26.9997,43,26.9997 L29,26.9997 C27.9,26.9997,27,27.8997,27,28.9997 L27,42.9997 C27,44.0997,27.9,44.9997,29,44.9997 L43,44.9997
diff --git a/chrome/android/java/res/layout/new_tab_page_incognito_md.xml b/chrome/android/java/res/layout/new_tab_page_incognito_md.xml index 146fd29..154a115 100644 --- a/chrome/android/java/res/layout/new_tab_page_incognito_md.xml +++ b/chrome/android/java/res/layout/new_tab_page_incognito_md.xml
@@ -42,46 +42,49 @@ android:id="@+id/new_tab_incognito_title" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:fontFamily="sans-serif-light" android:text="@string/new_tab_otr_title" android:textColor="@color/incognito_header" /> <TextView android:id="@+id/new_tab_incognito_subtitle" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:fontFamily="sans-serif-light" android:text="@string/new_tab_otr_subtitle" android:textColor="@color/incognito_header" android:lineSpacingExtra="6sp" /> - <TextView - android:id="@+id/new_tab_incognito_features" - android:layout_width="match_parent" + <LinearLayout + android:id="@+id/new_tab_incognito_bulletpoints_container" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:singleLine="false" - android:textColor="@color/incognito_text" - android:lineSpacingExtra="6sp" /> + android:orientation="horizontal" + android:gravity="start"> - <TextView - android:id="@+id/new_tab_incognito_warning" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:singleLine="false" - android:textColor="@color/incognito_text" - android:lineSpacingExtra="6sp" /> + <TextView + android:id="@+id/new_tab_incognito_features" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@color/incognito_text" + android:lineSpacingExtra="6sp" /> + + <TextView + android:id="@+id/new_tab_incognito_warning" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@color/incognito_text" + android:lineSpacingExtra="6sp" /> + + </LinearLayout> <TextView android:id="@+id/learn_more" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="?attr/listChoiceBackgroundIndicator" android:clickable="true" android:focusable="true" android:text="@string/learn_more" android:textColor="@color/google_blue_300" - android:lineSpacingExtra="6sp" - style="@style/RobotoMediumStyle" /> + android:lineSpacingExtra="6sp" /> </LinearLayout>
diff --git a/chrome/android/java/res/layout/new_tab_page_snippets_card.xml b/chrome/android/java/res/layout/new_tab_page_snippets_card.xml index d59c458..e0b5053d 100644 --- a/chrome/android/java/res/layout/new_tab_page_snippets_card.xml +++ b/chrome/android/java/res/layout/new_tab_page_snippets_card.xml
@@ -5,6 +5,7 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:chrome="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/snippets_card_view" @@ -106,4 +107,15 @@ android:scaleType="centerCrop" android:contentDescription="@null" android:src="@null" /> + + <ImageView + android:id="@+id/article_thumbnail_video_overlay" + android:layout_width="36dp" + android:layout_height="36dp" + android:layout_alignTop="@+id/article_thumbnail" + android:layout_alignStart="@+id/article_thumbnail" + android:layout_marginStart="18dp" + android:layout_marginTop="18dp" + android:contentDescription="@null" + app:srcCompat="@drawable/ic_play_circle_filled" /> </RelativeLayout>
diff --git a/chrome/android/java/res/layout/new_tab_page_snippets_card_large_thumbnail.xml b/chrome/android/java/res/layout/new_tab_page_snippets_card_large_thumbnail.xml index f59cd8e..ec68ec3d 100644 --- a/chrome/android/java/res/layout/new_tab_page_snippets_card_large_thumbnail.xml +++ b/chrome/android/java/res/layout/new_tab_page_snippets_card_large_thumbnail.xml
@@ -5,6 +5,7 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:chrome="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/snippets_card_view" @@ -110,4 +111,15 @@ android:scaleType="centerCrop" android:contentDescription="@null" android:src="@null" /> + + <ImageView + android:id="@+id/article_thumbnail_video_overlay" + android:layout_width="48dp" + android:layout_height="48dp" + android:layout_alignTop="@+id/article_thumbnail" + android:layout_alignStart="@+id/article_thumbnail" + android:layout_marginStart="38dp" + android:layout_marginTop="38dp" + android:contentDescription="@null" + app:srcCompat="@drawable/ic_play_circle_filled" /> </RelativeLayout>
diff --git a/chrome/android/java/res/values/colors.xml b/chrome/android/java/res/values/colors.xml index e3da7df3..d2d02355 100644 --- a/chrome/android/java/res/values/colors.xml +++ b/chrome/android/java/res/values/colors.xml
@@ -125,8 +125,6 @@ <color name="ntp_list_header_text">#333</color> <color name="ntp_list_header_subtext">#969696</color> <color name="ntp_list_header_subtext_active">#7cadff</color> - <color name="snippets_thumbnail_placeholder_bg">#f2f2f2</color> - <color name="snippets_thumbnail_placeholder_fg">#757575</color> <color name="snippets_publisher_name_color">#646464</color> <color name="snippets_text_color">#646464</color> <color name="snippets_list_header_text_color">#646464</color>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java index 05d51edf..a943252 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
@@ -41,6 +41,7 @@ * tests if test features have been set). */ public static boolean isInitialized() { + if (sTestFeatures != null) return true; if (!LibraryLoader.isInitialized()) return false; // Even if the native library is loaded, the C++ FeatureList might not be initialized yet. @@ -83,6 +84,7 @@ * the specified parameter does not exist. */ public static String getFieldTrialParamByFeature(String featureName, String paramName) { + if (sTestFeatures != null) return ""; assert isInitialized(); return nativeGetFieldTrialParamByFeature(featureName, paramName); } @@ -101,6 +103,7 @@ */ public static int getFieldTrialParamByFeatureAsInt( String featureName, String paramName, int defaultValue) { + if (sTestFeatures != null) return defaultValue; assert isInitialized(); return nativeGetFieldTrialParamByFeatureAsInt(featureName, paramName, defaultValue); } @@ -119,6 +122,7 @@ */ public static double getFieldTrialParamByFeatureAsDouble( String featureName, String paramName, double defaultValue) { + if (sTestFeatures != null) return defaultValue; assert isInitialized(); return nativeGetFieldTrialParamByFeatureAsDouble(featureName, paramName, defaultValue); } @@ -137,6 +141,7 @@ */ public static boolean getFieldTrialParamByFeatureAsBoolean( String featureName, String paramName, boolean defaultValue) { + if (sTestFeatures != null) return defaultValue; assert isInitialized(); return nativeGetFieldTrialParamByFeatureAsBoolean(featureName, paramName, defaultValue); } @@ -161,6 +166,7 @@ "ContentSuggestionsLargeThumbnail"; public static final String CONTENT_SUGGESTIONS_SETTINGS = "ContentSuggestionsSettings"; public static final String CONTENT_SUGGESTIONS_SHOW_SUMMARY = "ContentSuggestionsShowSummary"; + public static final String CONTENT_SUGGESTIONS_VIDEO_OVERLAY = "ContentSuggestionsVideoOverlay"; public static final String CONTEXTUAL_SEARCH_SINGLE_ACTIONS = "ContextualSearchSingleActions"; public static final String CONTEXTUAL_SEARCH_URL_ACTIONS = "ContextualSearchUrlActions"; public static final String CONTEXTUAL_SUGGESTIONS_CAROUSEL = "ContextualSuggestionsCarousel";
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java index d5bd176..df794bf 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -286,15 +286,15 @@ } @Override - public boolean isShowingBrowserControlsEnabled() { + public boolean canShowBrowserControls() { if (VrShellDelegate.isInVr()) return false; - return super.isShowingBrowserControlsEnabled(); + return super.canShowBrowserControls(); } @Override - public boolean isHidingBrowserControlsEnabled() { + public boolean canAutoHideBrowserControls() { if (VrShellDelegate.isInVr()) return true; - return super.isHidingBrowserControlsEnabled(); + return super.canAutoHideBrowserControls(); } } @@ -2262,4 +2262,4 @@ FeatureUtilities.isChromeHomeEnabled() ? 0 : yInsetPx); textBubble.show(); } -} \ No newline at end of file +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChromePhone.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChromePhone.java index 4feeb81..b6daa610 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChromePhone.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChromePhone.java
@@ -127,7 +127,7 @@ // smoothly. getActiveLayout().onTabCreating(sourceId); } else if (animationsEnabled()) { - if (!FeatureUtilities.isChromeHomeEnabled()) { + if (!FeatureUtilities.isChromeHomeEnabled() || !overviewVisible()) { if (getActiveLayout() != null && getActiveLayout().isHiding()) { setNextLayout(mSimpleAnimationLayout); // The method Layout#doneHiding() will automatically show the next layout.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/TabularContextMenuUi.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/TabularContextMenuUi.java index b2f6c02..863eb39 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/TabularContextMenuUi.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/TabularContextMenuUi.java
@@ -294,7 +294,6 @@ * @param topContentOffsetPx y content offset from the top. */ public void setTopContentOffsetY(float topContentOffsetPx) { - assert mContextMenuDialog != null; mTopContentOffsetPx = topContentOffsetPx; } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java index ffa2d894..8ec40a5e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
@@ -202,8 +202,8 @@ TabStateBrowserControlsVisibilityDelegate tabDelegate = new TabStateBrowserControlsVisibilityDelegate(tab) { @Override - public boolean isHidingBrowserControlsEnabled() { - return mShouldHideBrowserControls && super.isHidingBrowserControlsEnabled(); + public boolean canAutoHideBrowserControls() { + return mShouldHideBrowserControls && super.canAutoHideBrowserControls(); } };
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 06c9d022..6462fb59 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
@@ -494,15 +494,23 @@ @Override public OverrideUrlLoadingResult clobberCurrentTab( - String url, String referrerUrl, Tab tab) { + String url, String referrerUrl, final Tab tab) { int transitionType = PageTransition.LINK; - LoadUrlParams loadUrlParams = new LoadUrlParams(url, transitionType); + final LoadUrlParams loadUrlParams = new LoadUrlParams(url, transitionType); if (!TextUtils.isEmpty(referrerUrl)) { Referrer referrer = new Referrer(referrerUrl, Referrer.REFERRER_POLICY_ALWAYS); loadUrlParams.setReferrer(referrer); } if (tab != null) { - tab.loadUrl(loadUrlParams); + // Loading URL will start a new navigation which cancels the current one + // that this clobbering is being done for. It leads to UAF. To avoid that, + // we're loading URL asynchronously. See https://crbug.com/732260. + ThreadUtils.postOnUiThread(new Runnable() { + @Override + public void run() { + tab.loadUrl(loadUrlParams); + } + }); return OverrideUrlLoadingResult.OVERRIDE_WITH_CLOBBERING_TAB; } else { assert false : "clobberCurrentTab was called with an empty tab.";
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegate.java index 411314ef..7039bc9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegate.java
@@ -141,12 +141,12 @@ } @Override - public boolean isShowingBrowserControlsEnabled() { + public boolean canShowBrowserControls() { return true; } @Override - public boolean isHidingBrowserControlsEnabled() { + public boolean canAutoHideBrowserControls() { return sDisableOverridesForTesting || mPersistentControlTokens.isEmpty(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/ChromeFullscreenManager.java b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/ChromeFullscreenManager.java index 226c005..226cace 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/ChromeFullscreenManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/ChromeFullscreenManager.java
@@ -149,7 +149,7 @@ public void run() { if (getTab() != null) { getTab().updateFullscreenEnabledState(); - } else if (!mBrowserVisibilityDelegate.isHidingBrowserControlsEnabled()) { + } else if (!mBrowserVisibilityDelegate.canAutoHideBrowserControls()) { setPositionsForTabToNonFullscreen(); } } @@ -236,7 +236,7 @@ if (tab != null && previousTab != getTab()) { mBrowserVisibilityDelegate.showControlsTransient(); } - if (tab == null && !mBrowserVisibilityDelegate.isHidingBrowserControlsEnabled()) { + if (tab == null && !mBrowserVisibilityDelegate.canAutoHideBrowserControls()) { setPositionsForTabToNonFullscreen(); } } @@ -617,7 +617,7 @@ @Override public void setPositionsForTabToNonFullscreen() { Tab tab = getTab(); - if (tab == null || tab.isShowingBrowserControlsEnabled()) { + if (tab == null || tab.canShowBrowserControls()) { setPositionsForTab(0, 0, getTopControlsHeight()); } else { setPositionsForTab(-getTopControlsHeight(), getBottomControlsHeight(), 0);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/ComposedBrowserControlsVisibilityDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/ComposedBrowserControlsVisibilityDelegate.java index ea2089a..0ff16fda 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/ComposedBrowserControlsVisibilityDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/ComposedBrowserControlsVisibilityDelegate.java
@@ -28,17 +28,17 @@ } @Override - public boolean isShowingBrowserControlsEnabled() { + public boolean canShowBrowserControls() { for (int i = 0; i < mDelegates.size(); i++) { - if (!mDelegates.get(i).isShowingBrowserControlsEnabled()) return false; + if (!mDelegates.get(i).canShowBrowserControls()) return false; } return true; } @Override - public boolean isHidingBrowserControlsEnabled() { + public boolean canAutoHideBrowserControls() { for (int i = 0; i < mDelegates.size(); i++) { - if (!mDelegates.get(i).isHidingBrowserControlsEnabled()) return false; + if (!mDelegates.get(i).canAutoHideBrowserControls()) return false; } return true; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateCompactInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateCompactInfoBar.java index 3588891..c0e7637 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateCompactInfoBar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateCompactInfoBar.java
@@ -415,6 +415,12 @@ @Override public void onSourceMenuItemClicked(String code) { + // If source language is same as target language, the infobar will dismiss and no + // translation will be done. + if (mOptions.targetLanguageCode().equals(code)) { + closeInfobar(true); + return; + } // Reset source code in both UI and native. if (mNativeTranslateInfoBarPtr != 0 && mOptions.setSourceLanguage(code)) { recordInfobarLanguageData(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/translate/TranslateMenuHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/translate/TranslateMenuHelper.java index 0d0065d..112a493 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/translate/TranslateMenuHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/translate/TranslateMenuHelper.java
@@ -67,9 +67,11 @@ } else { for (int i = 0; i < mOptions.allLanguages().size(); ++i) { String code = mOptions.allLanguages().get(i).mLanguageCode; - // Don't show target or source language in the menu list. - if (code.equals(mOptions.targetLanguageCode()) - || code.equals(mOptions.sourceLanguageCode())) { + // Avoid source language in both the source and target language list. + // Avoid target language only in the target language list. + if (code.equals(mOptions.sourceLanguageCode()) + || (menuType == TranslateMenu.MENU_TARGET_LANGUAGE + && code.equals(mOptions.targetLanguageCode()))) { continue; } menuList.add(new TranslateMenu.MenuItem(TranslateMenu.ITEM_LANGUAGE, i, code));
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPageView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPageView.java index 1764db1a..5c01df3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPageView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPageView.java
@@ -75,6 +75,11 @@ mManager = manager; } + /** @return The IncognitoNewTabPageManager associated with this IncognitoNewTabPageView. */ + protected IncognitoNewTabPageManager getManager() { + return mManager; + } + /** * @see org.chromium.chrome.browser.compositor.layouts.content. * InvalidationAwareThumbnailProvider#shouldCaptureThumbnail()
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPageViewMD.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPageViewMD.java index 25dfc51..3616f8d7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPageViewMD.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPageViewMD.java
@@ -7,13 +7,18 @@ import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; +import android.support.annotation.ColorRes; import android.support.annotation.IdRes; import android.support.annotation.StringRes; import android.text.Layout; +import android.text.SpannableString; +import android.text.TextPaint; +import android.text.method.LinkMovementMethod; import android.text.style.BulletSpan; import android.text.style.ForegroundColorSpan; import android.util.AttributeSet; import android.util.DisplayMetrics; +import android.view.Gravity; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; @@ -21,6 +26,7 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.chrome.R; +import org.chromium.ui.text.NoUnderlineClickableSpan; import org.chromium.ui.text.SpanApplier; /** @@ -36,9 +42,18 @@ private LinearLayout mContainer; private TextView mHeader; + private TextView mSubtitle; + private LinearLayout mBulletpointsContainer; + private TextView mLearnMore; private TextView[] mParagraphs; - static class IncognitoBulletSpan extends BulletSpan { + boolean mFirstLayout = true; + + private static final int BULLETPOINTS_HORIZONTAL_SPACING_DP = 40; + private static final int CONTENT_WIDTH_DP = 600; + private static final int WIDE_LAYOUT_THRESHOLD_DP = 720; + + private static class IncognitoBulletSpan extends BulletSpan { public IncognitoBulletSpan() { super(0 /* gapWidth */); } @@ -51,6 +66,27 @@ } } + private static class IncognitoClickableSpan extends NoUnderlineClickableSpan { + private final @ColorRes int mColor; + private final IncognitoNewTabPageManager mManager; + + public IncognitoClickableSpan(Context context, IncognitoNewTabPageManager manager) { + mColor = + ApiCompatibilityUtils.getColor(context.getResources(), R.color.google_blue_300); + mManager = manager; + } + + @Override + public void onClick(View view) { + mManager.loadIncognitoLearnMore(); + } + + @Override + public void updateDrawState(TextPaint drawState) { + drawState.setColor(mColor); + } + } + /** Default constructor needed to inflate via XML. */ public IncognitoNewTabPageViewMD(Context context, AttributeSet attrs) { super(context, attrs); @@ -79,27 +115,29 @@ mContainer = (LinearLayout) findViewById(R.id.new_tab_incognito_container); mHeader = (TextView) findViewById(R.id.new_tab_incognito_title); - mParagraphs = new TextView[] { - (TextView) findViewById(R.id.new_tab_incognito_subtitle), - (TextView) findViewById(R.id.new_tab_incognito_features), - (TextView) findViewById(R.id.new_tab_incognito_warning), - (TextView) findViewById(R.id.learn_more), - }; + mSubtitle = (TextView) findViewById(R.id.new_tab_incognito_subtitle); + mLearnMore = (TextView) findViewById(R.id.learn_more); + mParagraphs = + new TextView[] {mSubtitle, (TextView) findViewById(R.id.new_tab_incognito_features), + (TextView) findViewById(R.id.new_tab_incognito_warning), mLearnMore}; + mBulletpointsContainer = + (LinearLayout) findViewById(R.id.new_tab_incognito_bulletpoints_container); } @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - int mNewWidthDp = pxToDp(View.MeasureSpec.getSize(widthMeasureSpec)); - int mNewHeightDp = pxToDp(View.MeasureSpec.getSize(heightMeasureSpec)); + protected void onLayout(boolean changed, int left, int top, int right, int bottom) { + super.onLayout(changed, left, top, right, bottom); - boolean needsReflow = mWidthDp != mNewWidthDp || mHeightDp != mNewHeightDp; + if (changed) { + mWidthDp = pxToDp(getMeasuredWidth()); + mHeightDp = pxToDp(getMeasuredHeight()); - mWidthDp = mNewWidthDp; - mHeightDp = mNewHeightDp; - - if (needsReflow) reflowLayout(); - - super.onMeasure(widthMeasureSpec, heightMeasureSpec); + adjustTypography(); + adjustIcon(); + adjustLayout(); + adjustLearnMore(); + mFirstLayout = false; + } } /** @@ -124,9 +162,10 @@ // - Disambiguate the <li></li> spans for SpanApplier. // - Add the bulletpoint symbols (Unicode BULLET U+2022) // - Remove leading whitespace (caused by formatting in the .grdp file) + // - Remove the trailing newline after the last bulletpoint. text = text.replaceFirst(" +<li>([^<]*)</li>", "<li1>\u2022 $1</li1>"); text = text.replaceFirst(" +<li>([^<]*)</li>", "<li2>\u2022 $1</li2>"); - text = text.replaceFirst(" +<li>([^<]*)</li>", "<li3>\u2022 $1</li3>"); + text = text.replaceFirst(" +<li>([^<]*)</li>\n", "<li3>\u2022 $1</li3>"); // Remove the <ul></ul> tags which serve no purpose here, including the whitespace around // them. @@ -141,13 +180,6 @@ new SpanApplier.SpanInfo("<li3>", "</li3>", new IncognitoBulletSpan()))); } - /** Reflows the layout based on the current window size. */ - private void reflowLayout() { - adjustTypography(); - adjustLayout(); - adjustIcon(); - } - /** Adjusts the font settings. */ private void adjustTypography() { if (mWidthDp <= 240 || mHeightDp <= 320) { @@ -167,21 +199,62 @@ // Paragraph line spacing is constant +6sp, defined in R.layout.new_tab_page_incognito_md. } - /** Adjusts the paddings and margins. */ + /** Adjusts the paddings, margins, and the orientation of bulletpoints. */ private void adjustLayout() { int paddingHorizontalDp; int paddingVerticalDp; - if (mWidthDp <= 720) { - // Small screens. + boolean bulletpointsArrangedHorizontally; + + if (mWidthDp <= WIDE_LAYOUT_THRESHOLD_DP) { + // Small padding. paddingHorizontalDp = mWidthDp <= 240 ? 24 : 32; - paddingVerticalDp = mHeightDp <= 480 ? 32 : (mHeightDp <= 600 ? 48 : 72); + paddingVerticalDp = mHeightDp <= 600 ? 32 : 72; + + // Align left. + mContainer.setGravity(Gravity.START); + + // Decide the bulletpoints orientation. + bulletpointsArrangedHorizontally = false; + + // The subtitle is sized automatically, but not wider than CONTENT_WIDTH_DP. + mSubtitle.setLayoutParams( + new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, + LinearLayout.LayoutParams.WRAP_CONTENT)); + mSubtitle.setMaxWidth(dpToPx(CONTENT_WIDTH_DP)); } else { - // Large screens. + // Large padding. paddingHorizontalDp = 0; // Should not be necessary on a screen this large. paddingVerticalDp = mHeightDp <= 320 ? 16 : 72; + + // Align to the center. + mContainer.setGravity(Gravity.CENTER_HORIZONTAL); + + // Decide the bulletpoints orientation. + // TODO(msramek): The total bulletpoints width is consistently miscalculated by 10dp + // on the first layout run. Investigate why. + int totalBulletpointsWidthDp = pxToDp(mBulletpointsContainer.getChildAt(0).getWidth()) + + pxToDp(mBulletpointsContainer.getChildAt(1).getWidth()) + + BULLETPOINTS_HORIZONTAL_SPACING_DP + (mFirstLayout ? 10 : 0); + bulletpointsArrangedHorizontally = totalBulletpointsWidthDp <= CONTENT_WIDTH_DP; + + // The subtitle width is equal to the two sets of bulletpoints if they are arranged + // horizontally. If not, use the default CONTENT_WIDTH_DP. + int subtitleWidthPx = bulletpointsArrangedHorizontally + ? dpToPx(totalBulletpointsWidthDp) + : dpToPx(CONTENT_WIDTH_DP); + mSubtitle.setLayoutParams(new LinearLayout.LayoutParams( + subtitleWidthPx, LinearLayout.LayoutParams.WRAP_CONTENT)); } + // Apply the bulletpoints orientation. + if (bulletpointsArrangedHorizontally) { + mBulletpointsContainer.setOrientation(LinearLayout.HORIZONTAL); + } else { + mBulletpointsContainer.setOrientation(LinearLayout.VERTICAL); + } + + // Set up paddings and margins. mContainer.setPadding(dpToPx(paddingHorizontalDp), dpToPx(paddingVerticalDp), dpToPx(paddingHorizontalDp), dpToPx(paddingVerticalDp)); @@ -189,19 +262,28 @@ (int) Math.ceil(mParagraphs[0].getTextSize() * (mHeightDp <= 600 ? 1 : 1.5)); for (TextView paragraph : mParagraphs) { + // If bulletpoints are arranged horizontally, there should be space between them. + int rightMarginPx = (bulletpointsArrangedHorizontally + && paragraph == mBulletpointsContainer.getChildAt(0)) + ? dpToPx(BULLETPOINTS_HORIZONTAL_SPACING_DP) + : 0; + ((LinearLayout.LayoutParams) paragraph.getLayoutParams()) - .setMargins(0, spacingPx, 0, 0); + .setMargins(0, spacingPx, rightMarginPx, 0); + paragraph.setLayoutParams(paragraph.getLayoutParams()); // Apply the new layout. } ((LinearLayout.LayoutParams) mHeader.getLayoutParams()).setMargins(0, spacingPx, 0, 0); + mHeader.setLayoutParams(mHeader.getLayoutParams()); // Apply the new layout. } /** Adjust the Incognito icon. */ private void adjustIcon() { - // TODO(msramek): Instead of stretching the icon, we should have differently-sized versions, - // or, if possible, reuse an icon intended for a higher DPI. + // The icon resource is 120dp x 120dp (i.e. 120px x 120px at MDPI). This method always + // resizes the icon view to 120dp x 120dp or smaller, therefore image quality is not lost. + int sizeDp; - if (mWidthDp <= 720) { + if (mWidthDp <= WIDE_LAYOUT_THRESHOLD_DP) { sizeDp = (mWidthDp <= 240 || mHeightDp <= 480) ? 48 : 72; } else { sizeDp = mHeightDp <= 480 ? 72 : 120; @@ -211,4 +293,33 @@ icon.getLayoutParams().width = dpToPx(sizeDp); icon.getLayoutParams().height = dpToPx(sizeDp); } + + /** Adjust the "Learn More" link. */ + private void adjustLearnMore() { + final String subtitleText = + mContext.getResources().getString(R.string.new_tab_otr_subtitle); + boolean learnMoreInSubtitle = mWidthDp > WIDE_LAYOUT_THRESHOLD_DP; + + mSubtitle.setClickable(learnMoreInSubtitle); + mLearnMore.setVisibility(learnMoreInSubtitle ? View.GONE : View.VISIBLE); + + if (!learnMoreInSubtitle) { + // Revert to the original text. + mSubtitle.setText(subtitleText); + mSubtitle.setMovementMethod(null); + return; + } + + // Concatenate the original text with a clickable "Learn more" link. + StringBuilder concatenatedText = new StringBuilder(); + concatenatedText.append(subtitleText); + concatenatedText.append(" "); + concatenatedText.append(mContext.getResources().getString(R.string.learn_more)); + SpannableString textWithLearnMoreLink = new SpannableString(concatenatedText.toString()); + + textWithLearnMoreLink.setSpan(new IncognitoClickableSpan(mContext, getManager()), + subtitleText.length() + 1, textWithLearnMoreLink.length(), 0 /* flags */); + mSubtitle.setText(textWithLearnMoreLink); + mSubtitle.setMovementMethod(LinkMovementMethod.getInstance()); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java index 16c96df..4b9f09d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java
@@ -4,7 +4,6 @@ package org.chromium.chrome.browser.ntp.snippets; -import android.annotation.SuppressLint; import android.content.res.ColorStateList; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; @@ -13,7 +12,7 @@ import android.media.ThumbnailUtils; import android.os.StrictMode; import android.os.SystemClock; -import android.support.annotation.IntDef; +import android.support.annotation.Nullable; import android.support.v4.text.BidiFormatter; import android.text.TextUtils; import android.text.format.DateUtils; @@ -32,16 +31,13 @@ import org.chromium.chrome.browser.compositor.layouts.ChromeAnimation; import org.chromium.chrome.browser.download.DownloadUtils; import org.chromium.chrome.browser.download.ui.DownloadFilter; -import org.chromium.chrome.browser.download.ui.ThumbnailProvider; -import org.chromium.chrome.browser.favicon.FaviconHelper.FaviconImageCallback; -import org.chromium.chrome.browser.favicon.FaviconHelper.IconAvailabilityCallback; import org.chromium.chrome.browser.ntp.ContextMenuManager; import org.chromium.chrome.browser.ntp.ContextMenuManager.ContextMenuItemId; import org.chromium.chrome.browser.ntp.cards.CardViewHolder; -import org.chromium.chrome.browser.ntp.cards.CardsVariationParameters; import org.chromium.chrome.browser.ntp.cards.ImpressionTracker; import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder; import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo; +import org.chromium.chrome.browser.suggestions.ImageFetcher; import org.chromium.chrome.browser.suggestions.SuggestionsMetrics; import org.chromium.chrome.browser.suggestions.SuggestionsRecyclerView; import org.chromium.chrome.browser.suggestions.SuggestionsUiDelegate; @@ -53,10 +49,6 @@ import org.chromium.chrome.browser.widget.displaystyle.VerticalDisplayStyle; import org.chromium.ui.mojom.WindowOpenDisposition; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.net.URI; -import java.net.URISyntaxException; import java.util.concurrent.TimeUnit; /** @@ -71,23 +63,11 @@ REFRESH_OFFLINE_BADGE_VISIBILITY_CALLBACK = new RefreshOfflineBadgeVisibilityCallback(); private static final String ARTICLE_AGE_FORMAT_STRING = " - %s"; - private static final int FADE_IN_ANIMATION_TIME_MS = 300; - private static final int[] FAVICON_SERVICE_SUPPORTED_SIZES = {16, 24, 32, 48, 64}; - private static final String FAVICON_SERVICE_FORMAT = - "https://s2.googleusercontent.com/s2/favicons?domain=%s&src=chrome_newtab_mobile&sz=%d&alt=404"; - - /** Min size for site attribution: only 16px as many sites do not have any other small icon. */ - private static final int PUBLISHER_FAVICON_MINIMUM_SIZE_PX = 16; - /** Desired size for site attribution: only 32px as larger icons are often too complex */ - private static final int PUBLISHER_FAVICON_DESIRED_SIZE_PX = 32; - - private static final int THUMBNAIL_SOURCE_ARTICLE = 0; - private static final int THUMBNAIL_SOURCE_DOWNLOAD = 1; private final SuggestionsUiDelegate mUiDelegate; private final UiConfig mUiConfig; - private final ThumbnailProvider mThumbnailProvider; + private final ImageFetcher mImageFetcher; private final LinearLayout mTextLayout; private final TextView mHeadlineTextView; @@ -95,18 +75,18 @@ private final TextView mArticleSnippetTextView; private final TextView mArticleAgeTextView; private final TintedImageView mThumbnailView; + private final ImageView mThumbnailVideoOverlay; private final ImageView mOfflineBadge; private final View mPublisherBar; private final int mThumbnailSize; /** Total horizontal space occupied by the thumbnail, sum of its size and margin. */ private final int mThumbnailFootprintPx; - private final boolean mUseFaviconService; private final int mIconBackgroundColor; private final ColorStateList mIconForegroundColorList; - private FetchImageCallback mImageCallback; - private ThumbnailCallback mDownloadThumbnailCallback; + @Nullable + private ImageFetcher.DownloadThumbnailRequest mThumbnailRequest; private SnippetArticle mArticle; private SuggestionsCategoryInfo mCategoryInfo; private int mPublisherFaviconSizePx; @@ -128,7 +108,7 @@ mUiDelegate = uiDelegate; mUiConfig = uiConfig; - mThumbnailProvider = uiDelegate.getThumbnailProvider(); + mImageFetcher = mUiDelegate.getImageFetcher(); mTextLayout = (LinearLayout) itemView.findViewById(R.id.text_layout); mHeadlineTextView = (TextView) itemView.findViewById(R.id.article_headline); @@ -136,6 +116,8 @@ mArticleSnippetTextView = (TextView) itemView.findViewById(R.id.article_snippet); mArticleAgeTextView = (TextView) itemView.findViewById(R.id.article_age); mThumbnailView = (TintedImageView) itemView.findViewById(R.id.article_thumbnail); + mThumbnailVideoOverlay = + (ImageView) itemView.findViewById(R.id.article_thumbnail_video_overlay); mPublisherBar = itemView.findViewById(R.id.publisher_bar); mOfflineBadge = (ImageView) itemView.findViewById(R.id.offline_icon); @@ -146,7 +128,6 @@ : R.dimen.snippets_thumbnail_size); mThumbnailFootprintPx = mThumbnailSize + itemView.getResources().getDimensionPixelSize(R.dimen.snippets_thumbnail_margin); - mUseFaviconService = CardsVariationParameters.isFaviconServiceEnabled(); mIconBackgroundColor = DownloadUtils.getIconBackgroundColor(parent.getContext()); mIconForegroundColorList = DownloadUtils.getIconForegroundColorList(parent.getContext()); @@ -232,20 +213,12 @@ // We start initialising with the default favicon to reserve the space and prevent the text // from moving later. setDefaultFaviconOnView(); - try { - long faviconFetchStartTimeMs = SystemClock.elapsedRealtime(); - URI pageUrl = new URI(mArticle.mUrl); - if (!article.isArticle() || !SnippetsConfig.isFaviconsFromNewServerEnabled()) { - // The old code path. Remove when the experiment is successful. - // Currently, we have to use this for non-articles, due to privacy. - fetchFaviconFromLocalCache(pageUrl, true, faviconFetchStartTimeMs); - } else { - // The new code path. - fetchFaviconFromLocalCacheOrGoogleServer(faviconFetchStartTimeMs); + mImageFetcher.makeFaviconRequest(mArticle, mPublisherFaviconSizePx, new Callback<Bitmap>() { + @Override + public void onResult(Bitmap image) { + setFaviconOnView(image); } - } catch (URISyntaxException e) { - // Do nothing, stick to the default favicon. - } + }); mOfflineBadge.setVisibility(View.GONE); refreshOfflineBadgeVisibility(); @@ -262,6 +235,7 @@ boolean showHeadline = shouldShowHeadline(); boolean showDescription = shouldShowDescription(horizontalStyle, verticalStyle, layout); boolean showThumbnail = shouldShowThumbnail(layout); + boolean showThumbnailVideoOverlay = shouldShowThumbnailVideoOverlay(showThumbnail); if (ChromeFeatureList.isEnabled(ChromeFeatureList.CONTENT_SUGGESTIONS_LARGE_THUMBNAIL)) { mTextLayout.setMinimumHeight(showThumbnail ? mThumbnailSize : 0); @@ -270,6 +244,7 @@ mHeadlineTextView.setMaxLines(getHeaderMaxLines(horizontalStyle, verticalStyle, layout)); mArticleSnippetTextView.setVisibility(showDescription ? View.VISIBLE : View.GONE); mThumbnailView.setVisibility(showThumbnail ? View.VISIBLE : View.GONE); + mThumbnailVideoOverlay.setVisibility(showThumbnailVideoOverlay ? View.VISIBLE : View.GONE); ViewGroup.MarginLayoutParams publisherBarParams = (ViewGroup.MarginLayoutParams) mPublisherBar.getLayoutParams(); @@ -322,6 +297,12 @@ return true; } + private boolean shouldShowThumbnailVideoOverlay(boolean showThumbnail) { + if (!showThumbnail) return false; + if (!mArticle.mIsVideoSuggestion) return false; + return ChromeFeatureList.isEnabled(ChromeFeatureList.CONTENT_SUGGESTIONS_VIDEO_OVERLAY); + } + /** * If no summary (no description) is shown, allow more lines for the header (title). * @return The maximum number of header text lines. @@ -391,13 +372,18 @@ int fileType = DownloadFilter.fromMimeType(mArticle.getAssetDownloadMimeType()); if (fileType == DownloadFilter.FILTER_IMAGE) { // For image downloads, attempt to fetch a thumbnail. - cancelImageFetch(); - mImageCallback = new FetchImageCallback(this, mArticle, THUMBNAIL_SOURCE_DOWNLOAD); - mDownloadThumbnailCallback = - new ThumbnailCallback(mImageCallback, mArticle, mThumbnailSize); - mThumbnailProvider.getThumbnail(mDownloadThumbnailCallback); + mThumbnailRequest = mImageFetcher.makeDownloadThumbnailRequest( + mArticle, mThumbnailSize, new FetchImageCallback(mArticle, mThumbnailSize)); } - setThumbnailFromFileType(fileType); + + // Code order here is important because the call to fetch a thumbnail above can be + // synchronous (if the image is cached) or asynchronous (if not). In the first case, it will + // immediately set a thumbnail on the mThumbnailView and no placeholder will be needed. In + // the second case, the placeholder will be replaced once the thumbnail is retrieved. + // We check here that there is no thumbnail already set on the mThumbnailView. + if (mThumbnailView.getDrawable() == null) { + setThumbnailFromFileType(fileType); + } } private void setThumbnail() { @@ -421,8 +407,8 @@ mThumbnailView.setBackground(null); mThumbnailView.setImageResource(R.drawable.ic_snippet_thumbnail_placeholder); mThumbnailView.setTint(null); - mImageCallback = new FetchImageCallback(this, mArticle, THUMBNAIL_SOURCE_ARTICLE); - mUiDelegate.getSuggestionsSource().fetchSuggestionImage(mArticle, mImageCallback); + mImageFetcher.makeArticleThumbnailRequest( + mArticle, new FetchImageCallback(mArticle, mThumbnailSize)); } /** Updates the visibility of the card's offline badge by checking the bound article's info. */ @@ -433,40 +419,19 @@ } private void cancelImageFetch() { - if (mImageCallback != null) { - mImageCallback.cancel(); - mImageCallback = null; - } - - if (mDownloadThumbnailCallback != null) { - mThumbnailProvider.cancelRetrieval(mDownloadThumbnailCallback); - mDownloadThumbnailCallback = null; + if (mThumbnailRequest != null) { + mThumbnailRequest.cancel(); + mThumbnailRequest = null; } } - private void fadeThumbnailIn(SnippetArticle snippet, Bitmap thumbnail, boolean owned) { - mImageCallback = null; - if (thumbnail == null) return; // Nothing to do, we keep the placeholder. - - // We need to crop and scale the downloaded bitmap, as the ImageView we set it on won't be - // able to do so when using a TransitionDrawable (as opposed to the straight bitmap). - // That's a limitation of TransitionDrawable, which doesn't handle layers of varying sizes. - if (thumbnail.getHeight() != mThumbnailSize || thumbnail.getWidth() != mThumbnailSize) { - // Resize the thumbnail. If we fully own the input bitmap (e.g. it isn't cached anywhere - // else), recycle the input image in the process. - thumbnail = ThumbnailUtils.extractThumbnail(thumbnail, mThumbnailSize, mThumbnailSize, - owned ? ThumbnailUtils.OPTIONS_RECYCLE_INPUT : 0); - } - - // Store the bitmap to skip the download task next time we display this snippet. - snippet.setThumbnailBitmap(mUiDelegate.getReferencePool().put(thumbnail)); - + private void fadeThumbnailIn(Bitmap thumbnail) { mThumbnailView.setScaleType(ImageView.ScaleType.CENTER_CROP); mThumbnailView.setBackground(null); mThumbnailView.setTint(null); int duration = (int) (FADE_IN_ANIMATION_TIME_MS * ChromeAnimation.Animation.getAnimationMultiplier()); - if (duration == 0) { + if (duration == 0 || mThumbnailView.getDrawable() == null) { mThumbnailView.setImageBitmap(thumbnail); return; } @@ -481,103 +446,6 @@ transitionDrawable.startTransition(duration); } - private void fetchFaviconFromLocalCacheOrGoogleServer(final long faviconFetchStartTimeMs) { - // The bitmap will not be resized to desired size in c++, this only expresses preference. - mUiDelegate.getSuggestionsSource().fetchSuggestionFavicon(mArticle, - PUBLISHER_FAVICON_MINIMUM_SIZE_PX, PUBLISHER_FAVICON_DESIRED_SIZE_PX, - new Callback<Bitmap>() { - @Override - public void onResult(Bitmap image) { - recordFaviconFetchTime(faviconFetchStartTimeMs); - if (image == null) return; - setFaviconOnView(image); - } - }); - } - - private void recordFaviconFetchTime(long faviconFetchStartTimeMs) { - RecordHistogram.recordMediumTimesHistogram( - "NewTabPage.ContentSuggestions.ArticleFaviconFetchTime", - SystemClock.elapsedRealtime() - faviconFetchStartTimeMs, TimeUnit.MILLISECONDS); - } - - private void recordFaviconFetchResult( - @FaviconFetchResult int result, long faviconFetchStartTimeMs) { - // Record the histogram for articles only to have a fair comparision. - if (!mArticle.isArticle()) return; - RecordHistogram.recordEnumeratedHistogram( - "NewTabPage.ContentSuggestions.ArticleFaviconFetchResult", result, - FaviconFetchResult.COUNT); - recordFaviconFetchTime(faviconFetchStartTimeMs); - } - - private void fetchFaviconFromLocalCache(final URI snippetUri, final boolean fallbackToService, - final long faviconFetchStartTimeMs) { - mUiDelegate.getLocalFaviconImageForURL( - getSnippetDomain(snippetUri), mPublisherFaviconSizePx, new FaviconImageCallback() { - @Override - public void onFaviconAvailable(Bitmap image, String iconUrl) { - if (image != null) { - setFaviconOnView(image); - recordFaviconFetchResult(fallbackToService - ? FaviconFetchResult.SUCCESS_CACHED - : FaviconFetchResult.SUCCESS_FETCHED, - faviconFetchStartTimeMs); - } else if (fallbackToService) { - if (!fetchFaviconFromService(snippetUri, faviconFetchStartTimeMs)) { - recordFaviconFetchResult( - FaviconFetchResult.FAILURE, faviconFetchStartTimeMs); - } - } - // Else do nothing, we already have the placeholder set. - } - }); - } - - // TODO(crbug.com/635567): Fix this properly. - @SuppressLint("DefaultLocale") - private boolean fetchFaviconFromService( - final URI snippetUri, final long faviconFetchStartTimeMs) { - if (!mUseFaviconService) return false; - int sizePx = getFaviconServiceSupportedSize(); - if (sizePx == 0) return false; - - // Replace the default icon by another one from the service when it is fetched. - mUiDelegate.ensureIconIsAvailable( - getSnippetDomain(snippetUri), // Store to the cache for the whole domain. - String.format(FAVICON_SERVICE_FORMAT, snippetUri.getHost(), sizePx), - /*useLargeIcon=*/false, /*isTemporary=*/true, new IconAvailabilityCallback() { - @Override - public void onIconAvailabilityChecked(boolean newlyAvailable) { - if (!newlyAvailable) { - recordFaviconFetchResult( - FaviconFetchResult.FAILURE, faviconFetchStartTimeMs); - return; - } - // The download succeeded, the favicon is in the cache; fetch it. - fetchFaviconFromLocalCache( - snippetUri, /*fallbackToService=*/false, faviconFetchStartTimeMs); - } - }); - return true; - } - - private int getFaviconServiceSupportedSize() { - // Take the smallest size larger than mFaviconSizePx. - for (int size : FAVICON_SERVICE_SUPPORTED_SIZES) { - if (size > mPublisherFaviconSizePx) return size; - } - // Or at least the largest available size (unless too small). - int largestSize = - FAVICON_SERVICE_SUPPORTED_SIZES[FAVICON_SERVICE_SUPPORTED_SIZES.length - 1]; - if (mPublisherFaviconSizePx <= largestSize * 1.5) return largestSize; - return 0; - } - - private String getSnippetDomain(URI snippetUri) { - return String.format("%s://%s", snippetUri.getScheme(), snippetUri.getHost()); - } - private void setDefaultFaviconOnView() { setFaviconOnView(ApiCompatibilityUtils.getDrawable( mPublisherTextView.getContext().getResources(), R.drawable.default_favicon)); @@ -594,68 +462,38 @@ mPublisherTextView.setVisibility(View.VISIBLE); } - @Retention(RetentionPolicy.SOURCE) - @IntDef({THUMBNAIL_SOURCE_ARTICLE, THUMBNAIL_SOURCE_DOWNLOAD}) - private @interface ThumbnailSource {} + private class FetchImageCallback extends Callback<Bitmap> { + private final SnippetArticle mSuggestion; + private final int mThumbnailSize; + private final boolean mIsBitmapOwned; - private static class FetchImageCallback extends Callback<Bitmap> { - private SnippetArticleViewHolder mViewHolder; - private final SnippetArticle mSnippet; - @ThumbnailSource - private final int mSource; - - public FetchImageCallback(SnippetArticleViewHolder viewHolder, SnippetArticle snippet, - @ThumbnailSource int source) { - mViewHolder = viewHolder; - mSnippet = snippet; - mSource = source; + FetchImageCallback(SnippetArticle suggestion, int size) { + mSuggestion = suggestion; + mThumbnailSize = size; + mIsBitmapOwned = suggestion.isArticle(); } @Override - public void onResult(Bitmap image) { - if (mViewHolder == null) return; - mViewHolder.fadeThumbnailIn(mSnippet, image, mSource == THUMBNAIL_SOURCE_ARTICLE); - } + public void onResult(Bitmap thumbnail) { + if (thumbnail == null) return; // Nothing to do, we keep the placeholder. - public void cancel() { - // TODO(treib): Pass the "cancel" on to the actual image fetcher. - mViewHolder = null; - } - } + // We need to crop and scale the downloaded bitmap, as the ImageView we set it on won't + // be able to do so when using a TransitionDrawable (as opposed to the straight bitmap). + // That's a limitation of TransitionDrawable, which doesn't handle layers of varying + // sizes. + if (thumbnail.getHeight() != mThumbnailSize || thumbnail.getWidth() != mThumbnailSize) { + // Resize the thumbnail. If we fully own the input bitmap (e.g. it isn't cached + // anywhere else), recycle the input image in the process. + thumbnail = ThumbnailUtils.extractThumbnail(thumbnail, mThumbnailSize, + mThumbnailSize, mIsBitmapOwned ? ThumbnailUtils.OPTIONS_RECYCLE_INPUT : 0); + } - private static class ThumbnailCallback implements ThumbnailProvider.ThumbnailRequest { - private final SnippetArticle mSnippet; - private final FetchImageCallback mCallback; - private final int mIconSize; + // Store the bitmap to skip the download task next time we display this snippet. + mSuggestion.setThumbnailBitmap(mUiDelegate.getReferencePool().put(thumbnail)); - public ThumbnailCallback( - FetchImageCallback callback, SnippetArticle snippet, int iconSize) { - assert snippet != null; - assert callback != null; + if (mSuggestion != mArticle) return; - mSnippet = snippet; - mCallback = callback; - mIconSize = iconSize; - } - - @Override - public String getFilePath() { - return mSnippet.getAssetDownloadFile().getAbsolutePath(); - } - - @Override - public void onThumbnailRetrieved(String filePath, Bitmap thumbnail) { - assert !thumbnail.isRecycled(); - - if (!getFilePath().equals(filePath)) return; - if (thumbnail.getWidth() <= 0 || thumbnail.getHeight() <= 0) return; - - mCallback.onResult(thumbnail); - } - - @Override - public int getIconSize() { - return mIconSize; + fadeThumbnailIn(thumbnail); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PickerBitmap.java b/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PickerBitmap.java index 6b75031f..ed34853c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PickerBitmap.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PickerBitmap.java
@@ -11,6 +11,8 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import java.text.DateFormat; +import java.util.Date; /** * A class to keep track of the meta data associated with a an image in the photo picker. @@ -56,6 +58,24 @@ } /** + * Accessor for the filename. + * @return The filename (without the extension and path). + */ + public String getFilenameWithoutExtension() { + int index = mFilePath.lastIndexOf("/"); + if (index == -1) return mFilePath; + return mFilePath.substring(index + 1, mFilePath.length()); + } + + /** + * Accessor for the last modified date. + * @return The last modified date in string format. + */ + public String getLastModifiedString() { + return DateFormat.getDateTimeInstance().format(new Date(mLastModified)); + } + + /** * Accessor for the tile type. * @return The type of tile involved for this bitmap object. */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PickerBitmapView.java b/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PickerBitmapView.java index efe355a..737a216 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PickerBitmapView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PickerBitmapView.java
@@ -14,6 +14,7 @@ import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; +import android.view.accessibility.AccessibilityNodeInfo; import android.view.animation.Animation; import android.view.animation.ScaleAnimation; import android.widget.ImageView; @@ -178,6 +179,19 @@ } } + @Override + public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { + super.onInitializeAccessibilityNodeInfo(info); + + if (!isPictureTile()) return; + + info.setCheckable(true); + info.setChecked(isChecked()); + CharSequence text = mBitmapDetails.getFilenameWithoutExtension() + " " + + mBitmapDetails.getLastModifiedString(); + info.setText(text); + } + /** * Sets the {@link PickerCategoryView} for this PickerBitmapView. * @param categoryView The category view showing the images. Used to access
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java index 1b4964b4..abcd8fb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java
@@ -306,12 +306,18 @@ } /** + * Notify subclasses that browsing data is about to be cleared. + */ + protected void onClearBrowsingData() {} + + /** * Requests the browsing data corresponding to the given dialog options to be deleted. * @param options The dialog options whose corresponding data should be deleted. */ private final void clearBrowsingData(EnumSet<DialogOption> options, @Nullable String[] blacklistedDomains, @Nullable int[] blacklistedDomainReasons, @Nullable String[] ignoredDomains, @Nullable int[] ignoredDomainReasons) { + onClearBrowsingData(); showProgressDialog(); RecordHistogram.recordMediumTimesHistogram("History.ClearBrowsingData.TimeSpentInDialog",
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesAdvanced.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesAdvanced.java index 68ed1acb..80e98e21e7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesAdvanced.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesAdvanced.java
@@ -4,6 +4,8 @@ package org.chromium.chrome.browser.preferences.privacy; +import org.chromium.base.metrics.RecordHistogram; +import org.chromium.base.metrics.RecordUserAction; import org.chromium.chrome.browser.browsing_data.ClearBrowsingDataTab; /** @@ -25,4 +27,12 @@ DialogOption.CLEAR_PASSWORDS, DialogOption.CLEAR_FORM_DATA, DialogOption.CLEAR_SITE_SETTINGS}; } + + @Override + protected void onClearBrowsingData() { + super.onClearBrowsingData(); + RecordHistogram.recordEnumeratedHistogram("History.ClearBrowsingData.UserDeletedFromTab", + ClearBrowsingDataTab.ADVANCED, ClearBrowsingDataTab.NUM_TYPES); + RecordUserAction.record("ClearBrowsingData_AdvancedTab"); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesBasic.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesBasic.java index 657f19a1..37feae63b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesBasic.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesBasic.java
@@ -6,6 +6,8 @@ import android.os.Bundle; +import org.chromium.base.metrics.RecordHistogram; +import org.chromium.base.metrics.RecordUserAction; import org.chromium.chrome.R; import org.chromium.chrome.browser.browsing_data.ClearBrowsingDataTab; import org.chromium.chrome.browser.preferences.ClearBrowsingDataTabCheckBoxPreference; @@ -70,4 +72,12 @@ protected int getPreferenceType() { return ClearBrowsingDataTab.BASIC; } + + @Override + protected void onClearBrowsingData() { + super.onClearBrowsingData(); + RecordHistogram.recordEnumeratedHistogram("History.ClearBrowsingData.UserDeletedFromTab", + ClearBrowsingDataTab.BASIC, ClearBrowsingDataTab.NUM_TYPES); + RecordUserAction.record("ClearBrowsingData_BasicTab"); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/rlz/RlzPingHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/rlz/RlzPingHandler.java index b6ab1f8..04d43c5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/rlz/RlzPingHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/rlz/RlzPingHandler.java
@@ -38,7 +38,7 @@ String id = new SettingsSecureBasedIdentificationGenerator(ContextUtils.getApplicationContext()) .getUniqueId(ID_SALT); - id = generate50CharacterId(id); + id = generate50CharacterId(id.toUpperCase(Locale.getDefault())); nativeStartPing(Profile.getLastUsedProfile().getOriginalProfile(), brand, Locale.getDefault().getLanguage(), TextUtils.join(",", events), id, callback);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/ImageFetcher.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/ImageFetcher.java new file mode 100644 index 0000000..cafe88e --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/ImageFetcher.java
@@ -0,0 +1,369 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.suggestions; + +import android.annotation.SuppressLint; +import android.graphics.Bitmap; +import android.os.SystemClock; + +import org.chromium.base.Callback; +import org.chromium.base.VisibleForTesting; +import org.chromium.base.metrics.RecordHistogram; +import org.chromium.chrome.browser.NativePageHost; +import org.chromium.chrome.browser.download.ui.ThumbnailProvider; +import org.chromium.chrome.browser.favicon.FaviconHelper; +import org.chromium.chrome.browser.favicon.LargeIconBridge; +import org.chromium.chrome.browser.ntp.cards.CardsVariationParameters; +import org.chromium.chrome.browser.ntp.snippets.FaviconFetchResult; +import org.chromium.chrome.browser.ntp.snippets.SnippetArticle; +import org.chromium.chrome.browser.ntp.snippets.SnippetsConfig; +import org.chromium.chrome.browser.ntp.snippets.SuggestionsSource; +import org.chromium.chrome.browser.profiles.Profile; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.concurrent.TimeUnit; + +/** + * Class responsible for fetching images for the views in the NewTabPage and Chrome Home. + * The images fetched by this class include: + * - favicons for content suggestions + * - thumbnails for content suggestions + * - large icons for URLs (used by the tiles in the NTP/Chrome Home) + * + * To fetch an image, the caller should create a request which is done in the following way: + * - for favicons: {@link #makeFaviconRequest(SnippetArticle, int, Callback)} + * - for article thumbnails: {@link #makeArticleThumbnailRequest(SnippetArticle, Callback)} + * - for article downloads: {@link #makeDownloadThumbnailRequest(SnippetArticle, int, Callback)} + * - for large icons: {@link #makeLargeIconRequest(String, int, + * LargeIconBridge.LargeIconCallback)} + * + * If there are no errors is the image fetching process, the corresponding bitmap will be returned + * in the callback. Otherwise, the callback will not be called. + */ +public class ImageFetcher { + /** Supported favicon sizes in pixels. */ + private static final int[] FAVICON_SERVICE_SUPPORTED_SIZES = {16, 24, 32, 48, 64}; + private static final String FAVICON_SERVICE_FORMAT = + "https://s2.googleusercontent.com/s2/favicons?domain=%s&src=chrome_newtab_mobile&sz=%d&alt=404"; + private static final int PUBLISHER_FAVICON_MINIMUM_SIZE_PX = 16; + + private final boolean mUseFaviconService; + private final NativePageHost mHost; + + private boolean mIsDestroyed; + + private final SuggestionsSource mSuggestionsSource; + private final Profile mProfile; + private ThumbnailProvider mThumbnailProvider; + private FaviconHelper mFaviconHelper; + private LargeIconBridge mLargeIconBridge; + + public ImageFetcher(SuggestionsSource suggestionsSource, Profile profile, NativePageHost host) { + mSuggestionsSource = suggestionsSource; + mProfile = profile; + mUseFaviconService = CardsVariationParameters.isFaviconServiceEnabled(); + mHost = host; + } + + /** + * Creates a request for a thumbnail from a downloaded image. + * + * If there is an error while fetching the thumbnail, the callback will not be called. + * + * @param suggestion The suggestion for which a thumbnail is needed. + * @param thumbnailSizePx The required size for the thumbnail. + * @param imageCallback The callback where the bitmap will be returned when fetched. + * @return The request which will be used to fetch the image. + */ + public DownloadThumbnailRequest makeDownloadThumbnailRequest( + SnippetArticle suggestion, int thumbnailSizePx, Callback<Bitmap> imageCallback) { + assert !mIsDestroyed; + + return new DownloadThumbnailRequest(suggestion, imageCallback, thumbnailSizePx); + } + + /** + * Creates a request for an article thumbnail. + * + * If there is an error while fetching the thumbnail, the callback will not be called. + * + * @param suggestion The article for which a thumbnail is needed. + * @param callback The callback where the bitmap will be returned when fetched. + */ + public void makeArticleThumbnailRequest(SnippetArticle suggestion, Callback<Bitmap> callback) { + assert !mIsDestroyed; + + mSuggestionsSource.fetchSuggestionImage(suggestion, callback); + } + + /** + * Creates a request for favicon for the URL of a suggestion. + * + * If there is an error while fetching the favicon, the callback will not be called. + * + * @param suggestion The suggestion whose URL needs a favicon. + * @param faviconSizePx The required size for the favicon. + * @param faviconCallback The callback where the bitmap will be returned when fetched. + */ + public void makeFaviconRequest(SnippetArticle suggestion, final int faviconSizePx, + final Callback<Bitmap> faviconCallback) { + assert !mIsDestroyed; + + long faviconFetchStartTimeMs = SystemClock.elapsedRealtime(); + URI pageUrl; + + try { + pageUrl = new URI(suggestion.getUrl()); + } catch (URISyntaxException e) { + assert false; + return; + } + + if (!suggestion.isArticle() || !SnippetsConfig.isFaviconsFromNewServerEnabled()) { + // The old code path. Remove when the experiment is successful. + // Currently, we have to use this for non-articles, due to privacy. + fetchFaviconFromLocalCache(pageUrl, true, faviconFetchStartTimeMs, faviconSizePx, + suggestion, faviconCallback); + } else { + // The new code path. + fetchFaviconFromLocalCacheOrGoogleServer( + suggestion, faviconFetchStartTimeMs, faviconCallback); + } + } + + /** + * Gets the large icon (e.g. favicon or touch icon) for a given URL. + * + * If there is an error while fetching the icon, the callback will not be called. + * + * @param url The URL of the site whose icon is being requested. + * @param size The desired size of the icon in pixels. + * @param callback The callback to be notified when the icon is available. + */ + public void makeLargeIconRequest( + String url, int size, LargeIconBridge.LargeIconCallback callback) { + assert !mIsDestroyed; + + getLargeIconBridge().getLargeIconForUrl(url, size, callback); + } + + public void onDestroy() { + if (mFaviconHelper != null) { + mFaviconHelper.destroy(); + mFaviconHelper = null; + } + + if (mLargeIconBridge != null) { + mLargeIconBridge.destroy(); + mLargeIconBridge = null; + } + + if (mThumbnailProvider != null) { + mThumbnailProvider.destroy(); + mThumbnailProvider = null; + } + + mIsDestroyed = true; + } + + private void fetchFaviconFromLocalCache(final URI snippetUri, final boolean fallbackToService, + final long faviconFetchStartTimeMs, final int faviconSizePx, + final SnippetArticle suggestion, final Callback<Bitmap> faviconCallback) { + getFaviconHelper().getLocalFaviconImageForURL(mProfile, getSnippetDomain(snippetUri), + faviconSizePx, new FaviconHelper.FaviconImageCallback() { + @Override + public void onFaviconAvailable(Bitmap image, String iconUrl) { + if (image != null) { + assert faviconCallback != null; + + faviconCallback.onResult(image); + recordFaviconFetchResult(suggestion, + fallbackToService ? FaviconFetchResult.SUCCESS_CACHED + : FaviconFetchResult.SUCCESS_FETCHED, + faviconFetchStartTimeMs); + } else if (fallbackToService) { + if (!fetchFaviconFromService(suggestion, snippetUri, + faviconFetchStartTimeMs, faviconSizePx, faviconCallback)) { + recordFaviconFetchResult(suggestion, FaviconFetchResult.FAILURE, + faviconFetchStartTimeMs); + } + } + } + }); + } + + private void fetchFaviconFromLocalCacheOrGoogleServer(SnippetArticle suggestion, + final long faviconFetchStartTimeMs, final Callback<Bitmap> faviconCallback) { + // Set the desired size to 0 to specify we do not want to resize in c++, we'll resize here. + mSuggestionsSource.fetchSuggestionFavicon(suggestion, PUBLISHER_FAVICON_MINIMUM_SIZE_PX, + /* desiredSizePx */ 0, new Callback<Bitmap>() { + @Override + public void onResult(Bitmap image) { + recordFaviconFetchTime(faviconFetchStartTimeMs); + if (image == null) return; + faviconCallback.onResult(image); + } + }); + } + + // TODO(crbug.com/635567): Fix this properly. + @SuppressLint("DefaultLocale") + private boolean fetchFaviconFromService(final SnippetArticle suggestion, final URI snippetUri, + final long faviconFetchStartTimeMs, final int faviconSizePx, + final Callback<Bitmap> faviconCallback) { + if (!mUseFaviconService) return false; + int sizePx = getFaviconServiceSupportedSize(faviconSizePx); + if (sizePx == 0) return false; + + // Replace the default icon by another one from the service when it is fetched. + ensureIconIsAvailable( + getSnippetDomain(snippetUri), // Store to the cache for the whole domain. + String.format(FAVICON_SERVICE_FORMAT, snippetUri.getHost(), sizePx), + /* useLargeIcon = */ false, /* isTemporary = */ true, + new FaviconHelper.IconAvailabilityCallback() { + @Override + public void onIconAvailabilityChecked(boolean newlyAvailable) { + if (!newlyAvailable) { + recordFaviconFetchResult(suggestion, FaviconFetchResult.FAILURE, + faviconFetchStartTimeMs); + return; + } + // The download succeeded, the favicon is in the cache; fetch it. + fetchFaviconFromLocalCache(snippetUri, /* fallbackToService = */ false, + faviconFetchStartTimeMs, faviconSizePx, suggestion, + faviconCallback); + } + }); + return true; + } + + private void recordFaviconFetchTime(long faviconFetchStartTimeMs) { + RecordHistogram.recordMediumTimesHistogram( + "NewTabPage.ContentSuggestions.ArticleFaviconFetchTime", + SystemClock.elapsedRealtime() - faviconFetchStartTimeMs, TimeUnit.MILLISECONDS); + } + + private void recordFaviconFetchResult(SnippetArticle suggestion, @FaviconFetchResult int result, + long faviconFetchStartTimeMs) { + // Record the histogram for articles only to have a fair comparision. + if (!suggestion.isArticle()) return; + RecordHistogram.recordEnumeratedHistogram( + "NewTabPage.ContentSuggestions.ArticleFaviconFetchResult", result, + FaviconFetchResult.COUNT); + recordFaviconFetchTime(faviconFetchStartTimeMs); + } + + /** + * Checks if an icon with the given URL is available. If not, + * downloads it and stores it as a favicon/large icon for the given {@code pageUrl}. + * @param pageUrl The URL of the site whose icon is being requested. + * @param iconUrl The URL of the favicon/large icon. + * @param isLargeIcon Whether the {@code iconUrl} represents a large icon or favicon. + * @param callback The callback to be notified when the favicon has been checked. + */ + private void ensureIconIsAvailable(String pageUrl, String iconUrl, boolean isLargeIcon, + boolean isTemporary, FaviconHelper.IconAvailabilityCallback callback) { + if (mHost.getActiveTab().getWebContents() != null) { + getFaviconHelper().ensureIconIsAvailable(mProfile, + mHost.getActiveTab().getWebContents(), pageUrl, iconUrl, isLargeIcon, + isTemporary, callback); + } + } + + private int getFaviconServiceSupportedSize(int faviconSizePX) { + // Take the smallest size larger than mFaviconSizePx. + for (int size : FAVICON_SERVICE_SUPPORTED_SIZES) { + if (size > faviconSizePX) return size; + } + // Or at least the largest available size (unless too small). + int largestSize = + FAVICON_SERVICE_SUPPORTED_SIZES[FAVICON_SERVICE_SUPPORTED_SIZES.length - 1]; + if (faviconSizePX <= largestSize * 1.5) return largestSize; + return 0; + } + + public static String getSnippetDomain(URI snippetUri) { + return String.format("%s://%s", snippetUri.getScheme(), snippetUri.getHost()); + } + + /** + * Utility method to lazily create the {@link ThumbnailProvider}, and avoid unnecessary native + * calls in tests. + */ + private ThumbnailProvider getThumbnailProvider() { + if (mThumbnailProvider == null) { + mThumbnailProvider = + SuggestionsDependencyFactory.getInstance().createThumbnailProvider(); + } + return mThumbnailProvider; + } + + /** + * Utility method to lazily create the {@link FaviconHelper}, and avoid unnecessary native + * calls in tests. + */ + @VisibleForTesting + protected FaviconHelper getFaviconHelper() { + if (mFaviconHelper == null) { + mFaviconHelper = SuggestionsDependencyFactory.getInstance().createFaviconHelper(); + } + return mFaviconHelper; + } + + /** + * Utility method to lazily create the {@link LargeIconBridge}, and avoid unnecessary native + * calls in tests. + */ + @VisibleForTesting + protected LargeIconBridge getLargeIconBridge() { + if (mLargeIconBridge == null) { + mLargeIconBridge = + SuggestionsDependencyFactory.getInstance().createLargeIconBridge(mProfile); + } + return mLargeIconBridge; + } + + /** + * Request for a download thumbnail. + * + * Cancellation of the request is available through {@link #cancel(), which will remove the + * request from the ThumbnailProvider queue}. + */ + public class DownloadThumbnailRequest implements ThumbnailProvider.ThumbnailRequest { + private final SnippetArticle mSuggestion; + private final Callback<Bitmap> mCallback; + private final int mSize; + + DownloadThumbnailRequest(SnippetArticle suggestion, Callback<Bitmap> callback, int size) { + mSuggestion = suggestion; + mCallback = callback; + mSize = size; + + // Fetch the download thumbnail. + getThumbnailProvider().getThumbnail(this); + } + + @Override + public String getFilePath() { + return mSuggestion.getAssetDownloadFile().getAbsolutePath(); + } + + @Override + public void onThumbnailRetrieved(String filePath, Bitmap thumbnail) { + mCallback.onResult(thumbnail); + } + + @Override + public int getIconSize() { + return mSize; + } + + public void cancel() { + if (mIsDestroyed) return; + getThumbnailProvider().cancelRetrieval(this); + } + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsDependencyFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsDependencyFactory.java index a7d66e9..72655767 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsDependencyFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsDependencyFactory.java
@@ -6,6 +6,9 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.VisibleForTesting; +import org.chromium.chrome.browser.download.ui.ThumbnailProvider; +import org.chromium.chrome.browser.download.ui.ThumbnailProviderImpl; +import org.chromium.chrome.browser.favicon.FaviconHelper; import org.chromium.chrome.browser.favicon.LargeIconBridge; import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge; import org.chromium.chrome.browser.ntp.snippets.SuggestionsSource; @@ -49,4 +52,12 @@ public LargeIconBridge createLargeIconBridge(Profile profile) { return new LargeIconBridge(profile); } + + public ThumbnailProvider createThumbnailProvider() { + return new ThumbnailProviderImpl(); + } + + public FaviconHelper createFaviconHelper() { + return new FaviconHelper(); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsUiDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsUiDelegate.java index 43a7df84..e502ccc 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsUiDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsUiDelegate.java
@@ -5,10 +5,6 @@ package org.chromium.chrome.browser.suggestions; import org.chromium.base.DiscardableReferencePool; -import org.chromium.chrome.browser.download.ui.ThumbnailProvider; -import org.chromium.chrome.browser.favicon.FaviconHelper.FaviconImageCallback; -import org.chromium.chrome.browser.favicon.FaviconHelper.IconAvailabilityCallback; -import org.chromium.chrome.browser.favicon.LargeIconBridge.LargeIconCallback; import org.chromium.chrome.browser.ntp.snippets.SuggestionsSource; /** @@ -31,8 +27,8 @@ /** Convenience method to access the {@link SuggestionsNavigationDelegate}. */ SuggestionsNavigationDelegate getNavigationDelegate(); - /** Convenience method to access the {@link ThumbnailProvider} */ - ThumbnailProvider getThumbnailProvider(); + /** Convenience method to access the {@link ImageFetcher} */ + ImageFetcher getImageFetcher(); /** * @return The reference pool to use for large objects that should be dropped under @@ -40,35 +36,6 @@ */ DiscardableReferencePool getReferencePool(); - // Favicons - - /** - * Checks if an icon with the given URL is available. If not, - * downloads it and stores it as a favicon/large icon for the given {@code pageUrl}. - * @param pageUrl The URL of the site whose icon is being requested. - * @param iconUrl The URL of the favicon/large icon. - * @param isLargeIcon Whether the {@code iconUrl} represents a large icon or favicon. - * @param callback The callback to be notified when the favicon has been checked. - */ - void ensureIconIsAvailable(String pageUrl, String iconUrl, boolean isLargeIcon, - boolean isTemporary, IconAvailabilityCallback callback); - - /** - * Gets the large icon (e.g. favicon or touch icon) for a given URL. - * @param url The URL of the site whose icon is being requested. - * @param size The desired size of the icon in pixels. - * @param callback The callback to be notified when the icon is available. - */ - void getLargeIconForUrl(String url, int size, LargeIconCallback callback); - - /** - * Gets the favicon image for a given URL. - * @param url The URL of the site whose favicon is being requested. - * @param size The desired size of the favicon in pixels. - * @param faviconCallback The callback to be notified when the favicon is available. - */ - void getLocalFaviconImageForURL(String url, int size, FaviconImageCallback faviconCallback); - // Feature/State checks /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsUiDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsUiDelegateImpl.java index 2595e9a..d2400589 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsUiDelegateImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsUiDelegateImpl.java
@@ -8,13 +8,6 @@ import org.chromium.base.DiscardableReferencePool; import org.chromium.chrome.browser.NativePageHost; -import org.chromium.chrome.browser.download.ui.ThumbnailProvider; -import org.chromium.chrome.browser.download.ui.ThumbnailProviderImpl; -import org.chromium.chrome.browser.favicon.FaviconHelper; -import org.chromium.chrome.browser.favicon.FaviconHelper.FaviconImageCallback; -import org.chromium.chrome.browser.favicon.FaviconHelper.IconAvailabilityCallback; -import org.chromium.chrome.browser.favicon.LargeIconBridge; -import org.chromium.chrome.browser.favicon.LargeIconBridge.LargeIconCallback; import org.chromium.chrome.browser.ntp.snippets.SuggestionsSource; import org.chromium.chrome.browser.profiles.Profile; @@ -30,18 +23,11 @@ private final SuggestionsRanker mSuggestionsRanker; private final SuggestionsEventReporter mSuggestionsEventReporter; private final SuggestionsNavigationDelegate mSuggestionsNavigationDelegate; - - private final Profile mProfile; - private final NativePageHost mHost; + private final ImageFetcher mImageFetcher; private final DiscardableReferencePool mReferencePool; - private final ThumbnailProvider mThumbnailProvider; - - private FaviconHelper mFaviconHelper; - private LargeIconBridge mLargeIconBridge; - private boolean mIsDestroyed; public SuggestionsUiDelegateImpl(SuggestionsSource suggestionsSource, @@ -52,9 +38,8 @@ mSuggestionsRanker = new SuggestionsRanker(); mSuggestionsEventReporter = eventReporter; mSuggestionsNavigationDelegate = navigationDelegate; - mThumbnailProvider = new ThumbnailProviderImpl(); + mImageFetcher = new ImageFetcher(suggestionsSource, profile, host); - mProfile = profile; mHost = host; mReferencePool = referencePool; @@ -62,30 +47,6 @@ } @Override - public void getLocalFaviconImageForURL( - String url, int size, FaviconImageCallback faviconCallback) { - if (mIsDestroyed) return; - getFaviconHelper().getLocalFaviconImageForURL(mProfile, url, size, faviconCallback); - } - - @Override - public void getLargeIconForUrl(String url, int size, LargeIconCallback callback) { - if (mIsDestroyed) return; - getLargeIconBridge().getLargeIconForUrl(url, size, callback); - } - - @Override - public void ensureIconIsAvailable(String pageUrl, String iconUrl, boolean isLargeIcon, - boolean isTemporary, IconAvailabilityCallback callback) { - if (mIsDestroyed) return; - if (mHost.getActiveTab() != null) { - getFaviconHelper().ensureIconIsAvailable(mProfile, - mHost.getActiveTab().getWebContents(), pageUrl, iconUrl, isLargeIcon, - isTemporary, callback); - } - } - - @Override public SuggestionsSource getSuggestionsSource() { return mSuggestionsSource; } @@ -108,8 +69,8 @@ } @Override - public ThumbnailProvider getThumbnailProvider() { - return mThumbnailProvider; + public ImageFetcher getImageFetcher() { + return mImageFetcher; } @Override @@ -131,39 +92,10 @@ public void onDestroy() { assert !mIsDestroyed; + mImageFetcher.onDestroy(); + for (DestructionObserver observer : mDestructionObservers) observer.onDestroy(); - if (mFaviconHelper != null) { - mFaviconHelper.destroy(); - mFaviconHelper = null; - } - if (mLargeIconBridge != null) { - mLargeIconBridge.destroy(); - mLargeIconBridge = null; - } mIsDestroyed = true; } - - /** - * Utility method to lazily create the {@link FaviconHelper}, and avoid unnecessary native - * calls in tests. - */ - private FaviconHelper getFaviconHelper() { - assert !mIsDestroyed; - if (mFaviconHelper == null) mFaviconHelper = new FaviconHelper(); - return mFaviconHelper; - } - - /** - * Utility method to lazily create the {@link LargeIconBridge}, and avoid unnecessary native - * calls in tests. - */ - private LargeIconBridge getLargeIconBridge() { - assert !mIsDestroyed; - if (mLargeIconBridge == null) { - mLargeIconBridge = - SuggestionsDependencyFactory.getInstance().createLargeIconBridge(mProfile); - } - return mLargeIconBridge; - } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGroup.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGroup.java index 5e41939..2842181 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGroup.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGroup.java
@@ -250,7 +250,7 @@ LargeIconCallback iconCallback = new LargeIconCallbackImpl(siteUrl, /* trackLoadTask = */ false); - mUiDelegate.getLargeIconForUrl(siteUrl, mMinIconSize, iconCallback); + mUiDelegate.getImageFetcher().makeLargeIconRequest(siteUrl, mMinIconSize, iconCallback); } /** @@ -338,7 +338,8 @@ private void loadWhitelistIcon(final Tile tile, final LargeIconCallback iconCallback) { if (tile.getWhitelistIconPath().isEmpty()) { - mUiDelegate.getLargeIconForUrl(tile.getUrl(), mMinIconSize, iconCallback); + mUiDelegate.getImageFetcher().makeLargeIconRequest( + tile.getUrl(), mMinIconSize, iconCallback); return; } @@ -355,7 +356,8 @@ @Override protected void onPostExecute(Bitmap icon) { if (icon == null) { - mUiDelegate.getLargeIconForUrl(tile.getUrl(), mMinIconSize, iconCallback); + mUiDelegate.getImageFetcher().makeLargeIconRequest( + tile.getUrl(), mMinIconSize, iconCallback); } else { iconCallback.onLargeIconAvailable(icon, Color.BLACK, false); } @@ -387,8 +389,8 @@ } if (countChanged) mObserver.onTileCountChanged(); - if (isInitialLoad) mObserver.onLoadTaskCompleted(); mObserver.onTileDataChanged(); + if (isInitialLoad) mObserver.onLoadTaskCompleted(); } /** @return A tile matching the provided URL, or {@code null} if none is found. */ @@ -412,32 +414,33 @@ @Override public void onLargeIconAvailable( @Nullable Bitmap icon, int fallbackColor, boolean isFallbackColorDefault) { - if (mTrackLoadTask) mObserver.onLoadTaskCompleted(); - Tile tile = getTile(mUrl); - if (tile == null) return; // The tile might have been removed. + if (tile != null) { // The tile might have been removed. + if (icon == null) { + mIconGenerator.setBackgroundColor(fallbackColor); + icon = mIconGenerator.generateIconForUrl(mUrl); + tile.setIcon(new BitmapDrawable(mContext.getResources(), icon)); + tile.setType(isFallbackColorDefault ? TileVisualType.ICON_DEFAULT + : TileVisualType.ICON_COLOR); + } else { + RoundedBitmapDrawable roundedIcon = + RoundedBitmapDrawableFactory.create(mContext.getResources(), icon); + int cornerRadius = Math.round(ICON_CORNER_RADIUS_DP + * mContext.getResources().getDisplayMetrics().density * icon.getWidth() + / mDesiredIconSize); + roundedIcon.setCornerRadius(cornerRadius); + roundedIcon.setAntiAlias(true); + roundedIcon.setFilterBitmap(true); - if (icon == null) { - mIconGenerator.setBackgroundColor(fallbackColor); - icon = mIconGenerator.generateIconForUrl(mUrl); - tile.setIcon(new BitmapDrawable(mContext.getResources(), icon)); - tile.setType(isFallbackColorDefault ? TileVisualType.ICON_DEFAULT - : TileVisualType.ICON_COLOR); - } else { - RoundedBitmapDrawable roundedIcon = - RoundedBitmapDrawableFactory.create(mContext.getResources(), icon); - int cornerRadius = Math.round(ICON_CORNER_RADIUS_DP - * mContext.getResources().getDisplayMetrics().density * icon.getWidth() - / mDesiredIconSize); - roundedIcon.setCornerRadius(cornerRadius); - roundedIcon.setAntiAlias(true); - roundedIcon.setFilterBitmap(true); + tile.setIcon(roundedIcon); + tile.setType(TileVisualType.ICON_REAL); + } - tile.setIcon(roundedIcon); - tile.setType(TileVisualType.ICON_REAL); + mObserver.onTileIconChanged(tile); } - mObserver.onTileIconChanged(tile); + // This call needs to be made after the tiles are completely initialised, for UMA. + if (mTrackLoadTask) mObserver.onLoadTaskCompleted(); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/BrowserControlsVisibilityDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/BrowserControlsVisibilityDelegate.java index 6c483906..2204235 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/BrowserControlsVisibilityDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/BrowserControlsVisibilityDelegate.java
@@ -9,12 +9,13 @@ */ public interface BrowserControlsVisibilityDelegate { /** - * @return Whether hiding browser controls is enabled or not. + * @return Whether browser controls can be shown. */ - boolean isHidingBrowserControlsEnabled(); + boolean canShowBrowserControls(); /** - * @return Whether showing browser controls is enabled or not. + * @return Whether browser controls can be auto-hidden + * (e.g. in response to user scroll). */ - boolean isShowingBrowserControlsEnabled(); + boolean canAutoHideBrowserControls(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java index 26e30c3..7eb8dd1 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java
@@ -4,6 +4,7 @@ package org.chromium.chrome.browser.tab; +import org.chromium.base.ThreadUtils; import org.chromium.base.VisibleForTesting; import org.chromium.base.metrics.RecordHistogram; import org.chromium.chrome.R; @@ -24,6 +25,10 @@ * Class that controls navigations and allows to intercept them. It is used on Android to 'convert' * certain navigations to Intents to 3rd party applications and to "pause" navigations when data use * tracking has ended. + * Note the Intent is often created together with a new empty tab which then shoud be closed + * immediately. Closing the tab will cancel the navigation that this delegate is running for, + * hence can cause UAF error. It should be done in an asynchronous fashion to avoid it. + * See https://crbug.com/732260. */ public class InterceptNavigationDelegateImpl implements InterceptNavigationDelegate { private final Tab mTab; @@ -243,7 +248,14 @@ // crbug.com/487938. mTab.getActivity().moveTaskToBack(false); } - mTab.getTabModelSelector().closeTab(mTab); + // Defer closing a tab (and the associated WebContents) till the navigation + // request and the throttle finishes the job with it. + ThreadUtils.postOnUiThread(new Runnable() { + @Override + public void run() { + mTab.getTabModelSelector().closeTab(mTab); + } + }); } else if (mTab.getTabRedirectHandler().isOnNavigation()) { int lastCommittedEntryIndexBeforeNavigation = mTab.getTabRedirectHandler() .getLastCommittedEntryIndexBeforeStartingNavigation();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java index 2609171..05424a1 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
@@ -2599,8 +2599,8 @@ /** * @return Whether hiding browser controls is enabled or not. */ - private boolean isHidingBrowserControlsEnabled() { - return mBrowserControlsVisibilityDelegate.isHidingBrowserControlsEnabled(); + private boolean canAutoHideBrowserControls() { + return mBrowserControlsVisibilityDelegate.canAutoHideBrowserControls(); } /** @@ -2622,8 +2622,8 @@ /** * @return Whether showing browser controls is enabled or not. */ - public boolean isShowingBrowserControlsEnabled() { - return mBrowserControlsVisibilityDelegate.isShowingBrowserControlsEnabled(); + public boolean canShowBrowserControls() { + return mBrowserControlsVisibilityDelegate.canShowBrowserControls(); } /** @@ -2633,9 +2633,9 @@ @BrowserControlsState public int getBrowserControlsStateConstraints() { int constraints = BrowserControlsState.BOTH; - if (!isShowingBrowserControlsEnabled()) { + if (!canShowBrowserControls()) { constraints = BrowserControlsState.HIDDEN; - } else if (!isHidingBrowserControlsEnabled()) { + } else if (!canAutoHideBrowserControls()) { constraints = BrowserControlsState.SHOWN; } return constraints;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabStateBrowserControlsVisibilityDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabStateBrowserControlsVisibilityDelegate.java index 7545ba4..35a74d17 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabStateBrowserControlsVisibilityDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabStateBrowserControlsVisibilityDelegate.java
@@ -131,7 +131,7 @@ } @Override - public boolean isHidingBrowserControlsEnabled() { + public boolean canAutoHideBrowserControls() { WebContents webContents = mTab.getWebContents(); if (webContents == null || webContents.isDestroyed()) return false; @@ -159,7 +159,7 @@ } @Override - public boolean isShowingBrowserControlsEnabled() { + public boolean canShowBrowserControls() { if (mTab.getFullscreenManager() == null) return true; return !mTab.getFullscreenManager().getPersistentFullscreenMode(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrCoreVersionChecker.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrCoreVersionChecker.java index 46852a7..636f0c93 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrCoreVersionChecker.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrCoreVersionChecker.java
@@ -12,8 +12,12 @@ public static final String VR_CORE_PACKAGE_ID = "com.google.vr.vrcore"; /** - * Returns the version of VrCore (if it is installed) and the compatibility of VrCore with - * Chrome. + * Returns the compatibility of VrCore with Chrome. */ - VrCoreInfo getVrCoreInfo(); + int getVrCoreCompatibility(); + + /** + * Returns a native VrCoreInfo object. + */ + long makeNativeVrCoreInfo(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrCoreVersionCheckerImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrCoreVersionCheckerImpl.java index 72fec4a..603c7845 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrCoreVersionCheckerImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrCoreVersionCheckerImpl.java
@@ -24,7 +24,6 @@ private static final String MIN_SDK_VERSION_PARAM_NAME = "min_sdk_version"; - @Override public VrCoreInfo getVrCoreInfo() { // Supported Build version is determined by the webvr cardboard support feature. // Default is KITKAT unless specified via server side finch config. @@ -60,4 +59,14 @@ return new VrCoreInfo(null, VrCoreCompatibility.VR_NOT_AVAILABLE); } } + + @Override + public int getVrCoreCompatibility() { + return getVrCoreInfo().compatibility; + } + + @Override + public long makeNativeVrCoreInfo() { + return getVrCoreInfo().makeNativeVrCoreInfo(); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java index a99c7ca6..9a70b610 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
@@ -99,6 +99,7 @@ "org.chromium.chrome.browser.vr_shell.VrEntryResult"; private static final long REENTER_VR_TIMEOUT_MS = 1000; + private static final int EXPECT_DON_TIMEOUT_MS = 2000; private static final String FEEDBACK_REPORT_TYPE = "USER_INITIATED_FEEDBACK_REPORT_VR"; @@ -132,6 +133,8 @@ private boolean mInVr; private final Handler mEnterVrHandler; + private final Handler mExpectPauseOrDonSucceeded; + private boolean mProbablyInDon; // Whether or not the VR Device ON flow succeeded. If this is true it means the user has a VR // headset on, but we haven't switched into VR mode yet. @@ -150,6 +153,7 @@ private Integer mRestoreOrientation = null; private long mNativeVrShellDelegate; private boolean mRequestedWebVr; + private boolean mRequestedWebVrBeforePause; private long mLastVrExit; private boolean mListeningForWebVrActivate; private boolean mListeningForWebVrActivateBeforePause; @@ -179,12 +183,16 @@ assert sInstance != null; if (sInstance == null) return; sInstance.mDonSucceeded = true; + sInstance.mProbablyInDon = false; + sInstance.mExpectPauseOrDonSucceeded.removeCallbacksAndMessages(null); if (sInstance.mPaused) { if (sInstance.mInVrAtChromeLaunch == null) sInstance.mInVrAtChromeLaunch = false; // We add a black overlay view so that we can show black while the VR UI is loading. // Note that this alone isn't sufficient to prevent 2D UI from showing while // resuming the Activity, see the comment about the custom animation below. - sInstance.addOverlayView(); + // However, if we're already in VR (in one of the cases where we chose not to exit + // VR before the DON flow), we don't need to add the overlay. + if (!sInstance.mInVr) sInstance.addOverlayView(); // We start the Activity with a custom animation that keeps it hidden for a few // hundred milliseconds - enough time for us to draw the first black view. @@ -192,9 +200,9 @@ // transition animation (I couldn't), then we can just make it indefinite until the // VR UI is ready, and then cancel it, rather than trying to guess how long it will // take to draw the first view, and possibly adding latency to VR startup. + int animation = sInstance.mInVr ? 0 : R.anim.stay_hidden; Bundle options = - ActivityOptions.makeCustomAnimation(activity, R.anim.stay_hidden, 0) - .toBundle(); + ActivityOptions.makeCustomAnimation(activity, animation, 0).toBundle(); ((ActivityManager) activity.getSystemService(Context.ACTIVITY_SERVICE)) .moveTaskToFront(activity.getTaskId(), 0, options); } else { @@ -473,6 +481,7 @@ createNonPresentingNativeContext(); mFeedbackFrequency = VrFeedbackStatus.getFeedbackFrequency(); mEnterVrHandler = new Handler(); + mExpectPauseOrDonSucceeded = new Handler(); Choreographer.getInstance().postFrameCallback(new FrameCallback() { @Override public void doFrame(long frameTimeNanos) { @@ -485,6 +494,7 @@ } }); ApplicationStatus.registerStateListenerForAllActivities(this); + if (!mPaused) onResume(); } @Override @@ -507,8 +517,6 @@ mShouldShowPageInfo = false; onExitVrResult(true); } else { - // We should never reach this state currently, but just in case... - assert false; shutdownVr(true /* disableVrMode */, false /* canReenter */, false /* stayingInChrome */); } @@ -564,11 +572,16 @@ return mVrSupportLevel == VR_DAYDREAM; } - private void maybeSetPresentResult(boolean result) { - if (mNativeVrShellDelegate != 0 && mRequestedWebVr) { - nativeSetPresentResult(mNativeVrShellDelegate, result); + private void maybeSetPresentResult(boolean result, boolean donCompleted) { + if (mNativeVrShellDelegate == 0 || !mRequestedWebVr) return; + if (!result) { + nativeSetPresentResult(mNativeVrShellDelegate, false); + mRequestedWebVr = false; + } else if (!isDaydreamCurrentViewer() || donCompleted) { + // Wait until DON success to report presentation success. + nativeSetPresentResult(mNativeVrShellDelegate, true); + mRequestedWebVr = false; } - mRequestedWebVr = false; } /** @@ -644,14 +657,17 @@ cancelPendingVrEntry(); return; } + mInVr = true; + boolean donSuceeded = mDonSucceeded; + mDonSucceeded = false; if (!createVrShell()) { - maybeSetPresentResult(false); + maybeSetPresentResult(false, donSuceeded); mVrDaydreamApi.launchVrHomescreen(); cancelPendingVrEntry(); + mInVr = false; return; } mVrClassesWrapper.setVrModeEnabled(mActivity, true); - mInVr = true; mShouldShowPageInfo = false; shutdownNonPresentingNativeContext(); @@ -671,9 +687,26 @@ // properly. if (!mPaused) mVrShell.resume(); - maybeSetPresentResult(true); + maybeSetPresentResult(true, donSuceeded); mVrShell.getContainer().setOnSystemUiVisibilityChangeListener(this); removeOverlayView(); + if (!donSuceeded && !mAutopresentWebVr && isDaydreamCurrentViewer()) { + // TODO(mthiesse): This is a VERY dirty hack. We need to know whether or not entering VR + // will trigger the DON flow, so that we can wait for it to complete before we let the + // webVR page know that it can present. However, Daydream APIs currently make this + // impossible for apps to know, so if the DON hasn't started after a delay we just + // assume it will never start. Once we know whether or not entering VR will trigger the + // DON flow, we should remove this. See b/63116739. + mProbablyInDon = true; + mExpectPauseOrDonSucceeded.postDelayed(new Runnable() { + @Override + public void run() { + mProbablyInDon = false; + mDonSucceeded = true; + handleDonFlowSuccess(); + } + }, EXPECT_DON_TIMEOUT_MS); + } } private void onAutopresentIntent() { @@ -755,15 +788,15 @@ switch (enterVrInternal()) { case ENTER_VR_NOT_NECESSARY: mVrShell.setWebVrModeEnabled(true, true); - maybeSetPresentResult(true); + maybeSetPresentResult(true, true); break; case ENTER_VR_CANCELLED: - maybeSetPresentResult(false); + maybeSetPresentResult(false, mDonSucceeded); break; case ENTER_VR_REQUESTED: break; case ENTER_VR_SUCCEEDED: - maybeSetPresentResult(true); + maybeSetPresentResult(true, mDonSucceeded); break; default: Log.e(TAG, "Unexpected enum."); @@ -776,10 +809,10 @@ */ @EnterVRResult private int enterVrInternal() { + if (mInVr) return ENTER_VR_NOT_NECESSARY; // Update VR support level as it can change at runtime updateVrSupportLevel(); if (mVrSupportLevel == VR_NOT_AVAILABLE) return ENTER_VR_CANCELLED; - if (mInVr) return ENTER_VR_NOT_NECESSARY; if (!canEnterVr(mActivity.getActivityTab())) return ENTER_VR_CANCELLED; enterVr(false); return ENTER_VR_REQUESTED; @@ -827,11 +860,6 @@ }); } - if (mInVr) { - mVrShell.resume(); - return; - } - // This handles the case where we're already in VR, and an NFC scan is received that pauses // and resumes Chrome without going through the DON flow or firing the DON success intent. if (isDaydreamCurrentViewer() @@ -839,26 +867,36 @@ mDonSucceeded = true; } + if (mInVr) { + mVrShell.resume(); + } + if (mDonSucceeded) { handleDonFlowSuccess(); } else if (mRestoreOrientation != null) { // This means the user backed out of the DON flow, and we won't be entering VR. - maybeSetPresentResult(false); - restoreWindowMode(); + maybeSetPresentResult(false, mDonSucceeded); + shutdownVr(true, false, false); } } private void handleDonFlowSuccess() { - mDonSucceeded = false; + if (mInVr) { + maybeSetPresentResult(true, mDonSucceeded); + mDonSucceeded = false; + return; + } // If we fail to enter VR when we should have entered VR, return to the home screen. if (!mInVr && !enterVrAfterDon()) { cancelPendingVrEntry(); - maybeSetPresentResult(false); + maybeSetPresentResult(false, mDonSucceeded); mVrDaydreamApi.launchVrHomescreen(); + mDonSucceeded = false; } } private void onPause() { + mExpectPauseOrDonSucceeded.removeCallbacksAndMessages(null); mPaused = true; unregisterDaydreamIntent(mVrDaydreamApi); if (mVrSupportLevel == VR_NOT_AVAILABLE) return; @@ -884,7 +922,7 @@ // We defer pausing of VrShell until the app is stopped to keep head tracking working for // as long as possible while going to daydream home. if (mInVr) mVrShell.pause(); - if (mShowingDaydreamDoff) return; + if (mShowingDaydreamDoff || mProbablyInDon) return; // TODO(mthiesse): When the user resumes Chrome in a 2D context, we don't want to tear down // VR UI, so for now, exit VR. @@ -1004,7 +1042,6 @@ return; } mInVr = false; - mRequestedWebVr = false; mAutopresentWebVr = false; mLastVrExit = canReenter ? SystemClock.uptimeMillis() : 0; @@ -1120,7 +1157,7 @@ private static boolean isVrCoreCompatible( final VrCoreVersionChecker versionChecker, final Tab tabToShowInfobarIn) { - final int vrCoreCompatibility = versionChecker.getVrCoreInfo().compatibility; + final int vrCoreCompatibility = versionChecker.getVrCoreCompatibility(); boolean needsUpdate = vrCoreCompatibility == VrCoreCompatibility.VR_NOT_AVAILABLE || vrCoreCompatibility == VrCoreCompatibility.VR_OUT_OF_DATE; if (tabToShowInfobarIn != null && needsUpdate) { @@ -1292,7 +1329,7 @@ @CalledByNative private long getVrCoreInfo() { assert mVrCoreVersionChecker != null; - return mVrCoreVersionChecker.getVrCoreInfo().makeNativeVrCoreInfo(); + return mVrCoreVersionChecker.makeNativeVrCoreInfo(); } private void destroy() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/FullScreenDelegateFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/FullScreenDelegateFactory.java index f590ec131..a91116a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/FullScreenDelegateFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/FullScreenDelegateFactory.java
@@ -27,8 +27,8 @@ public BrowserControlsVisibilityDelegate createBrowserControlsVisibilityDelegate(Tab tab) { return new TabStateBrowserControlsVisibilityDelegate(tab) { @Override - public boolean isHidingBrowserControlsEnabled() { - return !isShowingBrowserControlsEnabled(); + public boolean canAutoHideBrowserControls() { + return false; } }; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappBrowserControlsDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappBrowserControlsDelegate.java index 8693831d..bfed06f5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappBrowserControlsDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappBrowserControlsDelegate.java
@@ -20,16 +20,16 @@ } @Override - public boolean isShowingBrowserControlsEnabled() { - if (!super.isShowingBrowserControlsEnabled()) return false; + public boolean canShowBrowserControls() { + if (!super.canShowBrowserControls()) return false; return shouldShowBrowserControls( mActivity.getWebappInfo(), mTab.getUrl(), mTab.getSecurityLevel()); } @Override - public boolean isHidingBrowserControlsEnabled() { - return !isShowingBrowserControlsEnabled(); + public boolean canAutoHideBrowserControls() { + return false; } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java index d39e39e..7089239b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java
@@ -251,7 +251,7 @@ String url = IntentUtils.safeGetStringExtra(intent, ShortcutHelper.EXTRA_URL); if (TextUtils.isEmpty(url)) return false; - if (!webApkPackage.equals(WebApkValidator.queryWebApkPackage(this, url))) { + if (!WebApkValidator.canWebApkHandleUrl(this, webApkPackage, url)) { Log.d(TAG, "%s is not within scope of %s WebAPK", url, webApkPackage); return false; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java index 1805022..042d3ec8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java
@@ -361,7 +361,7 @@ @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { - if (!isTouchInSwipableXRange(e2)) return false; + if (!isTouchInSwipableXRange(e2) || !mIsScrolling) return false; cancelAnimation(); boolean wasOpenBeforeSwipe = mIsSheetOpen;
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index 48e8f351..c76bfb3a 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -1021,6 +1021,7 @@ "java/src/org/chromium/chrome/browser/snackbar/undo/UndoBarController.java", "java/src/org/chromium/chrome/browser/ssl/SecurityStateModel.java", "java/src/org/chromium/chrome/browser/suggestions/DestructionObserver.java", + "java/src/org/chromium/chrome/browser/suggestions/ImageFetcher.java", "java/src/org/chromium/chrome/browser/suggestions/MostVisitedSites.java", "java/src/org/chromium/chrome/browser/suggestions/MostVisitedSitesBridge.java", "java/src/org/chromium/chrome/browser/suggestions/SuggestionsBottomSheetContent.java", @@ -1157,7 +1158,6 @@ "java/src/org/chromium/chrome/browser/util/ViewUtils.java", "java/src/org/chromium/chrome/browser/vr_shell/NonPresentingGvrContext.java", "java/src/org/chromium/chrome/browser/vr_shell/VrClassesWrapper.java", - "java/src/org/chromium/chrome/browser/vr_shell/VrCoreInfo.java", "java/src/org/chromium/chrome/browser/vr_shell/VrCoreVersionChecker.java", "java/src/org/chromium/chrome/browser/vr_shell/VrDaydreamApi.java", "java/src/org/chromium/chrome/browser/vr_shell/VrFeedbackStatus.java", @@ -1299,6 +1299,7 @@ chrome_vr_java_sources = [ "java/src/org/chromium/chrome/browser/vr_shell/NonPresentingGvrContextImpl.java", "java/src/org/chromium/chrome/browser/vr_shell/VrClassesWrapperImpl.java", + "java/src/org/chromium/chrome/browser/vr_shell/VrCoreInfo.java", "java/src/org/chromium/chrome/browser/vr_shell/VrCoreVersionCheckerImpl.java", "java/src/org/chromium/chrome/browser/vr_shell/VrDaydreamApiImpl.java", "java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java", @@ -1490,6 +1491,7 @@ "javatests/src/org/chromium/chrome/browser/notifications/channels/SiteChannelsManagerTest.java", "javatests/src/org/chromium/chrome/browser/ntp/NewTabPageNavigationTest.java", "javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java", + "javatests/src/org/chromium/chrome/browser/ntp/NewTabPageLoadTest.java", "javatests/src/org/chromium/chrome/browser/ntp/RecentTabsPageTest.java", "javatests/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerViewTest.java", "javatests/src/org/chromium/chrome/browser/ntp/snippets/ArticleSnippetsTest.java", @@ -1804,6 +1806,7 @@ "junit/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferencesManagerTest.java", "junit/src/org/chromium/chrome/browser/preferences/password/PasswordReauthenticationFragmentTest.java", "junit/src/org/chromium/chrome/browser/snackbar/SnackbarCollectionUnitTest.java", + "junit/src/org/chromium/chrome/browser/suggestions/ImageFetcherTest.java", "junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java", "junit/src/org/chromium/chrome/browser/suggestions/TileTest.java", "junit/src/org/chromium/chrome/browser/superviseduser/SupervisedUserContentProviderUnitTest.java", @@ -1816,20 +1819,6 @@ "junit/src/org/chromium/chrome/browser/widget/selection/SelectionDelegateTest.java", ] -sync_shell_test_java_sources = [ - "sync_shell/javatests/src/org/chromium/chrome/browser/sync/AutofillTest.java", - "sync_shell/javatests/src/org/chromium/chrome/browser/sync/BookmarksTest.java", - "sync_shell/javatests/src/org/chromium/chrome/browser/sync/FakeServerHelper.java", - "sync_shell/javatests/src/org/chromium/chrome/browser/sync/FirstRunTest.java", - "sync_shell/javatests/src/org/chromium/chrome/browser/sync/GmsCoreSyncListenerTest.java", - "sync_shell/javatests/src/org/chromium/chrome/browser/sync/OpenTabsTest.java", - "sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncCustomizationFragmentTest.java", - "sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncTest.java", - "sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncTestBase.java", - "sync_shell/javatests/src/org/chromium/chrome/browser/sync/TypedUrlsTest.java", - "sync_shell/javatests/src/org/chromium/chrome/browser/sync/ui/PassphraseTypeDialogFragmentTest.java", -] - # Only used for testing, should not be shipped to end users. if (enable_offline_pages_harness) { chrome_java_sources += [ "java/src/org/chromium/chrome/browser/offlinepages/evaluation/OfflinePageEvaluationBridge.java" ]
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/NavigateTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/NavigateTest.java index 22990c6..dedc9d68 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/NavigateTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/NavigateTest.java
@@ -177,11 +177,9 @@ @MediumTest @Feature({"Navigation"}) public void testNavigateMany() throws Exception { - final String[] urls = { - mTestServer.getURL("/chrome/test/data/android/navigate/one.html"), - mTestServer.getURL("/chrome/test/data/android/navigate/two.html"), - mTestServer.getURL("/chrome/test/data/android/navigate/three.html") - }; + final String[] urls = mTestServer.getURLs("/chrome/test/data/android/navigate/one.html", + "/chrome/test/data/android/navigate/two.html", + "/chrome/test/data/android/navigate/three.html"); final String[] titles = {"One", "Two", "Three"}; final int repeats = 3;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageLoadTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageLoadTest.java new file mode 100644 index 0000000..d7160ac --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageLoadTest.java
@@ -0,0 +1,119 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.ntp; + +import static junit.framework.Assert.assertTrue; + +import static org.junit.Assert.assertNotEquals; + +import android.graphics.Bitmap; +import android.os.Handler; +import android.support.test.InstrumentationRegistry; +import android.support.test.filters.SmallTest; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.chrome.browser.ChromeSwitches; +import org.chromium.chrome.browser.UrlConstants; +import org.chromium.chrome.browser.favicon.LargeIconBridge; +import org.chromium.chrome.browser.suggestions.FakeMostVisitedSites; +import org.chromium.chrome.browser.suggestions.TileVisualType; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.test.ChromeActivityTestRule; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.chrome.test.ChromeTabbedActivityTestRule; +import org.chromium.chrome.test.util.NewTabPageTestUtils; +import org.chromium.chrome.test.util.browser.suggestions.SuggestionsDependenciesRule; +import org.chromium.net.test.EmbeddedTestServer; + +import java.io.IOException; + +/** + * Tests for events around the loading of a New Tab Page. + */ +@RunWith(ChromeJUnit4ClassRunner.class) +@CommandLineFlags.Add({ + ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, + ChromeActivityTestRule.DISABLE_NETWORK_PREDICTION_FLAG, +}) +public class NewTabPageLoadTest { + @Rule + public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); + + @Rule + public SuggestionsDependenciesRule mSuggestionDeps = new SuggestionsDependenciesRule(); + + private Tab mTab; + private EmbeddedTestServer mTestServer; + private AutoVerifyingMostVisitedSites mMostVisitedSites; + + @Before + public void setUp() throws Exception { + mTestServer = EmbeddedTestServer.createAndStartServer( + InstrumentationRegistry.getInstrumentation().getContext()); + + mMostVisitedSites = new AutoVerifyingMostVisitedSites(); + mMostVisitedSites.setTileSuggestions(mTestServer.getURLs("/site1", "/site2")); + mSuggestionDeps.getFactory().mostVisitedSites = mMostVisitedSites; + + mSuggestionDeps.getFactory().largeIconBridge = new AsyncMockLargeIconBridge(); + + mActivityTestRule.startMainActivityOnBlankPage(); + mTab = mActivityTestRule.getActivity().getActivityTab(); + } + + @After + public void tearDown() throws Exception { + mTestServer.stopAndDestroyServer(); + } + + @Test + @SmallTest + public void testTilesTypeInitialisedWhenPageLoaded() throws IOException, InterruptedException { + mActivityTestRule.loadUrl(UrlConstants.NTP_URL); + NewTabPageTestUtils.waitForNtpLoaded(mTab); + assertTrue(mMostVisitedSites.pageImpressionRecorded); + } + + private static class AutoVerifyingMostVisitedSites extends FakeMostVisitedSites { + public boolean pageImpressionRecorded; + + @Override + public void recordPageImpression(int tilesCount) { + pageImpressionRecorded = true; + } + + @Override + public void recordTileImpression(int index, int type, int source, String url) { + assertNotEquals(TileVisualType.NONE, type); + } + } + + private static class AsyncMockLargeIconBridge extends LargeIconBridge { + @Override + public boolean getLargeIconForUrl(String pageUrl, int desiredSizePx, + final LargeIconBridge.LargeIconCallback callback) { + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + callback.onLargeIconAvailable( + Bitmap.createBitmap(148, 148, Bitmap.Config.ALPHA_8), 0, false); + } + }, 0); + + return true; + } + + @Override + public void destroy() { + // Empty to avoid calling nativeDestroy inappropriately. + } + } +}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerViewTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerViewTest.java index 33ab5216..b7b4abac 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerViewTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerViewTest.java
@@ -85,7 +85,7 @@ // We currently mix the fake and the snippets bridge, resulting in crashes with unregistered // categories. @CategoryInt - private static final int TEST_CATEGORY = KnownCategories.BOOKMARKS; + private static final int TEST_CATEGORY = KnownCategories.ARTICLES; private Tab mTab; private NewTabPage mNtp; @@ -98,7 +98,7 @@ public void setUp() throws Exception { mTestServer = EmbeddedTestServer.createAndStartServer( InstrumentationRegistry.getInstrumentation().getContext()); - mSiteSuggestionUrls = new String[] {mTestServer.getURL(TEST_PAGE)}; + mSiteSuggestionUrls = mTestServer.getURLs(TEST_PAGE); mMostVisitedSites = new FakeMostVisitedSites(); mMostVisitedSites.setTileSuggestions(FAKE_MOST_VISITED_TITLES, mSiteSuggestionUrls,
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/snippets/ArticleSnippetsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/snippets/ArticleSnippetsTest.java index f7d947d..fb3871b6 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/snippets/ArticleSnippetsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/snippets/ArticleSnippetsTest.java
@@ -21,6 +21,7 @@ import org.junit.rules.ExternalResource; import org.junit.runner.RunWith; +import org.chromium.base.Callback; import org.chromium.base.DiscardableReferencePool; import org.chromium.base.ThreadUtils; import org.chromium.base.annotations.SuppressFBWarnings; @@ -34,9 +35,7 @@ import org.chromium.chrome.browser.compositor.layouts.ChromeAnimation; import org.chromium.chrome.browser.download.ui.ThumbnailProvider; import org.chromium.chrome.browser.download.ui.ThumbnailProvider.ThumbnailRequest; -import org.chromium.chrome.browser.favicon.FaviconHelper.FaviconImageCallback; -import org.chromium.chrome.browser.favicon.FaviconHelper.IconAvailabilityCallback; -import org.chromium.chrome.browser.favicon.LargeIconBridge.LargeIconCallback; +import org.chromium.chrome.browser.favicon.LargeIconBridge; import org.chromium.chrome.browser.ntp.ContextMenuManager; import org.chromium.chrome.browser.ntp.ContextMenuManager.TouchEnabledDelegate; import org.chromium.chrome.browser.ntp.cards.NewTabPageAdapter; @@ -45,6 +44,7 @@ import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.suggestions.ContentSuggestionsAdditionalAction; import org.chromium.chrome.browser.suggestions.DestructionObserver; +import org.chromium.chrome.browser.suggestions.ImageFetcher; import org.chromium.chrome.browser.suggestions.SuggestionsEventReporter; import org.chromium.chrome.browser.suggestions.SuggestionsNavigationDelegate; import org.chromium.chrome.browser.suggestions.SuggestionsRanker; @@ -58,6 +58,7 @@ import org.chromium.chrome.test.util.RenderTestRule; import org.chromium.chrome.test.util.browser.suggestions.DummySuggestionsEventReporter; import org.chromium.chrome.test.util.browser.suggestions.FakeSuggestionsSource; +import org.chromium.chrome.test.util.browser.suggestions.SuggestionsDependenciesRule; import java.io.IOException; import java.util.ArrayList; @@ -73,6 +74,9 @@ ChromeActivityTestRule.DISABLE_NETWORK_PREDICTION_FLAG}) public class ArticleSnippetsTest { @Rule + public SuggestionsDependenciesRule mSuggestionsDeps = new SuggestionsDependenciesRule(); + + @Rule public ChromeActivityTestRule<ChromeActivity> mActivityTestRule = new ChromeActivityTestRule<>(ChromeActivity.class); @Rule @@ -142,7 +146,7 @@ mRenderTestRule.render(mRecyclerView.getChildAt(first), "short_snippet"); mRenderTestRule.render(mRecyclerView.getChildAt(first + 1), "long_snippet"); - int firstOfSecondCategory = first + 1 /* card 2 */ + 1 /* header */ + 1 /* card 3*/; + int firstOfSecondCategory = first + 1 /* card 2 */ + 1 /* header */ + 1 /* card 3 */; mRenderTestRule.render(mRecyclerView.getChildAt(firstOfSecondCategory), "minimal_snippet"); mRenderTestRule.render(mRecyclerView, "snippets"); @@ -304,9 +308,11 @@ @Before public void setUp() throws Exception { mActivityTestRule.startMainActivityOnBlankPage(); - mUiDelegate = new MockUiDelegate(); mThumbnailProvider = new MockThumbnailProvider(); mSnippetsSource = new FakeSuggestionsSource(); + mSuggestionsDeps.getFactory().thumbnailProvider = mThumbnailProvider; + mSuggestionsDeps.getFactory().suggestionsSource = mSnippetsSource; + mUiDelegate = new MockUiDelegate(); Bitmap favicon = BitmapFactory.decodeResource( mActivityTestRule.getActivity().getResources(), R.drawable.star_green); mSnippetsSource.setDefaultFavicon(favicon); @@ -349,38 +355,11 @@ * A SuggestionsUiDelegate to initialize our Adapter. */ private class MockUiDelegate implements SuggestionsUiDelegate { - private SuggestionsEventReporter mSuggestionsEventReporter = + private final SuggestionsEventReporter mSuggestionsEventReporter = new DummySuggestionsEventReporter(); - private SuggestionsRanker mSuggestionsRanker = new SuggestionsRanker(); + private final SuggestionsRanker mSuggestionsRanker = new SuggestionsRanker(); private final DiscardableReferencePool mReferencePool = new DiscardableReferencePool(); - - @Override - public void getLocalFaviconImageForURL( - final String url, int size, final FaviconImageCallback faviconCallback) { - // Run the callback asynchronously incase the caller made that assumption. - ThreadUtils.postOnUiThread(new Runnable(){ - @Override - public void run() { - // Return an arbitrary drawable. - faviconCallback.onFaviconAvailable( - BitmapFactory.decodeResource( - mActivityTestRule.getActivity().getResources(), - R.drawable.star_green), - url); - } - }); - } - - @Override - public void getLargeIconForUrl(String url, int size, LargeIconCallback callback) { - throw new UnsupportedOperationException(); - } - - @Override - public void ensureIconIsAvailable(String pageUrl, String iconUrl, boolean isLargeIcon, - boolean isTemporary, IconAvailabilityCallback callback) { - throw new UnsupportedOperationException(); - } + private final ImageFetcher mImageFetcher = new MockImageFetcher(mSnippetsSource); @Override public SuggestionsSource getSuggestionsSource() { @@ -416,8 +395,45 @@ } @Override - public ThumbnailProvider getThumbnailProvider() { - return mThumbnailProvider; + public ImageFetcher getImageFetcher() { + return mImageFetcher; + } + } + + private class MockImageFetcher extends ImageFetcher { + public MockImageFetcher(SuggestionsSource suggestionsSource) { + super(suggestionsSource, null, null); + } + + @Override + public void makeFaviconRequest(SnippetArticle suggestion, final int faviconSizePx, + final Callback<Bitmap> faviconCallback) { + // Run the callback asynchronously in case the caller made that assumption. + ThreadUtils.postOnUiThread(new Runnable() { + @Override + public void run() { + // Return an arbitrary drawable. + faviconCallback.onResult(BitmapFactory.decodeResource( + mActivityTestRule.getActivity().getResources(), R.drawable.star_green)); + } + }); + } + + @Override + public void makeLargeIconRequest(final String url, final int largeIconSizePx, + final LargeIconBridge.LargeIconCallback callback) { + // Run the callback asynchronously in case the caller made that assumption. + ThreadUtils.postOnUiThread(new Runnable() { + @Override + public void run() { + // Return an arbitrary drawable. + callback.onLargeIconAvailable( + BitmapFactory.decodeResource( + mActivityTestRule.getActivity().getResources(), + R.drawable.star_green), + largeIconSizePx, true); + } + }); } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java index 1c4cf2c3..57dcdfb 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java
@@ -76,9 +76,7 @@ mTestServer = EmbeddedTestServer.createAndStartServer( InstrumentationRegistry.getInstrumentation().getContext()); - mSiteSuggestionUrls = new String[] {mTestServer.getURL(FAKE_MOST_VISITED_URLS[0]), - mTestServer.getURL(FAKE_MOST_VISITED_URLS[1]), - mTestServer.getURL(FAKE_MOST_VISITED_URLS[2])}; + mSiteSuggestionUrls = mTestServer.getURLs(FAKE_MOST_VISITED_URLS); mMostVisitedSites = new FakeMostVisitedSites(); mSuggestionsDeps.getFactory().mostVisitedSites = mMostVisitedSites;
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegateTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegateTest.java index 337e3ab3..c99298ba 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegateTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegateTest.java
@@ -47,12 +47,12 @@ @Test @Feature("Fullscreen") public void testTransientShow() { - assertTrue(mDelegate.isHidingBrowserControlsEnabled()); + assertTrue(mDelegate.canAutoHideBrowserControls()); mDelegate.showControlsTransient(); - assertFalse(mDelegate.isHidingBrowserControlsEnabled()); + assertFalse(mDelegate.canAutoHideBrowserControls()); ShadowLooper.runUiThreadTasksIncludingDelayedTasks(); - assertTrue(mDelegate.isHidingBrowserControlsEnabled()); + assertTrue(mDelegate.canAutoHideBrowserControls()); verify(mCallback, times(2)).run(); } @@ -60,14 +60,14 @@ @Test @Feature("Fullscreen") public void testShowPersistentTokenWithDelayedHide() { - assertTrue(mDelegate.isHidingBrowserControlsEnabled()); + assertTrue(mDelegate.canAutoHideBrowserControls()); int token = mDelegate.showControlsPersistent(); - assertFalse(mDelegate.isHidingBrowserControlsEnabled()); + assertFalse(mDelegate.canAutoHideBrowserControls()); // Advance the clock to exceed the minimum show time. advanceTime(2 * MINIMUM_SHOW_DURATION_MS); - assertFalse(mDelegate.isHidingBrowserControlsEnabled()); + assertFalse(mDelegate.canAutoHideBrowserControls()); mDelegate.hideControlsPersistent(token); - assertTrue(mDelegate.isHidingBrowserControlsEnabled()); + assertTrue(mDelegate.canAutoHideBrowserControls()); verify(mCallback, times(2)).run(); } @@ -75,17 +75,17 @@ @Test @Feature("Fullscreen") public void testShowPersistentTokenWithImmediateHide() { - assertTrue(mDelegate.isHidingBrowserControlsEnabled()); + assertTrue(mDelegate.canAutoHideBrowserControls()); int token = mDelegate.showControlsPersistent(); - assertFalse(mDelegate.isHidingBrowserControlsEnabled()); + assertFalse(mDelegate.canAutoHideBrowserControls()); mDelegate.hideControlsPersistent(token); // If the controls are not shown for the mimimum allowed time, then a task is posted to // keep them shown for longer. Ensure the controls can not be hidden until this delayed // task has been run. - assertFalse(mDelegate.isHidingBrowserControlsEnabled()); + assertFalse(mDelegate.canAutoHideBrowserControls()); ShadowLooper.runUiThreadTasksIncludingDelayedTasks(); - assertTrue(mDelegate.isHidingBrowserControlsEnabled()); + assertTrue(mDelegate.canAutoHideBrowserControls()); verify(mCallback, times(2)).run(); } @@ -93,18 +93,18 @@ @Test @Feature("Fullscreen") public void testShowPersistentBeyondRequiredMinDurationAndShowTransient() { - assertTrue(mDelegate.isHidingBrowserControlsEnabled()); + assertTrue(mDelegate.canAutoHideBrowserControls()); int token = mDelegate.showControlsPersistent(); - assertFalse(mDelegate.isHidingBrowserControlsEnabled()); + assertFalse(mDelegate.canAutoHideBrowserControls()); // Advance the clock to exceed the minimum show time. advanceTime(2 * MINIMUM_SHOW_DURATION_MS); - assertFalse(mDelegate.isHidingBrowserControlsEnabled()); + assertFalse(mDelegate.canAutoHideBrowserControls()); // At this point, the controls have been shown long enough that the transient request will // be a no-op. mDelegate.showControlsTransient(); mDelegate.hideControlsPersistent(token); - assertTrue(mDelegate.isHidingBrowserControlsEnabled()); + assertTrue(mDelegate.canAutoHideBrowserControls()); verify(mCallback, times(2)).run(); } @@ -112,22 +112,22 @@ @Test @Feature("Fullscreen") public void testShowPersistentBelowRequiredMinDurationAndShowTransient() { - assertTrue(mDelegate.isHidingBrowserControlsEnabled()); + assertTrue(mDelegate.canAutoHideBrowserControls()); int token = mDelegate.showControlsPersistent(); - assertFalse(mDelegate.isHidingBrowserControlsEnabled()); + assertFalse(mDelegate.canAutoHideBrowserControls()); // Advance the clock but not beyond the min show duration. advanceTime((long) (0.5 * MINIMUM_SHOW_DURATION_MS)); - assertFalse(mDelegate.isHidingBrowserControlsEnabled()); + assertFalse(mDelegate.canAutoHideBrowserControls()); // At this point, the controls have not been shown long enough, so the transient request // will delay the ability to hide. mDelegate.showControlsTransient(); mDelegate.hideControlsPersistent(token); - assertFalse(mDelegate.isHidingBrowserControlsEnabled()); + assertFalse(mDelegate.canAutoHideBrowserControls()); // Run the pending tasks on the UI thread, which will include the transient delayed task. ShadowLooper.runUiThreadTasksIncludingDelayedTasks(); - assertTrue(mDelegate.isHidingBrowserControlsEnabled()); + assertTrue(mDelegate.canAutoHideBrowserControls()); verify(mCallback, times(2)).run(); } @@ -135,26 +135,26 @@ @Test @Feature("Fullscreen") public void testShowPersistentMultipleTimes() { - assertTrue(mDelegate.isHidingBrowserControlsEnabled()); + assertTrue(mDelegate.canAutoHideBrowserControls()); int firstToken = mDelegate.showControlsPersistent(); - assertFalse(mDelegate.isHidingBrowserControlsEnabled()); + assertFalse(mDelegate.canAutoHideBrowserControls()); int secondToken = mDelegate.showControlsPersistent(); - assertFalse(mDelegate.isHidingBrowserControlsEnabled()); + assertFalse(mDelegate.canAutoHideBrowserControls()); int thirdToken = mDelegate.showControlsPersistent(); - assertFalse(mDelegate.isHidingBrowserControlsEnabled()); + assertFalse(mDelegate.canAutoHideBrowserControls()); // Advance the clock to exceed the minimum show time. advanceTime(2 * MINIMUM_SHOW_DURATION_MS); - assertFalse(mDelegate.isHidingBrowserControlsEnabled()); + assertFalse(mDelegate.canAutoHideBrowserControls()); mDelegate.hideControlsPersistent(secondToken); - assertFalse(mDelegate.isHidingBrowserControlsEnabled()); + assertFalse(mDelegate.canAutoHideBrowserControls()); mDelegate.hideControlsPersistent(firstToken); - assertFalse(mDelegate.isHidingBrowserControlsEnabled()); + assertFalse(mDelegate.canAutoHideBrowserControls()); mDelegate.hideControlsPersistent(thirdToken); - assertTrue(mDelegate.isHidingBrowserControlsEnabled()); + assertTrue(mDelegate.canAutoHideBrowserControls()); verify(mCallback, times(2)).run(); }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java index 56cad4b..4cb032c 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java
@@ -73,6 +73,7 @@ import org.chromium.chrome.browser.suggestions.SuggestionsEventReporter; import org.chromium.chrome.browser.suggestions.SuggestionsRanker; import org.chromium.chrome.browser.suggestions.SuggestionsUiDelegate; +import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.test.util.browser.Features; import org.chromium.chrome.test.util.browser.suggestions.ContentSuggestionsTestUtils.CategoryInfoBuilder; import org.chromium.chrome.test.util.browser.suggestions.FakeSuggestionsSource; @@ -234,6 +235,10 @@ MockitoAnnotations.initMocks(this); ContextUtils.initApplicationContextForTests(RuntimeEnvironment.application); + // Make sure that isChromeHome() is current value set by the test, not the value saved in + // the shared preference. + // TODO(changwan): check if we can clear shared preferences for each test case. + FeatureUtilities.cacheChromeHomeEnabled(); // Set empty variation params for the test. CardsVariationParameters.setTestVariationParams(new HashMap<String, String>());
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/ImageFetcherTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/ImageFetcherTest.java new file mode 100644 index 0000000..68dae9d --- /dev/null +++ b/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/ImageFetcherTest.java
@@ -0,0 +1,139 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.suggestions; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +import static org.chromium.chrome.test.util.browser.suggestions.ContentSuggestionsTestUtils.createDummySuggestion; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.robolectric.annotation.Config; + +import org.chromium.base.Callback; +import org.chromium.chrome.browser.DisableHistogramsRule; +import org.chromium.chrome.browser.NativePageHost; +import org.chromium.chrome.browser.download.ui.ThumbnailProvider; +import org.chromium.chrome.browser.favicon.FaviconHelper; +import org.chromium.chrome.browser.favicon.FaviconHelper.FaviconImageCallback; +import org.chromium.chrome.browser.favicon.LargeIconBridge; +import org.chromium.chrome.browser.favicon.LargeIconBridge.LargeIconCallback; +import org.chromium.chrome.browser.ntp.cards.CardsVariationParameters; +import org.chromium.chrome.browser.ntp.snippets.KnownCategories; +import org.chromium.chrome.browser.ntp.snippets.SnippetArticle; +import org.chromium.chrome.browser.ntp.snippets.SuggestionsSource; +import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.chrome.browser.suggestions.ImageFetcher.DownloadThumbnailRequest; +import org.chromium.chrome.test.util.browser.suggestions.SuggestionsDependenciesRule; +import org.chromium.testing.local.LocalRobolectricTestRunner; + +import java.net.URI; +import java.util.HashMap; +/** + * Unit tests for {@link ImageFetcher}. + */ +@RunWith(LocalRobolectricTestRunner.class) +@Config(manifest = Config.NONE) +public class ImageFetcherTest { + public static final int IMAGE_SIZE_PX = 100; + public static final String URL_STRING = "http://www.test.com"; + @Rule + public DisableHistogramsRule disableHistogramsRule = new DisableHistogramsRule(); + + @Rule + public SuggestionsDependenciesRule mSuggestionsDeps = new SuggestionsDependenciesRule(); + + @Mock + FaviconHelper mFaviconHelper; + @Mock + private ThumbnailProvider mThumbnailProvider; + @Mock + private SuggestionsSource mSuggestionsSource; + @Mock + private LargeIconBridge mLargeIconBridge; + + @Before + public void setUp() { + MockitoAnnotations.initMocks(this); + CardsVariationParameters.setTestVariationParams(new HashMap<String, String>()); + + mSuggestionsDeps.getFactory().largeIconBridge = mLargeIconBridge; + mSuggestionsDeps.getFactory().thumbnailProvider = mThumbnailProvider; + mSuggestionsDeps.getFactory().faviconHelper = mFaviconHelper; + mSuggestionsDeps.getFactory().suggestionsSource = mSuggestionsSource; + } + + @Test + public void testFaviconFetch() { + ImageFetcher imageFetcher = new ImageFetcher( + mSuggestionsSource, mock(Profile.class), mock(NativePageHost.class)); + + SnippetArticle suggestion = createDummySuggestion(KnownCategories.BOOKMARKS); + imageFetcher.makeFaviconRequest(suggestion, IMAGE_SIZE_PX, mock(Callback.class)); + + String expectedFaviconDomain = + ImageFetcher.getSnippetDomain(URI.create(suggestion.getUrl())); + verify(mFaviconHelper) + .getLocalFaviconImageForURL(any(Profile.class), eq(expectedFaviconDomain), + eq(IMAGE_SIZE_PX), any(FaviconImageCallback.class)); + } + + @Test + public void testDownloadThumbnailFetch() { + ImageFetcher imageFetcher = new ImageFetcher( + mSuggestionsSource, mock(Profile.class), mock(NativePageHost.class)); + + SnippetArticle suggestion = createDummySuggestion(KnownCategories.DOWNLOADS); + + DownloadThumbnailRequest request = imageFetcher.makeDownloadThumbnailRequest( + suggestion, IMAGE_SIZE_PX, mock(Callback.class)); + verify(mThumbnailProvider).getThumbnail(eq(request)); + + request.cancel(); + verify(mThumbnailProvider).cancelRetrieval(eq(request)); + } + + @Test + public void testArticleThumbnailFetch() { + ImageFetcher imageFetcher = new ImageFetcher( + mSuggestionsSource, mock(Profile.class), mock(NativePageHost.class)); + + SnippetArticle suggestion = createDummySuggestion(KnownCategories.ARTICLES); + imageFetcher.makeArticleThumbnailRequest(suggestion, mock(Callback.class)); + + verify(mSuggestionsSource).fetchSuggestionImage(eq(suggestion), any(Callback.class)); + } + + @Test + public void testLargeIconFetch() { + ImageFetcher imageFetcher = new ImageFetcher( + mSuggestionsSource, mock(Profile.class), mock(NativePageHost.class)); + + imageFetcher.makeLargeIconRequest(URL_STRING, IMAGE_SIZE_PX, mock(LargeIconCallback.class)); + + String expectedIconDomain = ImageFetcher.getSnippetDomain(URI.create(URL_STRING)); + verify(mLargeIconBridge) + .getLargeIconForUrl( + eq(expectedIconDomain), eq(IMAGE_SIZE_PX), any(LargeIconCallback.class)); + } + + @Test + public void testSnippetDomainExtraction() { + URI uri = URI.create(URL_STRING + "/test"); + + String expected = URL_STRING; + String actual = ImageFetcher.getSnippetDomain(uri); + + assertEquals(expected, actual); + } +}
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java index 542f25da..096e952 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java
@@ -197,10 +197,11 @@ @Test public void testRenderTileView() { - TileGroup tileGroup = - new TileGroup(RuntimeEnvironment.application, mock(SuggestionsUiDelegate.class), - mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, - mock(OfflinePageBridge.class), TILE_TITLE_LINES); + SuggestionsUiDelegate uiDelegate = mock(SuggestionsUiDelegate.class); + when(uiDelegate.getImageFetcher()).thenReturn(mock(ImageFetcher.class)); + TileGroup tileGroup = new TileGroup(RuntimeEnvironment.application, uiDelegate, + mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, + mock(OfflinePageBridge.class), TILE_TITLE_LINES); tileGroup.startObserving(MAX_TILES_TO_FETCH); ViewGroup layout = new FrameLayout(RuntimeEnvironment.application, null); @@ -216,10 +217,11 @@ @Test public void testRenderTileViewWithDuplicatedUrl() { - TileGroup tileGroup = - new TileGroup(RuntimeEnvironment.application, mock(SuggestionsUiDelegate.class), - mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, - mock(OfflinePageBridge.class), TILE_TITLE_LINES); + SuggestionsUiDelegate uiDelegate = mock(SuggestionsUiDelegate.class); + when(uiDelegate.getImageFetcher()).thenReturn(mock(ImageFetcher.class)); + TileGroup tileGroup = new TileGroup(RuntimeEnvironment.application, uiDelegate, + mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, + mock(OfflinePageBridge.class), TILE_TITLE_LINES); tileGroup.startObserving(MAX_TILES_TO_FETCH); ViewGroup layout = new FrameLayout(RuntimeEnvironment.application, null); @@ -235,10 +237,11 @@ @Test public void testRenderTileViewReplacing() { - TileGroup tileGroup = - new TileGroup(RuntimeEnvironment.application, mock(SuggestionsUiDelegate.class), - mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, - mock(OfflinePageBridge.class), TILE_TITLE_LINES); + SuggestionsUiDelegate uiDelegate = mock(SuggestionsUiDelegate.class); + when(uiDelegate.getImageFetcher()).thenReturn(mock(ImageFetcher.class)); + TileGroup tileGroup = new TileGroup(RuntimeEnvironment.application, uiDelegate, + mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, + mock(OfflinePageBridge.class), TILE_TITLE_LINES); tileGroup.startObserving(MAX_TILES_TO_FETCH); notifyTileUrlsAvailable(URLS); @@ -290,6 +293,7 @@ @Test public void testIconLoading() { SuggestionsUiDelegate uiDelegate = mock(SuggestionsUiDelegate.class); + when(uiDelegate.getImageFetcher()).thenReturn(mock(ImageFetcher.class)); TileGroup tileGroup = new TileGroup(RuntimeEnvironment.application, uiDelegate, mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, mock(OfflinePageBridge.class), TILE_TITLE_LINES); @@ -304,7 +308,8 @@ verify(mTileGroupObserver).onLoadTaskAdded(); ArgumentCaptor<LargeIconCallback> captor = ArgumentCaptor.forClass(LargeIconCallback.class); - verify(uiDelegate).getLargeIconForUrl(any(String.class), anyInt(), captor.capture()); + verify(uiDelegate.getImageFetcher()) + .makeLargeIconRequest(any(String.class), anyInt(), captor.capture()); for (LargeIconCallback cb : captor.getAllValues()) { cb.onLargeIconAvailable(mock(Bitmap.class), Color.BLACK, /* isColorDefault = */ false); } @@ -316,6 +321,7 @@ @Test public void testIconLoadingNoTask() { SuggestionsUiDelegate uiDelegate = mock(SuggestionsUiDelegate.class); + when(uiDelegate.getImageFetcher()).thenReturn(mock(ImageFetcher.class)); TileGroup tileGroup = new TileGroup(RuntimeEnvironment.application, uiDelegate, mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, mock(OfflinePageBridge.class), TILE_TITLE_LINES); @@ -330,7 +336,8 @@ verify(mTileGroupObserver, never()).onLoadTaskAdded(); ArgumentCaptor<LargeIconCallback> captor = ArgumentCaptor.forClass(LargeIconCallback.class); - verify(uiDelegate).getLargeIconForUrl(any(String.class), anyInt(), captor.capture()); + verify(uiDelegate.getImageFetcher()) + .makeLargeIconRequest(any(String.class), anyInt(), captor.capture()); for (LargeIconCallback cb : captor.getAllValues()) { cb.onLargeIconAvailable(mock(Bitmap.class), Color.BLACK, /* isColorDefault = */ false); } @@ -342,6 +349,7 @@ @Test public void testIconLoadingWhenTileNotRegistered() { SuggestionsUiDelegate uiDelegate = mock(SuggestionsUiDelegate.class); + when(uiDelegate.getImageFetcher()).thenReturn(mock(ImageFetcher.class)); TileGroup tileGroup = new TileGroup(RuntimeEnvironment.application, uiDelegate, mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, mock(OfflinePageBridge.class), TILE_TITLE_LINES); @@ -354,7 +362,8 @@ verify(mTileGroupObserver).onLoadTaskAdded(); ArgumentCaptor<LargeIconCallback> captor = ArgumentCaptor.forClass(LargeIconCallback.class); - verify(uiDelegate).getLargeIconForUrl(any(String.class), anyInt(), captor.capture()); + verify(uiDelegate.getImageFetcher()) + .makeLargeIconRequest(any(String.class), anyInt(), captor.capture()); captor.getValue().onLargeIconAvailable(mock(Bitmap.class), Color.BLACK, false); verify(mTileGroupObserver).onLoadTaskCompleted();
diff --git a/chrome/android/webapk/libs/client/junit/src/org/chromium/webapk/lib/client/WebApkValidatorTest.java b/chrome/android/webapk/libs/client/junit/src/org/chromium/webapk/lib/client/WebApkValidatorTest.java index 53ee432..9bb97730 100644 --- a/chrome/android/webapk/libs/client/junit/src/org/chromium/webapk/lib/client/WebApkValidatorTest.java +++ b/chrome/android/webapk/libs/client/junit/src/org/chromium/webapk/lib/client/WebApkValidatorTest.java
@@ -32,8 +32,6 @@ import org.chromium.testing.local.TestDir; import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.List; /** Unit tests for {@link org.chromium.webapk.lib.client.WebApkValidator}. */ @RunWith(LocalRobolectricTestRunner.class) @@ -140,64 +138,145 @@ } /** - * Tests {@link WebApkValidator.findWebApkPackage} returns the WebAPK package name if one of the - * ResolveInfos corresponds to a WebAPK and the WebAPK is valid. + * Tests {@link WebApkValidator.canWebApkHandleUrl()} returns true if the + * WebAPK can handle the given URL and the WebAPK is valid. */ @Test - public void testFindWebApkPackageReturnsPackageForValidWebApk() throws NameNotFoundException { - List<ResolveInfo> infos = new ArrayList<ResolveInfo>(); - infos.add(newResolveInfo(WEBAPK_PACKAGE_NAME)); + public void testCanWebApkHandleUrlReturnsTrueIfTheURLCanBeHandled() { + try { + Intent intent = Intent.parseUri(URL_OF_WEBAPK, Intent.URI_INTENT_SCHEME); + intent.addCategory(Intent.CATEGORY_BROWSABLE); + intent.setPackage(WEBAPK_PACKAGE_NAME); + + mPackageManager.addResolveInfoForIntent(intent, newResolveInfo(WEBAPK_PACKAGE_NAME)); + mPackageManager.addPackage(newPackageInfoWithBrowserSignature( + WEBAPK_PACKAGE_NAME, new Signature(EXPECTED_SIGNATURE))); + + assertTrue(WebApkValidator.canWebApkHandleUrl( + RuntimeEnvironment.application, WEBAPK_PACKAGE_NAME, URL_OF_WEBAPK)); + } catch (URISyntaxException e) { + Assert.fail("URI is invalid."); + } + } + + /** + * Tests {@link WebApkValidator.canWebApkHandleUrl()} returns false if the given APK package + * name is not signed with the WebAPK signature. + */ + @Test + public void testCanWebApkHandleUrlReturnsFalseIfWebApkIsNotValid() { + try { + Intent intent = Intent.parseUri(URL_OF_WEBAPK, Intent.URI_INTENT_SCHEME); + intent.addCategory(Intent.CATEGORY_BROWSABLE); + intent.setPackage(WEBAPK_PACKAGE_NAME); + + mPackageManager.addResolveInfoForIntent(intent, newResolveInfo(WEBAPK_PACKAGE_NAME)); + mPackageManager.addPackage(newPackageInfoWithBrowserSignature( + WEBAPK_PACKAGE_NAME, new Signature(SIGNATURE_1))); + + assertFalse(WebApkValidator.canWebApkHandleUrl( + RuntimeEnvironment.application, WEBAPK_PACKAGE_NAME, URL_OF_WEBAPK)); + } catch (URISyntaxException e) { + Assert.fail("URI is invalid."); + } + } + + /** + * Tests {@link WebApkValidator.canWebApkHandleUrl()} returns false for a non-browsable WebAPK. + */ + @Test + public void testCanWebApkHandleUrlReturnsFalseForNonBrowsableIntent() { + try { + Intent intent = Intent.parseUri(URL_OF_WEBAPK, Intent.URI_INTENT_SCHEME); + intent.setPackage(WEBAPK_PACKAGE_NAME); + + mPackageManager.addResolveInfoForIntent(intent, newResolveInfo(WEBAPK_PACKAGE_NAME)); + mPackageManager.addPackage(newPackageInfoWithBrowserSignature( + WEBAPK_PACKAGE_NAME, new Signature(EXPECTED_SIGNATURE))); + + assertFalse(WebApkValidator.canWebApkHandleUrl( + RuntimeEnvironment.application, WEBAPK_PACKAGE_NAME, URL_OF_WEBAPK)); + } catch (URISyntaxException e) { + Assert.fail("URI is invalid."); + } + } + + /** + * Tests {@link WebApkValidator.canWebApkHandleUrl()} returns false if the specific WebAPK does + * not handle the given URL. + */ + @Test + public void testCanWebApkHandleUrlReturnsFalseWhenNoWebApkHandlesTheURL() { + try { + Intent intent = Intent.parseUri(URL_OF_WEBAPK, Intent.URI_INTENT_SCHEME); + intent.addCategory(Intent.CATEGORY_BROWSABLE); + intent.setPackage(WEBAPK_PACKAGE_NAME); + + mPackageManager.addResolveInfoForIntent(intent, newResolveInfo(WEBAPK_PACKAGE_NAME)); + mPackageManager.addPackage(newPackageInfoWithBrowserSignature( + WEBAPK_PACKAGE_NAME, new Signature(EXPECTED_SIGNATURE))); + + assertFalse(WebApkValidator.canWebApkHandleUrl( + RuntimeEnvironment.application, WEBAPK_PACKAGE_NAME, URL_WITHOUT_WEBAPK)); + } catch (URISyntaxException e) { + Assert.fail("URI is invalid."); + } + } + + /** + * Tests {@link WebApkValidator.isValidWebApk} returns true if a package name corresponds to a + * WebAPK and the WebAPK is valid. + */ + @Test + public void testIsValidWebApkReturnsTrueForValidWebApk() throws NameNotFoundException { mPackageManager.addPackage(newPackageInfoWithBrowserSignature( WEBAPK_PACKAGE_NAME, new Signature(EXPECTED_SIGNATURE))); - assertEquals(WEBAPK_PACKAGE_NAME, - WebApkValidator.findWebApkPackage(RuntimeEnvironment.application, infos)); + assertTrue( + WebApkValidator.isValidWebApk(RuntimeEnvironment.application, WEBAPK_PACKAGE_NAME)); } /** - * Tests {@link WebApkValidator.findWebApkPackage} returns null if null if the package - * name is invalid. + * Tests {@link WebApkValidator.isValidWebApk} returns false if the package + * name is not valid for WebApks (and isn't comment-signed). */ @Test - public void testFindWebApkPackageReturnsNullForInvalidPackageName() { - List<ResolveInfo> infos = new ArrayList<ResolveInfo>(); - infos.add(newResolveInfo(INVALID_WEBAPK_PACKAGE_NAME)); + public void testIsValidWebApkFalseForInvalidPackageName() { mPackageManager.addPackage(newPackageInfoWithBrowserSignature( INVALID_WEBAPK_PACKAGE_NAME, new Signature(EXPECTED_SIGNATURE))); - assertNull(WebApkValidator.findWebApkPackage(RuntimeEnvironment.application, infos)); + assertFalse(WebApkValidator.isValidWebApk( + RuntimeEnvironment.application, INVALID_WEBAPK_PACKAGE_NAME)); } /** - * Tests {@link WebApkValidator.findWebApkPackage} returns null if a WebAPK has more than 2 + * Tests {@link WebApkValidator.isValidWebApk} returns false if a WebAPK has more than 2 * signatures, even if the second one matches the expected signature. */ @Test - public void testFindWebApkPackageReturnsNullForMoreThanTwoSignatures() + public void testIsValidWebApkReturnsFalseForMoreThanTwoSignatures() throws NameNotFoundException { - List<ResolveInfo> infos = new ArrayList<ResolveInfo>(); - infos.add(newResolveInfo(WEBAPK_PACKAGE_NAME)); Signature[] signatures = new Signature[] {new Signature(SIGNATURE_1), new Signature(EXPECTED_SIGNATURE), new Signature(SIGNATURE_2)}; mPackageManager.addPackage(newPackageInfo(WEBAPK_PACKAGE_NAME, signatures, null)); - assertNull(WebApkValidator.findWebApkPackage(RuntimeEnvironment.application, infos)); + assertFalse( + WebApkValidator.isValidWebApk(RuntimeEnvironment.application, WEBAPK_PACKAGE_NAME)); } /** - * Tests {@link WebApkValidator.findWebApkPackage} returns null if a WebAPK has multiple + * Tests {@link WebApkValidator.isValidWebApk} returns false if a WebAPK has multiple * signatures but none of the signatures match the expected signature. */ @Test - public void testFindWebApkPackageReturnsNullForWebApkWithMultipleSignaturesWithoutAnyMatched() + public void testIsValidWebApkReturnsFalseForWebApkWithMultipleSignaturesWithoutAnyMatched() throws NameNotFoundException { - List<ResolveInfo> infos = new ArrayList<ResolveInfo>(); - infos.add(newResolveInfo(WEBAPK_PACKAGE_NAME)); Signature signatures[] = new Signature[] {new Signature(SIGNATURE_1), new Signature(SIGNATURE_2)}; mPackageManager.addPackage(newPackageInfo(WEBAPK_PACKAGE_NAME, signatures, null)); - assertNull(WebApkValidator.findWebApkPackage(RuntimeEnvironment.application, infos)); + assertFalse( + WebApkValidator.isValidWebApk(RuntimeEnvironment.application, WEBAPK_PACKAGE_NAME)); } /**
diff --git a/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java b/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java index f62054e..2fc1e46 100644 --- a/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java +++ b/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
@@ -15,6 +15,7 @@ import android.content.pm.ResolveInfo; import android.content.pm.Signature; import android.os.StrictMode; +import android.support.annotation.Nullable; import android.text.TextUtils; import android.util.Log; @@ -56,7 +57,8 @@ * handled by a WebAPK. */ public static String queryWebApkPackage(Context context, String url) { - return findWebApkPackage(context, resolveInfosForUrl(context, url)); + return findWebApkPackage( + context, resolveInfosForUrlAndOptionalPackage(context, url, null /* package*/)); } /** @@ -72,33 +74,8 @@ * handled by a WebAPK. */ public static ResolveInfo queryResolveInfo(Context context, String url) { - return findResolveInfo(context, resolveInfosForUrl(context, url)); - } - - /** - * Fetches the list of resolve infos from the PackageManager that can handle the URL. - * - * @param context The application context. - * @param url The url to check. - * @return The list of resolve infos found that can handle the URL. - */ - private static List<ResolveInfo> resolveInfosForUrl(Context context, String url) { - Intent intent; - try { - intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME); - } catch (Exception e) { - return new LinkedList<>(); - } - - intent.addCategory(Intent.CATEGORY_BROWSABLE); - intent.setComponent(null); - Intent selector = intent.getSelector(); - if (selector != null) { - selector.addCategory(Intent.CATEGORY_BROWSABLE); - selector.setComponent(null); - } - return context.getPackageManager().queryIntentActivities( - intent, PackageManager.GET_RESOLVED_FILTER); + return findResolveInfo( + context, resolveInfosForUrlAndOptionalPackage(context, url, null /* package */)); } /** @@ -115,6 +92,49 @@ return null; } + public static boolean canWebApkHandleUrl(Context context, String webApkPackage, String url) { + List<ResolveInfo> infos = resolveInfosForUrlAndOptionalPackage(context, url, webApkPackage); + for (ResolveInfo info : infos) { + if (info.activityInfo != null + && isValidWebApk(context, info.activityInfo.packageName)) { + return true; + } + } + return false; + } + + /** + * Fetches the list of resolve infos from the PackageManager that can handle the URL. + * + * @param context The application context. + * @param url The url to check. + * @param applicationPackage The optional package name to set for intent resolution. + * @return The list of resolve infos found that can handle the URL. + */ + private static List<ResolveInfo> resolveInfosForUrlAndOptionalPackage( + Context context, String url, @Nullable String applicationPackage) { + Intent intent; + try { + intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME); + } catch (Exception e) { + return new LinkedList<>(); + } + + intent.addCategory(Intent.CATEGORY_BROWSABLE); + if (applicationPackage != null) { + intent.setPackage(applicationPackage); + } else { + intent.setComponent(null); + } + Intent selector = intent.getSelector(); + if (selector != null) { + selector.addCategory(Intent.CATEGORY_BROWSABLE); + selector.setComponent(null); + } + return context.getPackageManager().queryIntentActivities( + intent, PackageManager.GET_RESOLVED_FILTER); + } + /** * @param context The context to use to check whether WebAPK is valid. * @param infos The ResolveInfos to search.
diff --git a/chrome/android/webapk/shell_apk/shell_apk_version.gni b/chrome/android/webapk/shell_apk/shell_apk_version.gni index 23adf54..de66dac 100644 --- a/chrome/android/webapk/shell_apk/shell_apk_version.gni +++ b/chrome/android/webapk/shell_apk/shell_apk_version.gni
@@ -6,7 +6,7 @@ # (including AndroidManifest.xml) is updated. This version should be incremented # prior to uploading a new ShellAPK to the WebAPK Minting Server. # Does not affect Chrome.apk -template_shell_apk_version = 11 +template_shell_apk_version = 13 # The ShellAPK version expected by Chrome. Chrome will try to update the WebAPK # if the WebAPK's ShellAPK version is less than |expected_shell_apk_version|.
diff --git a/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/ChooseHostBrowserDialog.java b/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/ChooseHostBrowserDialog.java index dace205..7a86e61 100644 --- a/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/ChooseHostBrowserDialog.java +++ b/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/ChooseHostBrowserDialog.java
@@ -122,6 +122,12 @@ } }); + dialog.setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialogInterface) { + listener.onQuit(); + } + }); dialog.show(); };
diff --git a/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/InstallHostBrowserDialog.java b/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/InstallHostBrowserDialog.java index ddf8d39..105895b 100644 --- a/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/InstallHostBrowserDialog.java +++ b/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/InstallHostBrowserDialog.java
@@ -66,6 +66,12 @@ }); AlertDialog dialog = builder.create(); + dialog.setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialogInterface) { + listener.onConfirmQuit(); + } + }); dialog.show(); }; }
diff --git a/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/WebApkUtils.java b/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/WebApkUtils.java index a22a85f2..8fb7235 100644 --- a/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/WebApkUtils.java +++ b/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/WebApkUtils.java
@@ -160,8 +160,7 @@ /** Returns a list of ResolveInfo for all of the installed browsers. */ public static List<ResolveInfo> getInstalledBrowserResolveInfos(PackageManager packageManager) { Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://")); - return packageManager.queryIntentActivities( - browserIntent, PackageManager.MATCH_DEFAULT_ONLY); + return packageManager.queryIntentActivities(browserIntent, PackageManager.MATCH_ALL); } /**
diff --git a/chrome/app/bookmarks_strings.grdp b/chrome/app/bookmarks_strings.grdp index 2f545af..fbea426 100644 --- a/chrome/app/bookmarks_strings.grdp +++ b/chrome/app/bookmarks_strings.grdp
@@ -410,6 +410,9 @@ <message name="IDS_MD_BOOKMARK_MANAGER_MENU_SORT" desc="Title of the bookmark toolbar dropdown menu item that sorts bookmarks by title."> Sort by title </message> + <message name="IDS_MD_BOOKMARK_MANAGER_MORE_ACTIONS" desc="Tooltip of the button in the bookmark manager which shows an action menu for a bookmark, with actions like 'Edit' or 'Delete'"> + More actions... + </message> <message name="IDS_MD_BOOKMARK_MANAGER_NO_SEARCH_RESULTS" desc="Text on the bookmarks list that indicates that no bookmarks or folders match the search."> No search results found </message> @@ -436,6 +439,11 @@ <message name="IDS_MD_BOOKMARK_MANAGER_TOAST_URL_COPIED" desc="Label displayed in toast popup message when a URL is copied."> URL copied </message> + <message name="IDS_MD_BOOKMARK_MANAGER_TOAST_ITEMS_COPIED" desc="Label displayed in a toast popup message when several bookmark items are copied"> + {COUNT, plural, + =1 {'<ph name="COPIED_ITEM_NAME">$1</ph>' copied} + other {# items copied}} + </message> <!-- End of material design Bookmarks Manager strings. --> <!-- Begin of Bookmarks Menu (in the Main Menu) strings. -->
diff --git a/chrome/app/chrome_crash_reporter_client_win.cc b/chrome/app/chrome_crash_reporter_client_win.cc index 90c74c4..6cc0c91 100644 --- a/chrome/app/chrome_crash_reporter_client_win.cc +++ b/chrome/app/chrome_crash_reporter_client_win.cc
@@ -171,15 +171,18 @@ {"postmessage_script_info", kLargeSize}, // Temporary for https://crbug.com/668633. - {"swdh_set_hosted_version_worker_pid", crash_keys::kSmallSize}, - {"swdh_set_hosted_version_host_pid", crash_keys::kSmallSize}, - {"swdh_set_hosted_version_is_new_process", crash_keys::kSmallSize}, - {"swdh_set_hosted_version_restart_count", crash_keys::kSmallSize}, + {"swdh_set_hosted_version_worker_pid", kSmallSize}, + {"swdh_set_hosted_version_host_pid", kSmallSize}, + {"swdh_set_hosted_version_is_new_process", kSmallSize}, + {"swdh_set_hosted_version_restart_count", kSmallSize}, // Temporary for https://crbug.com/697745. - {"engine_params", crash_keys::kMediumSize}, - {"engine1_params", crash_keys::kMediumSize}, - {"engine2_params", crash_keys::kMediumSize}, + {"engine_params", kMediumSize}, + {"engine1_params", kMediumSize}, + {"engine2_params", kMediumSize}, + + // Temporary for https://crbug.com/685996. + {"user-cloud-policy-manager-connect-trace", kMediumSize}, }; // This dynamic set of keys is used for sets of key value pairs when gathering
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index 442e7ae..54baa96 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -2098,10 +2098,10 @@ <message name="IDS_SETTINGS_SITE_SETTINGS_FLASH_ASK_BEFORE_RUNNING_SUBTITLE" desc="The 'ask before running' subtitle label for Flash in site settings."> Ask before allowing sites to run Flash (recommended) </message> - <message name="IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_ALLOW_RECENTLY_CLOSED_SITES" desc="The allow label for background sync in site settings."> + <message name="IDS_SETTINGS_SITE_SETTINGS_ALLOW_RECENTLY_CLOSED_SITES" desc="The allow label for background sync in site settings."> Allow recently closed sites to finish sending and receiving data </message> - <message name="IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_ALLOW_RECENTLY_CLOSED_SITES_RECOMMENDED" desc="The allow label for background sync in site settings (with the 'recommended' suffix)."> + <message name="IDS_SETTINGS_SITE_SETTINGS_ALLOW_RECENTLY_CLOSED_SITES_RECOMMENDED" desc="The allow label for background sync in site settings (with the 'recommended' suffix)."> Allow recently closed sites to finish sending and receiving data (recommended) </message> <message name="IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_BLOCKED" desc="The block label for background sync in site settings.">
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index c183606..663e394f 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -1000,8 +1000,6 @@ "predictors/resource_prefetch_predictor_tables.h", "predictors/resource_prefetcher.cc", "predictors/resource_prefetcher.h", - "predictors/resource_prefetcher_manager.cc", - "predictors/resource_prefetcher_manager.h", "prefs/browser_prefs.cc", "prefs/browser_prefs.h", "prefs/chrome_command_line_pref_store.cc", @@ -2152,8 +2150,6 @@ "android/offline_pages/offline_page_info_handler.h", "android/offline_pages/offline_page_mhtml_archiver.cc", "android/offline_pages/offline_page_mhtml_archiver.h", - "android/offline_pages/offline_page_model_factory.cc", - "android/offline_pages/offline_page_model_factory.h", "android/offline_pages/offline_page_request_interceptor.cc", "android/offline_pages/offline_page_request_interceptor.h", "android/offline_pages/offline_page_request_job.cc", @@ -2178,6 +2174,8 @@ "android/offline_pages/request_coordinator_factory.h", "offline_pages/background_loader_offliner.cc", "offline_pages/background_loader_offliner.h", + "offline_pages/offline_page_model_factory.cc", + "offline_pages/offline_page_model_factory.h", "offline_pages/offliner_user_data.cc", "offline_pages/offliner_user_data.h", "offline_pages/prefetch/offline_metrics_collector_impl.cc", @@ -3933,6 +3931,13 @@ "chrome_browser_main_extra_parts_exo.h", ] } + + if (is_win || is_mac || (is_linux && !is_chromeos)) { + sources += [ + "password_manager/password_store_signin_notifier_impl.cc", + "password_manager/password_store_signin_notifier_impl.h", + ] + } } if (is_android) {
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 805f114..66aee98 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -1442,6 +1442,9 @@ {"instant-tethering", flag_descriptions::kTetherName, flag_descriptions::kTetherDescription, kOsCrOS, FEATURE_VALUE_TYPE(features::kInstantTethering)}, + {"multidevice", flag_descriptions::kMultideviceName, + flag_descriptions::kMultideviceDescription, kOsCrOS, + FEATURE_VALUE_TYPE(features::kMultidevice)}, #endif // OS_CHROMEOS { "disable-accelerated-video-decode", @@ -2383,6 +2386,11 @@ flag_descriptions::kEnableContentSuggestionsLargeThumbnailDescription, kOsAndroid, FEATURE_VALUE_TYPE(chrome::android::kContentSuggestionsLargeThumbnail)}, + {"enable-content-suggestions-video-overlay", + flag_descriptions::kEnableContentSuggestionsVideoOverlayName, + flag_descriptions::kEnableContentSuggestionsVideoOverlayDescription, + kOsAndroid, + FEATURE_VALUE_TYPE(chrome::android::kContentSuggestionsVideoOverlay)}, {"enable-content-suggestions-settings", flag_descriptions::kEnableContentSuggestionsSettingsName, flag_descriptions::kEnableContentSuggestionsSettingsDescription, @@ -3052,10 +3060,6 @@ flag_descriptions::kUseSuggestionsEvenIfFewFeatureDescription, kOsAll, FEATURE_VALUE_TYPE(suggestions::kUseSuggestionsEvenIfFewFeature)}, - {"enable-location-hard-reload", flag_descriptions::kLocationHardReloadName, - flag_descriptions::kLocationHardReloadDescription, kOsAll, - FEATURE_VALUE_TYPE(features::kLocationHardReload)}, - {"capture-thumbnail-on-load-finished", flag_descriptions::kCaptureThumbnailOnLoadFinishedName, flag_descriptions::kCaptureThumbnailOnLoadFinishedDescription, kOsDesktop, @@ -3115,6 +3119,10 @@ SINGLE_VALUE_TYPE(switches::kEnableExperimentalFullscreenExitUI)}, #endif // defined(TOOLKIT_VIEWS) + {"enable-module-scripts", flag_descriptions::kModuleScriptsName, + flag_descriptions::kModuleScriptsDescription, kOsAll, + FEATURE_VALUE_TYPE(features::kModuleScripts)}, + // NOTE: Adding new command-line switches requires adding corresponding // entries to enum "LoginCustomFlags" in histograms/enums.xml. See note in // enums.xml and don't forget to run AboutFlagsHistogramTest unit test.
diff --git a/chrome/browser/android/DEPS b/chrome/browser/android/DEPS index bb55a8c..8f032b7 100644 --- a/chrome/browser/android/DEPS +++ b/chrome/browser/android/DEPS
@@ -2,6 +2,7 @@ "-components/devtools_bridge", "+cc/layers/layer.h", "+cc/output/context_provider.h", + "+chrome_jni_registration/chrome_jni_registration.h", "+components/doodle", "+components/ntp_snippets", "+components/spellcheck/browser",
diff --git a/chrome/browser/android/browsing_data/browsing_data_bridge.cc b/chrome/browser/android/browsing_data/browsing_data_bridge.cc index d728477..f14586a1 100644 --- a/chrome/browser/android/browsing_data/browsing_data_bridge.cc +++ b/chrome/browser/android/browsing_data/browsing_data_bridge.cc
@@ -81,13 +81,6 @@ std::vector<int> data_types_vector; base::android::JavaIntArrayToIntVector(env, data_types, &data_types_vector); - if (base::FeatureList::IsEnabled(features::kTabsInCbd)) { - int tab = GetOriginalProfile()->GetPrefs()->GetInteger( - browsing_data::prefs::kLastClearBrowsingDataTab); - browsing_data::RecordDeletionFromTab( - static_cast<browsing_data::ClearBrowsingDataTab>(tab)); - } - int remove_mask = 0; for (const int data_type : data_types_vector) { switch (static_cast<browsing_data::BrowsingDataType>(data_type)) {
diff --git a/chrome/browser/android/chrome_entry_point.cc b/chrome/browser/android/chrome_entry_point.cc index ee46cd6c..079358b 100644 --- a/chrome/browser/android/chrome_entry_point.cc +++ b/chrome/browser/android/chrome_entry_point.cc
@@ -7,6 +7,7 @@ #include "base/android/library_loader/library_loader_hooks.h" #include "base/bind.h" #include "chrome/app/android/chrome_jni_onload.h" +#include "chrome/browser/android/chrome_jni_registration.h" namespace { @@ -23,6 +24,19 @@ // Java side and only register a subset of JNI methods. base::android::InitVM(vm); JNIEnv* env = base::android::AttachCurrentThread(); + + if (!base::android::IsSelectiveJniRegistrationEnabled(env)) { + if (!RegisterNonMainDexNatives(env)) { + return -1; + } + } + + if (!RegisterMainDexNatives(env)) { + return -1; + } + + // TODO(agrieve): Delete this block, this is a no-op now. + // https://crbug.com/683256. if (base::android::IsSelectiveJniRegistrationEnabled(env)) { base::android::SetJniRegistrationType( base::android::SELECTIVE_JNI_REGISTRATION);
diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc index 608c851..bcfcd7d9 100644 --- a/chrome/browser/android/chrome_feature_list.cc +++ b/chrome/browser/android/chrome_feature_list.cc
@@ -58,6 +58,7 @@ &kChromeHomeSwipeLogic, &kContentSuggestionsCategories, &kContentSuggestionsLargeThumbnail, + &kContentSuggestionsVideoOverlay, &kContentSuggestionsSettings, &kContentSuggestionsShowSummary, &kContextualSearchSingleActions, @@ -150,6 +151,9 @@ const base::Feature kContentSuggestionsLargeThumbnail{ "ContentSuggestionsLargeThumbnail", base::FEATURE_ENABLED_BY_DEFAULT}; +const base::Feature kContentSuggestionsVideoOverlay{ + "ContentSuggestionsVideoOverlay", base::FEATURE_ENABLED_BY_DEFAULT}; + const base::Feature kContentSuggestionsSettings{ "ContentSuggestionsSettings", base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/chrome/browser/android/chrome_feature_list.h b/chrome/browser/android/chrome_feature_list.h index b9340dd0..fe80482 100644 --- a/chrome/browser/android/chrome_feature_list.h +++ b/chrome/browser/android/chrome_feature_list.h
@@ -24,6 +24,7 @@ extern const base::Feature kChromeHomeSwipeLogic; extern const base::Feature kContentSuggestionsCategories; extern const base::Feature kContentSuggestionsLargeThumbnail; +extern const base::Feature kContentSuggestionsVideoOverlay; extern const base::Feature kContentSuggestionsSettings; extern const base::Feature kContentSuggestionsShowSummary; extern const base::Feature kContextualSearchSingleActions;
diff --git a/chrome/browser/android/chrome_sync_shell_entry_point.cc b/chrome/browser/android/chrome_sync_shell_entry_point.cc new file mode 100644 index 0000000..e14ea511 --- /dev/null +++ b/chrome/browser/android/chrome_sync_shell_entry_point.cc
@@ -0,0 +1,49 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/android/jni_android.h" +#include "base/android/jni_utils.h" +#include "base/android/library_loader/library_loader_hooks.h" +#include "base/bind.h" +#include "chrome/app/android/chrome_jni_onload.h" +#include "chrome/browser/android/chrome_sync_shell_jni_registration.h" + +namespace { + +bool NativeInit() { + return android::OnJNIOnLoadInit(); +} + +} // namespace + +// This is called by the VM when the shared library is first loaded. +JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { + // By default, all JNI methods are registered. However, since render processes + // don't need very much Java code, we enable selective JNI registration on the + // Java side and only register a subset of JNI methods. + base::android::InitVM(vm); + JNIEnv* env = base::android::AttachCurrentThread(); + + if (!base::android::IsSelectiveJniRegistrationEnabled(env)) { + if (!RegisterNonMainDexNatives(env)) { + return -1; + } + } + + if (!RegisterMainDexNatives(env)) { + return -1; + } + + // TODO(agrieve): Delete this block, this is a no-op now. + // https://crbug.com/683256. + if (base::android::IsSelectiveJniRegistrationEnabled(env)) { + base::android::SetJniRegistrationType( + base::android::SELECTIVE_JNI_REGISTRATION); + } + if (!android::OnJNIOnLoadRegisterJNI(env)) { + return -1; + } + base::android::SetNativeInitializationHook(NativeInit); + return JNI_VERSION_1_4; +}
diff --git a/chrome/browser/android/offline_pages/background_scheduler_bridge.cc b/chrome/browser/android/offline_pages/background_scheduler_bridge.cc index 91e52d5..409c14cd8 100644 --- a/chrome/browser/android/offline_pages/background_scheduler_bridge.cc +++ b/chrome/browser/android/offline_pages/background_scheduler_bridge.cc
@@ -5,8 +5,8 @@ #include "chrome/browser/android/offline_pages/background_scheduler_bridge.h" #include "base/android/callback_android.h" #include "base/android/scoped_java_ref.h" -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "components/offline_pages/core/background/device_conditions.h"
diff --git a/chrome/browser/android/offline_pages/downloads/offline_page_download_bridge.cc b/chrome/browser/android/offline_pages/downloads/offline_page_download_bridge.cc index aa8a8e20..c2501a3 100644 --- a/chrome/browser/android/offline_pages/downloads/offline_page_download_bridge.cc +++ b/chrome/browser/android/offline_pages/downloads/offline_page_download_bridge.cc
@@ -14,11 +14,11 @@ #include "chrome/browser/android/offline_pages/downloads/offline_page_infobar_delegate.h" #include "chrome/browser/android/offline_pages/downloads/offline_page_notification_bridge.h" #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" #include "chrome/browser/android/offline_pages/offline_page_utils.h" #include "chrome/browser/android/offline_pages/recent_tab_helper.h" #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" #include "chrome/browser/android/tab_android.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_android.h" #include "components/offline_pages/core/background/request_coordinator.h"
diff --git a/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc b/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc index 1041852..6fc30a6 100644 --- a/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc +++ b/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc
@@ -15,12 +15,12 @@ #include "chrome/browser/android/offline_pages/background_scheduler_bridge.h" #include "chrome/browser/android/offline_pages/downloads/offline_page_notification_bridge.h" #include "chrome/browser/android/offline_pages/evaluation/evaluation_test_scheduler.h" -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" #include "chrome/browser/android/offline_pages/prerendering_offliner.h" #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" #include "chrome/browser/net/nqe/ui_network_quality_estimator_service.h" #include "chrome/browser/net/nqe/ui_network_quality_estimator_service_factory.h" #include "chrome/browser/offline_pages/background_loader_offliner.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_android.h" #include "chrome/common/chrome_constants.h"
diff --git a/chrome/browser/android/offline_pages/offline_page_bookmark_observer.h b/chrome/browser/android/offline_pages/offline_page_bookmark_observer.h index 0e9194e..6e5fdfd 100644 --- a/chrome/browser/android/offline_pages/offline_page_bookmark_observer.h +++ b/chrome/browser/android/offline_pages/offline_page_bookmark_observer.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BOOKMARK_OBSERVER_H_ #include "base/memory/weak_ptr.h" -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "components/bookmarks/browser/base_bookmark_model_observer.h" #include "components/offline_pages/core/offline_page_types.h"
diff --git a/chrome/browser/android/offline_pages/offline_page_bridge.cc b/chrome/browser/android/offline_pages/offline_page_bridge.cc index 2daef6b..3c9e4ab3d 100644 --- a/chrome/browser/android/offline_pages/offline_page_bridge.cc +++ b/chrome/browser/android/offline_pages/offline_page_bridge.cc
@@ -18,10 +18,10 @@ #include "base/logging.h" #include "base/memory/ptr_util.h" #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" #include "chrome/browser/android/offline_pages/offline_page_utils.h" #include "chrome/browser/android/offline_pages/recent_tab_helper.h" #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_android.h" #include "components/offline_pages/core/background/request_coordinator.h"
diff --git a/chrome/browser/android/offline_pages/offline_page_model_factory.cc b/chrome/browser/android/offline_pages/offline_page_model_factory.cc deleted file mode 100644 index 29ae3e54..0000000 --- a/chrome/browser/android/offline_pages/offline_page_model_factory.cc +++ /dev/null
@@ -1,58 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" - -#include <utility> - -#include "base/files/file_path.h" -#include "base/memory/singleton.h" -#include "base/sequenced_task_runner.h" -#include "base/task_scheduler/post_task.h" -#include "chrome/browser/profiles/incognito_helpers.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/common/chrome_constants.h" -#include "components/keyed_service/content/browser_context_dependency_manager.h" -#include "components/offline_pages/core/offline_page_metadata_store_sql.h" -#include "components/offline_pages/core/offline_page_model_impl.h" - -namespace offline_pages { - -OfflinePageModelFactory::OfflinePageModelFactory() - : BrowserContextKeyedServiceFactory( - "OfflinePageModel", - BrowserContextDependencyManager::GetInstance()) { -} - -// static -OfflinePageModelFactory* OfflinePageModelFactory::GetInstance() { - return base::Singleton<OfflinePageModelFactory>::get(); -} - -// static -OfflinePageModel* OfflinePageModelFactory::GetForBrowserContext( - content::BrowserContext* context) { - return static_cast<OfflinePageModelImpl*>( - GetInstance()->GetServiceForBrowserContext(context, true)); -} - -KeyedService* OfflinePageModelFactory::BuildServiceInstanceFor( - content::BrowserContext* context) const { - Profile* profile = Profile::FromBrowserContext(context); - scoped_refptr<base::SequencedTaskRunner> background_task_runner = - base::CreateSequencedTaskRunnerWithTraits({base::MayBlock()}); - - base::FilePath store_path = - profile->GetPath().Append(chrome::kOfflinePageMetadataDirname); - std::unique_ptr<OfflinePageMetadataStore> metadata_store( - new OfflinePageMetadataStoreSQL(background_task_runner, store_path)); - - base::FilePath archives_dir = - profile->GetPath().Append(chrome::kOfflinePageArchivesDirname); - - return new OfflinePageModelImpl(std::move(metadata_store), archives_dir, - background_task_runner); -} - -} // namespace offline_pages
diff --git a/chrome/browser/android/offline_pages/offline_page_model_factory.h b/chrome/browser/android/offline_pages/offline_page_model_factory.h deleted file mode 100644 index 3944e382c..0000000 --- a/chrome/browser/android/offline_pages/offline_page_model_factory.h +++ /dev/null
@@ -1,45 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_FACTORY_H_ -#define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_FACTORY_H_ - -#include "base/macros.h" -#include "components/keyed_service/content/browser_context_keyed_service_factory.h" - -namespace base { -template <typename T> -struct DefaultSingletonTraits; -} // namespace base - -namespace offline_pages { - -class OfflinePageModel; - -// A factory to create one unique OfflinePageModel. Offline pages are not -// supported in incognito, and this class uses default implementation of -// |GetBrowserContextToUse|. -// TODO(fgorski): Add an integration test that ensures incognito users don't -// save or open offline pages. -class OfflinePageModelFactory : public BrowserContextKeyedServiceFactory { - public: - static OfflinePageModelFactory* GetInstance(); - static OfflinePageModel* GetForBrowserContext( - content::BrowserContext* context); - - private: - friend struct base::DefaultSingletonTraits<OfflinePageModelFactory>; - - OfflinePageModelFactory(); - ~OfflinePageModelFactory() override {} - - KeyedService* BuildServiceInstanceFor( - content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(OfflinePageModelFactory); -}; - -} // namespace offline_pages - -#endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_FACTORY_H_
diff --git a/chrome/browser/android/offline_pages/offline_page_request_job.cc b/chrome/browser/android/offline_pages/offline_page_request_job.cc index 3401b11..8278d6bb 100644 --- a/chrome/browser/android/offline_pages/offline_page_request_job.cc +++ b/chrome/browser/android/offline_pages/offline_page_request_job.cc
@@ -14,10 +14,10 @@ #include "base/strings/string_number_conversions.h" #include "base/task_scheduler/post_task.h" #include "base/threading/thread_task_runner_handle.h" -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h" #include "chrome/browser/android/offline_pages/offline_page_utils.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "chrome/browser/profiles/profile_manager.h" #include "components/offline_pages/core/offline_page_model.h" #include "components/offline_pages/core/request_header/offline_page_header.h"
diff --git a/chrome/browser/android/offline_pages/offline_page_request_job_unittest.cc b/chrome/browser/android/offline_pages/offline_page_request_job_unittest.cc index 5e2c50d..ea6ff6d6 100644 --- a/chrome/browser/android/offline_pages/offline_page_request_job_unittest.cc +++ b/chrome/browser/android/offline_pages/offline_page_request_job_unittest.cc
@@ -15,10 +15,10 @@ #include "base/test/histogram_tester.h" #include "base/test/simple_test_clock.h" #include "base/threading/thread_task_runner_handle.h" -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" #include "chrome/browser/android/offline_pages/offline_page_request_interceptor.h" #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h" #include "chrome/browser/android/offline_pages/test_offline_page_model_builder.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h"
diff --git a/chrome/browser/android/offline_pages/offline_page_utils.cc b/chrome/browser/android/offline_pages/offline_page_utils.cc index 6057317..253fef0 100644 --- a/chrome/browser/android/offline_pages/offline_page_utils.cc +++ b/chrome/browser/android/offline_pages/offline_page_utils.cc
@@ -14,11 +14,11 @@ #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h" #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" #include "chrome/browser/android/tab_android.h" #include "chrome/browser/net/net_error_tab_helper.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "components/offline_pages/core/background/request_coordinator.h" #include "components/offline_pages/core/background/save_page_request.h" #include "components/offline_pages/core/client_namespace_constants.h"
diff --git a/chrome/browser/android/offline_pages/offline_page_utils_unittest.cc b/chrome/browser/android/offline_pages/offline_page_utils_unittest.cc index ab47895..8942ba1 100644 --- a/chrome/browser/android/offline_pages/offline_page_utils_unittest.cc +++ b/chrome/browser/android/offline_pages/offline_page_utils_unittest.cc
@@ -19,11 +19,11 @@ #include "base/test/simple_test_clock.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h" #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" #include "chrome/browser/android/offline_pages/test_offline_page_model_builder.h" #include "chrome/browser/android/offline_pages/test_request_coordinator_builder.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "chrome/common/chrome_constants.h" #include "chrome/test/base/testing_profile.h" #include "components/offline_pages/core/background/network_quality_provider_stub.h"
diff --git a/chrome/browser/android/offline_pages/recent_tab_helper.cc b/chrome/browser/android/offline_pages/recent_tab_helper.cc index e7c5436..0187e0dd 100644 --- a/chrome/browser/android/offline_pages/recent_tab_helper.cc +++ b/chrome/browser/android/offline_pages/recent_tab_helper.cc
@@ -18,9 +18,9 @@ #include "base/time/time.h" #include "chrome/browser/android/offline_pages/downloads/offline_page_notification_bridge.h" #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" #include "chrome/browser/android/offline_pages/offline_page_utils.h" #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "components/offline_pages/core/background/request_coordinator.h" #include "components/offline_pages/core/client_namespace_constants.h" #include "components/offline_pages/core/offline_page_feature.h"
diff --git a/chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc b/chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc index 5f66503..9e46292 100644 --- a/chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc +++ b/chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc
@@ -12,10 +12,10 @@ #include "base/test/scoped_feature_list.h" #include "base/test/scoped_mock_time_message_loop_task_runner.h" #include "base/threading/thread_task_runner_handle.h" -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" #include "chrome/browser/android/offline_pages/test_offline_page_model_builder.h" #include "chrome/browser/android/offline_pages/test_request_coordinator_builder.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "components/offline_pages/core/client_namespace_constants.h" #include "components/offline_pages/core/offline_page_feature.h"
diff --git a/chrome/browser/android/offline_pages/request_coordinator_factory.cc b/chrome/browser/android/offline_pages/request_coordinator_factory.cc index e4c82ae8..65147b5 100644 --- a/chrome/browser/android/offline_pages/request_coordinator_factory.cc +++ b/chrome/browser/android/offline_pages/request_coordinator_factory.cc
@@ -13,12 +13,12 @@ #include "chrome/browser/android/offline_pages/background_scheduler_bridge.h" #include "chrome/browser/android/offline_pages/cct_request_observer.h" #include "chrome/browser/android/offline_pages/downloads/offline_page_notification_bridge.h" -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" #include "chrome/browser/android/offline_pages/prerendering_offliner.h" #include "chrome/browser/net/nqe/ui_network_quality_estimator_service.h" #include "chrome/browser/net/nqe/ui_network_quality_estimator_service_factory.h" #include "chrome/browser/offline_pages/android/load_termination_listener_impl.h" #include "chrome/browser/offline_pages/background_loader_offliner.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_constants.h" #include "components/keyed_service/content/browser_context_dependency_manager.h"
diff --git a/chrome/browser/android/preferences/pref_service_bridge.cc b/chrome/browser/android/preferences/pref_service_bridge.cc index f4e3fd2..8da39d5 100644 --- a/chrome/browser/android/preferences/pref_service_bridge.cc +++ b/chrome/browser/android/preferences/pref_service_bridge.cc
@@ -193,7 +193,8 @@ Java_PrefServiceBridge_addContentSettingExceptionToList( env, list, content_settings_type, ConvertUTF8ToJavaString(env, entries[i].primary_pattern.ToString()), - entries[i].setting, ConvertUTF8ToJavaString(env, entries[i].source)); + entries[i].GetContentSetting(), + ConvertUTF8ToJavaString(env, entries[i].source)); } }
diff --git a/chrome/browser/android/preferences/website_preference_bridge.cc b/chrome/browser/android/preferences/website_preference_bridge.cc index e0279b43..66e4753 100644 --- a/chrome/browser/android/preferences/website_preference_bridge.cc +++ b/chrome/browser/android/preferences/website_preference_bridge.cc
@@ -140,7 +140,7 @@ // Now add all origins that have a non-default setting to the list. for (const auto& settings_it : all_settings) { - if (settings_it.setting == default_content_setting) + if (settings_it.GetContentSetting() == default_content_setting) continue; if (managedOnly && HostContentSettingsMap::GetProviderTypeFromSource(settings_it.source) !=
diff --git a/chrome/browser/android/vr_shell/vr_shell_delegate.cc b/chrome/browser/android/vr_shell/vr_shell_delegate.cc index 0ed55503..17acec9 100644 --- a/chrome/browser/android/vr_shell/vr_shell_delegate.cc +++ b/chrome/browser/android/vr_shell/vr_shell_delegate.cc
@@ -83,10 +83,12 @@ const JavaParamRef<jobject>& obj, jboolean success) { CHECK(!present_callback_.is_null()); - if (success && !gvr_delegate_) { - // We have to wait until the GL thread is ready since we have to pass it - // the VRSubmitFrameClient. - pending_successful_present_request_ = true; + if (!gvr_delegate_) { + if (success) { + // We have to wait until the GL thread is ready since we have to pass it + // the VRSubmitFrameClient. + pending_successful_present_request_ = true; + } return; } @@ -217,7 +219,7 @@ void VrShellDelegate::GetNextMagicWindowPose( device::mojom::VRDisplay::GetNextMagicWindowPoseCallback callback) { - if (!gvr_api_) { + if (!gvr_api_ || gvr_delegate_) { std::move(callback).Run(nullptr); return; }
diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.cc b/chrome/browser/android/vr_shell/vr_shell_gl.cc index aa961325..990c281 100644 --- a/chrome/browser/android/vr_shell/vr_shell_gl.cc +++ b/chrome/browser/android/vr_shell/vr_shell_gl.cc
@@ -236,21 +236,7 @@ VrShellGl::~VrShellGl() { vsync_task_.Cancel(); - // TODO(mthiesse): Can we omit the Close() here? Concern is that if - // both ends of the connection ever live in the same process for - // some reason, we could receive another VSync request in response - // to the closing message in the destructor but fail to respond to - // the callback. - binding_.Close(); - if (!callback_.is_null()) { - // When this VSync provider is going away we have to respond to pending - // callbacks, so instead of providing a VSync, tell the requester to try - // again. A VSyncProvider is guaranteed to exist, so the request in response - // to this message will go through some other VSyncProvider. - base::ResetAndReturn(&callback_) - .Run(nullptr, base::TimeDelta(), -1, - device::mojom::VRPresentationProvider::VSyncStatus::CLOSING); - } + closePresentationBindings(); } void VrShellGl::Initialize() { @@ -407,8 +393,8 @@ void VrShellGl::ConnectPresentingService( device::mojom::VRSubmitFrameClientPtrInfo submit_client_info, device::mojom::VRPresentationProviderRequest request) { + closePresentationBindings(); submit_client_.Bind(std::move(submit_client_info)); - binding_.Close(); binding_.Bind(std::move(request)); } @@ -1490,7 +1476,7 @@ } if (!enabled) { - submit_client_.reset(); + closePresentationBindings(); } } @@ -1528,6 +1514,7 @@ // Don't send VSyncs until we have a timebase/interval. if (vsync_interval_.is_zero()) return; + target = now + vsync_interval_; int64_t intervals = (target - vsync_timebase_) / vsync_interval_; target = vsync_timebase_ + intervals * vsync_interval_; @@ -1554,7 +1541,7 @@ if (!callback_.is_null()) { mojo::ReportBadMessage( "Requested VSync before waiting for response to previous request."); - binding_.Close(); + closePresentationBindings(); return; } callback_ = std::move(callback); @@ -1640,4 +1627,17 @@ browser_->RunVRDisplayInfoCallback(callback, &info); } +void VrShellGl::closePresentationBindings() { + submit_client_.reset(); + if (!callback_.is_null()) { + // When this Presentation provider is going away we have to respond to + // pending callbacks, so instead of providing a VSync, tell the requester + // the connection is closing. + base::ResetAndReturn(&callback_) + .Run(nullptr, base::TimeDelta(), -1, + device::mojom::VRPresentationProvider::VSyncStatus::CLOSING); + } + binding_.Close(); +} + } // namespace vr_shell
diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.h b/chrome/browser/android/vr_shell/vr_shell_gl.h index 7b07d5d..5083b8e 100644 --- a/chrome/browser/android/vr_shell/vr_shell_gl.h +++ b/chrome/browser/android/vr_shell/vr_shell_gl.h
@@ -198,6 +198,8 @@ void SendVSync(base::TimeDelta time, GetVSyncCallback callback); + void closePresentationBindings(); + // samplerExternalOES texture data for main content image. int content_texture_id_ = 0; // samplerExternalOES texture data for WebVR content image.
diff --git a/chrome/browser/apps/app_url_redirector.cc b/chrome/browser/apps/app_url_redirector.cc index 46321f2e..e5ec867 100644 --- a/chrome/browser/apps/app_url_redirector.cc +++ b/chrome/browser/apps/app_url_redirector.cc
@@ -113,8 +113,7 @@ new navigation_interception::InterceptNavigationThrottle( handle, base::Bind(&LaunchAppWithUrl, - scoped_refptr<const Extension>(*iter), handler->id), - true)); + scoped_refptr<const Extension>(*iter), handler->id))); } }
diff --git a/chrome/browser/autocomplete/shortcuts_backend_factory.cc b/chrome/browser/autocomplete/shortcuts_backend_factory.cc index 1e32b7a..adc070d 100644 --- a/chrome/browser/autocomplete/shortcuts_backend_factory.cc +++ b/chrome/browser/autocomplete/shortcuts_backend_factory.cc
@@ -15,7 +15,6 @@ #include "components/omnibox/browser/shortcuts_backend.h" #include "components/omnibox/browser/shortcuts_constants.h" #include "components/prefs/pref_service.h" -#include "content/public/browser/browser_thread.h" #include "extensions/features/features.h" #if BUILDFLAG(ENABLE_EXTENSIONS) @@ -97,8 +96,6 @@ base::MakeUnique<UIThreadSearchTermsData>(profile), HistoryServiceFactory::GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS), - content::BrowserThread::GetTaskRunnerForThread( - content::BrowserThread::DB), profile->GetPath().Append(kShortcutsDatabaseName), suppress_db)); #if BUILDFLAG(ENABLE_EXTENSIONS) auto extensions_manager =
diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc index ba1d4292..bf08813 100644 --- a/chrome/browser/background/background_mode_manager.cc +++ b/chrome/browser/background/background_mode_manager.cc
@@ -154,7 +154,7 @@ DCHECK_LT(command_id, IDC_MinimumLabelValue); command_id_handler_vector_->push_back( base::Bind(&BackgroundModeManager::LaunchBackgroundApplication, - profile_, application.get())); + profile_, base::RetainedRef(application))); menu->AddItem(command_id, base::UTF8ToUTF16(name)); if (icon) menu->SetIcon(menu->GetItemCount() - 1, gfx::Image(*icon));
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd index 54f9e542..1f691a5a 100644 --- a/chrome/browser/browser_resources.grd +++ b/chrome/browser/browser_resources.grd
@@ -275,6 +275,8 @@ <include name="IDR_MD_BOOKMARKS_CONSTANTS_JS" file="resources\md_bookmarks\constants.js" type="BINDATA" /> <include name="IDR_MD_BOOKMARKS_DIALOG_FOCUS_MANAGER_HTML" file="resources\md_bookmarks\dialog_focus_manager.html" type="BINDATA" /> <include name="IDR_MD_BOOKMARKS_DIALOG_FOCUS_MANAGER_JS" file="resources\md_bookmarks\dialog_focus_manager.js" type="BINDATA" /> + <include name="IDR_MD_BOOKMARKS_DND_CHIP_HTML" file="resources\md_bookmarks\dnd_chip.html" type="BINDATA" /> + <include name="IDR_MD_BOOKMARKS_DND_CHIP_JS" file="resources\md_bookmarks\dnd_chip.js" type="BINDATA" /> <include name="IDR_MD_BOOKMARKS_DND_MANAGER_HTML" file="resources\md_bookmarks\dnd_manager.html" type="BINDATA" /> <include name="IDR_MD_BOOKMARKS_DND_MANAGER_JS" file="resources\md_bookmarks\dnd_manager.js" type="BINDATA" /> <include name="IDR_MD_BOOKMARKS_EDIT_DIALOG_HTML" file="resources\md_bookmarks\edit_dialog.html" type="BINDATA" />
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc index abe1f967..44fee5aa1 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
@@ -82,8 +82,8 @@ #include "url/url_util.h" #if defined(OS_ANDROID) -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" #include "chrome/browser/android/webapps/webapp_registry.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "chrome/browser/precache/precache_manager_factory.h" #include "components/offline_pages/core/offline_page_feature.h" #include "components/offline_pages/core/offline_page_model.h"
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_factory.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_factory.cc index 91911e4..b814ae2 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_factory.cc +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_factory.cc
@@ -24,7 +24,7 @@ #include "extensions/features/features.h" #if defined(OS_ANDROID) -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "chrome/browser/precache/precache_manager_factory.h" #endif
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc index e097b551..f19bb5e 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc
@@ -1697,12 +1697,12 @@ EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard(kOrigin1), host_settings[0].primary_pattern) << host_settings[0].primary_pattern.ToString(); - EXPECT_EQ(CONTENT_SETTING_ALLOW, host_settings[0].setting); + EXPECT_EQ(CONTENT_SETTING_ALLOW, host_settings[0].GetContentSetting()); // And the wildcard. EXPECT_EQ(ContentSettingsPattern::Wildcard(), host_settings[1].primary_pattern) << host_settings[1].primary_pattern.ToString(); - EXPECT_EQ(CONTENT_SETTING_ASK, host_settings[1].setting); + EXPECT_EQ(CONTENT_SETTING_ASK, host_settings[1].GetContentSetting()); // There should also only be one setting for origin3 map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string(), @@ -1711,12 +1711,12 @@ EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard(kOrigin3), host_settings[0].primary_pattern) << host_settings[0].primary_pattern.ToString(); - EXPECT_EQ(CONTENT_SETTING_ALLOW, host_settings[0].setting); + EXPECT_EQ(CONTENT_SETTING_ALLOW, host_settings[0].GetContentSetting()); // And the wildcard. EXPECT_EQ(ContentSettingsPattern::Wildcard(), host_settings[1].primary_pattern) << host_settings[1].primary_pattern.ToString(); - EXPECT_EQ(CONTENT_SETTING_ASK, host_settings[1].setting); + EXPECT_EQ(CONTENT_SETTING_ASK, host_settings[1].GetContentSetting()); BlockUntilOriginDataRemoved( base::Time(), base::Time::Max(), @@ -1730,7 +1730,7 @@ EXPECT_EQ(ContentSettingsPattern::Wildcard(), host_settings[0].primary_pattern) << host_settings[0].primary_pattern.ToString(); - EXPECT_EQ(CONTENT_SETTING_ASK, host_settings[0].setting); + EXPECT_EQ(CONTENT_SETTING_ASK, host_settings[0].GetContentSetting()); map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string(), &host_settings); @@ -1738,7 +1738,7 @@ EXPECT_EQ(ContentSettingsPattern::Wildcard(), host_settings[0].primary_pattern) << host_settings[0].primary_pattern.ToString(); - EXPECT_EQ(CONTENT_SETTING_ASK, host_settings[0].setting); + EXPECT_EQ(CONTENT_SETTING_ASK, host_settings[0].GetContentSetting()); } TEST_F(ChromeBrowsingDataRemoverDelegateTest, RemoveDurablePermission) { @@ -1777,13 +1777,13 @@ EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard(kOrigin1), host_settings[0].primary_pattern) << host_settings[0].primary_pattern.ToString(); - EXPECT_EQ(CONTENT_SETTING_ALLOW, host_settings[0].setting); + EXPECT_EQ(CONTENT_SETTING_ALLOW, host_settings[0].GetContentSetting()); // And our wildcard. EXPECT_EQ(ContentSettingsPattern::Wildcard(), host_settings[1].primary_pattern) << host_settings[1].primary_pattern.ToString(); - EXPECT_EQ(CONTENT_SETTING_ASK, host_settings[1].setting); + EXPECT_EQ(CONTENT_SETTING_ASK, host_settings[1].GetContentSetting()); } TEST_F(ChromeBrowsingDataRemoverDelegateTest,
diff --git a/chrome/browser/captive_portal/captive_portal_tab_helper.cc b/chrome/browser/captive_portal/captive_portal_tab_helper.cc index f4261dc7..647cc62 100644 --- a/chrome/browser/captive_portal/captive_portal_tab_helper.cc +++ b/chrome/browser/captive_portal/captive_portal_tab_helper.cc
@@ -95,6 +95,12 @@ void CaptivePortalTabHelper::DidFinishNavigation( content::NavigationHandle* navigation_handle) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + + // TODO(clamy): Remove this when we understand the root cause behind + // crbug.com/704892. + if (navigation_handle_ && !navigation_handle_->IsInMainFrame()) + base::debug::DumpWithoutCrashing(); + // Exclude subframe navigations. if (!navigation_handle->IsInMainFrame()) return;
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 6461d768..14f079e 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -133,6 +133,7 @@ #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings_types.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "components/dom_distiller/core/dom_distiller_switches.h" #include "components/dom_distiller/core/url_constants.h" #include "components/error_page/common/error_page_switches.h" @@ -755,25 +756,19 @@ void GetGuestViewDefaultContentSettingRules( bool incognito, RendererContentSettingRules* rules) { - rules->image_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_ALLOW, - std::string(), - incognito)); + rules->image_rules.push_back(ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), + content_settings::ContentSettingToValue(CONTENT_SETTING_ALLOW), + std::string(), incognito)); - rules->script_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_ALLOW, - std::string(), - incognito)); - rules->autoplay_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_ALLOW, - std::string(), - incognito)); + rules->script_rules.push_back(ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), + content_settings::ContentSettingToValue(CONTENT_SETTING_ALLOW), + std::string(), incognito)); + rules->autoplay_rules.push_back(ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), + content_settings::ContentSettingToValue(CONTENT_SETTING_ALLOW), + std::string(), incognito)); } AppLoadedInTabSource ClassifyAppLoadedInTabSource( @@ -2916,8 +2911,8 @@ Profile::FromBrowserContext(render_process_host->GetBrowserContext()); net::URLRequestContextGetter* context = render_process_host->GetStoragePartition()->GetURLRequestContext(); - registry->AddInterface( - base::Bind(&NetBenchmarking::Create, profile, context)); + registry->AddInterface(base::Bind(&NetBenchmarking::Create, profile, + base::RetainedRef(context))); } if (base::CommandLine::ForCurrentProcess()->HasSwitch(
diff --git a/chrome/browser/chrome_service_worker_browsertest.cc b/chrome/browser/chrome_service_worker_browsertest.cc index 74d21d5..c79f5a6d 100644 --- a/chrome/browser/chrome_service_worker_browsertest.cc +++ b/chrome/browser/chrome_service_worker_browsertest.cc
@@ -415,6 +415,7 @@ "use-credentials")); } +#if !defined(DISABLE_NACL) class ChromeServiceWorkerFetchPPAPITest : public ChromeServiceWorkerFetchTest { protected: ChromeServiceWorkerFetchPPAPITest() {} @@ -603,6 +604,7 @@ EXPECT_EQ(GetRequestStringForPNACL("#OtherCORSCredentials"), ExecutePNACLUrlLoaderTest("OtherCORSCredentials")); } +#endif // !defined(DISABLE_NACL) class ChromeServiceWorkerNavigationHintTest : public ChromeServiceWorkerTest { protected:
diff --git a/chrome/browser/chromeos/accessibility/accessibility_manager.cc b/chrome/browser/chromeos/accessibility/accessibility_manager.cc index 5e14cffa..d5938a6c 100644 --- a/chrome/browser/chromeos/accessibility/accessibility_manager.cc +++ b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
@@ -14,7 +14,6 @@ #include "ash/autoclick/autoclick_controller.h" #include "ash/autoclick/mus/public/interfaces/autoclick.mojom.h" #include "ash/high_contrast/high_contrast_controller.h" -#include "ash/metrics/user_metrics_recorder.h" #include "ash/root_window_controller.h" #include "ash/shelf/shelf.h" #include "ash/shelf/shelf_layout_manager.h" @@ -474,9 +473,6 @@ ash::AccessibilityNotificationVisibility notify) { if (!profile_) return; - ash::Shell::Get()->metrics()->RecordUserMetricsAction( - enabled ? ash::UMA_STATUS_AREA_ENABLE_SPOKEN_FEEDBACK - : ash::UMA_STATUS_AREA_DISABLE_SPOKEN_FEEDBACK); spoken_feedback_notification_ = notify;
diff --git a/chrome/browser/chromeos/arc/arc_migration_constants.h b/chrome/browser/chromeos/arc/arc_migration_constants.h index 95b0230..b397bf6 100644 --- a/chrome/browser/chromeos/arc/arc_migration_constants.h +++ b/chrome/browser/chromeos/arc/arc_migration_constants.h
@@ -10,8 +10,8 @@ // The minimum battery level to start the migration. constexpr double kMigrationMinimumBatteryPercent = 30; -// The minimum size of available space to start the migration. (10MB) -constexpr int64_t kMigrationMinimumAvailableStorage = 10LL * 1024 * 1024; +// The minimum size of available space to start the migration. (50MB) +constexpr int64_t kMigrationMinimumAvailableStorage = 50LL * 1024 * 1024; } // namespace arc
diff --git a/chrome/browser/chromeos/arc/arc_session_manager.cc b/chrome/browser/chromeos/arc/arc_session_manager.cc index e1ca910d..c9639e8 100644 --- a/chrome/browser/chromeos/arc/arc_session_manager.cc +++ b/chrome/browser/chromeos/arc/arc_session_manager.cc
@@ -214,13 +214,15 @@ void ArcSessionManager::OnSessionStopped(ArcStopReason reason, bool restarting) { if (restarting) { + DCHECK_EQ(state_, State::ACTIVE); // If ARC is being restarted, here do nothing, and just wait for its // next run. VLOG(1) << "ARC session is stopped, but being restarted: " << reason; return; } - SetState(State::STOPPED); + DCHECK(state_ == State::ACTIVE || state_ == State::STOPPING) << state_; + state_ = State::STOPPED; // TODO(crbug.com/625923): Use |reason| to report more detailed errors. if (arc_sign_in_timer_.IsRunning()) @@ -305,6 +307,7 @@ // Launch Play Store app, except for the following cases: // * When Opt-in verification is disabled (for tests); + // * In case ARC is enabled from OOBE. // * In ARC Kiosk mode, because the only one UI in kiosk mode must be the // kiosk app and device is not needed for opt-in; // * When ARC is managed, the user is not an Active Directory user and all @@ -315,7 +318,7 @@ // it less weird that a browser window pops up. const bool suppress_play_store_app = !IsPlayStoreAvailable() || IsArcOptInVerificationDisabled() || - IsArcKioskMode() || + IsArcKioskMode() || oobe_start_ || (IsArcPlayStoreEnabledPreferenceManagedForProfile(profile_) && AreArcAllOptInPreferencesManagedForProfile(profile_) && !IsActiveDirectoryUserForProfile(profile_)); @@ -397,10 +400,6 @@ ShowArcSupportHostError(error, true /* = show send feedback button */); } -void ArcSessionManager::SetState(State state) { - state_ = state; -} - bool ArcSessionManager::IsAllowed() const { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); return profile_ != nullptr; @@ -437,7 +436,7 @@ } DCHECK_EQ(State::NOT_INITIALIZED, state_); - SetState(State::STOPPED); + state_ = State::STOPPED; context_ = base::MakeUnique<ArcAuthContext>(profile_); @@ -461,7 +460,7 @@ } context_.reset(); profile_ = nullptr; - SetState(State::NOT_INITIALIZED); + state_ = State::NOT_INITIALIZED; if (scoped_opt_in_tracker_) { scoped_opt_in_tracker_->TrackShutdown(); scoped_opt_in_tracker_.reset(); @@ -473,12 +472,34 @@ playstore_launcher_.reset(); terms_of_service_negotiator_.reset(); android_management_checker_.reset(); - arc_session_runner_->RequestStop(false); - // TODO(hidehiko): The ARC instance's stopping is asynchronous, so it might - // still be running when we return from this function. Do not set the - // STOPPED state immediately here. - if (state_ != State::NOT_INITIALIZED && state_ != State::REMOVING_DATA_DIR) - SetState(State::STOPPED); + switch (state_) { + case State::NOT_INITIALIZED: + // Ignore in NOT_INITIALIZED case. This is called in initial SetProfile + // invocation. + // TODO(hidehiko): Remove this along with the clean up. + break; + case State::STOPPED: + // Currently, ARC is stopped. Do nothing. + break; + case State::NEGOTIATING_TERMS_OF_SERVICE: + case State::CHECKING_ANDROID_MANAGEMENT: + // Those operations are synchronously cancelled, so set the state to + // STOPPED immediately. + state_ = State::STOPPED; + break; + case State::REMOVING_DATA_DIR: + // When data removing is done, |state_| will be set to STOPPED. + // Do nothing here. + break; + case State::ACTIVE: + // Request to stop the ARC. |state_| will be set to STOPPED eventually. + arc_session_runner_->RequestStop(false); + state_ = State::STOPPING; + break; + case State::STOPPING: + // Now ARC is stopping. Do nothing here. + break; + } } void ArcSessionManager::AddObserver(Observer* observer) { @@ -574,15 +595,21 @@ void ArcSessionManager::RequestEnableImpl() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK(profile_); - DCHECK_NE(state_, State::ACTIVE); + DCHECK(enable_requested_); + DCHECK(state_ == State::STOPPED || state_ == State::STOPPING || + state_ == State::REMOVING_DATA_DIR) + << state_; - if (state_ == State::REMOVING_DATA_DIR) { - // Data removal request is in progress. Set flag to re-enable ARC once it - // is finished. + if (state_ != State::STOPPED) { + // If the previous invocation of ARC is still running (but currently being + // stopped) or ARC data removal is in progress, postpone the enabling + // procedure. reenable_arc_ = true; return; } + oobe_start_ = IsOobeOptInActive(); + PrefService* const prefs = profile_->GetPrefs(); // If it is marked that sign in has been successfully done, if ARC has been @@ -637,6 +664,7 @@ arc_session_runner_->RequestStop(true); return; } + oobe_start_ = false; enable_requested_ = false; scoped_opt_in_tracker_.reset(); @@ -677,13 +705,16 @@ profile_->GetPrefs()->SetBoolean(prefs::kArcDataRemoveRequested, true); // To support 1) case above, maybe start data removal. - if (state_ == State::STOPPED && arc_session_runner_->IsStopped()) + if (state_ == State::STOPPED) { + DCHECK(arc_session_runner_->IsStopped()); MaybeStartArcDataRemoval(); + } } void ArcSessionManager::MaybeStartTermsOfServiceNegotiation() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK(profile_); + DCHECK(arc_session_runner_->IsStopped()); DCHECK(!terms_of_service_negotiator_); // In Kiosk-mode, Terms of Service negotiation should be skipped. // See also RequestEnableImpl(). @@ -692,21 +723,13 @@ // be skipped, too. See also RequestEnableImpl(). DCHECK(!IsArcOptInVerificationDisabled()); - // TODO(hidehiko): Remove this condition, when the state machine is fixed. - if (!arc_session_runner_->IsStopped()) { - // If the user attempts to re-enable ARC while the ARC instance is still - // running the user should not be able to continue until the ARC instance - // has stopped. - ShowArcSupportHostError( - ArcSupportHost::Error::SIGN_IN_SERVICE_UNAVAILABLE_ERROR, false); - UpdateOptInCancelUMA(OptInCancelReason::SESSION_BUSY); - return; - } + DCHECK_EQ(state_, State::STOPPED); + state_ = State::NEGOTIATING_TERMS_OF_SERVICE; - // TODO(hidehiko): DCHECK if |state_| is STOPPED, when the state machine - // is fixed. - SetState(State::NEGOTIATING_TERMS_OF_SERVICE); - + // TODO(hidehiko): In kArcSignedIn = true case, this method should never + // be called. Remove the check. + // Conceptually, this is starting ToS negotiation, rather than opt-in flow. + // Move to RequestEnabledImpl. if (!scoped_opt_in_tracker_ && !profile_->GetPrefs()->GetBoolean(prefs::kArcSignedIn)) { scoped_opt_in_tracker_ = base::MakeUnique<ScopedOptInFlowTracker>(); @@ -752,7 +775,7 @@ void ArcSessionManager::OnTermsOfServiceNegotiated(bool accepted) { DCHECK_EQ(state_, State::NEGOTIATING_TERMS_OF_SERVICE); DCHECK(profile_); - DCHECK(terms_of_service_negotiator_); + DCHECK(terms_of_service_negotiator_ || g_disable_ui_for_testing); terms_of_service_negotiator_.reset(); if (!accepted) { @@ -807,8 +830,9 @@ DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK(arc_session_runner_->IsStopped()); DCHECK(state_ == State::NEGOTIATING_TERMS_OF_SERVICE || - state_ == State::CHECKING_ANDROID_MANAGEMENT); - SetState(State::CHECKING_ANDROID_MANAGEMENT); + state_ == State::CHECKING_ANDROID_MANAGEMENT) + << state_; + state_ = State::CHECKING_ANDROID_MANAGEMENT; // Show loading UI only if ARC support app's window is already shown. // User may not see any ARC support UI if everything needed is done in @@ -822,6 +846,9 @@ for (auto& observer : observer_list_) observer.OnArcOptInManagementCheckStarted(); + if (g_disable_ui_for_testing) + return; + android_management_checker_ = base::MakeUnique<ArcAndroidManagementChecker>( profile_, context_->token_service(), context_->account_id(), false /* retry_on_error */); @@ -904,19 +931,21 @@ void ArcSessionManager::StartArc() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + DCHECK(state_ == State::STOPPED || + state_ == State::CHECKING_ANDROID_MANAGEMENT) + << state_; + state_ = State::ACTIVE; // ARC must be started only if no pending data removal request exists. DCHECK(!profile_->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); arc_start_time_ = base::Time::Now(); - provisioning_reported_ = false; - arc_session_runner_->RequestStart(); - SetState(State::ACTIVE); } void ArcSessionManager::StopArc() { + // TODO(hidehiko): This STOPPED guard should be unnecessary. Remove it later. if (state_ != State::STOPPED) { profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, false); profile_->GetPrefs()->SetBoolean(prefs::kArcTermsAccepted, false); @@ -931,8 +960,7 @@ DCHECK(profile_); // Data removal cannot run in parallel with ARC session. DCHECK(arc_session_runner_->IsStopped()); - DCHECK_EQ(State::STOPPED, state_); - SetState(State::REMOVING_DATA_DIR); + DCHECK_EQ(state_, State::STOPPED); // TODO(hidehiko): Extract the implementation of data removal, so that // shutdown can cancel the operation not to call OnArcDataRemoved callback. @@ -943,6 +971,7 @@ } VLOG(1) << "Starting ARC data removal"; + state_ = State::REMOVING_DATA_DIR; // Remove Play user ID for Active Directory managed devices. profile_->GetPrefs()->SetString(prefs::kArcActiveDirectoryPlayUserId, @@ -966,6 +995,8 @@ DCHECK_EQ(state_, State::REMOVING_DATA_DIR); DCHECK(profile_); DCHECK(profile_->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); + state_ = State::STOPPED; + if (success) { VLOG(1) << "ARC data removal successful"; } else { @@ -983,18 +1014,13 @@ void ArcSessionManager::MaybeReenableArc() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - DCHECK_EQ(state_, State::REMOVING_DATA_DIR); - SetState(State::STOPPED); + DCHECK_EQ(state_, State::STOPPED); - // Here check if |reenable_arc_| is marked or not. - // TODO(hidehiko): Conceptually |reenable_arc_| should be always false - // if |enable_requested_| is false. Replace by DCHECK after state machine - // fix is done. - if (!reenable_arc_ || !enable_requested_) { - // Reset the flag, just in case. TODO(hidehiko): Remove this. - reenable_arc_ = false; + if (!reenable_arc_) { + // Reenabling is not triggered. Do nothing. return; } + DCHECK(enable_requested_); // Restart ARC anyway. Let the enterprise reporting instance decide whether // the ARC user data wipe is still required or not. @@ -1081,6 +1107,7 @@ MAP_STATE(CHECKING_ANDROID_MANAGEMENT); MAP_STATE(REMOVING_DATA_DIR); MAP_STATE(ACTIVE); + MAP_STATE(STOPPING); } #undef MAP_STATE
diff --git a/chrome/browser/chromeos/arc/arc_session_manager.h b/chrome/browser/chromeos/arc/arc_session_manager.h index 4a25ddc..4981097 100644 --- a/chrome/browser/chromeos/arc/arc_session_manager.h +++ b/chrome/browser/chromeos/arc/arc_session_manager.h
@@ -59,6 +59,7 @@ // REMOVING_DATA_DIR: When ARC is disabled, the data directory is removed. // While removing is processed, ARC cannot be started. This is the state. // ACTIVE: ARC is running. + // STOPPING: ARC is being shut down. // // State transition should be as follows: // @@ -77,6 +78,15 @@ // STOPPED -> ACTIVE: when arc.enabled preference is checked that it is // true. Practically, this is when the primary Profile gets ready. // + // In the disabling case: + // NEGOTIATING_TERMS_OF_SERVICE -> STOPPED + // CHECKING_ANDROID_MANAGEMENT -> STOPPED + // ACTIVE -> STOPPING -> (maybe REMOVING_DATA_DIR ->) STOPPED + // STOPPING: Eventually change the state to STOPPED. Do nothing + // immediately. + // REMOVING_DATA_DIR: Eventually state will become STOPPED. Do nothing + // immediately. + // // TODO(hidehiko): Fix the state machine, and update the comment including // relationship with |enable_requested_|. enum class State { @@ -86,6 +96,7 @@ CHECKING_ANDROID_MANAGEMENT, REMOVING_DATA_DIR, ACTIVE, + STOPPING, }; // Observer for those services outside of ARC which want to know ARC events. @@ -126,7 +137,7 @@ static ArcSessionManager* Get(); - // Exposed here for unit_tests validation. + // Returns true if OOBE flow is active currently. static bool IsOobeOptInActive(); // It is called from chrome/browser/prefs/browser_prefs.cc. @@ -244,6 +255,11 @@ // Service then passing Android management check successfully. void StartArcForTesting() { StartArc(); } + // Invokes OnTermsOfServiceNegotiated as if negotiation is done for testing. + void OnTermsOfServiceNegotiatedForTesting(bool accepted) { + OnTermsOfServiceNegotiated(accepted); + } + private: // Reports statuses of OptIn flow to UMA. class ScopedOptInFlowTracker; @@ -262,7 +278,6 @@ // ToS related code from ArcSessionManager into a dedicated class. bool IsArcTermsOfServiceNegotiationNeeded() const; - void SetState(State state); void ShutdownSession(); void OnArcSignInTimeout(); @@ -337,6 +352,11 @@ std::unique_ptr<ArcAppLauncher> playstore_launcher_; bool reenable_arc_ = false; bool provisioning_reported_ = false; + // In case ARC is started from OOBE |oobe_start_|, set to true. This flag is + // used to remember |IsOobeOptInActive| state when ARC start request was made. + // |IsOobeOptInActive| will be changed by the time when |oobe_start_| is + // checked to prevent the Play Store auto-launch. + bool oobe_start_ = false; base::OneShotTimer arc_sign_in_timer_; std::unique_ptr<ArcSupportHost> support_host_;
diff --git a/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc b/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc index 6d9ad6d..0efa612 100644 --- a/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc +++ b/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
@@ -239,8 +239,9 @@ ASSERT_EQ(ArcSessionManager::State::NEGOTIATING_TERMS_OF_SERVICE, arc_session_manager()->state()); - // TODO(hidehiko): Verify state transition from NEGOTIATING_TERMS_OF_SERVICE - // -> CHECKING_ANDROID_MANAGEMENT, when we extract ArcSessionManager. + arc_session_manager()->OnTermsOfServiceNegotiatedForTesting(true); + ASSERT_EQ(ArcSessionManager::State::CHECKING_ANDROID_MANAGEMENT, + arc_session_manager()->state()); arc_session_manager()->StartArcForTesting(); EXPECT_TRUE(arc_session_manager()->sign_in_start_time().is_null()); @@ -318,6 +319,9 @@ base::RunLoop().RunUntilIdle(); ASSERT_EQ(ArcSessionManager::State::NEGOTIATING_TERMS_OF_SERVICE, arc_session_manager()->state()); + arc_session_manager()->OnTermsOfServiceNegotiatedForTesting(true); + ASSERT_EQ(ArcSessionManager::State::CHECKING_ANDROID_MANAGEMENT, + arc_session_manager()->state()); arc_session_manager()->StartArcForTesting(); ASSERT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); @@ -345,7 +349,9 @@ arc_session_manager()->state()); // Emulate to accept the terms of service. - prefs->SetBoolean(prefs::kArcTermsAccepted, true); + arc_session_manager()->OnTermsOfServiceNegotiatedForTesting(true); + ASSERT_EQ(ArcSessionManager::State::CHECKING_ANDROID_MANAGEMENT, + arc_session_manager()->state()); arc_session_manager()->StartArcForTesting(); EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); EXPECT_TRUE(arc_session_manager()->IsSessionRunning()); @@ -415,6 +421,9 @@ profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); EXPECT_EQ(ArcSessionManager::State::NEGOTIATING_TERMS_OF_SERVICE, arc_session_manager()->state()); + arc_session_manager()->OnTermsOfServiceNegotiatedForTesting(true); + ASSERT_EQ(ArcSessionManager::State::CHECKING_ANDROID_MANAGEMENT, + arc_session_manager()->state()); arc_session_manager()->StartArcForTesting(); EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); @@ -449,6 +458,7 @@ TEST_F(ArcSessionManagerTest, IgnoreSecondErrorReporting) { arc_session_manager()->SetProfile(profile()); arc_session_manager()->RequestEnable(); + arc_session_manager()->OnTermsOfServiceNegotiatedForTesting(true); arc_session_manager()->StartArcForTesting(); EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); @@ -494,12 +504,7 @@ arc_session_manager()->RequestEnable(); base::RunLoop().RunUntilIdle(); ASSERT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); - - arc_session_manager()->StartArcForTesting(); - EXPECT_FALSE(arc_session_manager()->arc_start_time().is_null()); - - ASSERT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); ASSERT_TRUE(arc_session_manager()->IsSessionRunning()); arc_session_manager()->Shutdown(); @@ -577,16 +582,16 @@ backup_restore_pref_value().is_bool() && location_service_pref_value().is_bool(); EXPECT_EQ(expected_terms_skipping - ? ArcSessionManager::State::ACTIVE + ? ArcSessionManager::State::CHECKING_ANDROID_MANAGEMENT : ArcSessionManager::State::NEGOTIATING_TERMS_OF_SERVICE, arc_session_manager()->state()); // Complete provisioning if it's not done yet. - if (!expected_terms_skipping) { - arc_session_manager()->StartArcForTesting(); - arc_session_manager()->OnProvisioningFinished(ProvisioningResult::SUCCESS); - } + if (!expected_terms_skipping) + arc_session_manager()->OnTermsOfServiceNegotiatedForTesting(true); + arc_session_manager()->StartArcForTesting(); EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); + arc_session_manager()->OnProvisioningFinished(ProvisioningResult::SUCCESS); // Play Store app is launched unless the Terms screen was suppressed. EXPECT_NE(expected_terms_skipping, @@ -822,7 +827,8 @@ EXPECT_EQ(ArcSessionManager::State::NEGOTIATING_TERMS_OF_SERVICE, arc_session_manager()->state()); ReportResult(true); - EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); + EXPECT_EQ(ArcSessionManager::State::CHECKING_ANDROID_MANAGEMENT, + arc_session_manager()->state()); } TEST_P(ArcSessionOobeOptInNegotiatorTest, OobeTermsRejected) {
diff --git a/chrome/browser/chromeos/arc/notification/arc_provision_notification_service_unittest.cc b/chrome/browser/chromeos/arc/notification/arc_provision_notification_service_unittest.cc index 6a855d2e..151a924 100644 --- a/chrome/browser/chromeos/arc/notification/arc_provision_notification_service_unittest.cc +++ b/chrome/browser/chromeos/arc/notification/arc_provision_notification_service_unittest.cc
@@ -157,9 +157,12 @@ EXPECT_CALL(*arc_provision_notification_service_delegate(), ShowManagedProvisionNotification()); arc_session_manager()->RequestEnable(); - EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); Mock::VerifyAndClearExpectations( arc_provision_notification_service_delegate()); + EXPECT_EQ(ArcSessionManager::State::CHECKING_ANDROID_MANAGEMENT, + arc_session_manager()->state()); + arc_session_manager()->StartArcForTesting(); + EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); // Emulate successful provisioning. The notification gets removed. EXPECT_CALL(*arc_provision_notification_service_delegate(), @@ -218,9 +221,12 @@ EXPECT_CALL(*arc_provision_notification_service_delegate(), ShowManagedProvisionNotification()); arc_session_manager()->RequestEnable(); - EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); Mock::VerifyAndClearExpectations( arc_provision_notification_service_delegate()); + EXPECT_EQ(ArcSessionManager::State::CHECKING_ANDROID_MANAGEMENT, + arc_session_manager()->state()); + arc_session_manager()->StartArcForTesting(); + EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); // Emulate provisioning failure that leads to stopping ARC. The notification // gets removed. @@ -251,9 +257,12 @@ EXPECT_CALL(*arc_provision_notification_service_delegate(), ShowManagedProvisionNotification()); arc_session_manager()->RequestEnable(); - EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); Mock::VerifyAndClearExpectations( arc_provision_notification_service_delegate()); + EXPECT_EQ(ArcSessionManager::State::CHECKING_ANDROID_MANAGEMENT, + arc_session_manager()->state()); + arc_session_manager()->StartArcForTesting(); + EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); // Emulate provisioning failure that leads to showing an error screen without // shutting ARC down. The notification gets removed. @@ -288,7 +297,7 @@ arc_session_manager()->state()); // Emulate accepting the terms of service. - profile()->GetPrefs()->SetBoolean(prefs::kArcTermsAccepted, true); + arc_session_manager()->OnTermsOfServiceNegotiatedForTesting(true); arc_session_manager()->StartArcForTesting(); EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
diff --git a/chrome/browser/chromeos/arc/process/arc_process_service.h b/chrome/browser/chromeos/arc/process/arc_process_service.h index a3720cc..5e01a25 100644 --- a/chrome/browser/chromeos/arc/process/arc_process_service.h +++ b/chrome/browser/chromeos/arc/process/arc_process_service.h
@@ -50,7 +50,7 @@ public InstanceHolder<mojom::ProcessInstance>::Observer { public: using RequestProcessListCallback = - base::Callback<void(const std::vector<ArcProcess>&)>; + base::Callback<void(std::vector<ArcProcess>)>; explicit ArcProcessService(ArcBridgeService* bridge_service); ~ArcProcessService() override;
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc index 320ce28..ebddc814 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -620,8 +620,6 @@ // will ensure that loading is aborted on early exit. bool load_oem_statistics = !StartupUtils::IsOobeCompleted(); system::StatisticsProvider::GetInstance()->StartLoadingMachineStatistics( - content::BrowserThread::GetTaskRunnerForThread( - content::BrowserThread::FILE), load_oem_statistics); base::FilePath downloads_directory;
diff --git a/chrome/browser/chromeos/drive/drive_integration_service.cc b/chrome/browser/chromeos/drive/drive_integration_service.cc index 4c183d6..294c8cb 100644 --- a/chrome/browser/chromeos/drive/drive_integration_service.cc +++ b/chrome/browser/chromeos/drive/drive_integration_service.cc
@@ -294,15 +294,13 @@ resource_metadata_.reset(new internal::ResourceMetadata( metadata_storage_.get(), cache_.get(), blocking_task_runner_)); - file_task_runner_ = - BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); file_system_.reset( test_file_system ? test_file_system : new FileSystem( profile_->GetPrefs(), logger_.get(), cache_.get(), scheduler_.get(), resource_metadata_.get(), - blocking_task_runner_.get(), file_task_runner_.get(), + blocking_task_runner_.get(), cache_root_directory_.Append(kTemporaryFileDirectory))); download_handler_.reset(new DownloadHandler(file_system())); debug_info_collector_.reset(new DebugInfoCollector(
diff --git a/chrome/browser/chromeos/drive/drive_integration_service.h b/chrome/browser/chromeos/drive/drive_integration_service.h index 309cc2f..b0f486f 100644 --- a/chrome/browser/chromeos/drive/drive_integration_service.h +++ b/chrome/browser/chromeos/drive/drive_integration_service.h
@@ -172,7 +172,6 @@ base::FilePath cache_root_directory_; std::unique_ptr<EventLogger> logger_; scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; - scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; std::unique_ptr<internal::ResourceMetadataStorage, util::DestroyHelper> metadata_storage_; std::unique_ptr<internal::FileCache, util::DestroyHelper> cache_;
diff --git a/chrome/browser/chromeos/drive/file_system_util.cc b/chrome/browser/chromeos/drive/file_system_util.cc index 4ff9eb2..0ed7e25f 100644 --- a/chrome/browser/chromeos/drive/file_system_util.cc +++ b/chrome/browser/chromeos/drive/file_system_util.cc
@@ -20,6 +20,7 @@ #include "base/macros.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" +#include "base/task_scheduler/post_task.h" #include "base/threading/sequenced_worker_pool.h" #include "base/threading/thread_task_runner_handle.h" #include "chrome/browser/browser_process.h" @@ -193,8 +194,8 @@ FileSystemInterface* file_system = GetFileSystemByProfile(profile); if (!file_system || !IsUnderDriveMountPoint(path)) { - content::BrowserThread::GetBlockingPool()->PostTask( - FROM_HERE, + base::PostTaskWithTraits( + FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_BLOCKING}, base::BindOnce(callback, FILE_ERROR_FAILED, base::FilePath())); return; }
diff --git a/chrome/browser/chromeos/drive/fileapi/async_file_util.cc b/chrome/browser/chromeos/drive/fileapi/async_file_util.cc index bb3debda..d5b8df80 100644 --- a/chrome/browser/chromeos/drive/fileapi/async_file_util.cc +++ b/chrome/browser/chromeos/drive/fileapi/async_file_util.cc
@@ -10,6 +10,7 @@ #include "base/files/file_path.h" #include "base/logging.h" #include "base/single_thread_task_runner.h" +#include "base/task_scheduler/post_task.h" #include "base/threading/sequenced_worker_pool.h" #include "base/threading/thread_task_runner_handle.h" #include "chrome/browser/chromeos/drive/drive_integration_service.h" @@ -119,7 +120,9 @@ scoped_refptr<storage::ShareableFileReference> file_reference = storage::ShareableFileReference::GetOrCreate(storage::ScopedFile( - local_path, scope_out_policy, BrowserThread::GetBlockingPool())); + local_path, scope_out_policy, + base::CreateSequencedTaskRunnerWithTraits( + {base::MayBlock(), base::TaskPriority::USER_BLOCKING}))); callback.Run(error, file_info, local_path, file_reference); }
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc index 4c74e46..3b1302ff 100644 --- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc +++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -859,7 +859,8 @@ util_(delegate_.get()), component_extension_ime_manager_(new ComponentExtensionIMEManager()), enable_extension_loading_(enable_extension_loading), - is_ime_menu_activated_(false) { + is_ime_menu_activated_(false), + features_enabled_state_(InputMethodManager::FEATURE_ALL) { if (IsRunningAsSystemCompositor()) { #if defined(USE_OZONE) keyboard_ = base::MakeUnique<ImeKeyboardMus>( @@ -1275,5 +1276,18 @@ return base::FeatureList::IsEnabled(features::kEHVInputOnImeMenu); } +void InputMethodManagerImpl::SetImeMenuFeatureEnabled(ImeMenuFeature feature, + bool enabled) { + if (enabled) + features_enabled_state_ |= feature; + else + features_enabled_state_ &= ~feature; +} + +bool InputMethodManagerImpl::GetImeMenuFeatureEnabled( + ImeMenuFeature feature) const { + return features_enabled_state_ & feature; +} + } // namespace input_method } // namespace chromeos
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.h b/chrome/browser/chromeos/input_method/input_method_manager_impl.h index 7a4dd45..99e1cd6 100644 --- a/chrome/browser/chromeos/input_method/input_method_manager_impl.h +++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.h
@@ -105,7 +105,6 @@ InputMethodDescriptor GetCurrentInputMethod() const override; bool ReplaceEnabledInputMethods( const std::vector<std::string>& new_active_input_method_ids) override; - bool SetAllowedInputMethods( const std::vector<std::string>& new_allowed_input_method_ids) override; const std::vector<std::string>& GetAllowedInputMethods() override; @@ -183,6 +182,8 @@ void MaybeNotifyImeMenuActivationChanged() override; void OverrideKeyboardUrlRef(const std::string& keyset) override; bool IsEmojiHandwritingVoiceOnImeMenuEnabled() override; + void SetImeMenuFeatureEnabled(ImeMenuFeature feature, bool enabled) override; + bool GetImeMenuFeatureEnabled(ImeMenuFeature feature) const override; // chromeos::UserAddingScreen: void OnUserAddingStarted() override; @@ -299,6 +300,9 @@ // Whether the expanded IME menu is activated. bool is_ime_menu_activated_; + // The enabled state of keyboard features. + uint32_t features_enabled_state_; + // The engine map from extension_id to an engine. typedef std::map<std::string, ui::IMEEngineHandlerInterface*> EngineMap; typedef std::map<Profile*, EngineMap, ProfileCompare> ProfileEngineMap;
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc index 9253734..1bd121ff3 100644 --- a/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc +++ b/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
@@ -1506,5 +1506,43 @@ EXPECT_EQ(ImeIdFromEngineId(ids[1]), ime_controller.current_ime_id_); } +TEST_F(InputMethodManagerImplTest, SetFeaturesDisabled) { + // All features are enabled by default. + EXPECT_TRUE( + manager_->GetImeMenuFeatureEnabled(InputMethodManager::FEATURE_ALL)); + EXPECT_TRUE( + manager_->GetImeMenuFeatureEnabled(InputMethodManager::FEATURE_EMOJI)); + EXPECT_TRUE(manager_->GetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_HANDWRITING)); + EXPECT_TRUE( + manager_->GetImeMenuFeatureEnabled(InputMethodManager::FEATURE_VOICE)); + + // Sets emoji disabled and then enabled. + manager_->SetImeMenuFeatureEnabled(InputMethodManager::FEATURE_EMOJI, false); + EXPECT_FALSE( + manager_->GetImeMenuFeatureEnabled(InputMethodManager::FEATURE_EMOJI)); + manager_->SetImeMenuFeatureEnabled(InputMethodManager::FEATURE_EMOJI, true); + EXPECT_TRUE( + manager_->GetImeMenuFeatureEnabled(InputMethodManager::FEATURE_EMOJI)); + + // Sets voice disabled and then enabled. + manager_->SetImeMenuFeatureEnabled(InputMethodManager::FEATURE_VOICE, false); + EXPECT_FALSE( + manager_->GetImeMenuFeatureEnabled(InputMethodManager::FEATURE_VOICE)); + manager_->SetImeMenuFeatureEnabled(InputMethodManager::FEATURE_VOICE, true); + EXPECT_TRUE( + manager_->GetImeMenuFeatureEnabled(InputMethodManager::FEATURE_VOICE)); + + // Sets handwriting disabled and then enabled. + manager_->SetImeMenuFeatureEnabled(InputMethodManager::FEATURE_HANDWRITING, + false); + EXPECT_FALSE(manager_->GetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_HANDWRITING)); + manager_->SetImeMenuFeatureEnabled(InputMethodManager::FEATURE_HANDWRITING, + true); + EXPECT_TRUE(manager_->GetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_HANDWRITING)); +} + } // namespace input_method } // namespace chromeos
diff --git a/chrome/browser/chromeos/input_method/mode_indicator_controller.cc b/chrome/browser/chromeos/input_method/mode_indicator_controller.cc index 44869f0..6adac19f 100644 --- a/chrome/browser/chromeos/input_method/mode_indicator_controller.cc +++ b/chrome/browser/chromeos/input_method/mode_indicator_controller.cc
@@ -9,16 +9,20 @@ #include "ash/wm/window_util.h" #include "base/logging.h" #include "base/strings/utf_string_conversions.h" +#include "chrome/browser/chromeos/ash_config.h" +#include "mojo/public/cpp/bindings/type_converter.h" +#include "services/ui/public/cpp/property_type_converters.h" +#include "services/ui/public/interfaces/window_manager.mojom.h" #include "ui/base/ime/chromeos/input_method_util.h" -#include "ui/chromeos/ime/mode_indicator_view.h" namespace chromeos { namespace input_method { namespace { -ModeIndicatorObserverInterface* g_mode_indicator_observer_for_testing_ = NULL; -} // namespace +ModeIndicatorObserverInterface* g_mode_indicator_observer_for_testing = nullptr; + +// The non-test version of the interface. class ModeIndicatorObserver : public ModeIndicatorObserverInterface { public: ModeIndicatorObserver() @@ -49,6 +53,7 @@ views::Widget* active_widget_; }; +} // namespace ModeIndicatorController::ModeIndicatorController(InputMethodManager* imm) : imm_(imm), @@ -74,13 +79,7 @@ // static void ModeIndicatorController::SetModeIndicatorObserverForTesting( ModeIndicatorObserverInterface* observer) { - g_mode_indicator_observer_for_testing_ = observer; -} - -// static -ModeIndicatorObserverInterface* -ModeIndicatorController::GetModeIndicatorObserverForTesting() { - return g_mode_indicator_observer_for_testing_; + g_mode_indicator_observer_for_testing = observer; } void ModeIndicatorController::InputMethodChanged(InputMethodManager* manager, @@ -91,6 +90,22 @@ ShowModeIndicator(); } +void ModeIndicatorController::InitWidgetContainer( + views::Widget::InitParams* params) { + // The bubble needs to be placed in the proper ash window container, even + // though it is created by Chrome. + // TODO(crbug.com/738531): Consider moving the ModeIndicatorView into ash. + const int container_id = ash::kShellWindowId_SettingBubbleContainer; + if (chromeos::GetAshConfig() == ash::Config::MASH) { + using ui::mojom::WindowManager; + params->mus_properties[WindowManager::kContainerId_InitProperty] = + mojo::ConvertTo<std::vector<uint8_t>>(container_id); + } else { + params->parent = ash::Shell::GetContainer( + ash::wm::GetActiveWindow()->GetRootWindow(), container_id); + } +} + void ModeIndicatorController::ShowModeIndicator() { // TODO(komatsu): Show the mode indicator in the right bottom of the // display when the launch bar is hidden and the focus is out. To @@ -106,16 +121,13 @@ const base::string16 short_name = imm_->GetInputMethodUtil()->GetInputMethodShortName(descriptor); - aura::Window* parent = - ash::Shell::GetContainer(ash::wm::GetActiveWindow()->GetRootWindow(), - ash::kShellWindowId_SettingBubbleContainer); - ui::ime::ModeIndicatorView* mi_view = new ui::ime::ModeIndicatorView( - parent, cursor_bounds_, short_name); + ui::ime::ModeIndicatorView* mi_view = + new ui::ime::ModeIndicatorView(this, cursor_bounds_, short_name); views::BubbleDialogDelegateView::CreateBubble(mi_view); views::Widget* mi_widget = mi_view->GetWidget(); - if (GetModeIndicatorObserverForTesting()) - GetModeIndicatorObserverForTesting()->AddModeIndicatorWidget(mi_widget); + if (g_mode_indicator_observer_for_testing) + g_mode_indicator_observer_for_testing->AddModeIndicatorWidget(mi_widget); mi_observer_->AddModeIndicatorWidget(mi_widget); mi_view->ShowAndFadeOut();
diff --git a/chrome/browser/chromeos/input_method/mode_indicator_controller.h b/chrome/browser/chromeos/input_method/mode_indicator_controller.h index 1201c32..ec377032 100644 --- a/chrome/browser/chromeos/input_method/mode_indicator_controller.h +++ b/chrome/browser/chromeos/input_method/mode_indicator_controller.h
@@ -9,12 +9,14 @@ #include "base/macros.h" #include "ui/base/ime/chromeos/input_method_manager.h" +#include "ui/chromeos/ime/mode_indicator_view.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/widget/widget_observer.h" namespace chromeos { namespace input_method { +// Publicly visible for testing. class ModeIndicatorObserverInterface : public views::WidgetObserver { public: ModeIndicatorObserverInterface() {} @@ -26,10 +28,9 @@ // ModeIndicatorController is the controller of ModeIndicatiorDelegateView // on the MVC model. -class ModeIndicatorController - : public InputMethodManager::Observer { +class ModeIndicatorController : public InputMethodManager::Observer, + public ui::ime::ModeIndicatorView::Delegate { public: - // This class takes the ownership of |mi_widget|. explicit ModeIndicatorController(InputMethodManager* imm); ~ModeIndicatorController() override; @@ -44,7 +45,6 @@ // ownership of the observer object. static void SetModeIndicatorObserverForTesting( ModeIndicatorObserverInterface* observer); - static ModeIndicatorObserverInterface* GetModeIndicatorObserverForTesting(); private: // InputMethodManager::Observer implementation. @@ -52,6 +52,9 @@ Profile* profile, bool show_message) override; + // ui::ime::ModeIndicatorView::Delegate: + void InitWidgetContainer(views::Widget::InitParams* params) override; + // Show the mode inidicator with the current ime's short name if all // the conditions are cleared. void ShowModeIndicator();
diff --git a/chrome/browser/chromeos/net/client_cert_store_chromeos.cc b/chrome/browser/chromeos/net/client_cert_store_chromeos.cc index 75f67d37..05d577ed 100644 --- a/chrome/browser/chromeos/net/client_cert_store_chromeos.cc +++ b/chrome/browser/chromeos/net/client_cert_store_chromeos.cc
@@ -56,9 +56,9 @@ // Caller is responsible for keeping the ClientCertStore alive until the // callback is run. base::Callback<void(net::ClientCertIdentityList)> - get_platform_certs_and_filter = - base::Bind(&ClientCertStoreChromeOS::GotAdditionalCerts, - base::Unretained(this), &cert_request_info, callback); + get_platform_certs_and_filter = base::Bind( + &ClientCertStoreChromeOS::GotAdditionalCerts, base::Unretained(this), + base::Unretained(&cert_request_info), callback); base::Closure get_additional_certs_and_continue; if (cert_provider_) { @@ -86,7 +86,8 @@ base::WorkerPool::GetTaskRunner(true /* task_is_slow */).get(), FROM_HERE, base::Bind(&ClientCertStoreChromeOS::GetAndFilterCertsOnWorkerThread, - base::Unretained(this), password_delegate, request, + base::Unretained(this), password_delegate, + base::Unretained(request), base::Passed(&additional_certs)), callback)) { return;
diff --git a/chrome/browser/chromeos/policy/cloud_external_data_manager_base.cc b/chrome/browser/chromeos/policy/cloud_external_data_manager_base.cc index ce71a60..0afb0bcf 100644 --- a/chrome/browser/chromeos/policy/cloud_external_data_manager_base.cc +++ b/chrome/browser/chromeos/policy/cloud_external_data_manager_base.cc
@@ -149,6 +149,8 @@ // Used to download external data referenced by policies. std::unique_ptr<ExternalPolicyDataUpdater> updater_; + SEQUENCE_CHECKER(sequence_checker_); + DISALLOW_COPY_AND_ASSIGN(Backend); }; @@ -160,10 +162,13 @@ task_runner_(task_runner), callback_task_runner_(callback_task_runner), metadata_set_(false) { + // This class is allowed to be instantiated on any thread. + DETACH_FROM_SEQUENCE(sequence_checker_); } void CloudExternalDataManagerBase::Backend::SetExternalDataStore( std::unique_ptr<CloudExternalDataStore> external_data_store) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); external_data_store_ = std::move(external_data_store); if (metadata_set_ && external_data_store_) external_data_store_->Prune(metadata_); @@ -171,6 +176,7 @@ void CloudExternalDataManagerBase::Backend::Connect( std::unique_ptr<ExternalPolicyDataFetcher> external_policy_data_fetcher) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(!updater_); updater_.reset(new ExternalPolicyDataUpdater( task_runner_, std::move(external_policy_data_fetcher), @@ -182,11 +188,13 @@ } void CloudExternalDataManagerBase::Backend::Disconnect() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); updater_.reset(); } void CloudExternalDataManagerBase::Backend::OnMetadataUpdated( std::unique_ptr<Metadata> metadata) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); metadata_set_ = true; Metadata old_metadata; metadata_.swap(old_metadata); @@ -229,6 +237,7 @@ const std::string& policy, const std::string& hash, const std::string& data) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(metadata_.find(policy) != metadata_.end()); DCHECK_EQ(hash, metadata_[policy].hash); if (external_data_store_) @@ -246,6 +255,8 @@ void CloudExternalDataManagerBase::Backend::Fetch( const std::string& policy, const ExternalDataFetcher::FetchCallback& callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + Metadata::const_iterator metadata = metadata_.find(policy); if (metadata == metadata_.end()) { // If |policy| does not reference any external data, indicate permanent @@ -279,6 +290,7 @@ } void CloudExternalDataManagerBase::Backend::FetchAll() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Loop through all external data references. for (Metadata::const_iterator it = metadata_.begin(); it != metadata_.end(); ++it) { @@ -302,6 +314,8 @@ size_t CloudExternalDataManagerBase::Backend::GetMaxExternalDataSize( const std::string& policy) const { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (g_max_external_data_size_for_testing) return g_max_external_data_size_for_testing; @@ -319,12 +333,14 @@ void CloudExternalDataManagerBase::Backend::RunCallback( const ExternalDataFetcher::FetchCallback& callback, std::unique_ptr<std::string> data) const { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); callback_task_runner_->PostTask( FROM_HERE, base::BindOnce(callback, base::Passed(&data))); } void CloudExternalDataManagerBase::Backend::StartDownload( const std::string& policy) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(pending_downloads_.find(policy) != pending_downloads_.end()); if (!updater_) return;
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc index 20cc798..2edac9ed 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc +++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc
@@ -10,6 +10,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "base/command_line.h" +#include "base/debug/crash_logging.h" #include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" @@ -26,6 +27,7 @@ #include "chrome/browser/chromeos/policy/wildcard_login_checker.h" #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/common/chrome_content_client.h" +#include "chrome/common/crash_keys.h" #include "chromeos/chromeos_switches.h" #include "components/policy/core/common/cloud/cloud_external_data_manager.h" #include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h" @@ -135,6 +137,17 @@ scoped_refptr<net::URLRequestContextGetter> system_request_context) { DCHECK(device_management_service); DCHECK(local_state); + + // TODO(emaxx): Remove the crash key after the crashes tracked at + // https://crbug.com/685996 are fixed. + if (core()->client()) { + base::debug::SetCrashKeyToStackTrace( + crash_keys::kUserCloudPolicyManagerConnectTrace, connect_callstack_); + } else { + connect_callstack_ = base::debug::StackTrace(); + } + CHECK(!core()->client()); + local_state_ = local_state; // Note: |system_request_context| can be null for tests. // Use the system request context here instead of a context derived
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h index a7403924..1aff359 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h +++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h
@@ -9,6 +9,7 @@ #include <string> #include "base/compiler_specific.h" +#include "base/debug/stack_trace.h" #include "base/files/file_path.h" #include "base/macros.h" #include "base/memory/ref_counted.h" @@ -188,6 +189,11 @@ base::Time time_token_available_; base::Time time_client_registered_; + // Stack trace of the previous Connect() method call. + // TODO(emaxx): Remove after the crashes tracked at https://crbug.com/685996 + // are fixed. + base::debug::StackTrace connect_callstack_; + DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerChromeOS); };
diff --git a/chrome/browser/content_settings/content_settings_origin_identifier_value_map_unittest.cc b/chrome/browser/content_settings/content_settings_origin_identifier_value_map_unittest.cc index ca78f210..b295a1e 100644 --- a/chrome/browser/content_settings/content_settings_origin_identifier_value_map_unittest.cc +++ b/chrome/browser/content_settings/content_settings_origin_identifier_value_map_unittest.cc
@@ -9,6 +9,7 @@ #include "base/values.h" #include "components/content_settings/core/browser/content_settings_rule.h" #include "components/content_settings/core/browser/content_settings_utils.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h"
diff --git a/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc b/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc index 637c5b5..27990e8 100644 --- a/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc +++ b/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc
@@ -19,6 +19,7 @@ #include "components/content_settings/core/browser/content_settings_rule.h" #include "components/content_settings/core/browser/content_settings_utils.h" #include "components/content_settings/core/common/content_settings_pattern.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "components/content_settings/core/common/pref_names.h" #include "components/content_settings/core/test/content_settings_test_utils.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/content_settings/content_settings_supervised_provider_unittest.cc b/chrome/browser/content_settings/content_settings_supervised_provider_unittest.cc index 759c769..1e14de8 100644 --- a/chrome/browser/content_settings/content_settings_supervised_provider_unittest.cc +++ b/chrome/browser/content_settings/content_settings_supervised_provider_unittest.cc
@@ -13,6 +13,7 @@ #include "chrome/browser/supervised_user/supervised_user_settings_service.h" #include "components/content_settings/core/browser/content_settings_rule.h" #include "components/content_settings/core/browser/content_settings_utils.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "components/prefs/testing_pref_store.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc index 08c6d098..46d1544 100644 --- a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc +++ b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc
@@ -6,6 +6,7 @@ #include <string> #include <utility> +#include <vector> #include "base/memory/ptr_util.h" #include "chrome/browser/data_use_measurement/chrome_data_use_recorder.h" @@ -172,6 +173,9 @@ if (!recorder) return; + for (auto& observer : observers_) + observer.OnPageResourceLoad(request, &recorder->data_use()); + const content::ResourceRequestInfo* request_info = content::ResourceRequestInfo::ForRequest(&request); if (!request_info || @@ -197,9 +201,6 @@ if (entry == data_use_recorders_.end()) return; - for (auto& observer : observers_) - observer.OnPageResourceLoad(*request, &entry->data_use()); - const auto main_frame_it = main_render_frame_entry_map_.find(entry->main_frame_id()); @@ -310,7 +311,8 @@ int render_frame_id, const GURL& gurl, bool is_same_page_navigation, - uint32_t page_transition) { + uint32_t page_transition, + base::TimeTicks time) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); RenderFrameHostID main_frame(render_process_id, render_frame_id); @@ -376,7 +378,6 @@ DataUseRecorderEntry old_frame_entry = main_frame_it->second.data_use_recorder; old_frame_entry->set_page_transition(page_transition); - NotifyPageLoadCommit(old_frame_entry); if (is_same_page_navigation) { std::vector<net::URLRequest*> pending_url_requests; @@ -386,12 +387,9 @@ entry->MovePendingURLRequestTo(&(*old_frame_entry), request); } data_use_recorders_.erase(entry); - } else { - if (old_frame_entry->IsDataUseComplete()) { - NotifyDataUseCompleted(old_frame_entry); - data_use_recorders_.erase(old_frame_entry); - } + NotifyPageLoadCommit(old_frame_entry); + } else { DataUse& data_use = entry->data_use(); DCHECK(!data_use.url().is_valid() || data_use.url() == gurl) << "is valid: " << data_use.url().is_valid() @@ -401,8 +399,31 @@ data_use.set_url(gurl); } + // |time| is when navigation commit finished in UI thread. Before this + // navigation finish is processed in IO thread, there could be some + // subresource requests started and get asribed to |old_frame_entry|. Move + // these requests that started after |time| but ascribed to the previous + // page load to page load |entry|. + // TODO(rajendrant): This does not move completed requests. It is possible + // that requests could complete (more likely for cached requests) before + // this code is executed. crbug.com/738522 + std::vector<net::URLRequest*> pending_url_requests; + old_frame_entry->GetPendingURLRequests(&pending_url_requests); + for (net::URLRequest* request : pending_url_requests) { + DCHECK( + !old_frame_entry->GetPendingURLRequestStartTime(request).is_null()); + if (old_frame_entry->GetPendingURLRequestStartTime(request) > time) { + old_frame_entry->MovePendingURLRequestTo(&*entry, request); + AscribeRecorderWithRequest(request, entry); + } + } + if (old_frame_entry->IsDataUseComplete()) { + NotifyDataUseCompleted(old_frame_entry); + data_use_recorders_.erase(old_frame_entry); + } entry->set_is_visible(main_frame_it->second.is_visible); main_frame_it->second.data_use_recorder = entry; + NotifyPageLoadCommit(entry); } }
diff --git a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h index 9dc1530..9f30e21 100644 --- a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h +++ b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h
@@ -15,6 +15,7 @@ #include "base/hash.h" #include "base/macros.h" #include "base/supports_user_data.h" +#include "base/time/time.h" #include "chrome/browser/data_use_measurement/chrome_data_use_recorder.h" #include "components/data_use_measurement/core/data_use_ascriber.h" #include "content/public/browser/global_request_id.h" @@ -91,6 +92,14 @@ int render_process_id, int render_frame_id); + // Called when the main frame navigation is committed in the renderer. + void DidFinishMainFrameNavigation(int render_process_id, + int render_frame_id, + const GURL& gurl, + bool is_same_page_navigation, + uint32_t page_transition, + base::TimeTicks time); + // Called every time the WebContents changes visibility. void WasShownOrHidden(int main_render_process_id, int main_render_frame_id, @@ -102,12 +111,6 @@ int new_render_process_id, int new_render_frame_id); - void DidFinishMainFrameNavigation(int render_process_id, - int render_frame_id, - const GURL& gurl, - bool is_same_page_navigation, - uint32_t page_transition); - private: friend class ChromeDataUseAscriberTest;
diff --git a/chrome/browser/data_use_measurement/chrome_data_use_ascriber_service.cc b/chrome/browser/data_use_measurement/chrome_data_use_ascriber_service.cc index 087ddf6e..c0a6776 100644 --- a/chrome/browser/data_use_measurement/chrome_data_use_ascriber_service.cc +++ b/chrome/browser/data_use_measurement/chrome_data_use_ascriber_service.cc
@@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/memory/ptr_util.h" +#include "base/time/time.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/data_use_measurement/chrome_data_use_ascriber.h" #include "chrome/browser/io_thread.h" @@ -173,13 +174,13 @@ content::WebContents* web_contents = navigation_handle->GetWebContents(); content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, - base::BindOnce(&ChromeDataUseAscriber::DidFinishMainFrameNavigation, - base::Unretained(ascriber_), - web_contents->GetRenderProcessHost()->GetID(), - web_contents->GetMainFrame()->GetRoutingID(), - navigation_handle->GetURL(), - navigation_handle->IsSameDocument(), - navigation_handle->GetPageTransition())); + base::BindOnce( + &ChromeDataUseAscriber::DidFinishMainFrameNavigation, + base::Unretained(ascriber_), + web_contents->GetRenderProcessHost()->GetID(), + web_contents->GetMainFrame()->GetRoutingID(), + navigation_handle->GetURL(), navigation_handle->IsSameDocument(), + navigation_handle->GetPageTransition(), base::TimeTicks::Now())); } void ChromeDataUseAscriberService::SetDataUseAscriber(
diff --git a/chrome/browser/data_use_measurement/chrome_data_use_ascriber_unittest.cc b/chrome/browser/data_use_measurement/chrome_data_use_ascriber_unittest.cc index 48e011f6..0c52675 100644 --- a/chrome/browser/data_use_measurement/chrome_data_use_ascriber_unittest.cc +++ b/chrome/browser/data_use_measurement/chrome_data_use_ascriber_unittest.cc
@@ -124,9 +124,9 @@ ascriber()->ReadyToCommitMainFrameNavigation( content::GlobalRequestID(kRenderProcessId, 0), kRenderProcessId, kRenderFrameId); - ascriber()->DidFinishMainFrameNavigation(kRenderProcessId, kRenderFrameId, - GURL("http://test.com"), false, - kPageTransition); + ascriber()->DidFinishMainFrameNavigation( + kRenderProcessId, kRenderFrameId, GURL("http://test.com"), false, + kPageTransition, base::TimeTicks::Now()); ascriber()->WasShownOrHidden(kRenderProcessId, kRenderFrameId, true); EXPECT_TRUE(ascriber()->GetDataUseRecorder(*request)->is_visible()); @@ -147,9 +147,9 @@ ascriber()->ReadyToCommitMainFrameNavigation( content::GlobalRequestID(kRenderProcessId, 0), kRenderProcessId, kRenderFrameId); - ascriber()->DidFinishMainFrameNavigation(kRenderProcessId, kRenderFrameId, - GURL("http://test.com"), false, - kPageTransition); + ascriber()->DidFinishMainFrameNavigation( + kRenderProcessId, kRenderFrameId, GURL("http://test.com"), false, + kPageTransition, base::TimeTicks::Now()); ascriber()->WasShownOrHidden(kRenderProcessId, kRenderFrameId, false); EXPECT_FALSE(ascriber()->GetDataUseRecorder(*request)->is_visible()); @@ -170,9 +170,9 @@ ascriber()->ReadyToCommitMainFrameNavigation( content::GlobalRequestID(kRenderProcessId, 0), kRenderProcessId, kRenderFrameId); - ascriber()->DidFinishMainFrameNavigation(kRenderProcessId, kRenderFrameId, - GURL("http://test.com"), false, - kPageTransition); + ascriber()->DidFinishMainFrameNavigation( + kRenderProcessId, kRenderFrameId, GURL("http://test.com"), false, + kPageTransition, base::TimeTicks::Now()); ascriber()->WasShownOrHidden(kRenderProcessId, kRenderFrameId, true); EXPECT_TRUE(ascriber()->GetDataUseRecorder(*request)->is_visible()); @@ -208,9 +208,9 @@ ascriber()->ReadyToCommitMainFrameNavigation( content::GlobalRequestID(kRenderProcessId, 0), kRenderProcessId, kRenderFrameId); - ascriber()->DidFinishMainFrameNavigation(kRenderProcessId, kRenderFrameId, - GURL("http://mobile.test.com"), - false, kPageTransition); + ascriber()->DidFinishMainFrameNavigation( + kRenderProcessId, kRenderFrameId, GURL("http://mobile.test.com"), false, + kPageTransition, base::TimeTicks::Now()); // Navigation commit should merge the two data use recorder entries. EXPECT_EQ(1u, recorders().size()); @@ -248,9 +248,9 @@ ascriber()->ReadyToCommitMainFrameNavigation( content::GlobalRequestID(kRenderProcessId, 0), kRenderProcessId, kRenderFrameId); - ascriber()->DidFinishMainFrameNavigation(kRenderProcessId, kRenderFrameId, - GURL("http://mobile.test.com"), - false, kPageTransition); + ascriber()->DidFinishMainFrameNavigation( + kRenderProcessId, kRenderFrameId, GURL("http://mobile.test.com"), false, + kPageTransition, base::TimeTicks::Now()); std::unique_ptr<net::URLRequest> page_load_b_main_frame_request = CreateNewRequest("http://test_2.com", true, kRequestId + 1, @@ -269,9 +269,9 @@ ascriber()->ReadyToCommitMainFrameNavigation( content::GlobalRequestID(kRenderProcessId, 0), kRenderProcessId, kRenderFrameId); - ascriber()->DidFinishMainFrameNavigation(kRenderProcessId, kRenderFrameId, - GURL("http://mobile.test_2.com"), - false, kPageTransition); + ascriber()->DidFinishMainFrameNavigation( + kRenderProcessId, kRenderFrameId, GURL("http://mobile.test_2.com"), false, + kPageTransition, base::TimeTicks::Now()); // Delete the first main frame request. ascriber()->OnUrlRequestDestroyed(page_load_a_main_frame_request.get()); @@ -299,6 +299,90 @@ EXPECT_EQ(0u, recorders().size()); } +// Verifies that navigation finish acts as the event that separates pageloads. +// subresource requests started before the navigation commit has finished are +// ascribed to the previous page load, and requests started after are ascribed +// to the next page load. +TEST_F(ChromeDataUseAscriberTest, SubResourceRequestsAfterNavigationFinish) { + std::unique_ptr<net::URLRequest> page_load_a_mainresource = CreateNewRequest( + "http://test.com", true, kRequestId, kRenderProcessId, kRenderFrameId); + std::unique_ptr<net::URLRequest> page_load_a_subresource = + CreateNewRequest("http://test.com/subresource", false, kRequestId + 1, + kRenderProcessId, kRenderFrameId); + + // First page load 'a'. + ascriber()->RenderFrameCreated(kRenderProcessId, kRenderFrameId, -1, -1); + ascriber()->OnBeforeUrlRequest(page_load_a_mainresource.get()); + ascriber()->DidStartMainFrameNavigation(GURL("http://test.com"), + kRenderProcessId, kRenderFrameId, + kNavigationHandle); + ascriber()->ReadyToCommitMainFrameNavigation( + content::GlobalRequestID(kRenderProcessId, 0), kRenderProcessId, + kRenderFrameId); + ascriber()->DidFinishMainFrameNavigation( + kRenderProcessId, kRenderFrameId, GURL("http://mobile.test.com"), false, + kPageTransition, base::TimeTicks::Now()); + + ascriber()->OnBeforeUrlRequest(page_load_a_subresource.get()); + ascriber()->OnUrlRequestDestroyed(page_load_a_mainresource.get()); + + EXPECT_EQ(1u, recorders().size()); + auto& page_load_a_recorder = recorders().front(); + EXPECT_EQ(RenderFrameHostID(kRenderProcessId, kRenderFrameId), + page_load_a_recorder.main_frame_id()); + EXPECT_EQ(content::GlobalRequestID(kRenderProcessId, 0), + page_load_a_recorder.main_frame_request_id()); + EXPECT_EQ(GURL("http://mobile.test.com"), + page_load_a_recorder.data_use().url()); + EXPECT_EQ(DataUse::TrafficType::USER_TRAFFIC, + page_load_a_recorder.data_use().traffic_type()); + + std::unique_ptr<net::URLRequest> page_load_b_mainresource = + CreateNewRequest("http://test_2.com", true, kRequestId + 2, + kRenderProcessId, kRenderFrameId); + std::unique_ptr<net::URLRequest> page_load_b_subresource = + CreateNewRequest("http://test_2.com/subresource", false, kRequestId + 3, + kRenderProcessId, kRenderFrameId); + + // Second page load 'b' on the same main render frame. + ascriber()->OnBeforeUrlRequest(page_load_b_mainresource.get()); + ascriber()->DidStartMainFrameNavigation(GURL("http://test_2.com"), + kRenderProcessId, kRenderFrameId, + kNavigationHandle); + ascriber()->ReadyToCommitMainFrameNavigation( + content::GlobalRequestID(kRenderProcessId, 0), kRenderProcessId, + kRenderFrameId); + ascriber()->DidFinishMainFrameNavigation( + kRenderProcessId, kRenderFrameId, GURL("http://mobile.test_2.com"), false, + kPageTransition, base::TimeTicks::Now()); + + ascriber()->OnBeforeUrlRequest(page_load_b_subresource.get()); + ascriber()->OnNetworkBytesReceived(page_load_b_subresource.get(), 200); + ascriber()->OnNetworkBytesReceived(page_load_a_subresource.get(), 100); + + // Previous page recorder still exists. + EXPECT_EQ(2u, recorders().size()); + auto& page_load_b_recorder = recorders().back(); + EXPECT_EQ(RenderFrameHostID(kRenderProcessId, kRenderFrameId), + page_load_b_recorder.main_frame_id()); + EXPECT_EQ(content::GlobalRequestID(kRenderProcessId, 0), + page_load_b_recorder.main_frame_request_id()); + EXPECT_EQ(GURL("http://mobile.test_2.com"), + page_load_b_recorder.data_use().url()); + EXPECT_EQ(DataUse::TrafficType::USER_TRAFFIC, + page_load_b_recorder.data_use().traffic_type()); + + // Verify the data usage. + EXPECT_EQ(100, page_load_a_recorder.data_use().total_bytes_received()); + EXPECT_EQ(200, page_load_b_recorder.data_use().total_bytes_received()); + + ascriber()->OnUrlRequestDestroyed(page_load_a_subresource.get()); + ascriber()->OnUrlRequestDestroyed(page_load_b_subresource.get()); + ascriber()->OnUrlRequestDestroyed(page_load_b_mainresource.get()); + ascriber()->RenderFrameDeleted(kRenderProcessId, kRenderFrameId, -1, -1); + EXPECT_EQ(0u, recorders().size()); +} + TEST_F(ChromeDataUseAscriberTest, FailedMainFrameNavigation) { std::unique_ptr<net::URLRequest> request = CreateNewRequest( "http://test.com", true, kRequestId, kRenderProcessId, kRenderFrameId); @@ -345,18 +429,16 @@ kRenderFrameId); EXPECT_EQ(2u, recorders().size()); - DataUse* data_use = &recorders().front().data_use(); + DataUse* data_use = &recorders().back().data_use(); - EXPECT_CALL(mock_observer, - OnPageResourceLoad(testing::_, &recorders().back().data_use())) - .Times(1); + EXPECT_CALL(mock_observer, OnPageResourceLoad(testing::_, data_use)).Times(1); ascriber()->OnUrlRequestCompleted(*request, false); EXPECT_CALL(mock_observer, OnPageLoadCommit(data_use)).Times(1); EXPECT_CALL(mock_observer, OnPageLoadComplete(testing::_)).Times(1); - ascriber()->DidFinishMainFrameNavigation(kRenderProcessId, kRenderFrameId, - GURL("http://mobile.test.com"), - false, kPageTransition); + ascriber()->DidFinishMainFrameNavigation( + kRenderProcessId, kRenderFrameId, GURL("http://mobile.test.com"), false, + kPageTransition, base::TimeTicks::Now()); EXPECT_EQ(1u, recorders().size()); auto& recorder_entry = recorders().front();
diff --git a/chrome/browser/download/chrome_download_manager_delegate_unittest.cc b/chrome/browser/download/chrome_download_manager_delegate_unittest.cc index ed6f7b6d..e07149d 100644 --- a/chrome/browser/download/chrome_download_manager_delegate_unittest.cc +++ b/chrome/browser/download/chrome_download_manager_delegate_unittest.cc
@@ -368,8 +368,8 @@ base::RunLoop loop_runner; bool result = false; delegate()->CheckForFileExistence( - download_item, - base::Bind(&StoreBoolAndRunClosure, loop_runner.QuitClosure(), &result)); + download_item, base::BindOnce(&StoreBoolAndRunClosure, + loop_runner.QuitClosure(), &result)); loop_runner.Run(); return result; }
diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc index d478607..1f2bca5 100644 --- a/chrome/browser/download/download_prefs.cc +++ b/chrome/browser/download/download_prefs.cc
@@ -130,8 +130,8 @@ // Ensure that the default download directory exists. BrowserThread::PostTask( BrowserThread::FILE, FROM_HERE, - base::Bind(base::IgnoreResult(&base::CreateDirectory), - GetDefaultDownloadDirectoryForProfile())); + base::BindOnce(base::IgnoreResult(&base::CreateDirectory), + GetDefaultDownloadDirectoryForProfile())); #endif // defined(OS_CHROMEOS) #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MACOSX)
diff --git a/chrome/browser/download/download_target_determiner.cc b/chrome/browser/download/download_target_determiner.cc index ecc7952..9a32c252 100644 --- a/chrome/browser/download/download_target_determiner.cc +++ b/chrome/browser/download/download_target_determiner.cc
@@ -482,14 +482,10 @@ // The GetPlugins call causes the plugin list to be refreshed. Once that's // done we can retry the GetPluginInfo call. We break out of this cycle // after a single retry in order to avoid retrying indefinitely. - plugin_service->GetPlugins( - base::Bind(&InvokeClosureAfterGetPluginCallback, - base::Bind(&IsHandledBySafePlugin, - resource_context, - url, - mime_type, - IGNORE_IF_STALE_PLUGIN_LIST, - callback))); + plugin_service->GetPlugins(base::BindOnce( + &InvokeClosureAfterGetPluginCallback, + base::Bind(&IsHandledBySafePlugin, resource_context, url, mime_type, + IGNORE_IF_STALE_PLUGIN_LIST, callback))); return; } // In practice, we assume that retrying once is enough.
diff --git a/chrome/browser/download/download_target_determiner_unittest.cc b/chrome/browser/download/download_target_determiner_unittest.cc index 9edd1bb..5398afe7 100644 --- a/chrome/browser/download/download_target_determiner_unittest.cc +++ b/chrome/browser/download/download_target_determiner_unittest.cc
@@ -2112,7 +2112,7 @@ #endif base::RunLoop run_loop; content::PluginService::GetInstance()->GetPlugins( - base::Bind(&DummyGetPluginsCallback, run_loop.QuitClosure())); + base::BindOnce(&DummyGetPluginsCallback, run_loop.QuitClosure())); run_loop.Run(); #if !defined(OS_WIN) content::RenderProcessHost::SetRunRendererInProcess(false);
diff --git a/chrome/browser/download/notification/download_notification_browsertest.cc b/chrome/browser/download/notification/download_notification_browsertest.cc index ce5a483..5b9fe75 100644 --- a/chrome/browser/download/notification/download_notification_browsertest.cc +++ b/chrome/browser/download/notification/download_notification_browsertest.cc
@@ -280,7 +280,7 @@ content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, - base::Bind(&net::URLRequestSlowDownloadJob::AddUrlHandler)); + base::BindOnce(&net::URLRequestSlowDownloadJob::AddUrlHandler)); GetMessageCenter()->DisableTimersForTest();
diff --git a/chrome/browser/engagement/important_sites_util.cc b/chrome/browser/engagement/important_sites_util.cc index a9133c9..09dd032 100644 --- a/chrome/browser/engagement/important_sites_util.cc +++ b/chrome/browser/engagement/important_sites_util.cc
@@ -264,7 +264,7 @@ // wildcard patterns. std::set<GURL> content_origins; for (const ContentSettingPatternSource& site : content_settings_list) { - if (site.setting != CONTENT_SETTING_ALLOW) + if (site.GetContentSetting() != CONTENT_SETTING_ALLOW) continue; MaybePopulateImportantInfoForReason(GURL(site.primary_pattern.ToString()), &content_origins, reason, output);
diff --git a/chrome/browser/engagement/site_engagement_service.cc b/chrome/browser/engagement/site_engagement_service.cc index cd287187..bc55664 100644 --- a/chrome/browser/engagement/site_engagement_service.cc +++ b/chrome/browser/engagement/site_engagement_service.cc
@@ -75,7 +75,7 @@ // Fetch URLs of sites for which notifications are allowed. for (const auto& site : GetContentSettingsFromProfile( profile, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)) { - if (site.setting != CONTENT_SETTING_ALLOW) + if (site.GetContentSetting() != CONTENT_SETTING_ALLOW) continue; urls.insert(GURL(site.primary_pattern.ToString())); }
diff --git a/chrome/browser/engagement/site_engagement_service_unittest.cc b/chrome/browser/engagement/site_engagement_service_unittest.cc index 87eff98..ae735a0f 100644 --- a/chrome/browser/engagement/site_engagement_service_unittest.cc +++ b/chrome/browser/engagement/site_engagement_service_unittest.cc
@@ -208,7 +208,8 @@ content::BrowserThread::GetTaskRunnerForThread(thread_id)->PostTaskAndReply( FROM_HERE, base::BindOnce(&SiteEngagementServiceTest::CheckScoreFromSettings, - base::Unretained(this), settings_map, url, &score), + base::Unretained(this), base::RetainedRef(settings_map), + url, &score), run_loop.QuitClosure()); run_loop.Run(); return score;
diff --git a/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.cc b/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.cc index 5a406e3..ec59bcf 100644 --- a/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.cc +++ b/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.cc
@@ -128,10 +128,10 @@ void BrailleControllerImpl::AddObserver(BrailleObserver* observer) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - if (!BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, - base::Bind( - &BrailleControllerImpl::StartConnecting, - base::Unretained(this)))) { + if (!BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, + base::BindOnce(&BrailleControllerImpl::StartConnecting, + base::Unretained(this)))) { NOTREACHED(); } observers_.AddObserver(observer); @@ -173,12 +173,10 @@ // ENOENT). BrowserThread::PostTaskAndReply( BrowserThread::FILE, FROM_HERE, - base::Bind( - &BrailleControllerImpl::StartWatchingSocketDirOnFileThread, - base::Unretained(this)), - base::Bind( - &BrailleControllerImpl::TryToConnect, - base::Unretained(this))); + base::BindOnce(&BrailleControllerImpl::StartWatchingSocketDirOnFileThread, + base::Unretained(this)), + base::BindOnce(&BrailleControllerImpl::TryToConnect, + base::Unretained(this))); ResetRetryConnectHorizon(); } @@ -201,9 +199,9 @@ return; } BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, base::Bind( - &BrailleControllerImpl::OnSocketDirChangedOnIOThread, - base::Unretained(this))); + BrowserThread::IO, FROM_HERE, + base::BindOnce(&BrailleControllerImpl::OnSocketDirChangedOnIOThread, + base::Unretained(this))); } void BrailleControllerImpl::OnSocketDirChangedOnIOThread() { @@ -261,11 +259,11 @@ } VLOG(1) << "Scheduling connection retry to brlapi"; connect_scheduled_ = true; - BrowserThread::PostDelayedTask(BrowserThread::IO, FROM_HERE, - base::Bind( - &BrailleControllerImpl::TryToConnect, - base::Unretained(this)), - delay); + BrowserThread::PostDelayedTask( + BrowserThread::IO, FROM_HERE, + base::BindOnce(&BrailleControllerImpl::TryToConnect, + base::Unretained(this)), + delay); } void BrailleControllerImpl::Disconnect() { @@ -307,11 +305,10 @@ void BrailleControllerImpl::DispatchKeyEvent(std::unique_ptr<KeyEvent> event) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - base::Bind( - &BrailleControllerImpl::DispatchKeyEvent, - base::Unretained(this), - base::Passed(&event))); + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, + base::BindOnce(&BrailleControllerImpl::DispatchKeyEvent, + base::Unretained(this), base::Passed(&event))); return; } VLOG(1) << "Dispatching key event: " << *event->ToValue(); @@ -324,9 +321,9 @@ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { if (!BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::Bind(&BrailleControllerImpl::DispatchOnDisplayStateChanged, - base::Unretained(this), - base::Passed(&new_state)))) { + base::BindOnce( + &BrailleControllerImpl::DispatchOnDisplayStateChanged, + base::Unretained(this), base::Passed(&new_state)))) { NOTREACHED(); } return;
diff --git a/chrome/browser/extensions/api/braille_display_private/braille_display_private_apitest.cc b/chrome/browser/extensions/api/braille_display_private/braille_display_private_apitest.cc index 3873e64..fc092a6 100644 --- a/chrome/browser/extensions/api/braille_display_private/braille_display_private_apitest.cc +++ b/chrome/browser/extensions/api/braille_display_private/braille_display_private_apitest.cc
@@ -72,9 +72,10 @@ data_->connected = true; on_data_ready_ = on_data_ready; if (!data_->pending_keys.empty()) { - BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, - base::Bind(&MockBrlapiConnection::NotifyDataReady, - base::Unretained(this))); + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, + base::BindOnce(&MockBrlapiConnection::NotifyDataReady, + base::Unretained(this))); } return CONNECT_SUCCESS; } @@ -85,8 +86,9 @@ data_->display_columns *= 2; BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::Bind(&BrailleControllerImpl::PokeSocketDirForTesting, - base::Unretained(BrailleControllerImpl::GetInstance()))); + base::BindOnce( + &BrailleControllerImpl::PokeSocketDirForTesting, + base::Unretained(BrailleControllerImpl::GetInstance()))); } } @@ -132,9 +134,10 @@ void NotifyDataReady() { on_data_ready_.Run(); if (!data_->pending_keys.empty()) { - BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, - base::Bind(&MockBrlapiConnection::NotifyDataReady, - base::Unretained(this))); + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, + base::BindOnce(&MockBrlapiConnection::NotifyDataReady, + base::Unretained(this))); } }
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_api.cc b/chrome/browser/extensions/api/content_settings/content_settings_api.cc index efbf63b2..18bcd11 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_api.cc +++ b/chrome/browser/extensions/api/content_settings/content_settings_api.cc
@@ -280,10 +280,10 @@ return true; } - PluginService::GetInstance()->GetPlugins( - base::Bind(&ContentSettingsContentSettingGetResourceIdentifiersFunction:: - OnGotPlugins, - this)); + PluginService::GetInstance()->GetPlugins(base::BindOnce( + &ContentSettingsContentSettingGetResourceIdentifiersFunction:: + OnGotPlugins, + this)); return true; }
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_store.cc b/chrome/browser/extensions/api/content_settings/content_settings_store.cc index aeab4cc..050dd7ed 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_store.cc +++ b/chrome/browser/extensions/api/content_settings/content_settings_store.cc
@@ -19,6 +19,7 @@ #include "components/content_settings/core/browser/content_settings_origin_identifier_value_map.h" #include "components/content_settings/core/browser/content_settings_rule.h" #include "components/content_settings/core/browser/content_settings_utils.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "content/public/browser/browser_thread.h" using content::BrowserThread; @@ -27,7 +28,6 @@ using content_settings::RuleIterator; using content_settings::OriginIdentifierValueMap; using content_settings::ResourceIdentifier; -using content_settings::ValueToContentSetting; namespace extensions { @@ -276,7 +276,8 @@ helpers::ContentSettingsTypeToString(key.content_type)); setting_dict->SetString(keys::kResourceIdentifierKey, key.resource_identifier); - ContentSetting content_setting = ValueToContentSetting(rule.value.get()); + ContentSetting content_setting = + content_settings::ValueToContentSetting(rule.value.get()); DCHECK_NE(CONTENT_SETTING_DEFAULT, content_setting); std::string setting_string =
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_store_unittest.cc b/chrome/browser/extensions/api/content_settings/content_settings_store_unittest.cc index 02ab848..f516ce4 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_store_unittest.cc +++ b/chrome/browser/extensions/api/content_settings/content_settings_store_unittest.cc
@@ -14,6 +14,7 @@ #include "components/content_settings/core/browser/content_settings_registry.h" #include "components/content_settings/core/browser/content_settings_rule.h" #include "components/content_settings/core/browser/content_settings_utils.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "components/content_settings/core/test/content_settings_test_utils.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/extensions/api/cookies/cookies_api.cc b/chrome/browser/extensions/api/cookies/cookies_api.cc index ac15e13..ea47d94 100644 --- a/chrome/browser/extensions/api/cookies/cookies_api.cc +++ b/chrome/browser/extensions/api/cookies/cookies_api.cc
@@ -240,7 +240,7 @@ store_browser_context_->GetURLRequestContext()->cookie_store(); cookies_helpers::GetCookieListFromStore( cookie_store, url_, - base::Bind(&CookiesGetFunction::GetCookieCallback, this)); + base::BindOnce(&CookiesGetFunction::GetCookieCallback, this)); } void CookiesGetFunction::GetCookieCallback(const net::CookieList& cookie_list) { @@ -311,7 +311,7 @@ store_browser_context_->GetURLRequestContext()->cookie_store(); cookies_helpers::GetCookieListFromStore( cookie_store, url_, - base::Bind(&CookiesGetAllFunction::GetAllCookiesCallback, this)); + base::BindOnce(&CookiesGetAllFunction::GetAllCookiesCallback, this)); } void CookiesGetAllFunction::GetAllCookiesCallback( @@ -414,7 +414,7 @@ : false, same_site, net::COOKIE_PRIORITY_DEFAULT, - base::Bind(&CookiesSetFunction::PullCookie, this)); + base::BindOnce(&CookiesSetFunction::PullCookie, this)); // clang-format on } @@ -425,7 +425,7 @@ success_ = set_cookie_result; cookies_helpers::GetCookieListFromStore( cookie_store, url_, - base::Bind(&CookiesSetFunction::PullCookieCallback, this)); + base::BindOnce(&CookiesSetFunction::PullCookieCallback, this)); } void CookiesSetFunction::PullCookieCallback( @@ -504,7 +504,7 @@ store_browser_context_->GetURLRequestContext()->cookie_store(); cookie_store->DeleteCookieAsync( url_, parsed_args_->details.name, - base::Bind(&CookiesRemoveFunction::RemoveCookieCallback, this)); + base::BindOnce(&CookiesRemoveFunction::RemoveCookieCallback, this)); } void CookiesRemoveFunction::RemoveCookieCallback() {
diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc b/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc index 416355aa..1006f7da 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc
@@ -352,9 +352,9 @@ TestExtensionPrefSetting( base::Bind(&HasPrefsPermission, &util::AllowFileAccess, profile(), id), "fileAccess", id); - TestExtensionPrefSetting( - base::Bind(&HasAllUrlsPermission, extension, profile()), "runOnAllUrls", - id); + TestExtensionPrefSetting(base::Bind(&HasAllUrlsPermission, + base::RetainedRef(extension), profile()), + "runOnAllUrls", id); } // Test developerPrivate.reload.
diff --git a/chrome/browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_apitest.cc b/chrome/browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_apitest.cc index 2fdbbc356..f0d5b67 100644 --- a/chrome/browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_apitest.cc +++ b/chrome/browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_apitest.cc
@@ -199,7 +199,7 @@ IN_PROC_BROWSER_TEST_P(EnterpriseDeviceAttributesTest, Success) { content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, - base::Bind(chrome_browser_net::SetUrlRequestMocksEnabled, true)); + base::BindOnce(chrome_browser_net::SetUrlRequestMocksEnabled, true)); SetPolicy();
diff --git a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_unittest.cc b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_unittest.cc index 8bb9198..9cc89860 100644 --- a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_unittest.cc +++ b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_unittest.cc
@@ -64,7 +64,7 @@ void operator()(const chromeos::BoolDBusMethodCallback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, status_, value_)); + FROM_HERE, base::BindOnce(callback, status_, value_)); } private: @@ -78,7 +78,7 @@ const std::string& key_name, const cryptohome::AsyncMethodCaller::Callback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, true, cryptohome::MOUNT_ERROR_NONE)); + FROM_HERE, base::BindOnce(callback, true, cryptohome::MOUNT_ERROR_NONE)); } void RegisterKeyCallbackFalse( @@ -87,7 +87,7 @@ const std::string& key_name, const cryptohome::AsyncMethodCaller::Callback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, false, cryptohome::MOUNT_ERROR_NONE)); + FROM_HERE, base::BindOnce(callback, false, cryptohome::MOUNT_ERROR_NONE)); } void SignChallengeCallbackTrue( @@ -100,7 +100,7 @@ const std::string& challenge, const cryptohome::AsyncMethodCaller::DataCallback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, true, "response")); + FROM_HERE, base::BindOnce(callback, true, "response")); } void SignChallengeCallbackFalse( @@ -113,7 +113,7 @@ const std::string& challenge, const cryptohome::AsyncMethodCaller::DataCallback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, false, "")); + FROM_HERE, base::BindOnce(callback, false, "")); } void GetCertificateCallbackTrue( @@ -124,7 +124,7 @@ const chromeos::attestation::AttestationFlow::CertificateCallback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, true, "certificate")); + FROM_HERE, base::BindOnce(callback, true, "certificate")); } void GetCertificateCallbackFalse( @@ -135,7 +135,7 @@ const chromeos::attestation::AttestationFlow::CertificateCallback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, false, "")); + FROM_HERE, base::BindOnce(callback, false, "")); } class EPKChallengeKeyTestBase : public BrowserWithTestWindowTest {
diff --git a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc index 547c2f6b..5269baa 100644 --- a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc +++ b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc
@@ -310,11 +310,9 @@ if (GetParam().system_token_ == SYSTEM_TOKEN_EXISTS) { base::RunLoop loop; content::BrowserThread::PostTask( - content::BrowserThread::IO, - FROM_HERE, - base::Bind(&EnterprisePlatformKeysTest::SetUpTestSystemSlotOnIO, - base::Unretained(this), - loop.QuitClosure())); + content::BrowserThread::IO, FROM_HERE, + base::BindOnce(&EnterprisePlatformKeysTest::SetUpTestSystemSlotOnIO, + base::Unretained(this), loop.QuitClosure())); loop.Run(); } @@ -331,11 +329,10 @@ if (GetParam().system_token_ == SYSTEM_TOKEN_EXISTS) { base::RunLoop loop; content::BrowserThread::PostTask( - content::BrowserThread::IO, - FROM_HERE, - base::Bind(&EnterprisePlatformKeysTest::TearDownTestSystemSlotOnIO, - base::Unretained(this), - loop.QuitClosure())); + content::BrowserThread::IO, FROM_HERE, + base::BindOnce( + &EnterprisePlatformKeysTest::TearDownTestSystemSlotOnIO, + base::Unretained(this), loop.QuitClosure())); loop.Run(); } EXPECT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete()); @@ -439,9 +436,8 @@ // Enable the URLRequestMock, which is required for force-installing the // test extension through policy. content::BrowserThread::PostTask( - content::BrowserThread::IO, - FROM_HERE, - base::Bind(chrome_browser_net::SetUrlRequestMocksEnabled, true)); + content::BrowserThread::IO, FROM_HERE, + base::BindOnce(chrome_browser_net::SetUrlRequestMocksEnabled, true)); { base::RunLoop loop;
diff --git a/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc b/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc index c487110..c4c6fd7 100644 --- a/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc +++ b/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc
@@ -69,8 +69,7 @@ void operator() (const chromeos::BoolDBusMethodCallback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, status_, value_)); + FROM_HERE, base::BindOnce(callback, status_, value_)); } private: @@ -84,8 +83,7 @@ const std::string& key_name, const cryptohome::AsyncMethodCaller::Callback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, true, cryptohome::MOUNT_ERROR_NONE)); + FROM_HERE, base::BindOnce(callback, true, cryptohome::MOUNT_ERROR_NONE)); } void RegisterKeyCallbackFalse( @@ -94,8 +92,7 @@ const std::string& key_name, const cryptohome::AsyncMethodCaller::Callback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, false, cryptohome::MOUNT_ERROR_NONE)); + FROM_HERE, base::BindOnce(callback, false, cryptohome::MOUNT_ERROR_NONE)); } void SignChallengeCallbackTrue( @@ -108,8 +105,7 @@ const std::string& challenge, const cryptohome::AsyncMethodCaller::DataCallback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, true, "response")); + FROM_HERE, base::BindOnce(callback, true, "response")); } void SignChallengeCallbackFalse( @@ -122,8 +118,7 @@ const std::string& challenge, const cryptohome::AsyncMethodCaller::DataCallback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, false, "")); + FROM_HERE, base::BindOnce(callback, false, "")); } void GetCertificateCallbackTrue( @@ -134,8 +129,7 @@ const chromeos::attestation::AttestationFlow::CertificateCallback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, true, "certificate")); + FROM_HERE, base::BindOnce(callback, true, "certificate")); } void GetCertificateCallbackFalse( @@ -146,8 +140,7 @@ const chromeos::attestation::AttestationFlow::CertificateCallback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, false, "")); + FROM_HERE, base::BindOnce(callback, false, "")); } class EPKPChallengeKeyTestBase : public BrowserWithTestWindowTest {
diff --git a/chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc b/chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc index c4bccd5..6764b7ec 100644 --- a/chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc +++ b/chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc
@@ -68,7 +68,7 @@ // log sources actually work. Instead, simulate the asynchronous operation // of a SingleLogSource by invoking the callback separately. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, base::Owned(result_map))); + FROM_HERE, base::BindOnce(callback, base::Owned(result_map))); } // Instantiates a new instance of this class. Does not retain ownership. Used
diff --git a/chrome/browser/extensions/api/feedback_private/log_source_access_manager_chromeos_unittest.cc b/chrome/browser/extensions/api/feedback_private/log_source_access_manager_chromeos_unittest.cc index 05780e15..acef8a77 100644 --- a/chrome/browser/extensions/api/feedback_private/log_source_access_manager_chromeos_unittest.cc +++ b/chrome/browser/extensions/api/feedback_private/log_source_access_manager_chromeos_unittest.cc
@@ -49,7 +49,7 @@ // log sources actually work. Instead, simulate the asynchronous operation // of a SingleLogSource by invoking the callback separately. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, base::Owned(result_map))); + FROM_HERE, base::BindOnce(callback, base::Owned(result_map))); } // Instantiates a new instance of this class. Does not retain ownership. Used
diff --git a/chrome/browser/extensions/api/file_system/consent_provider.cc b/chrome/browser/extensions/api/file_system/consent_provider.cc index 3f7dece..a6e087c 100644 --- a/chrome/browser/extensions/api/file_system/consent_provider.cc +++ b/chrome/browser/extensions/api/file_system/consent_provider.cc
@@ -94,7 +94,7 @@ if (extension.location() == Manifest::COMPONENT && delegate_->IsWhitelistedComponent(extension)) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, CONSENT_GRANTED)); + FROM_HERE, base::BindOnce(callback, CONSENT_GRANTED)); return; } @@ -103,7 +103,7 @@ if (delegate_->IsAutoLaunched(extension)) { delegate_->ShowNotification(extension, volume, writable); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, CONSENT_GRANTED)); + FROM_HERE, base::BindOnce(callback, CONSENT_GRANTED)); return; } @@ -168,7 +168,7 @@ if (!web_contents) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, ui::DIALOG_BUTTON_NONE)); + FROM_HERE, base::BindOnce(callback, ui::DIALOG_BUTTON_NONE)); return; } @@ -177,14 +177,14 @@ if (g_auto_dialog_button_for_test != ui::DIALOG_BUTTON_NONE) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(callback, g_auto_dialog_button_for_test /* result */)); + base::BindOnce(callback, g_auto_dialog_button_for_test /* result */)); return; } // If the volume is gone, then cancel the dialog. if (!volume.get()) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, ui::DIALOG_BUTTON_CANCEL)); + FROM_HERE, base::BindOnce(callback, ui::DIALOG_BUTTON_CANCEL)); return; }
diff --git a/chrome/browser/extensions/api/font_settings/font_settings_api.cc b/chrome/browser/extensions/api/font_settings/font_settings_api.cc index 3f56296..d5f5b63 100644 --- a/chrome/browser/extensions/api/font_settings/font_settings_api.cc +++ b/chrome/browser/extensions/api/font_settings/font_settings_api.cc
@@ -284,7 +284,7 @@ bool FontSettingsGetFontListFunction::RunAsync() { content::GetFontListAsync( - Bind(&FontSettingsGetFontListFunction::FontListHasLoaded, this)); + BindOnce(&FontSettingsGetFontListFunction::FontListHasLoaded, this)); return true; }
diff --git a/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc b/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc index a9087e8..1b3c20a 100644 --- a/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc +++ b/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc
@@ -126,9 +126,9 @@ // From here on out, results must be returned asynchronously. StartAsyncRun(); - GetIdentityManager()->GetPrimaryAccountInfo( - base::Bind(&IdentityGetAuthTokenFunction::OnReceivedPrimaryAccountInfo, - this, scopes, gaia_id)); + GetIdentityManager()->GetPrimaryAccountInfo(base::BindOnce( + &IdentityGetAuthTokenFunction::OnReceivedPrimaryAccountInfo, this, scopes, + gaia_id)); return true; } @@ -154,7 +154,7 @@ // Get the AccountInfo for the account that the extension wishes to use. identity_manager_->GetAccountInfoFromGaiaId( extension_gaia_id, - base::Bind( + base::BindOnce( &IdentityGetAuthTokenFunction::OnReceivedExtensionAccountInfo, this, false /* not primary account */, scopes)); return; @@ -641,8 +641,8 @@ GetIdentityManager()->GetAccessToken( token_key_->account_id, ::identity::ScopeSet(), "extensions_identity_api", - base::Bind(&IdentityGetAuthTokenFunction::OnGetAccessTokenComplete, - base::Unretained(this))); + base::BindOnce(&IdentityGetAuthTokenFunction::OnGetAccessTokenComplete, + base::Unretained(this))); } void IdentityGetAuthTokenFunction::StartGaiaRequest(
diff --git a/chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc b/chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc index 10578ac..7cc9db2 100644 --- a/chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc +++ b/chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc
@@ -36,7 +36,7 @@ ->BindInterface(identity::mojom::kServiceName, mojo::MakeRequest(&identity_manager_)); - identity_manager_->GetPrimaryAccountInfo(base::Bind( + identity_manager_->GetPrimaryAccountInfo(base::BindOnce( &IdentityGetProfileUserInfoFunction::OnReceivedPrimaryAccountInfo, this)); return RespondLater();
diff --git a/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.cc b/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.cc index 297df8d0..3ad3e5d 100644 --- a/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.cc +++ b/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.cc
@@ -29,8 +29,8 @@ DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); binding_.set_connection_error_handler( - base::Bind(&ImageWriterUtilityClient::UtilityProcessError, - image_writer_utility_client_)); + base::BindOnce(&ImageWriterUtilityClient::UtilityProcessError, + image_writer_utility_client_)); } ~RemovableStorageWriterClientImpl() override = default;
diff --git a/chrome/browser/extensions/api/image_writer_private/operation_chromeos.cc b/chrome/browser/extensions/api/image_writer_private/operation_chromeos.cc index 9e0cd935..79ad1be 100644 --- a/chrome/browser/extensions/api/image_writer_private/operation_chromeos.cc +++ b/chrome/browser/extensions/api/image_writer_private/operation_chromeos.cc
@@ -22,9 +22,8 @@ void ClearImageBurner() { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - BrowserThread::PostTask(BrowserThread::UI, - FROM_HERE, - base::Bind(&ClearImageBurner)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + base::BindOnce(&ClearImageBurner)); return; } @@ -43,9 +42,8 @@ AddCleanUpFunction(base::Bind(&ClearImageBurner)); BrowserThread::PostTask( - BrowserThread::UI, - FROM_HERE, - base::Bind(&Operation::UnmountVolumes, this, continuation)); + BrowserThread::UI, FROM_HERE, + base::BindOnce(&Operation::UnmountVolumes, this, continuation)); } void Operation::VerifyWrite(const base::Closure& continuation) {
diff --git a/chrome/browser/extensions/api/image_writer_private/test_utils.cc b/chrome/browser/extensions/api/image_writer_private/test_utils.cc index 3b7ffbef..17f9f497 100644 --- a/chrome/browser/extensions/api/image_writer_private/test_utils.cc +++ b/chrome/browser/extensions/api/image_writer_private/test_utils.cc
@@ -40,14 +40,16 @@ const std::string& to_path, const ErrorCallback& error_callback) override { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(burn_progress_update_handler_, to_path, 0, 100)); - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(burn_progress_update_handler_, to_path, 50, 100)); + FROM_HERE, + base::BindOnce(burn_progress_update_handler_, to_path, 0, 100)); base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(burn_progress_update_handler_, to_path, 100, 100)); + base::BindOnce(burn_progress_update_handler_, to_path, 50, 100)); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(burn_finished_handler_, to_path, true, "")); + FROM_HERE, + base::BindOnce(burn_progress_update_handler_, to_path, 100, 100)); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(burn_finished_handler_, to_path, true, "")); } private: @@ -71,7 +73,7 @@ const std::string& device_path, const UnmountDeviceRecursivelyCallbackType& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - base::Bind(callback, true)); + base::BindOnce(callback, true)); } #endif
diff --git a/chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.cc b/chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.cc index da6f543..5cd36e3 100644 --- a/chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.cc +++ b/chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.cc
@@ -120,10 +120,11 @@ const std::string& error) { if (!error.empty()) { content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, - base::Bind(failure_callback, error)); + base::BindOnce(failure_callback, error)); } else { - content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, - base::Bind(success_callback, key_data)); + content::BrowserThread::PostTask( + content::BrowserThread::UI, FROM_HERE, + base::BindOnce(success_callback, key_data)); } }
diff --git a/chrome/browser/extensions/api/page_capture/page_capture_api.cc b/chrome/browser/extensions/api/page_capture/page_capture_api.cc index 81d6d917..7ec0dc27 100644 --- a/chrome/browser/extensions/api/page_capture/page_capture_api.cc +++ b/chrome/browser/extensions/api/page_capture/page_capture_api.cc
@@ -135,7 +135,8 @@ if (allowed_permissions.ContainsID(APIPermission::kPageCapture)) { BrowserThread::PostTask( BrowserThread::FILE, FROM_HERE, - base::Bind(&PageCaptureSaveAsMHTMLFunction::CreateTemporaryFile, this)); + base::BindOnce(&PageCaptureSaveAsMHTMLFunction::CreateTemporaryFile, + this)); } else { ReturnFailure(kUserDenied); }
diff --git a/chrome/browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc b/chrome/browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc index 341df18..5364c96 100644 --- a/chrome/browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc +++ b/chrome/browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc
@@ -91,10 +91,10 @@ base::RunLoop loop; content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, - base::Bind(&PlatformKeysTest::SetUpTestSystemSlotOnIO, - base::Unretained(this), - browser()->profile()->GetResourceContext(), - loop.QuitClosure())); + base::BindOnce(&PlatformKeysTest::SetUpTestSystemSlotOnIO, + base::Unretained(this), + browser()->profile()->GetResourceContext(), + loop.QuitClosure())); loop.Run(); } @@ -122,8 +122,8 @@ base::RunLoop loop; content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, - base::Bind(&PlatformKeysTest::TearDownTestSystemSlotOnIO, - base::Unretained(this), loop.QuitClosure())); + base::BindOnce(&PlatformKeysTest::TearDownTestSystemSlotOnIO, + base::Unretained(this), loop.QuitClosure())); loop.Run(); }
diff --git a/chrome/browser/extensions/api/platform_keys/verify_trust_api.cc b/chrome/browser/extensions/api/platform_keys/verify_trust_api.cc index 601e93f..3bc1527 100644 --- a/chrome/browser/extensions/api/platform_keys/verify_trust_api.cc +++ b/chrome/browser/extensions/api/platform_keys/verify_trust_api.cc
@@ -112,8 +112,8 @@ content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, - base::Bind(&IOPart::Verify, base::Unretained(io_part_.get()), - base::Passed(¶ms), extension_id, finish_callback)); + base::BindOnce(&IOPart::Verify, base::Unretained(io_part_.get()), + base::Passed(¶ms), extension_id, finish_callback)); } void VerifyTrustAPI::OnExtensionUnloaded( @@ -122,8 +122,8 @@ UnloadedExtensionReason reason) { content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, - base::Bind(&IOPart::OnExtensionUnloaded, base::Unretained(io_part_.get()), - extension->id())); + base::BindOnce(&IOPart::OnExtensionUnloaded, + base::Unretained(io_part_.get()), extension->id())); } void VerifyTrustAPI::FinishedVerificationOnUI(const VerifyCallback& ui_callback, @@ -142,7 +142,7 @@ int cert_status) { content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, - base::Bind(ui_callback, error, return_value, cert_status)); + base::BindOnce(ui_callback, error, return_value, cert_status)); } VerifyTrustAPI::IOPart::~IOPart() {
diff --git a/chrome/browser/extensions/api/terminal/terminal_private_api.cc b/chrome/browser/extensions/api/terminal/terminal_private_api.cc index 2b22971..c2207fe 100644 --- a/chrome/browser/extensions/api/terminal/terminal_private_api.cc +++ b/chrome/browser/extensions/api/terminal/terminal_private_api.cc
@@ -69,8 +69,8 @@ if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) { content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, - base::Bind(&NotifyProcessOutput, browser_context, extension_id, tab_id, - terminal_id, output_type, output)); + base::BindOnce(&NotifyProcessOutput, browser_context, extension_id, + tab_id, terminal_id, output_type, output)); return; } @@ -143,7 +143,7 @@ // Registry lives on FILE thread. content::BrowserThread::PostTask( content::BrowserThread::FILE, FROM_HERE, - base::Bind( + base::BindOnce( &TerminalPrivateOpenTerminalProcessFunction::OpenOnFileThread, this, base::Bind(&NotifyProcessOutput, browser_context(), extension_id(), tab_id), @@ -164,7 +164,7 @@ int terminal_id = registry->OpenProcess(command_.c_str(), output_callback); content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, - base::Bind(callback, terminal_id)); + base::BindOnce(callback, terminal_id)); } TerminalPrivateSendInputFunction::~TerminalPrivateSendInputFunction() {} @@ -183,9 +183,10 @@ EXTENSION_FUNCTION_VALIDATE(params.get()); // Registry lives on the FILE thread. - content::BrowserThread::PostTask(content::BrowserThread::FILE, FROM_HERE, - base::Bind(&TerminalPrivateSendInputFunction::SendInputOnFileThread, - this, params->pid, params->input)); + content::BrowserThread::PostTask( + content::BrowserThread::FILE, FROM_HERE, + base::BindOnce(&TerminalPrivateSendInputFunction::SendInputOnFileThread, + this, params->pid, params->input)); return RespondLater(); } @@ -197,8 +198,8 @@ content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, - base::Bind(&TerminalPrivateSendInputFunction::RespondOnUIThread, this, - success)); + base::BindOnce(&TerminalPrivateSendInputFunction::RespondOnUIThread, this, + success)); } void TerminalPrivateSendInputFunction::RespondOnUIThread(bool success) { @@ -217,7 +218,7 @@ // Registry lives on the FILE thread. content::BrowserThread::PostTask( content::BrowserThread::FILE, FROM_HERE, - base::Bind( + base::BindOnce( &TerminalPrivateCloseTerminalProcessFunction::CloseOnFileThread, this, params->pid)); @@ -229,9 +230,11 @@ bool success = chromeos::ProcessProxyRegistry::Get()->CloseProcess(terminal_id); - content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, - base::Bind(&TerminalPrivateCloseTerminalProcessFunction:: - RespondOnUIThread, this, success)); + content::BrowserThread::PostTask( + content::BrowserThread::UI, FROM_HERE, + base::BindOnce( + &TerminalPrivateCloseTerminalProcessFunction::RespondOnUIThread, this, + success)); } void TerminalPrivateCloseTerminalProcessFunction::RespondOnUIThread( @@ -249,9 +252,11 @@ EXTENSION_FUNCTION_VALIDATE(params.get()); // Registry lives on the FILE thread. - content::BrowserThread::PostTask(content::BrowserThread::FILE, FROM_HERE, - base::Bind(&TerminalPrivateOnTerminalResizeFunction::OnResizeOnFileThread, - this, params->pid, params->width, params->height)); + content::BrowserThread::PostTask( + content::BrowserThread::FILE, FROM_HERE, + base::BindOnce( + &TerminalPrivateOnTerminalResizeFunction::OnResizeOnFileThread, this, + params->pid, params->width, params->height)); return RespondLater(); } @@ -263,9 +268,11 @@ bool success = chromeos::ProcessProxyRegistry::Get()->OnTerminalResize( terminal_id, width, height); - content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, - base::Bind(&TerminalPrivateOnTerminalResizeFunction::RespondOnUIThread, - this, success)); + content::BrowserThread::PostTask( + content::BrowserThread::UI, FROM_HERE, + base::BindOnce( + &TerminalPrivateOnTerminalResizeFunction::RespondOnUIThread, this, + success)); } void TerminalPrivateOnTerminalResizeFunction::RespondOnUIThread(bool success) { @@ -292,8 +299,8 @@ // Registry lives on the FILE thread. content::BrowserThread::PostTask( content::BrowserThread::FILE, FROM_HERE, - base::Bind(&TerminalPrivateAckOutputFunction::AckOutputOnFileThread, this, - params->pid)); + base::BindOnce(&TerminalPrivateAckOutputFunction::AckOutputOnFileThread, + this, params->pid)); return RespondNow(NoArguments()); }
diff --git a/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc b/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc index 004743f..977c038 100644 --- a/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc +++ b/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc
@@ -83,8 +83,8 @@ OnKeyboardSettingsCallback on_settings_callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); media::AudioSystem::Get()->HasInputDevices( - base::Bind(&ChromeVirtualKeyboardDelegate::OnHasInputDevices, weak_this_, - std::move(on_settings_callback))); + base::BindOnce(&ChromeVirtualKeyboardDelegate::OnHasInputDevices, + weak_this_, std::move(on_settings_callback))); } bool ChromeVirtualKeyboardDelegate::HideKeyboard() {
diff --git a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc index bc5a07c..1670e55 100644 --- a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc +++ b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc
@@ -181,9 +181,9 @@ GetOutputDeviceDescriptionsOnIOThread() { DCHECK_CURRENTLY_ON(BrowserThread::IO); media::AudioSystem::Get()->GetDeviceDescriptions( - base::Bind(&WebrtcAudioPrivateGetSinksFunction:: - ReceiveOutputDeviceDescriptionsOnIOThread, - this), + base::BindOnce(&WebrtcAudioPrivateGetSinksFunction:: + ReceiveOutputDeviceDescriptionsOnIOThread, + this), false); } @@ -237,9 +237,9 @@ GetInputDeviceDescriptionsOnIOThread() { DCHECK_CURRENTLY_ON(BrowserThread::IO); media::AudioSystem::Get()->GetDeviceDescriptions( - base::Bind(&WebrtcAudioPrivateGetAssociatedSinkFunction:: - ReceiveInputDeviceDescriptionsOnIOThread, - this), + base::BindOnce(&WebrtcAudioPrivateGetAssociatedSinkFunction:: + ReceiveInputDeviceDescriptionsOnIOThread, + this), true); } @@ -268,7 +268,7 @@ } media::AudioSystem::Get()->GetAssociatedOutputDeviceID( raw_source_id, - base::Bind( + base::BindOnce( &WebrtcAudioPrivateGetAssociatedSinkFunction::CalculateHMACOnIOThread, this)); }
diff --git a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc index 4bd6a7bc..9f97850 100644 --- a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc +++ b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc
@@ -63,7 +63,7 @@ AudioDeviceDescriptions* device_descriptions) { base::RunLoop run_loop; media::AudioSystem::Get()->GetDeviceDescriptions( - base::Bind( + base::BindOnce( [](base::Closure finished_callback, AudioDeviceDescriptions* result, AudioDeviceDescriptions received) { *result = std::move(received);
diff --git a/chrome/browser/extensions/chrome_mojo_service_registration.cc b/chrome/browser/extensions/chrome_mojo_service_registration.cc index 594a8a8..4ff6213 100644 --- a/chrome/browser/extensions/chrome_mojo_service_registration.cc +++ b/chrome/browser/extensions/chrome_mojo_service_registration.cc
@@ -29,7 +29,7 @@ APIPermission::kMediaRouterPrivate)) { render_frame_host->GetInterfaceRegistry()->AddInterface( base::Bind(media_router::MediaRouterMojoImpl::BindToRequest, - extension, context)); + base::RetainedRef(extension), context)); } } }
diff --git a/chrome/browser/extensions/content_script_apitest.cc b/chrome/browser/extensions/content_script_apitest.cc index 4063d55..242b99dd 100644 --- a/chrome/browser/extensions/content_script_apitest.cc +++ b/chrome/browser/extensions/content_script_apitest.cc
@@ -419,6 +419,18 @@ ASSERT_TRUE(RunExtensionTest("content_scripts/policy")) << message_; } +// Verifies wildcard can be used for effecitve TLD. +IN_PROC_BROWSER_TEST_F(ExtensionApiTestWithManagementPolicy, + ContentScriptPolicyWildcard) { + // Set enterprise policy to block injection to policy specified hosts. + { + ExtensionManagementPolicyUpdater pref(&policy_provider_); + pref.AddRuntimeBlockedHost("*", "*://example.*"); + } + ASSERT_TRUE(StartEmbeddedTestServer()); + ASSERT_TRUE(RunExtensionTest("content_scripts/policy")) << message_; +} + IN_PROC_BROWSER_TEST_P(ContentScriptApiTest, ContentScriptBypassPageCSP) { ASSERT_TRUE(StartEmbeddedTestServer()); ASSERT_TRUE(RunExtensionTest("content_scripts/bypass_page_csp")) << message_;
diff --git a/chrome/browser/extensions/extension_disabled_ui.cc b/chrome/browser/extensions/extension_disabled_ui.cc index 50c997e..147aeb21 100644 --- a/chrome/browser/extensions/extension_disabled_ui.cc +++ b/chrome/browser/extensions/extension_disabled_ui.cc
@@ -284,7 +284,7 @@ base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&ExtensionService::GrantPermissionsAndEnableExtension, - service_->AsWeakPtr(), extension_)); + service_->AsWeakPtr(), base::RetainedRef(extension_))); } void ExtensionDisabledGlobalError::BubbleViewCancelButtonPressed( @@ -299,10 +299,11 @@ // Delay showing the uninstall dialog, so that this function returns // immediately, to close the bubble properly. See crbug.com/121544. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&ExtensionUninstallDialog::ConfirmUninstall, - uninstall_dialog_->AsWeakPtr(), extension_, - UNINSTALL_REASON_EXTENSION_DISABLED, - UNINSTALL_SOURCE_PERMISSIONS_INCREASE)); + FROM_HERE, + base::Bind(&ExtensionUninstallDialog::ConfirmUninstall, + uninstall_dialog_->AsWeakPtr(), base::RetainedRef(extension_), + UNINSTALL_REASON_EXTENSION_DISABLED, + UNINSTALL_SOURCE_PERMISSIONS_INCREASE)); } bool ExtensionDisabledGlobalError::ShouldCloseOnDeactivate() const {
diff --git a/chrome/browser/extensions/extension_special_storage_policy.cc b/chrome/browser/extensions/extension_special_storage_policy.cc index d1431b0..85a51b0 100644 --- a/chrome/browser/extensions/extension_special_storage_policy.cc +++ b/chrome/browser/extensions/extension_special_storage_policy.cc
@@ -123,7 +123,7 @@ ContentSettingsForOneType entries; cookie_settings_->GetCookieSettings(&entries); for (size_t i = 0; i < entries.size(); ++i) { - if (entries[i].setting == CONTENT_SETTING_SESSION_ONLY) + if (entries[i].GetContentSetting() == CONTENT_SETTING_SESSION_ONLY) return true; } return false;
diff --git a/chrome/browser/extensions/service_worker_apitest.cc b/chrome/browser/extensions/service_worker_apitest.cc index 89ef3b65..5f005f8 100644 --- a/chrome/browser/extensions/service_worker_apitest.cc +++ b/chrome/browser/extensions/service_worker_apitest.cc
@@ -36,6 +36,7 @@ #include "content/public/common/page_type.h" #include "content/public/test/background_sync_test_util.h" #include "content/public/test/browser_test_utils.h" +#include "content/public/test/service_worker_test_helpers.h" #include "extensions/browser/extension_host.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/process_manager.h" @@ -43,6 +44,7 @@ #include "extensions/test/extension_test_message_listener.h" #include "net/dns/mock_host_resolver.h" #include "net/test/embedded_test_server/embedded_test_server.h" +#include "url/url_constants.h" namespace extensions { @@ -682,6 +684,40 @@ ASSERT_EQ("chrome.tabs.onUpdated callback", result); } +IN_PROC_BROWSER_TEST_F(ServiceWorkerTest, EventsToStoppedWorker) { + // Extensions APIs from SW are only enabled on trunk. + ScopedCurrentChannel current_channel_override(version_info::Channel::UNKNOWN); + const Extension* extension = LoadExtensionWithFlags( + test_data_dir_.AppendASCII("service_worker/events_to_stopped_worker"), + kFlagNone); + ASSERT_TRUE(extension); + ui_test_utils::NavigateToURL(browser(), + extension->GetResourceURL("page.html")); + content::WebContents* web_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + { + std::string result; + ASSERT_TRUE(content::ExecuteScriptAndExtractString( + web_contents, "window.runServiceWorker()", &result)); + ASSERT_EQ("ready", result); + + base::RunLoop run_loop; + content::StoragePartition* storage_partition = + content::BrowserContext::GetDefaultStoragePartition( + browser()->profile()); + content::StopServiceWorkerForPattern( + storage_partition->GetServiceWorkerContext(), + // The service worker is registered at the top level scope. + extension->url(), run_loop.QuitClosure()); + run_loop.Run(); + } + + std::string result; + ASSERT_TRUE(content::ExecuteScriptAndExtractString( + web_contents, "window.createTabThenUpdate()", &result)); + ASSERT_EQ("chrome.tabs.onUpdated callback", result); +} + // Tests that worker ref count increments while extension API function is // active.
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index a73d18e..b3e61a04 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -2386,6 +2386,13 @@ "If enabled, the content suggestions cards will use large thumbnails and " "some related adjustments."; +const char kEnableContentSuggestionsVideoOverlayName[] = + "Video icon overlay on thumbnails for content suggestions cards."; + +const char kEnableContentSuggestionsVideoOverlayDescription[] = + "If enabled, the content suggestions cards for suggestions with a video " + "will show a video play icon overlay on the thumbnail."; + const char kEnableContentSuggestionsSettingsName[] = "Show content suggestions settings."; @@ -2879,6 +2886,11 @@ const char kMojoLoadingDescription[] = "Use Mojo IPC instead of traditional Chrome IPC for resource loading."; +const char kModuleScriptsName[] = "Enable ECMAScript 6 modules"; + +const char kModuleScriptsDescription[] = + "Enables ECMAScript 6 modules support in Blink."; + #if defined(OS_ANDROID) const char kUseNewDoodleApiName[] = "Use new Doodle API"; @@ -3228,13 +3240,6 @@ "Request server-side suggestions even if there are only very few of them " "and use them for tiles on the New Tab Page."; -const char kLocationHardReloadName[] = - "Experimental change for Location.reload() to trigger a hard-reload."; - -const char kLocationHardReloadDescription[] = - "Enable an experimental change for Location.reload() to trigger a " - "hard-reload."; - const char kCaptureThumbnailOnLoadFinishedName[] = "Capture page thumbnail on load finished"; @@ -3298,6 +3303,10 @@ "Enables inspection of native UI elements. For local inspection use " "chrome://inspect#other"; +const char kMultideviceName[] = "Enable multidevice features"; +const char kMultideviceDescription[] = + "Enables UI for controlling multidevice features."; + #endif // defined(OS_CHROMEOS) } // namespace flag_descriptions
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index e7b08eca..7ded2a4 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -428,9 +428,6 @@ extern const char kLoadMediaRouterComponentExtensionName[]; extern const char kLoadMediaRouterComponentExtensionDescription[]; -extern const char kLocationHardReloadName[]; -extern const char kLocationHardReloadDescription[]; - extern const char kManualPasswordGenerationName[]; extern const char kManualPasswordGenerationDescription[]; @@ -467,6 +464,9 @@ extern const char kMojoLoadingName[]; extern const char kMojoLoadingDescription[]; +extern const char kModuleScriptsName[]; +extern const char kModuleScriptsDescription[]; + extern const char kNewAudioRenderingMixingStrategyName[]; extern const char kNewAudioRenderingMixingStrategyDescription[]; @@ -910,6 +910,9 @@ extern const char kEnableContentSuggestionsLargeThumbnailName[]; extern const char kEnableContentSuggestionsLargeThumbnailDescription[]; +extern const char kEnableContentSuggestionsVideoOverlayName[]; +extern const char kEnableContentSuggestionsVideoOverlayDescription[]; + extern const char kEnableContentSuggestionsSettingsName[]; extern const char kEnableContentSuggestionsSettingsDescription[]; @@ -1345,6 +1348,9 @@ extern const char kMtpWriteSupportName[]; extern const char kMtpWriteSupportDescription[]; +extern const char kMultideviceName[]; +extern const char kMultideviceDescription[]; + extern const char kNetworkPortalNotificationName[]; extern const char kNetworkPortalNotificationDescription[];
diff --git a/chrome/browser/installable/installable_manager.cc b/chrome/browser/installable/installable_manager.cc index 189a4fba..dfd105b 100644 --- a/chrome/browser/installable/installable_manager.cc +++ b/chrome/browser/installable/installable_manager.cc
@@ -142,7 +142,7 @@ // Whitelist localhost. Check the VisibleURL to match what the // SecurityStateTabHelper looks at. - if (net::IsLocalhost(web_contents->GetVisibleURL().HostNoBrackets())) + if (net::IsLocalhost(web_contents->GetVisibleURL().HostNoBracketsPiece())) return true; security_state::SecurityInfo security_info;
diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc index 5ca3bc8..e13fda3 100644 --- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc +++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
@@ -828,8 +828,8 @@ const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); - signin::ProcessAccountConsistencyResponseHeaders( - request, GURL(), io_data, info->GetWebContentsGetterForRequest()); + signin::ProcessAccountConsistencyResponseHeaders(request, GURL(), + io_data->IsOffTheRecord()); // Built-in additional protection for the chrome web store origin. #if BUILDFLAG(ENABLE_EXTENSIONS) @@ -874,8 +874,8 @@ // native profile management UI is built on top of it. signin::FixAccountConsistencyRequestHeader( request, redirect_url, io_data, info->GetChildID(), info->GetRouteID()); - signin::ProcessAccountConsistencyResponseHeaders( - request, redirect_url, io_data, info->GetWebContentsGetterForRequest()); + signin::ProcessAccountConsistencyResponseHeaders(request, redirect_url, + io_data->IsOffTheRecord()); if (io_data->loading_predictor_observer()) { io_data->loading_predictor_observer()->OnRequestRedirected(
diff --git a/chrome/browser/media/android/remote/remote_media_player_bridge.cc b/chrome/browser/media/android/remote/remote_media_player_bridge.cc index 531e3f4..6c3e609 100644 --- a/chrome/browser/media/android/remote/remote_media_player_bridge.cc +++ b/chrome/browser/media/android/remote/remote_media_player_bridge.cc
@@ -262,7 +262,6 @@ // static bool RemoteMediaPlayerBridge::RegisterRemoteMediaPlayerBridge(JNIEnv* env) { bool ret = RegisterNativesImpl(env); - DCHECK(g_RemoteMediaPlayerBridge_clazz); return ret; }
diff --git a/chrome/browser/media/android/router/media_router_android_bridge.cc b/chrome/browser/media/android/router/media_router_android_bridge.cc index e56bbb59..4c57cde 100644 --- a/chrome/browser/media/android/router/media_router_android_bridge.cc +++ b/chrome/browser/media/android/router/media_router_android_bridge.cc
@@ -29,7 +29,6 @@ // static bool MediaRouterAndroidBridge::Register(JNIEnv* env) { bool ret = RegisterNativesImpl(env); - DCHECK(g_ChromeMediaRouter_clazz); return ret; }
diff --git a/chrome/browser/media/public_session_media_access_handler.cc b/chrome/browser/media/public_session_media_access_handler.cc index c629181..5d657cb 100644 --- a/chrome/browser/media/public_session_media_access_handler.cc +++ b/chrome/browser/media/public_session_media_access_handler.cc
@@ -54,9 +54,10 @@ // This Unretained is safe because the lifetime of this object is until // process exit (living inside a base::Singleton object). - auto prompt_resolved_callback = base::Bind( - &PublicSessionMediaAccessHandler::ChainHandleRequest, - base::Unretained(this), web_contents, request, callback, extension); + auto prompt_resolved_callback = + base::Bind(&PublicSessionMediaAccessHandler::ChainHandleRequest, + base::Unretained(this), web_contents, request, callback, + base::RetainedRef(extension)); extensions::PermissionIDSet requested_permissions; if (request.audio_type == content::MEDIA_DEVICE_AUDIO_CAPTURE)
diff --git a/chrome/browser/media/public_session_tab_capture_access_handler.cc b/chrome/browser/media/public_session_tab_capture_access_handler.cc index fe0c409..e08c239 100644 --- a/chrome/browser/media/public_session_tab_capture_access_handler.cc +++ b/chrome/browser/media/public_session_tab_capture_access_handler.cc
@@ -55,9 +55,10 @@ // This Unretained is safe because the lifetime of this object is until // process exit (living inside a base::Singleton object). - auto prompt_resolved_callback = base::Bind( - &PublicSessionTabCaptureAccessHandler::ChainHandleRequest, - base::Unretained(this), web_contents, request, callback, extension); + auto prompt_resolved_callback = + base::Bind(&PublicSessionTabCaptureAccessHandler::ChainHandleRequest, + base::Unretained(this), web_contents, request, callback, + base::RetainedRef(extension)); extensions::permission_helper::HandlePermissionRequest( *extension, {extensions::APIPermission::kTabCapture}, web_contents,
diff --git a/chrome/browser/media/router/media_router_metrics.cc b/chrome/browser/media/router/media_router_metrics.cc index 1b1455ad..491da23 100644 --- a/chrome/browser/media/router/media_router_metrics.cc +++ b/chrome/browser/media/router/media_router_metrics.cc
@@ -27,6 +27,8 @@ "MediaRouter.Icon.Click.Location"; const char MediaRouterMetrics::kHistogramMediaRouterCastingSource[] = "MediaRouter.Source.CastingSource"; +const char MediaRouterMetrics::kHistogramMediaRouterFileFormat[] = + "MediaRouter.Source.FileFormat"; const char MediaRouterMetrics::kHistogramRouteCreationOutcome[] = "MediaRouter.Route.CreationOutcome"; const char MediaRouterMetrics::kHistogramUiDialogPaint[] = @@ -83,6 +85,12 @@ UMA_HISTOGRAM_SPARSE_SLOWLY(kHistogramMediaRouterCastingSource, source); } +void MediaRouterMetrics::RecordMediaRouterFileFormat( + const media::container_names::MediaContainerName format) { + UMA_HISTOGRAM_ENUMERATION(kHistogramMediaRouterFileFormat, format, + media::container_names::CONTAINER_MAX); +} + void MediaRouterMetrics::RecordDialDeviceCounts(size_t available_device_count, size_t known_device_count) { if (clock_->Now() - device_count_metrics_record_time_ <
diff --git a/chrome/browser/media/router/media_router_metrics.h b/chrome/browser/media/router/media_router_metrics.h index d78696d..dd8dc022 100644 --- a/chrome/browser/media/router/media_router_metrics.h +++ b/chrome/browser/media/router/media_router_metrics.h
@@ -11,6 +11,7 @@ #include "base/time/clock.h" #include "base/time/time.h" #include "chrome/browser/ui/webui/media_router/media_cast_mode.h" +#include "media/base/container_names.h" namespace media_router { @@ -66,6 +67,7 @@ static const char kHistogramDialKnownDeviceCount[]; static const char kHistogramIconClickLocation[]; static const char kHistogramMediaRouterCastingSource[]; + static const char kHistogramMediaRouterFileFormat[]; static const char kHistogramRouteCreationOutcome[]; static const char kHistogramUiDialogPaint[]; static const char kHistogramUiDialogLoadedWithData[]; @@ -97,6 +99,10 @@ // Records casting source. static void RecordMediaRouterCastingSource(MediaCastMode source); + // Records the format of a cast file. + static void RecordMediaRouterFileFormat( + media::container_names::MediaContainerName format); + // Records device counts. // TODO(zhaobin): Move device count specific metrics and state into its own // class eventually.
diff --git a/chrome/browser/media/webrtc/webrtc_video_quality_browsertest.cc b/chrome/browser/media/webrtc/webrtc_video_quality_browsertest.cc index ff7e2b3..a8ca4227 100644 --- a/chrome/browser/media/webrtc/webrtc_video_quality_browsertest.cc +++ b/chrome/browser/media/webrtc/webrtc_video_quality_browsertest.cc
@@ -97,8 +97,8 @@ // * ffmpeg 0.11.1 or compatible version (see http://www.ffmpeg.org) // // The test runs several custom binaries - rgba_to_i420 converter and -// frame_analyzer. Both tools can be found under third_party/webrtc/tools. The -// test also runs a stand alone Python implementation of a WebSocket server +// frame_analyzer. Both tools can be found under third_party/webrtc/rtc_tools. +// The test also runs a stand alone Python implementation of a WebSocket server // (pywebsocket) and a barcode_decoder script. class WebRtcVideoQualityBrowserTest : public WebRtcTestBase, public testing::WithParamInterface<VideoQualityTestConfig> { @@ -194,7 +194,7 @@ base::FilePath path_to_analyzer = base::MakeAbsoluteFilePath( GetBrowserDir().Append(kFrameAnalyzerExecutable)); base::FilePath path_to_compare_script = GetSourceDir().Append( - FILE_PATH_LITERAL("third_party/webrtc/tools/compare_videos.py")); + FILE_PATH_LITERAL("third_party/webrtc/rtc_tools/compare_videos.py")); if (!base::PathExists(path_to_analyzer)) { LOG(ERROR) << "Missing frame analyzer: should be in "
diff --git a/chrome/browser/media_galleries/fileapi/media_file_system_backend.cc b/chrome/browser/media_galleries/fileapi/media_file_system_backend.cc index b58329ca..81463fd0 100644 --- a/chrome/browser/media_galleries/fileapi/media_file_system_backend.cc +++ b/chrome/browser/media_galleries/fileapi/media_file_system_backend.cc
@@ -115,9 +115,9 @@ profile); // Pass the WebContentsGetter to the closure to prevent a use-after-free // in the case that the web_contents is destroyed before the closure runs. - preferences->EnsureInitialized(base::Bind(&OnPreferencesInit, - web_contents_getter, extension, - pref_id, callback)); + preferences->EnsureInitialized( + base::Bind(&OnPreferencesInit, web_contents_getter, + base::RetainedRef(extension), pref_id, callback)); return; } }
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/browser/metrics/chrome_metrics_service_client.cc index 9da2ed18..2feb595e 100644 --- a/chrome/browser/metrics/chrome_metrics_service_client.cc +++ b/chrome/browser/metrics/chrome_metrics_service_client.cc
@@ -644,8 +644,6 @@ ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled())); drive_metrics_provider_ = new metrics::DriveMetricsProvider( - content::BrowserThread::GetTaskRunnerForThread( - content::BrowserThread::FILE), chrome::FILE_LOCAL_STATE); metrics_service_->RegisterMetricsProvider( std::unique_ptr<metrics::MetricsProvider>(drive_metrics_provider_));
diff --git a/chrome/browser/metrics/chromeos_metrics_provider.cc b/chrome/browser/metrics/chromeos_metrics_provider.cc index aea298f..bf60a3cf 100644 --- a/chrome/browser/metrics/chromeos_metrics_provider.cc +++ b/chrome/browser/metrics/chromeos_metrics_provider.cc
@@ -11,6 +11,9 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "base/task_scheduler/post_task.h" +#include "base/task_scheduler/task_traits.h" +#include "base/threading/thread_restrictions.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/arc/arc_session_manager.h" #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" @@ -23,7 +26,6 @@ #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "components/user_manager/user_manager.h" -#include "content/public/browser/browser_thread.h" #include "device/bluetooth/bluetooth_adapter.h" #include "device/bluetooth/bluetooth_adapter_factory.h" #include "device/bluetooth/bluetooth_device.h" @@ -167,18 +169,20 @@ void ChromeOSMetricsProvider::InitTaskGetHardwareClass( const base::Closure& callback) { - // Run the (potentially expensive) task on the FILE thread to avoid blocking + // Run the (potentially expensive) task in the background to avoid blocking // the UI thread. - content::BrowserThread::PostTaskAndReply( - content::BrowserThread::FILE, + base::PostTaskWithTraitsAndReply( FROM_HERE, - base::Bind(&ChromeOSMetricsProvider::InitTaskGetHardwareClassOnFileThread, - weak_ptr_factory_.GetWeakPtr()), + {base::MayBlock(), base::TaskPriority::BACKGROUND, + base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, + base::BindOnce( + &ChromeOSMetricsProvider::InitTaskGetHardwareClassOnBackgroundThread, + weak_ptr_factory_.GetWeakPtr()), callback); } -void ChromeOSMetricsProvider::InitTaskGetHardwareClassOnFileThread() { - DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); +void ChromeOSMetricsProvider::InitTaskGetHardwareClassOnBackgroundThread() { + base::ThreadRestrictions::AssertWaitAllowed(); chromeos::system::StatisticsProvider::GetInstance()->GetMachineStatistic( "hardware_class", &hardware_class_); }
diff --git a/chrome/browser/metrics/chromeos_metrics_provider.h b/chrome/browser/metrics/chromeos_metrics_provider.h index 293c0af4..9ed2756 100644 --- a/chrome/browser/metrics/chromeos_metrics_provider.h +++ b/chrome/browser/metrics/chromeos_metrics_provider.h
@@ -66,8 +66,8 @@ metrics::ChromeUserMetricsExtension* uma_proto) override; private: - // Called on the FILE thread to load hardware class information. - void InitTaskGetHardwareClassOnFileThread(); + // Called on a background thread to load hardware class information. + void InitTaskGetHardwareClassOnBackgroundThread(); // Update the number of users logged into a multi-profile session. // If the number of users change while the log is open, the call invalidates
diff --git a/chrome/browser/metrics/desktop_session_duration/chrome_visibility_observer.h b/chrome/browser/metrics/desktop_session_duration/chrome_visibility_observer.h index 3122503..7740391d 100644 --- a/chrome/browser/metrics/desktop_session_duration/chrome_visibility_observer.h +++ b/chrome/browser/metrics/desktop_session_duration/chrome_visibility_observer.h
@@ -21,10 +21,6 @@ // by tests. virtual void SendVisibilityChangeEvent(bool active, base::TimeDelta time_ago); - // chrome::BrowserListObserver: - // In protected section for test. - void OnBrowserRemoved(Browser* browser) override; - private: // Cancels visibility change in case when the browser becomes visible after a // short gap. @@ -33,6 +29,7 @@ // chrome::BrowserListObserver: void OnBrowserSetLastActive(Browser* browser) override; void OnBrowserNoLongerActive(Browser* browser) override; + void OnBrowserRemoved(Browser* browser) override; // Sets |visibility_gap_timeout_| based on variation params. void InitVisibilityGapTimeout();
diff --git a/chrome/browser/metrics/desktop_session_duration/chrome_visibility_observer_browsertest.cc b/chrome/browser/metrics/desktop_session_duration/chrome_visibility_observer_browsertest.cc index 6bbbd30..2993c76 100644 --- a/chrome/browser/metrics/desktop_session_duration/chrome_visibility_observer_browsertest.cc +++ b/chrome/browser/metrics/desktop_session_duration/chrome_visibility_observer_browsertest.cc
@@ -4,51 +4,27 @@ #include "chrome/browser/metrics/desktop_session_duration/chrome_visibility_observer.h" -#include "base/memory/singleton.h" #include "base/run_loop.h" -#include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/browser_list.h" +#include "chrome/browser/ui/browser_window.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" -#include "content/public/browser/notification_service.h" #include "content/public/test/test_utils.h" // Mock class for |ChromeVisibilityObserver| for testing. class MockChromeVisibilityObserver : public metrics::ChromeVisibilityObserver { public: - MockChromeVisibilityObserver() : is_active_(false) { - ResetRunLoop(); - } - - void Wait() { - run_loop_->Run(); - } - - void ResetRunLoop() { - run_loop_.reset(new base::RunLoop()); - } + MockChromeVisibilityObserver() : is_active_(false) {} bool is_active() const { return is_active_; } - void set_is_active(bool is_active) { is_active_ = is_active; } private: void SendVisibilityChangeEvent(bool active, base::TimeDelta time_ago) override { is_active_ = active; - // In this test browser became inactive after browser is removed, thus - // in this case quit runloop in OnBrowserRemoved(). - if (is_active_) - run_loop_->Quit(); - } - - void OnBrowserRemoved(Browser* browser) override { - metrics::ChromeVisibilityObserver::OnBrowserRemoved(browser); - run_loop_->Quit(); } bool is_active_; - std::unique_ptr<base::RunLoop> run_loop_; DISALLOW_COPY_AND_ASSIGN(MockChromeVisibilityObserver); }; @@ -56,31 +32,30 @@ class ChromeVisibilityObserverBrowserTest : public InProcessBrowserTest {}; IN_PROC_BROWSER_TEST_F(ChromeVisibilityObserverBrowserTest, VisibilityTest) { + // Deactivate the initial browser window, to make observer start inactive. + browser()->window()->Deactivate(); + base::RunLoop().RunUntilIdle(); + MockChromeVisibilityObserver observer; EXPECT_FALSE(observer.is_active()); Browser* new_browser = CreateBrowser(browser()->profile()); - observer.Wait(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(observer.is_active()); - observer.ResetRunLoop(); - observer.set_is_active(false); Browser* incognito_browser = CreateIncognitoBrowser(); - observer.Wait(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(observer.is_active()); - observer.ResetRunLoop(); CloseBrowserSynchronously(incognito_browser); - observer.Wait(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(observer.is_active()); - observer.ResetRunLoop(); CloseBrowserSynchronously(new_browser); - observer.Wait(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(observer.is_active()); - observer.ResetRunLoop(); CloseBrowserSynchronously(browser()); - observer.Wait(); + base::RunLoop().RunUntilIdle(); EXPECT_FALSE(observer.is_active()); }
diff --git a/chrome/browser/metrics/ukm_browsertest.cc b/chrome/browser/metrics/ukm_browsertest.cc index 50f2c08..fcb79221 100644 --- a/chrome/browser/metrics/ukm_browsertest.cc +++ b/chrome/browser/metrics/ukm_browsertest.cc
@@ -39,7 +39,8 @@ return service ? service->client_id_ : 0; } - void EnableSyncForProfile(Profile* profile) { + std::unique_ptr<ProfileSyncServiceHarness> EnableSyncForProfile( + Profile* profile) { browser_sync::ProfileSyncService* sync_service = ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); @@ -52,7 +53,8 @@ profile, "user@gmail.com", "password", ProfileSyncServiceHarness::SigninType::FAKE_SIGNIN); - harness->SetupSync(); + EXPECT_TRUE(harness->SetupSync()); + return harness; } private: @@ -62,7 +64,7 @@ }; // Make sure that UKM is disabled while an incognito window is open. -IN_PROC_BROWSER_TEST_F(UkmBrowserTest, DISABLED_IncognitoCheck) { +IN_PROC_BROWSER_TEST_F(UkmBrowserTest, IncognitoCheck) { // Enable metrics recording and update MetricsServicesManager. bool metrics_enabled = true; ChromeMetricsServiceAccessor::SetMetricsAndCrashReportingForTesting( @@ -71,9 +73,10 @@ false); Profile* profile = ProfileManager::GetActiveUserProfile(); - EnableSyncForProfile(profile); + std::unique_ptr<ProfileSyncServiceHarness> harness = + EnableSyncForProfile(profile); - CreateBrowser(ProfileManager::GetActiveUserProfile()); + Browser* sync_browser = CreateBrowser(profile); EXPECT_TRUE(ukm_enabled()); uint64_t original_client_id = client_id(); @@ -85,6 +88,8 @@ // Client ID should not have been reset. EXPECT_EQ(original_client_id, client_id()); + harness->service()->RequestStop(browser_sync::ProfileSyncService::CLEAR_DATA); + CloseBrowserSynchronously(sync_browser); ChromeMetricsServiceAccessor::SetMetricsAndCrashReportingForTesting(nullptr); }
diff --git a/chrome/browser/notifications/desktop_notification_profile_util_unittest.cc b/chrome/browser/notifications/desktop_notification_profile_util_unittest.cc index 28c331e..53024dec 100644 --- a/chrome/browser/notifications/desktop_notification_profile_util_unittest.cc +++ b/chrome/browser/notifications/desktop_notification_profile_util_unittest.cc
@@ -2,10 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/bind.h" #include "chrome/browser/notifications/desktop_notification_profile_util.h" + +#include "base/bind.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "chrome/test/base/testing_profile.h" +#include "components/content_settings/core/common/content_settings.h" #include "testing/gtest/include/gtest/gtest.h" class DesktopNotificationServiceTest : public ChromeRenderViewHostTestHarness { @@ -33,25 +35,20 @@ EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard( GURL("http://allowed.com")), settings[0].primary_pattern); - EXPECT_EQ(CONTENT_SETTING_ALLOW, - settings[0].setting); + EXPECT_EQ(CONTENT_SETTING_ALLOW, settings[0].GetContentSetting()); EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard( GURL("http://allowed2.com")), settings[1].primary_pattern); - EXPECT_EQ(CONTENT_SETTING_ALLOW, - settings[1].setting); + EXPECT_EQ(CONTENT_SETTING_ALLOW, settings[1].GetContentSetting()); EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard( GURL("http://denied.com")), settings[2].primary_pattern); - EXPECT_EQ(CONTENT_SETTING_BLOCK, - settings[2].setting); + EXPECT_EQ(CONTENT_SETTING_BLOCK, settings[2].GetContentSetting()); EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard( GURL("http://denied2.com")), settings[3].primary_pattern); - EXPECT_EQ(CONTENT_SETTING_BLOCK, - settings[3].setting); + EXPECT_EQ(CONTENT_SETTING_BLOCK, settings[3].GetContentSetting()); EXPECT_EQ(ContentSettingsPattern::Wildcard(), settings[4].primary_pattern); - EXPECT_EQ(CONTENT_SETTING_ASK, - settings[4].setting); + EXPECT_EQ(CONTENT_SETTING_ASK, settings[4].GetContentSetting()); }
diff --git a/chrome/browser/notifications/notification_channels_provider_android.cc b/chrome/browser/notifications/notification_channels_provider_android.cc index ccbd084..8eded769 100644 --- a/chrome/browser/notifications/notification_channels_provider_android.cc +++ b/chrome/browser/notifications/notification_channels_provider_android.cc
@@ -19,6 +19,7 @@ #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings_pattern.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "content/public/browser/browser_thread.h" #include "jni/NotificationSettingsBridge_jni.h" #include "url/gurl.h"
diff --git a/chrome/browser/notifications/notification_channels_provider_android_unittest.cc b/chrome/browser/notifications/notification_channels_provider_android_unittest.cc index d61b8bc5..d5fc4c0 100644 --- a/chrome/browser/notifications/notification_channels_provider_android_unittest.cc +++ b/chrome/browser/notifications/notification_channels_provider_android_unittest.cc
@@ -12,6 +12,7 @@ #include "components/content_settings/core/browser/content_settings_rule.h" #include "components/content_settings/core/browser/content_settings_utils.h" #include "components/content_settings/core/common/content_settings_pattern.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/test_utils.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome/browser/notifications/notification_interactive_uitest_support.cc b/chrome/browser/notifications/notification_interactive_uitest_support.cc index 4d8e157..4a71efed 100644 --- a/chrome/browser/notifications/notification_interactive_uitest_support.cc +++ b/chrome/browser/notifications/notification_interactive_uitest_support.cc
@@ -15,6 +15,7 @@ #include "chrome/common/chrome_features.h" #include "chrome/test/base/ui_test_utils.h" #include "components/content_settings/core/browser/host_content_settings_map.h" +#include "components/content_settings/core/common/content_settings.h" #include "content/public/common/content_switches.h" #include "content/public/test/browser_test_utils.h" #include "ui/message_center/message_center.h" @@ -268,10 +269,12 @@ settings); for (ContentSettingsForOneType::iterator it = settings->begin(); it != settings->end();) { - if (it->setting != setting || it->source.compare("preference") != 0) + if (it->GetContentSetting() != setting || + it->source.compare("preference") != 0) { it = settings->erase(it); - else + } else { ++it; + } } }
diff --git a/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc b/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc index fdeab49..e69d467 100644 --- a/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc +++ b/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
@@ -80,8 +80,8 @@ #endif #if BUILDFLAG(ENABLE_OFFLINE_PAGES) -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "chrome/browser/offline_pages/prefetch/prefetch_service_factory.h" #include "components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.h" #include "components/ntp_snippets/remote/prefetched_pages_tracker_impl.h"
diff --git a/chrome/browser/offline_pages/offline_page_model_factory.cc b/chrome/browser/offline_pages/offline_page_model_factory.cc new file mode 100644 index 0000000..5fab967 --- /dev/null +++ b/chrome/browser/offline_pages/offline_page_model_factory.cc
@@ -0,0 +1,57 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/offline_pages/offline_page_model_factory.h" + +#include <utility> + +#include "base/files/file_path.h" +#include "base/memory/singleton.h" +#include "base/sequenced_task_runner.h" +#include "base/task_scheduler/post_task.h" +#include "chrome/browser/profiles/incognito_helpers.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/common/chrome_constants.h" +#include "components/keyed_service/content/browser_context_dependency_manager.h" +#include "components/offline_pages/core/offline_page_metadata_store_sql.h" +#include "components/offline_pages/core/offline_page_model_impl.h" + +namespace offline_pages { + +OfflinePageModelFactory::OfflinePageModelFactory() + : BrowserContextKeyedServiceFactory( + "OfflinePageModel", + BrowserContextDependencyManager::GetInstance()) {} + +// static +OfflinePageModelFactory* OfflinePageModelFactory::GetInstance() { + return base::Singleton<OfflinePageModelFactory>::get(); +} + +// static +OfflinePageModel* OfflinePageModelFactory::GetForBrowserContext( + content::BrowserContext* context) { + return static_cast<OfflinePageModelImpl*>( + GetInstance()->GetServiceForBrowserContext(context, true)); +} + +KeyedService* OfflinePageModelFactory::BuildServiceInstanceFor( + content::BrowserContext* context) const { + Profile* profile = Profile::FromBrowserContext(context); + scoped_refptr<base::SequencedTaskRunner> background_task_runner = + base::CreateSequencedTaskRunnerWithTraits({base::MayBlock()}); + + base::FilePath store_path = + profile->GetPath().Append(chrome::kOfflinePageMetadataDirname); + std::unique_ptr<OfflinePageMetadataStore> metadata_store( + new OfflinePageMetadataStoreSQL(background_task_runner, store_path)); + + base::FilePath archives_dir = + profile->GetPath().Append(chrome::kOfflinePageArchivesDirname); + + return new OfflinePageModelImpl(std::move(metadata_store), archives_dir, + background_task_runner); +} + +} // namespace offline_pages
diff --git a/chrome/browser/offline_pages/offline_page_model_factory.h b/chrome/browser/offline_pages/offline_page_model_factory.h new file mode 100644 index 0000000..43dd3dc --- /dev/null +++ b/chrome/browser/offline_pages/offline_page_model_factory.h
@@ -0,0 +1,45 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_FACTORY_H_ +#define CHROME_BROWSER_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_FACTORY_H_ + +#include "base/macros.h" +#include "components/keyed_service/content/browser_context_keyed_service_factory.h" + +namespace base { +template <typename T> +struct DefaultSingletonTraits; +} // namespace base + +namespace offline_pages { + +class OfflinePageModel; + +// A factory to create one unique OfflinePageModel. Offline pages are not +// supported in incognito, and this class uses default implementation of +// |GetBrowserContextToUse|. +// TODO(fgorski): Add an integration test that ensures incognito users don't +// save or open offline pages. +class OfflinePageModelFactory : public BrowserContextKeyedServiceFactory { + public: + static OfflinePageModelFactory* GetInstance(); + static OfflinePageModel* GetForBrowserContext( + content::BrowserContext* context); + + private: + friend struct base::DefaultSingletonTraits<OfflinePageModelFactory>; + + OfflinePageModelFactory(); + ~OfflinePageModelFactory() override {} + + KeyedService* BuildServiceInstanceFor( + content::BrowserContext* context) const override; + + DISALLOW_COPY_AND_ASSIGN(OfflinePageModelFactory); +}; + +} // namespace offline_pages + +#endif // CHROME_BROWSER_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_FACTORY_H_
diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc index 083ae8d..cda6f282 100644 --- a/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc +++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
@@ -274,6 +274,10 @@ int64_t original_content_length, base::TimeTicks creation_time, int net_error) { + // Ignore non-HTTP(S) resources (blobs, data uris, etc). + if (!url.SchemeIsHTTPOrHTTPS()) + return; + PageLoadTracker* tracker = GetTrackerOrNullForRequest(request_id, resource_type, creation_time); if (tracker) {
diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer_unittest.cc b/chrome/browser/page_load_metrics/metrics_web_contents_observer_unittest.cc index 901c37e..f7ffe1b9 100644 --- a/chrome/browser/page_load_metrics/metrics_web_contents_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer_unittest.cc
@@ -26,6 +26,7 @@ #include "content/public/test/navigation_simulator.h" #include "content/public/test/test_renderer_host.h" #include "content/public/test/web_contents_tester.h" +#include "net/base/net_errors.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -965,7 +966,7 @@ CheckNoErrorEvents(); } -TEST_F(MetricsWebContentsObserverTest, OnLoadedResourceMainFrame) { +TEST_F(MetricsWebContentsObserverTest, OnLoadedResource_MainFrame) { GURL main_resource_url(kDefaultTestUrl); content::WebContentsTester::For(web_contents()) ->NavigateAndCommit(main_resource_url); @@ -983,7 +984,7 @@ observer()->OnRequestComplete( main_resource_url, net::HostPortPair(), frame_tree_node_id, request_id, content::ResourceType::RESOURCE_TYPE_MAIN_FRAME, false, nullptr, 0, 0, - base::TimeTicks::Now(), 0); + base::TimeTicks::Now(), net::OK); EXPECT_EQ(1u, loaded_resources().size()); EXPECT_EQ(main_resource_url, loaded_resources().back().url); @@ -994,12 +995,12 @@ observer()->OnRequestComplete( main_resource_url, net::HostPortPair(), frame_tree_node_id, request_id, content::ResourceType::RESOURCE_TYPE_MAIN_FRAME, false, nullptr, 0, 0, - base::TimeTicks::Now(), 0); + base::TimeTicks::Now(), net::OK); EXPECT_EQ(1u, loaded_resources().size()); EXPECT_EQ(main_resource_url, loaded_resources().back().url); } -TEST_F(MetricsWebContentsObserverTest, OnLoadedResource) { +TEST_F(MetricsWebContentsObserverTest, OnLoadedResource_Subresource) { content::WebContentsTester* web_contents_tester = content::WebContentsTester::For(web_contents()); web_contents_tester->NavigateAndCommit(GURL(kDefaultTestUrl)); @@ -1008,10 +1009,25 @@ loaded_resource_url, net::HostPortPair(), web_contents()->GetMainFrame()->GetFrameTreeNodeId(), content::GlobalRequestID(), content::RESOURCE_TYPE_SCRIPT, false, nullptr, - 0, 0, base::TimeTicks::Now(), 0); + 0, 0, base::TimeTicks::Now(), net::OK); EXPECT_EQ(1u, loaded_resources().size()); EXPECT_EQ(loaded_resource_url, loaded_resources().back().url); } +TEST_F(MetricsWebContentsObserverTest, + OnLoadedResource_IgnoreNonHttpOrHttpsScheme) { + content::WebContentsTester* web_contents_tester = + content::WebContentsTester::For(web_contents()); + web_contents_tester->NavigateAndCommit(GURL(kDefaultTestUrl)); + GURL loaded_resource_url("data:text/html,Hello world"); + observer()->OnRequestComplete( + loaded_resource_url, net::HostPortPair(), + web_contents()->GetMainFrame()->GetFrameTreeNodeId(), + content::GlobalRequestID(), content::RESOURCE_TYPE_SCRIPT, false, nullptr, + 0, 0, base::TimeTicks::Now(), net::OK); + + EXPECT_TRUE(loaded_resources().empty()); +} + } // namespace page_load_metrics
diff --git a/chrome/browser/page_load_metrics/observers/ads_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/ads_page_load_metrics_observer.cc index 659f1fc..a355a05a 100644 --- a/chrome/browser/page_load_metrics/observers/ads_page_load_metrics_observer.cc +++ b/chrome/browser/page_load_metrics/observers/ads_page_load_metrics_observer.cc
@@ -175,14 +175,6 @@ void AdsPageLoadMetricsObserver::ProcessLoadedResource( const page_load_metrics::ExtraRequestCompleteInfo& extra_request_info) { - if (!extra_request_info.url.SchemeIsHTTPOrHTTPS()) { - // Data uris should be accounted for in the generating resource, not - // here. Blobs for PlzNavigate shouldn't be counted as the http resource - // was already counted. Blobs for other things like CacheStorage or - // IndexedDB are also ignored for now, as they're not normal HTTP loads. - return; - } - const auto& id_and_data = ad_frames_data_.find(extra_request_info.frame_tree_node_id); if (id_and_data == ad_frames_data_.end()) {
diff --git a/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer_unittest.cc index 219ac74..6df70df 100644 --- a/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer_unittest.cc
@@ -429,13 +429,13 @@ page_load_metrics::ExtraRequestCompleteInfo resources[] = { // Cached request. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, true /*was_cached*/, 1024 * 20 /* raw_body_bytes */, 0 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached non-proxied request. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, @@ -520,13 +520,13 @@ page_load_metrics::ExtraRequestCompleteInfo resources[] = { // Cached request. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, true /*was_cached*/, 1024 * 20 /* raw_body_bytes */, 0 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached non-proxied request. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, @@ -605,13 +605,13 @@ page_load_metrics::ExtraRequestCompleteInfo resources[] = { // Cached request. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, true /*was_cached*/, 1024 * 20 /* raw_body_bytes */, 0 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached non-proxied request. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */,
diff --git a/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer_unittest.cc index 01d0a05..27399029 100644 --- a/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer_unittest.cc
@@ -424,7 +424,7 @@ // Verify LoFi is tracked when a LoFi response is received. page_load_metrics::ExtraRequestCompleteInfo resource = { - GURL(), + GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, true /*was_cached*/, @@ -468,24 +468,24 @@ // Prepare 4 resources of varying size and configurations. page_load_metrics::ExtraRequestCompleteInfo resources[] = { // Cached request. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, true /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 0 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached non-proxied request. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached proxied request with .1 compression ratio. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 * 10 /* original_network_content_length */, data->DeepCopy(), content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached proxied request with .5 compression ratio. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 * 5 /* original_network_content_length */, std::move(data), content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, @@ -529,24 +529,24 @@ // Prepare 4 resources of varying size and configurations. page_load_metrics::ExtraRequestCompleteInfo resources[] = { // Cached request. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, true /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 0 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached non-proxied request. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached proxied request with .1 compression ratio. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /*was_cached*/, 1024 * 40 * 10 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, data->DeepCopy(), content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached proxied request with .5 compression ratio. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /*was_cached*/, 1024 * 40 * 5 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, std::move(data), content::ResourceType::RESOURCE_TYPE_SCRIPT, 0},
diff --git a/chrome/browser/page_load_metrics/observers/lofi_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/lofi_page_load_metrics_observer_unittest.cc index 20efc021..608b5eae 100644 --- a/chrome/browser/page_load_metrics/observers/lofi_page_load_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/lofi_page_load_metrics_observer_unittest.cc
@@ -133,23 +133,23 @@ // LoFi set. page_load_metrics::ExtraRequestCompleteInfo resources[] = { // Cached request. - {GURL(), net::HostPortPair(), -1, true /*was_cached*/, + {GURL(kResourceUrl), net::HostPortPair(), -1, true /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 0 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached non-proxied request. - {GURL(), net::HostPortPair(), -1, false /*was_cached*/, + {GURL(kResourceUrl), net::HostPortPair(), -1, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_IMAGE, 0}, // Uncached proxied request with .1 compression ratio. - {GURL(), net::HostPortPair(), -1, false /*was_cached*/, + {GURL(kResourceUrl), net::HostPortPair(), -1, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 * 10 /* original_network_content_length */, data->DeepCopy(), content::ResourceType::RESOURCE_TYPE_IMAGE, 0}, // Uncached proxied request with .5 compression ratio. - {GURL(), net::HostPortPair(), -1, false /*was_cached*/, + {GURL(kResourceUrl), net::HostPortPair(), -1, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 * 5 /* original_network_content_length */, std::move(data), content::ResourceType::RESOURCE_TYPE_IMAGE, 0}, @@ -193,23 +193,23 @@ // client LoFi set. page_load_metrics::ExtraRequestCompleteInfo resources[] = { // Cached request. - {GURL(), net::HostPortPair(), -1, true /*was_cached*/, + {GURL(kResourceUrl), net::HostPortPair(), -1, true /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 0 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached non-proxied request. - {GURL(), net::HostPortPair(), -1, false /*was_cached*/, + {GURL(kResourceUrl), net::HostPortPair(), -1, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_IMAGE, 0}, // Uncached proxied request with .1 compression ratio. - {GURL(), net::HostPortPair(), -1, false /*was_cached*/, + {GURL(kResourceUrl), net::HostPortPair(), -1, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 * 10 /* original_network_content_length */, data->DeepCopy(), content::ResourceType::RESOURCE_TYPE_IMAGE, 0}, // Uncached proxied request with .5 compression ratio. - {GURL(), net::HostPortPair(), -1, false /*was_cached*/, + {GURL(kResourceUrl), net::HostPortPair(), -1, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 * 5 /* original_network_content_length */, std::move(data), content::ResourceType::RESOURCE_TYPE_IMAGE, 0}, @@ -254,23 +254,23 @@ // server LoFi set. page_load_metrics::ExtraRequestCompleteInfo resources[] = { // Cached request. - {GURL(), net::HostPortPair(), -1, true /*was_cached*/, + {GURL(kResourceUrl), net::HostPortPair(), -1, true /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 0 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached non-proxied request. - {GURL(), net::HostPortPair(), -1, false /*was_cached*/, + {GURL(kResourceUrl), net::HostPortPair(), -1, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_IMAGE, 0}, // Uncached proxied request with .1 compression ratio. - {GURL(), net::HostPortPair(), -1, false /*was_cached*/, + {GURL(kResourceUrl), net::HostPortPair(), -1, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 * 10 /* original_network_content_length */, data->DeepCopy(), content::ResourceType::RESOURCE_TYPE_IMAGE, 0}, // Uncached proxied request with .5 compression ratio. - {GURL(), net::HostPortPair(), -1, false /*was_cached*/, + {GURL(kResourceUrl), net::HostPortPair(), -1, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 * 5 /* original_network_content_length */, std::move(data), content::ResourceType::RESOURCE_TYPE_IMAGE, 0}, @@ -320,23 +320,23 @@ // 1 has Server LoFi. page_load_metrics::ExtraRequestCompleteInfo resources[] = { // Cached request. - {GURL(), net::HostPortPair(), -1, true /*was_cached*/, + {GURL(kResourceUrl), net::HostPortPair(), -1, true /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 0 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached non-proxied request. - {GURL(), net::HostPortPair(), -1, false /*was_cached*/, + {GURL(kResourceUrl), net::HostPortPair(), -1, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_IMAGE, 0}, // Uncached proxied request with .1 compression ratio. - {GURL(), net::HostPortPair(), -1, false /*was_cached*/, + {GURL(kResourceUrl), net::HostPortPair(), -1, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 * 10 /* original_network_content_length */, std::move(data1), content::ResourceType::RESOURCE_TYPE_IMAGE, 0}, // Uncached proxied request with .5 compression ratio. - {GURL(), net::HostPortPair(), -1, false /*was_cached*/, + {GURL(kResourceUrl), net::HostPortPair(), -1, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 * 5 /* original_network_content_length */, std::move(data2), content::ResourceType::RESOURCE_TYPE_IMAGE, 0},
diff --git a/chrome/browser/page_load_metrics/observers/media_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/media_page_load_metrics_observer_unittest.cc index 5cdb75b..7778661 100644 --- a/chrome/browser/page_load_metrics/observers/media_page_load_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/media_page_load_metrics_observer_unittest.cc
@@ -57,25 +57,25 @@ // Prepare 4 resources of varying size and configurations. page_load_metrics::ExtraRequestCompleteInfo resources[] = { // Cached request. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, true /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 0 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached non-proxied request. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached proxied request with .1 compression ratio. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached proxied request with .5 compression ratio. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */,
diff --git a/chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.cc b/chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.cc index 878fd4f9..e83ed8ce 100644 --- a/chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.cc +++ b/chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.cc
@@ -146,4 +146,7 @@ content::WebContentsTester::For(web_contents())->CommitPendingNavigation(); } +const char PageLoadMetricsObserverTestHarness::kResourceUrl[] = + "https://www.example.com/resource"; + } // namespace page_load_metrics
diff --git a/chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.h b/chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.h index 953f733..d6ac103 100644 --- a/chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.h +++ b/chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.h
@@ -27,6 +27,9 @@ : public ChromeRenderViewHostTestHarness, public test::WeakMockTimerProvider { public: + // Sample URL for resource loads. + static const char kResourceUrl[]; + PageLoadMetricsObserverTestHarness(); ~PageLoadMetricsObserverTestHarness() override;
diff --git a/chrome/browser/page_load_metrics/observers/subresource_filter_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/subresource_filter_metrics_observer_unittest.cc index 476b426..346dc16 100644 --- a/chrome/browser/page_load_metrics/observers/subresource_filter_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/subresource_filter_metrics_observer_unittest.cc
@@ -210,7 +210,7 @@ TEST_F(SubresourceFilterMetricsObserverTest, Subresources) { SimulateNavigateAndCommit(GURL(kDefaultTestUrlWithActivation)); - SimulateLoadedResource({GURL(), net::HostPortPair(), + SimulateLoadedResource({GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /* was_cached */, 1024 * 40 /* raw_body_bytes */, 0 /* original_network_content_length */, @@ -225,14 +225,14 @@ blink::WebLoadingBehaviorFlag::kWebLoadingBehaviorSubresourceFilterMatch; SimulateTimingAndMetadataUpdate(timing, metadata); - SimulateLoadedResource({GURL(), net::HostPortPair(), + SimulateLoadedResource({GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /* was_cached */, 1024 * 20 /* raw_body_bytes */, 0 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}); - SimulateLoadedResource({GURL(), net::HostPortPair(), + SimulateLoadedResource({GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, true /* was_cached */, 1024 * 10 /* raw_body_bytes */, 0 /* original_network_content_length */, @@ -313,7 +313,7 @@ SimulateMediaPlayed(); - SimulateLoadedResource({GURL(), net::HostPortPair(), + SimulateLoadedResource({GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /* was_cached */, 1024 * 40 /* raw_body_bytes */, 0 /* original_network_content_length */, @@ -328,14 +328,14 @@ blink::WebLoadingBehaviorFlag::kWebLoadingBehaviorSubresourceFilterMatch; SimulateTimingAndMetadataUpdate(timing, metadata); - SimulateLoadedResource({GURL(), net::HostPortPair(), + SimulateLoadedResource({GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /* was_cached */, 1024 * 20 /* raw_body_bytes */, 0 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}); - SimulateLoadedResource({GURL(), net::HostPortPair(), + SimulateLoadedResource({GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, true /* was_cached */, 1024 * 10 /* raw_body_bytes */, 0 /* original_network_content_length */,
diff --git a/chrome/browser/page_load_metrics/observers/tab_restore_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/tab_restore_page_load_metrics_observer_unittest.cc index 3a09152..f4b2114 100644 --- a/chrome/browser/page_load_metrics/observers/tab_restore_page_load_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/tab_restore_page_load_metrics_observer_unittest.cc
@@ -72,25 +72,25 @@ // Prepare 4 resources of varying size and configurations. page_load_metrics::ExtraRequestCompleteInfo resources[] = { // Cached request. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, true /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 0 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached non-proxied request. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached proxied request with .1 compression ratio. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */, content::ResourceType::RESOURCE_TYPE_SCRIPT, 0}, // Uncached proxied request with .5 compression ratio. - {GURL(), net::HostPortPair(), -1 /* frame_tree_node_id */, + {GURL(kResourceUrl), net::HostPortPair(), -1 /* frame_tree_node_id */, false /*was_cached*/, 1024 * 40 /* raw_body_bytes */, 1024 * 40 /* original_network_content_length */, nullptr /* data_reduction_proxy_data */,
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc index 19e3d7e..8723dfc 100644 --- a/chrome/browser/password_manager/chrome_password_manager_client.cc +++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -88,8 +88,14 @@ #include "extensions/common/constants.h" #endif +#include "device/vr/features/features.h" +#if BUILDFLAG(ENABLE_VR) +#include "chrome/browser/android/vr_shell/vr_tab_helper.h" +#endif // BUILDFLAG(ENABLE_VR) + using password_manager::ContentPasswordManagerDriverFactory; using password_manager::PasswordManagerInternalsService; +using password_manager::PasswordManagerMetricsRecorder; using sessions::SerializedNavigationEntry; // Shorten the name to spare line breaks. The code provides enough context @@ -209,6 +215,14 @@ is_enabled = entry->GetURL().host_piece() != chrome::kChromeUIChromeSigninHost; } + +#if BUILDFLAG(ENABLE_VR) + // The password manager is disabled while VR (virtual reality) is being used, + // as the use of conventional UI elements might harm the user experience in + // VR. + is_enabled = is_enabled && !vr_shell::VrTabHelper::IsInVr(web_contents()); +#endif // BUILDFLAG(ENABLE_VR) + if (log_manager_->IsLoggingActive()) { password_manager::BrowserSavePasswordProgressLogger logger( log_manager_.get()); @@ -454,6 +468,16 @@ return *ukm_source_id_; } +PasswordManagerMetricsRecorder& +ChromePasswordManagerClient::GetMetricsRecorder() { + if (!metrics_recorder_) { + metrics_recorder_.emplace( + PasswordManagerMetricsRecorder::CreateUkmEntryBuilder( + GetUkmRecorder(), GetUkmSourceId())); + } + return metrics_recorder_.value(); +} + // TODO(crbug.com/706392): Fix password reuse detection for Android. #if !defined(OS_ANDROID) void ChromePasswordManagerClient::DidFinishNavigation( @@ -461,8 +485,11 @@ if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) return; - if (!navigation_handle->IsSameDocument()) + if (!navigation_handle->IsSameDocument()) { ukm_source_id_.reset(); + // Send any collected metrics by destroying the metrics recorder. + metrics_recorder_.reset(); + } password_reuse_detection_manager_.DidNavigateMainFrame(GetMainFrameURL()); // After some navigations RenderViewHost persists and just adding the observer
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.h b/chrome/browser/password_manager/chrome_password_manager_client.h index 691fd949..2af35807 100644 --- a/chrome/browser/password_manager/chrome_password_manager_client.h +++ b/chrome/browser/password_manager/chrome_password_manager_client.h
@@ -16,6 +16,7 @@ #include "components/password_manager/content/browser/credential_manager_impl.h" #include "components/password_manager/core/browser/password_manager.h" #include "components/password_manager/core/browser/password_manager_client.h" +#include "components/password_manager/core/browser/password_manager_metrics_recorder.h" #include "components/password_manager/core/browser/password_reuse_detection_manager.h" #include "components/password_manager/sync/browser/sync_credentials_filter.h" #include "components/prefs/pref_member.h" @@ -118,6 +119,8 @@ ukm::UkmRecorder* GetUkmRecorder() override; ukm::SourceId GetUkmSourceId() override; + password_manager::PasswordManagerMetricsRecorder& GetMetricsRecorder() + override; static void CreateForWebContentsWithAutofillClient( content::WebContents* contents, @@ -223,6 +226,12 @@ // navigation of the tab owning this ChromePasswordManagerClient. base::Optional<ukm::SourceId> ukm_source_id_; + // Recorder of metrics that is associated with the last committed navigation + // of the WebContents owning this ChromePasswordManagerClient. May be unset at + // times. Sends statistics on destruction. + base::Optional<password_manager::PasswordManagerMetricsRecorder> + metrics_recorder_; + DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); };
diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc index 5f13a9c..808fc9f 100644 --- a/chrome/browser/password_manager/password_store_factory.cc +++ b/chrome/browser/password_manager/password_store_factory.cc
@@ -17,6 +17,7 @@ #include "build/build_config.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/sync/glue/sync_start_util.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/web_data_service_factory.h" @@ -56,6 +57,11 @@ #include "chrome/browser/password_manager/password_store_x.h" #endif +#if defined(OS_WIN) || defined(OS_MACOSX) || \ + (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +#include "chrome/browser/password_manager/password_store_signin_notifier_impl.h" +#endif + using password_manager::PasswordStore; namespace { @@ -104,21 +110,17 @@ content::BrowserThread::DB)); } -// static -void PasswordStoreFactory::TrimOrDeleteAffiliationCache(Profile* profile) { - scoped_refptr<PasswordStore> password_store = - GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS); - password_manager::TrimOrDeleteAffiliationCacheForStoreAndPath( - password_store.get(), profile->GetPath(), - content::BrowserThread::GetTaskRunnerForThread( - content::BrowserThread::DB)); -} - PasswordStoreFactory::PasswordStoreFactory() : RefcountedBrowserContextKeyedServiceFactory( "PasswordStore", BrowserContextDependencyManager::GetInstance()) { DependsOn(WebDataServiceFactory::GetInstance()); +#if defined(OS_WIN) || defined(OS_MACOSX) || \ + (defined(OS_LINUX) && !defined(OS_CHROMEOS)) + // TODO(crbug.com/715987). Remove when PasswordReuseDetector is decoupled + // from PasswordStore. + DependsOn(SigninManagerFactory::GetInstance()); +#endif } PasswordStoreFactory::~PasswordStoreFactory() {} @@ -275,6 +277,14 @@ ps.get(), profile->GetPrefs(), make_scoped_refptr(profile->GetRequestContext())); +#if defined(OS_WIN) || defined(OS_MACOSX) || \ + (defined(OS_LINUX) && !defined(OS_CHROMEOS)) + std::unique_ptr<password_manager::PasswordStoreSigninNotifier> notifier = + base::MakeUnique<password_manager::PasswordStoreSigninNotifierImpl>( + profile); + ps->SetPasswordStoreSigninNotifier(std::move(notifier)); +#endif + return ps; }
diff --git a/chrome/browser/password_manager/password_store_factory.h b/chrome/browser/password_manager/password_store_factory.h index 6c0df549..c8a5914a 100644 --- a/chrome/browser/password_manager/password_store_factory.h +++ b/chrome/browser/password_manager/password_store_factory.h
@@ -46,10 +46,6 @@ // that syncing passwords has just started or ended for |profile|. static void OnPasswordsSyncedStatePotentiallyChanged(Profile* profile); - // Trims the affiliation cache for |profile| if affiliation-based matching is - // enabled, and completely deletes it otherwise. - static void TrimOrDeleteAffiliationCache(Profile* profile); - private: friend struct base::DefaultSingletonTraits<PasswordStoreFactory>;
diff --git a/chrome/browser/password_manager/password_store_signin_notifier_impl.cc b/chrome/browser/password_manager/password_store_signin_notifier_impl.cc new file mode 100644 index 0000000..e0918ea --- /dev/null +++ b/chrome/browser/password_manager/password_store_signin_notifier_impl.cc
@@ -0,0 +1,44 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/password_manager/password_store_signin_notifier_impl.h" + +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/signin/signin_manager_factory.h" +#include "components/signin/core/browser/signin_manager.h" + +namespace password_manager { + +PasswordStoreSigninNotifierImpl::PasswordStoreSigninNotifierImpl( + Profile* profile) + : profile_(profile) { + DCHECK(profile); +} + +PasswordStoreSigninNotifierImpl::~PasswordStoreSigninNotifierImpl() {} + +void PasswordStoreSigninNotifierImpl::SubscribeToSigninEvents( + PasswordStore* store) { + set_store(store); + SigninManagerFactory::GetForProfile(profile_)->AddObserver(this); +} + +void PasswordStoreSigninNotifierImpl::UnsubscribeFromSigninEvents() { + SigninManagerFactory::GetForProfile(profile_)->RemoveObserver(this); +} + +void PasswordStoreSigninNotifierImpl::GoogleSigninSucceeded( + const std::string& account_id, + const std::string& username, + const std::string& password) { + NotifySignin(password); +} + +void PasswordStoreSigninNotifierImpl::GoogleSignedOut( + const std::string& account_id, + const std::string& username) { + NotifySignedOut(); +} + +} // namespace password_manager
diff --git a/chrome/browser/password_manager/password_store_signin_notifier_impl.h b/chrome/browser/password_manager/password_store_signin_notifier_impl.h new file mode 100644 index 0000000..f5cbc71 --- /dev/null +++ b/chrome/browser/password_manager/password_store_signin_notifier_impl.h
@@ -0,0 +1,42 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_SIGNIN_NOTIFIER_IMPL_H_ +#define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_SIGNIN_NOTIFIER_IMPL_H_ + +#include "base/macros.h" + +#include "components/password_manager/core/browser/password_store_signin_notifier.h" +#include "components/signin/core/browser/signin_manager_base.h" + +class Profile; + +namespace password_manager { + +// Responsible for subscribing to Chrome sign-in events and passing them to +// PasswordStore. +class PasswordStoreSigninNotifierImpl : public PasswordStoreSigninNotifier, + public SigninManagerBase::Observer { + public: + explicit PasswordStoreSigninNotifierImpl(Profile* profile); + ~PasswordStoreSigninNotifierImpl() override; + + // PasswordStoreSigninNotifier implementations. + void SubscribeToSigninEvents(PasswordStore* store) override; + void UnsubscribeFromSigninEvents() override; + + // SigninManagerBase::Observer implementations. + void GoogleSigninSucceeded(const std::string& account_id, + const std::string& username, + const std::string& password) override; + + void GoogleSignedOut(const std::string& account_id, + const std::string& username) override; + + private: + Profile* const profile_; +}; + +} // namespace password_manager +#endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_SIGNIN_NOTIFIER_IMPL_H_
diff --git a/chrome/browser/password_manager/password_store_signin_notifier_impl_unittest.cc b/chrome/browser/password_manager/password_store_signin_notifier_impl_unittest.cc new file mode 100644 index 0000000..8820d600 --- /dev/null +++ b/chrome/browser/password_manager/password_store_signin_notifier_impl_unittest.cc
@@ -0,0 +1,69 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/password_manager/password_store_signin_notifier_impl.h" + +#include "chrome/browser/signin/fake_signin_manager_builder.h" +#include "chrome/browser/signin/signin_manager_factory.h" +#include "chrome/test/base/testing_profile.h" +#include "components/password_manager/core/browser/mock_password_store.h" +#include "content/public/test/test_browser_thread_bundle.h" +#include "testing/gtest/include/gtest/gtest.h" + +using testing::_; + +namespace password_manager { +namespace { + +class PasswordStoreSigninNotifierImplTest : public testing::Test { + public: + PasswordStoreSigninNotifierImplTest() { + TestingProfile::Builder builder; + builder.AddTestingFactory(SigninManagerFactory::GetInstance(), + BuildFakeSigninManagerBase); + testing_profile_.reset(builder.Build().release()); + fake_signin_manager_ = static_cast<FakeSigninManagerForTesting*>( + SigninManagerFactory::GetForProfile(testing_profile_.get())); + store_ = new MockPasswordStore(); + } + + ~PasswordStoreSigninNotifierImplTest() override { + store_->ShutdownOnUIThread(); + } + + protected: + content::TestBrowserThreadBundle thread_bundle; + std::unique_ptr<TestingProfile> testing_profile_; + FakeSigninManagerForTesting* fake_signin_manager_; // Weak + scoped_refptr<MockPasswordStore> store_; +}; + +// Checks that if a notifier is subscribed on sign-in events, then +// a password store receives sign-in notifications. +TEST_F(PasswordStoreSigninNotifierImplTest, Subscribed) { + PasswordStoreSigninNotifierImpl notifier(testing_profile_.get()); + notifier.SubscribeToSigninEvents(store_.get()); + EXPECT_CALL(*store_, SaveSyncPasswordHash(base::ASCIIToUTF16("password"))); + fake_signin_manager_->SignIn("accountid", "username", "password"); + testing::Mock::VerifyAndClearExpectations(store_.get()); + EXPECT_CALL(*store_, ClearSyncPasswordHash()); + fake_signin_manager_->ForceSignOut(); + notifier.UnsubscribeFromSigninEvents(); +} + +// Checks that if a notifier is unsubscribed on sign-in events, then +// a password store receives no sign-in notifications. +TEST_F(PasswordStoreSigninNotifierImplTest, Unsubscribed) { + PasswordStoreSigninNotifierImpl notifier(testing_profile_.get()); + notifier.SubscribeToSigninEvents(store_.get()); + + notifier.UnsubscribeFromSigninEvents(); + EXPECT_CALL(*store_, SaveSyncPasswordHash(_)).Times(0); + EXPECT_CALL(*store_, ClearSyncPasswordHash()).Times(0); + fake_signin_manager_->SignIn("accountid", "username", "secret"); + fake_signin_manager_->ForceSignOut(); +} + +} // namespace +} // namespace password_manager
diff --git a/chrome/browser/permissions/permission_context_base.cc b/chrome/browser/permissions/permission_context_base.cc index 3f263c4..8210831 100644 --- a/chrome/browser/permissions/permission_context_base.cc +++ b/chrome/browser/permissions/permission_context_base.cc
@@ -470,9 +470,7 @@ ContentSettingsType PermissionContextBase::content_settings_storage_type() const { - if (content_settings_type_ == CONTENT_SETTINGS_TYPE_PUSH_MESSAGING) - return CONTENT_SETTINGS_TYPE_NOTIFICATIONS; - return content_settings_type_; + return PermissionUtil::GetContentSettingsStorageType(content_settings_type_); } bool PermissionContextBase::PermissionAllowedByFeaturePolicy(
diff --git a/chrome/browser/permissions/permission_context_base.h b/chrome/browser/permissions/permission_context_base.h index e50a900b..4c073a1 100644 --- a/chrome/browser/permissions/permission_context_base.h +++ b/chrome/browser/permissions/permission_context_base.h
@@ -174,9 +174,6 @@ return content_settings_type_; } - // TODO(timloh): The CONTENT_SETTINGS_TYPE_NOTIFICATIONS type is used to - // store both push messaging and notifications permissions. Remove this - // once we've unified these types (crbug.com/563297). ContentSettingsType content_settings_storage_type() const; private:
diff --git a/chrome/browser/permissions/permission_context_base_unittest.cc b/chrome/browser/permissions/permission_context_base_unittest.cc index dd62e4a9..72689b3 100644 --- a/chrome/browser/permissions/permission_context_base_unittest.cc +++ b/chrome/browser/permissions/permission_context_base_unittest.cc
@@ -23,6 +23,7 @@ #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/permissions/permission_decision_auto_blocker.h" +#include "chrome/browser/permissions/permission_manager.h" #include "chrome/browser/permissions/permission_queue_controller.h" #include "chrome/browser/permissions/permission_request_id.h" #include "chrome/browser/permissions/permission_request_manager.h" @@ -880,6 +881,28 @@ TestVariationBlockOnSeveralDismissals_TestContent(); } +// Test that too many dismissals for push messaging will result in notifications +// being embargoed. +TEST_P(PermissionContextBaseTests, PushMessagingEmbargoEmbargoesNotifications) { + GURL url("https://www.google.com"); + SetUpUrl(url); + DismissMultipleTimesAndExpectBlock(url, CONTENT_SETTINGS_TYPE_PUSH_MESSAGING, + 3); + PermissionManager* permission_manager = PermissionManager::Get(profile()); + + // Check push messaging is now embargoed. + PermissionResult result = permission_manager->GetPermissionStatus( + CONTENT_SETTINGS_TYPE_PUSH_MESSAGING, url, url); + EXPECT_EQ(CONTENT_SETTING_BLOCK, result.content_setting); + EXPECT_EQ(PermissionStatusSource::MULTIPLE_DISMISSALS, result.source); + + // Check notifications yields the same result. + result = permission_manager->GetPermissionStatus( + CONTENT_SETTINGS_TYPE_NOTIFICATIONS, url, url); + EXPECT_EQ(CONTENT_SETTING_BLOCK, result.content_setting); + EXPECT_EQ(PermissionStatusSource::MULTIPLE_DISMISSALS, result.source); +} + // Simulates non-valid requesting URL. // The permission should be denied but not saved for future use. TEST_P(PermissionContextBaseTests, TestNonValidRequestingUrl) {
diff --git a/chrome/browser/permissions/permission_decision_auto_blocker.cc b/chrome/browser/permissions/permission_decision_auto_blocker.cc index 2ca703f6..62e1df7 100644 --- a/chrome/browser/permissions/permission_decision_auto_blocker.cc +++ b/chrome/browser/permissions/permission_decision_auto_blocker.cc
@@ -288,6 +288,7 @@ const GURL& request_origin, ContentSettingsType permission, base::Callback<void(bool)> callback) { + permission = PermissionUtil::GetContentSettingsStorageType(permission); DCHECK_EQ(CONTENT_SETTING_ASK, GetEmbargoResult(request_origin, permission).content_setting); @@ -311,6 +312,7 @@ PermissionResult PermissionDecisionAutoBlocker::GetEmbargoResult( const GURL& request_origin, ContentSettingsType permission) { + permission = PermissionUtil::GetContentSettingsStorageType(permission); return GetEmbargoResult( HostContentSettingsMapFactory::GetForProfile(profile_), request_origin, permission, clock_->Now()); @@ -319,18 +321,21 @@ int PermissionDecisionAutoBlocker::GetDismissCount( const GURL& url, ContentSettingsType permission) { + permission = PermissionUtil::GetContentSettingsStorageType(permission); return GetActionCount(url, permission, kPromptDismissCountKey, profile_); } int PermissionDecisionAutoBlocker::GetIgnoreCount( const GURL& url, ContentSettingsType permission) { + permission = PermissionUtil::GetContentSettingsStorageType(permission); return GetActionCount(url, permission, kPromptIgnoreCountKey, profile_); } bool PermissionDecisionAutoBlocker::RecordDismissAndEmbargo( const GURL& url, ContentSettingsType permission) { + permission = PermissionUtil::GetContentSettingsStorageType(permission); int current_dismissal_count = RecordActionInWebsiteSettings( url, permission, kPromptDismissCountKey, profile_); @@ -355,6 +360,7 @@ bool PermissionDecisionAutoBlocker::RecordIgnoreAndEmbargo( const GURL& url, ContentSettingsType permission) { + permission = PermissionUtil::GetContentSettingsStorageType(permission); int current_ignore_count = RecordActionInWebsiteSettings( url, permission, kPromptIgnoreCountKey, profile_); @@ -370,6 +376,7 @@ void PermissionDecisionAutoBlocker::RemoveEmbargoByUrl( const GURL& url, ContentSettingsType permission) { + permission = PermissionUtil::GetContentSettingsStorageType(permission); if (!PermissionUtil::IsPermission(permission)) return;
diff --git a/chrome/browser/permissions/permission_util.cc b/chrome/browser/permissions/permission_util.cc index 1dc6cc6c..8e3e390 100644 --- a/chrome/browser/permissions/permission_util.cc +++ b/chrome/browser/permissions/permission_util.cc
@@ -141,6 +141,13 @@ return true; } +ContentSettingsType PermissionUtil::GetContentSettingsStorageType( + ContentSettingsType type) { + if (type == CONTENT_SETTINGS_TYPE_PUSH_MESSAGING) + return CONTENT_SETTINGS_TYPE_NOTIFICATIONS; + return type; +} + bool PermissionUtil::IsPermission(ContentSettingsType type) { switch (type) { case CONTENT_SETTINGS_TYPE_GEOLOCATION:
diff --git a/chrome/browser/permissions/permission_util.h b/chrome/browser/permissions/permission_util.h index 2376bc8..0df3f58 100644 --- a/chrome/browser/permissions/permission_util.h +++ b/chrome/browser/permissions/permission_util.h
@@ -61,6 +61,12 @@ static bool GetPermissionType(ContentSettingsType type, content::PermissionType* out); + // TODO(timloh): The CONTENT_SETTINGS_TYPE_NOTIFICATIONS type is used to + // store both push messaging and notifications permissions. Remove this + // once we've unified these types (crbug.com/563297). + static ContentSettingsType GetContentSettingsStorageType( + ContentSettingsType type); + // Checks whether the given ContentSettingsType is a permission. Use this // to determine whether a specific ContentSettingsType is supported by the // PermissionManager.
diff --git a/chrome/browser/plugins/flash_download_interception.cc b/chrome/browser/plugins/flash_download_interception.cc index b4f6678..f9a7b44 100644 --- a/chrome/browser/plugins/flash_download_interception.cc +++ b/chrome/browser/plugins/flash_download_interception.cc
@@ -159,5 +159,5 @@ } return base::MakeUnique<navigation_interception::InterceptNavigationThrottle>( - handle, base::Bind(&InterceptNavigation, source_url), true); + handle, base::Bind(&InterceptNavigation, source_url)); }
diff --git a/chrome/browser/plugins/plugin_utils.cc b/chrome/browser/plugins/plugin_utils.cc index 966da495..b56d974f 100644 --- a/chrome/browser/plugins/plugin_utils.cc +++ b/chrome/browser/plugins/plugin_utils.cc
@@ -9,6 +9,7 @@ #include "chrome/common/plugin_utils.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings_types.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "content/public/common/webplugininfo.h" #include "url/gurl.h" #include "url/origin.h"
diff --git a/chrome/browser/predictors/loading_predictor.cc b/chrome/browser/predictors/loading_predictor.cc index 5d1ced2..d9b9411 100644 --- a/chrome/browser/predictors/loading_predictor.cc +++ b/chrome/browser/predictors/loading_predictor.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/predictors/loading_predictor.h" +#include <vector> + #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "chrome/browser/predictors/loading_data_collector.h" @@ -26,6 +28,7 @@ config)), loading_data_collector_(base::MakeUnique<LoadingDataCollector>( resource_prefetch_predictor())), + observer_(nullptr), weak_factory_(this) { resource_prefetch_predictor_->SetStatsCollector(stats_collector_.get()); } @@ -41,9 +44,7 @@ // To report hint durations. active_hints_.emplace(url, base::TimeTicks::Now()); - - if (config_.IsPrefetchingEnabledForOrigin(profile_, origin)) - resource_prefetch_predictor_->StartPrefetching(url, prediction); + MaybeAddPrefetch(url, prediction, origin); } void LoadingPredictor::CancelPageLoadHint(const GURL& url) { @@ -64,6 +65,17 @@ void LoadingPredictor::Shutdown() { resource_prefetch_predictor_->Shutdown(); + + std::vector<std::unique_ptr<ResourcePrefetcher>> prefetchers; + for (auto& kv : prefetches_) + prefetchers.push_back(std::move(kv.second.first)); + + // |prefetchers| must be destroyed on the IO thread. + content::BrowserThread::PostTask( + content::BrowserThread::IO, FROM_HERE, + base::BindOnce( + [](std::vector<std::unique_ptr<ResourcePrefetcher>> prefetchers) {}, + std::move(prefetchers))); } void LoadingPredictor::OnMainFrameRequest(const URLRequestSummary& summary) { @@ -103,13 +115,17 @@ } } +void LoadingPredictor::SetObserverForTesting(TestLoadingObserver* observer) { + observer_ = observer; +} + std::map<GURL, base::TimeTicks>::iterator LoadingPredictor::CancelActiveHint( std::map<GURL, base::TimeTicks>::iterator hint_it) { if (hint_it == active_hints_.end()) return hint_it; const GURL& url = hint_it->first; - resource_prefetch_predictor_->StopPrefetching(url); + MaybeRemovePrefetch(url); UMA_HISTOGRAM_TIMES( internal::kResourcePrefetchPredictorPrefetchingDurationHistogram, @@ -149,4 +165,88 @@ } } +void LoadingPredictor::MaybeAddPrefetch( + const GURL& url, + const ResourcePrefetchPredictor::Prediction& prediction, + HintOrigin origin) { + if (!config_.IsPrefetchingEnabledForOrigin(profile_, origin)) + return; + std::string host = url.host(); + if (prefetches_.find(host) != prefetches_.end()) + return; + + auto prefetcher = base::MakeUnique<ResourcePrefetcher>( + GetWeakPtr(), profile_->GetRequestContext(), + config_.max_prefetches_inflight_per_navigation, + config_.max_prefetches_inflight_per_host_per_navigation, url, + prediction.subresource_urls); + // base::Unretained(prefetcher.get()) is fine, as |prefetcher| is always + // destructed on the IO thread, and the destruction task is posted from the + // UI thread, after the current task. Since the IO thread is FIFO, then + // ResourcePrefetcher::Start() will be called before ~ResourcePrefetcher. + content::BrowserThread::PostTask( + content::BrowserThread::IO, FROM_HERE, + base::BindOnce(&ResourcePrefetcher::Start, + base::Unretained(prefetcher.get()))); + prefetches_.emplace(host, std::make_pair(std::move(prefetcher), false)); + if (observer_) + observer_->OnPrefetchingStarted(url); +} + +void LoadingPredictor::MaybeRemovePrefetch(const GURL& url) { + std::string host = url.host(); + auto it = prefetches_.find(host); + if (it == prefetches_.end()) + return; + + auto& prefetcher_and_deleted = it->second; + if (prefetcher_and_deleted.second) + return; + + // Avoid to stop the same prefetcher twice, which can happen for instance with + // multiple prediction origins for the same |url|. Prefetches are + // de-duplicated, not their cancellation. + prefetcher_and_deleted.second = true; + content::BrowserThread::PostTask( + content::BrowserThread::IO, FROM_HERE, + base::BindOnce(&ResourcePrefetcher::Stop, + base::Unretained(prefetcher_and_deleted.first.get()))); + if (observer_) + observer_->OnPrefetchingStopped(url); +} + +void LoadingPredictor::ResourcePrefetcherFinished( + ResourcePrefetcher* prefetcher, + std::unique_ptr<ResourcePrefetcher::PrefetcherStats> stats) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + std::string host = prefetcher->main_frame_url().host(); + auto it = prefetches_.find(host); + // Can happen after Shutdown() has been called, since it purges |prefetches_|. + if (it == prefetches_.end()) + return; + + DCHECK(it->second.first.get() == prefetcher); + stats_collector_->RecordPrefetcherStats(std::move(stats)); + + if (observer_) + observer_->OnPrefetchingFinished(prefetcher->main_frame_url()); + + // ResourcePrefetcher must be destroyed on the IO thread. + content::BrowserThread::PostTask( + content::BrowserThread::IO, FROM_HERE, + base::BindOnce([](std::unique_ptr<ResourcePrefetcher>) {}, + std::move(it->second.first))); + + prefetches_.erase(it); +} + +TestLoadingObserver::~TestLoadingObserver() { + predictor_->SetObserverForTesting(nullptr); +} + +TestLoadingObserver::TestLoadingObserver(LoadingPredictor* predictor) + : predictor_(predictor) { + predictor_->SetObserverForTesting(this); +} + } // namespace predictors
diff --git a/chrome/browser/predictors/loading_predictor.h b/chrome/browser/predictors/loading_predictor.h index 89f48bb..2aa3f67 100644 --- a/chrome/browser/predictors/loading_predictor.h +++ b/chrome/browser/predictors/loading_predictor.h
@@ -7,6 +7,7 @@ #include <map> #include <memory> +#include <string> #include <utility> #include "base/gtest_prod_util.h" @@ -15,6 +16,8 @@ #include "chrome/browser/predictors/loading_data_collector.h" #include "chrome/browser/predictors/resource_prefetch_common.h" #include "chrome/browser/predictors/resource_prefetch_predictor.h" +#include "chrome/browser/predictors/resource_prefetcher.h" +#include "chrome/browser/profiles/profile.h" #include "components/keyed_service/core/keyed_service.h" #include "url/gurl.h" @@ -24,6 +27,7 @@ class ResourcePrefetchPredictor; class LoadingStatsCollector; +class TestLoadingObserver; // Entry point for the Loading predictor. // From a high-level request (GURL and motivation) and a database of historical @@ -36,7 +40,8 @@ // predictor. // // All methods must be called from the UI thread. -class LoadingPredictor : public KeyedService { +class LoadingPredictor : public KeyedService, + public ResourcePrefetcher::Delegate { public: LoadingPredictor(const LoadingPredictorConfig& config, Profile* profile); ~LoadingPredictor() override; @@ -69,6 +74,16 @@ return weak_factory_.GetWeakPtr(); } + // ResourcePrefetcher::Delegate: + void ResourcePrefetcherFinished( + ResourcePrefetcher* prefetcher, + std::unique_ptr<ResourcePrefetcher::PrefetcherStats> stats) override; + + // Sets the |observer| to be notified when prefetches start and + // finish. A previously registered observer will be discarded. Call this with + // a nullptr parameter to de-register the observer. + void SetObserverForTesting(TestLoadingObserver* observer); + private: // Cancels an active hint, from its iterator inside |active_hints_|. If the // iterator is .end(), does nothing. Returns the iterator after deletion of @@ -77,6 +92,16 @@ std::map<GURL, base::TimeTicks>::iterator hint_it); void CleanupAbandonedHintsAndNavigations(const NavigationID& navigation_id); + // May start a prefetch for |url| with the data from |prediction|, and a + // given hint |origin|. A new prefetch may not start if there is already + // one in flight, for instance. + void MaybeAddPrefetch(const GURL& url, + const ResourcePrefetchPredictor::Prediction& prediction, + HintOrigin origin); + + // If a prefetch exists for |url|, stop it. + void MaybeRemovePrefetch(const GURL& url); + // For testing. void set_mock_resource_prefetch_predictor( std::unique_ptr<ResourcePrefetchPredictor> predictor) { @@ -91,6 +116,10 @@ std::map<GURL, base::TimeTicks> active_hints_; // Initial URL. std::map<NavigationID, GURL> active_navigations_; + // The value is {prefetcher, already deleted}. + std::map<std::string, std::pair<std::unique_ptr<ResourcePrefetcher>, bool>> + prefetches_; + TestLoadingObserver* observer_; friend class LoadingPredictorTest; FRIEND_TEST_ALL_PREFIXES(LoadingPredictorTest, @@ -109,6 +138,30 @@ DISALLOW_COPY_AND_ASSIGN(LoadingPredictor); }; +// An interface used to notify that data in the LoadingPredictor has +// changed. All methods are called on the UI thread. +class TestLoadingObserver { + public: + // De-registers itself from |predictor_| on destruction. + virtual ~TestLoadingObserver(); + + virtual void OnPrefetchingStarted(const GURL& main_frame_url) {} + + virtual void OnPrefetchingStopped(const GURL& main_frame_url) {} + + virtual void OnPrefetchingFinished(const GURL& main_frame_url) {} + + protected: + // |predictor| must be non-NULL and has to outlive the LoadingTestObserver. + // Also the predictor must not have a LoadingTestObserver set. + explicit TestLoadingObserver(LoadingPredictor* predictor); + + private: + LoadingPredictor* predictor_; + + DISALLOW_COPY_AND_ASSIGN(TestLoadingObserver); +}; + } // namespace predictors #endif // CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_H_
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.cc b/chrome/browser/predictors/resource_prefetch_predictor.cc index 7c90514..4ac25ba9 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor.cc +++ b/chrome/browser/predictors/resource_prefetch_predictor.cc
@@ -18,7 +18,6 @@ #include "chrome/browser/predictors/loading_stats_collector.h" #include "chrome/browser/predictors/predictor_database.h" #include "chrome/browser/predictors/predictor_database_factory.h" -#include "chrome/browser/predictors/resource_prefetcher_manager.h" #include "chrome/browser/profiles/profile.h" #include "components/history/core/browser/history_database.h" #include "components/history/core/browser/history_service.h" @@ -499,16 +498,6 @@ nav_it->second->first_contentful_paint = first_contentful_paint; } -void ResourcePrefetchPredictor::OnPrefetchingFinished( - const GURL& main_frame_url, - std::unique_ptr<ResourcePrefetcher::PrefetcherStats> stats) { - if (observer_) - observer_->OnPrefetchingFinished(main_frame_url); - - if (stats_collector_) - stats_collector_->RecordPrefetcherStats(std::move(stats)); -} - bool ResourcePrefetchPredictor::IsUrlPrefetchable( const GURL& main_frame_url) const { return GetPrefetchData(main_frame_url, nullptr); @@ -533,10 +522,6 @@ } void ResourcePrefetchPredictor::Shutdown() { - if (prefetch_manager_.get()) { - prefetch_manager_->ShutdownOnUIThread(); - prefetch_manager_ = nullptr; - } history_service_observer_.RemoveAll(); } @@ -863,13 +848,7 @@ DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_EQ(INITIALIZING, initialization_state_); - // Initialize the prefetch manager only if prefetching is enabled. - if (config_.IsPrefetchingEnabledForSomeOrigin(profile_)) { - prefetch_manager_ = new ResourcePrefetcherManager( - this, config_, profile_->GetRequestContext()); - } initialization_state_ = INITIALIZED; - if (observer_) observer_->OnPredictorInitialized(); } @@ -1386,38 +1365,6 @@ } } -void ResourcePrefetchPredictor::StartPrefetching( - const GURL& url, - const ResourcePrefetchPredictor::Prediction& prediction) { - TRACE_EVENT1("browser", "ResourcePrefetchPredictor::StartPrefetching", "url", - url.spec()); - if (!prefetch_manager_.get()) // Not enabled. - return; - - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - base::BindOnce(&ResourcePrefetcherManager::MaybeAddPrefetch, - prefetch_manager_, url, prediction.subresource_urls)); - - if (observer_) - observer_->OnPrefetchingStarted(url); -} - -void ResourcePrefetchPredictor::StopPrefetching(const GURL& url) { - TRACE_EVENT1("browser", "ResourcePrefetchPredictor::StopPrefetching", "url", - url.spec()); - if (!prefetch_manager_.get()) // Not enabled. - return; - - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - base::BindOnce(&ResourcePrefetcherManager::MaybeRemovePrefetch, - prefetch_manager_, url)); - - if (observer_) - observer_->OnPrefetchingStopped(url); -} - //////////////////////////////////////////////////////////////////////////////// // TestObserver.
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.h b/chrome/browser/predictors/resource_prefetch_predictor.h index 7db2504..d1e6806 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor.h +++ b/chrome/browser/predictors/resource_prefetch_predictor.h
@@ -24,7 +24,6 @@ #include "chrome/browser/predictors/resource_prefetch_common.h" #include "chrome/browser/predictors/resource_prefetch_predictor_tables.h" #include "chrome/browser/predictors/resource_prefetcher.h" -#include "chrome/browser/predictors/resource_prefetcher_manager.h" #include "components/history/core/browser/history_db_task.h" #include "components/history/core/browser/history_service_observer.h" #include "components/history/core/browser/history_types.h" @@ -100,16 +99,6 @@ // it to disk in the DB thread through the ResourcePrefetchPredictorTables. It // initiates resource prefetching using the ResourcePrefetcherManager. Owned // by profile. -// * ResourcePrefetcherManager - Manages the ResourcePrefetchers that do the -// prefetching on the IO thread. The manager is owned by the -// ResourcePrefetchPredictor and interfaces between the predictor on the UI -// thread and the prefetchers on the IO thread. -// * ResourcePrefetcher - Lives entirely on the IO thread, owned by the -// ResourcePrefetcherManager, and issues net::URLRequest to fetch resources. -// -// TODO(zhenw): Currently only main frame requests/redirects/responses are -// recorded. Consider recording sub-frame responses independently or together -// with main frame. class ResourcePrefetchPredictor : public history::HistoryServiceObserver, public precache::PrecacheManager::Delegate { @@ -233,12 +222,6 @@ const std::string& mime_type, content::ResourceType fallback); - // Called when ResourcePrefetcher is finished, i.e. there is nothing pending - // in flight. - void OnPrefetchingFinished( - const GURL& main_frame_url, - std::unique_ptr<ResourcePrefetcher::PrefetcherStats> stats); - // Returns true if prefetching data exists for the |main_frame_url|. virtual bool IsUrlPrefetchable(const GURL& main_frame_url) const; @@ -286,15 +269,6 @@ const NavigationID& navigation_id, const base::TimeTicks& first_contentful_paint); - // Starts prefetching for |main_frame_url| from a |prediction|. - void StartPrefetching(const GURL& main_frame_url, - const Prediction& prediction); - - // Stops prefetching that may be in progress corresponding to - // |main_frame_url|. - void StopPrefetching(const GURL& main_frame_url); - - friend class LoadingPredictor; friend class ::PredictorsHandler; friend class LoadingDataCollector; friend class ResourcePrefetchPredictorTest; @@ -452,19 +426,12 @@ tables_ = tables; } - // For testing. - void set_mock_resource_prefetcher_manager( - scoped_refptr<ResourcePrefetcherManager> prefetch_manager) { - prefetch_manager_ = prefetch_manager; - } - Profile* const profile_; TestObserver* observer_; LoadingStatsCollector* stats_collector_; const LoadingPredictorConfig config_; InitializationState initialization_state_; scoped_refptr<ResourcePrefetchPredictorTables> tables_; - scoped_refptr<ResourcePrefetcherManager> prefetch_manager_; base::CancelableTaskTracker history_lookup_consumer_; std::unique_ptr<PrefetchDataMap> url_resource_data_; @@ -497,12 +464,6 @@ size_t url_visit_count, const ResourcePrefetchPredictor::PageRequestSummary& summary) {} - virtual void OnPrefetchingStarted(const GURL& main_frame_url) {} - - virtual void OnPrefetchingStopped(const GURL& main_frame_url) {} - - virtual void OnPrefetchingFinished(const GURL& main_frame_url) {} - protected: // |predictor| must be non-NULL and has to outlive the TestObserver. // Also the predictor must not have a TestObserver set.
diff --git a/chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc b/chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc index f56fae5..2e0e381 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc +++ b/chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc
@@ -288,22 +288,14 @@ // Helper class to track and allow waiting for a single OnPrefetchingFinished // event. Checks also that {Start,Stop}Prefetching are called with the right // argument. -class PrefetchingObserver : public TestObserver { +class PrefetchingObserver : public TestLoadingObserver { public: - PrefetchingObserver(ResourcePrefetchPredictor* predictor, - const GURL& expected_main_frame_url, - bool is_learning_allowed) - : TestObserver(predictor), - main_frame_url_(expected_main_frame_url), - is_learning_allowed_(is_learning_allowed) {} + PrefetchingObserver(LoadingPredictor* predictor, + const GURL& expected_main_frame_url) + : TestLoadingObserver(predictor), + main_frame_url_(expected_main_frame_url) {} - // TestObserver: - void OnNavigationLearned(size_t url_visit_count, - const PageRequestSummary& summary) override { - if (!is_learning_allowed_) - ADD_FAILURE() << "Prefetching shouldn't activate learning"; - } - + // LoadingTestObserver: void OnPrefetchingStarted(const GURL& main_frame_url) override { EXPECT_EQ(main_frame_url_, main_frame_url); } @@ -317,12 +309,14 @@ run_loop_.Quit(); } + // TODO(alexilin): Consider checking that prefetching does not activate + // learning here. + void Wait() { run_loop_.Run(); } private: base::RunLoop run_loop_; GURL main_frame_url_; - bool is_learning_allowed_; DISALLOW_COPY_AND_ASSIGN(PrefetchingObserver); }; @@ -446,8 +440,7 @@ } void NavigateToURLAndCheckPrefetching(const GURL& main_frame_url) { - PrefetchingObserver observer(resource_prefetch_predictor_, main_frame_url, - true); + PrefetchingObserver observer(predictor_, main_frame_url); ui_test_utils::NavigateToURL(browser(), main_frame_url); observer.Wait(); for (auto& kv : resources_) { @@ -457,8 +450,7 @@ } void PrefetchURL(const GURL& main_frame_url) { - PrefetchingObserver observer(resource_prefetch_predictor_, main_frame_url, - false); + PrefetchingObserver observer(predictor_, main_frame_url); predictor_->PrepareForPageLoad(main_frame_url, HintOrigin::EXTERNAL); observer.Wait(); for (auto& kv : resources_) {
diff --git a/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc b/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc index c4553461..7038919 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc +++ b/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc
@@ -17,7 +17,6 @@ #include "chrome/browser/predictors/loading_predictor.h" #include "chrome/browser/predictors/loading_test_util.h" #include "chrome/browser/predictors/resource_prefetch_predictor_tables.h" -#include "chrome/browser/predictors/resource_prefetcher_manager.h" #include "chrome/test/base/testing_profile.h" #include "components/history/core/browser/history_service.h" #include "components/history/core/browser/history_types.h"
diff --git a/chrome/browser/predictors/resource_prefetcher.cc b/chrome/browser/predictors/resource_prefetcher.cc index 6926c657..b5374be 100644 --- a/chrome/browser/predictors/resource_prefetcher.cc +++ b/chrome/browser/predictors/resource_prefetcher.cc
@@ -49,29 +49,33 @@ start_time(other.start_time), requests_stats(other.requests_stats) {} -ResourcePrefetcher::ResourcePrefetcher(Delegate* delegate, - size_t max_concurrent_requests, - size_t max_concurrent_requests_per_host, - const GURL& main_frame_url, - const std::vector<GURL>& urls) +ResourcePrefetcher::ResourcePrefetcher( + base::WeakPtr<Delegate> delegate, + scoped_refptr<net::URLRequestContextGetter> context_getter, + size_t max_concurrent_requests, + size_t max_concurrent_requests_per_host, + const GURL& main_frame_url, + const std::vector<GURL>& urls) : state_(INITIALIZED), delegate_(delegate), + context_getter_(context_getter), max_concurrent_requests_(max_concurrent_requests), max_concurrent_requests_per_host_(max_concurrent_requests_per_host), main_frame_url_(main_frame_url), prefetched_count_(0), prefetched_bytes_(0), + request_queue_(urls.begin(), urls.end()), stats_(base::MakeUnique<PrefetcherStats>(main_frame_url)) { - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - - std::copy(urls.begin(), urls.end(), std::back_inserter(request_queue_)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); } -ResourcePrefetcher::~ResourcePrefetcher() {} +ResourcePrefetcher::~ResourcePrefetcher() { + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); +} void ResourcePrefetcher::Start() { TRACE_EVENT_ASYNC_BEGIN0("browser", "ResourcePrefetcher::Prefetch", this); - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); CHECK_EQ(state_, INITIALIZED); state_ = RUNNING; @@ -82,7 +86,7 @@ void ResourcePrefetcher::Stop() { TRACE_EVENT_ASYNC_END0("browser", "ResourcePrefetcher::Prefetch", this); - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); if (state_ == FINISHED) return; @@ -135,7 +139,11 @@ prefetched_bytes_ / 1024); state_ = FINISHED; - delegate_->ResourcePrefetcherFinished(this, std::move(stats_)); + + content::BrowserThread::PostTask( + content::BrowserThread::UI, FROM_HERE, + base::BindOnce(&Delegate::ResourcePrefetcherFinished, delegate_, this, + base::Passed(std::move(stats_)))); } } @@ -181,8 +189,8 @@ } })"); std::unique_ptr<net::URLRequest> url_request = - delegate_->GetURLRequestContext()->CreateRequest(url, net::IDLE, this, - traffic_annotation); + context_getter_->GetURLRequestContext()->CreateRequest( + url, net::IDLE, this, traffic_annotation); host_inflight_counts_[url.host()] += 1; url_request->set_method("GET"); @@ -286,7 +294,6 @@ return; } - // TODO(shishir): Do not read cached entries, or ones that are not cacheable. ReadFullResponse(request); }
diff --git a/chrome/browser/predictors/resource_prefetcher.h b/chrome/browser/predictors/resource_prefetcher.h index ce64e76..4b85e79 100644 --- a/chrome/browser/predictors/resource_prefetcher.h +++ b/chrome/browser/predictors/resource_prefetcher.h
@@ -15,16 +15,14 @@ #include <vector> #include "base/macros.h" +#include "base/memory/ptr_util.h" #include "base/threading/thread_checker.h" #include "base/time/time.h" #include "net/url_request/redirect_info.h" #include "net/url_request/url_request.h" +#include "net/url_request/url_request_context_getter.h" #include "url/gurl.h" -namespace net { -class URLRequestContext; -} - namespace predictors { namespace internal { @@ -41,7 +39,8 @@ // - Limits the max number of resources in flight for any host and also across // hosts. // - When stopped, will wait for the pending requests to finish. -// - Lives entirely on the IO thread. +// - Created on the UI thread, member functions called and instances destroyed +// on the IO thread. class ResourcePrefetcher : public net::URLRequest::Delegate { public: struct PrefetchedRequestStats { @@ -65,23 +64,20 @@ std::vector<PrefetchedRequestStats> requests_stats; }; - // Used to communicate when the prefetching is done. All methods are invoked - // on the IO thread. + // Used to communicate when the prefetching is done. Lives on the UI thread. class Delegate { public: - virtual ~Delegate() { } + virtual ~Delegate() {} // Called when the ResourcePrefetcher is finished, i.e. there is nothing // pending in flight. virtual void ResourcePrefetcherFinished( ResourcePrefetcher* prefetcher, std::unique_ptr<PrefetcherStats> stats) = 0; - - virtual net::URLRequestContext* GetURLRequestContext() = 0; }; - // |delegate| has to outlive the ResourcePrefetcher. - ResourcePrefetcher(Delegate* delegate, + ResourcePrefetcher(base::WeakPtr<Delegate> delegate, + scoped_refptr<net::URLRequestContextGetter> context_getter, size_t max_concurrent_requests, size_t max_concurrent_requests_per_host, const GURL& main_frame_url, @@ -139,9 +135,9 @@ FINISHED = 3 // No more inflight request, new requests not possible. }; - base::ThreadChecker thread_checker_; PrefetcherState state_; - Delegate* const delegate_; + base::WeakPtr<Delegate> delegate_; + scoped_refptr<net::URLRequestContextGetter> context_getter_; size_t max_concurrent_requests_; size_t max_concurrent_requests_per_host_; GURL main_frame_url_;
diff --git a/chrome/browser/predictors/resource_prefetcher_manager.cc b/chrome/browser/predictors/resource_prefetcher_manager.cc deleted file mode 100644 index aad28a3..0000000 --- a/chrome/browser/predictors/resource_prefetcher_manager.cc +++ /dev/null
@@ -1,105 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/predictors/resource_prefetcher_manager.h" - -#include <utility> - -#include "base/bind.h" -#include "base/memory/ptr_util.h" -#include "base/stl_util.h" -#include "chrome/browser/predictors/resource_prefetch_predictor.h" -#include "content/public/browser/browser_thread.h" -#include "net/url_request/url_request.h" -#include "net/url_request/url_request_context_getter.h" - -using content::BrowserThread; - -namespace predictors { - -ResourcePrefetcherManager::ResourcePrefetcherManager( - ResourcePrefetchPredictor* predictor, - const LoadingPredictorConfig& config, - net::URLRequestContextGetter* context_getter) - : predictor_(predictor), config_(config), context_getter_(context_getter) { - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - CHECK(predictor_); - CHECK(context_getter_); -} - -ResourcePrefetcherManager::~ResourcePrefetcherManager() { - DCHECK(prefetcher_map_.empty()) - << "Did not call ShutdownOnUIThread or ShutdownOnIOThread. " - " Will leak Prefetcher pointers."; -} - -void ResourcePrefetcherManager::ShutdownOnUIThread() { - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - - predictor_ = NULL; - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - base::BindOnce(&ResourcePrefetcherManager::ShutdownOnIOThread, this)); -} - -void ResourcePrefetcherManager::ShutdownOnIOThread() { - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - prefetcher_map_.clear(); -} - -void ResourcePrefetcherManager::MaybeAddPrefetch( - const GURL& main_frame_url, - const std::vector<GURL>& urls) { - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - - // Don't add a duplicate prefetch for the same host. - std::string key = main_frame_url.host(); - if (base::ContainsKey(prefetcher_map_, key)) - return; - - auto prefetcher = base::MakeUnique<ResourcePrefetcher>( - this, config_.max_prefetches_inflight_per_navigation, - config_.max_prefetches_inflight_per_host_per_navigation, main_frame_url, - urls); - prefetcher->Start(); - prefetcher_map_[key] = std::move(prefetcher); -} - -void ResourcePrefetcherManager::MaybeRemovePrefetch( - const GURL& main_frame_url) { - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - - std::string key = main_frame_url.host(); - auto it = prefetcher_map_.find(key); - if (it != prefetcher_map_.end() && - it->second->main_frame_url() == main_frame_url) { - it->second->Stop(); - } -} - -void ResourcePrefetcherManager::ResourcePrefetcherFinished( - ResourcePrefetcher* resource_prefetcher, - std::unique_ptr<ResourcePrefetcher::PrefetcherStats> stats) { - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - - const GURL& main_frame_url = resource_prefetcher->main_frame_url(); - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - base::BindOnce(&ResourcePrefetchPredictor::OnPrefetchingFinished, - base::Unretained(predictor_), main_frame_url, - base::Passed(std::move(stats)))); - - const std::string key = main_frame_url.host(); - auto it = prefetcher_map_.find(key); - DCHECK(it != prefetcher_map_.end()); - prefetcher_map_.erase(it); -} - -net::URLRequestContext* ResourcePrefetcherManager::GetURLRequestContext() { - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - - return context_getter_->GetURLRequestContext(); -} - -} // namespace predictors
diff --git a/chrome/browser/predictors/resource_prefetcher_manager.h b/chrome/browser/predictors/resource_prefetcher_manager.h deleted file mode 100644 index 52fb50273..0000000 --- a/chrome/browser/predictors/resource_prefetcher_manager.h +++ /dev/null
@@ -1,79 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCHER_MANAGER_H_ -#define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCHER_MANAGER_H_ - -#include <map> -#include <memory> -#include <string> -#include <vector> - -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "chrome/browser/predictors/loading_predictor_config.h" -#include "chrome/browser/predictors/resource_prefetcher.h" - -namespace net { -class URLRequestContextGetter; -} - -namespace predictors { - -class ResourcePrefetchPredictor; - -// Manages prefetches for multiple navigations. -// - Created and owned by the resource prefetch predictor. -// - Needs to be refcounted as it is de-referenced on two different threads. -// - Created on the UI thread, but most functions are called in the IO thread. -// - Will only allow one inflight prefresh per host. -class ResourcePrefetcherManager - : public ResourcePrefetcher::Delegate, - public base::RefCountedThreadSafe<ResourcePrefetcherManager> { - public: - // The |predictor| should be alive till ShutdownOnIOThread is called. - ResourcePrefetcherManager(ResourcePrefetchPredictor* predictor, - const LoadingPredictorConfig& config, - net::URLRequestContextGetter* getter); - - // UI thread. - void ShutdownOnUIThread(); - - // --- IO Thread methods. - - // The prefetchers need to be deleted on the IO thread. - void ShutdownOnIOThread(); - - // Will create a new ResourcePrefetcher for a given main frame url if there - // isn't one already for the same host. - void MaybeAddPrefetch(const GURL& main_frame_url, - const std::vector<GURL>& urls); - - // Stops the ResourcePrefetcher for a given main frame URL, if one was in - // progress. - void MaybeRemovePrefetch(const GURL& main_frame_url); - - // ResourcePrefetcher::Delegate methods. - void ResourcePrefetcherFinished( - ResourcePrefetcher* prefetcher, - std::unique_ptr<ResourcePrefetcher::PrefetcherStats> stats) override; - net::URLRequestContext* GetURLRequestContext() override; - - private: - friend class base::RefCountedThreadSafe<ResourcePrefetcherManager>; - friend class MockResourcePrefetcherManager; - ~ResourcePrefetcherManager() override; - - ResourcePrefetchPredictor* predictor_; - const LoadingPredictorConfig config_; - net::URLRequestContextGetter* const context_getter_; - - std::map<std::string, std::unique_ptr<ResourcePrefetcher>> prefetcher_map_; - - DISALLOW_COPY_AND_ASSIGN(ResourcePrefetcherManager); -}; - -} // namespace predictors - -#endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCHER_MANAGER_H_
diff --git a/chrome/browser/predictors/resource_prefetcher_unittest.cc b/chrome/browser/predictors/resource_prefetcher_unittest.cc index 1347fe6..9694aca 100644 --- a/chrome/browser/predictors/resource_prefetcher_unittest.cc +++ b/chrome/browser/predictors/resource_prefetcher_unittest.cc
@@ -15,9 +15,9 @@ #include "base/message_loop/message_loop.h" #include "base/test/histogram_tester.h" #include "chrome/browser/predictors/loading_test_util.h" -#include "chrome/browser/predictors/resource_prefetcher_manager.h" #include "chrome/test/base/testing_profile.h" #include "content/public/test/test_browser_thread.h" +#include "content/public/test/test_browser_thread_bundle.h" #include "net/base/load_flags.h" #include "net/url_request/redirect_info.h" #include "net/url_request/url_request.h" @@ -33,16 +33,45 @@ constexpr size_t kMaxConcurrentRequests = 5; constexpr size_t kMaxConcurrentRequestsPerHost = 2; +// Delegate for ResourcePrefetcher. +class TestResourcePrefetcherDelegate + : public ResourcePrefetcher::Delegate, + public base::SupportsWeakPtr<TestResourcePrefetcherDelegate> { + public: + TestResourcePrefetcherDelegate() = default; + ~TestResourcePrefetcherDelegate() override = default; + + void ResourcePrefetcherFinished( + ResourcePrefetcher* prefetcher, + std::unique_ptr<ResourcePrefetcher::PrefetcherStats> stats) override { + prefetcher_ = prefetcher; + } + + bool ResourcePrefetcherFinishedCalled(ResourcePrefetcher* for_prefetcher) { + ResourcePrefetcher* prefetcher = prefetcher_; + prefetcher_ = nullptr; + return prefetcher == for_prefetcher; + } + + private: + ResourcePrefetcher* prefetcher_; + + DISALLOW_COPY_AND_ASSIGN(TestResourcePrefetcherDelegate); +}; + // Wrapper over the ResourcePrefetcher that stubs out the StartURLRequest call // since we do not want to do network fetches in this unittest. class TestResourcePrefetcher : public ResourcePrefetcher { public: - TestResourcePrefetcher(ResourcePrefetcher::Delegate* delegate, - size_t max_concurrent_requests, - size_t max_concurrent_requests_per_host, - const GURL& main_frame_url, - const std::vector<GURL>& urls) - : ResourcePrefetcher(delegate, + TestResourcePrefetcher( + TestResourcePrefetcherDelegate* delegate, + scoped_refptr<net::URLRequestContextGetter> context_getter, + size_t max_concurrent_requests, + size_t max_concurrent_requests_per_host, + const GURL& main_frame_url, + const std::vector<GURL>& urls) + : ResourcePrefetcher(delegate->AsWeakPtr(), + context_getter, max_concurrent_requests, max_concurrent_requests_per_host, main_frame_url, @@ -62,39 +91,6 @@ DISALLOW_COPY_AND_ASSIGN(TestResourcePrefetcher); }; - -// Delegate for ResourcePrefetcher. -class TestResourcePrefetcherDelegate : public ResourcePrefetcher::Delegate { - public: - explicit TestResourcePrefetcherDelegate(base::MessageLoop* loop) - : request_context_getter_( - new net::TestURLRequestContextGetter(loop->task_runner())) {} - ~TestResourcePrefetcherDelegate() override {} - - net::URLRequestContext* GetURLRequestContext() override { - return request_context_getter_->GetURLRequestContext(); - } - - void ResourcePrefetcherFinished( - ResourcePrefetcher* prefetcher, - std::unique_ptr<ResourcePrefetcher::PrefetcherStats> stats) override { - prefetcher_ = prefetcher; - } - - bool ResourcePrefetcherFinishedCalled(ResourcePrefetcher* for_prefetcher) { - ResourcePrefetcher* prefetcher = prefetcher_; - prefetcher_ = nullptr; - return prefetcher == for_prefetcher; - } - - private: - scoped_refptr<net::TestURLRequestContextGetter> request_context_getter_; - ResourcePrefetcher* prefetcher_; - - DISALLOW_COPY_AND_ASSIGN(TestResourcePrefetcherDelegate); -}; - - // The following unittest tests most of the ResourcePrefetcher except for: // 1. Call to ReadFullResponse. There does not seem to be a good way to test the // function in a unittest, and probably requires a browser_test. @@ -150,19 +146,19 @@ prefetcher_->OnResponseStarted(GetInFlightRequest(url), net::OK); } - base::MessageLoop loop_; - content::TestBrowserThread io_thread_; + content::TestBrowserThreadBundle thread_bundle_; TestResourcePrefetcherDelegate prefetcher_delegate_; std::unique_ptr<TestResourcePrefetcher> prefetcher_; + scoped_refptr<net::URLRequestContextGetter> context_getter_; private: DISALLOW_COPY_AND_ASSIGN(ResourcePrefetcherTest); }; ResourcePrefetcherTest::ResourcePrefetcherTest() - : loop_(base::MessageLoop::TYPE_IO), - io_thread_(content::BrowserThread::IO, &loop_), - prefetcher_delegate_(&loop_) {} + : prefetcher_delegate_(), + context_getter_(new net::TestURLRequestContextGetter( + base::ThreadTaskRunnerHandle::Get())) {} ResourcePrefetcherTest::~ResourcePrefetcherTest() { } @@ -183,7 +179,7 @@ GURL("http://yahoo.com/resource5.png")}; prefetcher_ = base::MakeUnique<TestResourcePrefetcher>( - &prefetcher_delegate_, kMaxConcurrentRequests, + &prefetcher_delegate_, context_getter_, kMaxConcurrentRequests, kMaxConcurrentRequestsPerHost, main_frame_url, urls); // Starting the prefetcher maxes out the number of possible requests. @@ -239,6 +235,7 @@ OnResponse("http://yahoo.com/resource3.png"); CheckPrefetcherState(0, 0, 0); + base::RunLoop().RunUntilIdle(); // Expect the final call. EXPECT_TRUE( prefetcher_delegate_.ResourcePrefetcherFinishedCalled(prefetcher_.get())); @@ -254,7 +251,7 @@ GURL("http://m.google.com/resource1.jpg")}; prefetcher_ = base::MakeUnique<TestResourcePrefetcher>( - &prefetcher_delegate_, kMaxConcurrentRequests, + &prefetcher_delegate_, context_getter_, kMaxConcurrentRequests, kMaxConcurrentRequestsPerHost, main_frame_url, urls); // Starting the prefetcher maxes out the number of possible requests. @@ -284,6 +281,7 @@ OnResponse("http://m.google.com/resource1.jpg"); CheckPrefetcherState(0, 1, 0); + base::RunLoop().RunUntilIdle(); // Expect the final call. EXPECT_TRUE( prefetcher_delegate_.ResourcePrefetcherFinishedCalled(prefetcher_.get())); @@ -300,7 +298,7 @@ GURL("http://www.google.com/resource6.png")}; prefetcher_ = base::MakeUnique<TestResourcePrefetcher>( - &prefetcher_delegate_, kMaxConcurrentRequests, + &prefetcher_delegate_, context_getter_, kMaxConcurrentRequests, kMaxConcurrentRequestsPerHost, main_frame_url, urls); // Starting the prefetcher maxes out the number of possible requests. @@ -336,6 +334,7 @@ histogram_tester.ExpectTotalCount( internal::kResourcePrefetchPredictorPrefetchedSizeHistogram, 1); + base::RunLoop().RunUntilIdle(); // Expect the final call. EXPECT_TRUE( prefetcher_delegate_.ResourcePrefetcherFinishedCalled(prefetcher_.get())); @@ -349,7 +348,7 @@ std::vector<GURL> urls = {GURL(https_resource), GURL(http_resource)}; prefetcher_ = base::MakeUnique<TestResourcePrefetcher>( - &prefetcher_delegate_, kMaxConcurrentRequests, + &prefetcher_delegate_, context_getter_, kMaxConcurrentRequests, kMaxConcurrentRequestsPerHost, GURL(url), urls); AddStartUrlRequestExpectation(https_resource); @@ -367,6 +366,7 @@ OnResponse(https_resource); OnResponse(http_resource); + base::RunLoop().RunUntilIdle(); // Expect the final call. EXPECT_TRUE( prefetcher_delegate_.ResourcePrefetcherFinishedCalled(prefetcher_.get()));
diff --git a/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc b/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc index 7d6792b..5cb5d6c 100644 --- a/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc +++ b/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc
@@ -120,6 +120,11 @@ content::BrowserThread::IO, FROM_HERE, base::BindOnce(WaitForAppcacheOnIO, manifest_url, appcache_service, wait_loop.QuitClosure(), &found_manifest)); + // There seems to be some flakiness in the appcache getting back to us, so + // use a timeout task to try the appcache query again. + content::BrowserThread::PostDelayedTask( + content::BrowserThread::UI, FROM_HERE, wait_loop.QuitClosure(), + base::TimeDelta::FromMilliseconds(2000)); wait_loop.Run(); } while (!found_manifest); }
diff --git a/chrome/browser/printing/print_dialog_cloud_win.cc b/chrome/browser/printing/print_dialog_cloud_win.cc index d868b776..baecdb40 100644 --- a/chrome/browser/printing/print_dialog_cloud_win.cc +++ b/chrome/browser/printing/print_dialog_cloud_win.cc
@@ -17,6 +17,7 @@ #include "base/memory/ref_counted_memory.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "base/task_scheduler/post_task.h" #include "base/threading/thread_task_runner_handle.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" @@ -107,7 +108,6 @@ scoped_refptr<base::RefCountedMemory> ReadFile( const base::FilePath& path_to_file) { - DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); scoped_refptr<base::RefCountedMemory> data; int64_t file_size = 0; if (base::GetFileSize(path_to_file, &file_size) && file_size != 0) { @@ -130,11 +130,11 @@ const base::string16& print_ticket, const std::string& file_type) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - content::BrowserThread::PostTaskAndReplyWithResult( - content::BrowserThread::FILE, FROM_HERE, + base::PostTaskWithTraitsAndReplyWithResult( + FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_BLOCKING}, base::Bind(&ReadFile, path_to_file), - base::Bind(&CreatePrintDialog, browser_context, - print_job_title, print_ticket, file_type)); + base::Bind(&CreatePrintDialog, browser_context, print_job_title, + print_ticket, file_type)); } } // namespace
diff --git a/chrome/browser/printing/printer_manager_dialog_linux.cc b/chrome/browser/printing/printer_manager_dialog_linux.cc index 156dda9..43736f9 100644 --- a/chrome/browser/printing/printer_manager_dialog_linux.cc +++ b/chrome/browser/printing/printer_manager_dialog_linux.cc
@@ -9,15 +9,11 @@ #include "base/bind.h" #include "base/environment.h" #include "base/files/file_util.h" -#include "base/message_loop/message_loop.h" #include "base/nix/xdg_util.h" #include "base/process/kill.h" #include "base/process/launch.h" -#include "base/strings/string_split.h" -#include "content/public/browser/browser_thread.h" - -using base::Environment; -using content::BrowserThread; +#include "base/task_scheduler/post_task.h" +#include "base/threading/thread_restrictions.h" namespace { @@ -49,8 +45,8 @@ // Detect the command based on the deskop environment and open the printer // manager dialog. void DetectAndOpenPrinterConfigDialog() { - DCHECK_CURRENTLY_ON(BrowserThread::FILE); - std::unique_ptr<Environment> env(Environment::Create()); + base::ThreadRestrictions::AssertIOAllowed(); + std::unique_ptr<base::Environment> env(base::Environment::Create()); bool opened = false; switch (base::nix::GetDesktopEnvironment(env.get())) { @@ -73,13 +69,14 @@ LOG_IF(ERROR, !opened) << "Failed to open printer manager dialog "; } -} // anonymous namespace +} // namespace namespace printing { void PrinterManagerDialog::ShowPrinterManagerDialog() { - BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, - base::BindOnce(&DetectAndOpenPrinterConfigDialog)); + base::PostTaskWithTraits( + FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_BLOCKING}, + base::BindOnce(&DetectAndOpenPrinterConfigDialog)); } } // namespace printing
diff --git a/chrome/browser/printing/printer_manager_dialog_win.cc b/chrome/browser/printing/printer_manager_dialog_win.cc index 5e71976..983dea7 100644 --- a/chrome/browser/printing/printer_manager_dialog_win.cc +++ b/chrome/browser/printing/printer_manager_dialog_win.cc
@@ -10,31 +10,31 @@ #include "base/bind.h" #include "base/files/file_path.h" #include "base/path_service.h" +#include "base/task_scheduler/post_task.h" #include "base/threading/thread.h" -#include "chrome/browser/browser_process.h" -#include "content/public/browser/browser_thread.h" -using content::BrowserThread; - -namespace printing { +namespace { // A helper callback that opens the printer management dialog. void OpenPrintersDialogCallback() { base::FilePath sys_dir; PathService::Get(base::DIR_SYSTEM, &sys_dir); - base::FilePath rundll32 = sys_dir.AppendASCII("rundll32.exe"); - base::FilePath shell32dll = sys_dir.AppendASCII("shell32.dll"); + base::FilePath rundll32 = sys_dir.Append(L"rundll32.exe"); + base::FilePath shell32dll = sys_dir.Append(L"shell32.dll"); std::wstring args(shell32dll.value()); args.append(L",SHHelpShortcuts_RunDLL PrintersFolder"); - ShellExecute(NULL, L"open", rundll32.value().c_str(), args.c_str(), NULL, - SW_SHOWNORMAL); + ShellExecute(nullptr, L"open", rundll32.value().c_str(), args.c_str(), + nullptr, SW_SHOWNORMAL); } +} // namespace + +namespace printing { + void PrinterManagerDialog::ShowPrinterManagerDialog() { - BrowserThread::PostTask( - BrowserThread::FILE, - FROM_HERE, + base::PostTaskWithTraits( + FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_BLOCKING}, base::Bind(OpenPrintersDialogCallback)); }
diff --git a/chrome/browser/profile_resetter/profile_resetter.cc b/chrome/browser/profile_resetter/profile_resetter.cc index b22b7b0d..003793a 100644 --- a/chrome/browser/profile_resetter/profile_resetter.cc +++ b/chrome/browser/profile_resetter/profile_resetter.cc
@@ -11,9 +11,11 @@ #include "base/macros.h" #include "base/synchronization/cancellation_flag.h" +#include "base/task_scheduler/post_task.h" +#include "base/task_scheduler/task_traits.h" +#include "base/threading/thread_restrictions.h" #include "build/build_config.h" #include "chrome/browser/browsing_data/browsing_data_helper.h" - #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/extensions/extension_service.h" @@ -50,8 +52,8 @@ namespace { -void ResetShortcutsOnFileThread() { - DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); +void ResetShortcutsOnBlockingThread() { + base::ThreadRestrictions::AssertIOAllowed(); // Get full path of chrome. base::FilePath chrome_exe; if (!PathService::Get(base::FILE_EXE, &chrome_exe)) @@ -140,7 +142,7 @@ } bool ProfileResetter::IsActive() const { - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return pending_reset_flags_ != 0; } @@ -322,13 +324,11 @@ void ProfileResetter::ResetShortcuts() { #if defined(OS_WIN) - content::BrowserThread::PostTaskAndReply( - content::BrowserThread::FILE, - FROM_HERE, - base::Bind(&ResetShortcutsOnFileThread), - base::Bind(&ProfileResetter::MarkAsDone, - weak_ptr_factory_.GetWeakPtr(), - SHORTCUTS)); + base::CreateCOMSTATaskRunnerWithTraits( + {base::MayBlock(), base::TaskPriority::USER_VISIBLE}) + ->PostTaskAndReply(FROM_HERE, base::Bind(&ResetShortcutsOnBlockingThread), + base::Bind(&ProfileResetter::MarkAsDone, + weak_ptr_factory_.GetWeakPtr(), SHORTCUTS)); #else MarkAsDone(SHORTCUTS); #endif @@ -349,10 +349,10 @@ MarkAsDone(COOKIES_AND_SITE_DATA); } +#if defined(OS_WIN) std::vector<ShortcutCommand> GetChromeLaunchShortcuts( const scoped_refptr<SharedCancellationFlag>& cancel) { - DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); -#if defined(OS_WIN) + base::ThreadRestrictions::AssertIOAllowed(); // Get full path of chrome. base::FilePath chrome_exe; if (!PathService::Get(base::FILE_EXE, &chrome_exe)) @@ -373,7 +373,5 @@ &shortcuts); } return shortcuts; -#else - return std::vector<ShortcutCommand>(); -#endif } +#endif // defined(OS_WIN)
diff --git a/chrome/browser/profile_resetter/profile_resetter.h b/chrome/browser/profile_resetter/profile_resetter.h index c59273d..de5d5c5b 100644 --- a/chrome/browser/profile_resetter/profile_resetter.h +++ b/chrome/browser/profile_resetter/profile_resetter.h
@@ -117,10 +117,12 @@ typedef base::RefCountedData<base::CancellationFlag> SharedCancellationFlag; +#if defined(OS_WIN) // On Windows returns all the shortcuts which launch Chrome and corresponding // arguments. |cancel| can be passed to abort the operation earlier. -// Call on FILE thread. +// Call on COM task runner that may block. std::vector<ShortcutCommand> GetChromeLaunchShortcuts( const scoped_refptr<SharedCancellationFlag>& cancel); +#endif #endif // CHROME_BROWSER_PROFILE_RESETTER_PROFILE_RESETTER_H_
diff --git a/chrome/browser/profile_resetter/profile_resetter_unittest.cc b/chrome/browser/profile_resetter/profile_resetter_unittest.cc index 5d2f931..a3c6c7a 100644 --- a/chrome/browser/profile_resetter/profile_resetter_unittest.cc +++ b/chrome/browser/profile_resetter/profile_resetter_unittest.cc
@@ -864,8 +864,8 @@ ResettableSettingsSnapshot nonorganic_snap(profile()); nonorganic_snap.RequestShortcuts(base::Closure()); - // Let it enumerate shortcuts on the FILE thread. - base::RunLoop().RunUntilIdle(); + // Let it enumerate shortcuts on a blockable task runner. + content::RunAllBlockingPoolTasksUntilIdle(); int diff_fields = ResettableSettingsSnapshot::ALL_FIELDS; if (!ShortcutHandler::IsSupported()) diff_fields &= ~ResettableSettingsSnapshot::SHORTCUTS; @@ -892,8 +892,8 @@ ResettableSettingsSnapshot organic_snap(profile()); organic_snap.RequestShortcuts(base::Closure()); - // Let it enumerate shortcuts on the FILE thread. - base::RunLoop().RunUntilIdle(); + // Let it enumerate shortcuts on a blockable task runner. + content::RunAllBlockingPoolTasksUntilIdle(); EXPECT_EQ(diff_fields, nonorganic_snap.FindDifferentFields(organic_snap)); nonorganic_snap.Subtract(organic_snap); const GURL urls[] = {GURL("http://foo.de"), GURL("http://goo.gl")}; @@ -936,8 +936,8 @@ ResettableSettingsSnapshot nonorganic_snap(profile()); nonorganic_snap.RequestShortcuts(base::Closure()); - // Let it enumerate shortcuts on the FILE thread. - base::RunLoop().RunUntilIdle(); + // Let it enumerate shortcuts on a blockable task runner. + content::RunAllBlockingPoolTasksUntilIdle(); static_assert(ResettableSettingsSnapshot::ALL_FIELDS == 31, "this test needs to be expanded"); @@ -1015,8 +1015,9 @@ base::Unretained(&capture), profile(), base::ConstRef(snapshot))); - // Let it enumerate shortcuts on the FILE thread. - base::RunLoop().RunUntilIdle(); + // Let it enumerate shortcuts on a blockable task runner. + content::RunAllBlockingPoolTasksUntilIdle(); + EXPECT_TRUE(snapshot.shortcuts_determined()); ::testing::Mock::VerifyAndClearExpectations(&capture); // The homepage and the startup page are in punycode. They are unreadable. // Trying to find the extension name.
diff --git a/chrome/browser/profile_resetter/resettable_settings_snapshot.cc b/chrome/browser/profile_resetter/resettable_settings_snapshot.cc index 81e38701..6ed3730 100644 --- a/chrome/browser/profile_resetter/resettable_settings_snapshot.cc +++ b/chrome/browser/profile_resetter/resettable_settings_snapshot.cc
@@ -12,6 +12,9 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/synchronization/cancellation_flag.h" +#include "base/task_runner_util.h" +#include "base/task_scheduler/post_task.h" +#include "base/task_scheduler/task_traits.h" #include "base/values.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profile_resetter/profile_reset_report.pb.h" @@ -133,13 +136,23 @@ DCHECK(!cancellation_flag_.get() && !shortcuts_determined()); cancellation_flag_ = new SharedCancellationFlag; - content::BrowserThread::PostTaskAndReplyWithResult( - content::BrowserThread::FILE, - FROM_HERE, - base::Bind(&GetChromeLaunchShortcuts, cancellation_flag_), +#if defined(OS_WIN) + base::PostTaskAndReplyWithResult( + base::CreateCOMSTATaskRunnerWithTraits( + {base::MayBlock(), base::TaskPriority::USER_VISIBLE}) + .get(), + FROM_HERE, base::Bind(&GetChromeLaunchShortcuts, cancellation_flag_), base::Bind(&ResettableSettingsSnapshot::SetShortcutsAndReport, - weak_ptr_factory_.GetWeakPtr(), - callback)); + weak_ptr_factory_.GetWeakPtr(), callback)); +#else // defined(OS_WIN) + // Shortcuts are only supported on Windows. + std::vector<ShortcutCommand> no_shortcuts; + base::SequencedTaskRunnerHandle::Get()->PostTask( + FROM_HERE, + base::BindOnce(&ResettableSettingsSnapshot::SetShortcutsAndReport, + weak_ptr_factory_.GetWeakPtr(), callback, + std::move(no_shortcuts))); +#endif // defined(OS_WIN) } void ResettableSettingsSnapshot::SetShortcutsAndReport(
diff --git a/chrome/browser/profiles/profile_browsertest.cc b/chrome/browser/profiles/profile_browsertest.cc index 00b1849..76c5ddd 100644 --- a/chrome/browser/profiles/profile_browsertest.cc +++ b/chrome/browser/profiles/profile_browsertest.cc
@@ -607,8 +607,9 @@ base::RunLoop run_loop; content::BrowserThread::PostTaskAndReply( content::BrowserThread::IO, FROM_HERE, - base::BindOnce(&CompareURLRequestContexts, extension_context_getter, - main_context_getter), + base::BindOnce(&CompareURLRequestContexts, + base::RetainedRef(extension_context_getter), + base::RetainedRef(main_context_getter)), run_loop.QuitClosure()); run_loop.Run(); } @@ -646,8 +647,9 @@ base::RunLoop run_loop; content::BrowserThread::PostTaskAndReply( content::BrowserThread::IO, FROM_HERE, - base::BindOnce(&CompareURLRequestContexts, extension_context_getter, - main_context_getter), + base::BindOnce(&CompareURLRequestContexts, + base::RetainedRef(extension_context_getter), + base::RetainedRef(main_context_getter)), run_loop.QuitClosure()); run_loop.Run(); }
diff --git a/chrome/browser/push_messaging/push_messaging_browsertest.cc b/chrome/browser/push_messaging/push_messaging_browsertest.cc index 24c32b4..e1deb6d3 100644 --- a/chrome/browser/push_messaging/push_messaging_browsertest.cc +++ b/chrome/browser/push_messaging/push_messaging_browsertest.cc
@@ -1832,6 +1832,33 @@ } IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, + ServiceWorkerDatabaseDeletionUnsubscribes) { + std::string script_result; + + ASSERT_NO_FATAL_FAILURE(SubscribeSuccessfully()); + + LoadTestPage(); // Reload to become controlled. + ASSERT_TRUE(RunScript("isControlled()", &script_result)); + ASSERT_EQ("true - is controlled", script_result); + + // Pretend as if the Service Worker database went away, and wait for callback + // to complete. + base::RunLoop run_loop; + push_service()->SetServiceWorkerDatabaseWipedCallbackForTesting( + run_loop.QuitClosure()); + push_service()->DidDeleteServiceWorkerDatabase(); + run_loop.Run(); + + // This should have unregistered the push subscription. + histogram_tester_.ExpectUniqueSample( + "PushMessaging.UnregistrationReason", + content::PUSH_UNREGISTRATION_REASON_SERVICE_WORKER_DATABASE_WIPED, 1); + + // There should not be any subscriptions left. + EXPECT_EQ(PushMessagingAppIdentifier::GetCount(GetBrowser()->profile()), 0u); +} + +IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, InvalidGetSubscriptionUnsubscribes) { std::string script_result;
diff --git a/chrome/browser/push_messaging/push_messaging_service_impl.cc b/chrome/browser/push_messaging/push_messaging_service_impl.cc index 520be4f..b1fc84d 100644 --- a/chrome/browser/push_messaging/push_messaging_service_impl.cc +++ b/chrome/browser/push_messaging/push_messaging_service_impl.cc
@@ -172,7 +172,7 @@ void PushMessagingServiceImpl::IncreasePushSubscriptionCount(int add, bool is_pending) { - DCHECK(add > 0); + DCHECK_GT(add, 0); if (push_subscription_count_ + pending_push_subscription_count_ == 0) { GetGCMDriver()->AddAppHandler(kPushMessagingAppIdentifierPrefix, this); } @@ -192,13 +192,13 @@ void PushMessagingServiceImpl::DecreasePushSubscriptionCount(int subtract, bool was_pending) { - DCHECK(subtract > 0); + DCHECK_GT(subtract, 0); if (was_pending) { pending_push_subscription_count_ -= subtract; - DCHECK(pending_push_subscription_count_ >= 0); + DCHECK_GE(pending_push_subscription_count_, 0); } else { push_subscription_count_ -= subtract; - DCHECK(push_subscription_count_ >= 0); + DCHECK_GE(push_subscription_count_, 0); } if (push_subscription_count_ + pending_push_subscription_count_ == 0) { GetGCMDriver()->RemoveAppHandler(kPushMessagingAppIdentifierPrefix); @@ -873,6 +873,36 @@ service_worker_unregistered_callback_for_testing_ = callback; } +// DidDeleteServiceWorkerDatabase methods -------------------------------------- + +void PushMessagingServiceImpl::DidDeleteServiceWorkerDatabase() { + std::vector<PushMessagingAppIdentifier> app_identifiers = + PushMessagingAppIdentifier::GetAll(profile_); + + base::RepeatingClosure completed_closure = base::BarrierClosure( + app_identifiers.size(), + service_worker_database_wiped_callback_for_testing_.is_null() + ? base::Bind(&base::DoNothing) + : service_worker_database_wiped_callback_for_testing_); + + for (const PushMessagingAppIdentifier& app_identifier : app_identifiers) { + // Note this will not fully unsubscribe pre-InstanceID subscriptions on + // Android from GCM, as that requires a sender_id. We can't fetch those from + // the Service Worker database anymore as it's been deleted. + UnsubscribeInternal( + content::PUSH_UNREGISTRATION_REASON_SERVICE_WORKER_DATABASE_WIPED, + app_identifier.origin(), + app_identifier.service_worker_registration_id(), + app_identifier.app_id(), std::string() /* sender_id */, + base::Bind(&UnregisterCallbackToClosure, completed_closure)); + } +} + +void PushMessagingServiceImpl::SetServiceWorkerDatabaseWipedCallbackForTesting( + const base::Closure& callback) { + service_worker_database_wiped_callback_for_testing_ = callback; +} + // OnContentSettingChanged methods --------------------------------------------- void PushMessagingServiceImpl::OnContentSettingChanged(
diff --git a/chrome/browser/push_messaging/push_messaging_service_impl.h b/chrome/browser/push_messaging/push_messaging_service_impl.h index 7ffd501..27c59cfa 100644 --- a/chrome/browser/push_messaging/push_messaging_service_impl.h +++ b/chrome/browser/push_messaging/push_messaging_service_impl.h
@@ -105,6 +105,7 @@ void DidDeleteServiceWorkerRegistration( const GURL& origin, int64_t service_worker_registration_id) override; + void DidDeleteServiceWorkerDatabase() override; // content_settings::Observer implementation. void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern, @@ -131,6 +132,8 @@ const base::Closure& callback); void SetServiceWorkerUnregisteredCallbackForTesting( const base::Closure& callback); + void SetServiceWorkerDatabaseWipedCallbackForTesting( + const base::Closure& callback); private: friend class PushMessagingBrowserTest; @@ -271,6 +274,7 @@ base::Closure unsubscribe_callback_for_testing_; base::Closure content_setting_changed_callback_for_testing_; base::Closure service_worker_unregistered_callback_for_testing_; + base::Closure service_worker_database_wiped_callback_for_testing_; PushMessagingNotificationManager notification_manager_;
diff --git a/chrome/browser/resource_coordinator/DEPS b/chrome/browser/resource_coordinator/DEPS index 537cfa8..a3aaa05 100644 --- a/chrome/browser/resource_coordinator/DEPS +++ b/chrome/browser/resource_coordinator/DEPS
@@ -2,5 +2,6 @@ # TODO(mash): Remove. http://crbug.com/723881 "+ash/multi_profile_uma.h", "+ash/shell.h", + "+content/test/test_web_contents.h", "+services/resource_coordinator/public", ]
diff --git a/chrome/browser/resource_coordinator/tab_manager.cc b/chrome/browser/resource_coordinator/tab_manager.cc index cd87260..296ab6d8b 100644 --- a/chrome/browser/resource_coordinator/tab_manager.cc +++ b/chrome/browser/resource_coordinator/tab_manager.cc
@@ -95,6 +95,15 @@ return -1; } +void ReloadWebContentsIfDiscarded(WebContents* contents, + TabManager::WebContentsData* contents_data) { + if (contents_data->IsDiscarded()) { + contents->GetController().SetNeedsReload(); + contents->GetController().LoadIfNecessary(); + contents_data->SetDiscardState(false); + } +} + } // namespace //////////////////////////////////////////////////////////////////////////////// @@ -132,7 +141,7 @@ #if !defined(OS_CHROMEOS) minimum_protection_time_(base::TimeDelta::FromMinutes(10)), #endif - browser_tab_strip_tracker_(this, nullptr, nullptr), + browser_tab_strip_tracker_(this, nullptr, this), test_tick_clock_(nullptr), is_session_restore_loading_tabs_(false), weak_ptr_factory_(this) { @@ -253,9 +262,17 @@ return GetWebContentsData(contents)->IsDiscarded(); } -bool TabManager::CanDiscardTab(int64_t target_web_contents_id) const { +bool TabManager::CanDiscardTab(const TabStats& tab_stats) const { +#if defined(OS_CHROMEOS) + if (tab_stats.is_active && tab_stats.is_in_visible_window) + return false; +#else + if (tab_stats.is_active) + return false; +#endif // defined(OS_CHROMEOS) + TabStripModel* model; - int idx = FindTabStripModelById(target_web_contents_id, &model); + const int idx = FindTabStripModelById(tab_stats.tab_contents_id, &model); if (idx == -1) return false; @@ -364,8 +381,10 @@ TabStatsList stats_list; stats_list.reserve(32); // 99% of users have < 30 tabs open. - for (const BrowserInfo& browser_info : GetBrowserInfoList()) - AddTabStats(browser_info, &stats_list); + for (const BrowserInfo& browser_info : GetBrowserInfoList()) { + const bool window_is_active = stats_list.empty(); + AddTabStats(browser_info, window_is_active, &stats_list); + } return stats_list; } @@ -419,11 +438,7 @@ // static bool TabManager::CompareTabStats(const TabStats& first, const TabStats& second) { - // Being currently selected is most important to protect. - if (first.is_selected != second.is_selected) - return first.is_selected; - - // Non auto-discardable tabs are more important to protect. + // Portect non auto-discardable tabs. if (first.is_auto_discardable != second.is_auto_discardable) return !first.is_auto_discardable; @@ -595,6 +610,7 @@ } void TabManager::AddTabStats(const BrowserInfo& browser_info, + bool window_is_active, TabStatsList* stats_list) const { TabStripModel* tab_strip_model = browser_info.tab_strip_model; for (int i = 0; i < tab_strip_model->count(); i++) { @@ -605,8 +621,8 @@ stats.is_internal_page = IsInternalPage(contents->GetLastCommittedURL()); stats.is_media = IsMediaTab(contents); stats.is_pinned = tab_strip_model->IsTabPinned(i); - stats.is_selected = - browser_info.window_is_active && tab_strip_model->IsTabSelected(i); + stats.is_active = tab_strip_model->active_index() == i; + stats.is_in_active_window = window_is_active; // Only consider the window non-visible if it is minimized. The consumer // of the constructed TabStatsList may update this after performing more // advanced window visibility checks. @@ -695,10 +711,6 @@ } WebContents* TabManager::DiscardWebContentsAt(int index, TabStripModel* model) { - // Can't discard active index. - if (model->active_index() == index) - return nullptr; - WebContents* old_contents = model->GetWebContentsAt(index); // Can't discard tabs that are already discarded. @@ -717,8 +729,19 @@ WebContents::Create(WebContents::CreateParams(model->profile())); // Copy over the state from the navigation controller to preserve the // back/forward history and to continue to display the correct title/favicon. + // + // Set |needs_reload| to false so that the tab is not automatically reloaded + // when activated (otherwise, there would be an immediate reload when the + // active tab in a non-visible window is discarded). TabManager will + // explicitly reload the tab when it becomes the active tab in an active + // window (ReloadWebContentsIfDiscarded). + // + // Note: It is important that |needs_reload| is false even when the discarded + // tab is not active. Otherwise, it would get reloaded by + // WebContentsImpl::WasShown() and by ReloadWebContentsIfDiscarded() when + // activated. null_contents->GetController().CopyStateFrom(old_contents->GetController(), - /* needs_reload */ true); + /* needs_reload */ false); // Make sure to persist the last active time property. null_contents->SetLastActiveTime(old_contents->GetLastActiveTime()); @@ -783,9 +806,6 @@ content::WebContents* new_contents, int index, int reason) { - GetWebContentsData(new_contents)->SetDiscardState(false); - // When ActiveTabChanged, |new_contents| purged state changes to be false. - GetWebContentsData(new_contents)->set_is_purged(false); // If |old_contents| is set, that tab has switched from being active to // inactive, so record the time of that transition. if (old_contents) { @@ -797,6 +817,15 @@ // |old_contents| is set. RecordSwitchToTab(new_contents); } + + // An active tab is not purged. + GetWebContentsData(new_contents)->set_is_purged(false); + + // Reload |web_contents| if it is in an active browser and discarded. + if (IsActiveWebContentsInActiveBrowser(new_contents)) { + ReloadWebContentsIfDiscarded(new_contents, + GetWebContentsData(new_contents)); + } } void TabManager::TabInsertedAt(TabStripModel* tab_strip_model, @@ -816,6 +845,14 @@ GetTimeToPurge(min_time_to_purge_)); } +void TabManager::OnBrowserSetLastActive(Browser* browser) { + // Reload the active tab in |browser| if it is discarded. + content::WebContents* contents = + browser->tab_strip_model()->GetActiveWebContents(); + if (contents) + ReloadWebContentsIfDiscarded(contents, GetWebContentsData(contents)); +} + bool TabManager::IsMediaTab(WebContents* contents) const { if (contents->WasRecentlyAudible()) return true; @@ -859,9 +896,8 @@ // Loop until a non-discarded tab to kill is found. for (TabStatsList::const_reverse_iterator stats_rit = stats.rbegin(); stats_rit != stats.rend(); ++stats_rit) { - int64_t least_important_tab_id = stats_rit->tab_contents_id; - if (CanDiscardTab(least_important_tab_id)) { - WebContents* new_contents = DiscardTabById(least_important_tab_id); + if (CanDiscardTab(*stats_rit)) { + WebContents* new_contents = DiscardTabById(stats_rit->tab_contents_id); if (new_contents) return new_contents; } @@ -886,6 +922,15 @@ #endif } +bool TabManager::IsActiveWebContentsInActiveBrowser( + content::WebContents* contents) const { + auto browser_info_list = GetBrowserInfoList(); + if (browser_info_list.empty()) + return false; + return browser_info_list.front().tab_strip_model->GetActiveWebContents() == + contents; +} + std::vector<TabManager::BrowserInfo> TabManager::GetBrowserInfoList() const { if (!test_browser_info_list_.empty()) return test_browser_info_list_; @@ -900,7 +945,6 @@ BrowserInfo browser_info; browser_info.tab_strip_model = browser->tab_strip_model(); - browser_info.window_is_active = browser->window()->IsActive(); browser_info.window_is_minimized = browser->window()->IsMinimized(); browser_info.browser_is_app = browser->is_app(); browser_info_list.push_back(browser_info);
diff --git a/chrome/browser/resource_coordinator/tab_manager.h b/chrome/browser/resource_coordinator/tab_manager.h index 038bed63..9f3ecddd 100644 --- a/chrome/browser/resource_coordinator/tab_manager.h +++ b/chrome/browser/resource_coordinator/tab_manager.h
@@ -9,7 +9,6 @@ #include <memory> #include <string> -#include <utility> #include <vector> #include "base/callback.h" @@ -25,6 +24,7 @@ #include "chrome/browser/resource_coordinator/tab_manager_observer.h" #include "chrome/browser/resource_coordinator/tab_stats.h" #include "chrome/browser/sessions/session_restore_observer.h" +#include "chrome/browser/ui/browser_list_observer.h" #include "chrome/browser/ui/browser_tab_strip_tracker.h" #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" @@ -51,8 +51,9 @@ // which are then used by the algorithm embedded here for priority in being // killed upon OOM conditions. // -// The algorithm used favors killing tabs that are not selected, not pinned, -// and have been idle for longest, in that order of priority. +// The algorithm used favors killing tabs that are not active, not in an active +// window, not in a visible window, not pinned, and have been idle for longest, +// in that order of priority. // // On Chrome OS (via the delegate), the kernel (via /proc/<pid>/oom_score_adj) // will be informed of each renderer's score, which is based on the status, so @@ -63,7 +64,8 @@ // Note that the browser tests are only active for platforms that use // TabManager (CrOS only for now) and need to be adjusted accordingly if // support for new platforms is added. -class TabManager : public TabStripModelObserver { +class TabManager : public TabStripModelObserver, + public chrome::BrowserListObserver { public: // Needs to be public for DEFINE_WEB_CONTENTS_USER_DATA_KEY. class WebContentsData; @@ -91,7 +93,7 @@ // Goes through a list of checks to see if a tab is allowed to be discarded by // the automatic tab discarding mechanism. Note that this is not used when // discarding a particular tab from about:discards. - bool CanDiscardTab(int64_t target_web_contents_id) const; + bool CanDiscardTab(const TabStats& tab_stats) const; // Discards a tab to free the memory occupied by its renderer. The tab still // exists in the tab-strip; clicking on it will reload it. @@ -184,11 +186,11 @@ FRIEND_TEST_ALL_PREFIXES(TabManagerTest, GetUnsortedTabStatsIsInVisibleWindow); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, HistogramsSessionRestoreSwitchToTab); + FRIEND_TEST_ALL_PREFIXES(TabManagerTest, DiscardTabWithNonVisibleTabs); // Information about a Browser. struct BrowserInfo { TabStripModel* tab_strip_model; - bool window_is_active; bool window_is_minimized; bool browser_is_app; }; @@ -244,7 +246,9 @@ int GetTabCount() const; // Adds all the stats of the tabs in |browser_info| into |stats_list|. + // |window_is_active| indicates whether |browser_info|'s window is active. void AddTabStats(const BrowserInfo& browser_info, + bool window_is_active, TabStatsList* stats_list) const; // Callback for when |update_timer_| fires. Takes care of executing the tasks @@ -295,6 +299,9 @@ int index, bool foreground) override; + // BrowserListObserver overrides. + void OnBrowserSetLastActive(Browser* browser) override; + // Returns true if the tab is currently playing audio or has played audio // recently, or if the tab is currently accessing the camera, microphone or // mirroring the display. @@ -315,8 +322,13 @@ // Returns true if tabs can be discarded only once. bool CanOnlyDiscardOnce() const; - // Returns a list of BrowserInfo sorted in z-order from top to bottom. The - // list is constructed from either |test_browser_info_list_| or BrowserList. + // Returns true if |web_contents| is the active WebContents in the last active + // Browser. + bool IsActiveWebContentsInActiveBrowser(content::WebContents* contents) const; + + // Returns a list of BrowserInfo constructed from either + // |test_browser_info_list_| or BrowserList. The first BrowserInfo in the list + // corresponds to the last active Browser. std::vector<BrowserInfo> GetBrowserInfoList() const; void OnSessionRestoreStartedLoadingTabs(); @@ -379,8 +391,8 @@ // Injected BrowserInfo list. Allows this to be tested end-to-end without // requiring a full browser environment. If specified these BrowserInfo will // be crawled as the authoritative source of tabs, otherwise the BrowserList - // and associated Browser objects are crawled. The list must be sorted in - // z-order, from top to bottom. + // and associated Browser objects are crawled. The first BrowserInfo in the + // list corresponds to the last active Browser. // TODO(chrisha): Factor out tab-strip model enumeration to a helper class, // and make a delegate that centralizes all testing seams. std::vector<BrowserInfo> test_browser_info_list_;
diff --git a/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.cc b/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.cc index 25b44abb..612506f 100644 --- a/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.cc +++ b/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.cc
@@ -153,7 +153,7 @@ return ProcessType::BACKGROUND_APP; } if (tab()) { - if (tab()->is_selected) + if (tab()->is_active && tab()->is_in_active_window) return ProcessType::FOCUSED_TAB; return ProcessType::BACKGROUND_TAB; } @@ -354,8 +354,7 @@ } // If the list of ARC processes is not available, call LowMemoryKillImpl // synchronously with an empty list of apps. - std::vector<arc::ArcProcess> dummy_apps; - LowMemoryKillImpl(tab_list, dummy_apps); + LowMemoryKillImpl(tab_list, std::vector<arc::ArcProcess>()); } int TabManagerDelegate::GetCachedOomScore(ProcessHandle process_handle) { @@ -536,10 +535,10 @@ return true; } -bool TabManagerDelegate::KillTab(int64_t tab_id) { +bool TabManagerDelegate::KillTab(const TabStats& tab_stats) { // Check |tab_manager_| is alive before taking tabs into consideration. - return tab_manager_ && tab_manager_->CanDiscardTab(tab_id) && - tab_manager_->DiscardTabById(tab_id); + return tab_manager_ && tab_manager_->CanDiscardTab(tab_stats) && + tab_manager_->DiscardTabById(tab_stats.tab_contents_id); } chromeos::DebugDaemonClient* TabManagerDelegate::GetDebugDaemonClient() { @@ -548,7 +547,7 @@ void TabManagerDelegate::LowMemoryKillImpl( const TabStatsList& tab_list, - const std::vector<arc::ArcProcess>& arc_processes) { + std::vector<arc::ArcProcess> arc_processes) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); VLOG(2) << "LowMemoryKillImpl"; @@ -608,13 +607,12 @@ MEMORY_LOG(ERROR) << "Failed to kill " << it->app()->process_name(); } } else if (it->tab()) { - int64_t tab_id = it->tab()->tab_contents_id; // The estimation is problematic since multiple tabs may share the same // process, while the calculation counts memory used by the whole process. // So |estimated_memory_freed_kb| is an over-estimation. int estimated_memory_freed_kb = mem_stat_->EstimatedMemoryFreedKB(it->tab()->renderer_handle); - if (KillTab(tab_id)) { + if (KillTab(*it->tab())) { target_memory_to_free_kb -= estimated_memory_freed_kb; memory::MemoryKillsMonitor::LogLowMemoryKill("TAB", estimated_memory_freed_kb); @@ -632,7 +630,7 @@ void TabManagerDelegate::AdjustOomPrioritiesImpl( const TabStatsList& tab_list, - const std::vector<arc::ArcProcess>& arc_processes) { + std::vector<arc::ArcProcess> arc_processes) { std::vector<TabManagerDelegate::Candidate> candidates; std::vector<TabManagerDelegate::Candidate> apps_non_killable;
diff --git a/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.h b/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.h index 8c51eb6..f7f0ff7 100644 --- a/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.h +++ b/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.h
@@ -96,7 +96,7 @@ // Kills a tab. Returns true if the tab is killed successfully. // Virtual for unit testing. - virtual bool KillTab(int64_t tab_id); + virtual bool KillTab(const TabStats& tab_stats); // Get debugd client instance. Virtual for unit testing. virtual chromeos::DebugDaemonClient* GetDebugDaemonClient(); @@ -141,7 +141,7 @@ // Kills a process after getting all info of tabs and apps. void LowMemoryKillImpl(const TabStatsList& tab_list, - const std::vector<arc::ArcProcess>& arc_processes); + std::vector<arc::ArcProcess> arc_processes); // Public interface to adjust OOM scores. void AdjustOomPriorities(const TabStatsList& tab_list, @@ -151,9 +151,8 @@ void AdjustFocusedTabScore(base::ProcessHandle pid); // Called by AdjustOomPriorities. Runs on the main thread. - void AdjustOomPrioritiesImpl( - const TabStatsList& tab_list, - const std::vector<arc::ArcProcess>& arc_processes); + void AdjustOomPrioritiesImpl(const TabStatsList& tab_list, + std::vector<arc::ArcProcess> arc_processes); // Sets OOM score for processes in the range [|rbegin|, |rend|) to integers // distributed evenly in [|range_begin|, |range_end|).
diff --git a/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos_unittest.cc b/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos_unittest.cc index 06f6de01..d104d5e 100644 --- a/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos_unittest.cc +++ b/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos_unittest.cc
@@ -6,6 +6,7 @@ #include <map> #include <string> +#include <utility> #include <vector> #include "base/process/process_handle.h" @@ -101,7 +102,8 @@ TabStats tab1; tab1.tab_contents_id = 100; tab1.is_pinned = true; - tab1.is_selected = true; + tab1.is_in_active_window = true; + tab1.is_active = true; const TabStatsList tab_list = {tab1}; const std::vector<TabManagerDelegate::Candidate> candidates = @@ -156,8 +158,8 @@ return true; } - bool KillTab(int64_t tab_id) override { - killed_tabs_.push_back(tab_id); + bool KillTab(const TabStats& tab_stats) override { + killed_tabs_.push_back(tab_stats.tab_contents_id); return true; } @@ -247,7 +249,8 @@ // tab1 pid: 11 // tab5 pid: 12 // tab2 pid: 11 - tab_manager_delegate.AdjustOomPrioritiesImpl(tab_list, arc_processes); + tab_manager_delegate.AdjustOomPrioritiesImpl(tab_list, + std::move(arc_processes)); auto& oom_score_map = tab_manager_delegate.oom_score_map_; // 6 PIDs for apps + 2 PIDs for tabs. @@ -334,7 +337,7 @@ memory_stat->SetTargetMemoryToFreeKB(250000); memory_stat->SetProcessPss(30, 10000); TabStatsList tab_list; - tab_manager_delegate.LowMemoryKillImpl(tab_list, arc_processes); + tab_manager_delegate.LowMemoryKillImpl(tab_list, std::move(arc_processes)); auto killed_arc_processes = tab_manager_delegate.GetKilledArcProcesses(); EXPECT_EQ(0U, killed_arc_processes.size()); @@ -411,7 +414,7 @@ memory_stat->SetProcessPss(20, 30000); memory_stat->SetProcessPss(10, 100000); - tab_manager_delegate.LowMemoryKillImpl(tab_list, arc_processes); + tab_manager_delegate.LowMemoryKillImpl(tab_list, std::move(arc_processes)); auto killed_arc_processes = tab_manager_delegate.GetKilledArcProcesses(); auto killed_tabs = tab_manager_delegate.GetKilledTabs();
diff --git a/chrome/browser/resource_coordinator/tab_manager_unittest.cc b/chrome/browser/resource_coordinator/tab_manager_unittest.cc index 2e68ed0..6e3f7507 100644 --- a/chrome/browser/resource_coordinator/tab_manager_unittest.cc +++ b/chrome/browser/resource_coordinator/tab_manager_unittest.cc
@@ -35,6 +35,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/test/mock_render_process_host.h" #include "content/public/test/web_contents_tester.h" +#include "content/test/test_web_contents.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -90,7 +91,6 @@ }; enum TestIndicies { - kSelected, kAutoDiscardable, kPinned, kApp, @@ -108,7 +108,11 @@ class TabManagerTest : public ChromeRenderViewHostTestHarness { public: WebContents* CreateWebContents() { - return WebContents::Create(WebContents::CreateParams(profile())); + content::TestWebContents* web_contents = + content::TestWebContents::Create(profile(), nullptr); + // Commit an URL to allow discarding. + web_contents->NavigateAndCommit(GURL("https://www.example.com")); + return web_contents; } }; @@ -120,7 +124,7 @@ TabStatsList test_list; const base::TimeTicks now = base::TimeTicks::Now(); - // Add kSelected last to verify that the array is being sorted. + // Add kAutoDiscardable last to verify that the array is being sorted. { TabStats stats; @@ -191,6 +195,8 @@ test_list.push_back(stats); } + // This entry sorts to the front, so by adding it last, it verifies that the + // array is being sorted. { TabStats stats; stats.last_active = now; @@ -199,20 +205,9 @@ test_list.push_back(stats); } - // This entry sorts to the front, so by adding it last, it verifies that the - // array is being sorted. - { - TabStats stats; - stats.last_active = now; - stats.is_selected = true; - stats.child_process_host_id = kSelected; - test_list.push_back(stats); - } - std::sort(test_list.begin(), test_list.end(), TabManager::CompareTabStats); int index = 0; - EXPECT_EQ(kSelected, test_list[index++].child_process_host_id); EXPECT_EQ(kAutoDiscardable, test_list[index++].child_process_host_id); EXPECT_EQ(kFormEntry, test_list[index++].child_process_host_id); EXPECT_EQ(kPlayingAudio, test_list[index++].child_process_host_id); @@ -247,10 +242,17 @@ TEST_F(TabManagerTest, DiscardWebContentsAt) { TabManager tab_manager; + // Create a tab strip in a visible and active window. TabStripDummyDelegate delegate; TabStripModel tabstrip(&delegate, profile()); tabstrip.AddObserver(&tab_manager); + TabManager::BrowserInfo browser_info; + browser_info.tab_strip_model = &tabstrip; + browser_info.window_is_minimized = false; + browser_info.browser_is_app = false; + tab_manager.test_browser_info_list_.push_back(browser_info); + // Fill it with some tabs. WebContents* contents1 = CreateWebContents(); tabstrip.AppendWebContents(contents1, true); @@ -293,12 +295,6 @@ EXPECT_FALSE(tab_manager.IsTabDiscarded(tabstrip.GetWebContentsAt(0))); EXPECT_FALSE(tab_manager.IsTabDiscarded(tabstrip.GetWebContentsAt(1))); - // Don't discard active tab. - tab_manager.DiscardWebContentsAt(0, &tabstrip); - ASSERT_EQ(2, tabstrip.count()); - EXPECT_FALSE(tab_manager.IsTabDiscarded(tabstrip.GetWebContentsAt(0))); - EXPECT_FALSE(tab_manager.IsTabDiscarded(tabstrip.GetWebContentsAt(1))); - tabstrip.CloseAllTabs(); EXPECT_TRUE(tabstrip.empty()); } @@ -457,6 +453,9 @@ // Wait 1 day and verify that the tab is still be purged. test_clock.Advance(base::TimeDelta::FromHours(24)); EXPECT_FALSE(tab_manager.ShouldPurgeNow(test_contents)); + + // Tabs with a committed URL must be closed explicitly to avoid DCHECK errors. + tabstrip.CloseAllTabs(); } TEST_F(TabManagerTest, ActivateTabResetPurgeState) { @@ -467,7 +466,6 @@ TabManager::BrowserInfo browser_info; browser_info.tab_strip_model = &tabstrip; - browser_info.window_is_active = true; browser_info.window_is_minimized = false; browser_info.browser_is_app = false; tab_manager.test_browser_info_list_.push_back(browser_info); @@ -499,6 +497,9 @@ // Activate tab2. Tab2's PurgeAndSuspend state should be NOT_PURGED. tabstrip.ActivateTabAt(1, true /* user_gesture */); EXPECT_FALSE(tab_manager.GetWebContentsData(tab2)->is_purged()); + + // Tabs with a committed URL must be closed explicitly to avoid DCHECK errors. + tabstrip.CloseAllTabs(); } // Verify that the |is_in_visible_window| field of TabStats returned by @@ -526,14 +527,12 @@ // minimized. TabManager::BrowserInfo browser_info1; browser_info1.tab_strip_model = &tab_strip1; - browser_info1.window_is_active = true; browser_info1.window_is_minimized = false; browser_info1.browser_is_app = false; tab_manager.test_browser_info_list_.push_back(browser_info1); TabManager::BrowserInfo browser_info2; browser_info2.tab_strip_model = &tab_strip2; - browser_info2.window_is_active = false; browser_info2.window_is_minimized = true; browser_info2.browser_is_app = false; tab_manager.test_browser_info_list_.push_back(browser_info2); @@ -557,6 +556,66 @@ EXPECT_TRUE(tab_stats[1].is_in_visible_window); EXPECT_FALSE(tab_stats[2].is_in_visible_window); EXPECT_FALSE(tab_stats[3].is_in_visible_window); + + // Tabs with a committed URL must be closed explicitly to avoid DCHECK errors. + tab_strip1.CloseAllTabs(); + tab_strip2.CloseAllTabs(); +} + +// Verify that: +// - On ChromeOS, DiscardTab can discard every tab in a non-visible window, but +// cannot discard the active tab in a visible window. +// - On other platforms, DiscardTab can discard every non-active tab. +TEST_F(TabManagerTest, DiscardTabWithNonVisibleTabs) { + TabManager tab_manager; + TabStripDummyDelegate delegate; + + // Create 2 TabStripModels. + TabStripModel tab_strip1(&delegate, profile()); + tab_strip1.AppendWebContents(CreateWebContents(), true); + tab_strip1.AppendWebContents(CreateWebContents(), false); + + TabStripModel tab_strip2(&delegate, profile()); + tab_strip2.AppendWebContents(CreateWebContents(), true); + tab_strip2.AppendWebContents(CreateWebContents(), false); + + // Add the 2 TabStripModels to the TabManager. + // The window for |tab_strip1| is visible while the window for |tab_strip2| + // is minimized. + TabManager::BrowserInfo browser_info1; + browser_info1.tab_strip_model = &tab_strip1; + browser_info1.window_is_minimized = false; + browser_info1.browser_is_app = false; + tab_manager.test_browser_info_list_.push_back(browser_info1); + + TabManager::BrowserInfo browser_info2; + browser_info2.tab_strip_model = &tab_strip2; + browser_info2.window_is_minimized = true; + browser_info2.browser_is_app = false; + tab_manager.test_browser_info_list_.push_back(browser_info2); + + for (int i = 0; i < 4; ++i) + tab_manager.DiscardTab(); + + // Active tab in a visible window should not be discarded. + EXPECT_FALSE(tab_manager.IsTabDiscarded(tab_strip1.GetWebContentsAt(0))); + + // Non-active tabs should be discarded. + EXPECT_TRUE(tab_manager.IsTabDiscarded(tab_strip1.GetWebContentsAt(1))); + EXPECT_TRUE(tab_manager.IsTabDiscarded(tab_strip2.GetWebContentsAt(1))); + +#if defined(OS_CHROMEOS) + // On ChromeOS, active tab in a minimized window should be discarded. + EXPECT_TRUE(tab_manager.IsTabDiscarded(tab_strip2.GetWebContentsAt(0))); +#else + // On other platforms, an active tab is never discarded, even if its window is + // minimized. + EXPECT_FALSE(tab_manager.IsTabDiscarded(tab_strip2.GetWebContentsAt(0))); +#endif // defined(OS_CHROMEOS) + + // Tabs with a committed URL must be closed explicitly to avoid DCHECK errors. + tab_strip1.CloseAllTabs(); + tab_strip2.CloseAllTabs(); } TEST_F(TabManagerTest, OnSessionRestoreStartedAndFinishedLoadingTabs) { @@ -583,7 +642,11 @@ const char kHistogramName[] = "TabManager.SessionRestore.SwitchToTab"; TabManager tab_manager; + TabStripDummyDelegate delegate; + TabStripModel tab_strip(&delegate, profile()); WebContents* tab = CreateWebContents(); + tab_strip.AppendWebContents(tab, true); + auto* data = tab_manager.GetWebContentsData(tab); base::HistogramTester histograms; @@ -623,6 +686,9 @@ histograms.ExpectBucketCount(kHistogramName, TAB_IS_NOT_LOADING, 2); histograms.ExpectBucketCount(kHistogramName, TAB_IS_LOADING, 3); histograms.ExpectBucketCount(kHistogramName, TAB_IS_LOADED, 4); + + // Tabs with a committed URL must be closed explicitly to avoid DCHECK errors. + tab_strip.CloseAllTabs(); } } // namespace resource_coordinator
diff --git a/chrome/browser/resource_coordinator/tab_stats.h b/chrome/browser/resource_coordinator/tab_stats.h index 52c24f42..a74a057 100644 --- a/chrome/browser/resource_coordinator/tab_stats.h +++ b/chrome/browser/resource_coordinator/tab_stats.h
@@ -34,9 +34,12 @@ bool is_media = false; bool is_pinned = false; bool is_in_visible_window = false; - bool is_selected = false; // Selected in the currently active browser window. + bool is_in_active_window = false; + // Whether this is the active tab in a browser window. + bool is_active = false; bool is_discarded = false; - bool has_form_entry = false; // User has entered text in a form. + // User has entered text in a form. + bool has_form_entry = false; int discard_count = 0; base::TimeTicks last_active; base::TimeTicks last_hidden;
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js index 6d60261..6c47233 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js
@@ -325,4 +325,20 @@ return node.name || ''; }; +/** + * Gets the root of editable node. + * @param {!AutomationNode} node + * @return {!AutomationNode|undefined} + */ +AutomationUtil.getEditableRoot = function(node) { + var testNode = node; + var rootEditable; + do { + if (testNode.state.editable && testNode.state.focused) + rootEditable = testNode; + testNode = testNode.parent; + } while (testNode); + return rootEditable; +}; + }); // goog.scope
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs index 309cbd0a..b78b3f4 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
@@ -227,10 +227,10 @@ .expectBraille('apple btn +popup +') .call(incrementSelectedIndex) .expectSpeech('grape', /2 of 3/) - .expectBraille('grape mnuitm 2/3') + .expectBraille('grape mnuitm 2/3 (x)') .call(incrementSelectedIndex) .expectSpeech('banana', /3 of 3/) - .expectBraille('banana mnuitm 3/3'); + .expectBraille('banana mnuitm 3/3 (x)'); mockFeedback.replay(); }); });
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js index aa6c338..c894b2c 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
@@ -66,9 +66,8 @@ this.addListener_( EventType.SCROLL_POSITION_CHANGED, this.onScrollPositionChanged); this.addListener_(EventType.SELECTION, this.onSelection); - this.addListener_(EventType.TEXT_CHANGED, this.onTextChanged); - this.addListener_( - EventType.TEXT_SELECTION_CHANGED, this.onTextSelectionChanged); + this.addListener_(EventType.TEXT_CHANGED, this.onEditableChanged_); + this.addListener_(EventType.TEXT_SELECTION_CHANGED, this.onEditableChanged_); this.addListener_(EventType.VALUE_CHANGED, this.onValueChanged); AutomationObjectConstructorInstaller.init(node, function() { @@ -267,10 +266,11 @@ // data might require editable text updates. Further note that children // change events can and do come after text/text selection changes. var rootEditable = evt.target; - while (rootEditable.parent && rootEditable.parent.state.richlyEditable) - rootEditable = rootEditable.parent; - this.onEditableChanged_(new CustomAutomationEvent( - EventType.TEXT_CHANGED, rootEditable, evt.eventFrom)); + rootEditable = AutomationUtil.getEditableRoot(rootEditable); + if (rootEditable) { + this.onEditableChanged_(new CustomAutomationEvent( + EventType.TEXT_CHANGED, rootEditable, evt.eventFrom)); + } return; } @@ -388,59 +388,20 @@ }, /** - * Provides all feedback once a text changed event fires. - * @param {!AutomationEvent} evt - */ - onTextChanged: function(evt) { - if (evt.target.state.editable) - this.onEditableChanged_(evt); - }, - - /** - * Provides all feedback once a text selection changed event fires. - * @param {!AutomationEvent} evt - */ - onTextSelectionChanged: function(evt) { - if (evt.target.state.editable) - this.onEditableChanged_(evt); - }, - - /** * Provides all feedback once a change event in a text field fires. * @param {!AutomationEvent} evt * @private */ onEditableChanged_: function(evt) { - var topRoot = AutomationUtil.getTopLevelRoot(evt.target); - if (!evt.target.state.focused || - (topRoot && topRoot.parent && !topRoot.parent.state.focused)) - return; - if (!ChromeVoxState.instance.currentRange) { this.onEventDefault(evt); ChromeVoxState.instance.setCurrentRange( cursors.Range.fromNode(evt.target)); } - // Re-target the node to the root of the editable. - var target = evt.target; - while (target.parent && target.parent.state.editable) - target = target.parent; - var voxTarget = ChromeVoxState.instance.currentRange.start.node; - while (voxTarget && voxTarget.parent && voxTarget.parent.state.editable) - voxTarget = voxTarget.parent; - - // It is possible that ChromeVox has range over some other node when a text - // field is focused. Only allow this when focus is on a desktop node or - // ChromeVox is over the keyboard. - if (!target.state.focused || - (target != voxTarget && target.root.role != RoleType.DESKTOP && - voxTarget.root.url.indexOf(DesktopAutomationHandler.KEYBOARD_URL) != - 0)) + if (!this.createTextEditHandlerIfNeeded_(evt.target)) return; - this.createTextEditHandlerIfNeeded_(target); - // Sync the ChromeVox range to the editable, if a selection exists. var anchorObject = evt.target.root.anchorObject; var anchorOffset = evt.target.root.anchorOffset || 0; @@ -454,11 +415,7 @@ // Sync ChromeVox range with selection. ChromeVoxState.instance.setCurrentRange(selectedRange); } - - // TODO(plundblad): This can currently be null for contenteditables. - // Clean up when it can't. - if (this.textEditHandler_) - this.textEditHandler_.onEvent(evt); + this.textEditHandler_.onEvent(evt); }, /** @@ -562,11 +519,37 @@ /** * Create an editable text handler for the given node if needed. * @param {!AutomationNode} node + * @return {boolean} True if the handler exists (created/already present). */ createTextEditHandlerIfNeeded_: function(node) { - if (!this.textEditHandler_ || this.textEditHandler_.node !== node) { - this.textEditHandler_ = editing.TextEditHandler.createForNode(node); + if (!node.state.editable) + return false; + + var topRoot = AutomationUtil.getTopLevelRoot(node); + if (topRoot && topRoot.parent && !topRoot.parent.state.focused) + return false; + + // Re-target the node to the root of the editable. + var target = node; + target = AutomationUtil.getEditableRoot(target); + var voxTarget = ChromeVoxState.instance.currentRange.start.node; + voxTarget = AutomationUtil.getEditableRoot(voxTarget) || voxTarget; + + // It is possible that ChromeVox has range over some other node when a text + // field is focused. Only allow this when focus is on a desktop node or + // ChromeVox is over the keyboard. + if (!target || !voxTarget || + (target != voxTarget && target.root.role != RoleType.DESKTOP && + voxTarget.root.role != RoleType.DESKTOP && + voxTarget.root.url.indexOf(DesktopAutomationHandler.KEYBOARD_URL) != + 0)) + return false; + + if (!this.textEditHandler_ || this.textEditHandler_.node !== target) { + this.textEditHandler_ = editing.TextEditHandler.createForNode(target); } + + return !!this.textEditHandler_; }, /**
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js index 3b501d4..199e4065 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
@@ -481,19 +481,10 @@ * @return {editing.TextEditHandler} */ editing.TextEditHandler.createForNode = function(node) { - var rootFocusedEditable = null; - var testNode = node; + if (!node.state.editable) + throw new Error('Expected editable node.'); - do { - if (testNode.state[StateType.FOCUSED] && testNode.state[StateType.EDITABLE]) - rootFocusedEditable = testNode; - testNode = testNode.parent; - } while (testNode); - - if (rootFocusedEditable) - return new TextFieldTextEditHandler(rootFocusedEditable); - - return null; + return new TextFieldTextEditHandler(node); }; /** @@ -556,9 +547,9 @@ // Computed members. /** @private {Spannable} */ this.value_; - /** @private {AutomationNode} */ + /** @private {AutomationNode|undefined} */ this.lineStart_; - /** @private {AutomationNode} */ + /** @private {AutomationNode|undefined} */ this.lineEnd_; /** @private {AutomationNode|undefined} */ this.startContainer_; @@ -602,24 +593,27 @@ // Annotate each chunk with its associated inline text box node. this.value_.setSpan(this.lineStart_, 0, nameLen); - // If the current selection is not on an inline text box (e.g. an image), - // return early here so that the line contents are just the node. This is - // pending the ability to show non-text leaf inline objects. - if (this.lineStart_.role != RoleType.INLINE_TEXT_BOX) - return; - - // Also, track their static text parents. + // Also, track the nodes necessary for selection (either their parents, in + // the case of inline text boxes, or the node itself). var parents = [this.startContainer_]; // Compute the start of line. var lineStart = this.lineStart_; - while (lineStart.previousOnLine && lineStart.previousOnLine.role) { - lineStart = lineStart.previousOnLine; - if (lineStart.role != RoleType.INLINE_TEXT_BOX) - continue; + + // Hack: note underlying bugs require these hacks. + while ((lineStart.previousOnLine && lineStart.previousOnLine.role) || + (lineStart.previousSibling && lineStart.previousSibling.lastChild && + lineStart.previousSibling.lastChild.nextOnLine == lineStart)) { + if (lineStart.previousOnLine) + lineStart = lineStart.previousOnLine; + else + lineStart = lineStart.previousSibling.lastChild; this.lineStart_ = lineStart; - if (parents[0] != lineStart.parent) + + if (lineStart.role != RoleType.INLINE_TEXT_BOX) + parents.unshift(lineStart); + else if (parents[0] != lineStart.parent) parents.unshift(lineStart.parent); var prepend = new Spannable(lineStart.name, lineStart); @@ -629,13 +623,21 @@ this.lineStartContainer_ = this.lineStart_.parent; var lineEnd = this.lineEnd_; - while (lineEnd.nextOnLine && lineEnd.nextOnLine.role) { - lineEnd = lineEnd.nextOnLine; - if (lineEnd.role != RoleType.INLINE_TEXT_BOX) - continue; + + // Hack: note underlying bugs require these hacks. + while ((lineEnd.nextOnLine && lineEnd.nextOnLine.role) || + (lineEnd.nextSibling && + lineEnd.nextSibling.previousOnLine == lineEnd)) { + if (lineEnd.nextOnLine) + lineEnd = lineEnd.nextOnLine; + else + lineEnd = lineEnd.nextSibling.firstChild; this.lineEnd_ = lineEnd; - if (parents[parents.length - 1] != lineEnd.parent) + + if (lineEnd.role != RoleType.INLINE_TEXT_BOX) + parents.push(this.lineEnd_); + else if (parents[parents.length - 1] != lineEnd.parent) parents.push(this.lineEnd_.parent); var annotation = lineEnd;
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs index 6bfb586..f589443a 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs
@@ -484,6 +484,62 @@ }); }); +TEST_F('EditingTest', 'RichTextImageByCharacter', function() { + var mockFeedback = this.createMockFeedback(); + this.runWithLoadedTree(function() {/*! + <p id="go" contenteditable> + <img alt="dog"></img> is a <img alt="cat"</img> test + </p> + <script> + document.getElementById('go').addEventListener('click', function() { + var sel = getSelection(); + sel.modify('move', 'forward', 'character'); + }, true); + </script> + */}, function(root) { + var input = root.find({role: RoleType.PARAGRAPH}); + var moveByChar = input.doDefault.bind(input); + + this.listenOnce(input, 'focus', function() { + var lineText = 'dog is a cat test'; + mockFeedback.call(moveByChar) + // Note that this isn't quite correct. This should be the second + // character which is a space ' '. + .expectSpeech('dog', 'Image') + // Ditto. + .expectBraille(lineText, {startIndex: 0, endIndex: 0}) + .call(moveByChar) + .expectSpeech('i') + .expectBraille(lineText, {startIndex: 4, endIndex: 4}) + .call(moveByChar) + .expectSpeech('s') + .expectBraille(lineText, {startIndex: 5, endIndex: 5}) + .call(moveByChar) + .expectSpeech(' ') + .expectBraille(lineText, {startIndex: 6, endIndex: 6}) + .call(moveByChar) + .expectSpeech('a') + .expectBraille(lineText, {startIndex: 7, endIndex: 7}) + .call(moveByChar) + .expectSpeech(' ') + .expectBraille(lineText, {startIndex: 8, endIndex: 8}) + .call(moveByChar) + + // This is technically wrong because we're actually over the entire + // image. This is broken because of bad node offsets. + .expectSpeech('c') + .expectBraille(lineText, {startIndex: 9, endIndex: 9}) + + // Unfortunately, the node offset being wrong here means there's no + // output for the next character move. Fix Once node offsets get fixed + // in Blink. + + .replay(); + }); + input.focus(); + }); +}); + TEST_F('EditingTest', 'EditableLineOneStaticText', function() { this.runWithLoadedTree(function() {/*! <p contenteditable style="word-spacing:100000px">this is a test</p>
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js index 8a13ff0a2..346ec373 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
@@ -277,11 +277,14 @@ }, alert: { enter: '$name $role $state', - speak: '$earcon(ALERT_NONMODAL) $role $nameOrTextContent $state' + speak: '$earcon(ALERT_NONMODAL) $role $nameOrTextContent $description ' + + '$state' }, alertDialog: { - enter: '$earcon(ALERT_MODAL) $name $state', - speak: '$earcon(ALERT_MODAL) $name $nameOrTextContent $state $role' + enter: '$earcon(ALERT_MODAL) $name $state $description', + speak: + '$earcon(ALERT_MODAL) $name $nameOrTextContent $description $state ' + + '$role' }, cell: { enter: '@cell_summary($if($ariaCellRowIndex, $ariaCellRowIndex, ' + @@ -291,7 +294,7 @@ speak: '$name @cell_summary($if($ariaCellRowIndex, $ariaCellRowIndex, ' + '$tableCellRowIndex), ' + '$if($ariaCellColumnIndex, $ariaCellColumnIndex, ' + - '$tableCellColumnIndex)) $node(tableColumnHeader) $state' + '$tableCellColumnIndex)) $node(tableColumnHeader) $state $description' }, checkBox: { speak: '$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) ' + @@ -300,8 +303,10 @@ client: {speak: '$name'}, date: {enter: '$nameFromNode $role $description'}, dialog: {enter: '$nameFromNode $role $description'}, - genericContainer: - {enter: '$nameFromNode', speak: '$nameOrTextContent $description'}, + genericContainer: { + enter: '$nameFromNode $description $state', + speak: '$nameOrTextContent $description $state' + }, embeddedObject: {speak: '$name'}, grid: {enter: '$nameFromNode $role $description'}, group: { @@ -312,10 +317,12 @@ heading: { enter: '!relativePitch(hierarchicalLevel) ' + '$nameFromNode= ' + - '$if($hierarchicalLevel, @tag_h+$hierarchicalLevel, $role) $state', + '$if($hierarchicalLevel, @tag_h+$hierarchicalLevel, $role) $state ' + + '$description', speak: '!relativePitch(hierarchicalLevel) ' + '$nameOrDescendants= ' + - '$if($hierarchicalLevel, @tag_h+$hierarchicalLevel, $role) $state' + '$if($hierarchicalLevel, @tag_h+$hierarchicalLevel, $role) $state ' + + '$description' }, image: { speak: '$if($name, $name, $urlFilename) ' + @@ -330,7 +337,8 @@ }, list: { enter: '$role @@list_with_items($countChildren(listItem))', - speak: '$descendants $role @@list_with_items($countChildren(listItem))' + speak: '$descendants $role @@list_with_items($countChildren(listItem)) ' + + '$description $state' }, listBox: { enter: '$nameFromNode ' + @@ -345,9 +353,11 @@ enter: '$name= $role $state $description', speak: '$nameOrDescendants $earcon(LIST_ITEM) $role $state $description' }, + listMarker: {speak: '$name'}, menu: { enter: '$name $role', - speak: '$name $role @@list_with_items($countChildren(menuItem)) $state' + speak: '$name $role @@list_with_items($countChildren(menuItem)) ' + + '$description $state' }, menuItem: { speak: '$name $role $if($haspopup, @has_submenu) ' + @@ -356,18 +366,19 @@ }, menuItemCheckBox: { speak: '$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) ' + - '$name $role $checked $description ' + + '$name $role $checked $state $description ' + '@describe_index($indexInParent, $parentChildCount) ' }, menuItemRadio: { speak: '$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) ' + '$if($checked, @describe_radio_selected($name), ' + - '@describe_radio_unselected($name)) $description ' + + '@describe_radio_unselected($name)) $state $description ' + '@describe_index($indexInParent, $parentChildCount) ' }, menuListOption: { speak: '$name @role_menuitem ' + - '@describe_index($indexInParent, $parentChildCount) $description' + '@describe_index($indexInParent, $parentChildCount) $state ' + + '$description' }, paragraph: {speak: '$descendants'}, popUpButton: { @@ -377,13 +388,13 @@ radioButton: { speak: '$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) ' + '$if($checked, @describe_radio_selected($name), ' + - '@describe_radio_unselected($name)) $description' + '@describe_radio_unselected($name)) $description $state' }, radioGroup: {enter: '$name $role $description'}, rootWebArea: {enter: '$name', speak: '$if($name, $name, $docUrl)'}, - region: {speak: '$nameOrTextContent'}, + region: {speak: '$state $nameOrTextContent $description'}, row: {enter: '$node(tableRowHeader)'}, - rowHeader: {speak: '$nameOrTextContent $state'}, + rowHeader: {speak: '$nameOrTextContent $description $state'}, staticText: {speak: '$name='}, switch: { speak: '$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) ' + @@ -418,7 +429,7 @@ '@describe_index($indexInParent, $parentChildCount) ' + '@describe_depth($hierarchicalLevel)', speak: '$name ' + - '$role $state ' + + '$role $description $state ' + '@describe_index($indexInParent, $parentChildCount) ' + '@describe_depth($hierarchicalLevel)' },
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output_test.extjs b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output_test.extjs index 07ae9313..72a16863 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output_test.extjs +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output_test.extjs
@@ -787,3 +787,55 @@ o); }); }); + +SYNC_TEST_F('OutputE2ETest', 'ValidateStateAndDescription', function() { + var stateStr = '$state'; + var descStr = '$description'; + var missingState = []; + var missingDescription = []; + for (var key in Output.RULES.navigate) { + var speak = Output.RULES.navigate[key].speak; + if (!speak) + continue; + + if (speak.indexOf(stateStr) == -1) + missingState.push(key); + if (speak.indexOf(descStr) == -1) + missingDescription.push(key); + } + + // This filters out known roles that don't have states or descriptions. + var notStated = [RoleType.CLIENT, RoleType.EMBEDDED_OBJECT, + RoleType.INLINE_TEXT_BOX, RoleType.LIST_MARKER, + RoleType.PARAGRAPH, RoleType.ROOT_WEB_AREA, + RoleType.STATIC_TEXT, RoleType.WINDOW]; + var notDescribed = [RoleType.CLIENT, RoleType.EMBEDDED_OBJECT, + RoleType.INLINE_TEXT_BOX, RoleType.LIST_MARKER, RoleType.PARAGRAPH, + RoleType.ROOT_WEB_AREA, RoleType.STATIC_TEXT, RoleType.WINDOW]; + missingState = missingState.filter(function(state) { + return notStated.indexOf(state) == -1; + }); + missingDescription = missingDescription.filter(function(desc) { + return notDescribed.indexOf(desc) == -1; + }); + + assertEquals(0, missingState.length, + 'Unexpected missing states for output rules ' + + missingState.join(' ')); + assertEquals(0, missingDescription.length, + 'Unexpected missing descriptions for output rules ' + + missingDescription.join(' ')); + + // If you fail this test, you likely need to insert a $state or $description + // into the output rules for the printed roles. Typically, $description goes + // towards the end of the output rule, though this depends on the role. For + // example, it could make sense to put $description before $value or $state. + + // You can also add the role to be excluded from this check. You are + // encouraged to write a more intelligent output rule to provide friendlier + // feedback. For example, 'not selected apple item 2 out of 3' coming from a + // message template like '@smart_selection($state, $name, $indexInParent, + // $childCount)'. + // In such cases, you are responsible for ensuring you include all states and + // descriptions somewhere in the output. +});
diff --git a/chrome/browser/resources/chromeos/guest_session_tab.html b/chrome/browser/resources/chromeos/guest_session_tab.html index 1fd35f0..3940a24a 100644 --- a/chrome/browser/resources/chromeos/guest_session_tab.html +++ b/chrome/browser/resources/chromeos/guest_session_tab.html
@@ -1,8 +1,8 @@ <!doctype html> -<html i18n-values="dir:textdirection;lang:language"> +<html dir="$i18n{textdirection}" lang="$i18n{language}"> <head> <meta charset="utf-8"> -<title i18n-content="title"></title> +<title>$i18n{title}</title> <link rel="stylesheet" href="chrome://resources/css/text_defaults.css"> <link rel="stylesheet" href="../ntp4/incognito_and_guest_tab.css"> <link rel="stylesheet" href="guest_session_tab.css"> @@ -14,18 +14,18 @@ </script> </head> <body> -<div id="enterprise-info" i18n-values="visible:enterpriseInfoVisible;"> +<div id="enterprise-info" visible="$i18n{enterpriseInfoVisible}"> <img src="../../../../ui/webui/resources/images/business.svg"> - <span id="enterprise-info-message" i18n-content="enterpriseInfoMessage"> - </span> - <a id="enterprise-info-hint-link" i18n-content="enterpriseLearnMore" - i18n-values=".href:enterpriseInfoHintLink"></a> + <span id="enterprise-info-message">$i18n{enterpriseInfoMessage}</span> + <a id="enterprise-info-hint-link" href="$i18nRaw{enterpriseInfoHintLink}"> + $i18n{enterpriseLearnMore} + </a> </div> <div class="content"> - <h1 i18n-content="guestTabHeading"></h1> + <h1>$i18n{guestTabHeading}</h1> <p> - <span i18n-content="guestTabDescription"></span> - <a i18n-content="learnMore" i18n-values=".href:learnMoreLink"></a> + <span>$i18n{guestTabDescription}</span> + <a href="$i18nRaw{learnMoreLink}">$i18n{learnMore}</a> </p> </div> </body> @@ -36,4 +36,3 @@ } </script> </html> -
diff --git a/chrome/browser/resources/chromeos/input_method/google_xkb_manifest.json b/chrome/browser/resources/chromeos/input_method/google_xkb_manifest.json index c9c720f..ed509c9 100644 --- a/chrome/browser/resources/chromeos/input_method/google_xkb_manifest.json +++ b/chrome/browser/resources/chromeos/input_method/google_xkb_manifest.json
@@ -115,6 +115,22 @@ "options_page": "hmm_options.html?code=xkb:us:intl:eng" }, { + "name": "__MSG_keyboard_us_international_pc__", + "type": "ime", + "id": "xkb:us:intl_pc:eng", + "indicator": "INTL", + "description": "", + "language": [ + "en", + "en-US" + ], + "layouts": [ + "us(intl_pc)" + ], + "input_view": "inputview.html#id=us-intl&language=en-US&passwordLayout=us-intl&name=keyboard_us_international_pc", + "options_page": "hmm_options.html?code=xkb:us:intl_pc:eng" + }, + { "name": "__MSG_keyboard_netherlands__", "type": "ime", "id": "xkb:us:intl:nld", @@ -130,6 +146,21 @@ "options_page": "hmm_options.html?code=xkb:us:intl:nld" }, { + "name": "__MSG_keyboard_us_international_pc__", + "type": "ime", + "id": "xkb:us:intl_pc:nld", + "indicator": "NLD", + "description": "", + "language": [ + "nl" + ], + "layouts": [ + "us(intl_pc)" + ], + "input_view": "inputview.html#id=us-intl&language=nl&passwordLayout=us-intl&name=keyboard_us_international_pc", + "options_page": "hmm_options.html?code=xkb:us:intl_pc:nld" + }, + { "name": "__MSG_keyboard_us_international__", "type": "ime", "id": "xkb:us:intl:por", @@ -145,6 +176,21 @@ "options_page": "hmm_options.html?code=xkb:us:intl:por" }, { + "name": "__MSG_keyboard_us_international_pc__", + "type": "ime", + "id": "xkb:us:intl_pc:por", + "indicator": "INTL", + "description": "", + "language": [ + "pt-BR" + ], + "layouts": [ + "us(intl_pc)" + ], + "input_view": "inputview.html#id=us-intl&language=pt-BR&passwordLayout=us-intl&name=keyboard_us_international_pc", + "options_page": "hmm_options.html?code=xkb:us:intl_pc:por" + }, + { "name": "__MSG_keyboard_us_extended__", "type": "ime", "id": "xkb:us:altgr-intl:eng",
diff --git a/chrome/browser/resources/md_bookmarks/app.html b/chrome/browser/resources/md_bookmarks/app.html index df448d36..7d01735c 100644 --- a/chrome/browser/resources/md_bookmarks/app.html +++ b/chrome/browser/resources/md_bookmarks/app.html
@@ -69,7 +69,7 @@ </style> <bookmarks-toolbar sidebar-width="[[sidebarWidth_]]"></bookmarks-toolbar> <div id="main-container"> - <div id="sidebar"> + <div id="sidebar" role="tree"> <bookmarks-folder-node item-id="0" depth="-1"></bookmarks-folder-node> </div> <div id="splitter"></div>
diff --git a/chrome/browser/resources/md_bookmarks/bookmarks.html b/chrome/browser/resources/md_bookmarks/bookmarks.html index 685fb57..bc725be 100644 --- a/chrome/browser/resources/md_bookmarks/bookmarks.html +++ b/chrome/browser/resources/md_bookmarks/bookmarks.html
@@ -11,6 +11,7 @@ background: var(--md-background-color); height: 100%; margin: 0; + overflow: hidden; } </style> </head>
diff --git a/chrome/browser/resources/md_bookmarks/command_manager.html b/chrome/browser/resources/md_bookmarks/command_manager.html index 49cd2a9c..2586135 100644 --- a/chrome/browser/resources/md_bookmarks/command_manager.html +++ b/chrome/browser/resources/md_bookmarks/command_manager.html
@@ -28,13 +28,14 @@ } </style> <template is="cr-lazy-render" id="dropdown"> - <dialog is="cr-action-menu" on-mousedown="onMenuMousedown_"> + <dialog is="cr-action-menu" on-mousedown="onMenuMousedown_" role="menu"> <template is="dom-repeat" items="[[menuCommands_]]" as="command"> <button class="dropdown-item" command$="[[command]]" hidden$="[[!isCommandVisible_(command, menuIds_)]]" disabled$="[[!isCommandEnabled_(command, menuIds_)]]" - on-click="onCommandClick_"> + on-click="onCommandClick_" + role="menuitem"> <span class="label"> [[getCommandLabel_(command, menuIds_)]] </span>
diff --git a/chrome/browser/resources/md_bookmarks/command_manager.js b/chrome/browser/resources/md_bookmarks/command_manager.js index f0b37bf..fefe8a6 100644 --- a/chrome/browser/resources/md_bookmarks/command_manager.js +++ b/chrome/browser/resources/md_bookmarks/command_manager.js
@@ -22,7 +22,7 @@ value: function() { return [ Command.EDIT, - Command.COPY, + Command.COPY_URL, Command.DELETE, // <hr> Command.OPEN_NEW_TAB, @@ -78,7 +78,6 @@ this.shortcuts_ = {}; this.addShortcut_(Command.EDIT, 'F2', 'Enter'); - this.addShortcut_(Command.COPY, 'Ctrl|c', 'Meta|c'); this.addShortcut_(Command.DELETE, 'Delete', 'Delete Backspace'); this.addShortcut_(Command.OPEN, 'Enter', 'Meta|ArrowDown Meta|o'); @@ -90,6 +89,10 @@ this.addShortcut_(Command.SELECT_ALL, 'Ctrl|a', 'Meta|a'); this.addShortcut_(Command.DESELECT_ALL, 'Escape'); + + this.addShortcut_(Command.CUT, 'Ctrl|x', 'Meta|x'); + this.addShortcut_(Command.COPY, 'Ctrl|c', 'Meta|c'); + this.addShortcut_(Command.PASTE, 'Ctrl|v', 'Meta|v'); }, detached: function() { @@ -155,6 +158,7 @@ * @return {boolean} */ canExecute: function(command, itemIds) { + var state = this.getState(); switch (command) { case Command.OPEN: return itemIds.size > 0; @@ -164,6 +168,16 @@ case Command.SELECT_ALL: case Command.DESELECT_ALL: return true; + case Command.COPY: + return itemIds.size > 0; + case Command.CUT: + return itemIds.size > 0 && + !this.containsMatchingNode_(itemIds, function(node) { + return !bookmarks.util.canEditNode(state, node.id); + }); + case Command.PASTE: + return state.search.term == '' && + bookmarks.util.canReorderChildren(state, state.selectedFolder); default: return this.isCommandVisible_(command, itemIds) && this.isCommandEnabled_(command, itemIds); @@ -180,7 +194,7 @@ switch (command) { case Command.EDIT: return itemIds.size == 1 && this.globalCanEdit_; - case Command.COPY: + case Command.COPY_URL: return this.isSingleBookmark_(itemIds); case Command.DELETE: return itemIds.size > 0 && this.globalCanEdit_; @@ -231,12 +245,22 @@ /** @type {!BookmarksEditDialogElement} */ (this.$.editDialog.get()) .showEditDialog(state.nodes[id]); break; + case Command.COPY_URL: case Command.COPY: var idList = Array.from(itemIds); chrome.bookmarkManagerPrivate.copy(idList, function() { - bookmarks.ToastManager.getInstance().show( - loadTimeData.getString('toastUrlCopied'), false); - }); + var labelPromise; + if (command == Command.COPY_URL) { + labelPromise = + Promise.resolve(loadTimeData.getString('toastUrlCopied')); + } else { + labelPromise = cr.sendWithPromise( + 'getPluralString', 'toastItemsCopied', idList.length); + } + + this.showTitleToast_( + labelPromise, state.nodes[idList[0]].title, false); + }.bind(this)); break; case Command.DELETE: var idList = Array.from(this.minimizeDeletionSet_(itemIds)); @@ -244,16 +268,7 @@ var labelPromise = cr.sendWithPromise( 'getPluralString', 'toastItemsDeleted', idList.length); chrome.bookmarkManagerPrivate.removeTrees(idList, function() { - labelPromise.then(function(label) { - var pieces = loadTimeData.getSubstitutedStringPieces(label, title) - .map(function(p) { - // Make the bookmark name collapsible. - p.collapsible = !!p.arg; - return p; - }); - bookmarks.ToastManager.getInstance().showForStringPieces( - pieces, true); - }.bind(this)); + this.showTitleToast_(labelPromise, title, true); }.bind(this)); break; case Command.UNDO: @@ -288,6 +303,15 @@ case Command.DESELECT_ALL: this.dispatch(bookmarks.actions.deselectItems()); break; + case Command.CUT: + chrome.bookmarkManagerPrivate.cut(Array.from(itemIds)); + break; + case Command.PASTE: + var selectedFolder = state.selectedFolder; + var selectedItems = state.selection.items; + chrome.bookmarkManagerPrivate.paste( + selectedFolder, Array.from(selectedItems)); + break; default: assert(false); } @@ -453,63 +477,6 @@ }, /** - * @param {Event} e - * @private - */ - onOpenItemMenu_: function(e) { - if (e.detail.targetElement) { - this.openCommandMenuAtElement(e.detail.targetElement); - } else { - this.openCommandMenuAtPosition(e.detail.x, e.detail.y); - } - }, - - /** - * @param {Event} e - * @private - */ - onCommandClick_: function(e) { - this.handle( - e.currentTarget.getAttribute('command'), assert(this.menuIds_)); - this.closeCommandMenu(); - }, - - /** - * @param {!Event} e - * @private - */ - onKeydown_: function(e) { - var selection = this.getState().selection.items; - if (e.target == document.body) - this.handleKeyEvent(e, selection); - }, - - /** - * Close the menu on mousedown so clicks can propagate to the underlying UI. - * This allows the user to right click the list while a context menu is - * showing and get another context menu. - * @param {Event} e - * @private - */ - onMenuMousedown_: function(e) { - if (e.path[0] != this.$.dropdown.getIfExists()) - return; - - this.closeCommandMenu(); - }, - - /** @private */ - onOpenCancelTap_: function() { - this.$.openDialog.get().cancel(); - }, - - /** @private */ - onOpenConfirmTap_: function() { - this.confirmOpenCallback_(); - this.$.openDialog.get().close(); - }, - - /** * @param {Command} command * @return {string} * @private @@ -529,7 +496,7 @@ var itemUrl = this.getState().nodes[id].url; label = itemUrl ? 'menuEdit' : 'menuRename'; break; - case Command.COPY: + case Command.COPY_URL: label = 'menuCopyURL'; break; case Command.DELETE: @@ -587,6 +554,89 @@ return command == Command.DELETE && (this.globalCanEdit_ || this.isSingleBookmark_(itemIds)); }, + + /** + * Show a toast with a bookmark |title| inserted into a label, with the + * title ellipsised if necessary. + * @param {!Promise<string>} labelPromise Promise which resolves with the + * label for the toast. + * @param {string} title Bookmark title to insert. + * @param {boolean} canUndo If true, shows an undo button in the toast. + * @private + */ + showTitleToast_: function(labelPromise, title, canUndo) { + labelPromise.then(function(label) { + var pieces = loadTimeData.getSubstitutedStringPieces(label, title) + .map(function(p) { + // Make the bookmark name collapsible. + p.collapsible = !!p.arg; + return p; + }); + + bookmarks.ToastManager.getInstance().showForStringPieces( + pieces, canUndo); + }); + }, + + //////////////////////////////////////////////////////////////////////////// + // Event handlers: + + /** + * @param {Event} e + * @private + */ + onOpenItemMenu_: function(e) { + if (e.detail.targetElement) { + this.openCommandMenuAtElement(e.detail.targetElement); + } else { + this.openCommandMenuAtPosition(e.detail.x, e.detail.y); + } + }, + + /** + * @param {Event} e + * @private + */ + onCommandClick_: function(e) { + this.handle( + e.currentTarget.getAttribute('command'), assert(this.menuIds_)); + this.closeCommandMenu(); + }, + + /** + * @param {!Event} e + * @private + */ + onKeydown_: function(e) { + var selection = this.getState().selection.items; + if (e.target == document.body) + this.handleKeyEvent(e, selection); + }, + + /** + * Close the menu on mousedown so clicks can propagate to the underlying UI. + * This allows the user to right click the list while a context menu is + * showing and get another context menu. + * @param {Event} e + * @private + */ + onMenuMousedown_: function(e) { + if (e.path[0] != this.$.dropdown.getIfExists()) + return; + + this.closeCommandMenu(); + }, + + /** @private */ + onOpenCancelTap_: function() { + this.$.openDialog.get().cancel(); + }, + + /** @private */ + onOpenConfirmTap_: function() { + this.confirmOpenCallback_(); + this.$.openDialog.get().close(); + }, }); /** @private {bookmarks.CommandManager} */
diff --git a/chrome/browser/resources/md_bookmarks/compiled_resources2.gyp b/chrome/browser/resources/md_bookmarks/compiled_resources2.gyp index a22067e6..6891e10b 100644 --- a/chrome/browser/resources/md_bookmarks/compiled_resources2.gyp +++ b/chrome/browser/resources/md_bookmarks/compiled_resources2.gyp
@@ -67,14 +67,25 @@ 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, { + 'target_name': 'dnd_chip', + 'dependencies': [ + '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', + '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:icon', + 'types', + ], + 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], + }, + { 'target_name': 'dnd_manager', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(EXTERNS_GYP):bookmark_manager_private', '<(EXTERNS_GYP):metrics_private', + 'dnd_chip', 'store', 'timer_proxy', 'types', + 'util', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'] }, @@ -181,6 +192,7 @@ 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data', + '<(DEPTH)/third_party/polymer/v1_0/components-chromium/iron-a11y-announcer/compiled_resources2.gyp:iron-a11y-announcer-extracted', '<(DEPTH)/third_party/polymer/v1_0/components-chromium/paper-button/compiled_resources2.gyp:paper-button-extracted', 'timer_proxy', ],
diff --git a/chrome/browser/resources/md_bookmarks/constants.js b/chrome/browser/resources/md_bookmarks/constants.js index b94bcf08..b3e0429c 100644 --- a/chrome/browser/resources/md_bookmarks/constants.js +++ b/chrome/browser/resources/md_bookmarks/constants.js
@@ -21,7 +21,7 @@ */ var Command = { EDIT: 'edit', - COPY: 'copy', + COPY_URL: 'copy-url', DELETE: 'delete', OPEN_NEW_TAB: 'open-new-tab', OPEN_NEW_WINDOW: 'open-new-window', @@ -32,6 +32,9 @@ OPEN: 'open', SELECT_ALL: 'select-all', DESELECT_ALL: 'deselect-all', + COPY: 'copy', + CUT: 'cut', + PASTE: 'paste', }; /**
diff --git a/chrome/browser/resources/md_bookmarks/dnd_chip.html b/chrome/browser/resources/md_bookmarks/dnd_chip.html new file mode 100644 index 0000000..9703e16 --- /dev/null +++ b/chrome/browser/resources/md_bookmarks/dnd_chip.html
@@ -0,0 +1,70 @@ +<link rel="import" href="chrome://resources/html/polymer.html"> + +<link rel="import" href="chrome://resources/cr_elements/icons.html"> +<link rel="import" href="chrome://resources/html/icon.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> +<link rel="import" href="chrome://bookmarks/shared_style.html"> + +<dom-module id="bookmarks-dnd-chip"> + <template> + <style include="shared-style"> + :host { + align-items: center; + background-color: var(--interactive-color); + border-radius: 20px; + box-shadow: 0 0 8px 0 rgba(0,0,0,0.12), 0 8px 8px 0 rgba(0,0,0,0.24); + display: none; + height: 40px; + left: 0; + padding: 0 20px; + pointer-events: none; + position: absolute; + top: 0; + transform: translate( + calc(var(--mouse-x) - 50%), calc(var(--mouse-y) - 80%)); + width: 132px; + } + + :host([showing_]) { + display: flex; + } + + #title { + -webkit-margin-start: 20px; + color: white; + flex: 1; + font-weight: 500; + overflow: hidden; + text-decoration: none; + text-overflow: ellipsis; + white-space: nowrap; + } + + #icon-wrapper { + align-items: center; + background: white; + border-radius: 12px; + color: var(--secondary-text-color); + display: flex; + height: 24px; + justify-content: center; + position: relative; + width: 24px; + } + + #icon { + background-repeat: no-repeat; + height: 16px; + margin: 2px; + width: 16px; + } + </style> + <div id="icon-wrapper"> + <iron-icon id="folder-icon" icon="cr:folder" hidden$="[[!isFolder_]]"> + </iron-icon> + <div id="icon" hidden$="[[isFolder_]]"></div> + </div> + <div id="title"></div> + </template> + <script src="chrome://bookmarks/dnd_chip.js"></script> +<dom-module>
diff --git a/chrome/browser/resources/md_bookmarks/dnd_chip.js b/chrome/browser/resources/md_bookmarks/dnd_chip.js new file mode 100644 index 0000000..41bd942 --- /dev/null +++ b/chrome/browser/resources/md_bookmarks/dnd_chip.js
@@ -0,0 +1,44 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +Polymer({ + is: 'bookmarks-dnd-chip', + + properties: { + /** @private */ + showing_: { + type: Boolean, + reflectToAttribute: true, + }, + + /** @private */ + isFolder_: Boolean, + }, + + /** + * @param {number} x + * @param {number} y + * @param {!Array<BookmarkNode>} items + */ + showForItems: function(x, y, items) { + this.style.setProperty('--mouse-x', x + 'px'); + this.style.setProperty('--mouse-y', y + 'px'); + + if (this.showing_) + return; + + var firstItem = items[0]; + this.isFolder_ = !firstItem.url; + // TODO(calamity): handle multi-item UI. + if (firstItem.url) + this.$.icon.style.backgroundImage = cr.icon.getFavicon(firstItem.url); + + this.$.title.textContent = firstItem.title; + this.showing_ = true; + }, + + hide: function() { + this.showing_ = false; + }, +});
diff --git a/chrome/browser/resources/md_bookmarks/dnd_manager.html b/chrome/browser/resources/md_bookmarks/dnd_manager.html index a41e2cb..dc6db92b 100644 --- a/chrome/browser/resources/md_bookmarks/dnd_manager.html +++ b/chrome/browser/resources/md_bookmarks/dnd_manager.html
@@ -1,3 +1,4 @@ <link rel="import" href="chrome://bookmarks/constants.html"> +<link rel="import" href="chrome://bookmarks/dnd_chip.html"> <link rel="import" href="chrome://bookmarks/timer_proxy.html"> <script src="chrome://bookmarks/dnd_manager.js"></script>
diff --git a/chrome/browser/resources/md_bookmarks/dnd_manager.js b/chrome/browser/resources/md_bookmarks/dnd_manager.js index 309bd95..587a4523 100644 --- a/chrome/browser/resources/md_bookmarks/dnd_manager.js +++ b/chrome/browser/resources/md_bookmarks/dnd_manager.js
@@ -289,6 +289,12 @@ * @private {bookmarks.TimerProxy} */ this.timerProxy_ = new bookmarks.TimerProxy(); + + /** + * The bookmark drag and drop indicator chip. + * @private {BookmarksDndChipElement} + */ + this.chip_ = null; } DNDManager.prototype = { @@ -319,6 +325,9 @@ }, destroy: function() { + if (this.chip_ && this.chip_.parentElement) + document.body.removeChild(this.chip_); + for (var event in this.documentListeners_) document.removeEventListener(event, this.documentListeners_[event]); }, @@ -384,6 +393,8 @@ /** @private */ clearDragData_: function() { + this.dndChip.hide(); + // Defer the clearing of the data so that the bookmark manager API's drop // event doesn't clear the drop data before the web drop event has a // chance to execute (on Mac). @@ -478,6 +489,12 @@ if (!this.dragInfo_.isDragValid()) return; + this.dndChip.showForItems( + e.clientX, e.clientY, + this.dragInfo_.dragData.elements.map(function(x) { + return bookmarks.util.normalizeNode(x); + })); + var overElement = getBookmarkElement(e.path); this.autoExpander_.update(e, overElement); if (!overElement) @@ -643,7 +660,19 @@ setTimerProxyForTesting: function(timerProxy) { this.timerProxy_ = timerProxy; this.dropIndicator_.timerProxy = timerProxy; - } + }, + + /** @return {BookmarksDndChipElement} */ + get dndChip() { + if (!this.chip_) { + this.chip_ = + /** @type {BookmarksDndChipElement} */ ( + document.createElement('bookmarks-dnd-chip')); + document.body.appendChild(this.chip_); + } + + return this.chip_; + }, }; return {
diff --git a/chrome/browser/resources/md_bookmarks/folder_node.html b/chrome/browser/resources/md_bookmarks/folder_node.html index deb4b1c..e72f981d 100644 --- a/chrome/browser/resources/md_bookmarks/folder_node.html +++ b/chrome/browser/resources/md_bookmarks/folder_node.html
@@ -86,8 +86,9 @@ on-tap="selectFolder_" on-contextmenu="onContextMenu_" tabindex$="[[getTabIndex_(isSelectedFolder_)]]" - hidden="[[isRootFolder_(depth)]]"> - <template is="dom-if" if="[[hasChildFolder_(item_.children)]]"> + hidden="[[isRootFolder_(depth)]]" + role="treeitem"> + <template is="dom-if" if="[[hasChildFolder_]]"> <button is="paper-icon-button-light" id="arrow" on-tap="toggleFolder_" on-mousedown="preventDefault_" tabindex="-1"> <iron-icon icon="cr:arrow-drop-down" is-open$="[[!isClosed_]]"> @@ -96,12 +97,12 @@ </template> <div id="folder-label" class="v-centered"> <iron-icon icon="[[getFolderIcon_(isSelectedFolder_)]]" - no-children$="[[!hasChildFolder_(item_.children)]]"> + no-children$="[[!hasChildFolder_]]"> </iron-icon> <div class="menu-label">[[item_.title]]</div> </div> </div> - <div id="descendants" hidden$="[[isClosed_]]"> + <div id="descendants" hidden$="[[isClosed_]]" role="group"> <template is="dom-repeat" items="[[item_.children]]" as="child"
diff --git a/chrome/browser/resources/md_bookmarks/folder_node.js b/chrome/browser/resources/md_bookmarks/folder_node.js index c6885ce..31a3a85 100644 --- a/chrome/browser/resources/md_bookmarks/folder_node.js +++ b/chrome/browser/resources/md_bookmarks/folder_node.js
@@ -40,12 +40,22 @@ reflectToAttribute: true, computed: 'computeIsSelected_(itemId, selectedFolder_, searchActive_)' }, + + /** @private */ + hasChildFolder_: { + type: Boolean, + computed: 'computeHasChildFolder_(item_.children)', + }, }, listeners: { 'keydown': 'onKeydown_', }, + observers: [ + 'updateAriaExpanded_(hasChildFolder_, isClosed_)', + ], + /** @override */ attached: function() { this.watch('item_', function(state) { @@ -135,7 +145,7 @@ if (xDirection == 1) { // The right arrow opens a folder if closed and goes to the first child // otherwise. - if (this.hasChildFolder_()) { + if (this.hasChildFolder_) { if (this.isClosed_) { this.dispatch( bookmarks.actions.changeFolderOpen(this.item_.id, true)); @@ -146,7 +156,7 @@ } else if (xDirection == -1) { // The left arrow closes a folder if open and goes to the parent // otherwise. - if (this.hasChildFolder_() && !this.isClosed_) { + if (this.hasChildFolder_ && !this.isClosed_) { this.dispatch(bookmarks.actions.changeFolderOpen(this.item_.id, false)); } else { var parentFolderNode = this.getParentFolderNode_(); @@ -317,13 +327,15 @@ * @private * @return {boolean} */ - hasChildFolder_: function() { + computeHasChildFolder_: function() { return bookmarks.util.hasChildFolders(this.itemId, this.getState().nodes); }, /** @private */ depthChanged_: function() { this.style.setProperty('--node-depth', String(this.depth)); + if (this.depth == -1) + this.$.descendants.removeAttribute('role'); }, /** @@ -358,4 +370,18 @@ getTabIndex_: function() { return this.isSelectedFolder_ ? '0' : '-1'; }, + + /** + * Sets the 'aria-expanded' accessibility on nodes which need it. Note that + * aria-expanded="false" is different to having the attribute be undefined. + * @param {boolean} hasChildFolder + * @param {boolean} isClosed + * @private + */ + updateAriaExpanded_: function(hasChildFolder, isClosed) { + if (hasChildFolder) + this.getFocusTarget().setAttribute('aria-expanded', String(!isClosed)); + else + this.getFocusTarget().removeAttribute('aria-expanded'); + }, });
diff --git a/chrome/browser/resources/md_bookmarks/item.html b/chrome/browser/resources/md_bookmarks/item.html index a5a776fe..2ce033d 100644 --- a/chrome/browser/resources/md_bookmarks/item.html +++ b/chrome/browser/resources/md_bookmarks/item.html
@@ -68,9 +68,13 @@ <div id="website-title"> [[item_.title]] </div> - <button is="paper-icon-button-light" class="more-vert-button" - on-click="onMenuButtonClick_" on-dblclick="onMenuButtonDblClick_" - tabindex$="[[ironListTabIndex]]" on-focus="clearMouseFocus"> + <button is="paper-icon-button-light" + class="more-vert-button" + tabindex$="[[ironListTabIndex]]" + title="$i18n{moreActionsButtonTitle}" + on-click="onMenuButtonClick_" + on-dblclick="onMenuButtonDblClick_" + on-focus="clearMouseFocus"> <div></div> <div></div> <div></div>
diff --git a/chrome/browser/resources/md_bookmarks/item.js b/chrome/browser/resources/md_bookmarks/item.js index 06b29a68..7f0466f3 100644 --- a/chrome/browser/resources/md_bookmarks/item.js +++ b/chrome/browser/resources/md_bookmarks/item.js
@@ -34,6 +34,10 @@ isFolder_: Boolean, }, + hostAttributes: { + 'role': 'listitem', + }, + observers: [ 'updateFavicon_(item_.url)', ], @@ -118,6 +122,7 @@ /** @private */ onItemChanged_: function() { this.isFolder_ = !this.item_.url; + this.setAttribute('aria-label', this.item_.title); }, /**
diff --git a/chrome/browser/resources/md_bookmarks/list.html b/chrome/browser/resources/md_bookmarks/list.html index 94b5b308..ae6ee5e 100644 --- a/chrome/browser/resources/md_bookmarks/list.html +++ b/chrome/browser/resources/md_bookmarks/list.html
@@ -39,7 +39,7 @@ } </style> <iron-list items="[[displayedList_]]" id="bookmarksCard" - hidden$="[[isEmptyList_(displayedList_.length)]]"> + hidden$="[[isEmptyList_(displayedList_.length)]]" role="list"> <template> <bookmarks-item item-id="[[item.id]]" draggable="true" tabindex$="[[tabIndex]]" iron-list-tab-index="[[tabIndex]]">
diff --git a/chrome/browser/resources/md_bookmarks/toast_manager.html b/chrome/browser/resources/md_bookmarks/toast_manager.html index 4a15865..cb30e220 100644 --- a/chrome/browser/resources/md_bookmarks/toast_manager.html +++ b/chrome/browser/resources/md_bookmarks/toast_manager.html
@@ -1,5 +1,5 @@ <link rel="import" href="chrome://resources/html/polymer.html"> - +<link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-announcer/iron-a11y-announcer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://bookmarks/shared_style.html"> @@ -9,17 +9,17 @@ #content { display: flex; flex: 1; - margin-right: 32px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } paper-button { + -webkit-margin-end: 0; + -webkit-margin-start: 32px; color: var(--google-blue-300); font-weight: 500; height: 32px; - margin: 0; min-width: 52px; padding: 8px; } @@ -54,12 +54,12 @@ white-space: nowrap; } - :host([open_]) #toast { + #toast[aria-hidden=false] { opacity: 1; transform: translateY(0); } </style> - <div id="toast" aria-live="polite"> + <div id="toast"> <div id="content"></div> <paper-button id="button" hidden$="[[!showUndo_]]" on-tap="onUndoTap_"> $i18n{undo}
diff --git a/chrome/browser/resources/md_bookmarks/toast_manager.js b/chrome/browser/resources/md_bookmarks/toast_manager.js index 642ce382..3692b5f 100644 --- a/chrome/browser/resources/md_bookmarks/toast_manager.js +++ b/chrome/browser/resources/md_bookmarks/toast_manager.js
@@ -19,7 +19,8 @@ /** @private */ open_: { type: Boolean, - reflectToAttribute: true, + observer: 'openChanged_', + value: false, }, /** @private */ @@ -36,6 +37,9 @@ attached: function() { assert(ToastManager.instance_ == null); ToastManager.instance_ = this; + Polymer.RenderStatus.afterNextRender(this, function() { + Polymer.IronA11yAnnouncer.requestAvailability(); + }); }, /** @override */ @@ -82,6 +86,7 @@ showInternal_: function(showUndo) { this.open_ = true; this.showUndo_ = showUndo; + this.fire('iron-announce', {text: this.$.content.textContent}); if (!this.duration) return; @@ -90,13 +95,15 @@ this.timerProxy_.clearTimeout(this.hideTimeoutId_); this.hideTimeoutId_ = this.timerProxy_.setTimeout(function() { - this.open_ = false; + this.hide(); this.hideTimeoutId_ = null; }.bind(this), this.duration); }, hide: function() { this.open_ = false; + // Hide the undo button to prevent it from being accessed with tab. + this.showUndo_ = false; }, /** @private */ @@ -104,6 +111,11 @@ // Will hide the toast. this.fire('command-undo'); }, + + /** @private */ + openChanged_: function() { + this.$.toast.setAttribute('aria-hidden', String(!this.open_)); + }, }); /** @private {?bookmarks.ToastManager} */
diff --git a/chrome/browser/resources/md_bookmarks/toolbar.html b/chrome/browser/resources/md_bookmarks/toolbar.html index 529b3bd..9f077ac 100644 --- a/chrome/browser/resources/md_bookmarks/toolbar.html +++ b/chrome/browser/resources/md_bookmarks/toolbar.html
@@ -55,6 +55,7 @@ <button is="paper-icon-button-light" id="menuButton" class="more-actions more-vert-button" + title="$i18n{organizeButtonTitle}" on-tap="onMenuButtonOpenTap_"> <div></div> <div></div> @@ -62,26 +63,38 @@ </button> </cr-toolbar> <template is="cr-lazy-render" id="dropdown"> - <dialog is="cr-action-menu"> - <button class="dropdown-item" on-tap="onSortTap_" - disabled="[[!canChangeList_]]"> + <dialog is="cr-action-menu" role="menu"> + <button class="dropdown-item" + on-tap="onSortTap_" + disabled="[[!canChangeList_]]" + role="menuitem"> $i18n{menuSort} </button> <hr> - <button id="addBookmarkButton" class="dropdown-item" - on-tap="onAddBookmarkTap_" disabled="[[!canChangeList_]]"> + <button id="addBookmarkButton" + class="dropdown-item" + on-tap="onAddBookmarkTap_" + disabled="[[!canChangeList_]]" + role="menuitem"> $i18n{menuAddBookmark} </button> - <button class="dropdown-item" on-tap="onAddFolderTap_" - disabled="[[!canChangeList_]]"> + <button class="dropdown-item" + on-tap="onAddFolderTap_" + disabled="[[!canChangeList_]]" + role="menuitem"> $i18n{menuAddFolder} </button> <hr> - <button id="importBookmarkButton" class="dropdown-item" - on-tap="onImportTap_" disabled="[[!globalCanEdit_]]"> + <button id="importBookmarkButton" + class="dropdown-item" + on-tap="onImportTap_" + disabled="[[!globalCanEdit_]]" + role="menuitem"> $i18n{menuImport} </button> - <button class="dropdown-item" on-tap="onExportTap_"> + <button class="dropdown-item" + on-tap="onExportTap_" + role="menuitem"> $i18n{menuExport} </button> </dialog>
diff --git a/chrome/browser/resources/md_user_manager/create_profile.html b/chrome/browser/resources/md_user_manager/create_profile.html index dc5ffb7..b098070 100644 --- a/chrome/browser/resources/md_user_manager/create_profile.html +++ b/chrome/browser/resources/md_user_manager/create_profile.html
@@ -154,7 +154,7 @@ hidden="[[!isProfileShortcutsEnabled_]]"> $i18n{createDesktopShortcutLabel} </paper-checkbox> - <template is="dom-if" if="[[!isForceSigninEnabled_]]"> + <template is="dom-if" if="[[isSupervisedUserCreationEnabled_]]"> <paper-checkbox id="makeSupervisedCheckbox" checked="{{isSupervised_}}"> $i18n{manageProfilesSupervisedSignedInLabel} </paper-checkbox>
diff --git a/chrome/browser/resources/md_user_manager/create_profile.js b/chrome/browser/resources/md_user_manager/create_profile.js index cc5a0c3f..59deaa4 100644 --- a/chrome/browser/resources/md_user_manager/create_profile.js +++ b/chrome/browser/resources/md_user_manager/create_profile.js
@@ -123,6 +123,18 @@ value: function() { return loadTimeData.getBoolean('isForceSigninEnabled'); }, + }, + + /** + * True if Supervised User creation is enabled. + * @private {boolean} + */ + isSupervisedUserCreationEnabled_: { + type: Boolean, + value: function() { + return loadTimeData.getBoolean('isSupervisedUserCreationEnabled') && + !loadTimeData.getBoolean('isForceSigninEnabled'); + }, } },
diff --git a/chrome/browser/resources/media_router/icons/media_router_icons.html b/chrome/browser/resources/media_router/icons/media_router_icons.html index ff93aca7..9cdf533 100644 --- a/chrome/browser/resources/media_router/icons/media_router_icons.html +++ b/chrome/browser/resources/media_router/icons/media_router_icons.html
@@ -11,7 +11,7 @@ <g id="arrow-forward"><path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"></path></g> <g id="close"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path></g> <g id="error-outline"><path d="M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></g> - <g id="folder"><path d="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"></path></g> + <g id="folder"><path d="M0 0h24v24H0z" fill="none"></path><path d="M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"></path></g> <g id="search"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path></g> <g id="tab"><path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h10v4h8v10z"></path></g>
diff --git a/chrome/browser/resources/ntp4/new_tab.html b/chrome/browser/resources/ntp4/new_tab.html index 513b4d2..1a643280 100644 --- a/chrome/browser/resources/ntp4/new_tab.html +++ b/chrome/browser/resources/ntp4/new_tab.html
@@ -1,10 +1,9 @@ <!doctype html> -<html class="starting-up" i18n-values="dir:textdirection; - bookmarkbarattached:bookmarkbarattached; - lang:language"> +<html class="starting-up" dir="$i18n{textdirection}" + bookmarkbarattached="$i18n{bookmarkbarattached}" lang="$i18n{language}"> <head> <meta charset="utf-8"> -<title i18n-content="title"></title> +<title>$i18n{title}</title> <!-- Don't scale the viewport in either portrait or landscape mode. Note that this means apps will be reflowed when rotated (like iPad). If we wanted to maintain position we could remove 'maximum-scale' so @@ -74,16 +73,16 @@ tabindex="2" hidden>› </button> <div id="attribution"> - <span i18n-content="attributionintro"></span> + <span>$i18n{attributionintro}</span> <img id="attribution-img"> </div> </div> <div id="app-launcher-promo" hidden> - <div class="apps-promo-text" i18n-content="appsPromoTitle"></div> + <div class="apps-promo-text">$i18n{appsPromoTitle}</div> <a href="https://chrome.google.com/webstore/launcher" - id="apps-promo-learn-more" class="apps-promo-learn-more" - i18n-content="learn_more"> + id="apps-promo-learn-more" class="apps-promo-learn-more"> + $i18n{learn_more} </a> <img src="app_launcher_promo.png"> <button class="close-button custom-appearance" @@ -103,15 +102,14 @@ <div id="footer-menu-container" class="menu-container"> <a id="chrome-web-store-link"> - <span id="chrome-web-store-title" i18n-content="webStoreTitleShort"> - </span> + <span id="chrome-web-store-title">$i18n{webStoreTitleShort}</span> </a> </div> <div id="trash" class="trash"> <span class="lid"></span> <span class="can"></span> - <span class="trash-text" i18n-content="appuninstall"></span> + <span class="trash-text">$i18n{appuninstall}</span> </div> </div> </div> @@ -130,17 +128,17 @@ <!-- Login status bubble --> <div id="login-status-bubble-contents"> <div id="login-status-message-container"> - <span i18n-content="login_status_message"></span> - <a id="login-status-learn-more" i18n-content="learn_more" - i18n-values="href:login_status_url" target="_blank"></a> + <span>$i18n{login_status_message}</span> + <a id="login-status-learn-more" href="$i18nRaw{login_status_url}" + target="_blank">$i18n{learn_more}</a> </div> <div class="login-status-row"> <div id="login-status-advanced-container"> - <a is="action-link" id="login-status-advanced" - i18n-content="login_status_advanced"></a> + <a is="action-link" id="login-status-advanced"> + $i18n{login_status_advanced} + </a> </div> - <button id="login-status-dismiss" i18n-content="login_status_dismiss"> - </button> + <button id="login-status-dismiss">$i18n{login_status_dismiss}</button> </div> </div>
diff --git a/chrome/browser/resources/settings/device_page/night_light_slider.html b/chrome/browser/resources/settings/device_page/night_light_slider.html index 45b09a2..48bb584 100644 --- a/chrome/browser/resources/settings/device_page/night_light_slider.html +++ b/chrome/browser/resources/settings/device_page/night_light_slider.html
@@ -54,8 +54,12 @@ z-index: 3; } + .knob-inner:focus { + outline: none; + } + .expanded-knob { - transform: scale(1.5); + transform: scale(1.25); z-index: 3; } @@ -74,7 +78,7 @@ } #labelContainer { - height: 2em; + height: 1.75em; } .label { @@ -87,6 +91,7 @@ margin-left: -2.5em; position: absolute; text-align: center; + transition: margin-top 200ms cubic-bezier(0, 0, 0.2, 1); vertical-align: middle; width: 5em; }
diff --git a/chrome/browser/resources/settings/device_page/night_light_slider.js b/chrome/browser/resources/settings/device_page/night_light_slider.js index 8f4a67f..bd5ba0e1 100644 --- a/chrome/browser/resources/settings/device_page/night_light_slider.js +++ b/chrome/browser/resources/settings/device_page/night_light_slider.js
@@ -12,7 +12,7 @@ */ /** @const */ var HOURS_PER_DAY = 24; -/** @const */ var MIN_KNOBS_DISTANCE_MINUTES = 30; +/** @const */ var MIN_KNOBS_DISTANCE_MINUTES = 60; /** @const */ var OFFSET_MINUTES_6PM = 18 * 60; /** @const */ var TOTAL_MINUTES_PER_DAY = 24 * 60; @@ -350,7 +350,9 @@ var endLabel = this.$.endLabel; var distance = Math.abs( parseFloat(startLabel.style.left) - parseFloat(endLabel.style.left)); - if (distance <= startLabel.offsetWidth) { + // Both knobs have the same width, but the one being dragged is scaled up by + // 125%. + if (distance <= (1.25 * startLabel.offsetWidth)) { // Shift the end label up so that it doesn't overlap with the start label. endLabel.classList.add('end-label-overlap'); } else { @@ -389,14 +391,14 @@ if (otherValue > value && ((otherValue - value) < MIN_KNOBS_DISTANCE_MINUTES)) { // We are incrementing the minutes offset moving towards the other knob. - // We have a minimum 30 minutes overlap threshold. Move this knob to the + // We have a minimum 60 minutes overlap threshold. Move this knob to the // other side of the other knob. // // Was: - // ------ (+) --- 29 MIN --- + ------->> + // ------ (+) --- 59 MIN --- + ------->> // // Now: - // ------ + --- 30 MIN --- (+) ------->> + // ------ + --- 60 MIN --- (+) ------->> // // (+) ==> Knob being moved. value = otherValue + MIN_KNOBS_DISTANCE_MINUTES; @@ -421,14 +423,14 @@ if (value > otherValue && ((value - otherValue) < MIN_KNOBS_DISTANCE_MINUTES)) { // We are decrementing the minutes offset moving towards the other knob. - // We have a minimum 30 minutes overlap threshold. Move this knob to the + // We have a minimum 60 minutes overlap threshold. Move this knob to the // other side of the other knob. // // Was: - // <<------ + --- 29 MIN --- (+) ------- + // <<------ + --- 59 MIN --- (+) ------- // // Now: - // <<------ (+) --- 30 MIN --- + ------ + // <<------ (+) --- 60 MIN --- + ------ // // (+) ==> Knob being moved. value = otherValue - MIN_KNOBS_DISTANCE_MINUTES;
diff --git a/chrome/browser/resources/settings/icons.html b/chrome/browser/resources/settings/icons.html index c6f13cc7..c49d8fa 100644 --- a/chrome/browser/resources/settings/icons.html +++ b/chrome/browser/resources/settings/icons.html
@@ -50,9 +50,6 @@ <if expr="not chromeos"> <g id="build"><path d="M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z"></path></g> </if> -<if expr="chromeos"> - <g id="camera-alt"><circle cx="12" cy="12" r="3.2"></circle><path d="M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"></path></g> -</if> <g id="check-circle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"></path></g> <if expr="chromeos"> <g id="chevron-left"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"</path></g>
diff --git a/chrome/browser/resources/settings/page_visibility.js b/chrome/browser/resources/settings/page_visibility.js index 0349d6c..a5d4a1c1 100644 --- a/chrome/browser/resources/settings/page_visibility.js +++ b/chrome/browser/resources/settings/page_visibility.js
@@ -60,7 +60,7 @@ * because polymer only notifies after a property is set. * @type {!GuestModePageVisibility} */ - var pageVisibility = {}; + var pageVisibility; if (loadTimeData.getBoolean('isGuest')) { // "if not chromeos" and "if chromeos" in two completely separate blocks
diff --git a/chrome/browser/resources/settings/people_page/camera.html b/chrome/browser/resources/settings/people_page/camera.html deleted file mode 100644 index 6437e0c..0000000 --- a/chrome/browser/resources/settings/people_page/camera.html +++ /dev/null
@@ -1,87 +0,0 @@ -<link rel="import" href="chrome://resources/html/polymer.html"> - -<link rel="import" href="chrome://resources/html/util.html"> -<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner.html"> -<link rel="import" href="../icons.html"> -<link rel="import" href="../settings_shared_css.html"> - -<dom-module id="settings-camera"> - <template> - <style include="settings-shared"> - #perspectiveBox { - height: 228px; - perspective: 600px; - width: 228px; - } - - #userImageStreamCrop { - height: 228px; - overflow: hidden; - position: relative; - width: 228px; - } - - #userImageStreamCrop.flip-x { - transform: rotateY(180deg); - } - - paper-spinner { - bottom: 0; - left: 0; - margin: auto auto; - position: absolute; - right: 0; - top: 0; - } - - #cameraVideo { - height: 228px; - /* Center image for 4:3 aspect ratio. */ - left: -16.6%; - position: absolute; - } - - #cameraControls { - background-color: var(--paper-grey-800); - border-bottom-left-radius: 2px; - border-bottom-right-radius: 2px; - padding: 8px; - } - - #flipPhoto { - float: right; - } - - :host-context([dir=rtl]) #flipPhoto { - float: left; - } - - #takePhoto { - background-color: var(--paper-green-500); - border-radius: 50%; - display: block; - margin: 0 auto 0 auto; - } - </style> - <div hidden="[[!cameraActive]]"> - <div id="perspectiveBox"> - <div id="userImageStreamCrop"> - <video id="cameraVideo" autoplay hidden="[[!cameraOnline_]]"></video> - <paper-spinner active="[[!cameraOnline_]]"></paper-spinner> - </div> - </div> - <div id="cameraControls"> - <button is="paper-icon-button-light" id="flipPhoto" tabindex="2" - title="$i18n{flipPhoto}" on-tap="onTapFlipPhoto_" - disabled="[[!cameraOnline_]]" class="icon-flip"> - </button> - <button is="paper-icon-button-light" id="takePhoto" tabindex="1" - title="$i18n{takePhoto}" on-tap="takePhoto" - disabled="[[!cameraOnline_]]" class="icon-camera-alt"> - </button> - </div> - </div> - </template> - <script src="camera.js"></script> -</dom-module>
diff --git a/chrome/browser/resources/settings/people_page/camera.js b/chrome/browser/resources/settings/people_page/camera.js deleted file mode 100644 index f8a53b45e..0000000 --- a/chrome/browser/resources/settings/people_page/camera.js +++ /dev/null
@@ -1,207 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/** - * @fileoverview - * 'settings-camera' is the Polymer control used to take a picture from the - * user webcam to use as a ChromeOS profile picture. - */ -(function() { - -/** - * Dimensions for camera capture. - * @const - */ -var CAPTURE_SIZE = {height: 480, width: 480}; - -Polymer({ - is: 'settings-camera', - - properties: { - /** - * True if the user has selected the camera as the user image source. - * @type {boolean} - */ - cameraActive: { - type: Boolean, - observer: 'cameraActiveChanged_', - value: false, - }, - - /** - * True when the camera is actually streaming video. May be false even when - * the camera is present and shown, but still initializing. - * @private {boolean} - */ - cameraOnline_: { - type: Boolean, - value: false, - }, - - /** - * True if the photo is currently marked flipped. - * @private {boolean} - */ - isFlipped_: { - type: Boolean, - value: false, - }, - }, - - /** @override */ - attached: function() { - this.$.cameraVideo.addEventListener('canplay', function() { - this.cameraOnline_ = true; - }.bind(this)); - }, - - /** - * Performs photo capture from the live camera stream. 'phototaken' event - * will be fired as soon as captured photo is available, with 'dataURL' - * property containing the photo encoded as a data URL. - * @private - */ - takePhoto: function() { - if (!this.cameraOnline_) - return; - var canvas = - /** @type {HTMLCanvasElement} */ (document.createElement('canvas')); - canvas.width = CAPTURE_SIZE.width; - canvas.height = CAPTURE_SIZE.height; - this.captureFrame_( - this.$.cameraVideo, - /** @type {!CanvasRenderingContext2D} */ (canvas.getContext('2d'))); - - var photoDataUrl = this.isFlipped_ ? this.flipFrame_(canvas) : - canvas.toDataURL('image/png'); - this.fire('phototaken', {photoDataUrl: photoDataUrl}); - - announceAccessibleMessage( - loadTimeData.getString('photoCaptureAccessibleText')); - }, - - /** - * Observer for the cameraActive property. - * @private - */ - cameraActiveChanged_: function() { - if (this.cameraActive) - this.startCamera_(); - else - this.stopCamera_(); - }, - - /** - * Tries to start the camera stream capture. - * @private - */ - startCamera_: function() { - this.stopCamera_(); - this.cameraStartInProgress_ = true; - - var successCallback = function(stream) { - if (this.cameraStartInProgress_) { - this.$.cameraVideo.src = URL.createObjectURL(stream); - this.cameraStream_ = stream; - } else { - this.stopVideoTracks_(stream); - } - this.cameraStartInProgress_ = false; - }.bind(this); - - var errorCallback = function() { - this.cameraOnline_ = false; - this.cameraStartInProgress_ = false; - }.bind(this); - - navigator.webkitGetUserMedia({video: true}, successCallback, errorCallback); - }, - - /** - * Stops camera capture, if it's currently cameraActive. - * @private - */ - stopCamera_: function() { - this.cameraOnline_ = false; - this.$.cameraVideo.src = ''; - if (this.cameraStream_) - this.stopVideoTracks_(this.cameraStream_); - // Cancel any pending getUserMedia() checks. - this.cameraStartInProgress_ = false; - }, - - /** - * Stops all video tracks associated with a MediaStream object. - * @param {!MediaStream} stream - * @private - */ - stopVideoTracks_: function(stream) { - var tracks = stream.getVideoTracks(); - for (var i = 0; i < tracks.length; i++) - tracks[i].stop(); - }, - - /** - * Flip the live camera stream. - * @private - */ - onTapFlipPhoto_: function() { - this.isFlipped_ = !this.isFlipped_; - this.$.userImageStreamCrop.classList.toggle('flip-x', this.isFlipped_); - - var flipMessageId = this.isFlipped_ ? 'photoFlippedAccessibleText' : - 'photoFlippedBackAccessibleText'; - announceAccessibleMessage(loadTimeData.getString(flipMessageId)); - }, - - /** - * Captures a single still frame from a <video> element, placing it at the - * current drawing origin of a canvas context. - * @param {!HTMLVideoElement} video Video element to capture from. - * @param {!CanvasRenderingContext2D} ctx Canvas context to draw onto. - * @private - */ - captureFrame_: function(video, ctx) { - var width = video.videoWidth; - var height = video.videoHeight; - if (width < CAPTURE_SIZE.width || height < CAPTURE_SIZE.height) { - console.error( - 'Video capture size too small: ' + width + 'x' + height + '!'); - } - var src = {}; - if (width / CAPTURE_SIZE.width > height / CAPTURE_SIZE.height) { - // Full height, crop left/right. - src.height = height; - src.width = height * CAPTURE_SIZE.width / CAPTURE_SIZE.height; - } else { - // Full width, crop top/bottom. - src.width = width; - src.height = width * CAPTURE_SIZE.height / CAPTURE_SIZE.width; - } - src.x = (width - src.width) / 2; - src.y = (height - src.height) / 2; - ctx.drawImage( - video, src.x, src.y, src.width, src.height, 0, 0, CAPTURE_SIZE.width, - CAPTURE_SIZE.height); - }, - - /** - * Flips frame horizontally. - * @param {!(HTMLImageElement|HTMLCanvasElement|HTMLVideoElement)} source - * Frame to flip. - * @return {string} Flipped frame as data URL. - */ - flipFrame_: function(source) { - var canvas = document.createElement('canvas'); - canvas.width = CAPTURE_SIZE.width; - canvas.height = CAPTURE_SIZE.height; - var ctx = canvas.getContext('2d'); - ctx.translate(CAPTURE_SIZE.width, 0); - ctx.scale(-1.0, 1.0); - ctx.drawImage(source, 0, 0); - return canvas.toDataURL('image/png'); - }, -}); - -})();
diff --git a/chrome/browser/resources/settings/people_page/change_picture.html b/chrome/browser/resources/settings/people_page/change_picture.html index 6b885ef..fa65ecf 100644 --- a/chrome/browser/resources/settings/people_page/change_picture.html +++ b/chrome/browser/resources/settings/people_page/change_picture.html
@@ -1,5 +1,6 @@ <link rel="import" href="chrome://resources/html/polymer.html"> +<link rel="import" href="chrome://resources/cr_elements/chromeos/change_picture/cr_camera.html"> <link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/html/util.html"> @@ -8,8 +9,6 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-selector/iron-selector.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> <link rel="import" href="../i18n_setup.html"> -<link rel="import" href="../icons.html"> -<link rel="import" href="camera.html"> <link rel="import" href="change_picture_browser_proxy.html"> <link rel="import" href="../route.html"> <link rel="import" href="../settings_shared_css.html"> @@ -102,7 +101,7 @@ selected-item="{{selectedItem_}}" role="radiogroup"> <iron-icon id="cameraImage" role="radio" data-type$="[[selectionTypesEnum_.CAMERA]]" - icon="settings:camera-alt" title="$i18n{takePhoto}" + icon="cr:camera-alt" title="$i18n{takePhoto}" hidden="[[!cameraPresent_]]"> </iron-icon> <iron-icon data-type$="[[selectionTypesEnum_.FILE]]" role="radio" @@ -141,10 +140,13 @@ on-tap="onTapDiscardOldImage_"> </button> </div> - <settings-camera id="camera" + <cr-camera id="camera" camera-active="[[isCameraActive_(cameraPresent_, selectedItem_)]]" - on-phototaken="onPhotoTaken_"> - </settings-camera> + on-photo-taken="onPhotoTaken_" + on-photo-flipped="onPhotoFlipped_" + flip-photo-label="$i18n{flipPhoto}" + take-photo-label="$i18n{takePhoto}"> + </cr-camera> </div> </div> </template>
diff --git a/chrome/browser/resources/settings/people_page/change_picture.js b/chrome/browser/resources/settings/people_page/change_picture.js index f210cbc6a..8b258d7 100644 --- a/chrome/browser/resources/settings/people_page/change_picture.js +++ b/chrome/browser/resources/settings/people_page/change_picture.js
@@ -310,7 +310,7 @@ case 'space': if (this.selectedItem_.dataset.type == ChangePictureSelectionTypes.CAMERA) { - var /** SettingsCameraElement */ camera = this.$.camera; + var /** CrCameraElement */ camera = this.$.camera; camera.takePhoto(); } else if ( this.selectedItem_.dataset.type == @@ -337,13 +337,25 @@ }, /** - * Handle photo captured event, which contains the data URL of the image. * @param {!{detail: !{photoDataUrl: string}}} event - * containing a data URL. + * @private */ onPhotoTaken_: function(event) { this.browserProxy_.photoTaken(event.detail.photoDataUrl); this.$.container.focus(); + announceAccessibleMessage( + loadTimeData.getString('photoCaptureAccessibleText')); + }, + + /** + * @param {!{detail: boolean}} event + * @private + */ + onPhotoFlipped_: function(event) { + var flipped = event.detail; + var flipMessageId = flipped ? 'photoFlippedAccessibleText' : + 'photoFlippedBackAccessibleText'; + announceAccessibleMessage(loadTimeData.getString(flipMessageId)); }, /**
diff --git a/chrome/browser/resources/settings/people_page/compiled_resources2.gyp b/chrome/browser/resources/settings/people_page/compiled_resources2.gyp index 246c892..b76d019 100644 --- a/chrome/browser/resources/settings/people_page/compiled_resources2.gyp +++ b/chrome/browser/resources/settings/people_page/compiled_resources2.gyp
@@ -4,23 +4,15 @@ { 'targets': [ { - 'target_name': 'camera', - 'dependencies': [ - '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data', - '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:util', - ], - 'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'], - }, - { 'target_name': 'change_picture', 'dependencies': [ + '<(DEPTH)/ui/webui/resources/cr_elements/chromeos/change_picture/compiled_resources2.gyp:cr_camera', '<(DEPTH)/third_party/polymer/v1_0/components-chromium/iron-selector/compiled_resources2.gyp:iron-selector-extracted', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:util', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:web_ui_listener_behavior', '../compiled_resources2.gyp:route', - 'camera', 'change_picture_browser_proxy', ], 'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
diff --git a/chrome/browser/resources/settings/images/settings_icon_camera_alt.svg b/chrome/browser/resources/settings/people_page/settings_icon_camera_alt.svg similarity index 100% rename from chrome/browser/resources/settings/images/settings_icon_camera_alt.svg rename to chrome/browser/resources/settings/people_page/settings_icon_camera_alt.svg
diff --git a/chrome/browser/resources/settings/images/settings_icon_flip.svg b/chrome/browser/resources/settings/people_page/settings_icon_flip.svg similarity index 100% rename from chrome/browser/resources/settings/images/settings_icon_flip.svg rename to chrome/browser/resources/settings/people_page/settings_icon_flip.svg
diff --git a/chrome/browser/resources/settings/settings_icons_css.html b/chrome/browser/resources/settings/settings_icons_css.html index 0ea4a644..8a3722d 100644 --- a/chrome/browser/resources/settings/settings_icons_css.html +++ b/chrome/browser/resources/settings/settings_icons_css.html
@@ -20,12 +20,6 @@ button[is='paper-icon-button-light'].icon-add-wifi { background-image: url(./images/settings_icon_add_wifi.svg); } - button[is='paper-icon-button-light'].icon-camera-alt { - background-image: url(./images/settings_icon_camera_alt.svg); - } - button[is='paper-icon-button-light'].icon-flip { - background-image: url(./images/settings_icon_flip.svg); - } </if> </style> </template>
diff --git a/chrome/browser/resources/settings/settings_resources.grd b/chrome/browser/resources/settings/settings_resources.grd index 5dd11199..679c6c7 100644 --- a/chrome/browser/resources/settings/settings_resources.grd +++ b/chrome/browser/resources/settings/settings_resources.grd
@@ -1242,14 +1242,6 @@ <structure name="IDR_SETTINGS_TETHER_CONNECTION_DIALOG_JS" file="internet_page/tether_connection_dialog.js" type="chrome_html" /> - <structure name="IDR_SETTINGS_PEOPLE_PAGE_CAMERA_HTML" - file="people_page/camera.html" - type="chrome_html" - preprocess="true" - allowexternalscript="true" /> - <structure name="IDR_SETTINGS_PEOPLE_PAGE_CAMERA_JS" - file="people_page/camera.js" - type="chrome_html" /> <structure name="IDR_SETTINGS_PEOPLE_PAGE_CHANGE_PICTURE_HTML" file="people_page/change_picture.html" type="chrome_html"
diff --git a/chrome/browser/safe_browsing/browser_url_loader_throttle.cc b/chrome/browser/safe_browsing/browser_url_loader_throttle.cc index cc4ec69..a8563ae4 100644 --- a/chrome/browser/safe_browsing/browser_url_loader_throttle.cc +++ b/chrome/browser/safe_browsing/browser_url_loader_throttle.cc
@@ -35,9 +35,9 @@ url_checker_ = base::MakeUnique<SafeBrowsingUrlCheckerImpl>( load_flags, resource_type, std::move(database_manager_), std::move(ui_manager_), web_contents_getter_); - url_checker_->CheckUrl(url, - base::Bind(&BrowserURLLoaderThrottle::OnCheckUrlResult, - base::Unretained(this))); + url_checker_->CheckUrl( + url, base::BindOnce(&BrowserURLLoaderThrottle::OnCheckUrlResult, + base::Unretained(this))); } void BrowserURLLoaderThrottle::WillRedirectRequest(
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_win.cc index 9eb9da3..0ea7937 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_win.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_win.cc
@@ -41,8 +41,9 @@ using ::chrome_cleaner::mojom::PromptAcceptance; using ::content::BrowserThread; -// Keeps track of whether GetInstance() has been called. -bool g_instance_exists = false; +// The global singleton instance. Exposed outside of GetInstance() so that it +// can be reset by tests. +ChromeCleanerController* g_controller = nullptr; // TODO(alito): Move these shared exit codes to the chrome_cleaner component. // https://crbug.com/727956 @@ -139,17 +140,17 @@ ChromeCleanerController* ChromeCleanerController::GetInstance() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - static ChromeCleanerController* const kInstance = - new ChromeCleanerController(); - g_instance_exists = true; - return kInstance; + if (!g_controller) + g_controller = new ChromeCleanerController(); + + return g_controller; } // static bool ChromeCleanerController::ShouldShowCleanupInSettingsUI() { // Short-circuit if the instance doesn't exist to avoid creating it during // navigation to chrome://settings. - if (!g_instance_exists) + if (!g_controller) return false; State state = GetInstance()->state(); @@ -157,6 +158,15 @@ state == State::kRebootRequired; } +void ChromeCleanerController::SetLogsEnabled(bool logs_enabled) { + if (logs_enabled_ == logs_enabled) + return; + + logs_enabled_ = logs_enabled; + for (auto& observer : observer_list_) + observer.OnLogsEnabledChanged(logs_enabled_); +} + void ChromeCleanerController::SetDelegateForTesting( ChromeCleanerControllerDelegate* delegate) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); @@ -164,10 +174,14 @@ DCHECK(delegate_); } -void ChromeCleanerController::DismissRebootForTesting() { - DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - DCHECK_EQ(State::kRebootRequired, state()); - state_ = State::kIdle; +// static +void ChromeCleanerController::ResetInstanceForTesting() { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + + if (g_controller) { + delete g_controller; + g_controller = nullptr; + } } void ChromeCleanerController::AddObserver(Observer* observer) { @@ -214,8 +228,15 @@ PromptAcceptance acceptance = PromptAcceptance::DENIED; State new_state = State::kIdle; switch (user_response) { - case UserResponse::kAccepted: - acceptance = PromptAcceptance::ACCEPTED; + case UserResponse::kAcceptedWithLogs: + acceptance = PromptAcceptance::ACCEPTED_WITH_LOGS; + SetLogsEnabled(true); + new_state = State::kCleaning; + delegate_->TagForResetting(profile); + break; + case UserResponse::kAcceptedWithoutLogs: + acceptance = PromptAcceptance::ACCEPTED_WITHOUT_LOGS; + SetLogsEnabled(false); new_state = State::kCleaning; delegate_->TagForResetting(profile); break;
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_win.h b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_win.h index 45ec62c..0547e74 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_win.h +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_win.h
@@ -91,8 +91,10 @@ }; enum class UserResponse { - // User accepted the cleanup operation. - kAccepted, + // User accepted the cleanup operation and logs upload is enabled. + kAcceptedWithLogs, + // User accepted the cleanup operation and logs upload is not enabled. + kAcceptedWithoutLogs, // User explicitly denied the cleanup operation, for example by clicking the // Cleaner dialog's cancel button. kDenied, @@ -109,6 +111,7 @@ virtual void OnCleaning(const std::set<base::FilePath>& files_to_delete) {} virtual void OnRebootRequired() {} virtual void OnRebootFailed() {} + virtual void OnLogsEnabledChanged(bool logs_enabled) {} protected: virtual ~Observer() = default; @@ -123,6 +126,12 @@ State state() const { return state_; } + // Called by Chrome Cleaner's UI when the user changes Cleaner logs upload + // permissions. Observers are notified if |logs_enabled| is different from the + // current permission state. + void SetLogsEnabled(bool logs_enabled); + bool logs_enabled() const { return logs_enabled_; } + // |AddObserver()| immediately notifies |observer| of the controller's state // by calling the corresponding |On*()| function. void AddObserver(Observer* observer); @@ -167,10 +176,10 @@ // if the system calls to initiate a reboot return success. void Reboot(); + static void ResetInstanceForTesting(); // Passing in a nullptr as |delegate| resets the delegate to a default // production version. void SetDelegateForTesting(ChromeCleanerControllerDelegate* delegate); - void DismissRebootForTesting(); private: ChromeCleanerController(); @@ -216,6 +225,9 @@ ChromeCleanerControllerDelegate* delegate_; State state_ = State::kIdle; + // The logs permission checkboxes in the Chrome Cleaner dialog and webui page + // are opt out. + bool logs_enabled_ = true; IdleReason idle_reason_ = IdleReason::kInitial; std::unique_ptr<SwReporterInvocation> reporter_invocation_; std::unique_ptr<std::set<base::FilePath>> files_to_delete_;
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_win_unittest.cc b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_win_unittest.cc index 9b9a5cbb..d63a48c 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_win_unittest.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_win_unittest.cc
@@ -27,6 +27,7 @@ #include "components/chrome_cleaner/public/constants/constants.h" #include "content/public/browser/browser_thread.h" #include "content/public/test/test_browser_thread_bundle.h" +#include "content/public/test/test_utils.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/multiprocess_func_list.h" @@ -34,6 +35,7 @@ namespace safe_browsing { namespace { +using ::chrome_cleaner::mojom::PromptAcceptance; using ::testing::Combine; using ::testing::DoAll; using ::testing::InvokeWithoutArgs; @@ -47,6 +49,24 @@ using State = ChromeCleanerController::State; using UserResponse = ChromeCleanerController::UserResponse; +// Returns the PromptAcceptance value that ChromeCleanerController is supposed +// to send to the Chrome Cleaner process when ReplyWithUserResponse() is +// called with |user_response|. +PromptAcceptance UserResponseToPromptAcceptance(UserResponse user_response) { + switch (user_response) { + case UserResponse::kAcceptedWithLogs: + return PromptAcceptance::ACCEPTED_WITH_LOGS; + case UserResponse::kAcceptedWithoutLogs: + return PromptAcceptance::ACCEPTED_WITHOUT_LOGS; + case UserResponse::kDenied: // Fallthrough + case UserResponse::kDismissed: + return PromptAcceptance::DENIED; + } + + NOTREACHED(); + return PromptAcceptance::UNSPECIFIED; +} + class MockChromeCleanerControllerObserver : public ChromeCleanerController::Observer { public: @@ -55,6 +75,8 @@ MOCK_METHOD1(OnInfected, void(const std::set<base::FilePath>&)); MOCK_METHOD1(OnCleaning, void(const std::set<base::FilePath>&)); MOCK_METHOD0(OnRebootRequired, void()); + MOCK_METHOD0(OnRebootFailed, void()); + MOCK_METHOD1(OnLogsEnabledChanged, void(bool)); }; enum class MetricsStatus { @@ -95,6 +117,7 @@ scout_enabled_ = scout_status == ScoutStatus::kEnabled; SetChromeCleanerRunnerTestDelegateForTesting(this); + ChromeCleanerController::ResetInstanceForTesting(); ChromeCleanerController::GetInstance()->SetDelegateForTesting(this); scoped_feature_list_.InitAndEnableFeature(kInBrowserCleanerUIFeature); } @@ -140,6 +163,9 @@ return base::Process(); } + void OnCleanerProcessDone( + const ChromeCleanerRunner::ProcessStatus& process_status) override {} + protected: // We need this because we need UI and IO threads during tests. The thread // bundle should be the first member of the class so that it will be destroyed @@ -233,7 +259,12 @@ cleaner_process_options_.set_reboot_required( uws_found_status_ == UwsFoundStatus::kUwsFoundRebootRequired); cleaner_process_options_.set_crash_point(crash_point_); + cleaner_process_options_.set_expected_user_response( + uws_found_status_ == UwsFoundStatus::kNoUwsFound + ? PromptAcceptance::DENIED + : UserResponseToPromptAcceptance(user_response_)); + ChromeCleanerController::ResetInstanceForTesting(); controller_ = ChromeCleanerController::GetInstance(); ASSERT_TRUE(controller_); @@ -243,9 +274,6 @@ } void TearDown() override { - if (controller_->state() == State::kRebootRequired) - controller_->DismissRebootForTesting(); - controller_->SetDelegateForTesting(nullptr); SetChromeCleanerRunnerTestDelegateForTesting(nullptr); } @@ -311,11 +339,17 @@ return std::move(result.process); } + void OnCleanerProcessDone( + const ChromeCleanerRunner::ProcessStatus& process_status) override { + cleaner_process_status_ = process_status; + } + ChromeCleanerController::State ExpectedFinalState() { if (process_status_ == CleanerProcessStatus::kFetchSuccessValidProcess && crash_point_ == CrashPoint::kNone && uws_found_status_ == UwsFoundStatus::kUwsFoundRebootRequired && - user_response_ == UserResponse::kAccepted) { + (user_response_ == UserResponse::kAcceptedWithLogs || + user_response_ == UserResponse::kAcceptedWithoutLogs)) { return State::kRebootRequired; } return State::kIdle; @@ -333,7 +367,8 @@ bool ExpectedOnCleaningCalled() { return ExpectedOnInfectedCalled() && crash_point_ != CrashPoint::kAfterRequestSent && - user_response_ == UserResponse::kAccepted; + (user_response_ == UserResponse::kAcceptedWithLogs || + user_response_ == UserResponse::kAcceptedWithoutLogs); } bool ExpectedOnRebootRequiredCalled() { @@ -348,14 +383,16 @@ crash_point_ == CrashPoint::kAfterResponseReceived) && (uws_found_status_ == UwsFoundStatus::kUwsFoundNoRebootRequired || uws_found_status_ == UwsFoundStatus::kUwsFoundRebootRequired) && - user_response_ == UserResponse::kAccepted; + (user_response_ == UserResponse::kAcceptedWithLogs || + user_response_ == UserResponse::kAcceptedWithoutLogs); } bool ExpectedToResetSettings() { return process_status_ == CleanerProcessStatus::kFetchSuccessValidProcess && crash_point_ == CrashPoint::kNone && uws_found_status_ == UwsFoundStatus::kUwsFoundNoRebootRequired && - user_response_ == UserResponse::kAccepted; + (user_response_ == UserResponse::kAcceptedWithLogs || + user_response_ == UserResponse::kAcceptedWithoutLogs); } ChromeCleanerController::IdleReason ExpectedIdleReason() { @@ -377,7 +414,8 @@ } if (ExpectedOnInfectedCalled() && - user_response_ == UserResponse::kAccepted && + (user_response_ == UserResponse::kAcceptedWithLogs || + user_response_ == UserResponse::kAcceptedWithoutLogs) && crash_point_ == CrashPoint::kAfterResponseReceived) { return IdleReason::kCleaningFailed; } @@ -401,6 +439,7 @@ StrictMock<MockChromeCleanerControllerObserver> mock_observer_; ChromeCleanerController* controller_; + ChromeCleanerRunner::ProcessStatus cleaner_process_status_; std::vector<Profile*> profiles_tagged_; std::vector<Profile*> profiles_to_reset_if_tagged_; @@ -469,6 +508,10 @@ controller_->ReplyWithUserResponse(profile1, user_response_); }))); + // Since logs upload is enabled by default, OnLogsEnabledChanged() will be + // called only if the user response is kAcceptedWithoutLogs. + if (user_response_ == UserResponse::kAcceptedWithoutLogs) + EXPECT_CALL(mock_observer_, OnLogsEnabledChanged(false)); } if (ExpectedOnCleaningCalled()) { @@ -487,7 +530,12 @@ // never stop. ASSERT_TRUE(ExpectedOnIdleCalled() || ExpectedOnRebootRequiredCalled()); run_loop.Run(); + // Also ensure that we wait until the mock cleaner process has finished and + // that all tasks that posted by ChromeCleanerRunner have run. + content::RunAllBlockingPoolTasksUntilIdle(); + EXPECT_NE(cleaner_process_status_.exit_code, + MockChromeCleanerProcess::kInternalTestFailureExitCode); EXPECT_EQ(controller_->state(), ExpectedFinalState()); EXPECT_EQ(!files_to_delete_on_infected.empty(), ExpectedUwsFound()); EXPECT_EQ(!files_to_delete_on_cleaning.empty(), @@ -529,7 +577,8 @@ Values(UwsFoundStatus::kNoUwsFound, UwsFoundStatus::kUwsFoundRebootRequired, UwsFoundStatus::kUwsFoundNoRebootRequired), - Values(UserResponse::kAccepted, + Values(UserResponse::kAcceptedWithLogs, + UserResponse::kAcceptedWithoutLogs, UserResponse::kDenied, UserResponse::kDismissed)));
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_win.cc index 0a2cce2..7624e64 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_win.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_win.cc
@@ -57,11 +57,14 @@ void ChromeCleanerDialogControllerImpl::DialogShown() {} -void ChromeCleanerDialogControllerImpl::Accept() { +void ChromeCleanerDialogControllerImpl::Accept(bool logs_enabled) { DCHECK(browser_); cleaner_controller_->ReplyWithUserResponse( - browser_->profile(), ChromeCleanerController::UserResponse::kAccepted); + browser_->profile(), + logs_enabled + ? ChromeCleanerController::UserResponse::kAcceptedWithLogs + : ChromeCleanerController::UserResponse::kAcceptedWithoutLogs); OpenSettingsPage(browser_); OnInteractionDone(); } @@ -82,11 +85,21 @@ OnInteractionDone(); } -void ChromeCleanerDialogControllerImpl::DetailsButtonClicked() { +void ChromeCleanerDialogControllerImpl::DetailsButtonClicked( + bool logs_enabled) { + cleaner_controller_->SetLogsEnabled(logs_enabled); OpenSettingsPage(browser_); OnInteractionDone(); } +void ChromeCleanerDialogControllerImpl::SetLogsEnabled(bool logs_enabled) { + cleaner_controller_->SetLogsEnabled(logs_enabled); +} + +bool ChromeCleanerDialogControllerImpl::LogsEnabled() { + return cleaner_controller_->logs_enabled(); +} + void ChromeCleanerDialogControllerImpl::OnIdle( ChromeCleanerController::IdleReason idle_reason) { if (!dialog_shown_)
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_win.h b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_win.h index 64b1ea81..8c87c4f 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_win.h +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_win.h
@@ -27,10 +27,12 @@ // ChromeCleanerDialogController overrides. void DialogShown() override; - void Accept() override; + void Accept(bool logs_enabled) override; void Cancel() override; void Close() override; - void DetailsButtonClicked() override; + void DetailsButtonClicked(bool logs_enabled) override; + void SetLogsEnabled(bool logs_enabled) override; + bool LogsEnabled() override; // ChromeCleanerController::Observer overrides. void OnIdle(ChromeCleanerController::IdleReason idle_reason) override;
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_win.h b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_win.h index 40b4fc566..eb1d375e 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_win.h +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_win.h
@@ -23,7 +23,7 @@ // Called by the Cleaner dialog when user accepts the prompt. Once |Accept()| // has been called, the controller will eventually delete itself and no member // functions should be called after that. - virtual void Accept() = 0; + virtual void Accept(bool logs_enabled) = 0; // Called by the Cleaner dialog when the dialog is closed via the cancel // button. Once |Cancel()| has been called, the controller will eventually // delete itself and no member functions should be called after that. @@ -38,7 +38,14 @@ // close. After a call to |DetailsButtonClicked()|, the controller will // eventually delete itself and no member functions should be called after // that. - virtual void DetailsButtonClicked() = 0; + virtual void DetailsButtonClicked(bool logs_enabled) = 0; + + // To be called by the dialog when the user changes the state of the logs + // upload permission checkbox. + virtual void SetLogsEnabled(bool logs_enabled) = 0; + // Returns whether logs upload is currently enabled. Used to set the dialog's + // default permission checkbox state. + virtual bool LogsEnabled() = 0; protected: virtual ~ChromeCleanerDialogController() {}
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.cc index 25c1575b..8724e44 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.cc
@@ -223,6 +223,13 @@ } void ChromeCleanerRunner::OnProcessDone(ProcessStatus process_status) { + if (g_test_delegate) { + task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&ChromeCleanerRunnerTestDelegate::OnCleanerProcessDone, + base::Unretained(g_test_delegate), process_status)); + } + if (on_process_done_) { task_runner_->PostTask( FROM_HERE, base::BindOnce(std::move(on_process_done_), process_status));
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.h b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.h index dc9cce1..7e92607d 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.h +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.h
@@ -159,6 +159,9 @@ virtual base::Process LaunchTestProcess( const base::CommandLine& command_line, const base::LaunchOptions& launch_options) = 0; + + virtual void OnCleanerProcessDone( + const ChromeCleanerRunner::ProcessStatus& process_status) = 0; }; void SetChromeCleanerRunnerTestDelegateForTesting(
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win_unittest.cc b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win_unittest.cc index 0c50ae0..93f3539e 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win_unittest.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win_unittest.cc
@@ -115,6 +115,9 @@ return base::Process(); } + void OnCleanerProcessDone( + const ChromeCleanerRunner::ProcessStatus& process_status) override {} + // IPC callbacks. void OnPromptUser(std::unique_ptr<std::set<base::FilePath>> files_to_delete, @@ -235,6 +238,8 @@ cleaner_process_options_.set_reboot_required( uws_found_state == UwsFoundState::kUwsFoundRebootRequired); cleaner_process_options_.set_crash_point(crash_point); + cleaner_process_options_.set_expected_user_response( + prompt_acceptance_to_send); prompt_acceptance_to_send_ = prompt_acceptance_to_send; SetChromeCleanerRunnerTestDelegateForTesting(this); @@ -278,6 +283,9 @@ return std::move(result.process); } + void OnCleanerProcessDone( + const ChromeCleanerRunner::ProcessStatus& process_status) override {} + // IPC callbacks. // Will receive the main Mojo message from the Mock Chrome Cleaner process. @@ -395,7 +403,9 @@ MockChromeCleanerProcess::CrashPoint::kAfterConnection, MockChromeCleanerProcess::CrashPoint::kAfterRequestSent, MockChromeCleanerProcess::CrashPoint::kAfterResponseReceived), - Values(PromptAcceptance::DENIED, PromptAcceptance::ACCEPTED))); + Values(PromptAcceptance::DENIED, + PromptAcceptance::ACCEPTED_WITH_LOGS, + PromptAcceptance::ACCEPTED_WITHOUT_LOGS))); } // namespace } // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/mock_chrome_cleaner_process_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/mock_chrome_cleaner_process_win.cc index 97e83b6..2d40d03 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/mock_chrome_cleaner_process_win.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/mock_chrome_cleaner_process_win.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/safe_browsing/chrome_cleaner/mock_chrome_cleaner_process_win.h" #include <utility> +#include <vector> #include "base/bind_helpers.h" #include "base/memory/ref_counted.h" @@ -36,6 +37,7 @@ constexpr char kCrashPointSwitch[] = "mock-crash-point"; constexpr char kUwsFoundSwitch[] = "mock-uws-found"; constexpr char kRebootRequiredSwitch[] = "mock-reboot-required"; +constexpr char kExpectedUserResponseSwitch[] = "mock-expected-user-response"; } // namespace @@ -58,6 +60,21 @@ } } + if (command_line.HasSwitch(kExpectedUserResponseSwitch)) { + int expected_response_int = 0; + if (base::StringToInt( + command_line.GetSwitchValueASCII(kExpectedUserResponseSwitch), + &expected_response_int) && + expected_response_int >= 0 && + expected_response_int < + static_cast<int>(PromptAcceptance::NUM_VALUES)) { + options->set_expected_user_response( + static_cast<PromptAcceptance>(expected_response_int)); + } else { + return false; + } + } + return true; } @@ -66,14 +83,15 @@ MockChromeCleanerProcess::Options::Options(const Options& other) : files_to_delete_(other.files_to_delete_), reboot_required_(other.reboot_required_), - crash_point_(other.crash_point_) { -} + crash_point_(other.crash_point_), + expected_user_response_(other.expected_user_response_) {} MockChromeCleanerProcess::Options& MockChromeCleanerProcess::Options::operator=( const Options& other) { files_to_delete_ = other.files_to_delete_; reboot_required_ = other.reboot_required_; crash_point_ = other.crash_point_; + expected_user_response_ = other.expected_user_response_; return *this; } @@ -91,6 +109,12 @@ command_line->AppendSwitchASCII( kCrashPointSwitch, base::IntToString(static_cast<int>(crash_point()))); } + + if (expected_user_response() != PromptAcceptance::UNSPECIFIED) { + command_line->AppendSwitchASCII( + kExpectedUserResponseSwitch, + base::IntToString(static_cast<int>(expected_user_response()))); + } } void MockChromeCleanerProcess::Options::SetDoFindUws(bool do_find_uws) { @@ -114,7 +138,8 @@ if (files_to_delete_.empty()) return kNothingFoundExitCode; - if (received_prompt_acceptance == PromptAcceptance::ACCEPTED) { + if (received_prompt_acceptance == PromptAcceptance::ACCEPTED_WITH_LOGS || + received_prompt_acceptance == PromptAcceptance::ACCEPTED_WITHOUT_LOGS) { return reboot_required() ? kRebootRequiredExitCode : kRebootNotRequiredExitCode; } @@ -181,6 +206,7 @@ run_loop.Run(); EXPECT_NE(received_prompt_acceptance_, PromptAcceptance::UNSPECIFIED); + EXPECT_EQ(received_prompt_acceptance_, options_.expected_user_response()); if (::testing::Test::HasFailure()) return kInternalTestFailureExitCode; return options_.ExpectedExitCode(received_prompt_acceptance_);
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/mock_chrome_cleaner_process_win.h b/chrome/browser/safe_browsing/chrome_cleaner/mock_chrome_cleaner_process_win.h index 7c06170..f2d6cb6 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/mock_chrome_cleaner_process_win.h +++ b/chrome/browser/safe_browsing/chrome_cleaner/mock_chrome_cleaner_process_win.h
@@ -43,8 +43,8 @@ kNumCrashPoints, }; - static constexpr int kInternalTestFailureExitCode = -1; - static constexpr int kDeliberateCrashExitCode = -2; + static constexpr int kInternalTestFailureExitCode = 100001; + static constexpr int kDeliberateCrashExitCode = 100002; static constexpr int kNothingFoundExitCode = 2; static constexpr int kDeclinedExitCode = 44; static constexpr int kRebootRequiredExitCode = 15; @@ -75,6 +75,15 @@ void set_crash_point(CrashPoint crash_point) { crash_point_ = crash_point; } CrashPoint crash_point() const { return crash_point_; } + void set_expected_user_response( + chrome_cleaner::mojom::PromptAcceptance expected_user_response) { + expected_user_response_ = expected_user_response; + } + + chrome_cleaner::mojom::PromptAcceptance expected_user_response() const { + return expected_user_response_; + } + int ExpectedExitCode(chrome_cleaner::mojom::PromptAcceptance received_prompt_acceptance) const; @@ -82,6 +91,8 @@ std::set<base::FilePath> files_to_delete_; bool reboot_required_ = false; CrashPoint crash_point_ = CrashPoint::kNone; + chrome_cleaner::mojom::PromptAcceptance expected_user_response_ = + chrome_cleaner::mojom::PromptAcceptance::UNSPECIFIED; }; MockChromeCleanerProcess(const Options& options,
diff --git a/chrome/browser/safe_browsing/chrome_password_protection_service_unittest.cc b/chrome/browser/safe_browsing/chrome_password_protection_service_unittest.cc index f24d7cb..ac042a8 100644 --- a/chrome/browser/safe_browsing/chrome_password_protection_service_unittest.cc +++ b/chrome/browser/safe_browsing/chrome_password_protection_service_unittest.cc
@@ -11,6 +11,7 @@ #include "chrome/browser/signin/chrome_signin_client_factory.h" #include "chrome/browser/signin/fake_account_fetcher_service_builder.h" #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" +#include "chrome/browser/signin/fake_signin_manager_builder.h" #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h" #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" #include "chrome/browser/signin/signin_manager_factory.h" @@ -37,16 +38,6 @@ const char kTestAccountID[] = "account_id"; const char kTestEmail[] = "foo@example.com"; -std::unique_ptr<KeyedService> SigninManagerBuild( - content::BrowserContext* context) { - Profile* profile = static_cast<Profile*>(context); - std::unique_ptr<SigninManagerBase> service(new SigninManagerBase( - ChromeSigninClientFactory::GetInstance()->GetForProfile(profile), - AccountTrackerServiceFactory::GetForProfile(profile))); - service->Initialize(NULL); - return std::move(service); -} - } // namespace class MockSafeBrowsingUIManager : public SafeBrowsingUIManager { @@ -144,7 +135,7 @@ builder.AddTestingFactory(ChromeSigninClientFactory::GetInstance(), signin::BuildTestSigninClient); builder.AddTestingFactory(SigninManagerFactory::GetInstance(), - SigninManagerBuild); + BuildFakeSigninManagerBase); builder.AddTestingFactory(AccountFetcherServiceFactory::GetInstance(), FakeAccountFetcherServiceBuilder::BuildForTests); return builder.Build().release();
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc index 82900f5..d2764d21 100644 --- a/chrome/browser/safe_browsing/download_protection_service.cc +++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -252,13 +252,14 @@ UpdateDownloadCheckStats(dangerous_type_); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::Bind(&DownloadUrlSBClient::ReportMalware, this, threat_type)); + base::BindOnce(&DownloadUrlSBClient::ReportMalware, this, + threat_type)); } else { // Identify download referrer chain, which will be used in // ClientDownloadRequest. BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::Bind(&DownloadUrlSBClient::IdentifyReferrerChain, this)); + base::BindOnce(&DownloadUrlSBClient::IdentifyReferrerChain, this)); } BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::BindOnce(callback_, result));
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc index a352c331..baf6c2b 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
@@ -143,16 +143,6 @@ } } -bool SafeBrowsingBlockingPage::ShouldReportThreatDetails( - SBThreatType threat_type) { - return threat_type == SB_THREAT_TYPE_URL_PHISHING || - threat_type == SB_THREAT_TYPE_URL_MALWARE || - threat_type == SB_THREAT_TYPE_URL_UNWANTED || - threat_type == SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING || - threat_type == SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE || - threat_type == SB_THREAT_TYPE_URL_PASSWORD_PROTECTION_PHISHING; -} - SafeBrowsingBlockingPage::~SafeBrowsingBlockingPage() { }
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h index 15160c4eb..63baa90 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h
@@ -77,9 +77,6 @@ void OverrideRendererPrefs(content::RendererPreferences* prefs) override; content::InterstitialPageDelegate::TypeID GetTypeForTesting() const override; - // Checks the threat type to decide if we should report ThreatDetails. - static bool ShouldReportThreatDetails(SBThreatType threat_type); - protected: friend class SafeBrowsingBlockingPageFactoryImpl; friend class SafeBrowsingBlockingPageTest;
diff --git a/chrome/browser/safe_browsing/safe_browsing_url_checker_impl.cc b/chrome/browser/safe_browsing/safe_browsing_url_checker_impl.cc index 397709f..025639f 100644 --- a/chrome/browser/safe_browsing/safe_browsing_url_checker_impl.cc +++ b/chrome/browser/safe_browsing/safe_browsing_url_checker_impl.cc
@@ -98,8 +98,8 @@ content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, - base::Bind(&SafeBrowsingUrlCheckerImpl::StartDisplayingBlockingPage, - weak_factory_.GetWeakPtr(), ui_manager_, resource)); + base::BindOnce(&SafeBrowsingUrlCheckerImpl::StartDisplayingBlockingPage, + weak_factory_.GetWeakPtr(), ui_manager_, resource)); } // static
diff --git a/chrome/browser/signin/chrome_signin_helper.cc b/chrome/browser/signin/chrome_signin_helper.cc index 0a93f2f1..6fe62ed83 100644 --- a/chrome/browser/signin/chrome_signin_helper.cc +++ b/chrome/browser/signin/chrome_signin_helper.cc
@@ -43,6 +43,7 @@ #if BUILDFLAG(ENABLE_DICE_SUPPORT) const char kDiceResponseHeader[] = "X-Chrome-ID-Consistency-Response"; +const char kGoogleSignoutResponseHeader[] = "Google-Accounts-SignOut"; #endif // Processes the mirror response header on the UI thread. Currently depending @@ -134,11 +135,8 @@ // Looks for the X-Chrome-Manage-Accounts response header, and if found, // tries to show the avatar bubble in the browser identified by the // child/route id. Must be called on IO thread. -void ProcessMirrorResponseHeaderIfExists( - net::URLRequest* request, - ProfileIOData* io_data, - const content::ResourceRequestInfo::WebContentsGetter& - web_contents_getter) { +void ProcessMirrorResponseHeaderIfExists(net::URLRequest* request, + bool is_off_the_record) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); const content::ResourceRequestInfo* info = @@ -159,7 +157,7 @@ return; } - if (io_data->IsOffTheRecord()) { + if (is_off_the_record) { NOTREACHED() << "Gaia should not send the X-Chrome-Manage-Accounts header " << "in incognito."; return; @@ -180,18 +178,16 @@ content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, - base::BindOnce(ProcessMirrorHeaderUIThread, params, web_contents_getter)); + base::BindOnce(ProcessMirrorHeaderUIThread, params, + info->GetWebContentsGetterForRequest())); } #if BUILDFLAG(ENABLE_DICE_SUPPORT) -void ProcessDiceResponseHeaderIfExists( - net::URLRequest* request, - ProfileIOData* io_data, - const content::ResourceRequestInfo::WebContentsGetter& - web_contents_getter) { +void ProcessDiceResponseHeaderIfExists(net::URLRequest* request, + bool is_off_the_record) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - if (io_data->IsOffTheRecord()) + if (is_off_the_record) return; const content::ResourceRequestInfo* info = @@ -212,12 +208,18 @@ return; std::string header_value; - if (!response_headers->GetNormalizedHeader(kDiceResponseHeader, - &header_value)) { - return; + DiceResponseParams params; + if (response_headers->GetNormalizedHeader(kDiceResponseHeader, + &header_value)) { + params = BuildDiceSigninResponseParams(header_value); + // The header must be removed for privacy reasons, so that renderers never + // have access to the authorization code. + response_headers->RemoveHeader(kDiceResponseHeader); + } else if (response_headers->GetNormalizedHeader(kGoogleSignoutResponseHeader, + &header_value)) { + params = BuildDiceSignoutResponseParams(header_value); } - DiceResponseParams params = BuildDiceResponseParams(header_value); // If the request does not have a response header or if the header contains // garbage, then |user_intention| is set to |NONE|. if (params.user_intention == DiceAction::NONE) @@ -225,7 +227,8 @@ content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, - base::Bind(ProcessDiceHeaderUIThread, params, web_contents_getter)); + base::Bind(ProcessDiceHeaderUIThread, params, + info->GetWebContentsGetterForRequest())); } #endif // BUILDFLAG(ENABLE_DICE_SUPPORT) @@ -269,28 +272,23 @@ io_data->GetCookieSettings(), profile_mode_mask); } -void ProcessAccountConsistencyResponseHeaders( - net::URLRequest* request, - const GURL& redirect_url, - ProfileIOData* io_data, - const content::ResourceRequestInfo::WebContentsGetter& - web_contents_getter) { +void ProcessAccountConsistencyResponseHeaders(net::URLRequest* request, + const GURL& redirect_url, + bool is_off_the_record) { if (redirect_url.is_empty()) { // This is not a redirect. // See if the response contains the X-Chrome-Manage-Accounts header. If so // show the profile avatar bubble so that user can complete signin/out // action the native UI. - ProcessMirrorResponseHeaderIfExists(request, io_data, web_contents_getter); - } else { - // This is a redirect. + ProcessMirrorResponseHeaderIfExists(request, is_off_the_record); + } #if BUILDFLAG(ENABLE_DICE_SUPPORT) - // Process the Dice header: on sign-in, exchange the authorization code for - // a refresh token, on sign-out just follow the sign-out URL. - ProcessDiceResponseHeaderIfExists(request, io_data, web_contents_getter); + // Process the Dice header: on sign-in, exchange the authorization code for a + // refresh token, on sign-out just follow the sign-out URL. + ProcessDiceResponseHeaderIfExists(request, is_off_the_record); #endif // BUILDFLAG(ENABLE_DICE_SUPPORT) - } } } // namespace signin
diff --git a/chrome/browser/signin/chrome_signin_helper.h b/chrome/browser/signin/chrome_signin_helper.h index 1c73f0e..2a3400be 100644 --- a/chrome/browser/signin/chrome_signin_helper.h +++ b/chrome/browser/signin/chrome_signin_helper.h
@@ -35,11 +35,9 @@ // Processes account consistency response headers (X-Chrome-Manage-Accounts and // Dice). |redirect_url| is empty if the request is not a redirect. -void ProcessAccountConsistencyResponseHeaders( - net::URLRequest* request, - const GURL& redirect_url, - ProfileIOData* io_data, - const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter); +void ProcessAccountConsistencyResponseHeaders(net::URLRequest* request, + const GURL& redirect_url, + bool is_off_the_record); }; // namespace signin
diff --git a/chrome/browser/signin/chrome_signin_helper_unittest.cc b/chrome/browser/signin/chrome_signin_helper_unittest.cc new file mode 100644 index 0000000..d5003b9 --- /dev/null +++ b/chrome/browser/signin/chrome_signin_helper_unittest.cc
@@ -0,0 +1,155 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/signin/chrome_signin_helper.h" + +#include <memory> +#include <string> + +#include "base/command_line.h" +#include "base/run_loop.h" +#include "base/strings/stringprintf.h" +#include "components/signin/core/common/profile_management_switches.h" +#include "components/signin/core/common/signin_features.h" +#include "content/public/browser/browser_thread.h" +#include "content/public/browser/resource_request_info.h" +#include "content/public/test/test_browser_thread_bundle.h" +#include "net/http/http_response_headers.h" +#include "net/traffic_annotation/network_traffic_annotation_test_helper.h" +#include "net/url_request/url_request.h" +#include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_filter.h" +#include "net/url_request/url_request_interceptor.h" +#include "net/url_request/url_request_test_job.h" +#include "net/url_request/url_request_test_util.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" + +namespace { + +#if BUILDFLAG(ENABLE_DICE_SUPPORT) +const GURL kGaiaUrl("https://accounts.google.com"); +const char kDiceResponseHeader[] = "X-Chrome-ID-Consistency-Response"; + +// URLRequestInterceptor adding a Dice response header to Gaia responses. +class TestRequestInterceptor : public net::URLRequestInterceptor { + public: + ~TestRequestInterceptor() override {} + + private: + net::URLRequestJob* MaybeInterceptRequest( + net::URLRequest* request, + net::NetworkDelegate* network_delegate) const override { + std::string response_headers = + base::StringPrintf("HTTP/1.1 200 OK\n\n%s: Foo\n", kDiceResponseHeader); + return new net::URLRequestTestJob(request, network_delegate, + response_headers, "", true); + } +}; + +// Helper class managing the thread hopping between UI and IO. +class TestResponseHelper { + public: + TestResponseHelper() : success_(false) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + } + + // Creates a URL request with the Dice response headers. + void CreateRequestWithResponseHeaders() { + success_ = false; + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + content::BrowserThread::PostTask( + content::BrowserThread::IO, FROM_HERE, + base::BindOnce( + &TestResponseHelper::CreateRequestWithDiceResponseHeaderOnIO, + base::Unretained(this))); + base::RunLoop().RunUntilIdle(); + ASSERT_TRUE(success_); + + success_ = false; + content::BrowserThread::PostTask( + content::BrowserThread::IO, FROM_HERE, + base::BindOnce(&TestResponseHelper::CheckHeaderSetOnIO, + base::Unretained(this))); + base::RunLoop().RunUntilIdle(); + ASSERT_TRUE(success_); + } + + // Processes the Dice header and check that it was removed. + void CheckDiceHeaderRemoved() { + success_ = false; + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + content::BrowserThread::PostTask( + content::BrowserThread::IO, FROM_HERE, + base::BindOnce(&TestResponseHelper::CheckDiceHeaderRemovedOnIO, + base::Unretained(this))); + base::RunLoop().RunUntilIdle(); + ASSERT_TRUE(success_); + } + + private: + void CreateRequestWithDiceResponseHeaderOnIO() { + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + test_request_delegate_ = base::MakeUnique<net::TestDelegate>(); + request_ = url_request_context_.CreateRequest( + kGaiaUrl, net::DEFAULT_PRIORITY, test_request_delegate_.get(), + TRAFFIC_ANNOTATION_FOR_TESTS); + content::ResourceRequestInfo::AllocateForTesting( + request_.get(), content::RESOURCE_TYPE_MAIN_FRAME, nullptr, -1, -1, -1, + true, false, false, true, content::PREVIEWS_OFF); + net::URLRequestFilter::GetInstance()->AddUrlInterceptor( + kGaiaUrl, base::MakeUnique<TestRequestInterceptor>()); + request_->Start(); + success_ = true; + } + + void CheckHeaderSetOnIO() { + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + net::HttpResponseHeaders* response_headers = request_->response_headers(); + ASSERT_TRUE(response_headers); + ASSERT_TRUE(request_->response_headers()->HasHeader(kDiceResponseHeader)); + net::URLRequestFilter::GetInstance()->RemoveUrlHandler(kGaiaUrl); + success_ = true; + } + + void CheckDiceHeaderRemovedOnIO() { + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + // Process the header. + signin::ProcessAccountConsistencyResponseHeaders(request_.get(), GURL(), + false /* is_incognito */); + // Check that the header has been removed. + EXPECT_FALSE(request_->response_headers()->HasHeader(kDiceResponseHeader)); + success_ = true; + } + + net::TestURLRequestContext url_request_context_; + std::unique_ptr<net::TestDelegate> test_request_delegate_; + std::unique_ptr<net::URLRequest> request_; + bool success_; +}; +#endif // BUILDFLAG(ENABLE_DICE_SUPPORT) + +} // namespace + +class ChromeSigninHelperTest : public testing::Test { + protected: + ChromeSigninHelperTest() + : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {} + + ~ChromeSigninHelperTest() override {} + + content::TestBrowserThreadBundle thread_bundle_; +}; + +#if BUILDFLAG(ENABLE_DICE_SUPPORT) +// Tests that Dice response headers are removed after being processed. +TEST_F(ChromeSigninHelperTest, RemoveDiceSigninHeader) { + switches::EnableAccountConsistencyDiceForTesting( + base::CommandLine::ForCurrentProcess()); + + TestResponseHelper test_response_helper; + test_response_helper.CreateRequestWithResponseHeaders(); + test_response_helper.CheckDiceHeaderRemoved(); +} +#endif // BUILDFLAG(ENABLE_DICE_SUPPORT)
diff --git a/chrome/browser/signin/dice_response_handler.cc b/chrome/browser/signin/dice_response_handler.cc index 5142d24..5b93dda 100644 --- a/chrome/browser/signin/dice_response_handler.cc +++ b/chrome/browser/signin/dice_response_handler.cc
@@ -15,12 +15,15 @@ #include "chrome/browser/signin/account_tracker_service_factory.h" #include "chrome/browser/signin/chrome_signin_client_factory.h" #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" +#include "chrome/browser/signin/signin_manager_factory.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" #include "components/signin/core/browser/account_tracker_service.h" #include "components/signin/core/browser/profile_oauth2_token_service.h" #include "components/signin/core/browser/signin_client.h" #include "components/signin/core/browser/signin_header_helper.h" +#include "components/signin/core/browser/signin_manager.h" +#include "components/signin/core/browser/signin_metrics.h" #include "components/signin/core/common/profile_management_switches.h" #include "google_apis/gaia/gaia_auth_fetcher.h" #include "google_apis/gaia/gaia_constants.h" @@ -52,6 +55,7 @@ DependsOn(AccountTrackerServiceFactory::GetInstance()); DependsOn(ChromeSigninClientFactory::GetInstance()); DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); + DependsOn(SigninManagerFactory::GetInstance()); } ~DiceResponseHandlerFactory() override {} @@ -65,6 +69,7 @@ Profile* profile = static_cast<Profile*>(context); return new DiceResponseHandler( ChromeSigninClientFactory::GetForProfile(profile), + SigninManagerFactory::GetForProfile(profile), ProfileOAuth2TokenServiceFactory::GetForProfile(profile), AccountTrackerServiceFactory::GetForProfile(profile)); } @@ -137,12 +142,15 @@ DiceResponseHandler::DiceResponseHandler( SigninClient* signin_client, + SigninManager* signin_manager, ProfileOAuth2TokenService* profile_oauth2_token_service, AccountTrackerService* account_tracker_service) - : signin_client_(signin_client), + : signin_manager_(signin_manager), + signin_client_(signin_client), token_service_(profile_oauth2_token_service), account_tracker_service_(account_tracker_service) { DCHECK(signin_client_); + DCHECK(signin_manager_); DCHECK(token_service_); DCHECK(account_tracker_service_); } @@ -156,13 +164,19 @@ switch (dice_params.user_intention) { case signin::DiceAction::SIGNIN: - ProcessDiceSigninHeader(dice_params.gaia_id, dice_params.email, - dice_params.authorization_code); + ProcessDiceSigninHeader(dice_params.signin_info.gaia_id, + dice_params.signin_info.email, + dice_params.signin_info.authorization_code); return; - case signin::DiceAction::SIGNOUT: - case signin::DiceAction::SINGLE_SESSION_SIGNOUT: - LOG(ERROR) << "Signout through Dice is not implemented."; + case signin::DiceAction::SIGNOUT: { + const signin::DiceResponseParams::SignoutInfo& signout_info = + dice_params.signout_info; + DCHECK_GT(signout_info.gaia_id.size(), 0u); + DCHECK_EQ(signout_info.gaia_id.size(), signout_info.email.size()); + DCHECK_EQ(signout_info.gaia_id.size(), signout_info.session_index.size()); + ProcessDiceSignoutHeader(signout_info.gaia_id, signout_info.email); return; + } case signin::DiceAction::NONE: NOTREACHED() << "Invalid Dice response parameters."; return; @@ -195,6 +209,34 @@ gaia_id, email, authorization_code, signin_client_, this)); } +void DiceResponseHandler::ProcessDiceSignoutHeader( + const std::vector<std::string>& gaia_ids, + const std::vector<std::string>& emails) { + DCHECK_EQ(gaia_ids.size(), emails.size()); + // If one of the signed out accounts is the main Chrome account, then force a + // complete signout. Otherwise simply revoke the corresponding tokens. + std::string current_account = signin_manager_->GetAuthenticatedAccountId(); + std::vector<std::string> signed_out_accounts; + for (unsigned int i = 0; i < gaia_ids.size(); ++i) { + std::string signed_out_account = + account_tracker_service_->PickAccountIdForAccount(gaia_ids[i], + emails[i]); + if (signed_out_account == current_account) { + VLOG(1) << "[Dice] Signing out all accounts."; + signin_manager_->SignOut(signin_metrics::SERVER_FORCED_DISABLE, + signin_metrics::SignoutDelete::IGNORE_METRIC); + return; + } else { + signed_out_accounts.push_back(signed_out_account); + } + } + + for (const auto& account : signed_out_accounts) { + VLOG(1) << "[Dice]: Revoking token for account: " << account; + token_service_->RevokeCredentials(account); + } +} + void DiceResponseHandler::DeleteTokenFetcher(DiceTokenFetcher* token_fetcher) { for (auto it = token_fetchers_.begin(); it != token_fetchers_.end(); ++it) { if (it->get() == token_fetcher) { @@ -212,7 +254,7 @@ const GaiaAuthConsumer::ClientOAuthResult& result) { std::string account_id = account_tracker_service_->SeedAccountInfo(gaia_id, email); - VLOG(1) << "Dice OAuth success for account: " << account_id; + VLOG(1) << "[Dice] OAuth success for account: " << account_id; token_service_->UpdateCredentials(account_id, result.refresh_token); DeleteTokenFetcher(token_fetcher); } @@ -221,6 +263,6 @@ DiceTokenFetcher* token_fetcher, const GoogleServiceAuthError& error) { // TODO(droger): Handle authentication errors. - VLOG(1) << "Dice OAuth failed with error: " << error.ToString(); + VLOG(1) << "[Dice] OAuth failed with error: " << error.ToString(); DeleteTokenFetcher(token_fetcher); }
diff --git a/chrome/browser/signin/dice_response_handler.h b/chrome/browser/signin/dice_response_handler.h index 17e7e62..c3d2f129 100644 --- a/chrome/browser/signin/dice_response_handler.h +++ b/chrome/browser/signin/dice_response_handler.h
@@ -22,6 +22,7 @@ class GaiaAuthFetcher; class GoogleServiceAuthError; class SigninClient; +class SigninManager; class ProfileOAuth2TokenService; class Profile; @@ -36,6 +37,7 @@ static DiceResponseHandler* GetForProfile(Profile* profile); DiceResponseHandler(SigninClient* signin_client, + SigninManager* signin_manager, ProfileOAuth2TokenService* profile_oauth2_token_service, AccountTrackerService* account_tracker_service); ~DiceResponseHandler() override; @@ -90,6 +92,10 @@ const std::string& email, const std::string& authorization_code); + // Process the Dice signout action. + void ProcessDiceSignoutHeader(const std::vector<std::string>& gaia_ids, + const std::vector<std::string>& emails); + // Called after exchanging an OAuth 2.0 authorization code for a refresh token // after DiceAction::SIGNIN. void OnTokenExchangeSuccess( @@ -100,6 +106,7 @@ void OnTokenExchangeFailure(DiceTokenFetcher* token_fetcher, const GoogleServiceAuthError& error); + SigninManager* signin_manager_; SigninClient* signin_client_; ProfileOAuth2TokenService* token_service_; AccountTrackerService* account_tracker_service_;
diff --git a/chrome/browser/signin/dice_response_handler_unittest.cc b/chrome/browser/signin/dice_response_handler_unittest.cc index 6ad0e165..50e1bb9 100644 --- a/chrome/browser/signin/dice_response_handler_unittest.cc +++ b/chrome/browser/signin/dice_response_handler_unittest.cc
@@ -12,6 +12,7 @@ #include "base/time/time.h" #include "chrome/test/base/testing_profile.h" #include "components/signin/core/browser/account_tracker_service.h" +#include "components/signin/core/browser/fake_signin_manager.h" #include "components/signin/core/browser/profile_oauth2_token_service.h" #include "components/signin/core/browser/signin_header_helper.h" #include "components/signin/core/browser/test_signin_client.h" @@ -68,7 +69,12 @@ signin_client_(&pref_service_), token_service_(base::MakeUnique<FakeOAuth2TokenServiceDelegate>( request_context_getter_.get())), + signin_manager_(&signin_client_, + &token_service_, + &account_tracker_service_, + nullptr), dice_response_handler_(&signin_client_, + &signin_manager_, &token_service_, &account_tracker_service_) { loop_.SetTaskRunner(task_runner_); @@ -77,6 +83,7 @@ base::CommandLine::ForCurrentProcess()); signin_client_.SetURLRequestContext(request_context_getter_.get()); AccountTrackerService::RegisterPrefs(pref_service_.registry()); + SigninManager::RegisterProfilePrefs(pref_service_.registry()); account_tracker_service_.Initialize(&signin_client_); } @@ -85,10 +92,16 @@ DiceResponseParams MakeDiceParams(DiceAction action) { DiceResponseParams dice_params; dice_params.user_intention = action; - dice_params.gaia_id = kGaiaID; - dice_params.email = kEmail; - dice_params.session_index = kSessionIndex; - dice_params.authorization_code = kAuthorizationCode; + if (action == DiceAction::SIGNIN) { + dice_params.signin_info.gaia_id = kGaiaID; + dice_params.signin_info.email = kEmail; + dice_params.signin_info.session_index = kSessionIndex; + dice_params.signin_info.authorization_code = kAuthorizationCode; + } else if (action == DiceAction::SIGNOUT) { + dice_params.signout_info.gaia_id.push_back(kGaiaID); + dice_params.signout_info.email.push_back(kEmail); + dice_params.signout_info.session_index.push_back(kSessionIndex); + } return dice_params; } @@ -99,13 +112,15 @@ DiceTestSigninClient signin_client_; ProfileOAuth2TokenService token_service_; AccountTrackerService account_tracker_service_; + FakeSigninManager signin_manager_; DiceResponseHandler dice_response_handler_; }; // Checks that a SIGNIN action triggers a token exchange request. TEST_F(DiceResponseHandlerTest, Signin) { DiceResponseParams dice_params = MakeDiceParams(DiceAction::SIGNIN); - ASSERT_FALSE(token_service_.RefreshTokenIsAvailable(dice_params.gaia_id)); + ASSERT_FALSE( + token_service_.RefreshTokenIsAvailable(dice_params.signin_info.gaia_id)); dice_response_handler_.ProcessDiceHeader(dice_params); // Check that a GaiaAuthFetcher has been created. ASSERT_THAT(signin_client_.consumer_, testing::NotNull()); @@ -113,13 +128,15 @@ signin_client_.consumer_->OnClientOAuthSuccess( GaiaAuthConsumer::ClientOAuthResult("refresh_token", "access_token", 10)); // Check that the token has been inserted in the token service. - EXPECT_TRUE(token_service_.RefreshTokenIsAvailable(dice_params.gaia_id)); + EXPECT_TRUE( + token_service_.RefreshTokenIsAvailable(dice_params.signin_info.gaia_id)); } // Checks that a GaiaAuthFetcher failure is handled correctly. TEST_F(DiceResponseHandlerTest, SigninFailure) { DiceResponseParams dice_params = MakeDiceParams(DiceAction::SIGNIN); - ASSERT_FALSE(token_service_.RefreshTokenIsAvailable(dice_params.gaia_id)); + ASSERT_FALSE( + token_service_.RefreshTokenIsAvailable(dice_params.signin_info.gaia_id)); dice_response_handler_.ProcessDiceHeader(dice_params); // Check that a GaiaAuthFetcher has been created. ASSERT_THAT(signin_client_.consumer_, testing::NotNull()); @@ -131,14 +148,16 @@ EXPECT_EQ( 0u, dice_response_handler_.GetPendingDiceTokenFetchersCountForTesting()); // Check that the token has not been inserted in the token service. - EXPECT_FALSE(token_service_.RefreshTokenIsAvailable(dice_params.gaia_id)); + EXPECT_FALSE( + token_service_.RefreshTokenIsAvailable(dice_params.signin_info.gaia_id)); } // Checks that a second token for the same account is not requested when a // request is already in flight. TEST_F(DiceResponseHandlerTest, SigninRepeatedWithSameAccount) { DiceResponseParams dice_params = MakeDiceParams(DiceAction::SIGNIN); - ASSERT_FALSE(token_service_.RefreshTokenIsAvailable(dice_params.gaia_id)); + ASSERT_FALSE( + token_service_.RefreshTokenIsAvailable(dice_params.signin_info.gaia_id)); dice_response_handler_.ProcessDiceHeader(dice_params); // Check that a GaiaAuthFetcher has been created. GaiaAuthConsumer* consumer = signin_client_.consumer_; @@ -152,17 +171,20 @@ consumer->OnClientOAuthSuccess( GaiaAuthConsumer::ClientOAuthResult("refresh_token", "access_token", 10)); // Check that the token has been inserted in the token service. - EXPECT_TRUE(token_service_.RefreshTokenIsAvailable(dice_params.gaia_id)); + EXPECT_TRUE( + token_service_.RefreshTokenIsAvailable(dice_params.signin_info.gaia_id)); } // Checks that two SIGNIN requests can happen concurrently. TEST_F(DiceResponseHandlerTest, SigninWithTwoAccounts) { DiceResponseParams dice_params_1 = MakeDiceParams(DiceAction::SIGNIN); DiceResponseParams dice_params_2 = MakeDiceParams(DiceAction::SIGNIN); - dice_params_2.email = "other_email"; - dice_params_2.gaia_id = "other_gaia_id"; - ASSERT_FALSE(token_service_.RefreshTokenIsAvailable(dice_params_1.gaia_id)); - ASSERT_FALSE(token_service_.RefreshTokenIsAvailable(dice_params_2.gaia_id)); + dice_params_2.signin_info.email = "other_email"; + dice_params_2.signin_info.gaia_id = "other_gaia_id"; + ASSERT_FALSE(token_service_.RefreshTokenIsAvailable( + dice_params_1.signin_info.gaia_id)); + ASSERT_FALSE(token_service_.RefreshTokenIsAvailable( + dice_params_2.signin_info.gaia_id)); // Start first request. dice_response_handler_.ProcessDiceHeader(dice_params_1); // Check that a GaiaAuthFetcher has been created. @@ -177,17 +199,20 @@ consumer_1->OnClientOAuthSuccess( GaiaAuthConsumer::ClientOAuthResult("refresh_token", "access_token", 10)); // Check that the token has been inserted in the token service. - EXPECT_TRUE(token_service_.RefreshTokenIsAvailable(dice_params_1.gaia_id)); + EXPECT_TRUE(token_service_.RefreshTokenIsAvailable( + dice_params_1.signin_info.gaia_id)); // Simulate GaiaAuthFetcher success for the second request. consumer_2->OnClientOAuthSuccess( GaiaAuthConsumer::ClientOAuthResult("refresh_token", "access_token", 10)); // Check that the token has been inserted in the token service. - EXPECT_TRUE(token_service_.RefreshTokenIsAvailable(dice_params_2.gaia_id)); + EXPECT_TRUE(token_service_.RefreshTokenIsAvailable( + dice_params_2.signin_info.gaia_id)); } TEST_F(DiceResponseHandlerTest, Timeout) { DiceResponseParams dice_params = MakeDiceParams(DiceAction::SIGNIN); - ASSERT_FALSE(token_service_.RefreshTokenIsAvailable(dice_params.gaia_id)); + ASSERT_FALSE( + token_service_.RefreshTokenIsAvailable(dice_params.signin_info.gaia_id)); dice_response_handler_.ProcessDiceHeader(dice_params); // Check that a GaiaAuthFetcher has been created. ASSERT_THAT(signin_client_.consumer_, testing::NotNull()); @@ -199,7 +224,75 @@ EXPECT_EQ( 0u, dice_response_handler_.GetPendingDiceTokenFetchersCountForTesting()); // Check that the token has not been inserted in the token service. - EXPECT_FALSE(token_service_.RefreshTokenIsAvailable(dice_params.gaia_id)); + EXPECT_FALSE( + token_service_.RefreshTokenIsAvailable(dice_params.signin_info.gaia_id)); +} + +TEST_F(DiceResponseHandlerTest, SignoutMainAccount) { + const char kSecondaryGaiaID[] = "secondary_account"; + DiceResponseParams dice_params = MakeDiceParams(DiceAction::SIGNOUT); + // User is signed in to Chrome, and has some refresh token for a secondary + // account. + signin_manager_.SignIn(dice_params.signout_info.gaia_id[0], + dice_params.signout_info.email[0], "password"); + token_service_.UpdateCredentials(dice_params.signout_info.gaia_id[0], + "token1"); + token_service_.UpdateCredentials(kSecondaryGaiaID, "token2"); + EXPECT_TRUE(token_service_.RefreshTokenIsAvailable( + dice_params.signout_info.gaia_id[0])); + EXPECT_TRUE(token_service_.RefreshTokenIsAvailable(kSecondaryGaiaID)); + EXPECT_TRUE(signin_manager_.IsAuthenticated()); + // Receive signout response for the main account. + dice_response_handler_.ProcessDiceHeader(dice_params); + // User is signed out and all tokens are cleared. + EXPECT_FALSE(token_service_.RefreshTokenIsAvailable( + dice_params.signout_info.gaia_id[0])); + EXPECT_FALSE(token_service_.RefreshTokenIsAvailable(kSecondaryGaiaID)); + EXPECT_FALSE(signin_manager_.IsAuthenticated()); +} + +TEST_F(DiceResponseHandlerTest, SignoutSecondaryAccount) { + const char kMainGaiaID[] = "main_account"; + DiceResponseParams dice_params = MakeDiceParams(DiceAction::SIGNOUT); + // User is signed in to Chrome, and has some refresh token for a secondary + // account. + signin_manager_.SignIn(kMainGaiaID, "user", "password"); + token_service_.UpdateCredentials(kMainGaiaID, "token2"); + token_service_.UpdateCredentials(dice_params.signout_info.gaia_id[0], + "token1"); + EXPECT_TRUE(token_service_.RefreshTokenIsAvailable( + dice_params.signout_info.gaia_id[0])); + EXPECT_TRUE(token_service_.RefreshTokenIsAvailable(kMainGaiaID)); + EXPECT_TRUE(signin_manager_.IsAuthenticated()); + // Receive signout response for the secondary account. + dice_response_handler_.ProcessDiceHeader(dice_params); + // Only the token corresponding the the Dice parameter has been removed, and + // the user is still signed in. + EXPECT_FALSE(token_service_.RefreshTokenIsAvailable( + dice_params.signout_info.gaia_id[0])); + EXPECT_TRUE(token_service_.RefreshTokenIsAvailable(kMainGaiaID)); + EXPECT_TRUE(signin_manager_.IsAuthenticated()); +} + +TEST_F(DiceResponseHandlerTest, SignoutWebOnly) { + const char kSecondaryGaiaID[] = "secondary_account"; + DiceResponseParams dice_params = MakeDiceParams(DiceAction::SIGNOUT); + // User is NOT signed in to Chrome, and has some refresh tokens for two + // accounts. + token_service_.UpdateCredentials(dice_params.signout_info.gaia_id[0], + "refresh_token"); + token_service_.UpdateCredentials(kSecondaryGaiaID, "refresh_token"); + EXPECT_TRUE(token_service_.RefreshTokenIsAvailable( + dice_params.signout_info.gaia_id[0])); + EXPECT_TRUE(token_service_.RefreshTokenIsAvailable(kSecondaryGaiaID)); + EXPECT_FALSE(signin_manager_.IsAuthenticated()); + // Receive signout response. + dice_response_handler_.ProcessDiceHeader(dice_params); + // Only the token corresponding the the Dice parameter has been removed. + EXPECT_FALSE(token_service_.RefreshTokenIsAvailable( + dice_params.signout_info.gaia_id[0])); + EXPECT_TRUE(token_service_.RefreshTokenIsAvailable(kSecondaryGaiaID)); + EXPECT_FALSE(signin_manager_.IsAuthenticated()); } // Tests that the DiceResponseHandler is created for a normal profile but not
diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc index 872d405..af4695e 100644 --- a/chrome/browser/ssl/ssl_blocking_page.cc +++ b/chrome/browser/ssl/ssl_blocking_page.cc
@@ -99,10 +99,15 @@ content::WebContents* web_contents, int cert_error, const GURL& request_url, - bool overridable) { + bool overridable, + bool is_superfish) { security_interstitials::MetricsHelper::ReportDetails reporting_info; - reporting_info.metric_prefix = - overridable ? "ssl_overridable" : "ssl_nonoverridable"; + if (is_superfish) { + reporting_info.metric_prefix = "superfish"; + } else { + reporting_info.metric_prefix = + overridable ? "ssl_overridable" : "ssl_nonoverridable"; + } return base::MakeUnique<ChromeMetricsHelper>( web_contents, request_url, reporting_info, GetSamplingEventName(overridable, cert_error)); @@ -143,8 +148,8 @@ else options_mask &= ~SSLErrorUI::SOFT_OVERRIDE_ENABLED; - std::unique_ptr<ChromeMetricsHelper> metrics_helper( - CreateMetricsHelper(web_contents, cert_error, request_url, overridable)); + std::unique_ptr<ChromeMetricsHelper> metrics_helper(CreateMetricsHelper( + web_contents, cert_error, request_url, overridable, is_superfish)); metrics_helper.get()->StartRecordingCaptivePortalMetrics(overridable); return new SSLBlockingPage(web_contents, cert_error, ssl_info, request_url,
diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc index 329bc3d..8a3af9f1 100644 --- a/chrome/browser/ssl/ssl_browser_tests.cc +++ b/chrome/browser/ssl/ssl_browser_tests.cc
@@ -5048,6 +5048,10 @@ // Tests that the Superfish interstitial is shown when the Finch feature is // enabled and the Superfish certificate is present. IN_PROC_BROWSER_TEST_F(SuperfishSSLUITest, SuperfishInterstitial) { + base::HistogramTester histograms; + const char kDecisionHistogram[] = "interstitial.superfish.decision"; + const char kInteractionHistogram[] = "interstitial.superfish.interaction"; + base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitFromCommandLine("SuperfishInterstitial", std::string()); @@ -5069,6 +5073,15 @@ l10n_util::GetStringUTF8(IDS_SSL_SUPERFISH_HEADING); EXPECT_TRUE(chrome_browser_interstitials::IsInterstitialDisplayingText( interstitial_page, expected_title)); + + // Check that the correct histograms were recorded. + histograms.ExpectTotalCount(kDecisionHistogram, 1); + histograms.ExpectBucketCount(kDecisionHistogram, + security_interstitials::MetricsHelper::SHOW, 1); + histograms.ExpectTotalCount(kInteractionHistogram, 1); + histograms.ExpectBucketCount( + kInteractionHistogram, + security_interstitials::MetricsHelper::TOTAL_VISITS, 1); } // Tests that the Superfish interstitial is not shown when the Finch feature is
diff --git a/chrome/browser/subresource_filter/subresource_filter_content_settings_manager_unittest.cc b/chrome/browser/subresource_filter/subresource_filter_content_settings_manager_unittest.cc index c7ee05f..ef02b82 100644 --- a/chrome/browser/subresource_filter/subresource_filter_content_settings_manager_unittest.cc +++ b/chrome/browser/subresource_filter/subresource_filter_content_settings_manager_unittest.cc
@@ -78,7 +78,7 @@ for (const auto& it : host_settings) { // Need GURL conversion to get rid of unnecessary default ports. if (GURL(it.primary_pattern.ToString()) == url_with_empty_path) - return it.setting; + return it.GetContentSetting(); } return CONTENT_SETTING_DEFAULT; }
diff --git a/chrome/browser/supervised_user/legacy/supervised_user_registration_utility.cc b/chrome/browser/supervised_user/legacy/supervised_user_registration_utility.cc index 24bcf09..2fa9ccd 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_registration_utility.cc +++ b/chrome/browser/supervised_user/legacy/supervised_user_registration_utility.cc
@@ -10,6 +10,7 @@ #include "base/base64.h" #include "base/bind.h" #include "base/command_line.h" +#include "base/feature_list.h" #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/rand_util.h" @@ -27,6 +28,7 @@ #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h" #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service_factory.h" #include "chrome/browser/supervised_user/supervised_user_constants.h" +#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "components/prefs/pref_service.h" @@ -157,6 +159,8 @@ return base::WrapUnique(result); } + DCHECK(base::FeatureList::IsEnabled(features::kSupervisedUserCreation)); + ProfileOAuth2TokenService* token_service = ProfileOAuth2TokenServiceFactory::GetForProfile(profile); SigninManagerBase* signin_manager =
diff --git a/chrome/browser/task_manager/providers/arc/arc_process_task_provider.cc b/chrome/browser/task_manager/providers/arc/arc_process_task_provider.cc index 546d3ea..ebbdbdf 100644 --- a/chrome/browser/task_manager/providers/arc/arc_process_task_provider.cc +++ b/chrome/browser/task_manager/providers/arc/arc_process_task_provider.cc
@@ -93,14 +93,14 @@ } void ArcProcessTaskProvider::OnUpdateAppProcessList( - const std::vector<ArcProcess>& processes) { + std::vector<ArcProcess> processes) { TRACE_EVENT0("browser", "ArcProcessTaskProvider::OnUpdateAppProcessList"); UpdateProcessList(&nspid_to_task_, processes); ScheduleNextAppRequest(); } void ArcProcessTaskProvider::OnUpdateSystemProcessList( - const std::vector<ArcProcess>& processes) { + std::vector<ArcProcess> processes) { UpdateProcessList(&nspid_to_sys_task_, processes); ScheduleNextSystemRequest(); }
diff --git a/chrome/browser/task_manager/providers/arc/arc_process_task_provider.h b/chrome/browser/task_manager/providers/arc/arc_process_task_provider.h index 56e8d2e..e7565d8 100644 --- a/chrome/browser/task_manager/providers/arc/arc_process_task_provider.h +++ b/chrome/browser/task_manager/providers/arc/arc_process_task_provider.h
@@ -50,8 +50,8 @@ void UpdateProcessList(ArcTaskMap* pid_to_task, const std::vector<arc::ArcProcess>& processes); - void OnUpdateAppProcessList(const std::vector<arc::ArcProcess>& processes); - void OnUpdateSystemProcessList(const std::vector<arc::ArcProcess>& processes); + void OnUpdateAppProcessList(std::vector<arc::ArcProcess> processes); + void OnUpdateSystemProcessList(std::vector<arc::ArcProcess> processes); // task_manager::TaskProvider: void StartUpdating() override;
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc index f5c851be..420b7d6 100644 --- a/chrome/browser/themes/theme_service.cc +++ b/chrome/browser/themes/theme_service.cc
@@ -849,7 +849,8 @@ {base::MayBlock(), base::TaskPriority::USER_BLOCKING}); build_extension_task_tracker_.PostTaskAndReply( task_runner.get(), FROM_HERE, - base::Bind(&BrowserThemePack::BuildFromExtension, extension, pack), + base::Bind(&BrowserThemePack::BuildFromExtension, + base::RetainedRef(extension), pack), base::Bind(&ThemeService::OnThemeBuiltFromExtension, weak_ptr_factory_.GetWeakPtr(), extension->id(), pack, suppress_infobar));
diff --git a/chrome/browser/thumbnails/simple_thumbnail_crop.cc b/chrome/browser/thumbnails/simple_thumbnail_crop.cc index 9abdb02..27f0f13 100644 --- a/chrome/browser/thumbnails/simple_thumbnail_crop.cc +++ b/chrome/browser/thumbnails/simple_thumbnail_crop.cc
@@ -4,19 +4,8 @@ #include "chrome/browser/thumbnails/simple_thumbnail_crop.h" -#include "base/metrics/histogram_macros.h" #include "content/public/browser/browser_thread.h" -#include "skia/ext/platform_canvas.h" -#include "ui/base/layout.h" -#include "ui/gfx/color_utils.h" #include "ui/gfx/geometry/size_conversions.h" -#include "ui/gfx/image/image_skia.h" -#include "ui/gfx/scrollbar_size.h" -#include "ui/gfx/skbitmap_operations.h" - -namespace { -static const char kThumbnailHistogramName[] = "Thumbnail.ComputeMS"; -} namespace thumbnails { @@ -36,32 +25,6 @@ return clip_result; } -void SimpleThumbnailCrop::ProcessBitmap( - scoped_refptr<ThumbnailingContext> context, - const ConsumerCallback& callback, - const SkBitmap& bitmap) { - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - if (bitmap.isNull() || bitmap.empty()) - return; - - DCHECK(context->clip_result != thumbnails::CLIP_RESULT_UNPROCESSED); - // TODO(treib): Getting the maximum supported scale here seems pointless - - // we only read back what GetCopySizeForThumbnail said. The max scale could - // only ever be smaller in the 1x -> 2x hack case (see - // GetCopySizeForThumbnail), but that seems like a bug - why would we scale - // on the CPU in that case? - SkBitmap thumbnail = - CreateThumbnail(bitmap, ComputeTargetSizeAtMaximumScale(target_size_)); - - context->score.boring_score = color_utils::CalculateBoringScore(thumbnail); - context->score.good_clipping = - (context->clip_result == CLIP_RESULT_WIDER_THAN_TALL || - context->clip_result == CLIP_RESULT_TALLER_THAN_WIDE || - context->clip_result == CLIP_RESULT_NOT_CLIPPED); - - callback.Run(*context.get(), thumbnail); -} - // RenderWidgetHostView::CopyFromSurface() can be costly especially when it is // necessary to read back the web contents image data from GPU. As the cost is // roughly proportional to the number of the copied pixels, the size of the @@ -123,33 +86,6 @@ return clipping_rect; } -// static -gfx::Size SimpleThumbnailCrop::ComputeTargetSizeAtMaximumScale( - const gfx::Size& given_size) { - // TODO(mazda|oshima): Update thumbnail when the max scale factor changes. - // crbug.com/159157. - float max_scale_factor = gfx::ImageSkia::GetMaxSupportedScale(); - return gfx::ScaleToFlooredSize(given_size, max_scale_factor); -} - -SimpleThumbnailCrop::~SimpleThumbnailCrop() { -} - -// Creates a downsampled thumbnail from the given bitmap. -// store. The returned bitmap will be isNull if there was an error creating it. -SkBitmap SimpleThumbnailCrop::CreateThumbnail(const SkBitmap& bitmap, - const gfx::Size& desired_size) { - base::TimeTicks begin_compute_thumbnail = base::TimeTicks::Now(); - - // Need to resize it to the size we want, so downsample until it's - // close, and let the caller make it the exact size if desired. - // TODO(treib): This is probably pointless, see TODO in ProcessBitmap. - SkBitmap result = SkBitmapOperations::DownsampleByTwoUntilSize( - bitmap, desired_size.width(), desired_size.height()); - - LOCAL_HISTOGRAM_TIMES(kThumbnailHistogramName, - base::TimeTicks::Now() - begin_compute_thumbnail); - return result; -} +SimpleThumbnailCrop::~SimpleThumbnailCrop() = default; } // namespace thumbnails
diff --git a/chrome/browser/thumbnails/simple_thumbnail_crop.h b/chrome/browser/thumbnails/simple_thumbnail_crop.h index 9440540..c80721cc 100644 --- a/chrome/browser/thumbnails/simple_thumbnail_crop.h +++ b/chrome/browser/thumbnails/simple_thumbnail_crop.h
@@ -24,10 +24,6 @@ gfx::Rect* clipping_rect, gfx::Size* copy_size) const override; - void ProcessBitmap(scoped_refptr<ThumbnailingContext> context, - const ConsumerCallback& callback, - const SkBitmap& bitmap) override; - // Returns the size copied from the backing store. |thumbnail_size| is in // DIP, returned size in pixels. static gfx::Size GetCopySizeForThumbnail(ui::ScaleFactor scale_factor, @@ -36,19 +32,10 @@ const gfx::Size& desired_size, ClipResult* clip_result); - // Computes the size of a thumbnail that should be stored in the database from - // |given_size| (expected to be the thumbnail size we would normally want to - // see). The returned size is expressed in pixels and is determined by - // bumping the resolution up to the maximum scale factor. - static gfx::Size ComputeTargetSizeAtMaximumScale(const gfx::Size& given_size); - protected: ~SimpleThumbnailCrop() override; private: - static SkBitmap CreateThumbnail(const SkBitmap& bitmap, - const gfx::Size& desired_size); - // The target size of the captured thumbnails, in DIPs. const gfx::Size target_size_;
diff --git a/chrome/browser/thumbnails/thumbnail_service_impl.cc b/chrome/browser/thumbnails/thumbnail_service_impl.cc index fc4bc8c6..632adc1 100644 --- a/chrome/browser/thumbnails/thumbnail_service_impl.cc +++ b/chrome/browser/thumbnails/thumbnail_service_impl.cc
@@ -118,7 +118,7 @@ !current_score.ShouldConsiderUpdating()) { return false; } - // Skip if we don't have to udpate the temporary thumbnail (i.e. the one + // Skip if we don't have to update the temporary thumbnail (i.e. the one // not yet saved). ThumbnailScore temporary_score; if (local_ptr->GetTemporaryPageThumbnailScore(url, &temporary_score) &&
diff --git a/chrome/browser/thumbnails/thumbnail_tab_helper.cc b/chrome/browser/thumbnails/thumbnail_tab_helper.cc index a2075b76..6d470f8 100644 --- a/chrome/browser/thumbnails/thumbnail_tab_helper.cc +++ b/chrome/browser/thumbnails/thumbnail_tab_helper.cc
@@ -19,12 +19,12 @@ #include "content/public/browser/render_view_host.h" #include "content/public/browser/render_widget_host.h" #include "content/public/browser/render_widget_host_view.h" +#include "third_party/skia/include/core/SkBitmap.h" +#include "ui/gfx/color_utils.h" #include "ui/gfx/scrollbar_size.h" DEFINE_WEB_CONTENTS_USER_DATA_KEY(ThumbnailTabHelper); -class SkBitmap; - // Overview // -------- // This class provides a service for updating thumbnails to be used in @@ -208,12 +208,11 @@ copy_from_surface_start_time_ = base::TimeTicks::Now(); view->CopyFromSurface(copy_rect, thumbnailing_context_->requested_copy_size, base::Bind(&ThumbnailTabHelper::ProcessCapturedBitmap, - weak_factory_.GetWeakPtr(), algorithm), + weak_factory_.GetWeakPtr()), kN32_SkColorType); } void ThumbnailTabHelper::ProcessCapturedBitmap( - scoped_refptr<ThumbnailingAlgorithm> algorithm, const SkBitmap& bitmap, content::ReadbackResponse response) { base::TimeDelta copy_from_surface_time = @@ -223,11 +222,20 @@ if (response == content::READBACK_SUCCESS) { // On success, we must be on the UI thread. DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - process_bitmap_start_time_ = base::TimeTicks::Now(); - algorithm->ProcessBitmap(thumbnailing_context_, - base::Bind(&ThumbnailTabHelper::UpdateThumbnail, - weak_factory_.GetWeakPtr()), - bitmap); + base::TimeTicks process_bitmap_start_time = base::TimeTicks::Now(); + if (!bitmap.isNull() && !bitmap.empty()) { + // TODO(treib): Move this off the UI thread. crbug.com/737396 + thumbnailing_context_->score.boring_score = + color_utils::CalculateBoringScore(bitmap); + + thumbnailing_context_->score.good_clipping = + thumbnails::IsGoodClipping(thumbnailing_context_->clip_result); + } + base::TimeDelta process_bitmap_time = + base::TimeTicks::Now() - process_bitmap_start_time; + UMA_HISTOGRAM_TIMES("Thumbnails.ProcessBitmapTime", process_bitmap_time); + + UpdateThumbnail(bitmap); } else { // On failure because of shutdown we are not on the UI thread, so ensure // that cleanup happens on that thread. @@ -239,18 +247,15 @@ } } -void ThumbnailTabHelper::UpdateThumbnail(const ThumbnailingContext& context, - const SkBitmap& thumbnail) { +void ThumbnailTabHelper::UpdateThumbnail(const SkBitmap& thumbnail) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - base::TimeDelta process_bitmap_time = - base::TimeTicks::Now() - process_bitmap_start_time_; - UMA_HISTOGRAM_TIMES("Thumbnails.ProcessBitmapTime", process_bitmap_time); // Feed the constructed thumbnail to the thumbnail service. gfx::Image image = gfx::Image::CreateFrom1xBitmap(thumbnail); - context.service->SetPageThumbnail(context, image); - DVLOG(1) << "Thumbnail taken for " << context.url << ": " - << context.score.ToString(); + thumbnailing_context_->service->SetPageThumbnail(*thumbnailing_context_, + image); + DVLOG(1) << "Thumbnail taken for " << thumbnailing_context_->url << ": " + << thumbnailing_context_->score.ToString(); CleanUpFromThumbnailGeneration(); }
diff --git a/chrome/browser/thumbnails/thumbnail_tab_helper.h b/chrome/browser/thumbnails/thumbnail_tab_helper.h index f48af331..bd824c0 100644 --- a/chrome/browser/thumbnails/thumbnail_tab_helper.h +++ b/chrome/browser/thumbnails/thumbnail_tab_helper.h
@@ -57,14 +57,11 @@ // Create a thumbnail from the web contents bitmap. void ProcessCapturedBitmap( - scoped_refptr<thumbnails::ThumbnailingAlgorithm> algorithm, const SkBitmap& bitmap, content::ReadbackResponse response); // Pass the thumbnail to the thumbnail service. - void UpdateThumbnail( - const thumbnails::ThumbnailingContext& context, - const SkBitmap& thumbnail); + void UpdateThumbnail(const SkBitmap& thumbnail); // Clean up after thumbnail generation has ended. void CleanUpFromThumbnailGeneration(); @@ -85,7 +82,6 @@ scoped_refptr<thumbnails::ThumbnailingContext> thumbnailing_context_; base::TimeTicks copy_from_surface_start_time_; - base::TimeTicks process_bitmap_start_time_; base::WeakPtrFactory<ThumbnailTabHelper> weak_factory_;
diff --git a/chrome/browser/thumbnails/thumbnailing_algorithm.h b/chrome/browser/thumbnails/thumbnailing_algorithm.h index cf5a487..df9c827b 100644 --- a/chrome/browser/thumbnails/thumbnailing_algorithm.h +++ b/chrome/browser/thumbnails/thumbnailing_algorithm.h
@@ -7,12 +7,10 @@ #include "base/memory/ref_counted.h" #include "chrome/browser/thumbnails/thumbnailing_context.h" -#include "ui/base/layout.h" +#include "ui/base/resource/scale_factor.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" -class SkBitmap; - namespace thumbnails { // An interface abstracting thumbnailing algorithms. Instances are intended to @@ -21,8 +19,6 @@ class ThumbnailingAlgorithm : public base::RefCountedThreadSafe<ThumbnailingAlgorithm> { public: - typedef base::Callback<void(const ThumbnailingContext&, const SkBitmap&)> - ConsumerCallback; // Provides information necessary to crop-and-resize image data from a source // canvas of |source_size|. Auxiliary |scale_factor| helps compute the target // thumbnail size to be copied from the backing store, in pixels. Parameters @@ -35,18 +31,6 @@ gfx::Rect* clipping_rect, gfx::Size* copy_size) const = 0; - // Invoked to produce a thumbnail image from a |bitmap| extracted by the - // callee from source canvas according to instructions provided by a call - // to GetCanvasCopyInfo. - // Note that ProcessBitmap must be able to handle bitmaps which might have not - // been processed (scalled/cropped) as requested. |context| gives additional - // information on the source, including if and how it was clipped. - // The function shall invoke |callback| once done, passing in fully populated - // |context| along with resulting thumbnail bitmap. - virtual void ProcessBitmap(scoped_refptr<ThumbnailingContext> context, - const ConsumerCallback& callback, - const SkBitmap& bitmap) = 0; - protected: virtual ~ThumbnailingAlgorithm() {} friend class base::RefCountedThreadSafe<ThumbnailingAlgorithm>;
diff --git a/chrome/browser/thumbnails/thumbnailing_context.cc b/chrome/browser/thumbnails/thumbnailing_context.cc index 04765e6..28add9fe 100644 --- a/chrome/browser/thumbnails/thumbnailing_context.cc +++ b/chrome/browser/thumbnails/thumbnailing_context.cc
@@ -9,6 +9,12 @@ namespace thumbnails { +bool IsGoodClipping(ClipResult clip_result) { + return clip_result == CLIP_RESULT_WIDER_THAN_TALL || + clip_result == CLIP_RESULT_TALLER_THAN_WIDE || + clip_result == CLIP_RESULT_NOT_CLIPPED; +} + ThumbnailingContext::ThumbnailingContext(content::WebContents* web_contents, ThumbnailService* receiving_service, bool load_interrupted)
diff --git a/chrome/browser/thumbnails/thumbnailing_context.h b/chrome/browser/thumbnails/thumbnailing_context.h index 6575441e..e9493b1 100644 --- a/chrome/browser/thumbnails/thumbnailing_context.h +++ b/chrome/browser/thumbnails/thumbnailing_context.h
@@ -28,10 +28,10 @@ CLIP_RESULT_TALLER_THAN_WIDE, // The source and destination aspect ratios are identical. CLIP_RESULT_NOT_CLIPPED, - // The source and destination are identical. - CLIP_RESULT_SOURCE_SAME_AS_TARGET, }; +bool IsGoodClipping(ClipResult clip_result); + // Holds the information needed for processing a thumbnail. struct ThumbnailingContext : base::RefCountedThreadSafe<ThumbnailingContext> { ThumbnailingContext(content::WebContents* web_contents,
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index a67bee2f..8e3adb44 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -1540,6 +1540,8 @@ "views/harmony/harmony_layout_provider.h", "views/harmony/harmony_typography_provider.cc", "views/harmony/harmony_typography_provider.h", + "views/importer/import_lock_dialog_view.cc", + "views/importer/import_lock_dialog_view.h", "views/location_bar/location_bar_bubble_delegate_view.cc", "views/location_bar/location_bar_bubble_delegate_view.h", "views/location_bar/zoom_bubble_view.cc", @@ -1831,8 +1833,6 @@ "views/hung_renderer_view.h", "views/ime/ime_warning_bubble_view.cc", "views/ime/ime_warning_bubble_view.h", - "views/importer/import_lock_dialog_view.cc", - "views/importer/import_lock_dialog_view.h", "views/infobars/alternate_nav_infobar_view.cc", "views/infobars/alternate_nav_infobar_view.h", "views/infobars/confirm_infobar.cc",
diff --git a/chrome/browser/ui/android/ssl_client_certificate_request.cc b/chrome/browser/ui/android/ssl_client_certificate_request.cc index 9bc2698..3d9a25e 100644 --- a/chrome/browser/ui/android/ssl_client_certificate_request.cc +++ b/chrome/browser/ui/android/ssl_client_certificate_request.cc
@@ -18,6 +18,7 @@ #include "chrome/browser/ui/android/view_android_helper.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/client_certificate_delegate.h" +#include "device/vr/features/features.h" #include "jni/SSLClientCertificateRequest_jni.h" #include "net/base/host_port_pair.h" #include "net/cert/cert_database.h" @@ -29,6 +30,10 @@ #include "ui/android/view_android.h" #include "ui/android/window_android.h" +#if BUILDFLAG(ENABLE_VR) +#include "chrome/browser/android/vr_shell/vr_tab_helper.h" +#endif // BUILDFLAG(ENABLE_VR) + using base::android::JavaParamRef; using base::android::ScopedJavaLocalRef; @@ -188,6 +193,12 @@ net::SSLCertRequestInfo* cert_request_info, net::ClientCertIdentityList unused_client_certs, std::unique_ptr<content::ClientCertificateDelegate> delegate) { +#if BUILDFLAG(ENABLE_VR) + if (vr_shell::VrTabHelper::IsInVr(contents)) { + delegate->ContinueWithCertificate(nullptr, nullptr); + return; + } +#endif // BUILDFLAG(ENABLE_VR) ui::WindowAndroid* window = ViewAndroidHelper::FromWebContents(contents) ->GetViewAndroid()->GetWindowAndroid(); DCHECK(window);
diff --git a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc index abbb6f40..9e495acd 100644 --- a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc +++ b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
@@ -6,7 +6,6 @@ #include <string> -#include "ash/metrics/user_metrics_recorder.h" #include "ash/public/cpp/shelf_model.h" #include "ash/shelf/shelf.h" #include "ash/shelf/shelf_widget.h" @@ -14,7 +13,7 @@ #include "ash/strings/grit/ash_strings.h" #include "ash/wallpaper/wallpaper_delegate.h" #include "ash/wm/maximize_mode/maximize_mode_controller.h" -#include "build/build_config.h" +#include "base/metrics/user_metrics.h" #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" #include "chrome/browser/fullscreen.h" #include "chrome/browser/profiles/profile.h" @@ -125,13 +124,12 @@ // TODO(simonhong): Use ShelfItemDelegate::Close(). controller_->Close(item_.id); } - ash::Shell::Get()->metrics()->RecordUserMetricsAction( - ash::UMA_CLOSE_THROUGH_CONTEXT_MENU); + base::RecordAction(base::UserMetricsAction("CloseFromContextMenu")); if (ash::Shell::Get() ->maximize_mode_controller() ->IsMaximizeModeWindowManagerEnabled()) { - ash::Shell::Get()->metrics()->RecordUserMetricsAction( - ash::UMA_TABLET_WINDOW_CLOSE_THROUGH_CONTXT_MENU); + base::RecordAction( + base::UserMetricsAction("Tablet_WindowCloseFromContextMenu")); } break; case MENU_PIN:
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 29a59d8b..c068168 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc
@@ -1064,12 +1064,6 @@ exclusive_access_manager_->OnTabDetachedFromView(old_contents); - // Discarded tabs always get reloaded. - // TODO(georgesak): Validate the usefulness of this. And if needed then move - // to TabManager. - if (g_browser_process->GetTabManager()->IsTabDiscarded(new_contents)) - chrome::Reload(this, WindowOpenDisposition::CURRENT_TAB); - // If we have any update pending, do it now. if (chrome_updater_factory_.HasWeakPtrs() && old_contents) ProcessPendingUIUpdates();
diff --git a/chrome/browser/ui/cocoa/browser_dialogs_views_mac.cc b/chrome/browser/ui/cocoa/browser_dialogs_views_mac.cc index 1494ed4..1ece5dd 100644 --- a/chrome/browser/ui/cocoa/browser_dialogs_views_mac.cc +++ b/chrome/browser/ui/cocoa/browser_dialogs_views_mac.cc
@@ -12,6 +12,7 @@ #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" #include "chrome/browser/ui/views/content_setting_bubble_contents.h" +#include "chrome/browser/ui/views/importer/import_lock_dialog_view.h" #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" #include "chrome/browser/ui/views/page_info/page_info_bubble_view.h" #include "chrome/browser/ui/views/task_manager_view.h" @@ -120,4 +121,9 @@ UpdateRecommendedMessageBox::Show(parent); } +void ShowImportLockDialogViews(gfx::NativeWindow parent, + const base::Callback<void(bool)>& callback) { + return ImportLockDialogView::Show(parent, callback); +} + } // namespace chrome
diff --git a/chrome/browser/ui/cocoa/browser_dialogs_views_mac.h b/chrome/browser/ui/cocoa/browser_dialogs_views_mac.h index 15f5cfe..94dd571 100644 --- a/chrome/browser/ui/cocoa/browser_dialogs_views_mac.h +++ b/chrome/browser/ui/cocoa/browser_dialogs_views_mac.h
@@ -83,6 +83,10 @@ DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingBubbleViewsBridge); }; +// Shows the import lock dialog. +void ShowImportLockDialogViews(gfx::NativeWindow parent, + const base::Callback<void(bool)>& callback); + } // namespace chrome #endif // CHROME_BROWSER_UI_COCOA_BROWSER_DIALOGS_VIEWS_MAC_H_
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm index 710ff90..38acfd7 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -1085,8 +1085,10 @@ manager->DisplayPendingRequests(); } - if ([self isInAnyFullscreenMode]) - [[self fullscreenToolbarController] revealToolbarForTabStripChanges]; + if ([self isInAnyFullscreenMode]) { + [[self fullscreenToolbarController] revealToolbarForWebContents:newContents + inForeground:YES]; + } } - (void)zoomChangedForActiveTab:(BOOL)canShowBubble { @@ -1525,9 +1527,12 @@ [infoBarContainerController_ tabDetachedWithContents:contents]; } -- (void)onTabInsertedInForeground:(BOOL)inForeground { +- (void)onTabInsertedWithContents:(content::WebContents*)contents + inForeground:(BOOL)inForeground { if ([self isInAnyFullscreenMode] && !inForeground) - [[self fullscreenToolbarController] revealToolbarForTabStripChanges]; + [[self fullscreenToolbarController] + revealToolbarForWebContents:contents + inForeground:inForeground]; if (inForeground) { AppToolbarButton* appMenuButton =
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm b/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm index 630d4d6..fd79d5ff 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm
@@ -189,26 +189,28 @@ @interface MockFullscreenToolbarController : FullscreenToolbarController // True if revealToolbarForTabStripChanges was called. -@property(nonatomic, assign) BOOL isRevealingToolbarForTabstrip; +@property(nonatomic, assign) BOOL isRevealingToolbar; // Sets isRevealingToolbarForTabstrip back to false. - (void)resetToolbarFlag; // Overridden to set isRevealingToolbarForTabstrip to true when it's called. -- (void)revealToolbarForTabStripChanges; +- (void)revealToolbarForWebContents:(content::WebContents*)contents + inForeground:(BOOL)inForeground; @end @implementation MockFullscreenToolbarController -@synthesize isRevealingToolbarForTabstrip = isRevealingToolbarForTabstrip_; +@synthesize isRevealingToolbar = isRevealingToolbar_; - (void)resetToolbarFlag { - isRevealingToolbarForTabstrip_ = NO; + isRevealingToolbar_ = NO; } -- (void)revealToolbarForTabStripChanges { - isRevealingToolbarForTabstrip_ = YES; +- (void)revealToolbarForWebContents:(content::WebContents*)contents + inForeground:(BOOL)inForeground { + isRevealingToolbar_ = YES; } @end @@ -767,29 +769,29 @@ // Insert a non-NTP new tab in the foreground. AddTabAtIndex(0, GURL("http://google.com"), ui::PAGE_TRANSITION_LINK); ASSERT_FALSE([[controller() toolbarController] isLocationBarFocused]); - EXPECT_TRUE([fullscreenToolbarController isRevealingToolbarForTabstrip]); + EXPECT_TRUE([fullscreenToolbarController isRevealingToolbar]); [fullscreenToolbarController resetToolbarFlag]; // Insert a new tab in the background. AddTabAtBackground(0, GURL("about:blank")); - EXPECT_TRUE([fullscreenToolbarController isRevealingToolbarForTabstrip]); + EXPECT_TRUE([fullscreenToolbarController isRevealingToolbar]); [fullscreenToolbarController resetToolbarFlag]; // Insert a NTP new tab in the foreground. AddTabAtIndex(0, GURL("about:blank"), ui::PAGE_TRANSITION_LINK); ASSERT_TRUE([[controller() toolbarController] isLocationBarFocused]); - EXPECT_TRUE([fullscreenToolbarController isRevealingToolbarForTabstrip]); + EXPECT_TRUE([fullscreenToolbarController isRevealingToolbar]); [fullscreenToolbarController resetToolbarFlag]; AddTabAtBackground(1, GURL("http://google.com")); ASSERT_TRUE([[controller() toolbarController] isLocationBarFocused]); - EXPECT_TRUE([fullscreenToolbarController isRevealingToolbarForTabstrip]); + EXPECT_TRUE([fullscreenToolbarController isRevealingToolbar]); [fullscreenToolbarController resetToolbarFlag]; // Switch to a non-NTP tab. TabStripModel* model = browser()->tab_strip_model(); model->ActivateTabAt(1, true); ASSERT_FALSE([[controller() toolbarController] isLocationBarFocused]); - EXPECT_TRUE([fullscreenToolbarController isRevealingToolbarForTabstrip]); + EXPECT_TRUE([fullscreenToolbarController isRevealingToolbar]); [fullscreenToolbarController resetToolbarFlag]; }
diff --git a/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_animation_controller.h b/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_animation_controller.h index 64d6133..0927b739 100644 --- a/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_animation_controller.h +++ b/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_animation_controller.h
@@ -8,18 +8,28 @@ #import <Cocoa/Cocoa.h> #include "base/timer/timer.h" +#include "content/public/browser/web_contents_observer.h" #include "ui/gfx/animation/animation_delegate.h" #include "ui/gfx/animation/slide_animation.h" +class FullscreenToolbarAnimationController; @class FullscreenToolbarController; +namespace content { +class WebContents; +} + // This class provides a controller that manages the fullscreen toolbar's // animation. -class FullscreenToolbarAnimationController : public gfx::AnimationDelegate { +class FullscreenToolbarAnimationController + : public gfx::AnimationDelegate, + public content::WebContentsObserver { public: explicit FullscreenToolbarAnimationController( FullscreenToolbarController* owner); + ~FullscreenToolbarAnimationController() override; + // Called by |owner_| when the fullscreen toolbar layout is updated. void ToolbarDidUpdate(); @@ -27,7 +37,10 @@ void StopAnimationAndTimer(); // Animates the toolbar in and out to show changes with the tabstrip. - void AnimateToolbarForTabstripChanges(); + // |contents| is the WebContents that's changed. + // |in_foreground| is true if the tabstrip change is done in the foreground. + void AnimateToolbarForTabstripChanges(content::WebContents* contents, + bool in_foreground); // Animates the toolbar in if it's not fully shown. void AnimateToolbarIn(); @@ -45,13 +58,20 @@ // Only for testing. Sets the duration of |animation_|. void SetAnimationDuration(CGFloat duration); + // content::WebContentsObserver: + void DidFirstVisuallyNonEmptyPaint() override; + // gfx::AnimationDelegate: void AnimationProgressed(const gfx::Animation* animation) override; void AnimationEnded(const gfx::Animation* animation) override; private: + // Kickstarts |hide_toolbar_timer_| if applicable. This should only be + // called after the toolbar is shown. + void StartHideTimerIfPossible(); + // Our owner. - FullscreenToolbarController* owner_; // weak + FullscreenToolbarController* owner_; // weak. // The animation of the decoration. gfx::SlideAnimation animation_; @@ -64,6 +84,8 @@ // True when the toolbar is dropped to show tabstrip changes. BOOL should_hide_toolbar_after_delay_; + + DISALLOW_COPY_AND_ASSIGN(FullscreenToolbarAnimationController); }; #endif // CHROME_BROWSER_UI_COCOA_FULLSCREEN_FULLSCREEN_TOOLBAR_ANIMATION_CONTROLLER_H_ \ No newline at end of file
diff --git a/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_animation_controller.mm b/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_animation_controller.mm index df6b951..c26fdc5 100644 --- a/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_animation_controller.mm +++ b/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_animation_controller.mm
@@ -5,6 +5,7 @@ #import "chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_animation_controller.h" #import "chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.h" +#include "content/public/browser/web_contents.h" namespace { @@ -25,7 +26,8 @@ FullscreenToolbarAnimationController::FullscreenToolbarAnimationController( FullscreenToolbarController* owner) - : owner_(owner), + : WebContentsObserver(nullptr), + owner_(owner), animation_(this), hide_toolbar_timer_( FROM_HERE, @@ -40,6 +42,8 @@ animation_.SetTweenType(gfx::Tween::EASE_OUT); } +FullscreenToolbarAnimationController::~FullscreenToolbarAnimationController() {} + void FullscreenToolbarAnimationController::ToolbarDidUpdate() { animation_start_value_ = [owner_ toolbarFraction]; } @@ -49,17 +53,25 @@ hide_toolbar_timer_.Stop(); } -void FullscreenToolbarAnimationController::AnimateToolbarForTabstripChanges() { +void FullscreenToolbarAnimationController::AnimateToolbarForTabstripChanges( + content::WebContents* contents, + bool in_foreground) { // Don't kickstart the animation if the toolbar is already displayed. if ([owner_ mustShowFullscreenToolbar]) return; if (animation_.IsShowing()) { hide_toolbar_timer_.Reset(); + Observe(nullptr); return; } should_hide_toolbar_after_delay_ = true; + if (in_foreground && contents && + !contents->CompletedFirstVisuallyNonEmptyPaint()) { + Observe(contents); + } + AnimateToolbarIn(); } @@ -97,6 +109,14 @@ } ////////////////////////////////////////////////////////////////// +// FullscreenToolbarAnimationController::WebContentsObserver: + +void FullscreenToolbarAnimationController::DidFirstVisuallyNonEmptyPaint() { + StartHideTimerIfPossible(); + Observe(nullptr); +} + +////////////////////////////////////////////////////////////////// // FullscreenToolbarAnimationController::AnimationDelegate: void FullscreenToolbarAnimationController::AnimationProgressed( @@ -106,7 +126,16 @@ void FullscreenToolbarAnimationController::AnimationEnded( const gfx::Animation* animation) { - if (animation_.IsShowing() && should_hide_toolbar_after_delay_) { + if (!web_contents() && animation_.IsShowing()) + StartHideTimerIfPossible(); +} + +////////////////////////////////////////////////////////////////// +// FullscreenToolbarAnimationController, private: + +void FullscreenToolbarAnimationController::StartHideTimerIfPossible() { + DCHECK(animation_.IsShowing()); + if (should_hide_toolbar_after_delay_) { hide_toolbar_timer_.Reset(); should_hide_toolbar_after_delay_ = false; }
diff --git a/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.h b/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.h index a38b91ce..474952e 100644 --- a/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.h +++ b/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.h
@@ -17,6 +17,10 @@ @class FullscreenToolbarVisibilityLockController; @class ImmersiveFullscreenController; +namespace content { +class WebContents; +} + // This enum class represents the appearance of the fullscreen toolbar, which // includes the tab strip and omnibox. enum class FullscreenToolbarStyle { @@ -93,7 +97,8 @@ - (void)cancelAnimationAndTimer; // Animates the toolbar dropping down to show changes to the tab strip. -- (void)revealToolbarForTabStripChanges; +- (void)revealToolbarForWebContents:(content::WebContents*)contents + inForeground:(BOOL)inForeground; // Returns the fraction of the toolbar exposed at the top. // It returns 1.0 if the toolbar is fully shown and 0.0 if the toolbar is
diff --git a/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.mm b/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.mm index f80e083f..bc36eec 100644 --- a/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.mm +++ b/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.mm
@@ -82,13 +82,15 @@ animationController_->StopAnimationAndTimer(); } -- (void)revealToolbarForTabStripChanges { +- (void)revealToolbarForWebContents:(content::WebContents*)contents + inForeground:(BOOL)inForeground { if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableFullscreenToolbarReveal)) { return; } - animationController_->AnimateToolbarForTabstripChanges(); + animationController_->AnimateToolbarForTabstripChanges(contents, + inForeground); } - (CGFloat)toolbarFraction {
diff --git a/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm b/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm index 4aa0fae3..a90ff54 100644 --- a/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm +++ b/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm
@@ -10,9 +10,11 @@ #include "base/metrics/user_metrics.h" #include "base/threading/thread_task_runner_handle.h" #include "chrome/browser/importer/importer_lock_dialog.h" +#include "chrome/browser/ui/cocoa/browser_dialogs_views_mac.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util_mac.h" +#include "ui/base/material_design/material_design_controller.h" using base::UserMetricsAction; @@ -20,6 +22,9 @@ void ShowImportLockDialog(gfx::NativeWindow parent, const base::Callback<void(bool)>& callback) { + if (ui::MaterialDesignController::IsSecondaryUiMaterial()) + return chrome::ShowImportLockDialogViews(parent, callback); + base::scoped_nsobject<NSAlert> lock_alert([[NSAlert alloc] init]); [lock_alert addButtonWithTitle:l10n_util::GetNSStringWithFixup( IDS_IMPORTER_LOCK_OK)];
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.h b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.h index a9566eaa..862d37b 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.h +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.h
@@ -51,7 +51,8 @@ // Stripped down version of // TabStripModelObserverBridge:onTabInsertedInForeground. -- (void)onTabInsertedInForeground:(BOOL)inForeground; +- (void)onTabInsertedWithContents:(content::WebContents*)contents + inForeground:(BOOL)inForeground; @end
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm index 0c224b12..25cf1b6 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
@@ -1319,7 +1319,7 @@ // else. [self updateIconsForContents:contents atIndex:modelIndex]; - [delegate_ onTabInsertedInForeground:inForeground]; + [delegate_ onTabInsertedWithContents:contents inForeground:inForeground]; } // Called before |contents| is deactivated.
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller_unittest.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller_unittest.mm index 8321fa70..1e4b7e2 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller_unittest.mm
@@ -62,7 +62,8 @@ } - (void)onTabDetachedWithContents:(WebContents*)contents { } -- (void)onTabInsertedInForeground:(BOOL)inForeground { +- (void)onTabInsertedWithContents:(WebContents*)contents + inForeground:(BOOL)inForeground { } @end
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc index 8cd5df8..4a85cca 100644 --- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -43,6 +43,7 @@ #include "components/content_settings/core/browser/content_settings_utils.h" #include "components/content_settings/core/browser/cookie_settings.h" #include "components/content_settings/core/common/content_settings.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "components/prefs/pref_service.h" #include "components/rappor/public/rappor_utils.h" #include "components/rappor/rappor_service_impl.h"
diff --git a/chrome/browser/ui/libgtkui/BUILD.gn b/chrome/browser/ui/libgtkui/BUILD.gn index 05e5209a..e24526e1 100644 --- a/chrome/browser/ui/libgtkui/BUILD.gn +++ b/chrome/browser/ui/libgtkui/BUILD.gn
@@ -8,22 +8,6 @@ import("//build/config/linux/gtk/gtk.gni") import("//printing/features/features.gni") -# gn orders flags on a target before flags from configs. The default config -# adds -Wall, and these flags have to be after -Wall -- so they need to come -# from a config and can't be on the target directly. -config("libgtkui_warnings") { - if (is_clang) { - cflags = [ - # G_DEFINE_TYPE automatically generates a *get_instance_private inline - # function after glib 2.37. That's unused. Prevent to complain about it. - "-Wno-unused-function", - - # G_STATIC_ASSERT uses a typedef as a static_assert. - "-Wno-unused-local-typedef", - ] - } -} - # Automatically depends on the GTK version associated with the current build # flags. group("libgtkui") { @@ -80,10 +64,7 @@ "x11_input_method_context_impl_gtk.h", ] - configs += [ - ":libgtkui_warnings", - "//build/config/linux:x11", - ] + configs += [ "//build/config/linux:x11" ] if (use_gconf) { sources += [ @@ -104,6 +85,7 @@ "//base:i18n", "//base/third_party/dynamic_annotations", "//cc/paint", + "//chrome/common:features", "//chrome:extra_resources", "//chrome:resources", "//chrome:strings",
diff --git a/chrome/browser/ui/page_info/page_info.cc b/chrome/browser/ui/page_info/page_info.cc index 4b93e3b..effd49e 100644 --- a/chrome/browser/ui/page_info/page_info.cc +++ b/chrome/browser/ui/page_info/page_info.cc
@@ -51,6 +51,7 @@ #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings_pattern.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "components/rappor/public/rappor_utils.h" #include "components/rappor/rappor_service_impl.h" #include "components/ssl_errors/error_info.h"
diff --git a/chrome/browser/ui/views/chrome_cleaner_dialog_browsertest_win.cc b/chrome/browser/ui/views/chrome_cleaner_dialog_browsertest_win.cc index 1eaaeef..37df5883 100644 --- a/chrome/browser/ui/views/chrome_cleaner_dialog_browsertest_win.cc +++ b/chrome/browser/ui/views/chrome_cleaner_dialog_browsertest_win.cc
@@ -27,17 +27,22 @@ : public safe_browsing::ChromeCleanerDialogController { public: MOCK_METHOD0(DialogShown, void()); - MOCK_METHOD0(Accept, void()); + MOCK_METHOD1(Accept, void(bool)); MOCK_METHOD0(Cancel, void()); MOCK_METHOD0(Close, void()); - MOCK_METHOD0(DetailsButtonClicked, void()); + MOCK_METHOD1(DetailsButtonClicked, void(bool)); + MOCK_METHOD1(SetLogsEnabled, void(bool)); + MOCK_METHOD0(LogsEnabled, bool()); }; class ChromeCleanerDialogTest : public DialogBrowserTest { public: ChromeCleanerDialogTest() : mock_dialog_controller_( - base::MakeUnique<NiceMock<MockChromeCleanerDialogController>>()) {} + base::MakeUnique<NiceMock<MockChromeCleanerDialogController>>()) { + ON_CALL(*mock_dialog_controller_, LogsEnabled()) + .WillByDefault(Return(true)); + } void ShowDialog(const std::string& name) override { chrome::ShowChromeCleanerPrompt(browser(), mock_dialog_controller_.get());
diff --git a/chrome/browser/ui/views/chrome_cleaner_dialog_win.cc b/chrome/browser/ui/views/chrome_cleaner_dialog_win.cc index 6f82660..c876a5b7f 100644 --- a/chrome/browser/ui/views/chrome_cleaner_dialog_win.cc +++ b/chrome/browser/ui/views/chrome_cleaner_dialog_win.cc
@@ -19,9 +19,11 @@ #include "ui/gfx/geometry/insets.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/text_constants.h" +#include "ui/views/controls/button/checkbox.h" #include "ui/views/controls/button/md_text_button.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/widget/widget.h" namespace chrome { @@ -45,7 +47,10 @@ ChromeCleanerDialog::ChromeCleanerDialog( safe_browsing::ChromeCleanerDialogController* controller) - : browser_(nullptr), controller_(controller) { + : browser_(nullptr), + controller_(controller), + details_button_(nullptr), + logs_permission_checkbox_(nullptr) { DCHECK(controller_); SetLayoutManager( @@ -92,6 +97,22 @@ // DialogDelegate overrides. +views::View* ChromeCleanerDialog::CreateFootnoteView() { + DCHECK(!logs_permission_checkbox_); + DCHECK(controller_); + + views::View* footnote_view = new views::View(); + footnote_view->SetLayoutManager(new views::BoxLayout( + views::BoxLayout::kVertical, ChromeLayoutProvider::Get()->GetInsetsMetric( + views::INSETS_DIALOG_CONTENTS))); + logs_permission_checkbox_ = new views::Checkbox( + l10n_util::GetStringUTF16(IDS_CHROME_CLEANUP_LOGS_PERMISSION)); + logs_permission_checkbox_->SetChecked(controller_->LogsEnabled()); + logs_permission_checkbox_->set_listener(this); + footnote_view->AddChildView(logs_permission_checkbox_); + return footnote_view; +} + base::string16 ChromeCleanerDialog::GetDialogButtonLabel( ui::DialogButton button) const { DCHECK(button == ui::DIALOG_BUTTON_OK || button == ui::DIALOG_BUTTON_CANCEL); @@ -104,14 +125,17 @@ } views::View* ChromeCleanerDialog::CreateExtraView() { - return views::MdTextButton::CreateSecondaryUiButton( + DCHECK(!details_button_); + + details_button_ = views::MdTextButton::CreateSecondaryUiButton( this, l10n_util::GetStringUTF16( IDS_CHROME_CLEANUP_PROMPT_DETAILS_BUTTON_LABEL)); + return details_button_; } bool ChromeCleanerDialog::Accept() { if (controller_) { - controller_->Accept(); + controller_->Accept(/*logs_enabled=*/logs_permission_checkbox_->checked()); controller_ = nullptr; } return true; @@ -145,11 +169,18 @@ const ui::Event& event) { DCHECK(browser_); - // TODO(alito): Navigate to the webui version of the Chrome Cleaner UI when - // that is implemented. - if (controller_) { - controller_->DetailsButtonClicked(); - controller_ = nullptr; + if (sender == details_button_) { + if (controller_) { + controller_->DetailsButtonClicked( + /*logs_enabled=*/logs_permission_checkbox_->checked()); + controller_ = nullptr; + } + GetWidget()->Close(); + return; } - GetWidget()->Close(); + + DCHECK_EQ(logs_permission_checkbox_, sender); + + if (controller_) + controller_->SetLogsEnabled(logs_permission_checkbox_->checked()); }
diff --git a/chrome/browser/ui/views/chrome_cleaner_dialog_win.h b/chrome/browser/ui/views/chrome_cleaner_dialog_win.h index 8d3b1449..ab4bd31 100644 --- a/chrome/browser/ui/views/chrome_cleaner_dialog_win.h +++ b/chrome/browser/ui/views/chrome_cleaner_dialog_win.h
@@ -17,6 +17,11 @@ class ChromeCleanerDialogController; } +namespace views { +class Checkbox; +class LabelButton; +} // namespace views + // A modal dialog asking the user if they want to remove harmful software from // their computers by running the Chrome Cleanup tool. // @@ -43,6 +48,7 @@ base::string16 GetWindowTitle() const override; // views::DialogDelegate overrides. + views::View* CreateFootnoteView() override; base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; views::View* CreateExtraView() override; bool Accept() override; @@ -60,6 +66,8 @@ // The pointer will be set to nullptr once the controller has been notified of // user interaction since the controller can delete itself after that point. safe_browsing::ChromeCleanerDialogController* controller_; + views::LabelButton* details_button_; + views::Checkbox* logs_permission_checkbox_; DISALLOW_COPY_AND_ASSIGN(ChromeCleanerDialog); };
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_list_view.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_list_view.cc index 2d6cd74..123d1a1 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_list_view.cc +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_list_view.cc
@@ -203,6 +203,7 @@ if (!autoselect_source.empty() && base::ASCIIToUTF16(autoselect_source) == source.name) { // Select, then accept and close the dialog when we're done adding sources. + parent_->SelectTab(source.id.type); source_view->OnFocus(); content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE,
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc index f9a6d0b..90808ed 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc
@@ -201,7 +201,7 @@ } // Focus on the first non-null media_list. - SwitchSourceType(0); + OnSourceTypeSwitched(0); // If |parent_web_contents| is set and it's not a background page then the // picker will be shown modal to the web contents. Otherwise the picker is @@ -242,12 +242,12 @@ DesktopMediaPickerDialogView::~DesktopMediaPickerDialogView() {} void DesktopMediaPickerDialogView::TabSelectedAt(int index) { - SwitchSourceType(index); + OnSourceTypeSwitched(index); list_views_[index]->RequestFocus(); GetDialogClientView()->UpdateDialogButtons(); } -void DesktopMediaPickerDialogView::SwitchSourceType(int index) { +void DesktopMediaPickerDialogView::OnSourceTypeSwitched(int index) { // Set whether the checkbox is visible based on the source type. if (audio_share_checkbox_) { switch (source_types_[index]) { @@ -366,6 +366,16 @@ GetDialogClientView()->AcceptWindow(); } +void DesktopMediaPickerDialogView::SelectTab( + content::DesktopMediaID::Type source_type) { + for (size_t i = 0; i < source_types_.size(); i++) { + if (source_types_[i] == source_type) { + pane_->SelectTabAt(i); + return; + } + } +} + void DesktopMediaPickerDialogView::OnMediaListRowsChanged() { gfx::Rect widget_bound = GetWidget()->GetWindowBoundsInScreen();
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h index 6f0cf0d..6e82b45 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h
@@ -40,6 +40,7 @@ // Called by DesktopMediaListView. void OnSelectionChanged(); void OnDoubleClick(); + void SelectTab(content::DesktopMediaID::Type source_type); // views::TabbedPaneListener overrides. void TabSelectedAt(int index) override; @@ -67,7 +68,7 @@ views::TabbedPane* GetPaneForTesting() const; private: - void SwitchSourceType(int index); + void OnSourceTypeSwitched(int index); DesktopMediaPickerViews* parent_;
diff --git a/chrome/browser/ui/views/frame/browser_frame.cc b/chrome/browser/ui/views/frame/browser_frame.cc index 34168ebd..9c4367f3 100644 --- a/chrome/browser/ui/views/frame/browser_frame.cc +++ b/chrome/browser/ui/views/frame/browser_frame.cc
@@ -205,21 +205,6 @@ } } -void BrowserFrame::OnNativeWidgetActivationChanged(bool active) { - if (active) { - // When running under remote desktop, if the remote desktop client is not - // active on the users desktop, then none of the windows contained in the - // remote desktop will be activated. However, NativeWidget::Activate() will - // still bring this browser window to the foreground. We explicitly set - // ourselves as the last active browser window to ensure that we get treated - // as such by the rest of Chrome. - BrowserList::SetLastActive(browser_view_->browser()); - } else { - BrowserList::NotifyBrowserNoLongerActive(browser_view_->browser()); - } - Widget::OnNativeWidgetActivationChanged(active); -} - void BrowserFrame::OnNativeWidgetWorkspaceChanged() { chrome::SaveWindowWorkspace(browser_view_->browser(), GetWorkspace()); #if !defined(OS_CHROMEOS) && defined(USE_X11)
diff --git a/chrome/browser/ui/views/frame/browser_frame.h b/chrome/browser/ui/views/frame/browser_frame.h index 4ea5b40..09d6302 100644 --- a/chrome/browser/ui/views/frame/browser_frame.h +++ b/chrome/browser/ui/views/frame/browser_frame.h
@@ -106,7 +106,6 @@ const ui::ThemeProvider* GetThemeProvider() const override; const ui::NativeTheme* GetNativeTheme() const override; void SchedulePaintInRect(const gfx::Rect& rect) override; - void OnNativeWidgetActivationChanged(bool active) override; void OnNativeWidgetWorkspaceChanged() override; void OnNativeThemeUpdated(ui::NativeTheme* observed_theme) override;
diff --git a/chrome/browser/ui/views/harmony/harmony_typography_provider.cc b/chrome/browser/ui/views/harmony/harmony_typography_provider.cc index 939f5a5..3a58836 100644 --- a/chrome/browser/ui/views/harmony/harmony_typography_provider.cc +++ b/chrome/browser/ui/views/harmony/harmony_typography_provider.cc
@@ -4,16 +4,83 @@ #include "chrome/browser/ui/views/harmony/harmony_typography_provider.h" +#include "build/build_config.h" #include "chrome/browser/ui/views/harmony/chrome_typography.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_palette.h" +#include "ui/gfx/color_utils.h" #include "ui/gfx/platform_font.h" #include "ui/native_theme/native_theme.h" +#if defined(OS_WIN) +#include "ui/native_theme/native_theme_win.h" +#endif + #if defined(USE_ASH) #include "ash/public/cpp/ash_typography.h" // nogncheck #endif +namespace { + +// If the default foreground color from the native theme isn't black, the rest +// of the Harmony spec isn't going to work. Also skip Harmony if a Windows +// High Contrast theme is enabled. One of the four standard High Contrast themes +// in Windows 10 still has black text, but (since the user wants high contrast) +// the grey text shades in Harmony should not be used. +bool ShouldIgnoreHarmonySpec(const ui::NativeTheme& theme) { +#if defined(OS_WIN) + if (ui::NativeThemeWin::IsUsingHighContrastTheme()) + return true; +#endif + constexpr auto kTestColorId = ui::NativeTheme::kColorId_LabelEnabledColor; + return theme.GetSystemColor(kTestColorId) != SK_ColorBLACK; +} + +// Returns a color for a possibly inverted or high-contrast OS color theme. +SkColor GetHarmonyTextColorForNonStandardNativeTheme( + int context, + int style, + const ui::NativeTheme& theme) { + // At the time of writing, very few UI surfaces need typography for a Chrome- + // provided theme. Typically just incognito browser windows (when the native + // theme is NativeThemeDarkAura). Instead, this method is consulted when the + // actual OS theme is configured in a special way. So pick from a small number + // of NativeTheme constants that are known to adapt properly to distinct + // colors when configuring the OS to use a high-contrast theme. For example, + // ::GetSysColor() on Windows has 8 text colors: BTNTEXT, CAPTIONTEXT, + // GRAYTEXT, HIGHLIGHTTEXT, INACTIVECAPTIONTEXT, INFOTEXT (tool tips), + // MENUTEXT, and WINDOWTEXT. There's also hyperlinks: COLOR_HOTLIGHT. + // Diverging from these risks using a color that doesn't match user + // expectations. + + const bool inverted_scheme = color_utils::IsInvertedColorScheme(); + + ui::NativeTheme::ColorId color_id = + (context == views::style::CONTEXT_BUTTON || + context == views::style::CONTEXT_BUTTON_MD) + ? ui::NativeTheme::kColorId_ButtonEnabledColor + : ui::NativeTheme::kColorId_TextfieldDefaultColor; + switch (style) { + case views::style::STYLE_DIALOG_BUTTON_DEFAULT: + // This is just white in Harmony and, even in inverted themes, prominent + // buttons have a dark background, so white will maximize contrast. + return SK_ColorWHITE; + case views::style::STYLE_DISABLED: + color_id = ui::NativeTheme::kColorId_LabelDisabledColor; + break; + case views::style::STYLE_LINK: + color_id = ui::NativeTheme::kColorId_LinkEnabled; + break; + case STYLE_RED: + return inverted_scheme ? gfx::kGoogleRed300 : gfx::kGoogleRed700; + case STYLE_GREEN: + return inverted_scheme ? gfx::kGoogleGreen300 : gfx::kGoogleGreen700; + } + return theme.GetSystemColor(color_id); +} + +} // namespace + const gfx::FontList& HarmonyTypographyProvider::GetFont(int context, int style) const { // "Target" font size constants from the Harmony spec. @@ -56,32 +123,18 @@ int context, int style, const ui::NativeTheme& theme) const { - const SkColor foreground_color = - theme.GetSystemColor(ui::NativeTheme::kColorId_LabelEnabledColor); + if (ShouldIgnoreHarmonySpec(theme)) + return GetHarmonyTextColorForNonStandardNativeTheme(context, style, theme); - // If the default foreground color from the native theme isn't black, the rest - // of the Harmony spec isn't going to work. TODO(tapted): Something more - // generic would be nice here, but that requires knowing the background color - // for the text. At the time of writing, very few UI surfaces need native- - // themed typography with a custom native theme. Typically just incognito - // browser windows, when the native theme is NativeThemeDarkAura. - if (foreground_color != SK_ColorBLACK) { + if (context == views::style::CONTEXT_BUTTON_MD) { switch (style) { + case views::style::STYLE_DIALOG_BUTTON_DEFAULT: + return SK_ColorWHITE; case views::style::STYLE_DISABLED: - case STYLE_SECONDARY: - case STYLE_HINT: - return theme.GetSystemColor( - ui::NativeTheme::kColorId_LabelDisabledColor); - case views::style::STYLE_LINK: - return theme.GetSystemColor(ui::NativeTheme::kColorId_LinkEnabled); - case STYLE_RED: - return foreground_color == SK_ColorWHITE ? gfx::kGoogleRed300 - : gfx::kGoogleRed700; - case STYLE_GREEN: - return foreground_color == SK_ColorWHITE ? gfx::kGoogleGreen300 - : gfx::kGoogleGreen700; + return SkColorSetRGB(0x9e, 0x9e, 0x9e); + default: + return SkColorSetRGB(0x75, 0x75, 0x75); } - return foreground_color; } switch (style) {
diff --git a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc index f12b9907..ff4e860 100644 --- a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc +++ b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc
@@ -10,6 +10,7 @@ #include "base/single_thread_task_runner.h" #include "base/strings/utf_string_conversions.h" #include "base/threading/thread_task_runner_handle.h" +#include "build/build_config.h" #include "chrome/browser/importer/importer_lock_dialog.h" #include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" @@ -17,6 +18,7 @@ #include "chrome/grit/generated_resources.h" #include "chrome/grit/locale_settings.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/ui_features.h" #include "ui/views/controls/label.h" #include "ui/views/widget/widget.h" @@ -24,11 +26,12 @@ namespace importer { +#if !defined(OS_MACOSX) || BUILDFLAG(MAC_VIEWS_BROWSER) void ShowImportLockDialog(gfx::NativeWindow parent, const base::Callback<void(bool)>& callback) { ImportLockDialogView::Show(parent, callback); - base::RecordAction(UserMetricsAction("ImportLockDialogView_Shown")); } +#endif // !OS_MACOSX || MAC_VIEWS_BROWSER } // namespace importer @@ -37,6 +40,7 @@ const base::Callback<void(bool)>& callback) { views::DialogDelegate::CreateDialogWidget( new ImportLockDialogView(callback), NULL, NULL)->Show(); + base::RecordAction(UserMetricsAction("ImportLockDialogView_Shown")); } ImportLockDialogView::ImportLockDialogView(
diff --git a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc index eb4d9d37..bf9ed6b 100644 --- a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc +++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
@@ -119,7 +119,11 @@ const gfx::Point& anchor_point, DisplayReason reason) { Browser* browser = chrome::FindBrowserWithWebContents(web_contents); - DCHECK(browser && browser->window() && + // |web_contents| could have been unloaded if a tab gets closed and a mouse + // event arrives before the zoom icon gets hidden. + if (!browser) + return; + DCHECK(browser->window() && browser->exclusive_access_manager()->fullscreen_controller()); views::View* anchor_view = nullptr;
diff --git a/chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc b/chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc index 8a09efc..bbfa013d 100644 --- a/chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc +++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc
@@ -141,6 +141,21 @@ } #endif // OS_CHROMEOS +// Tests that trying to open zoom bubble with stale WebContents is safe. +IN_PROC_BROWSER_TEST_F(ZoomBubbleBrowserTest, NoWebContentsIsSafe) { + BrowserView* browser_view = static_cast<BrowserView*>(browser()->window()); + content::WebContents* web_contents = browser_view->GetActiveWebContents(); + + ZoomBubbleView::ShowBubble(web_contents, gfx::Point(), + ZoomBubbleView::AUTOMATIC); + + // Close the current tab and try opening the zoom bubble with stale + // |web_contents|. + chrome::CloseTab(browser()); + ZoomBubbleView::ShowBubble(web_contents, gfx::Point(), + ZoomBubbleView::AUTOMATIC); +} + class ZoomBubbleDialogTest : public DialogBrowserTest { public: ZoomBubbleDialogTest() {}
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc index 785c667..c687b445 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc
@@ -28,6 +28,7 @@ #include "ui/gfx/geometry/vector2d.h" #include "ui/gfx/render_text.h" #include "ui/views/controls/textfield/textfield_test_api.h" +#include "ui/views/test/views_test_base.h" #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/input_method/input_method_configuration.h" @@ -173,7 +174,7 @@ // OmniboxViewViewsTest ------------------------------------------------------- -class OmniboxViewViewsTest : public testing::Test { +class OmniboxViewViewsTest : public views::ViewsTestBase { public: OmniboxViewViewsTest(); @@ -228,6 +229,7 @@ } void OmniboxViewViewsTest::SetUp() { + ViewsTestBase::SetUp(); #if defined(OS_CHROMEOS) chromeos::input_method::InitializeForTesting( new chromeos::input_method::MockInputMethodManagerImpl); @@ -248,6 +250,7 @@ #if defined(OS_CHROMEOS) chromeos::input_method::Shutdown(); #endif + ViewsTestBase::TearDown(); } // Actual tests ---------------------------------------------------------------
diff --git a/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.cc b/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.cc index 9e248963..8d515b6 100644 --- a/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.cc +++ b/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.cc
@@ -11,71 +11,15 @@ #include "chrome/grit/generated_resources.h" #include "components/constrained_window/constrained_window_views.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/base/resource/resource_bundle.h" -#include "ui/views/controls/button/md_text_button.h" +#include "ui/views/border.h" #include "ui/views/controls/styled_label.h" -#include "ui/views/layout/grid_layout.h" +#include "ui/views/layout/fill_layout.h" #include "ui/views/widget/widget.h" -namespace { -// An identifier for views::ColumnSet. -enum ColumnSetType { - // | | (FILL, FILL) | | - SINGLE_VIEW_COLUMN_SET, - - // | | (TRAILING, CENTER) | | (TRAILING, CENTER) | | - // Used for buttons at the bottom of the dialog which should nest at the - // bottom-right corner. - DOUBLE_BUTTON_COLUMN_SET, -}; - -// Construct an appropriate ColumnSet for the given |type|, and add it -// to |layout|. -void BuildColumnSet(views::GridLayout* layout, ColumnSetType type) { - views::ColumnSet* column_set = layout->AddColumnSet(type); - ChromeLayoutProvider* layout_provider = ChromeLayoutProvider::Get(); - gfx::Insets dialog_insets = - layout_provider->GetInsetsMetric(views::INSETS_DIALOG_CONTENTS); - column_set->AddPaddingColumn(0, dialog_insets.left()); - switch (type) { - case SINGLE_VIEW_COLUMN_SET: - column_set->AddColumn(views::GridLayout::FILL, - views::GridLayout::FILL, - 1, - views::GridLayout::USE_PREF, - 0, - 0); - break; - case DOUBLE_BUTTON_COLUMN_SET: - column_set->AddColumn(views::GridLayout::TRAILING, - views::GridLayout::CENTER, - 1, - views::GridLayout::USE_PREF, - 0, - 0); - column_set->AddPaddingColumn( - 0, layout_provider->GetDistanceMetric( - views::DISTANCE_RELATED_BUTTON_HORIZONTAL)); - column_set->AddColumn(views::GridLayout::TRAILING, - views::GridLayout::CENTER, - 0, - views::GridLayout::USE_PREF, - 0, - 0); - break; - } - column_set->AddPaddingColumn(0, dialog_insets.right()); -} - -} // namespace - AutoSigninFirstRunDialogView::AutoSigninFirstRunDialogView( PasswordDialogController* controller, content::WebContents* web_contents) - : ok_button_(nullptr), - turn_off_button_(nullptr), - controller_(controller), - web_contents_(web_contents) { + : controller_(controller), web_contents_(web_contents), text_(nullptr) { chrome::RecordDialogCreation(chrome::DialogIdentifier::AUTO_SIGNIN_FIRST_RUN); } @@ -100,42 +44,43 @@ return controller_->GetAutoSigninPromoTitle(); } -bool AutoSigninFirstRunDialogView::ShouldShowWindowTitle() const { - // The framework trims the title instead of resizing the dialog. - return false; -} - bool AutoSigninFirstRunDialogView::ShouldShowCloseButton() const { return false; } -views::View* AutoSigninFirstRunDialogView::GetInitiallyFocusedView() { - return ok_button_; -} - void AutoSigninFirstRunDialogView::WindowClosing() { if (controller_) controller_->OnCloseDialog(); } -int AutoSigninFirstRunDialogView::GetDialogButtons() const { - // None because ESC is equivalent to Cancel. It shouldn't turn off the auto - // signin. - return ui::DIALOG_BUTTON_NONE; +void AutoSigninFirstRunDialogView::OnNativeThemeChanged( + const ui::NativeTheme* theme) { + views::StyledLabel::RangeStyleInfo default_style; + default_style.color = + views::style::GetColor(CONTEXT_BODY_TEXT_LARGE, STYLE_SECONDARY, theme); + text_->SetDefaultStyle(default_style); } -gfx::Size AutoSigninFirstRunDialogView::CalculatePreferredSize() const { - return gfx::Size(kDesiredWidth, GetHeightForWidth(kDesiredWidth)); +bool AutoSigninFirstRunDialogView::Cancel() { + controller_->OnAutoSigninTurnOff(); + return true; } -void AutoSigninFirstRunDialogView::ButtonPressed(views::Button* sender, - const ui::Event& event) { - if (sender == ok_button_) - controller_->OnAutoSigninOK(); - else if (sender == turn_off_button_) - controller_->OnAutoSigninTurnOff(); - else - NOTREACHED(); +bool AutoSigninFirstRunDialogView::Accept() { + controller_->OnAutoSigninOK(); + return true; +} + +bool AutoSigninFirstRunDialogView::Close() { + // Do nothing rather than running Cancel(), which would turn off auto-signin. + return true; +} + +base::string16 AutoSigninFirstRunDialogView::GetDialogButtonLabel( + ui::DialogButton button) const { + return l10n_util::GetStringUTF16(button == ui::DIALOG_BUTTON_OK + ? IDS_AUTO_SIGNIN_FIRST_RUN_OK + : IDS_AUTO_SIGNIN_FIRST_RUN_TURN_OFF); } void AutoSigninFirstRunDialogView::StyledLabelLinkClicked( @@ -146,58 +91,22 @@ } void AutoSigninFirstRunDialogView::InitWindow() { - ChromeLayoutProvider* layout_provider = ChromeLayoutProvider::Get(); - views::GridLayout* layout = new views::GridLayout(this); - SetLayoutManager(layout); - BuildColumnSet(layout, SINGLE_VIEW_COLUMN_SET); + SetBorder( + views::CreateEmptyBorder(ChromeLayoutProvider::Get()->GetInsetsMetric( + views::INSETS_DIALOG_CONTENTS))); + SetLayoutManager(new views::FillLayout()); - // Title. - views::Label* title_label = - new views::Label(GetWindowTitle(), views::style::CONTEXT_DIALOG_TITLE); - title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); - - // Content. std::pair<base::string16, gfx::Range> text_content = controller_->GetAutoSigninText(); - views::StyledLabel* content_label = - new views::StyledLabel(text_content.first, this); - content_label->SetBaseFontList(views::style::GetFont( - CONTEXT_DEPRECATED_SMALL, views::style::STYLE_PRIMARY)); - views::StyledLabel::RangeStyleInfo default_style; - default_style.color = kAutoSigninTextColor; - content_label->SetDefaultStyle(default_style); + text_ = new views::StyledLabel(text_content.first, this); + text_->SetBaseFontList( + views::style::GetFont(CONTEXT_BODY_TEXT_LARGE, STYLE_SECONDARY)); + OnNativeThemeChanged(GetNativeTheme()); if (!text_content.second.is_empty()) { - content_label->AddStyleRange( - text_content.second, - views::StyledLabel::RangeStyleInfo::CreateForLink()); + text_->AddStyleRange(text_content.second, + views::StyledLabel::RangeStyleInfo::CreateForLink()); } - - // Buttons. - ok_button_ = views::MdTextButton::CreateSecondaryUiButton( - this, l10n_util::GetStringUTF16(IDS_AUTO_SIGNIN_FIRST_RUN_OK)); - turn_off_button_ = views::MdTextButton::CreateSecondaryUiButton( - this, l10n_util::GetStringUTF16(IDS_AUTO_SIGNIN_FIRST_RUN_TURN_OFF)); - - // Layout. - layout->StartRowWithPadding( - 0, SINGLE_VIEW_COLUMN_SET, 0, - layout_provider->GetInsetsMetric(views::INSETS_DIALOG_TITLE).top()); - layout->AddView(title_label); - const gfx::Insets dialog_insets = - layout_provider->GetInsetsMetric(views::INSETS_DIALOG_CONTENTS); - layout->StartRowWithPadding(0, SINGLE_VIEW_COLUMN_SET, 0, - dialog_insets.top()); - layout->AddView(content_label); - layout->AddPaddingRow(0, dialog_insets.bottom()); - - BuildColumnSet(layout, DOUBLE_BUTTON_COLUMN_SET); - const gfx::Insets button_insets = - layout_provider->GetInsetsMetric(views::INSETS_DIALOG_BUTTON_ROW); - layout->StartRowWithPadding(0, DOUBLE_BUTTON_COLUMN_SET, 0, - button_insets.top()); - layout->AddView(ok_button_); - layout->AddView(turn_off_button_); - layout->AddPaddingRow(0, button_insets.bottom()); + AddChildView(text_); } AutoSigninFirstRunPrompt* CreateAutoSigninPromptView(
diff --git a/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.h b/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.h index e6095f3..c79a08a2 100644 --- a/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.h +++ b/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.h
@@ -7,13 +7,15 @@ #include "base/macros.h" #include "chrome/browser/ui/passwords/password_dialog_prompts.h" -#include "ui/views/controls/button/button.h" #include "ui/views/controls/styled_label_listener.h" #include "ui/views/window/dialog_delegate.h" +namespace views { +class StyledLabel; +} + class AutoSigninFirstRunDialogView : public views::DialogDelegateView, public views::StyledLabelListener, - public views::ButtonListener, public AutoSigninFirstRunPrompt { public: AutoSigninFirstRunDialogView(PasswordDialogController* controller, @@ -25,22 +27,16 @@ void ControllerGone() override; private: - // views::WidgetDelegate: + // views::DialogDelegateView: ui::ModalType GetModalType() const override; base::string16 GetWindowTitle() const override; - bool ShouldShowWindowTitle() const override; bool ShouldShowCloseButton() const override; - views::View* GetInitiallyFocusedView() override; void WindowClosing() override; - - // views::DialogDelegate: - int GetDialogButtons() const override; - - // views::View - gfx::Size CalculatePreferredSize() const override; - - // views::ButtonListener: - void ButtonPressed(views::Button* sender, const ui::Event& event) override; + void OnNativeThemeChanged(const ui::NativeTheme* theme) override; + bool Cancel() override; + bool Accept() override; + bool Close() override; + base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; // views::StyledLabelListener: void StyledLabelLinkClicked(views::StyledLabel* label, @@ -50,13 +46,12 @@ // Sets up the child views. void InitWindow(); - views::View* ok_button_; - views::View* turn_off_button_; - // A weak pointer to the controller. PasswordDialogController* controller_; content::WebContents* const web_contents_; + views::StyledLabel* text_; + DISALLOW_COPY_AND_ASSIGN(AutoSigninFirstRunDialogView); };
diff --git a/chrome/browser/ui/views/payments/validating_textfield_unittest.cc b/chrome/browser/ui/views/payments/validating_textfield_unittest.cc index 1b39248..e3daf65 100644 --- a/chrome/browser/ui/views/payments/validating_textfield_unittest.cc +++ b/chrome/browser/ui/views/payments/validating_textfield_unittest.cc
@@ -13,10 +13,11 @@ #include "chrome/browser/ui/views/payments/validation_delegate.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/views/controls/textfield/textfield.h" +#include "ui/views/test/views_test_base.h" namespace payments { -class ValidatingTextfieldTest : public testing::Test { +class ValidatingTextfieldTest : public views::ViewsTestBase { public: ValidatingTextfieldTest() {} ~ValidatingTextfieldTest() override {}
diff --git a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc index 88d1809..0f10fc1e 100644 --- a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc
@@ -352,12 +352,15 @@ params.SetString("gaiaPath", eafe_path); } + // Easy bootstrap is not v2-compatible if (base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kCrosGaiaApiV1)) { + switches::kCrosGaiaApiV1) || + use_easy_bootstrap_) { params.SetString("chromeOSApiVersion", "1"); - } else if (use_easy_bootstrap_) { - // Easy bootstrap is not v2-compatible - params.SetString("chromeOSApiVersion", "1"); + } else { + // This enables GLIF MM UI for the online Gaia screen by default. + // (see https://crbug.com/709244 ). + params.SetString("chromeOSApiVersion", "2"); } frame_state_ = FRAME_STATE_LOADING;
diff --git a/chrome/browser/ui/webui/chromeos/login/l10n_util_unittest.cc b/chrome/browser/ui/webui/chromeos/login/l10n_util_unittest.cc index 8202c1f1..d4c6b8a 100644 --- a/chrome/browser/ui/webui/chromeos/login/l10n_util_unittest.cc +++ b/chrome/browser/ui/webui/chromeos/login/l10n_util_unittest.cc
@@ -8,14 +8,11 @@ #include <utility> -#include "base/at_exit.h" #include "base/compiler_specific.h" #include "base/macros.h" #include "base/memory/ptr_util.h" -#include "base/memory/singleton.h" -#include "base/message_loop/message_loop.h" #include "base/run_loop.h" -#include "base/single_thread_task_runner.h" +#include "base/test/scoped_task_environment.h" #include "base/values.h" #include "chrome/browser/chromeos/customization/customization_document.h" #include "chrome/browser/chromeos/input_method/input_method_configuration.h" @@ -28,28 +25,6 @@ namespace { -class MachineStatisticsInitializer { - public: - MachineStatisticsInitializer(); - - static MachineStatisticsInitializer* GetInstance(); - - private: - DISALLOW_COPY_AND_ASSIGN(MachineStatisticsInitializer); -}; - -MachineStatisticsInitializer::MachineStatisticsInitializer() { - base::MessageLoop loop; - chromeos::system::StatisticsProvider::GetInstance() - ->StartLoadingMachineStatistics(loop.task_runner(), false); - base::RunLoop().RunUntilIdle(); -} - -// static -MachineStatisticsInitializer* MachineStatisticsInitializer::GetInstance() { - return base::Singleton<MachineStatisticsInitializer>::get(); -} - void VerifyOnlyUILanguages(const base::ListValue& list) { for (size_t i = 0; i < list.GetSize(); ++i) { const base::DictionaryValue* dict; @@ -80,34 +55,27 @@ L10nUtilTest(); ~L10nUtilTest() override; - // testing::Test: - void SetUp() override; - void TearDown() override; - void SetInputMethods1(); void SetInputMethods2(); private: - base::ShadowingAtExitManager at_exit_manager_; + base::test::ScopedTaskEnvironment scoped_task_environment_; MockInputMethodManagerWithInputMethods* input_manager_; }; L10nUtilTest::L10nUtilTest() : input_manager_(new MockInputMethodManagerWithInputMethods) { -} - -L10nUtilTest::~L10nUtilTest() { -} - -void L10nUtilTest::SetUp() { chromeos::input_method::InitializeForTesting(input_manager_); input_manager_->SetComponentExtensionIMEManager( base::MakeUnique<ComponentExtensionIMEManager>()); - MachineStatisticsInitializer::GetInstance(); // Ignore result. + + chromeos::system::StatisticsProvider::GetInstance() + ->StartLoadingMachineStatistics(false); + base::RunLoop().RunUntilIdle(); } -void L10nUtilTest::TearDown() { +L10nUtilTest::~L10nUtilTest() { chromeos::input_method::Shutdown(); }
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc index a69e504..ff8c1811 100644 --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
@@ -13,6 +13,7 @@ #include "ash/public/interfaces/tray_action.mojom.h" #include "ash/shelf/shelf_constants.h" #include "ash/shell.h" +#include "ash/shutdown_reason.h" #include "ash/system/devicetype_utils.h" #include "ash/wm/lock_state_controller.h" #include "base/bind.h" @@ -283,10 +284,8 @@ ash::mojom::TouchViewObserverPtr observer; touch_view_binding_.Bind(mojo::MakeRequest(&observer)); touch_view_manager_ptr_->AddObserver(std::move(observer)); - if (ScreenLocker::default_screen_locker() && - lock_screen_apps::StateController::IsEnabled()) { + if (lock_screen_apps::StateController::IsEnabled()) lock_screen_apps_observer_.Add(lock_screen_apps::StateController::Get()); - } if (WallpaperManager::HasInstance()) WallpaperManager::Get()->AddObserver(this); } @@ -1087,6 +1086,9 @@ void SigninScreenHandler::OnLockScreenNoteStateChanged( ash::mojom::TrayActionState state) { + if (!ScreenLocker::default_screen_locker()) + return; + std::string lock_screen_apps_state; switch (state) { case ash::mojom::TrayActionState::kActive: @@ -1184,7 +1186,8 @@ } void SigninScreenHandler::HandleShutdownSystem() { - ash::Shell::Get()->lock_state_controller()->RequestShutdown(); + ash::Shell::Get()->lock_state_controller()->RequestShutdown( + ash::ShutdownReason::LOGIN_SHUT_DOWN_BUTTON); } void SigninScreenHandler::HandleLoadWallpaper(const AccountId& account_id) { @@ -1284,8 +1287,7 @@ is_account_picker_showing_first_time_ = true; - if (ScreenLocker::default_screen_locker() && - lock_screen_apps::StateController::IsEnabled()) { + if (lock_screen_apps::StateController::IsEnabled()) { OnLockScreenNoteStateChanged( lock_screen_apps::StateController::Get()->GetLockScreenNoteState()); }
diff --git a/chrome/browser/ui/webui/flags_ui.cc b/chrome/browser/ui/webui/flags_ui.cc index 75db6452..293a141 100644 --- a/chrome/browser/ui/webui/flags_ui.cc +++ b/chrome/browser/ui/webui/flags_ui.cc
@@ -101,7 +101,6 @@ } #endif - source->SetJsonPath("strings.js"); source->AddResourcePath(flags_ui::kFlagsJS, IDR_FLAGS_UI_FLAGS_JS); source->SetDefaultResource(IDR_FLAGS_UI_FLAGS_HTML); return source; @@ -175,7 +174,7 @@ access_ = access; if (experimental_features_requested_) - HandleRequestExperimentalFeatures(NULL); + HandleRequestExperimentalFeatures(nullptr); } void FlagsDOMHandler::HandleRequestExperimentalFeatures(
diff --git a/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc b/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc index d16575a..a79ca9db 100644 --- a/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc +++ b/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc
@@ -81,6 +81,8 @@ IDS_BOOKMARK_BAR_OPEN_INCOGNITO); AddLocalizedString(source, "menuRename", IDS_MD_BOOKMARK_MANAGER_MENU_RENAME); AddLocalizedString(source, "menuSort", IDS_MD_BOOKMARK_MANAGER_MENU_SORT); + AddLocalizedString(source, "moreActionsButtonTitle", + IDS_MD_BOOKMARK_MANAGER_MORE_ACTIONS); AddLocalizedString(source, "noSearchResults", IDS_MD_BOOKMARK_MANAGER_NO_SEARCH_RESULTS); AddLocalizedString(source, "openDialogBody", @@ -89,6 +91,8 @@ IDS_MD_BOOKMARK_MANAGER_OPEN_DIALOG_CONFIRM); AddLocalizedString(source, "openDialogTitle", IDS_MD_BOOKMARK_MANAGER_OPEN_DIALOG_TITLE); + AddLocalizedString(source, "organizeButtonTitle", + IDS_BOOKMARK_MANAGER_ORGANIZE_MENU); AddLocalizedString(source, "renameFolderTitle", IDS_MD_BOOKMARK_MANAGER_FOLDER_RENAME_TITLE); AddLocalizedString(source, "searchPrompt", @@ -124,6 +128,8 @@ IDR_MD_BOOKMARKS_DIALOG_FOCUS_MANAGER_HTML); source->AddResourcePath("dialog_focus_manager.js", IDR_MD_BOOKMARKS_DIALOG_FOCUS_MANAGER_JS); + source->AddResourcePath("dnd_chip.html", IDR_MD_BOOKMARKS_DND_CHIP_HTML); + source->AddResourcePath("dnd_chip.js", IDR_MD_BOOKMARKS_DND_CHIP_JS); source->AddResourcePath("dnd_manager.html", IDR_MD_BOOKMARKS_DND_MANAGER_HTML); source->AddResourcePath("dnd_manager.js", IDR_MD_BOOKMARKS_DND_MANAGER_JS); @@ -187,6 +193,8 @@ auto plural_string_handler = base::MakeUnique<PluralStringHandler>(); plural_string_handler->AddLocalizedString( "toastItemsDeleted", IDS_MD_BOOKMARK_MANAGER_TOAST_ITEMS_DELETED); + plural_string_handler->AddLocalizedString( + "toastItemsCopied", IDS_MD_BOOKMARK_MANAGER_TOAST_ITEMS_COPIED); web_ui->AddMessageHandler(std::move(plural_string_handler)); web_ui->AddMessageHandler(base::MakeUnique<BookmarksMessageHandler>());
diff --git a/chrome/browser/ui/webui/media_router/media_router_file_dialog.cc b/chrome/browser/ui/webui/media_router/media_router_file_dialog.cc index ea6cb1c..3489362 100644 --- a/chrome/browser/ui/webui/media_router/media_router_file_dialog.cc +++ b/chrome/browser/ui/webui/media_router/media_router_file_dialog.cc
@@ -7,10 +7,12 @@ #include "base/bind.h" #include "base/task/cancelable_task_tracker.h" #include "base/task_scheduler/post_task.h" +#include "chrome/browser/media/router/media_router_metrics.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/media_router/issue.h" #include "chrome/grit/generated_resources.h" +#include "media/base/container_names.h" #include "media/base/mime_util.h" #include "net/base/filename_util.h" #include "net/base/mime_util.h" @@ -143,6 +145,20 @@ : base::string16(); } +void MediaRouterFileDialog::MaybeReportLastSelectedFileInformation() { + if (selected_file_.has_value()) { + cancelable_task_tracker_.PostTask( + task_runner_.get(), FROM_HERE, + base::BindOnce(&MediaRouterFileDialog::ReportFileFormat, + base::Unretained(this), selected_file_->local_path)); + + // TODO(paezagon): Report file media length. + } else { + VLOG(1) << "MediaRouterFileDialog did not report file information; no file " + "to report."; + } +} + void MediaRouterFileDialog::OpenFileDialog(Browser* browser) { const base::FilePath directory = file_system_delegate_->GetLastSelectedDirectory(browser); @@ -154,6 +170,21 @@ &file_type_info); } +void MediaRouterFileDialog::ReportFileFormat(const base::FilePath& filename) { + // Windows implementation of ReadFile fails if file smaller than desired size, + // so use file length if file less than 8192 bytes (http://crbug.com/243885). + char buffer[8192]; + int read_size = sizeof(buffer); + int64_t actual_size; + if (base::GetFileSize(filename, &actual_size) && actual_size < read_size) + read_size = actual_size; + int read = base::ReadFile(filename, buffer, read_size); + + MediaRouterMetrics::RecordMediaRouterFileFormat( + media::container_names::DetermineContainer( + reinterpret_cast<const uint8_t*>(buffer), read)); +} + void MediaRouterFileDialog::FileSelected(const base::FilePath& path, int index, void* params) { @@ -166,10 +197,10 @@ void* params) { cancelable_task_tracker_.PostTaskAndReplyWithResult( task_runner_.get(), FROM_HERE, - base::Bind(&MediaRouterFileDialog::ValidateFile, base::Unretained(this), - file_info), - base::Bind(&MediaRouterFileDialog::OnValidationResults, - base::Unretained(this), file_info)); + base::BindOnce(&MediaRouterFileDialog::ValidateFile, + base::Unretained(this), file_info), + base::BindOnce(&MediaRouterFileDialog::OnValidationResults, + base::Unretained(this), file_info)); } void MediaRouterFileDialog::OnValidationResults(
diff --git a/chrome/browser/ui/webui/media_router/media_router_file_dialog.h b/chrome/browser/ui/webui/media_router/media_router_file_dialog.h index 0ef4083..31bb5f9e 100644 --- a/chrome/browser/ui/webui/media_router/media_router_file_dialog.h +++ b/chrome/browser/ui/webui/media_router/media_router_file_dialog.h
@@ -103,10 +103,17 @@ virtual GURL GetLastSelectedFileUrl(); virtual base::string16 GetLastSelectedFileName(); + // Checks if a file has been recorded as being selected, then attempts to + // report interesting information about the file, such as format. + virtual void MaybeReportLastSelectedFileInformation(); + // Opens the dialog configured to get a media file. virtual void OpenFileDialog(Browser* browser); private: + // Reports the format of a file to the UMA stats. + void ReportFileFormat(const base::FilePath& filename); + // Overridden from SelectFileDialog::Listener: void FileSelected(const base::FilePath& path, int index,
diff --git a/chrome/browser/ui/webui/media_router/media_router_ui.cc b/chrome/browser/ui/webui/media_router/media_router_ui.cc index 92e11a6..369bcbe 100644 --- a/chrome/browser/ui/webui/media_router/media_router_ui.cc +++ b/chrome/browser/ui/webui/media_router/media_router_ui.cc
@@ -547,7 +547,7 @@ // treat subsequent route requests from a Presentation API-initiated dialogs // as browser-initiated. if (!for_presentation_source || !create_session_request_) { - route_response_callbacks->push_back(base::Bind( + route_response_callbacks->push_back(base::BindOnce( &MediaRouterUI::OnRouteResponseReceived, weak_factory_.GetWeakPtr(), current_route_request_id_, sink_id, cast_mode, base::UTF8ToUTF16(GetTruncatedPresentationRequestSourceName()))); @@ -556,22 +556,28 @@ if (create_session_request_) { // |create_session_request_| will be nullptr after this call, as the // object will be transferred to the callback. - route_response_callbacks->push_back( - base::Bind(&CreatePresentationConnectionRequest::HandleRouteResponse, - base::Passed(&create_session_request_))); - route_response_callbacks->push_back( - base::Bind(&MediaRouterUI::HandleCreateSessionRequestRouteResponse, - weak_factory_.GetWeakPtr())); + route_response_callbacks->push_back(base::BindOnce( + &CreatePresentationConnectionRequest::HandleRouteResponse, + base::Passed(&create_session_request_))); + route_response_callbacks->push_back(base::BindOnce( + &MediaRouterUI::HandleCreateSessionRequestRouteResponse, + weak_factory_.GetWeakPtr())); } else if (presentation_service_delegate_) { - route_response_callbacks->push_back( - base::Bind(&PresentationServiceDelegateImpl::OnRouteResponse, - presentation_service_delegate_, *presentation_request_)); + route_response_callbacks->push_back(base::BindOnce( + &PresentationServiceDelegateImpl::OnRouteResponse, + presentation_service_delegate_, *presentation_request_)); } } route_response_callbacks->push_back( - base::Bind(&MediaRouterUI::MaybeReportCastingSource, - weak_factory_.GetWeakPtr(), cast_mode)); + base::BindOnce(&MediaRouterUI::MaybeReportCastingSource, + weak_factory_.GetWeakPtr(), cast_mode)); + + if (cast_mode == MediaCastMode::LOCAL_FILE) { + route_response_callbacks->push_back( + base::BindOnce(&MediaRouterUI::MaybeReportFileInformation, + weak_factory_.GetWeakPtr())); + } *timeout = GetRouteRequestTimeout(cast_mode); *incognito = Profile::FromWebUI(web_ui())->IsOffTheRecord(); @@ -754,6 +760,12 @@ MediaRouterMetrics::RecordMediaRouterCastingSource(cast_mode); } +void MediaRouterUI::MaybeReportFileInformation( + const RouteRequestResult& result) { + if (result.result_code() == RouteRequestResult::OK) + media_router_file_dialog_->MaybeReportLastSelectedFileInformation(); +} + void MediaRouterUI::HandleCreateSessionRequestRouteResponse( const RouteRequestResult&) { Close();
diff --git a/chrome/browser/ui/webui/media_router/media_router_ui.h b/chrome/browser/ui/webui/media_router/media_router_ui.h index 1b664dd..bc58d4d4 100644 --- a/chrome/browser/ui/webui/media_router/media_router_ui.h +++ b/chrome/browser/ui/webui/media_router/media_router_ui.h
@@ -296,6 +296,9 @@ // Logs a UMA stat for the source that was cast if the result is successful. void MaybeReportCastingSource(MediaCastMode cast_mode, const RouteRequestResult& result); + // Sends a request to the file dialog to log UMA stats for the file that was + // cast if the result is successful. + void MaybeReportFileInformation(const RouteRequestResult& result); // Closes the dialog after receiving a route response when using // |create_session_request_|. This prevents the dialog from trying to use the
diff --git a/chrome/browser/ui/webui/net_export_ui.cc b/chrome/browser/ui/webui/net_export_ui.cc index 3f5b6f89..c9b3adee 100644 --- a/chrome/browser/ui/webui/net_export_ui.cc +++ b/chrome/browser/ui/webui/net_export_ui.cc
@@ -24,6 +24,7 @@ #include "chrome/browser/platform_util.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/chrome_select_file_policy.h" +#include "chrome/common/channel_info.h" #include "chrome/common/url_constants.h" #include "components/grit/components_resources.h" #include "components/net_log/chrome_net_log.h" @@ -111,6 +112,8 @@ // Send NetLog data via email. static void SendEmail(const base::FilePath& file_to_send); + void StartNetLog(const base::FilePath& path); + // Reveal |path| in the shell on desktop platforms. void ShowFileInShell(const base::FilePath& path); @@ -222,8 +225,7 @@ net_log::NetLogFileWriter::CaptureModeFromString(capture_mode_string); if (UsingMobileUI()) { - file_writer_->StartNetLog(base::FilePath(), capture_mode_, - GetURLRequestContexts()); + StartNetLog(base::FilePath()); } else { base::FilePath initial_dir = last_save_dir.Pointer()->empty() ? DownloadPrefs::FromBrowserContext( @@ -280,7 +282,7 @@ DCHECK(select_file_dialog_); *last_save_dir.Pointer() = path.DirName(); - file_writer_->StartNetLog(path, capture_mode_, GetURLRequestContexts()); + StartNetLog(path); // IMPORTANT: resetting the dialog may lead to the deletion of |path|, so keep // this line last. @@ -315,6 +317,15 @@ #endif } +void NetExportMessageHandler::StartNetLog(const base::FilePath& path) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + + file_writer_->StartNetLog( + path, capture_mode_, + base::CommandLine::ForCurrentProcess()->GetCommandLineString(), + chrome::GetChannelString(), GetURLRequestContexts()); +} + void NetExportMessageHandler::ShowFileInShell(const base::FilePath& path) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (path.empty())
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc index b3a4a3ff..7e7d444a 100644 --- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc +++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -352,6 +352,9 @@ chrome::kLearnMoreEnterpriseURL); } else { localized_strings.SetString("enterpriseInfoVisible", "false"); + localized_strings.SetString("enterpriseInfoMessage", ""); + localized_strings.SetString("enterpriseLearnMore", ""); + localized_strings.SetString("enterpriseInfoHintLink", ""); } #endif @@ -369,17 +372,10 @@ static const base::StringPiece guest_tab_html( ResourceBundle::GetSharedInstance().GetRawDataResource(guest_tab_ids)); -#if defined(OS_CHROMEOS) - // TODO(dbeam): convert c/b/resources/chromeos/guest_session_tab.html from - // i18n-* to $i18n{}. - std::string full_html = webui::GetI18nTemplateHtml( - guest_tab_html, &localized_strings); -#else ui::TemplateReplacements replacements; ui::TemplateReplacementsFromDictionaryValue(localized_strings, &replacements); std::string full_html = ui::ReplaceTemplateExpressions(guest_tab_html, replacements); -#endif new_tab_guest_html_ = base::RefCountedString::TakeString(&full_html); }
diff --git a/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc b/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc index de7fec70..4f3dc93f 100644 --- a/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc +++ b/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc
@@ -18,9 +18,9 @@ #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/values.h" -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" #include "chrome/browser/android/offline_pages/prefetch/prefetch_background_task.h" #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "chrome/browser/offline_pages/prefetch/prefetch_service_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/channel_info.h"
diff --git a/chrome/browser/ui/webui/options/OWNERS b/chrome/browser/ui/webui/options/OWNERS index 5fb82a30b..12eda5ad 100644 --- a/chrome/browser/ui/webui/options/OWNERS +++ b/chrome/browser/ui/webui/options/OWNERS
@@ -1,4 +1,4 @@ -# This UI is deprecated. See chrome/browser/ui/webui/options/ instead. +# This UI is deprecated. See chrome/browser/ui/webui/settings/ instead. set noparent dbeam@chromium.org
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc index d96f445..074fa97 100644 --- a/chrome/browser/ui/webui/options/content_settings_handler.cc +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -838,7 +838,7 @@ continue; } all_patterns_settings[std::make_pair(i->primary_pattern, i->source)] - [i->secondary_pattern] = i->setting; + [i->secondary_pattern] = i->GetContentSetting(); } base::ListValue exceptions; @@ -909,11 +909,9 @@ continue; } - exceptions.Append( - GetNotificationExceptionForPage(i->primary_pattern, - i->secondary_pattern, - i->setting, - i->source)); + exceptions.Append(GetNotificationExceptionForPage( + i->primary_pattern, i->secondary_pattern, i->GetContentSetting(), + i->source)); } base::Value type_string(site_settings::ContentSettingsTypeToGroupName(
diff --git a/chrome/browser/ui/webui/settings/chrome_cleanup_handler.cc b/chrome/browser/ui/webui/settings/chrome_cleanup_handler.cc index 46f4b8c..8965daf 100644 --- a/chrome/browser/ui/webui/settings/chrome_cleanup_handler.cc +++ b/chrome/browser/ui/webui/settings/chrome_cleanup_handler.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ui/webui/settings/chrome_cleanup_handler.h" +#include <string> + #include "base/command_line.h" #include "base/feature_list.h" #include "base/synchronization/lock.h" @@ -146,7 +148,9 @@ DCHECK_EQ(0U, args->GetSize()); controller_->ReplyWithUserResponse( - profile_, ChromeCleanerController::UserResponse::kAccepted); + // TODO(proberge): Send kAcceptedWithLogs or kAcceptedWithoutLogs based on + // the state of a logs upload permissions checkbox. + profile_, ChromeCleanerController::UserResponse::kAcceptedWithoutLogs); } } // namespace settings
diff --git a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc index a4c4006..dfb283f30 100644 --- a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
@@ -1833,9 +1833,9 @@ {"siteSettingsFlashAllow", IDS_SETTINGS_SITE_SETTINGS_FLASH_ALLOW}, {"siteSettingsFlashBlock", IDS_SETTINGS_SITE_SETTINGS_FLASH_BLOCK}, {"siteSettingsAllowRecentlyClosedSites", - IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_ALLOW_RECENTLY_CLOSED_SITES}, + IDS_SETTINGS_SITE_SETTINGS_ALLOW_RECENTLY_CLOSED_SITES}, {"siteSettingsAllowRecentlyClosedSitesRecommended", - IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_ALLOW_RECENTLY_CLOSED_SITES_RECOMMENDED}, + IDS_SETTINGS_SITE_SETTINGS_ALLOW_RECENTLY_CLOSED_SITES_RECOMMENDED}, {"siteSettingsBackgroundSyncBlocked", IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_BLOCKED}, {"siteSettingsHandlersAsk", IDS_SETTINGS_SITE_SETTINGS_HANDLERS_ASK},
diff --git a/chrome/browser/ui/webui/settings/site_settings_handler.cc b/chrome/browser/ui/webui/settings/site_settings_handler.cc index d315350..4022176a 100644 --- a/chrome/browser/ui/webui/settings/site_settings_handler.cc +++ b/chrome/browser/ui/webui/settings/site_settings_handler.cc
@@ -29,6 +29,7 @@ #include "components/content_settings/core/browser/content_settings_utils.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings_types.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "components/crx_file/id_util.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h"
diff --git a/chrome/browser/ui/webui/signin/md_user_manager_ui.cc b/chrome/browser/ui/webui/signin/md_user_manager_ui.cc index 4b58961..52b53b9 100644 --- a/chrome/browser/ui/webui/signin/md_user_manager_ui.cc +++ b/chrome/browser/ui/webui/signin/md_user_manager_ui.cc
@@ -6,6 +6,7 @@ #include <string> +#include "base/feature_list.h" #include "base/memory/ptr_util.h" #include "base/values.h" #include "chrome/browser/browser_process.h" @@ -15,6 +16,7 @@ #include "chrome/browser/ui/webui/signin/signin_utils.h" #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h" #include "chrome/browser/ui/webui/theme_source.h" +#include "chrome/common/chrome_features.h" #include "chrome/common/features.h" #include "chrome/common/url_constants.h" #include "chrome/grit/browser_resources.h" @@ -67,6 +69,9 @@ source->AddBoolean("profileShortcutsEnabled", ProfileShortcutManager::IsFeatureEnabled()); source->AddBoolean("isForceSigninEnabled", signin::IsForceSigninEnabled()); + source->AddBoolean( + "isSupervisedUserCreationEnabled", + base::FeatureList::IsEnabled(features::kSupervisedUserCreation)); source->SetJsonPath("strings.js");
diff --git a/chrome/browser/ui/webui/site_settings_helper.cc b/chrome/browser/ui/webui/site_settings_helper.cc index 1a859e6..299d94c 100644 --- a/chrome/browser/ui/webui/site_settings_helper.cc +++ b/chrome/browser/ui/webui/site_settings_helper.cc
@@ -14,6 +14,7 @@ #include "chrome/browser/usb/usb_chooser_context_factory.h" #include "chrome/common/pref_names.h" #include "components/content_settings/core/browser/host_content_settings_map.h" +#include "components/content_settings/core/common/content_settings.h" #include "components/prefs/pref_service.h" #include "extensions/browser/extension_registry.h" @@ -203,7 +204,7 @@ continue; all_patterns_settings[std::make_pair(i->primary_pattern, i->source)] - [i->secondary_pattern] = i->setting; + [i->secondary_pattern] = i->GetContentSetting(); } // Keep the exceptions sorted by provider so they will be displayed in
diff --git a/chrome/browser/win/jumplist.cc b/chrome/browser/win/jumplist.cc index 6f3aa455..7ebb5ea 100644 --- a/chrome/browser/win/jumplist.cc +++ b/chrome/browser/win/jumplist.cc
@@ -663,9 +663,6 @@ bool recently_closed_should_update, IncognitoModePrefs::Availability incognito_availability, UpdateTransaction* update_transaction) { - if (!JumpListUpdater::IsEnabled()) - return; - DCHECK(update_transaction); base::FilePath most_visited_icon_dir = GenerateJumplistIconDirName(
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index 99098ff..1b66b34 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -252,6 +252,12 @@ base::FEATURE_DISABLED_BY_DEFAULT}; #endif +#if defined(OS_CHROMEOS) +// Enables or disables multidevice features and corresponding UI on Chrome OS. +const base::Feature kMultidevice{"Multidevice", + base::FEATURE_DISABLED_BY_DEFAULT}; +#endif + // Enables the use of native notification centers instead of using the Message // Center for displaying the toasts. #if BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS)
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index 51579cd6..f96568db 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -129,6 +129,10 @@ extern const base::Feature kModuleDatabase; #endif +#if defined(OS_CHROMEOS) +extern const base::Feature kMultidevice; +#endif + #if BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) extern const base::Feature kNativeNotifications; #endif
diff --git a/chrome/common/chrome_paths_unittest.cc b/chrome/common/chrome_paths_unittest.cc index 5ad0167..85d301c55 100644 --- a/chrome/common/chrome_paths_unittest.cc +++ b/chrome/common/chrome_paths_unittest.cc
@@ -72,13 +72,22 @@ base::FilePath home_dir; PathService::Get(base::DIR_HOME, &home_dir); + std::string expected_branding; +#if defined(GOOGLE_CHROME_BUILD) + // TODO(skobes): Test channel suffixes with $CHROME_VERSION_EXTRA. + expected_branding = "google-chrome"; +#else + expected_branding = "chromium"; +#endif + base::FilePath user_data_dir; GetDefaultUserDataDirectory(&user_data_dir); - EXPECT_EQ(home_dir.Append(".config/chromium").value(), user_data_dir.value()); + EXPECT_EQ(home_dir.Append(".config/" + expected_branding).value(), + user_data_dir.value()); env->SetVar("CHROME_CONFIG_HOME", "/foo/bar"); GetDefaultUserDataDirectory(&user_data_dir); - EXPECT_EQ("/foo/bar/chromium", user_data_dir.value()); + EXPECT_EQ("/foo/bar/" + expected_branding, user_data_dir.value()); // TODO(skobes): It would be nice to test $CHROME_USER_DATA_DIR here too, but // it's handled by ChromeMainDelegate instead of GetDefaultUserDataDirectory.
diff --git a/chrome/common/crash_keys.cc b/chrome/common/crash_keys.cc index 51e3812..c4b563e0 100644 --- a/chrome/common/crash_keys.cc +++ b/chrome/common/crash_keys.cc
@@ -86,6 +86,9 @@ const char kZeroEncodeDetails[] = "zero-encode-details"; +const char kUserCloudPolicyManagerConnectTrace[] = + "user-cloud-policy-manager-connect-trace"; + size_t RegisterChromeCrashKeys() { // The following keys may be chunked by the underlying crash logging system, // but ultimately constitute a single key-value pair. @@ -221,6 +224,9 @@ {"engine_params", crash_keys::kMediumSize}, {"engine1_params", crash_keys::kMediumSize}, {"engine2_params", crash_keys::kMediumSize}, + + // Temporary for https://crbug.com/685996. + {kUserCloudPolicyManagerConnectTrace, kMediumSize}, }; // This dynamic set of keys is used for sets of key value pairs when gathering
diff --git a/chrome/common/crash_keys.h b/chrome/common/crash_keys.h index 93fb0b07e..687146e 100644 --- a/chrome/common/crash_keys.h +++ b/chrome/common/crash_keys.h
@@ -145,6 +145,11 @@ // was encountered. http://crbug.com/519022 extern const char kZeroEncodeDetails[]; +// TEMPORARY: Stack trace for the previous call of the +// UserCloudPolicyManager::Connect() method. The value is set when we trigger a +// browser crash due to an attempt to connect twice. https://crbug.com/685996. +extern const char kUserCloudPolicyManagerConnectTrace[]; + } // namespace crash_keys #endif // CHROME_COMMON_CRASH_KEYS_H_
diff --git a/chrome/installer/zucchini/BUILD.gn b/chrome/installer/zucchini/BUILD.gn index e74142a2..f417400 100644 --- a/chrome/installer/zucchini/BUILD.gn +++ b/chrome/installer/zucchini/BUILD.gn
@@ -5,6 +5,20 @@ import("//chrome/process_version_rc_template.gni") import("//testing/test.gni") +static_library("zucchini_lib") { + sources = [ + "buffer_view.h", + "disassembler.cc", + "disassembler.h", + "image_utils.h", + "typed_value.h", + ] + + deps = [ + "//base", + ] +} + executable("zucchini") { sources = [ "zucchini_main.cc", @@ -27,9 +41,11 @@ test("zucchini_unittests") { sources = [ "buffer_view_unittest.cc", + "typed_value_unittest.cc", ] deps = [ + ":zucchini_lib", "//base", "//base/test:run_all_unittests", "//base/test:test_support",
diff --git a/chrome/installer/zucchini/README.md b/chrome/installer/zucchini/README.md new file mode 100644 index 0000000..315ae84 --- /dev/null +++ b/chrome/installer/zucchini/README.md
@@ -0,0 +1,87 @@ + +Basic Definitions for Patching +------------------------------ + +**Binary**: Executable image and data. Binaries may persist in an archive +(e.g., chrome.7z), and need to be periodically updated. Formats for binaries +include {PE files EXE / DLL, ELF, DEX}. Architectures binaries include +{x86, x64, ARM, AArch64, Dalvik}. A binary is also referred to as an executable +or an image file. + +**Patching**: Sending a "new" file to clients who have an "old" file by +computing and transmitting a "patch" that can be used to transform "old" into +"new". Patches are compressed for transmission. A key performance metric is +patch size, which refers to the size of compressed patch file. For our +experiments we use 7z. + +**Patch generation**: Computation of a "patch" from "old" and "new". This can be +expensive (e.g., ~15-20 min for Chrome, using 1 GB of RAM), but since patch +generation is a run-once step on the server-side when releasing "new" binaries, +the expense is not too critical. + +**Patch application**: Transformation from "old" binaries to "new", using a +(downloaded) "patch". This is executed on client side on updates, so resource +constraints (e.g., time, RAM, disk space) is more stringent. Also, fault- +tolerance is important. This is usually achieved by an update system by having +a fallback method of directly downloading "new" in case of patching failure. + +**Offset**: Position relative to the start of a file. + +**Reference**: A directed connection between two offsets in a binary. For +example, consider jump instructions in x86: + + 00401000: E9 3D 00 00 00 jmp 00401042 + +Here, the 4 bytes `[3D 00 00 00]` starting at address `00401001` point to +address `00401042` in memory. This forms a reference from `offset(00401001)` +(length `4`) to `offset(00401042)`, where `offset(addr)` indicates the disk +offset corresponding to `addr`. + +**Location**: The starting offset of bytes that store a reference. In the +preceding example, `offset(00401001)` is a location. Each location is associated +with a span of bytes that encodes reference data. + +**Target**: The offset that's the destination of a reference. In the preceding +example, `offset(00401042)` is a target. Different references can share common +targets. For example, in + + 00401000: E9 3D 00 00 00 jmp 00401042 + 00401005: EB 3B jmp 00401042 + +we have two references with different locations, but same target. + +Because the bytes that encode a reference depend on its target, and potentially +on its location, they are more likely to get modified from an old version of a +binary to a newer version. This is why "naive" patching does not do well on +binaries. + +**Disassembler**: Architecture specific data and operations, used to extract and +correct references in a binary. + +**Type of reference**: The type of a reference determines the binary +representation used to encode its target. This affects how references are parsed +and written by a disassembler. There can be many types of references in the same +binary. + +A reference is represented by the tuple (disassembler, location, target, type). +This tuple contains sufficient information to write the reference in a binary. + +**Pool of targets**: Collection of targets that is assumed to have some semantic +relationship. Each reference type belong to exactly one reference pool. Targets +for references in the same pool are shared. + +For example, the following describes two pools defined for Dalvik Executable +format (DEX). Both pools spawn mutiple types of references. + +1. Index in string table. + - From bytecode to string index using 16 bits. + - From bytecode to string index using 32 bits. + - From field item to string index using 32 bits. +2. Address in code. + - Relative 16 bits pointer. + - Relative 32 bits pointer. + +Boundaries between different pools can be ambiguous. Having all targets belong +to the same pool can reduce redundancy, but will use more memory and might +cause larger corrections to happen, so this is a tradeoff that can be resolved +with benchmarks. \ No newline at end of file
diff --git a/chrome/installer/zucchini/disassembler.cc b/chrome/installer/zucchini/disassembler.cc new file mode 100644 index 0000000..93dbcf6 --- /dev/null +++ b/chrome/installer/zucchini/disassembler.cc
@@ -0,0 +1,52 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/installer/zucchini/disassembler.h" + +#include "base/logging.h" + +namespace zucchini { + +std::unique_ptr<ReferenceReader> ReferenceGroup::GetReader( + offset_t lower, + offset_t upper, + Disassembler* disasm) const { + DCHECK(lower <= upper); + DCHECK(upper <= disasm->size()); + return (disasm->*reader_factory_)(lower, upper); +} + +std::unique_ptr<ReferenceReader> ReferenceGroup::GetReader( + Disassembler* disasm) const { + return (disasm->*reader_factory_)(0, static_cast<offset_t>(disasm->size())); +} + +std::unique_ptr<ReferenceWriter> ReferenceGroup::GetWriter( + MutableBufferView image, + Disassembler* disasm) const { + DCHECK(image.begin() == disasm->GetImage().begin()); + DCHECK(image.size() == disasm->size()); + return (disasm->*writer_factory_)(image); +} + +ReferenceTypeTraits ReferenceGroup::Traits() const { + return traits_; +} + +offset_t ReferenceGroup::Width() const { + return traits_.width; +} + +TypeTag ReferenceGroup::TypeTag() const { + return traits_.type_tag; +} + +PoolTag ReferenceGroup::PoolTag() const { + return traits_.pool_tag; +} + +Disassembler::Disassembler() = default; +Disassembler::~Disassembler() = default; + +} // namespace zucchini
diff --git a/chrome/installer/zucchini/disassembler.h b/chrome/installer/zucchini/disassembler.h new file mode 100644 index 0000000..448a67a --- /dev/null +++ b/chrome/installer/zucchini/disassembler.h
@@ -0,0 +1,142 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_INSTALLER_ZUCCHINI_DISASSEMBLER_H_ +#define CHROME_INSTALLER_ZUCCHINI_DISASSEMBLER_H_ + +#include <memory> +#include <string> +#include <vector> + +#include "base/optional.h" +#include "chrome/installer/zucchini/buffer_view.h" +#include "chrome/installer/zucchini/image_utils.h" + +namespace zucchini { + +class Disassembler; + +// Interface for extracting References through member function GetNext(). +// This is used by Disassemblers to extract references from an image file. +// Typycally, a Reader lazily extracts values and does not hold any storage. +class ReferenceReader { + public: + virtual ~ReferenceReader() = default; + + // Returns the next available Reference, or nullopt_t if exhausted. + // Extracted References must be ordered by their location in the image. + virtual base::Optional<Reference> GetNext() = 0; +}; + +// Interface for writing References through member function +// PutNext(reference). This is used by Disassemblers to write new References +// in the image file. +class ReferenceWriter { + public: + virtual ~ReferenceWriter() = default; + + // Writes |reference| in the underlying image file. This operation always + // succeeds. + virtual void PutNext(Reference reference) = 0; +}; + +// A ReferenceGroup is associated with a specific |type| and has convenience +// methods to obtain readers and writers for that type. A ReferenceGroup does +// not store references; it is a lighweight class that communicates with the +// disassembler to operate on them. +class ReferenceGroup { + public: + // Member function pointer used to obtain a ReferenceReader. + using ReaderFactory = std::unique_ptr<ReferenceReader> ( + Disassembler::*)(offset_t lower, offset_t upper); + + // Member function pointer used to obtain a ReferenceWriter. + using WriterFactory = std::unique_ptr<ReferenceWriter> (Disassembler::*)( + MutableBufferView image); + + ReferenceGroup() = default; + + // RefinedGeneratorFactory and RefinedReceptorFactory don't have to be + // identical to GeneratorFactory and ReceptorFactory, but they must be + // convertible. As a result, they can be pointer to member function of a + // derived Disassembler. + template <class RefinedReaderFactory, class RefinedWriterFactory> + ReferenceGroup(ReferenceTypeTraits traits, + RefinedReaderFactory reader_factory, + RefinedWriterFactory writer_factory) + : traits_(traits), + reader_factory_(static_cast<ReaderFactory>(reader_factory)), + writer_factory_(static_cast<WriterFactory>(writer_factory)) {} + + // Returns a reader for all references in the binary. + // Invalidates any other writer or reader previously obtained for |disasm|. + std::unique_ptr<ReferenceReader> GetReader(Disassembler* disasm) const; + + // Returns a reader for references whose bytes are entirely contained in + // |[lower, upper)|. + // Invalidates any other writer or reader previously obtained for |disasm|. + std::unique_ptr<ReferenceReader> GetReader(offset_t lower, + offset_t upper, + Disassembler* disasm) const; + + // Returns a writer for references in |image|, assuming that |image| was the + // same one initially parsed by |disasm|. + // Invalidates any other writer or reader previously obtained for |disasm|. + std::unique_ptr<ReferenceWriter> GetWriter(MutableBufferView image, + Disassembler* disasm) const; + + // Returns traits describing the reference type. + ReferenceTypeTraits Traits() const; + + // Shorthand for Traits().width. + offset_t Width() const; + + // Shorthand for Traits().type_tag. + TypeTag TypeTag() const; + + // Shorthand for Traits().pool_tag. + PoolTag PoolTag() const; + + protected: + ReferenceTypeTraits traits_; + ReaderFactory reader_factory_ = nullptr; + WriterFactory writer_factory_ = nullptr; +}; + +// A Disassembler is used to encapsulate architecture specific operations, to: +// - Describe types of references found in the architecture using traits. +// - Extract references contained in an image file. +// - Correct target for some references. +class Disassembler { + public: + virtual ~Disassembler(); + + // Returns the type of executable handled by the Disassembler. + virtual ExecutableType GetExeType() const = 0; + + // Returns a more detailed description of the executable type. + virtual std::string GetExeTypeString() const = 0; + + // Creates and returns a vector that contains all groups of references. + // Groups must be aggregated by pool. + virtual std::vector<ReferenceGroup> GetReferenceGroups() const = 0; + + BufferView GetImage() const { return image_; } + size_t size() const { return image_.size(); } + + protected: + Disassembler(); + + // Parses |image| and initializes internal states. Returns true on success. + // This must be called once and before any other operation. + virtual bool Parse(BufferView image) = 0; + + // Raw image data. After Parse(), a Disassembler should shrink this to contain + // only the portion containing the executable file it recognizes. + BufferView image_; +}; + +} // namespace zucchini + +#endif // CHROME_INSTALLER_ZUCCHINI_DISASSEMBLER_H_
diff --git a/chrome/installer/zucchini/image_utils.h b/chrome/installer/zucchini/image_utils.h new file mode 100644 index 0000000..48935b54 --- /dev/null +++ b/chrome/installer/zucchini/image_utils.h
@@ -0,0 +1,107 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_INSTALLER_ZUCCHINI_IMAGE_UTILS_H_ +#define CHROME_INSTALLER_ZUCCHINI_IMAGE_UTILS_H_ + +#include <cstdint> + +#include "chrome/installer/zucchini/typed_value.h" + +namespace zucchini { + +// offset_t is used to describe an offset in an image. +// Files bigger than 4GB are not supported. +using offset_t = uint32_t; + +// Used to uniquely identify a reference group. +// Strongly typed objects are used to avoid ambiguitees with PoolTag. +struct TypeTag : TypedValue<TypeTag, uint8_t> { + // inheriting constructor: + using TypedValue<TypeTag, uint8_t>::TypedValue; +}; + +// Used to uniquely identify a pool. +struct PoolTag : TypedValue<PoolTag, uint8_t> { + // inheriting constructor: + using TypedValue<PoolTag, uint8_t>::TypedValue; +}; + +constexpr TypeTag kNoTypeTag = 0xFF; +constexpr PoolTag kNoPoolTag = 0xFF; + +// Specification of references in an image file. +struct ReferenceTypeTraits { + constexpr ReferenceTypeTraits(offset_t width, + TypeTag type_tag, + PoolTag pool_tag) + : width(width), type_tag(type_tag), pool_tag(pool_tag) {} + + // |width| specifies number of bytes covered by the reference's binary + // |encoding. + offset_t width; + // |type_tag| identifies the reference type being described. + TypeTag type_tag = kNoTypeTag; + // |pool_tag| identifies the pool this type belongs to. + PoolTag pool_tag = kNoPoolTag; +}; + +// There is no need to store |type| because references of the same type are +// always aggregated into the same container, and so during iteration we'd have +// |type| already. +struct Reference { + offset_t location; + offset_t target; +}; + +inline bool operator==(Reference a, Reference b) { + return a.location == b.location && a.target == b.target; +} + +// An Equivalence is a block of length |length| that approximately match in +// |old_image| at an offset of |src_offset| and in |new_image| at an offset of +// |dst_offset|. +struct Equivalence { + offset_t src_offset; + offset_t dst_offset; + offset_t length; +}; + +// Same as Equivalence, but with a similarity score. +// This is only used when generating the patch. +struct EquivalenceCandidate { + offset_t src_offset; + offset_t dst_offset; + offset_t length; + double similarity; +}; + +// Enumerations for supported executables. +enum ExecutableType : uint32_t { + EXE_TYPE_UNKNOWN = UINT32_MAX, + EXE_TYPE_NO_OP = 0, + EXE_TYPE_WIN32_X86 = 1, + EXE_TYPE_WIN32_X64 = 2, + EXE_TYPE_ELF_X86 = 3, + EXE_TYPE_ELF_ARM32 = 4, + EXE_TYPE_ELF_AARCH64 = 5, + EXE_TYPE_DEX = 6, +}; + +// Descibes where to find an executable embedded in an image. +struct Element { + ExecutableType exe_type; + offset_t offset; + offset_t length; +}; + +// A matched pair of Elements. +struct ElementMatch { + Element old_element; + Element new_element; +}; + +} // namespace zucchini + +#endif // CHROME_INSTALLER_ZUCCHINI_IMAGE_UTILS_H_
diff --git a/chrome/installer/zucchini/typed_value.h b/chrome/installer/zucchini/typed_value.h new file mode 100644 index 0000000..12ddf3f --- /dev/null +++ b/chrome/installer/zucchini/typed_value.h
@@ -0,0 +1,46 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_INSTALLER_ZUCCHINI_TYPED_VALUE_H_ +#define CHROME_INSTALLER_ZUCCHINI_TYPED_VALUE_H_ + +#include <cstdint> + +namespace zucchini { + +// Strong typed values, with compare and convert functions for underlying data. +// Typically one would use strongly typed enums for this. However, for Zucchini, +// the number of bytes is not fixed, and need to be represented as integer for +// iteration. +// |Tag| is a type tag used to uniquely identify TypedValue. +// |T| is an integral type used to hold values. +// Example: +// struct Foo : TypedValue<Foo, int> { +// using Foo::TypedValue::TypedValue; // inheriting constructor. +// }; +// Foo will be used to hold values of type |int|, but with a distinct type from +// any other TypedValue. +template <class Tag, class T> +class TypedValue { + public: + constexpr TypedValue() = default; + constexpr TypedValue(const T& value) : value_(value) {} + + explicit operator const T() const { return value_; } + const T value() const { return value_; } + + friend bool operator==(const TypedValue& a, const TypedValue& b) { + return a.value_ == b.value_; + } + friend bool operator!=(const TypedValue& a, const TypedValue& b) { + return !(a == b); + } + + protected: + T value_ = {}; +}; + +} // namespace zucchini + +#endif // CHROME_INSTALLER_ZUCCHINI_TYPED_VALUE_H_
diff --git a/chrome/installer/zucchini/typed_value_unittest.cc b/chrome/installer/zucchini/typed_value_unittest.cc new file mode 100644 index 0000000..f96f6f9 --- /dev/null +++ b/chrome/installer/zucchini/typed_value_unittest.cc
@@ -0,0 +1,40 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/installer/zucchini/typed_value.h" + +#include <type_traits> + +#include "testing/gtest/include/gtest/gtest.h" + +namespace zucchini { + +struct ValueA : TypedValue<ValueA, int> { + using ValueA::TypedValue::TypedValue; +}; + +struct ValueB : TypedValue<ValueB, int> { + using ValueB::TypedValue::TypedValue; +}; + +TEST(TypedIdTest, Value) { + EXPECT_EQ(42, ValueA(42).value()); + EXPECT_EQ(42, static_cast<int>(ValueA(42))); // explicit cast +} + +TEST(TypedIdTest, Comparison) { + EXPECT_TRUE(ValueA(0) == ValueA(0)); + EXPECT_FALSE(ValueA(0) == ValueA(42)); + EXPECT_FALSE(ValueA(0) != ValueA(0)); + EXPECT_TRUE(ValueA(0) != ValueA(42)); +} + +TEST(TypedIdTest, StrongType) { + static_assert(!std::is_convertible<ValueA, ValueB>::value, + "ValueA should not be convertible to ValueB"); + static_assert(!std::is_convertible<ValueB, ValueA>::value, + "ValueB should not be convertible to ValueA"); +} + +} // namespace zucchini
diff --git a/chrome/renderer/BUILD.gn b/chrome/renderer/BUILD.gn index 5623ec74..8d4c6833 100644 --- a/chrome/renderer/BUILD.gn +++ b/chrome/renderer/BUILD.gn
@@ -194,6 +194,8 @@ "pepper/pepper_uma_host.h", "plugins/chrome_plugin_placeholder.cc", "plugins/chrome_plugin_placeholder.h", + "plugins/pdf_plugin_placeholder.cc", + "plugins/pdf_plugin_placeholder.h", "plugins/plugin_preroller.cc", "plugins/plugin_preroller.h", "plugins/power_saver_info.cc",
diff --git a/chrome/renderer/autofill/fake_content_password_manager_driver.cc b/chrome/renderer/autofill/fake_content_password_manager_driver.cc index 7199ca5..096014c41 100644 --- a/chrome/renderer/autofill/fake_content_password_manager_driver.cc +++ b/chrome/renderer/autofill/fake_content_password_manager_driver.cc
@@ -76,6 +76,10 @@ called_record_save_progress_ = true; } +void FakeContentPasswordManagerDriver::UserModifiedPasswordField() { + called_user_modified_password_field_ = true; +} + void FakeContentPasswordManagerDriver::SaveGenerationFieldDetectedByClassifier( const autofill::PasswordForm& password_form, const base::string16& generation_field) {
diff --git a/chrome/renderer/autofill/fake_content_password_manager_driver.h b/chrome/renderer/autofill/fake_content_password_manager_driver.h index 5736e92..5de4491 100644 --- a/chrome/renderer/autofill/fake_content_password_manager_driver.h +++ b/chrome/renderer/autofill/fake_content_password_manager_driver.h
@@ -93,6 +93,10 @@ return called_record_save_progress_; } + bool called_user_modified_password_field() const { + return called_user_modified_password_field_; + } + bool called_save_generation_field() const { return called_save_generation_field_; } @@ -157,6 +161,8 @@ void RecordSavePasswordProgress(const std::string& log) override; + void UserModifiedPasswordField() override; + void SaveGenerationFieldDetectedByClassifier( const autofill::PasswordForm& password_form, const base::string16& generation_field) override; @@ -190,6 +196,8 @@ base::Optional<std::vector<autofill::PasswordForm>> password_forms_rendered_; // Records whether RecordSavePasswordProgress() gets called. bool called_record_save_progress_ = false; + // Records whether UserModifiedPasswordField() gets called. + bool called_user_modified_password_field_ = false; // Records whether SaveGenerationFieldDetectedByClassifier() gets called. bool called_save_generation_field_ = false; // Records data received via SaveGenerationFieldDetectedByClassifier() call.
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index fa44f43..add5f9d5 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -51,6 +51,7 @@ #include "chrome/renderer/page_load_metrics/metrics_render_frame_observer.h" #include "chrome/renderer/pepper/pepper_helper.h" #include "chrome/renderer/plugins/non_loadable_plugin_placeholder.h" +#include "chrome/renderer/plugins/pdf_plugin_placeholder.h" #include "chrome/renderer/plugins/plugin_preroller.h" #include "chrome/renderer/plugins/plugin_uma.h" #include "chrome/renderer/prerender/prerender_dispatcher.h" @@ -883,6 +884,13 @@ ASCIIToUTF16(ChromeContentClient::kPDFExtensionPluginName)) { ReportPDFLoadStatus( PDFLoadStatus::kShowedDisabledPluginPlaceholderForEmbeddedPdf); + + if (base::FeatureList::IsEnabled( + features::kClickToOpenPDFPlaceholder)) { + return PDFPluginPlaceholder::CreatePDFPlaceholder(render_frame, + params) + ->plugin(); + } } placeholder = create_blocked_plugin( @@ -1504,22 +1512,24 @@ DidInitializeServiceWorkerContextOnWorkerThread( v8::Local<v8::Context> context, int64_t service_worker_version_id, - const GURL& url) { + const GURL& service_worker_scope, + const GURL& script_url) { #if BUILDFLAG(ENABLE_EXTENSIONS) ChromeExtensionsRendererClient::GetInstance() ->extension_dispatcher() ->DidInitializeServiceWorkerContextOnWorkerThread( - context, service_worker_version_id, url); + context, service_worker_version_id, service_worker_scope, script_url); #endif } void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( v8::Local<v8::Context> context, int64_t service_worker_version_id, - const GURL& url) { + const GURL& service_worker_scope, + const GURL& script_url) { #if BUILDFLAG(ENABLE_EXTENSIONS) extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread( - context, service_worker_version_id, url); + context, service_worker_version_id, service_worker_scope, script_url); #endif }
diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h index e9e6622..2e78bdd 100644 --- a/chrome/renderer/chrome_content_renderer_client.h +++ b/chrome/renderer/chrome_content_renderer_client.h
@@ -187,11 +187,13 @@ void DidInitializeServiceWorkerContextOnWorkerThread( v8::Local<v8::Context> context, int64_t service_worker_version_id, - const GURL& url) override; + const GURL& service_worker_scope, + const GURL& script_url) override; void WillDestroyServiceWorkerContextOnWorkerThread( v8::Local<v8::Context> context, int64_t service_worker_version_id, - const GURL& url) override; + const GURL& service_worker_scope, + const GURL& script_url) override; bool ShouldEnforceWebRTCRoutingPreferences() override; GURL OverrideFlashEmbedWithHTML(const GURL& url) override; std::unique_ptr<base::TaskScheduler::InitParams> GetTaskSchedulerInitParams()
diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc index 784f773..4555cf7b 100644 --- a/chrome/renderer/content_settings_observer.cc +++ b/chrome/renderer/content_settings_observer.cc
@@ -6,6 +6,7 @@ #include "chrome/common/render_messages.h" #include "chrome/common/ssl_insecure_content.h" +#include "components/content_settings/core/common/content_settings.h" #include "content/public/common/url_constants.h" #include "content/public/renderer/document_state.h" #include "content/public/renderer/render_frame.h" @@ -71,14 +72,14 @@ if (rules.size() == 1) { DCHECK(rules[0].primary_pattern == ContentSettingsPattern::Wildcard()); DCHECK(rules[0].secondary_pattern == ContentSettingsPattern::Wildcard()); - return rules[0].setting; + return rules[0].GetContentSetting(); } const GURL& primary_url = GetOriginOrURL(frame); const GURL& secondary_gurl = secondary_url; for (it = rules.begin(); it != rules.end(); ++it) { if (it->primary_pattern.Matches(primary_url) && it->secondary_pattern.Matches(secondary_gurl)) { - return it->setting; + return it->GetContentSetting(); } } NOTREACHED();
diff --git a/chrome/renderer/content_settings_observer_browsertest.cc b/chrome/renderer/content_settings_observer_browsertest.cc index 21cd628..2b0f359 100644 --- a/chrome/renderer/content_settings_observer_browsertest.cc +++ b/chrome/renderer/content_settings_observer_browsertest.cc
@@ -5,10 +5,12 @@ #include <stddef.h> #include "base/run_loop.h" +#include "base/values.h" #include "chrome/common/render_messages.h" #include "chrome/renderer/content_settings_observer.h" #include "chrome/test/base/chrome_render_view_test.h" #include "components/content_settings/core/common/content_settings.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "content/public/renderer/render_view.h" #include "ipc/ipc_message_macros.h" #include "testing/gmock/include/gmock/gmock.h" @@ -104,12 +106,10 @@ RendererContentSettingRules content_setting_rules; ContentSettingsForOneType& script_setting_rules = content_setting_rules.script_rules; - script_setting_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_BLOCK, - std::string(), - false)); + script_setting_rules.push_back(ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), + content_settings::ContentSettingToValue(CONTENT_SETTING_BLOCK), + std::string(), false)); ContentSettingsObserver* observer = ContentSettingsObserver::Get( view_->GetMainRenderFrame()); observer->SetContentSettingRules(&content_setting_rules); @@ -183,12 +183,10 @@ RendererContentSettingRules content_setting_rules; ContentSettingsForOneType& image_setting_rules = content_setting_rules.image_rules; - image_setting_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_BLOCK, - std::string(), - false)); + image_setting_rules.push_back(ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), + content_settings::ContentSettingToValue(CONTENT_SETTING_BLOCK), + std::string(), false)); ContentSettingsObserver* observer = ContentSettingsObserver::Get( view_->GetMainRenderFrame()); @@ -204,9 +202,8 @@ ContentSettingPatternSource( ContentSettingsPattern::Wildcard(), ContentSettingsPattern::FromString(mock_observer.image_origin_), - CONTENT_SETTING_ALLOW, - std::string(), - false)); + content_settings::ContentSettingToValue(CONTENT_SETTING_ALLOW), + std::string(), false)); EXPECT_CALL(mock_observer, OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES, base::string16())).Times(0); @@ -224,12 +221,10 @@ RendererContentSettingRules content_setting_rules; ContentSettingsForOneType& image_setting_rules = content_setting_rules.image_rules; - image_setting_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_ALLOW, - std::string(), - false)); + image_setting_rules.push_back(ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), + content_settings::ContentSettingToValue(CONTENT_SETTING_ALLOW), + std::string(), false)); ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_->GetMainRenderFrame()); @@ -245,9 +240,8 @@ ContentSettingPatternSource( ContentSettingsPattern::Wildcard(), ContentSettingsPattern::FromString(mock_observer.image_origin_), - CONTENT_SETTING_BLOCK, - std::string(), - false)); + content_settings::ContentSettingToValue(CONTENT_SETTING_BLOCK), + std::string(), false)); EXPECT_CALL(mock_observer, OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES, base::string16())); EXPECT_FALSE(observer->AllowImage(true, mock_observer.image_url_)); @@ -259,12 +253,10 @@ RendererContentSettingRules content_setting_rules; ContentSettingsForOneType& script_setting_rules = content_setting_rules.script_rules; - script_setting_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_BLOCK, - std::string(), - false)); + script_setting_rules.push_back(ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), + content_settings::ContentSettingToValue(CONTENT_SETTING_BLOCK), + std::string(), false)); ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_->GetMainRenderFrame()); @@ -296,12 +288,10 @@ RendererContentSettingRules content_setting_rules; ContentSettingsForOneType& script_setting_rules = content_setting_rules.script_rules; - script_setting_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_ALLOW, - std::string(), - false)); + script_setting_rules.push_back(ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), + content_settings::ContentSettingToValue(CONTENT_SETTING_ALLOW), + std::string(), false)); ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_->GetMainRenderFrame()); @@ -338,7 +328,8 @@ content_setting_rules.script_rules; script_setting_rules.push_back(ContentSettingPatternSource( ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_BLOCK, std::string(), false)); + content_settings::ContentSettingToValue(CONTENT_SETTING_BLOCK), + std::string(), false)); ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_->GetMainRenderFrame()); @@ -369,7 +360,8 @@ script_setting_rules.clear(); script_setting_rules.push_back(ContentSettingPatternSource( ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_ALLOW, std::string(), false)); + content_settings::ContentSettingToValue(CONTENT_SETTING_ALLOW), + std::string(), false)); observer->SetContentSettingRules(&content_setting_rules); // 4. Reload the page. @@ -421,7 +413,8 @@ content_setting_rules.script_rules; script_setting_rules.push_back(ContentSettingPatternSource( ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_BLOCK, std::string(), false)); + content_settings::ContentSettingToValue(CONTENT_SETTING_BLOCK), + std::string(), false)); ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_->GetMainRenderFrame()); @@ -439,21 +432,17 @@ RendererContentSettingRules content_setting_rules; ContentSettingsForOneType& script_setting_rules = content_setting_rules.script_rules; - script_setting_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_BLOCK, - std::string(), - false)); + script_setting_rules.push_back(ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), + content_settings::ContentSettingToValue(CONTENT_SETTING_BLOCK), + std::string(), false)); // Block images. ContentSettingsForOneType& image_setting_rules = content_setting_rules.image_rules; - image_setting_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_BLOCK, - std::string(), - false)); + image_setting_rules.push_back(ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), + content_settings::ContentSettingToValue(CONTENT_SETTING_BLOCK), + std::string(), false)); ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_->GetMainRenderFrame()); @@ -497,12 +486,10 @@ RendererContentSettingRules content_setting_rules; ContentSettingsForOneType& autoplay_setting_rules = content_setting_rules.autoplay_rules; - autoplay_setting_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_ALLOW, - std::string(), - false)); + autoplay_setting_rules.push_back(ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), + content_settings::ContentSettingToValue(CONTENT_SETTING_ALLOW), + std::string(), false)); ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_->GetMainRenderFrame()); @@ -517,9 +504,8 @@ ContentSettingPatternSource( ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_BLOCK, - std::string(), - false)); + content_settings::ContentSettingToValue(CONTENT_SETTING_BLOCK), + std::string(), false)); EXPECT_FALSE(observer->AllowAutoplay(true)); ::testing::Mock::VerifyAndClearExpectations(&observer);
diff --git a/chrome/renderer/plugins/pdf_plugin_placeholder.cc b/chrome/renderer/plugins/pdf_plugin_placeholder.cc new file mode 100644 index 0000000..3263551 --- /dev/null +++ b/chrome/renderer/plugins/pdf_plugin_placeholder.cc
@@ -0,0 +1,33 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/renderer/plugins/pdf_plugin_placeholder.h" + +#include "chrome/grit/renderer_resources.h" +#include "ui/base/resource/resource_bundle.h" +#include "ui/base/webui/jstemplate_builder.h" + +gin::WrapperInfo PDFPluginPlaceholder::kWrapperInfo = {gin::kEmbedderNativeGin}; + +PDFPluginPlaceholder::PDFPluginPlaceholder(content::RenderFrame* render_frame, + const blink::WebPluginParams& params, + const std::string& html_data) + : plugins::PluginPlaceholderBase(render_frame, params, html_data) {} + +PDFPluginPlaceholder::~PDFPluginPlaceholder() {} + +PDFPluginPlaceholder* PDFPluginPlaceholder::CreatePDFPlaceholder( + content::RenderFrame* render_frame, + const blink::WebPluginParams& params) { + const base::StringPiece template_html( + ResourceBundle::GetSharedInstance().GetRawDataResource( + IDR_PDF_PLUGIN_HTML)); + base::DictionaryValue values; + std::string html_data = webui::GetI18nTemplateHtml(template_html, &values); + return new PDFPluginPlaceholder(render_frame, params, html_data); +} + +v8::Local<v8::Value> PDFPluginPlaceholder::GetV8Handle(v8::Isolate* isolate) { + return gin::CreateHandle(isolate, this).ToV8(); +}
diff --git a/chrome/renderer/plugins/pdf_plugin_placeholder.h b/chrome/renderer/plugins/pdf_plugin_placeholder.h new file mode 100644 index 0000000..e3975ce --- /dev/null +++ b/chrome/renderer/plugins/pdf_plugin_placeholder.h
@@ -0,0 +1,35 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_RENDERER_PLUGINS_PDF_PLUGIN_PLACEHOLDER_H_ +#define CHROME_RENDERER_PLUGINS_PDF_PLUGIN_PLACEHOLDER_H_ + +#include "components/plugins/renderer/plugin_placeholder.h" + +// Placeholder that allows users to click to download a PDF for when +// plugins are disabled and the PDF fails to load. +// TODO(amberwon): Flesh out the class more to download an embedded PDF when the +// PDF plugin is disabled or unavailable. +class PDFPluginPlaceholder : public plugins::PluginPlaceholderBase, + public gin::Wrappable<PDFPluginPlaceholder> { + public: + static gin::WrapperInfo kWrapperInfo; + + // Returned placeholder is owned by the associated plugin, which can be + // retrieved with PluginPlaceholderBase::plugin(). + static PDFPluginPlaceholder* CreatePDFPlaceholder( + content::RenderFrame* render_frame, + const blink::WebPluginParams& params); + + private: + PDFPluginPlaceholder(content::RenderFrame* render_frame, + const blink::WebPluginParams& params, + const std::string& html_data); + ~PDFPluginPlaceholder() final; + + // WebViewPlugin::Delegate methods: + v8::Local<v8::Value> GetV8Handle(v8::Isolate* isolate) final; +}; + +#endif // CHROME_RENDERER_PLUGINS_PDF_PLUGIN_PLACEHOLDER_H_
diff --git a/chrome/renderer/resources/plugins/pdf_plugin.html b/chrome/renderer/resources/plugins/pdf_plugin.html new file mode 100644 index 0000000..9149032 --- /dev/null +++ b/chrome/renderer/resources/plugins/pdf_plugin.html
@@ -0,0 +1,9 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8"> + </head> + <body> + <!-- TODO(amberwon): Add html with the finalized UI. --> + </body> +</html>
diff --git a/chrome/renderer/resources/renderer_resources.grd b/chrome/renderer/resources/renderer_resources.grd index f467a4f..fef051c 100644 --- a/chrome/renderer/resources/renderer_resources.grd +++ b/chrome/renderer/resources/renderer_resources.grd
@@ -16,6 +16,7 @@ <includes> <include name="IDR_BLOCKED_PLUGIN_HTML" file="plugins/blocked_plugin.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_DISABLED_PLUGIN_HTML" file="plugins/disabled_plugin.html" flattenhtml="true" type="BINDATA" /> + <include name="IDR_PDF_PLUGIN_HTML" file="plugins/pdf_plugin.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_PREFER_HTML_PLUGIN_HTML" file="plugins/prefer_html_plugin.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_PLUGIN_POSTER_HTML" file="plugins/plugin_poster.html" flattenhtml="true" type="BINDATA" />
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index c6aef16d..a0583d4 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -1239,6 +1239,7 @@ "../browser/chrome_origin_trials_browsertest.cc", "../browser/chrome_plugin_browsertest.cc", "../browser/chrome_security_exploit_browsertest.cc", + "../browser/chrome_service_worker_browsertest.cc", "../browser/chrome_site_per_process_browsertest.cc", "../browser/chrome_switches_browsertest.cc", "../browser/component_updater/component_patcher_operation_out_of_process_browsertest.cc", @@ -1741,7 +1742,6 @@ } if (enable_nacl) { sources += [ - "../browser/chrome_service_worker_browsertest.cc", "../browser/extensions/extension_nacl_browsertest.cc", "../browser/nacl_host/test/gdb_debug_stub_browsertest.cc", "nacl/nacl_browsertest.cc", @@ -2570,13 +2570,15 @@ } if (!enable_print_preview) { sources -= [ - "../browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc", "../browser/printing/print_browsertest.cc", "../browser/printing/print_preview_dialog_controller_browsertest.cc", "../browser/printing/print_preview_pdf_generated_browsertest.cc", "../browser/service_process/service_process_control_browsertest.cc", "../browser/ui/webui/print_preview/print_preview_ui_browsertest.cc", ] + if (enable_extensions) { + sources -= [ "../browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc" ] + } } if (!enable_print_preview || is_mac || is_chromeos) { sources -= [ @@ -3275,6 +3277,7 @@ "../browser/shell_integration_win_unittest.cc", "../browser/signin/account_reconcilor_unittest.cc", "../browser/signin/chrome_signin_client_unittest.cc", + "../browser/signin/chrome_signin_helper_unittest.cc", "../browser/signin/chrome_signin_status_metrics_provider_delegate_unittest.cc", "../browser/signin/local_auth_unittest.cc", "../browser/signin/signin_manager_unittest.cc", @@ -4934,6 +4937,10 @@ "//ui/app_list:test_support", ] } + + if (is_win || is_mac || (is_linux && !is_chromeos)) { + sources += [ "../browser/password_manager/password_store_signin_notifier_impl_unittest.cc" ] + } } if (safe_browsing_mode == 1 && is_mac) {
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/suggestions/ContentSuggestionsTestUtils.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/suggestions/ContentSuggestionsTestUtils.java index 0ed20b2..72450d3b 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/suggestions/ContentSuggestionsTestUtils.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/suggestions/ContentSuggestionsTestUtils.java
@@ -21,13 +21,22 @@ public final class ContentSuggestionsTestUtils { private ContentSuggestionsTestUtils() {} + public static SnippetArticle createDummySuggestion( + @CategoryInt int category, String suffix, boolean isVideoSuggestion) { + return new SnippetArticle(category, "https://site.com/url" + suffix, "title" + suffix, + "pub" + suffix, "txt" + suffix, "https://site.com/url" + suffix, 0, 0, 0, + isVideoSuggestion); + } + + public static SnippetArticle createDummySuggestion(@CategoryInt int category) { + return createDummySuggestion(category, "", false); + } + public static List<SnippetArticle> createDummySuggestions( - int count, @CategoryInt int category, String prefix) { + int count, @CategoryInt int category, String suffix) { List<SnippetArticle> suggestions = new ArrayList<>(); for (int index = 0; index < count; index++) { - suggestions.add(new SnippetArticle(category, "https://site.com/url" + prefix + index, - prefix + "title" + index, "pub" + index, "txt" + index, - "https://site.com/url" + index, 0, 0, 0, false)); + suggestions.add(createDummySuggestion(category, suffix + index, false)); } return suggestions; }
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/suggestions/SuggestionsDependenciesRule.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/suggestions/SuggestionsDependenciesRule.java index f98f83c..71baf55 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/suggestions/SuggestionsDependenciesRule.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/suggestions/SuggestionsDependenciesRule.java
@@ -8,6 +8,8 @@ import org.junit.runner.Description; import org.chromium.base.annotations.SuppressFBWarnings; +import org.chromium.chrome.browser.download.ui.ThumbnailProvider; +import org.chromium.chrome.browser.favicon.FaviconHelper; import org.chromium.chrome.browser.favicon.LargeIconBridge; import org.chromium.chrome.browser.ntp.snippets.SuggestionsSource; import org.chromium.chrome.browser.profiles.Profile; @@ -52,6 +54,8 @@ public MostVisitedSites mostVisitedSites; public LargeIconBridge largeIconBridge; public SuggestionsEventReporter eventReporter; + public ThumbnailProvider thumbnailProvider; + public FaviconHelper faviconHelper; @Override public SuggestionsSource createSuggestionSource(Profile profile) { @@ -76,5 +80,17 @@ if (largeIconBridge != null) return largeIconBridge; return new LargeIconBridge(profile); } + + @Override + public ThumbnailProvider createThumbnailProvider() { + if (thumbnailProvider != null) return thumbnailProvider; + return super.createThumbnailProvider(); + } + + @Override + public FaviconHelper createFaviconHelper() { + if (faviconHelper != null) return faviconHelper; + return super.createFaviconHelper(); + } } }
diff --git a/chrome/test/base/browser_perf_tests_main.cc b/chrome/test/base/browser_perf_tests_main.cc index 8cca36bf..efea5db 100644 --- a/chrome/test/base/browser_perf_tests_main.cc +++ b/chrome/test/base/browser_perf_tests_main.cc
@@ -8,7 +8,9 @@ int main(int argc, char** argv) { // Always run browser perf tests serially - parallel running would be less // deterministic and distort perf measurements. + size_t parallel_jobs = 1U; + ChromeTestSuiteRunner runner; ChromeTestLauncherDelegate delegate(&runner); - return LaunchChromeTests(1, &delegate, argc, argv); + return LaunchChromeTests(parallel_jobs, &delegate, argc, argv); }
diff --git a/chrome/test/base/browser_tests_main.cc b/chrome/test/base/browser_tests_main.cc index b70df69f..fc92756 100644 --- a/chrome/test/base/browser_tests_main.cc +++ b/chrome/test/base/browser_tests_main.cc
@@ -2,15 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <algorithm> - -#include "base/sys_info.h" +#include "base/command_line.h" +#include "base/test/launcher/test_launcher.h" #include "chrome/test/base/chrome_test_launcher.h" #include "chrome/test/base/chrome_test_suite.h" int main(int argc, char** argv) { - int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); + base::CommandLine::Init(argc, argv); + size_t parallel_jobs = base::NumParallelJobs(); + if (parallel_jobs == 0U) { + return 1; + } else if (parallel_jobs > 1U) { + parallel_jobs /= 2U; + } + ChromeTestSuiteRunner runner; ChromeTestLauncherDelegate delegate(&runner); - return LaunchChromeTests(default_jobs, &delegate, argc, argv); + return LaunchChromeTests(parallel_jobs, &delegate, argc, argv); }
diff --git a/chrome/test/base/browser_tests_main_chromeos.cc b/chrome/test/base/browser_tests_main_chromeos.cc index 6ce258fb..57f7776 100644 --- a/chrome/test/base/browser_tests_main_chromeos.cc +++ b/chrome/test/base/browser_tests_main_chromeos.cc
@@ -2,9 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <algorithm> - -#include "base/sys_info.h" +#include "base/command_line.h" +#include "base/test/launcher/test_launcher.h" #include "chrome/test/base/chrome_test_launcher.h" #include "chrome/test/base/chrome_test_suite.h" #include "chrome/test/base/mash_browser_tests_main.h" @@ -14,8 +13,15 @@ if (RunMashBrowserTests(argc, argv, &exit_code)) return exit_code; - int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); + base::CommandLine::Init(argc, argv); + size_t parallel_jobs = base::NumParallelJobs(); + if (parallel_jobs == 0U) { + return 1; + } else if (parallel_jobs > 1U) { + parallel_jobs /= 2U; + } + ChromeTestSuiteRunner runner; ChromeTestLauncherDelegate delegate(&runner); - return LaunchChromeTests(default_jobs, &delegate, argc, argv); + return LaunchChromeTests(parallel_jobs, &delegate, argc, argv); }
diff --git a/chrome/test/base/chrome_test_launcher.cc b/chrome/test/base/chrome_test_launcher.cc index 5e678f0..9ac53c8 100644 --- a/chrome/test/base/chrome_test_launcher.cc +++ b/chrome/test/base/chrome_test_launcher.cc
@@ -125,7 +125,7 @@ #endif } -int LaunchChromeTests(int default_jobs, +int LaunchChromeTests(size_t parallel_jobs, content::TestLauncherDelegate* delegate, int argc, char** argv) { @@ -146,5 +146,5 @@ crash_reporter::SetCrashReporterClient(crash_client); #endif - return content::LaunchTests(delegate, default_jobs, argc, argv); + return content::LaunchTests(delegate, parallel_jobs, argc, argv); }
diff --git a/chrome/test/base/chrome_test_launcher.h b/chrome/test/base/chrome_test_launcher.h index af6d80f..6ad9d06 100644 --- a/chrome/test/base/chrome_test_launcher.h +++ b/chrome/test/base/chrome_test_launcher.h
@@ -44,10 +44,10 @@ DISALLOW_COPY_AND_ASSIGN(ChromeTestLauncherDelegate); }; -// Launches Chrome browser tests. |default_jobs| is number of test jobs to be -// run in parallel, unless overridden from the command line. Returns exit code. +// Launches Chrome browser tests. |parallel_jobs| is number of test jobs to be +// run in parallel. Returns exit code. // Does not take ownership of ChromeTestLauncherDelegate. -int LaunchChromeTests(int default_jobs, +int LaunchChromeTests(size_t parallel_jobs, content::TestLauncherDelegate* delegate, int argc, char** argv);
diff --git a/chrome/test/base/interactive_ui_tests_main.cc b/chrome/test/base/interactive_ui_tests_main.cc index c2491cf..a33c029 100644 --- a/chrome/test/base/interactive_ui_tests_main.cc +++ b/chrome/test/base/interactive_ui_tests_main.cc
@@ -102,11 +102,13 @@ InProcessBrowserTest::set_global_browser_set_up_function( &ui_test_utils::BringBrowserWindowToFront); #endif + // Run interactive_ui_tests serially, they do not support running in parallel. - int default_jobs = 1; + size_t parallel_jobs = 1U; + InteractiveUITestSuiteRunner runner; ChromeTestLauncherDelegate delegate(&runner); - const int result = LaunchChromeTests(default_jobs, &delegate, argc, argv); + const int result = LaunchChromeTests(parallel_jobs, &delegate, argc, argv); #if defined(OS_WIN) KillAlwaysOnTopWindows(RunType::AFTER_TEST); #endif
diff --git a/chrome/test/base/mash_browser_tests_main.cc b/chrome/test/base/mash_browser_tests_main.cc index aca66ca7..af58976c 100644 --- a/chrome/test/base/mash_browser_tests_main.cc +++ b/chrome/test/base/mash_browser_tests_main.cc
@@ -19,6 +19,7 @@ #include "base/run_loop.h" #include "base/sys_info.h" #include "base/task_scheduler/task_scheduler.h" +#include "base/test/launcher/test_launcher.h" #include "base/threading/thread_task_runner_handle.h" #include "base/values.h" #include "chrome/app/mash/embedded_services.h" @@ -201,7 +202,10 @@ return true; } - int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); + size_t parallel_jobs = base::NumParallelJobs(); + if (parallel_jobs > 1U) { + parallel_jobs /= 2U; + } MashTestLauncherDelegate delegate; // --single_process and no service pipe token indicate we were run directly // from the command line. In this case we have to start up @@ -214,6 +218,6 @@ content::ServiceManagerConnection::SetFactoryForTest( &service_manager_connection_factory); } - *exit_code = LaunchChromeTests(default_jobs, &delegate, argc, argv); + *exit_code = LaunchChromeTests(parallel_jobs, &delegate, argc, argv); return true; }
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc index 884a457..e66d6c76 100644 --- a/chrome/test/base/testing_profile.cc +++ b/chrome/test/base/testing_profile.cc
@@ -68,6 +68,7 @@ #include "components/history/core/browser/history_service.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/keyed_service/core/refcounted_keyed_service.h" +#include "components/offline_pages/features/features.h" #include "components/omnibox/browser/autocomplete_classifier.h" #include "components/omnibox/browser/history_index_restore_observer.h" #include "components/omnibox/browser/in_memory_url_index.h" @@ -129,8 +130,8 @@ #include "chrome/browser/supervised_user/supervised_user_settings_service_factory.h" #endif -#if defined(OS_ANDROID) -#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" +#if BUILDFLAG(ENABLE_OFFLINE_PAGES) +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "components/offline_pages/core/stub_offline_page_model.h" #endif @@ -253,7 +254,7 @@ &TestProfileErrorCallback); } -#if defined(OS_ANDROID) +#if BUILDFLAG(ENABLE_OFFLINE_PAGES) std::unique_ptr<KeyedService> BuildOfflinePageModel( content::BrowserContext* context) { return base::MakeUnique<offline_pages::StubOfflinePageModel>(); @@ -640,7 +641,7 @@ base::FilePath path = GetPath().Append(bookmarks::kBookmarksFileName); base::DeleteFile(path, false); } -#if defined(OS_ANDROID) +#if BUILDFLAG(ENABLE_OFFLINE_PAGES) offline_pages::OfflinePageModelFactory::GetInstance()->SetTestingFactory( this, BuildOfflinePageModel); #endif
diff --git a/chrome/test/chromedriver/net/websocket.cc b/chrome/test/chromedriver/net/websocket.cc index 3f43f48..6e15f3dd 100644 --- a/chrome/test/chromedriver/net/websocket.cc +++ b/chrome/test/chromedriver/net/websocket.cc
@@ -88,7 +88,7 @@ endpoints.AppendString(endpoint.ToStringWithoutPort()); std::string json; CHECK(base::JSONWriter::Write(endpoints, &json)); - VLOG(0) << "resolved " << url_.HostNoBrackets() << " to " << json; + VLOG(0) << "resolved " << url_.HostNoBracketsPiece() << " to " << json; } net::NetLogSource source; @@ -127,8 +127,8 @@ void WebSocket::OnSocketConnect(int code) { if (code != net::OK) { - VLOG(1) << "failed to connect to " << url_.HostNoBrackets() << " (error " - << code << ")"; + VLOG(1) << "failed to connect to " << url_.HostNoBracketsPiece() + << " (error " << code << ")"; Close(code); return; }
diff --git a/chrome/test/data/android/webvr_instrumentation/html/test_presentation_locks_focus.html b/chrome/test/data/android/webvr_instrumentation/html/test_presentation_locks_focus.html index 0378246..bb1084d 100644 --- a/chrome/test/data/android/webvr_instrumentation/html/test_presentation_locks_focus.html +++ b/chrome/test/data/android/webvr_instrumentation/html/test_presentation_locks_focus.html
@@ -23,7 +23,7 @@ }; window.onblur = function() { onAnimationFrameCallback = function() { - if (rafCount = 3) { + if (rafCount == 3) { t.done(); } rafCount++;
diff --git a/chrome/test/data/extensions/api_test/messaging/connect_crash/test.js b/chrome/test/data/extensions/api_test/messaging/connect_crash/test.js index d9f6db28..409c7b12 100644 --- a/chrome/test/data/extensions/api_test/messaging/connect_crash/test.js +++ b/chrome/test/data/extensions/api_test/messaging/connect_crash/test.js
@@ -22,7 +22,7 @@ chrome.tabs.sendMessage(port.sender.tab.id, 'Rob says hi', function() { chrome.test.log('tab.sendMessage\'s response callback was invoked'); chrome.test.assertLastError( - 'The message port closed before a reponse was received.'); + 'The message port closed before a response was received.'); succeed2(); }); });
diff --git a/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/manifest.json b/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/manifest.json new file mode 100644 index 0000000..30bd2d73 --- /dev/null +++ b/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/manifest.json
@@ -0,0 +1,6 @@ +{ + "name": "Service worker with chrome.tabs.onUpdated event", + "version": "1.0", + "manifest_version": 2, + "permissions": [ "tabs" ] +}
diff --git a/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/on_updated.html b/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/on_updated.html new file mode 100644 index 0000000..41cd8f6 --- /dev/null +++ b/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/on_updated.html
@@ -0,0 +1,6 @@ +<!DOCTYPE html> +<html> +<head> + <script src="on_updated.js"></script> +</head> +</html>
diff --git a/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/on_updated.js b/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/on_updated.js new file mode 100644 index 0000000..5ce2a61 --- /dev/null +++ b/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/on_updated.js
@@ -0,0 +1,13 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +window.onload = function() { + setTimeout(function() { + document.title = 'foo'; + setTimeout(function() { + document.title = 'bar'; + }, 0); + }, 0); +} +
diff --git a/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/page.html b/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/page.html new file mode 100644 index 0000000..f6e2de85 --- /dev/null +++ b/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/page.html
@@ -0,0 +1 @@ +<script src="page.js"></script>
diff --git a/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/page.js b/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/page.js new file mode 100644 index 0000000..43c3454 --- /dev/null +++ b/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/page.js
@@ -0,0 +1,30 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +var readyPromise = new Promise(function(resolve, reject) { + navigator.serviceWorker.register('sw.js').then(function() { + return navigator.serviceWorker.ready; + }).then(function(registration) { + resolve('ready'); + }).catch(function(err) { + reject(err); + }); +}); + +window.runServiceWorker = function() { + readyPromise.then(function(message) { + window.domAutomationController.send(message); + }).catch(function(err) { + window.domAutomationController.send('FAILURE'); + }); +}; + +window.createTabThenUpdate = function() { + navigator.serviceWorker.onmessage = function(e) { + // e.data -> 'chrome.tabs.onUpdated callback'. + window.domAutomationController.send(e.data); + }; + var url = chrome.extension.getURL('on_updated.html'); + chrome.tabs.create({url: url}); +};
diff --git a/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/sw.js b/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/sw.js new file mode 100644 index 0000000..f6a7374c --- /dev/null +++ b/chrome/test/data/extensions/api_test/service_worker/events_to_stopped_worker/sw.js
@@ -0,0 +1,55 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +var expectedEventData; +var capturedEventData; + +function expect(data) { + expectedEventData = data; + capturedEventData = []; +} + +// Claim clients to send postMessage reply to them. +self.addEventListener('activate', function(e) { + e.waitUntil(self.clients.claim()); +}); + +function sendMessage(msg) { + clients.matchAll({}).then(function(clients) { + clients.forEach(function(client) { + client.postMessage(msg); + }); + }); +} + +function checkExpectations() { + if (capturedEventData.length < expectedEventData.length) { + return; + } + + var passed = JSON.stringify(expectedEventData) == + JSON.stringify(capturedEventData); + if (passed) { + sendMessage('chrome.tabs.onUpdated callback'); + } else { + sendMessage('FAILURE'); + } +} + +function addOnUpdatedListener() { + chrome.tabs.onUpdated.addListener(function(tabId, info, tab) { + capturedEventData.push(info); + checkExpectations(); + }); + + var url = chrome.extension.getURL('on_updated.html'); + expect([ + {status: 'loading', 'url': url}, + {status: 'complete'}, + {title: 'foo'}, + {title: 'bar'} + ]); +}; + +addOnUpdatedListener();
diff --git a/chrome/test/data/webui/cr_elements/cr_action_menu_test.js b/chrome/test/data/webui/cr_elements/cr_action_menu_test.js index 06a1060..62e5101 100644 --- a/chrome/test/data/webui/cr_elements/cr_action_menu_test.js +++ b/chrome/test/data/webui/cr_elements/cr_action_menu_test.js
@@ -215,8 +215,6 @@ anchorAlignmentX: AnchorAlignment.CENTER, anchorAlignmentY: AnchorAlignment.CENTER, })); - menuWidth = menu.offsetWidth; - menuHeight = menu.offsetHeight; assertEquals(`${120 - menuWidth / 2}px`, menu.style.left); assertEquals(`${255 - menuHeight / 2}px`, menu.style.top); menu.close(); @@ -226,8 +224,6 @@ anchorAlignmentX: AnchorAlignment.BEFORE_END, anchorAlignmentY: AnchorAlignment.BEFORE_END, })); - menuWidth = menu.offsetWidth; - menuHeight = menu.offsetHeight; assertEquals(`${140 - menuWidth}px`, menu.style.left); assertEquals(`${260 - menuHeight}px`, menu.style.top); menu.close(); @@ -239,8 +235,6 @@ left: 0, top: 0, })); - menuWidth = menu.offsetWidth; - menuHeight = menu.offsetHeight; assertEquals(`0px`, menu.style.left); assertEquals(`0px`, menu.style.top); menu.close(); @@ -253,17 +247,25 @@ maxX: 1000, maxY: 2000, }); - menuWidth = menu.offsetWidth; - menuHeight = menu.offsetHeight; assertEquals(`${1000 - menuWidth}px`, menu.style.left); assertEquals(`${2000 - menuHeight}px`, menu.style.top); menu.close(); + // If the viewport can't fit the menu, align the menu to the viewport. + menu.showAtPosition({ + left: menuWidth - 5, + top: 0, + width: 0, + height: 0, + maxX: menuWidth * 2 - 10, + }); + assertEquals(`${menuWidth - 10}px`, menu.style.left); + assertEquals(`0px`, menu.style.top); + menu.close(); + // Alignment is reversed in RTL. document.body.style.direction = 'rtl'; menu.showAtPosition(config); - menuWidth = menu.offsetWidth; - menuHeight = menu.offsetHeight; assertTrue(menu.open); assertEquals(140 - menuWidth, menu.offsetLeft); assertEquals('250px', menu.style.top);
diff --git a/chrome/test/data/webui/md_bookmarks/command_manager_test.js b/chrome/test/data/webui/md_bookmarks/command_manager_test.js index f4672d1e..61ff0f8 100644 --- a/chrome/test/data/webui/md_bookmarks/command_manager_test.js +++ b/chrome/test/data/webui/md_bookmarks/command_manager_test.js
@@ -50,6 +50,7 @@ createFolder('21', []), ]), createFolder('3', bulkChildren)), + selectedFolder: '1', }); store.replaceSingleton(); @@ -59,10 +60,11 @@ document.createElement('bookmarks-toast-manager')); }); - test('can only copy single URL items', function() { - assertFalse(commandManager.canExecute(Command.COPY, new Set(['11']))); - assertFalse(commandManager.canExecute(Command.COPY, new Set(['11', '13']))); - assertTrue(commandManager.canExecute(Command.COPY, new Set(['13']))); + test('Copy URL is only active for single URL items', function() { + assertFalse(commandManager.canExecute(Command.COPY_URL, new Set(['11']))); + assertFalse( + commandManager.canExecute(Command.COPY_URL, new Set(['11', '13']))); + assertTrue(commandManager.canExecute(Command.COPY_URL, new Set(['13']))); }); test('context menu hides invalid commands', function() { @@ -79,32 +81,32 @@ // With a folder and an item selected, the only available context menu item // is 'Delete'. - assertTrue(commandHidden['edit']); - assertTrue(commandHidden['copy']); - assertFalse(commandHidden['delete']); + assertTrue(commandHidden[Command.EDIT]); + assertTrue(commandHidden[Command.COPY_URL]); + assertFalse(commandHidden[Command.DELETE]); }); - test('keyboard shortcuts trigger when valid', function() { - var modifier = cr.isMac ? 'meta' : 'ctrl'; + test('edit shortcut triggers when valid', function() { + var key = cr.isMac ? 'Enter' : 'F2'; store.data.selection.items = new Set(['13']); store.notifyObservers(); - MockInteractions.pressAndReleaseKeyOn(document.body, 67, modifier, 'c'); - commandManager.assertLastCommand('copy', ['13']); + MockInteractions.pressAndReleaseKeyOn(document.body, '', [], key); + commandManager.assertLastCommand('edit', ['13']); - // Doesn't trigger when a folder is selected. - store.data.selection.items = new Set(['11']); + // Doesn't trigger when multiple items are selected. + store.data.selection.items = new Set(['11', '13']); store.notifyObservers(); - MockInteractions.pressAndReleaseKeyOn(document.body, 67, modifier, 'c'); + MockInteractions.pressAndReleaseKeyOn(document.body, '', [], key); commandManager.assertLastCommand(null); // Doesn't trigger when nothing is selected. store.data.selection.items = new Set(); store.notifyObservers(); - MockInteractions.pressAndReleaseKeyOn(document.body, 67, modifier, 'c'); + MockInteractions.pressAndReleaseKeyOn(document.body, '', [], key); commandManager.assertLastCommand(null); }); @@ -116,15 +118,35 @@ commandManager.assertLastCommand('delete', ['12', '13']); }); - test('edit command triggers', function() { - var key = cr.isMac ? 'Enter' : 'F2'; - var keyCode = cr.isMac ? 13 : 113; + test('copy command triggers', function() { + var modifier = cr.isMac ? 'meta' : 'ctrl'; - store.data.selection.items = new Set(['11']); + store.data.selection.items = new Set(['11', '13']); store.notifyObservers(); - MockInteractions.pressAndReleaseKeyOn(document.body, keyCode, '', key); - commandManager.assertLastCommand('edit', ['11']); + MockInteractions.pressAndReleaseKeyOn(document.body, '', modifier, 'c'); + commandManager.assertLastCommand('copy', ['11', '13']); + }); + + test('cut/paste commands trigger', function() { + var lastCut; + var lastPaste; + chrome.bookmarkManagerPrivate.cut = function(idList) { + lastCut = idList.sort(); + }; + chrome.bookmarkManagerPrivate.paste = function(selectedFolder) { + lastPaste = selectedFolder; + }; + + var modifier = cr.isMac ? 'meta' : 'ctrl'; + + store.data.selection.items = new Set(['11', '13']); + store.notifyObservers(); + + MockInteractions.pressAndReleaseKeyOn(document.body, '', modifier, 'x'); + assertDeepEquals(['11', '13'], lastCut); + MockInteractions.pressAndReleaseKeyOn(document.body, '', modifier, 'v'); + assertEquals('1', lastPaste); }); test('undo and redo commands trigger', function() {
diff --git a/chrome/test/data/webui/md_bookmarks/dnd_manager_test.js b/chrome/test/data/webui/md_bookmarks/dnd_manager_test.js index 2c71a90..5da049d 100644 --- a/chrome/test/data/webui/md_bookmarks/dnd_manager_test.js +++ b/chrome/test/data/webui/md_bookmarks/dnd_manager_test.js
@@ -527,4 +527,21 @@ assertEquals( DropPosition.NONE, dndManager.calculateValidDropPositions_(dragTarget)); }); + + test('ensure drag and drop chip shows', function() { + var dragElement = getListItem('13'); + var dragTarget = getFolderNode('2'); + dispatchDragEvent('dragstart', dragElement); + dndManager.dragInfo_.handleChromeDragEnter(createDragData(draggedIds)); + + dispatchDragEvent('dragover', dragTarget, {x: 50, y: 80}); + assertTrue(!!dndManager.chip_); + var dndChip = dndManager.dndChip; + assertEquals('50px', dndChip.style.getPropertyValue('--mouse-x')); + assertEquals('80px', dndChip.style.getPropertyValue('--mouse-y')); + assertTrue(dndChip.showing_); + + dispatchDragEvent('dragend', dragElement); + assertFalse(dndChip.showing_); + }); });
diff --git a/chrome/test/data/webui/md_bookmarks/toast_manager_test.js b/chrome/test/data/webui/md_bookmarks/toast_manager_test.js index 24ba421..b7d4dffd 100644 --- a/chrome/test/data/webui/md_bookmarks/toast_manager_test.js +++ b/chrome/test/data/webui/md_bookmarks/toast_manager_test.js
@@ -22,6 +22,9 @@ toastManager.show('test', true); assertFalse(toastManager.$$('paper-button').hidden); + + toastManager.hide(); + assertTrue(toastManager.$.button.hidden); }); test('auto hide', function() {
diff --git a/chrome/test/data/webui/md_user_manager/user_manager_browsertest.js b/chrome/test/data/webui/md_user_manager/user_manager_browsertest.js index 931f2be..8e4b587e 100644 --- a/chrome/test/data/webui/md_user_manager/user_manager_browsertest.js +++ b/chrome/test/data/webui/md_user_manager/user_manager_browsertest.js
@@ -10,6 +10,7 @@ // Polymer BrowserTest fixture. GEN_INCLUDE( [ROOT_PATH + 'chrome/test/data/webui/polymer_browser_test_base.js']); +GEN('#include "base/command_line.h"'); /** * @constructor @@ -24,6 +25,10 @@ browsePreload: 'chrome://md-user-manager/', /** @override */ + commandLineSwitches: [{switchName: 'enable-features', + switchValue: 'SupervisedUserCreation'}], + + /** @override */ extraLibraries: PolymerTest.getLibraries(ROOT_PATH).concat([ '../test_browser_proxy.js', 'control_bar_tests.js',
diff --git a/chrome/test/data/webui/settings/basic_page_browsertest.js b/chrome/test/data/webui/settings/basic_page_browsertest.js index fcf5a38..609c5ca 100644 --- a/chrome/test/data/webui/settings/basic_page_browsertest.js +++ b/chrome/test/data/webui/settings/basic_page_browsertest.js
@@ -21,16 +21,8 @@ ]), }; -// Times out on debug builders because the Settings page can take several -// seconds to load in a Release build and several times that in a Debug build. -// See https://crbug.com/558434. -GEN('#if !defined(NDEBUG)'); -GEN('#define MAYBE_Load DISABLED_Load'); -GEN('#else'); -GEN('#define MAYBE_Load Load'); -GEN('#endif'); - -TEST_F('SettingsBasicPageBrowserTest', 'MAYBE_Load', function() { +// http://crbug/738146 +TEST_F('SettingsBasicPageBrowserTest', 'DISABLED_Load', function() { // Assign |self| to |this| instead of binding since 'this' in suite() // and test() will be a Mocha 'Suite' or 'Test' instance. var self = this;
diff --git a/chrome/test/data/webui/settings/people_page_change_picture_test.js b/chrome/test/data/webui/settings/people_page_change_picture_test.js index a9492a3..627c43ba 100644 --- a/chrome/test/data/webui/settings/people_page_change_picture_test.js +++ b/chrome/test/data/webui/settings/people_page_change_picture_test.js
@@ -82,7 +82,7 @@ suite('ChangePictureTests', function() { var changePicture = null; var browserProxy = null; - var settingsCamera = null; + var crCamera = null; var discardControlBar = null; suiteSetup(function() { @@ -98,8 +98,8 @@ changePicture = document.createElement('settings-change-picture'); document.body.appendChild(changePicture); - settingsCamera = changePicture.$$('settings-camera'); - assertTrue(!!settingsCamera); + crCamera = changePicture.$$('cr-camera'); + assertTrue(!!crCamera); discardControlBar = changePicture.$.discardControlBar; assertTrue(!!discardControlBar); @@ -121,26 +121,26 @@ Polymer.dom.flush(); expectTrue(cameraIcon.hidden); - expectFalse(settingsCamera.cameraActive); + expectFalse(crCamera.cameraActive); cr.webUIListenerCallback('camera-presence-changed', true); Polymer.dom.flush(); expectFalse(cameraIcon.hidden); - expectFalse(settingsCamera.cameraActive); + expectFalse(crCamera.cameraActive); MockInteractions.tap(cameraIcon); Polymer.dom.flush(); expectFalse(cameraIcon.hidden); - expectTrue(settingsCamera.cameraActive); + expectTrue(crCamera.cameraActive); expectEquals(ChangePictureSelectionTypes.CAMERA, changePicture.selectedItem_.dataset.type); expectTrue(discardControlBar.hidden); // Ensure that the camera is deactivated if user navigates away. changePicture.currentRouteChanged(settings.Route.BASIC); - expectFalse(settingsCamera.cameraActive); + expectFalse(crCamera.cameraActive); }); test('ChangePictureProfileImage', function() { @@ -155,7 +155,7 @@ expectEquals(ChangePictureSelectionTypes.PROFILE, changePicture.selectedItem_.dataset.type); - expectFalse(settingsCamera.cameraActive); + expectFalse(crCamera.cameraActive); expectTrue(discardControlBar.hidden); // Ensure that the selection is restored after navigating away and @@ -181,7 +181,7 @@ expectEquals(ChangePictureSelectionTypes.OLD, changePicture.selectedItem_.dataset.type); expectFalse(oldImage.hidden); - expectFalse(settingsCamera.cameraActive); + expectFalse(crCamera.cameraActive); expectFalse(discardControlBar.hidden); }); @@ -199,7 +199,7 @@ expectEquals(ChangePictureSelectionTypes.DEFAULT, changePicture.selectedItem_.dataset.type); expectEquals(firstDefaultImage, changePicture.selectedItem_); - expectFalse(settingsCamera.cameraActive); + expectFalse(crCamera.cameraActive); expectTrue(discardControlBar.hidden); // Now verify that arrow keys actually select the new image.
diff --git a/chrome_elf/BUILD.gn b/chrome_elf/BUILD.gn index 0c77f18..8ae2c85 100644 --- a/chrome_elf/BUILD.gn +++ b/chrome_elf/BUILD.gn
@@ -243,6 +243,7 @@ "/DELAYLOAD:advapi32.dll", "/DELAYLOAD:ole32.dll", "/DELAYLOAD:shell32.dll", + "/DELAYLOAD:shlwapi.dll", "/DELAYLOAD:user32.dll", "/DELAYLOAD:winmm.dll", ]
diff --git a/chromecast/BUILD.gn b/chromecast/BUILD.gn index 08cbad2c..3d10c9cd 100644 --- a/chromecast/BUILD.gn +++ b/chromecast/BUILD.gn
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//base/android/jni_generator/jni_exception_list.gni") import("//build/buildflag_header.gni") import("//build/config/features.gni") import("//build/config/sanitizers/sanitizers.gni") @@ -481,6 +482,11 @@ } if (is_android) { + generate_jni_registration("cast_shell_jni_registration") { + target = ":cast_shell_apk" + output = "$root_gen_dir/chromecast/android/${target_name}.h" + exception_files = jni_exception_files + } android_assets("cast_shell_apk_assets") { assert(v8_use_external_startup_data)
diff --git a/chromecast/android/BUILD.gn b/chromecast/android/BUILD.gn index 1d29974..321a3d2 100644 --- a/chromecast/android/BUILD.gn +++ b/chromecast/android/BUILD.gn
@@ -27,6 +27,7 @@ deps = [ ":platform_jni_loader", "//base", + "//chromecast:cast_shell_jni_registration", "//chromecast:cast_shell_lib", "//chromecast:chromecast_features", "//chromecast/app",
diff --git a/chromecast/android/cast_jni_registrar.cc b/chromecast/android/cast_jni_registrar.cc index 0004e6ab..873048c 100644 --- a/chromecast/android/cast_jni_registrar.cc +++ b/chromecast/android/cast_jni_registrar.cc
@@ -13,6 +13,7 @@ #if BUILDFLAG(IS_CAST_USING_CMA_BACKEND) #include "chromecast/media/cma/backend/android/audio_sink_android_audiotrack_impl.h" +#include "chromecast/media/cma/backend/android/volume_control_android.h" #endif namespace chromecast { @@ -27,6 +28,7 @@ #if BUILDFLAG(IS_CAST_USING_CMA_BACKEND) {"AudioSinkAudioTrackImpl", media::AudioSinkAndroidAudioTrackImpl::RegisterJni}, + {"VolumeControlAndroid", media::VolumeControlAndroid::RegisterJni}, #endif };
diff --git a/chromecast/app/android/cast_jni_loader.cc b/chromecast/app/android/cast_jni_loader.cc index 79a32fe..73b829bb 100644 --- a/chromecast/app/android/cast_jni_loader.cc +++ b/chromecast/app/android/cast_jni_loader.cc
@@ -6,6 +6,7 @@ #include "base/android/library_loader/library_loader_hooks.h" #include "base/bind.h" #include "chromecast/android/cast_jni_registrar.h" +#include "chromecast/android/cast_shell_jni_registration.h" #include "chromecast/android/platform_jni_loader.h" #include "chromecast/app/cast_main_delegate.h" #include "chromecast/browser/android/jni_registrar.h" @@ -42,6 +43,12 @@ JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { base::android::InitVM(vm); JNIEnv* env = base::android::AttachCurrentThread(); + if (!RegisterMainDexNatives(env) || !RegisterNonMainDexNatives(env)) { + return -1; + } + + // TODO(agrieve): Delete this block, this is a no-op now. + // https://crbug.com/683256. if (!content::android::OnJNIOnLoadRegisterJNI(env) || !RegisterJNI(env) || !NativeInit()) { return -1;
diff --git a/chromecast/app/cast_test_launcher.cc b/chromecast/app/cast_test_launcher.cc index f10da6a..47cd697 100644 --- a/chromecast/app/cast_test_launcher.cc +++ b/chromecast/app/cast_test_launcher.cc
@@ -2,8 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/command_line.h" #include "base/macros.h" #include "base/sys_info.h" +#include "base/test/launcher/test_launcher.h" #include "base/test/test_suite.h" #include "chromecast/app/cast_main_delegate.h" #include "content/public/test/test_launcher.h" @@ -41,8 +43,12 @@ } // namespace chromecast int main(int argc, char** argv) { - int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); + base::CommandLine::Init(argc, argv); + size_t parallel_jobs = base::NumParallelJobs(); + if (parallel_jobs > 1U) { + parallel_jobs /= 2U; + } chromecast::shell::CastTestLauncherDelegate launcher_delegate; mojo::edk::Init(); - return content::LaunchTests(&launcher_delegate, default_jobs, argc, argv); + return content::LaunchTests(&launcher_delegate, parallel_jobs, argc, argv); }
diff --git a/chromecast/browser/BUILD.gn b/chromecast/browser/BUILD.gn index ff476ce..a7793ae 100644 --- a/chromecast/browser/BUILD.gn +++ b/chromecast/browser/BUILD.gn
@@ -132,12 +132,16 @@ "cast_content_window_linux.h", "cast_memory_pressure_monitor.cc", "cast_memory_pressure_monitor.h", + "memory_pressure_controller_impl.cc", + "memory_pressure_controller_impl.h", "metrics/external_metrics.cc", "metrics/external_metrics.h", ] deps += [ + "//chromecast/common:interfaces", "//components/metrics:serialization", + "//mojo/public/cpp/bindings", "//third_party/fontconfig", "//ui/aura", ]
diff --git a/chromecast/browser/cast_content_browser_client.cc b/chromecast/browser/cast_content_browser_client.cc index 48b8c1c..e1ca469 100644 --- a/chromecast/browser/cast_content_browser_client.cc +++ b/chromecast/browser/cast_content_browser_client.cc
@@ -73,6 +73,8 @@ #if defined(OS_ANDROID) #include "components/cdm/browser/cdm_message_filter_android.h" #include "components/crash/content/browser/crash_dump_manager_android.h" +#else +#include "chromecast/browser/memory_pressure_controller_impl.h" #endif // defined(OS_ANDROID) #if BUILDFLAG(IS_CAST_USING_CMA_BACKEND) @@ -504,6 +506,17 @@ base::Bind(&media::MediaCapsImpl::AddBinding, base::Unretained(cast_browser_main_parts_->media_caps())), base::ThreadTaskRunnerHandle::Get()); + +#if !defined(OS_ANDROID) + if (!memory_pressure_controller_) { + memory_pressure_controller_.reset(new MemoryPressureControllerImpl()); + } + + registry->AddInterface( + base::Bind(&MemoryPressureControllerImpl::AddBinding, + base::Unretained(memory_pressure_controller_.get())), + base::ThreadTaskRunnerHandle::Get()); +#endif // !defined(OS_ANDROID) } void CastContentBrowserClient::RegisterInProcessServices(
diff --git a/chromecast/browser/cast_content_browser_client.h b/chromecast/browser/cast_content_browser_client.h index e1c0a970..1f9e569 100644 --- a/chromecast/browser/cast_content_browser_client.h +++ b/chromecast/browser/cast_content_browser_client.h
@@ -38,6 +38,7 @@ namespace chromecast { class CastService; class CastWindowManager; +class MemoryPressureControllerImpl; namespace media { class MediaCapsImpl; @@ -200,6 +201,10 @@ // A static cache to hold crash_handlers for each process_type std::map<std::string, breakpad::CrashHandlerHostLinux*> crash_handlers_; + + // Notify renderers of memory pressure (Android renderers register directly + // with OS for this). + std::unique_ptr<MemoryPressureControllerImpl> memory_pressure_controller_; #endif // !defined(OS_ANDROID) // Created by CastContentBrowserClient but owned by BrowserMainLoop.
diff --git a/chromecast/browser/cast_content_browser_manifest_overlay.json b/chromecast/browser/cast_content_browser_manifest_overlay.json index 1d69006c..ab9db16 100644 --- a/chromecast/browser/cast_content_browser_manifest_overlay.json +++ b/chromecast/browser/cast_content_browser_manifest_overlay.json
@@ -5,7 +5,8 @@ "service_manager:connector": { "provides": { "renderer": [ - "chromecast::media::mojom::MediaCaps" + "chromecast::media::mojom::MediaCaps", + "chromecast::mojom::MemoryPressureController" ] } }
diff --git a/chromecast/browser/memory_pressure_controller_impl.cc b/chromecast/browser/memory_pressure_controller_impl.cc new file mode 100644 index 0000000..0179121 --- /dev/null +++ b/chromecast/browser/memory_pressure_controller_impl.cc
@@ -0,0 +1,37 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chromecast/browser/memory_pressure_controller_impl.h" + +#include "base/logging.h" + +namespace chromecast { + +MemoryPressureControllerImpl::MemoryPressureControllerImpl() { + memory_pressure_listener_.reset(new base::MemoryPressureListener( + base::BindRepeating(&MemoryPressureControllerImpl::OnMemoryPressure, + base::Unretained(this)))); +} + +MemoryPressureControllerImpl::~MemoryPressureControllerImpl() = default; + +void MemoryPressureControllerImpl::AddBinding( + const service_manager::BindSourceInfo& source_info, + mojom::MemoryPressureControllerRequest request) { + bindings_.AddBinding(this, std::move(request)); +} + +void MemoryPressureControllerImpl::OnMemoryPressure( + base::MemoryPressureListener::MemoryPressureLevel level) { + observers_.ForAllPtrs([level](mojom::MemoryPressureObserver* observer) { + observer->MemoryPressureLevelChanged(level); + }); +} + +void MemoryPressureControllerImpl::AddObserver( + mojom::MemoryPressureObserverPtr observer) { + observers_.AddPtr(std::move(observer)); +} + +} // namespace chromecast
diff --git a/chromecast/browser/memory_pressure_controller_impl.h b/chromecast/browser/memory_pressure_controller_impl.h new file mode 100644 index 0000000..6b6bf026 --- /dev/null +++ b/chromecast/browser/memory_pressure_controller_impl.h
@@ -0,0 +1,45 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROMECAST_BROWSER_MEMORY_PRESSURE_CONTROLLER_IMPL_H_ +#define CHROMECAST_BROWSER_MEMORY_PRESSURE_CONTROLLER_IMPL_H_ + +#include "base/macros.h" +#include "base/memory/memory_pressure_listener.h" +#include "chromecast/common/memory_pressure.mojom.h" +#include "mojo/public/cpp/bindings/binding_set.h" +#include "mojo/public/cpp/bindings/interface_ptr_set.h" + +namespace service_manager { +struct BindSourceInfo; +} + +namespace chromecast { + +class MemoryPressureControllerImpl : public mojom::MemoryPressureController { + public: + MemoryPressureControllerImpl(); + ~MemoryPressureControllerImpl() override; + + void AddBinding(const service_manager::BindSourceInfo& source_info, + mojom::MemoryPressureControllerRequest request); + + private: + // chromecast::mojom::MemoryPressure implementation. + void AddObserver(mojom::MemoryPressureObserverPtr observer) override; + + void OnMemoryPressure( + base::MemoryPressureListener::MemoryPressureLevel level); + + mojo::InterfacePtrSet<mojom::MemoryPressureObserver> observers_; + mojo::BindingSet<mojom::MemoryPressureController> bindings_; + + std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; + + DISALLOW_COPY_AND_ASSIGN(MemoryPressureControllerImpl); +}; + +} // namespace chromecast + +#endif // CHROMECAST_BROWSER_MEMORY_PRESSURE_CONTROLLER_IMPL_H_
diff --git a/chromecast/common/BUILD.gn b/chromecast/common/BUILD.gn index d1765f1..b79e8505 100644 --- a/chromecast/common/BUILD.gn +++ b/chromecast/common/BUILD.gn
@@ -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("//mojo/public/tools/bindings/mojom.gni") + source_set("common") { sources = [ "cast_content_client.cc", @@ -22,3 +24,11 @@ "//url:url", ] } + +if (!is_android) { + mojom("interfaces") { + sources = [ + "memory_pressure.mojom", + ] + } +}
diff --git a/components/webauth/OWNERS b/chromecast/common/OWNERS similarity index 100% rename from components/webauth/OWNERS rename to chromecast/common/OWNERS
diff --git a/chromecast/common/memory_pressure.mojom b/chromecast/common/memory_pressure.mojom new file mode 100644 index 0000000..3e7facea --- /dev/null +++ b/chromecast/common/memory_pressure.mojom
@@ -0,0 +1,14 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module chromecast.mojom; + +interface MemoryPressureController { + AddObserver(MemoryPressureObserver observer); +}; + +interface MemoryPressureObserver { + // Levels defined in base::MemoryPressureListener::MemoryPressureLevel + MemoryPressureLevelChanged(int32 pressure_level); +};
diff --git a/chromecast/crash/cast_crash_keys.cc b/chromecast/crash/cast_crash_keys.cc index 97a2e43..48dab21 100644 --- a/chromecast/crash/cast_crash_keys.cc +++ b/chromecast/crash/cast_crash_keys.cc
@@ -88,6 +88,9 @@ {"swdh_set_hosted_version_host_pid", ::crash_keys::kSmallSize}, {"swdh_set_hosted_version_is_new_process", ::crash_keys::kSmallSize}, {"swdh_set_hosted_version_restart_count", ::crash_keys::kSmallSize}, + + // Temporary for https://crbug.com/685996. + {"user-cloud-policy-manager-connect-trace", ::crash_keys::kMediumSize}, }; return base::debug::InitCrashKeys(fixed_keys, arraysize(fixed_keys),
diff --git a/chromecast/media/cma/backend/android/BUILD.gn b/chromecast/media/cma/backend/android/BUILD.gn index bd66441f..17e82a72 100644 --- a/chromecast/media/cma/backend/android/BUILD.gn +++ b/chromecast/media/cma/backend/android/BUILD.gn
@@ -39,17 +39,24 @@ generate_jni("audio_track_jni_headers") { sources = [ "java/src/org/chromium/chromecast/cma/backend/android/AudioSinkAudioTrackImpl.java", + "java/src/org/chromium/chromecast/cma/backend/android/VolumeControl.java", ] jni_package = "audio_track" } android_library("audio_track_java") { - java_files = [ "java/src/org/chromium/chromecast/cma/backend/android/AudioSinkAudioTrackImpl.java" ] + java_files = [ + "java/src/org/chromium/chromecast/cma/backend/android/AudioSinkAudioTrackImpl.java", + "java/src/org/chromium/chromecast/cma/backend/android/VolumeControl.java", + ] + + srcjar_deps = [ "//chromecast/public:java_enums_volume_control" ] deps = [ "//base:base_java", "//chromecast/base:base_java", + "//third_party/android_tools:android_support_annotations_java", "//third_party/android_tools:android_support_v13_java", ] }
diff --git a/chromecast/media/cma/backend/android/audio_decoder_android.cc b/chromecast/media/cma/backend/android/audio_decoder_android.cc index a3eacd78..98c2a5a 100644 --- a/chromecast/media/cma/backend/android/audio_decoder_android.cc +++ b/chromecast/media/cma/backend/android/audio_decoder_android.cc
@@ -117,7 +117,7 @@ DCHECK(IsValidConfig(config_)); sink_.Reset(this, config_.samples_per_second, backend_->Primary(), backend_->DeviceId(), backend_->ContentType()); - sink_->SetVolumeMultiplier(volume_multiplier_); + sink_->SetStreamVolumeMultiplier(volume_multiplier_); // Create decoder_ if necessary. This can happen if Stop() was called, and // SetConfig() was not called since then. if (!decoder_) { @@ -264,7 +264,7 @@ // is updated. sink_.Reset(this, config.samples_per_second, backend_->Primary(), backend_->DeviceId(), backend_->ContentType()); - sink_->SetVolumeMultiplier(volume_multiplier_); + sink_->SetStreamVolumeMultiplier(volume_multiplier_); pending_output_frames_ = kNoPendingOutput; } @@ -321,7 +321,7 @@ DCHECK(task_runner_->BelongsToCurrentThread()); volume_multiplier_ = multiplier; if (sink_) - sink_->SetVolumeMultiplier(volume_multiplier_); + sink_->SetStreamVolumeMultiplier(volume_multiplier_); return true; }
diff --git a/chromecast/media/cma/backend/android/audio_sink_android.h b/chromecast/media/cma/backend/android/audio_sink_android.h index cd317fe1..fa1d834 100644 --- a/chromecast/media/cma/backend/android/audio_sink_android.h +++ b/chromecast/media/cma/backend/android/audio_sink_android.h
@@ -70,20 +70,19 @@ // Pauses/unpauses this input. virtual void SetPaused(bool paused) = 0; - // Sets the volume multiplier for this input. If |multiplier| is outside the + // Sets the stream volume multiplier for this input. If |multiplier| is + // outside the range [0.0, 1.0], it is clamped to that range. + // The stream volume is not set by the volume controller but rather by the + // Cast app as an additional volume control on top of Android's. + virtual void SetStreamVolumeMultiplier(float multiplier) = 0; + + // Sets the limiter multiplier for this input. If |multiplier| is outside the // range [0.0, 1.0], it is clamped to that range. - virtual void SetVolumeMultiplier(float multiplier) = 0; + // The limiter is used by the volume controller to achieve ducking. + virtual void SetLimiterVolumeMultiplier(float multiplier) = 0; - // Sets the multiplier based on this stream's content type. The resulting - // output volume should be the content type volume * the per-stream volume - // multiplier. If |fade_ms| is >= 0, the volume change should be faded over - // that many milliseconds; otherwise, the default fade time should be used. - virtual void SetContentTypeVolume(float multiplier, int fade_ms) = 0; - - // Sets whether or not this stream should be muted. - virtual void SetMuted(bool muted) = 0; - - // Returns the volume multiplier of the stream. + // Returns the volume multiplier of the stream, typically the product of + // stream multiplier and limiter multiplier. virtual float EffectiveVolume() const = 0; // Getters
diff --git a/chromecast/media/cma/backend/android/audio_sink_android_audiotrack_impl.cc b/chromecast/media/cma/backend/android/audio_sink_android_audiotrack_impl.cc index f99e400d..83cb01d 100644 --- a/chromecast/media/cma/backend/android/audio_sink_android_audiotrack_impl.cc +++ b/chromecast/media/cma/backend/android/audio_sink_android_audiotrack_impl.cc
@@ -56,9 +56,7 @@ device_id_(device_id), content_type_(content_type), stream_volume_multiplier_(1.0f), - type_volume_multiplier_(1.0f), - mute_volume_multiplier_(1.0f), - fade_ms_(kDefaultSlewTimeMs), + limiter_volume_multiplier_(1.0f), feeder_thread_("AudioTrack feeder thread"), feeder_task_runner_(nullptr), caller_task_runner_(base::ThreadTaskRunnerHandle::Get()), @@ -80,7 +78,8 @@ reinterpret_cast<intptr_t>(this))); Java_AudioSinkAudioTrackImpl_init( base::android::AttachCurrentThread(), j_audio_sink_audiotrack_impl_, - input_samples_per_second_, kDirectBufferSize); + static_cast<int>(content_type_), input_samples_per_second_, + kDirectBufferSize); // Should be set now. DCHECK(direct_pcm_buffer_address_); DCHECK(direct_rendering_delay_address_); @@ -126,6 +125,9 @@ LOG(WARNING) << "j_audio_sink_audiotrack_impl_ is NULL"; return; } + + wait_for_eos_task_.Cancel(); + Java_AudioSinkAudioTrackImpl_close(base::android::AttachCurrentThread(), j_audio_sink_audiotrack_impl_); j_audio_sink_audiotrack_impl_.Reset(); @@ -166,9 +168,8 @@ DCHECK(pending_data_); if (pending_data_->end_of_stream()) { - LOG(INFO) << __func__ << "(" << this << "): EOS!"; state_ = kStateGotEos; - PostPcmCallback(sink_rendering_delay_); + ScheduleWaitForEosTask(); return; } @@ -218,6 +219,29 @@ PostPcmCallback(sink_rendering_delay_); } +void AudioSinkAndroidAudioTrackImpl::ScheduleWaitForEosTask() { + DCHECK(wait_for_eos_task_.IsCancelled()); + DCHECK(state_ == kStateGotEos); + + int64_t playout_time_left_us = + Java_AudioSinkAudioTrackImpl_prepareForShutdown( + base::android::AttachCurrentThread(), j_audio_sink_audiotrack_impl_); + LOG(INFO) << __func__ << "(" << this << "): Hit EOS, playout time left is " + << playout_time_left_us << "us"; + wait_for_eos_task_.Reset(base::Bind( + &AudioSinkAndroidAudioTrackImpl::OnPlayoutDone, base::Unretained(this))); + base::TimeDelta delay = + base::TimeDelta::FromMicroseconds(playout_time_left_us); + feeder_task_runner_->PostDelayedTask(FROM_HERE, wait_for_eos_task_.callback(), + delay); +} + +void AudioSinkAndroidAudioTrackImpl::OnPlayoutDone() { + DCHECK(feeder_task_runner_->BelongsToCurrentThread()); + DCHECK(state_ == kStateGotEos); + PostPcmCallback(sink_rendering_delay_); +} + void AudioSinkAndroidAudioTrackImpl::ReformatData() { // Data is in planar float format, i.e. all left samples first, then all // right -> "LLLLLLLLLLLLLLLLRRRRRRRRRRRRRRRR"). @@ -329,47 +353,30 @@ EffectiveVolume()); } -void AudioSinkAndroidAudioTrackImpl::SetVolumeMultiplier(float multiplier) { - RUN_ON_FEEDER_THREAD(SetVolumeMultiplier, multiplier); +void AudioSinkAndroidAudioTrackImpl::SetStreamVolumeMultiplier( + float multiplier) { + RUN_ON_FEEDER_THREAD(SetStreamVolumeMultiplier, multiplier); stream_volume_multiplier_ = std::max(0.0f, std::min(multiplier, 1.0f)); LOG(INFO) << __func__ << "(" << this << "): device_id_=" << device_id_ - << " stream_multiplier=" << stream_volume_multiplier_ << " (" - << multiplier << ")" + << " stream_multiplier=" << stream_volume_multiplier_ << " effective=" << EffectiveVolume(); UpdateVolume(); } -void AudioSinkAndroidAudioTrackImpl::SetContentTypeVolume(float multiplier, - int fade_ms) { - RUN_ON_FEEDER_THREAD(SetContentTypeVolume, multiplier, fade_ms); +void AudioSinkAndroidAudioTrackImpl::SetLimiterVolumeMultiplier( + float multiplier) { + RUN_ON_FEEDER_THREAD(SetLimiterVolumeMultiplier, multiplier); - type_volume_multiplier_ = std::max(0.0f, std::min(multiplier, 1.0f)); + limiter_volume_multiplier_ = std::max(0.0f, std::min(multiplier, 1.0f)); LOG(INFO) << __func__ << "(" << this << "): device_id_=" << device_id_ - << " type_multiplier=" << type_volume_multiplier_ << " (" - << multiplier << ")" - << " effective=" << EffectiveVolume(); - if (fade_ms < 0) { - fade_ms = kDefaultSlewTimeMs; - } - fade_ms_ = fade_ms; - LOG(INFO) << "Fade over " << fade_ms_ << " ms"; - UpdateVolume(); -} - -void AudioSinkAndroidAudioTrackImpl::SetMuted(bool muted) { - RUN_ON_FEEDER_THREAD(SetMuted, muted); - - mute_volume_multiplier_ = muted ? 0.0f : 1.0f; - LOG(INFO) << __func__ << "(" << this << "): device_id_=" << device_id_ - << " mute_multiplier=" << mute_volume_multiplier_ + << " limiter_multiplier=" << limiter_volume_multiplier_ << " effective=" << EffectiveVolume(); UpdateVolume(); } float AudioSinkAndroidAudioTrackImpl::EffectiveVolume() const { - return stream_volume_multiplier_ * type_volume_multiplier_ * - mute_volume_multiplier_; + return stream_volume_multiplier_ * limiter_volume_multiplier_; } } // namespace media
diff --git a/chromecast/media/cma/backend/android/audio_sink_android_audiotrack_impl.h b/chromecast/media/cma/backend/android/audio_sink_android_audiotrack_impl.h index 4beed48..e969658b 100644 --- a/chromecast/media/cma/backend/android/audio_sink_android_audiotrack_impl.h +++ b/chromecast/media/cma/backend/android/audio_sink_android_audiotrack_impl.h
@@ -11,6 +11,7 @@ #include <string> #include "base/android/jni_android.h" +#include "base/cancelable_callback.h" #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" @@ -53,10 +54,10 @@ // AudioSinkAndroid implementation void WritePcm(scoped_refptr<DecoderBufferBase> data) override; void SetPaused(bool paused) override; - void SetVolumeMultiplier(float multiplier) override; - void SetContentTypeVolume(float volume, int fade_ms) override; - void SetMuted(bool muted) override; + void SetStreamVolumeMultiplier(float multiplier) override; + void SetLimiterVolumeMultiplier(float multiplier) override; float EffectiveVolume() const override; + // Getters int input_samples_per_second() const override; bool primary() const override; @@ -86,6 +87,9 @@ void FeedData(); void FeedDataContinue(); + void ScheduleWaitForEosTask(); + void OnPlayoutDone(); + // Reformats audio data from planar float into interleaved float for // AudioTrack. I.e.: // "LLLLLLLLLLLLLLLLRRRRRRRRRRRRRRRR" -> "LRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLR". @@ -109,11 +113,7 @@ const AudioContentType content_type_; float stream_volume_multiplier_; - float type_volume_multiplier_; - float mute_volume_multiplier_; - // TODO(ckuiper): Use this to configure the fading logic in Android's audio - // subsystem. - int fade_ms_; + float limiter_volume_multiplier_; // Java AudioSinkAudioTrackImpl instance. base::android::ScopedJavaGlobalRef<jobject> j_audio_sink_audiotrack_impl_; @@ -126,6 +126,8 @@ base::Thread feeder_thread_; scoped_refptr<base::SingleThreadTaskRunner> feeder_task_runner_; + base::CancelableClosure wait_for_eos_task_; + const scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; // Buffers shared between native and Java space to move data across the JNI.
diff --git a/chromecast/media/cma/backend/android/audio_sink_manager.cc b/chromecast/media/cma/backend/android/audio_sink_manager.cc index 7d6f8b9..b1461b3 100644 --- a/chromecast/media/cma/backend/android/audio_sink_manager.cc +++ b/chromecast/media/cma/backend/android/audio_sink_manager.cc
@@ -14,10 +14,6 @@ namespace { -const int kUseDefaultFade = -1; -const int kMediaDuckFadeMs = 150; -const int kMediaUnduckFadeMs = 700; - class AudioSinkManagerInstance : public AudioSinkManager { public: AudioSinkManagerInstance() {} @@ -32,8 +28,13 @@ } // namespace -float AudioSinkManager::VolumeInfo::GetEffectiveVolume() { - return std::min(volume, limit); +float AudioSinkManager::VolumeInfo::GetLimiterMultiplier() { + // Goal: multiplier * volume = min(volume, limit). + if (volume == 0) + return 0.0f; + if (volume < limit) + return 1.0f; + return limit / volume; } // static @@ -52,16 +53,7 @@ << " type=" << sink->GetContentTypeName(); base::AutoLock lock(lock_); - - auto type = sink->content_type(); - if (sink->primary()) { - sink->SetContentTypeVolume(volume_info_[type].GetEffectiveVolume(), - kUseDefaultFade); - } else { - sink->SetContentTypeVolume(volume_info_[type].volume, kUseDefaultFade); - } - sink->SetMuted(volume_info_[type].muted); - + UpdateLimiterMultiplier(sink); sinks_.push_back(sink); } @@ -81,62 +73,38 @@ sinks_.erase(it); } -void AudioSinkManager::SetVolume(AudioContentType type, float level) { - LOG(INFO) << __func__ << ": level=" << level - << " type=" << GetAudioContentTypeName(type); - +void AudioSinkManager::SetTypeVolume(AudioContentType type, float level) { + LOG(INFO) << __func__ << ": Set volume for " << GetAudioContentTypeName(type) + << " to level=" << level; base::AutoLock lock(lock_); - volume_info_[type].volume = level; - float effective_volume = volume_info_[type].GetEffectiveVolume(); - for (auto* sink : sinks_) { - if (sink->content_type() != type) { - continue; - } - if (sink->primary()) { - sink->SetContentTypeVolume(effective_volume, kUseDefaultFade); - } else { - // Volume limits don't apply to effects streams. - sink->SetContentTypeVolume(level, kUseDefaultFade); - } - } -} - -void AudioSinkManager::SetMuted(AudioContentType type, bool muted) { - base::AutoLock lock(lock_); - - LOG(INFO) << __func__ << ": muted=" << muted - << " type=" << GetAudioContentTypeName(type); - - volume_info_[type].muted = muted; - for (auto* sink : sinks_) { - if (sink->content_type() == type) { - sink->SetMuted(muted); - } - } + // Since the type volume changed we need to reflect that in the limiter + // multipliers. + UpdateAllLimiterMultipliers(type); } void AudioSinkManager::SetOutputLimit(AudioContentType type, float limit) { LOG(INFO) << __func__ << ": limit=" << limit << " type=" << GetAudioContentTypeName(type); - base::AutoLock lock(lock_); - volume_info_[type].limit = limit; - float effective_volume = volume_info_[type].GetEffectiveVolume(); - int fade_ms = kUseDefaultFade; - if (type == AudioContentType::kMedia) { - if (limit >= 1.0f) { // Unducking. - fade_ms = kMediaUnduckFadeMs; - } else { - fade_ms = kMediaDuckFadeMs; - } - } + UpdateAllLimiterMultipliers(type); +} + +void AudioSinkManager::UpdateAllLimiterMultipliers(AudioContentType type) { for (auto* sink : sinks_) { + if (sink->content_type() == type) + UpdateLimiterMultiplier(sink); + } +} + +void AudioSinkManager::UpdateLimiterMultiplier(AudioSinkAndroid* sink) { + AudioContentType type = sink->content_type(); + if (sink->primary()) { + sink->SetLimiterVolumeMultiplier(volume_info_[type].GetLimiterMultiplier()); + } else { // Volume limits don't apply to effects streams. - if (sink->primary() && sink->content_type() == type) { - sink->SetContentTypeVolume(effective_volume, fade_ms); - } + sink->SetLimiterVolumeMultiplier(1.0f); } }
diff --git a/chromecast/media/cma/backend/android/audio_sink_manager.h b/chromecast/media/cma/backend/android/audio_sink_manager.h index f847a2d..6372f82 100644 --- a/chromecast/media/cma/backend/android/audio_sink_manager.h +++ b/chromecast/media/cma/backend/android/audio_sink_manager.h
@@ -28,13 +28,13 @@ // Removes the given sink instance from the vector. void Remove(AudioSinkAndroid* sink); - // Sets the volume multiplier for the given content |type|. - void SetVolume(AudioContentType type, float level); + // Sets the type volume level for the given content |type|. Note that this + // volume is not actually applied to the sink, as the volume controller + // applies it directly in Android OS. Instead the value is just stored and + // used to calculate the proper limiter multiplier. + void SetTypeVolume(AudioContentType type, float level); - // Sets the mute state for the given content |type|. - void SetMuted(AudioContentType type, bool muted); - - // Sets the volume multiplier limit for the given content |type|. + // Sets the volume limit for the given content |type|. void SetOutputLimit(AudioContentType type, float limit); protected: @@ -44,13 +44,20 @@ private: // Contains volume control information for an audio content type. struct VolumeInfo { - float GetEffectiveVolume(); + // Returns the limiter multiplier such that: + // multiplier * volume = min(volume, limit). + float GetLimiterMultiplier(); float volume = 0.0f; float limit = 1.0f; - bool muted = false; }; + // Updates the limiter multipliers for all sinks of the given type. + void UpdateAllLimiterMultipliers(AudioContentType type); + + // Updates the limiter multiplier for the given sink. + void UpdateLimiterMultiplier(AudioSinkAndroid* sink); + base::Lock lock_; std::map<AudioContentType, VolumeInfo> volume_info_;
diff --git a/chromecast/media/cma/backend/android/java/src/org/chromium/chromecast/cma/backend/android/AudioSinkAudioTrackImpl.java b/chromecast/media/cma/backend/android/java/src/org/chromium/chromecast/cma/backend/android/AudioSinkAudioTrackImpl.java index 4480302..9b69a9c 100644 --- a/chromecast/media/cma/backend/android/java/src/org/chromium/chromecast/cma/backend/android/AudioSinkAudioTrackImpl.java +++ b/chromecast/media/cma/backend/android/java/src/org/chromium/chromecast/cma/backend/android/AudioSinkAudioTrackImpl.java
@@ -11,6 +11,7 @@ import android.media.AudioTrack; import android.os.Build; import android.os.SystemClock; +import android.util.SparseIntArray; import org.chromium.base.Log; import org.chromium.base.annotations.CalledByNative; @@ -46,8 +47,16 @@ private static final String TAG = "AudiotrackImpl"; private static final int DEBUG_LEVEL = 0; - // hardcoded AudioTrack config parameters - private static final int STREAM_TYPE = AudioManager.STREAM_MUSIC; + // Mapping from Android's stream_type to Cast's AudioContentType (used for callback). + private static final SparseIntArray CAST_TYPE_TO_ANDROID_TYPE_MAP = new SparseIntArray(3) { + { + append(AudioContentType.MEDIA, AudioManager.STREAM_MUSIC); + append(AudioContentType.ALARM, AudioManager.STREAM_ALARM); + append(AudioContentType.COMMUNICATION, AudioManager.STREAM_SYSTEM); + } + }; + + // Hardcoded AudioTrack config parameters. private static final int CHANNEL_CONFIG = AudioFormat.CHANNEL_OUT_STEREO; private static final int AUDIO_FORMAT = AudioFormat.ENCODING_PCM_FLOAT; private static final int AUDIO_MODE = AudioTrack.MODE_STREAM; @@ -69,7 +78,7 @@ private AudioTrack mAudioTrack; // Timestamping logic for RenderingDelay calculations. - private AudioTimestamp mLastPlayoutTStamp; + private AudioTimestamp mRefPointTStamp; private long mLastTimestampUpdateNsec; // Last time we updated the timestamp. private boolean mTriggerTimestampUpdateNow; // Set to true to trigger an early update. @@ -109,12 +118,17 @@ mTotalFramesWritten = 0; } + private boolean haveValidRefPoint() { + return mLastTimestampUpdateNsec != NO_TIMESTAMP; + } + /** * Initializes the instance by creating the AudioTrack object and allocating * the shared memory buffers. */ @CalledByNative - private void init(int sampleRateInHz, int bytesPerBuffer) { + private void init( + @AudioContentType int castContentType, int sampleRateInHz, int bytesPerBuffer) { Log.i(TAG, "Init:" + " sampleRateInHz=" + sampleRateInHz @@ -135,11 +149,12 @@ // similar. int bufferSizeInBytes = 5 * AudioTrack.getMinBufferSize(mSampleRateInHz, CHANNEL_CONFIG, AUDIO_FORMAT); - Log.i(TAG, "Init: using an AudioTrack buffer_size=" + bufferSizeInBytes); - - mAudioTrack = new AudioTrack(STREAM_TYPE, mSampleRateInHz, CHANNEL_CONFIG, AUDIO_FORMAT, + int streamType = CAST_TYPE_TO_ANDROID_TYPE_MAP.get(castContentType); + Log.i(TAG, + "Init: create an AudioTrack of size=" + bufferSizeInBytes + " type=" + streamType); + mAudioTrack = new AudioTrack(streamType, mSampleRateInHz, CHANNEL_CONFIG, AUDIO_FORMAT, bufferSizeInBytes, AUDIO_MODE); - mLastPlayoutTStamp = new AudioTimestamp(); + mRefPointTStamp = new AudioTimestamp(); // Allocated shared buffers. mPcmBuffer = ByteBuffer.allocateDirect(bytesPerBuffer); @@ -189,6 +204,32 @@ return mAudioTrack.getPlayState() == AudioTrack.PLAYSTATE_PAUSED; } + /** Stops the AudioTrack and returns an estimate of the time it takes for the remaining data + * left in the internal queue to be played out (in usecs). */ + @CalledByNative + private long prepareForShutdown() { + long playtimeLeftNsecs; + + // Stop the AudioTrack. This will put it into STOPPED mode and audio will stop playing after + // the last buffer that was written has been played. + mAudioTrack.stop(); + + // Estimate how much playing time is left based on the most recent reference point. + updateRefPointTimestamp(); + long lastPlayoutTimeNsecs = + getInterpolatedTStampNsecs(mRefPointTStamp, mTotalFramesWritten); + if (lastPlayoutTimeNsecs != NO_TIMESTAMP) { + long now = System.nanoTime(); + playtimeLeftNsecs = lastPlayoutTimeNsecs - now; + } else { + // We have no timestamp to estimate how much is left to play, so assume the worst case. + long most_frames_left = + Math.min(mTotalFramesWritten, mAudioTrack.getBufferSizeInFrames()); + playtimeLeftNsecs = SEC_IN_NSEC * most_frames_left / mSampleRateInHz; + } + return playtimeLeftNsecs / 1000; // return usecs + } + @CalledByNative /** Closes the instance by stopping playback and releasing the AudioTrack * object. */ @@ -198,7 +239,7 @@ Log.w(TAG, "Close: not initialized."); return; } - mAudioTrack.stop(); + if (!isStopped()) mAudioTrack.stop(); mAudioTrack.release(); mIsInitialized = false; } @@ -322,8 +363,9 @@ } private void updateRenderingDelay() { - updateTimestamp(); - if (mLastTimestampUpdateNsec == NO_TIMESTAMP) { + checkForUnderruns(); + updateRefPointTimestamp(); + if (!haveValidRefPoint()) { // No timestamp available yet, just put dummy values and return. mRenderingDelayBuffer.putLong(0, 0); mRenderingDelayBuffer.putLong(8, NO_TIMESTAMP); @@ -331,50 +373,67 @@ } // Interpolate to get proper Rendering delay. - long delta_frames = mTotalFramesWritten - mLastPlayoutTStamp.framePosition; - long delta_nsecs = 1000000000 * delta_frames / mSampleRateInHz; - long playout_time_nsecs = mLastPlayoutTStamp.nanoTime + delta_nsecs; - long now_nsecs = System.nanoTime(); - long delay_nsecs = playout_time_nsecs - now_nsecs; + long playoutTimeNsecs = getInterpolatedTStampNsecs(mRefPointTStamp, mTotalFramesWritten); + long nowNsecs = System.nanoTime(); + long delayNsecs = playoutTimeNsecs - nowNsecs; // Populate RenderingDelay return value for native land. - mRenderingDelayBuffer.putLong(0, delay_nsecs / 1000); - mRenderingDelayBuffer.putLong(8, now_nsecs / 1000); + mRenderingDelayBuffer.putLong(0, delayNsecs / 1000); + mRenderingDelayBuffer.putLong(8, nowNsecs / 1000); if (DEBUG_LEVEL >= 3) { Log.i(TAG, "RenderingDelay: " - + " df=" + delta_frames + " dt=" + (delta_nsecs / 1000) - + " delay=" + (delay_nsecs / 1000) + " play=" + (now_nsecs / 1000)); + + " delay=" + (delayNsecs / 1000) + " play=" + (nowNsecs / 1000)); } } - /** Gets a new timestamp from AudioTrack. For performance reasons we only - * read a new timestamp in certain intervals. */ - private void updateTimestamp() { + /** Returns an interpolated timestamp based on the reference point timestamp and given frame + * position. If no valid reference point exists, returns NO_TIMESTAMP. */ + private long getInterpolatedTStampNsecs(AudioTimestamp referencePoint, long framePosition) { + if (!haveValidRefPoint()) { + return NO_TIMESTAMP; + } + long deltaFrames = framePosition - referencePoint.framePosition; + long deltaNsecs = 1000000000L * deltaFrames / mSampleRateInHz; + long interpolatedTimestampNsecs = referencePoint.nanoTime + deltaNsecs; + return interpolatedTimestampNsecs; + } + + /** Checks for underruns and if detected invalidates the reference point timestamp. */ + private void checkForUnderruns() { int underruns = getUnderrunCount(); if (underruns != mLastUnderrunCount) { logUnderruns(underruns); + // Invalidate timestamp (resets RenderingDelay). mLastTimestampUpdateNsec = NO_TIMESTAMP; mLastUnderrunCount = underruns; } - if (!mTriggerTimestampUpdateNow && mLastTimestampUpdateNsec != NO_TIMESTAMP + } + + /** Gets a new reference point timestamp from AudioTrack. For performance reasons we only + * read a new timestamp in certain intervals. */ + private void updateRefPointTimestamp() { + if (!mTriggerTimestampUpdateNow && haveValidRefPoint() && elapsedNsec(mLastTimestampUpdateNsec) <= TIMESTAMP_UPDATE_PERIOD) { // not time for an update yet return; } - if (mAudioTrack.getTimestamp(mLastPlayoutTStamp)) { - // Got a new value. - if (DEBUG_LEVEL >= 1) { - Log.i(TAG, - "New AudioTrack timestamp:" - + " pos=" + mLastPlayoutTStamp.framePosition - + " ts=" + mLastPlayoutTStamp.nanoTime / 1000 + "us"); - } - mLastTimestampUpdateNsec = System.nanoTime(); - mTriggerTimestampUpdateNow = false; + if (!mAudioTrack.getTimestamp(mRefPointTStamp)) { + return; // no timestamp available } + + // Got a new value. + if (DEBUG_LEVEL >= 1) { + Log.i(TAG, + "New AudioTrack timestamp:" + + " pos=" + mRefPointTStamp.framePosition + + " ts=" + mRefPointTStamp.nanoTime / 1000 + "us"); + } + + mLastTimestampUpdateNsec = System.nanoTime(); + mTriggerTimestampUpdateNow = false; } /** Logs underruns in a throttled manner. */
diff --git a/chromecast/media/cma/backend/android/java/src/org/chromium/chromecast/cma/backend/android/VolumeControl.java b/chromecast/media/cma/backend/android/java/src/org/chromium/chromecast/cma/backend/android/VolumeControl.java new file mode 100644 index 0000000..d8df7e76 --- /dev/null +++ b/chromecast/media/cma/backend/android/java/src/org/chromium/chromecast/cma/backend/android/VolumeControl.java
@@ -0,0 +1,260 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chromecast.cma.backend.android; + +import android.annotation.TargetApi; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.media.AudioManager; +import android.os.Build; +import android.util.SparseArray; +import android.util.SparseIntArray; + +import org.chromium.base.ContextUtils; +import org.chromium.base.Log; +import org.chromium.base.annotations.CalledByNative; +import org.chromium.base.annotations.JNINamespace; + +/** + * Implements the java-side of the volume control logic running on Android when using CMA backend by + * setting the volume levels and mute states directly in the OS using AudioManager. The following + * mapping is used between Cast's native AudioContentType and Android's internal stream types: + * + * AudioContentType::kMedia -> AudioManager.STREAM_MUSIC + * AudioContentType::kAlarm -> AudioManager.STREAM_ALARM + * AudioContentType::kCommunication -> AudioManager.STREAM_SYSTEM + * + * In addition it listens to volume and mute state changes broadcasted by the system via (hidden) + * intents and reports detected changes back to the native volume controller code. + */ +@JNINamespace("chromecast::media") +@TargetApi(Build.VERSION_CODES.M) +class VolumeControl { + /** + * Helper class storing settings and reading/writing volume and mute settings from/to Android's + * AudioManager. + */ + private class Settings { + Settings(int streamType) { + mStreamType = streamType; + mMaxVolumeIndexAsFloat = (float) mAudioManager.getStreamMaxVolume(mStreamType); + refreshVolume(); + refreshMuteState(); + } + + /** Returns the current volume level in the range [0.0f .. 1.0f]. */ + float getVolumeLevel() { + return mVolumeIndexAsFloat / mMaxVolumeIndexAsFloat; + } + + /** Sets the given volume level in AudioManager. The given level is in the range + * [0.0f .. 1.0f] and converted to a volume index in the range [0 .. mMaxVolumeIndex] before + * writing to AudioManager. */ + void setVolumeLevel(float level) { + int volumeIndex = Math.round(level * mMaxVolumeIndexAsFloat); + mVolumeIndexAsFloat = (float) volumeIndex; + if (DEBUG_LEVEL >= 1) { + Log.i(TAG, + "setVolumeLevel: index=" + mVolumeIndexAsFloat + + " level=" + getVolumeLevel() + " (from:" + level + ")"); + } + mAudioManager.setStreamVolume(mStreamType, volumeIndex, 0); + } + + /** Refreshes the stored volume level by reading it from AudioManager. + * Returns true if the value changed, false otherwise. */ + boolean refreshVolume() { + float oldVolume = mVolumeIndexAsFloat; + mVolumeIndexAsFloat = (float) mAudioManager.getStreamVolume(mStreamType); + if (DEBUG_LEVEL >= 2) { + Log.i(TAG, "refresh: index=" + mVolumeIndexAsFloat + " level=" + getVolumeLevel()); + } + return oldVolume != mVolumeIndexAsFloat; + } + + /** Returns the current mute state. */ + boolean isMuted() { + return mIsMuted; + } + + /** Sets the given mute state in AudioManager. */ + void setMuted(boolean muted) { + if (DEBUG_LEVEL >= 1) Log.i(TAG, "setMuted: muted=" + muted); + int direction = muted ? AudioManager.ADJUST_MUTE : AudioManager.ADJUST_UNMUTE; + int flag = 0; + mAudioManager.adjustStreamVolume(mStreamType, direction, flag); + } + + /** Refreshes the stored mute state by reading it from AudioManager. + * Returns true if the state changed, false otherwise. */ + boolean refreshMuteState() { + boolean oldMuteState = mIsMuted; + mIsMuted = mAudioManager.isStreamMute(mStreamType); + if (DEBUG_LEVEL >= 2) Log.i(TAG, "refresh: muted=" + mIsMuted); + return oldMuteState != mIsMuted; + } + + private final int mStreamType; + + // Cached maximum volume index. Stored as float for easier calculations. + private final float mMaxVolumeIndexAsFloat; + + // Current volume index. Stored as float for easier calculations. + float mVolumeIndexAsFloat; + + boolean mIsMuted; + } + + private static final String TAG = "VolumeControlAndroid"; + private static final int DEBUG_LEVEL = 0; + + // Hidden intent actions of AudioManager. + private static final String VOLUME_CHANGED_ACTION = "android.media.VOLUME_CHANGED_ACTION"; + private static final String STREAM_MUTE_CHANGED_ACTION = + "android.media.STREAM_MUTE_CHANGED_ACTION"; + private static final String EXTRA_VOLUME_STREAM_TYPE = "android.media.EXTRA_VOLUME_STREAM_TYPE"; + + // Mapping from Android's stream_type to Cast's AudioContentType (used for callback). + private static final SparseIntArray ANDROID_TYPE_TO_CAST_TYPE_MAP = new SparseIntArray(3) { + { + append(AudioManager.STREAM_MUSIC, AudioContentType.MEDIA); + append(AudioManager.STREAM_ALARM, AudioContentType.ALARM); + append(AudioManager.STREAM_SYSTEM, AudioContentType.COMMUNICATION); + } + }; + + private final long mNativeVolumeControl; + + private Context mContext; + + private AudioManager mAudioManager; + + private BroadcastReceiver mMediaEventIntentListener; + + // Mapping from Cast's AudioContentType to their respective Settings instance. + private SparseArray<Settings> mSettings; + + /** Construction */ + @CalledByNative + static VolumeControl createVolumeControl(long nativeVolumeControl) { + Log.i(TAG, "Creating new VolumeControl instance"); + return new VolumeControl(nativeVolumeControl); + } + + /** + * Creates a new instance. The given cast type ids are used to create the + * settings array, mapping Cast's AudioContentType::{kMedia, kAlarm, + * kCommunication} to Android's AudioManager.STREAM_{MUSIC,ALARM,SYSTEM} settings. + */ + private VolumeControl(long nativeVolumeControl) { + mNativeVolumeControl = nativeVolumeControl; + + mContext = ContextUtils.getApplicationContext(); + mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); + + // Populate settings. + mSettings = new SparseArray<Settings>(3); + mSettings.append(AudioContentType.MEDIA, new Settings(AudioManager.STREAM_MUSIC)); + mSettings.append(AudioContentType.ALARM, new Settings(AudioManager.STREAM_ALARM)); + mSettings.append(AudioContentType.COMMUNICATION, new Settings(AudioManager.STREAM_SYSTEM)); + + registerIntentListeners(); + } + + /** Registers the intent listeners for volume and mute changes. */ + private void registerIntentListeners() { + mMediaEventIntentListener = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + String action = intent.getAction(); + int type = intent.getIntExtra(EXTRA_VOLUME_STREAM_TYPE, -1); + if (type != AudioManager.STREAM_MUSIC && type != AudioManager.STREAM_ALARM + && type != AudioManager.STREAM_SYSTEM) { + return; + } + if (DEBUG_LEVEL >= 1) Log.i(TAG, "Got intent:" + action + " for type:" + type); + if (action.equals(VOLUME_CHANGED_ACTION)) { + handleVolumeChange(type); + } + if (action.equals(STREAM_MUTE_CHANGED_ACTION)) { + handleMuteChange(type); + } + } + }; + IntentFilter mediaEventIntentFilter = new IntentFilter(); + mediaEventIntentFilter.addAction(VOLUME_CHANGED_ACTION); + mediaEventIntentFilter.addAction(STREAM_MUTE_CHANGED_ACTION); + mContext.registerReceiver(mMediaEventIntentListener, mediaEventIntentFilter); + } + + /** + * Handles received volume change events by checking the value for the provided type and + * triggering the native callback function if changes are detected. + */ + private void handleVolumeChange(int androidType) { + int castType = ANDROID_TYPE_TO_CAST_TYPE_MAP.get(androidType); + Settings s = mSettings.get(castType); + if (s.refreshVolume()) { + if (DEBUG_LEVEL >= 1) { + Log.i(TAG, "New volume for castType " + castType + " is " + s.getVolumeLevel()); + } + nativeOnVolumeChange(mNativeVolumeControl, castType, s.getVolumeLevel()); + } + } + + /** + * Handles mute state change events by checking the state for the provided type and triggering + * the native callback function if changes are detected. + */ + private void handleMuteChange(int androidType) { + int castType = ANDROID_TYPE_TO_CAST_TYPE_MAP.get(androidType); + Settings s = mSettings.get(castType); + if (s.refreshMuteState()) { + if (DEBUG_LEVEL >= 1) { + Log.i(TAG, "New mute state for castType " + castType + " is " + s.isMuted()); + } + nativeOnMuteChange(mNativeVolumeControl, castType, s.isMuted()); + } + } + + /** Returns the volume for the given cast type as a float in the range [0.0f .. 1.0f]. */ + @CalledByNative + float getVolume(int castType) { + Settings s = mSettings.get(castType); + s.refreshVolume(); + return s.getVolumeLevel(); + } + + /** Sets the given volume (range [0 .. 1.0]) for the given cast type. */ + @CalledByNative + void setVolume(int castType, float level) { + level = Math.min(1.0f, Math.max(0.0f, level)); + mSettings.get(castType).setVolumeLevel(level); + } + + /** Returns the mute state (true/false) for the given cast type. */ + @CalledByNative + boolean isMuted(int castType) { + Settings s = mSettings.get(castType); + s.refreshMuteState(); + return s.isMuted(); + } + + /** Sets the mute state for streams of the given cast type. */ + @CalledByNative + void setMuted(int castType, boolean muted) { + mSettings.get(castType).setMuted(muted); + } + + // + // JNI functions in native land. + // + private native void nativeOnVolumeChange( + long nativeVolumeControlAndroid, int type, float level); + private native void nativeOnMuteChange( + long nativeVolumeControlAndroid, int type, boolean muted); +}
diff --git a/chromecast/media/cma/backend/android/volume_control_android.cc b/chromecast/media/cma/backend/android/volume_control_android.cc index 7343a7a..c34797d8 100644 --- a/chromecast/media/cma/backend/android/volume_control_android.cc +++ b/chromecast/media/cma/backend/android/volume_control_android.cc
@@ -14,66 +14,29 @@ #include "base/bind.h" #include "base/bind_helpers.h" -#include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/lazy_instance.h" #include "base/location.h" #include "base/logging.h" -#include "base/macros.h" #include "base/memory/ptr_util.h" -#include "base/synchronization/lock.h" -#include "base/synchronization/waitable_event.h" -#include "base/threading/thread.h" -#include "base/values.h" #include "chromecast/base/init_command_line_shlib.h" #include "chromecast/base/serializers.h" -#include "chromecast/media/cma/backend/android/audio_sink_manager.h" +#include "jni/VolumeControl_jni.h" namespace chromecast { namespace media { namespace { -// TODO(ckuiper): figure out where this should be in Android. -const char kCastAudioConfigFilePath[] = "/etc/cast_audio.json"; - -constexpr float kDefaultMediaDbFS = -25.0f; -constexpr float kDefaultAlarmDbFS = -20.0f; -constexpr float kDefaultCommunicationDbFS = -25.0f; - constexpr float kMinDbFS = -120.0f; -constexpr char kKeyMediaDbFS[] = "dbfs.media"; -constexpr char kKeyAlarmDbFS[] = "dbfs.alarm"; -constexpr char kKeyCommunicationDbFS[] = "dbfs.communication"; -constexpr char kKeyVolumeMap[] = "volume_map"; -constexpr char kKeyLevel[] = "level"; -constexpr char kKeyDb[] = "db"; - +// TODO(ckuiper): Update this to reflect Android's default volume table. const VolumeMap::LevelToDb kDefaultVolumeMap[] = {{0.0f, kMinDbFS}, {0.01f, -58.0f}, {0.090909f, -48.0f}, {0.818182f, -8.0f}, {1.0f, 0.0f}}; -float DbFsToScale(float db) { - if (db <= kMinDbFS) { - return 0.0f; - } - return std::pow(10, db / 20); -} - -std::string ContentTypeToDbFSKey(AudioContentType type) { - switch (type) { - case AudioContentType::kAlarm: - return kKeyAlarmDbFS; - case AudioContentType::kCommunication: - return kKeyCommunicationDbFS; - default: - return kKeyMediaDbFS; - } -} - base::LazyInstance<VolumeMap>::Leaky g_volume_map = LAZY_INSTANCE_INITIALIZER; base::LazyInstance<VolumeControlAndroid>::Leaky g_volume_control = @@ -82,59 +45,9 @@ } // namespace VolumeMap::VolumeMap() { - auto cast_audio_config = - DeserializeJsonFromFile(base::FilePath(kCastAudioConfigFilePath)); - const base::DictionaryValue* cast_audio_dict; - if (!cast_audio_config || - !cast_audio_config->GetAsDictionary(&cast_audio_dict)) { - LOG(WARNING) << "No cast audio config found; using default volume map."; - volume_map_.insert(volume_map_.end(), kDefaultVolumeMap, - kDefaultVolumeMap + arraysize(kDefaultVolumeMap)); - return; - } - - const base::ListValue* volume_map_list; - if (!cast_audio_dict->GetList(kKeyVolumeMap, &volume_map_list)) { - LOG(WARNING) << "No volume map found; using default volume map."; - volume_map_.insert(volume_map_.end(), kDefaultVolumeMap, - kDefaultVolumeMap + arraysize(kDefaultVolumeMap)); - return; - } - - double prev_level = -1.0; - for (size_t i = 0; i < volume_map_list->GetSize(); ++i) { - const base::DictionaryValue* volume_map_entry; - CHECK(volume_map_list->GetDictionary(i, &volume_map_entry)); - - double level; - CHECK(volume_map_entry->GetDouble(kKeyLevel, &level)); - CHECK_GE(level, 0.0); - CHECK_LE(level, 1.0); - CHECK_GT(level, prev_level); - prev_level = level; - - double db; - CHECK(volume_map_entry->GetDouble(kKeyDb, &db)); - CHECK_LE(db, 0.0); - if (level == 1.0) { - CHECK_EQ(db, 0.0); - } - - volume_map_.push_back({level, db}); - } - - if (volume_map_.empty()) { - LOG(FATAL) << "No entries in volume map."; - return; - } - - if (volume_map_[0].level > 0.0) { - volume_map_.insert(volume_map_.begin(), {0.0, kMinDbFS}); - } - - if (volume_map_.rbegin()->level < 1.0) { - volume_map_.push_back({1.0, 0.0}); - } + // TODO(ckuiper): Load active volume table from Android. + volume_map_.insert(volume_map_.end(), kDefaultVolumeMap, + kDefaultVolumeMap + arraysize(kDefaultVolumeMap)); } VolumeMap::~VolumeMap() {} @@ -176,40 +89,30 @@ initialize_complete_event_( base::WaitableEvent::ResetPolicy::MANUAL, base::WaitableEvent::InitialState::NOT_SIGNALED) { + DCHECK(j_volume_control_.is_null()); + j_volume_control_.Reset(Java_VolumeControl_createVolumeControl( + base::android::AttachCurrentThread(), reinterpret_cast<intptr_t>(this))); + // Load volume map to check that the config file is correct. g_volume_map.Get(); - stored_values_.SetDouble(kKeyMediaDbFS, kDefaultMediaDbFS); - stored_values_.SetDouble(kKeyAlarmDbFS, kDefaultAlarmDbFS); - stored_values_.SetDouble(kKeyCommunicationDbFS, kDefaultCommunicationDbFS); - - auto types = {AudioContentType::kMedia, AudioContentType::kAlarm, - AudioContentType::kCommunication}; - double volume; - - storage_path_ = base::GetHomeDir().Append("saved_volumes"); - auto old_stored_data = DeserializeJsonFromFile(storage_path_); - base::DictionaryValue* old_stored_dict; - if (old_stored_data && old_stored_data->GetAsDictionary(&old_stored_dict)) { - for (auto type : types) { - if (old_stored_dict->GetDouble(ContentTypeToDbFSKey(type), &volume)) { - stored_values_.SetDouble(ContentTypeToDbFSKey(type), volume); - } - } - } - base::Thread::Options options; options.message_loop_type = base::MessageLoop::TYPE_IO; thread_.StartWithOptions(options); thread_.task_runner()->PostTask( - FROM_HERE, base::Bind(&VolumeControlAndroid::InitializeOnThread, - base::Unretained(this))); + FROM_HERE, base::BindOnce(&VolumeControlAndroid::InitializeOnThread, + base::Unretained(this))); initialize_complete_event_.Wait(); } VolumeControlAndroid::~VolumeControlAndroid() {} +// static +bool VolumeControlAndroid::RegisterJni(JNIEnv* env) { + return RegisterNativesImpl(env); +} + void VolumeControlAndroid::AddVolumeObserver(VolumeObserver* observer) { base::AutoLock lock(observer_lock_); volume_observers_.push_back(observer); @@ -230,8 +133,8 @@ void VolumeControlAndroid::SetVolume(AudioContentType type, float level) { level = std::max(0.0f, std::min(level, 1.0f)); thread_.task_runner()->PostTask( - FROM_HERE, base::Bind(&VolumeControlAndroid::SetVolumeOnThread, - base::Unretained(this), type, level)); + FROM_HERE, base::BindOnce(&VolumeControlAndroid::SetVolumeOnThread, + base::Unretained(this), type, level)); } bool VolumeControlAndroid::IsMuted(AudioContentType type) { @@ -241,28 +144,52 @@ void VolumeControlAndroid::SetMuted(AudioContentType type, bool muted) { thread_.task_runner()->PostTask( - FROM_HERE, base::Bind(&VolumeControlAndroid::SetMutedOnThread, - base::Unretained(this), type, muted)); + FROM_HERE, base::BindOnce(&VolumeControlAndroid::SetMutedOnThread, + base::Unretained(this), type, muted)); } void VolumeControlAndroid::SetOutputLimit(AudioContentType type, float limit) { limit = std::max(0.0f, std::min(limit, 1.0f)); - AudioSinkManager::Get()->SetOutputLimit( - type, DbFsToScale(VolumeControl::VolumeToDbFS(limit))); + AudioSinkManager::Get()->SetOutputLimit(type, limit); +} + +void VolumeControlAndroid::OnVolumeChange( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj, + jint type, + jfloat level) { + thread_.task_runner()->PostTask( + FROM_HERE, + base::BindOnce(&VolumeControlAndroid::ReportVolumeChangeOnThread, + base::Unretained(this), (AudioContentType)type, level)); +} + +void VolumeControlAndroid::OnMuteChange( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj, + jint type, + jboolean muted) { + thread_.task_runner()->PostTask( + FROM_HERE, + base::BindOnce(&VolumeControlAndroid::ReportMuteChangeOnThread, + base::Unretained(this), (AudioContentType)type, muted)); } void VolumeControlAndroid::InitializeOnThread() { DCHECK(thread_.task_runner()->BelongsToCurrentThread()); - double dbfs; for (auto type : {AudioContentType::kMedia, AudioContentType::kAlarm, AudioContentType::kCommunication}) { - CHECK(stored_values_.GetDouble(ContentTypeToDbFSKey(type), &dbfs)); - volumes_[type] = VolumeControl::DbFSToVolume(dbfs); - AudioSinkManager::Get()->SetVolume(type, DbFsToScale(dbfs)); - - // Note that mute state is not persisted across reboots. - muted_[type] = false; + volumes_[type] = + Java_VolumeControl_getVolume(base::android::AttachCurrentThread(), + j_volume_control_, static_cast<int>(type)); + AudioSinkManager::Get()->SetTypeVolume(type, volumes_[type]); + muted_[type] = + Java_VolumeControl_isMuted(base::android::AttachCurrentThread(), + j_volume_control_, static_cast<int>(type)); + LOG(INFO) << __func__ << ": Initial values for" + << " type=" << static_cast<int>(type) << ": " + << " volume=" << volumes_[type] << " mute=" << muted_[type]; } initialize_complete_event_.Signal(); } @@ -278,19 +205,15 @@ volumes_[type] = level; } - float dbfs = VolumeControl::VolumeToDbFS(level); - LOG(INFO) << __func__ << ": level=" << level << " -> dbfs=" << dbfs; - AudioSinkManager::Get()->SetVolume(type, DbFsToScale(dbfs)); - - { - base::AutoLock lock(observer_lock_); - for (VolumeObserver* observer : volume_observers_) { - observer->OnVolumeChange(type, level); - } - } - - stored_values_.SetDouble(ContentTypeToDbFSKey(type), dbfs); - SerializeJsonToFile(storage_path_, stored_values_); + LOG(INFO) << __func__ << ": level=" << level; + // Provide the type volume to the sink manager so it can properly calculate + // the limiter multiplier. The volume is *not* applied by the sink though. + AudioSinkManager::Get()->SetTypeVolume(type, level); + // Set proper volume in Android OS. + Java_VolumeControl_setVolume(base::android::AttachCurrentThread(), + j_volume_control_, static_cast<int>(type), + level); + ReportVolumeChangeOnThread(type, level); } void VolumeControlAndroid::SetMutedOnThread(AudioContentType type, bool muted) { @@ -303,13 +226,27 @@ muted_[type] = muted; } - AudioSinkManager::Get()->SetMuted(type, muted); + Java_VolumeControl_setMuted(base::android::AttachCurrentThread(), + j_volume_control_, static_cast<int>(type), muted); - { - base::AutoLock lock(observer_lock_); - for (VolumeObserver* observer : volume_observers_) { - observer->OnMuteChange(type, muted); - } + ReportMuteChangeOnThread(type, muted); +} + +void VolumeControlAndroid::ReportVolumeChangeOnThread(AudioContentType type, + float level) { + DCHECK(thread_.task_runner()->BelongsToCurrentThread()); + base::AutoLock lock(observer_lock_); + for (VolumeObserver* observer : volume_observers_) { + observer->OnVolumeChange(type, level); + } +} + +void VolumeControlAndroid::ReportMuteChangeOnThread(AudioContentType type, + bool muted) { + DCHECK(thread_.task_runner()->BelongsToCurrentThread()); + base::AutoLock lock(observer_lock_); + for (VolumeObserver* observer : volume_observers_) { + observer->OnMuteChange(type, muted); } }
diff --git a/chromecast/media/cma/backend/android/volume_control_android.h b/chromecast/media/cma/backend/android/volume_control_android.h index 1c564a59..88ba5d44 100644 --- a/chromecast/media/cma/backend/android/volume_control_android.h +++ b/chromecast/media/cma/backend/android/volume_control_android.h
@@ -8,8 +8,10 @@ #include <map> #include <vector> +#include "base/android/jni_android.h" #include "base/files/file_path.h" #include "base/macros.h" +#include "base/synchronization/lock.h" #include "base/synchronization/waitable_event.h" #include "base/threading/thread.h" #include "base/values.h" @@ -46,6 +48,8 @@ VolumeControlAndroid(); ~VolumeControlAndroid(); + static bool RegisterJni(JNIEnv* env); + void AddVolumeObserver(VolumeObserver* observer); void RemoveVolumeObserver(VolumeObserver* observer); float GetVolume(AudioContentType type); @@ -54,10 +58,25 @@ void SetMuted(AudioContentType type, bool muted); void SetOutputLimit(AudioContentType type, float limit); + // Called from java to signal a change volume. + void OnVolumeChange(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj, + jint type, + jfloat level); + + void OnMuteChange(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj, + jint type, + jboolean muted); + private: void InitializeOnThread(); void SetVolumeOnThread(AudioContentType type, float level); void SetMutedOnThread(AudioContentType type, bool muted); + void ReportVolumeChangeOnThread(AudioContentType type, float level); + void ReportMuteChangeOnThread(AudioContentType type, bool muted); + + base::android::ScopedJavaGlobalRef<jobject> j_volume_control_; base::FilePath storage_path_; base::DictionaryValue stored_values_;
diff --git a/chromecast/net/connectivity_checker_impl.cc b/chromecast/net/connectivity_checker_impl.cc index 17e7c5b0..efd71c6 100644 --- a/chromecast/net/connectivity_checker_impl.cc +++ b/chromecast/net/connectivity_checker_impl.cc
@@ -69,9 +69,9 @@ network_changed_pending_(false) { DCHECK(task_runner_.get()); - task_runner->PostTask(FROM_HERE, - base::Bind(&ConnectivityCheckerImpl::Initialize, this, - url_request_context_getter)); + task_runner->PostTask( + FROM_HERE, base::Bind(&ConnectivityCheckerImpl::Initialize, this, + base::RetainedRef(url_request_context_getter))); } void ConnectivityCheckerImpl::Initialize(
diff --git a/chromecast/public/BUILD.gn b/chromecast/public/BUILD.gn index 7f11577..4d875f2c 100644 --- a/chromecast/public/BUILD.gn +++ b/chromecast/public/BUILD.gn
@@ -37,4 +37,10 @@ "avsettings.h", ] } + + java_cpp_enum("java_enums_volume_control") { + sources = [ + "volume_control.h", + ] + } }
diff --git a/chromecast/public/volume_control.h b/chromecast/public/volume_control.h index 56e1432..e34044c6 100644 --- a/chromecast/public/volume_control.h +++ b/chromecast/public/volume_control.h
@@ -15,6 +15,7 @@ // Audio content types for volume control. Each content type has a separate // volume and mute state. +// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chromecast.cma.backend.android enum class AudioContentType { kMedia, // Normal audio playback; also used for system sound effects. kAlarm, // Alarm sounds.
diff --git a/chromecast/renderer/BUILD.gn b/chromecast/renderer/BUILD.gn index ea4bd19f..fb37fe6 100644 --- a/chromecast/renderer/BUILD.gn +++ b/chromecast/renderer/BUILD.gn
@@ -38,4 +38,16 @@ "//media", "//services/service_manager/public/cpp", ] + + if (!is_android) { + sources += [ + "memory_pressure_observer_impl.cc", + "memory_pressure_observer_impl.h", + ] + + deps += [ + "//chromecast/common:interfaces", + "//mojo/public/cpp/bindings", + ] + } }
diff --git a/chromecast/renderer/DEPS b/chromecast/renderer/DEPS index fbc990d..f6c55143 100644 --- a/chromecast/renderer/DEPS +++ b/chromecast/renderer/DEPS
@@ -9,6 +9,7 @@ "+media/base", "+media/media_features.h", "+media/renderers", + "+mojo/public", "+services/service_manager/public", "+third_party/WebKit/public/platform", "+third_party/WebKit/public/web",
diff --git a/chromecast/renderer/cast_content_renderer_client.cc b/chromecast/renderer/cast_content_renderer_client.cc index 78f20a0d..bf0002b 100644 --- a/chromecast/renderer/cast_content_renderer_client.cc +++ b/chromecast/renderer/cast_content_renderer_client.cc
@@ -35,6 +35,8 @@ #if defined(OS_ANDROID) #include "media/base/android/media_codec_util.h" +#else +#include "chromecast/renderer/memory_pressure_observer_impl.h" #endif // OS_ANDROID namespace chromecast { @@ -80,6 +82,17 @@ new media::MediaCapsObserverImpl(&proxy, supported_profiles_.get())); media_caps->AddObserver(std::move(proxy)); +#if !defined(OS_ANDROID) + // Register to observe memory pressure changes + mojom::MemoryPressureControllerPtr memory_pressure_controller; + thread->GetConnector()->BindInterface(content::mojom::kBrowserServiceName, + &memory_pressure_controller); + mojom::MemoryPressureObserverPtr memory_pressure_proxy; + memory_pressure_observer_.reset( + new MemoryPressureObserverImpl(&memory_pressure_proxy)); + memory_pressure_controller->AddObserver(std::move(memory_pressure_proxy)); +#endif + prescient_networking_dispatcher_.reset( new network_hints::PrescientNetworkingDispatcher());
diff --git a/chromecast/renderer/cast_content_renderer_client.h b/chromecast/renderer/cast_content_renderer_client.h index 5a75c740..f72a97f5 100644 --- a/chromecast/renderer/cast_content_renderer_client.h +++ b/chromecast/renderer/cast_content_renderer_client.h
@@ -17,6 +17,7 @@ } // namespace network_hints namespace chromecast { +class MemoryPressureObserverImpl; namespace media { class MediaCapsObserverImpl; class SupportedCodecProfileLevelsMemo; @@ -59,6 +60,9 @@ prescient_networking_dispatcher_; std::unique_ptr<media::MediaCapsObserverImpl> media_caps_observer_; std::unique_ptr<media::SupportedCodecProfileLevelsMemo> supported_profiles_; +#if !defined(OS_ANDROID) + std::unique_ptr<MemoryPressureObserverImpl> memory_pressure_observer_; +#endif const bool allow_hidden_media_playback_;
diff --git a/chromecast/renderer/memory_pressure_observer_impl.cc b/chromecast/renderer/memory_pressure_observer_impl.cc new file mode 100644 index 0000000..ccd6568 --- /dev/null +++ b/chromecast/renderer/memory_pressure_observer_impl.cc
@@ -0,0 +1,24 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chromecast/renderer/memory_pressure_observer_impl.h" + +#include "base/memory/memory_pressure_listener.h" + +namespace chromecast { + +MemoryPressureObserverImpl::MemoryPressureObserverImpl( + mojom::MemoryPressureObserverPtr* proxy) + : binding_(this, mojo::MakeRequest(proxy)) {} + +MemoryPressureObserverImpl::~MemoryPressureObserverImpl() = default; + +void MemoryPressureObserverImpl::MemoryPressureLevelChanged( + int32_t pressure_level) { + base::MemoryPressureListener::NotifyMemoryPressure( + static_cast<base::MemoryPressureListener::MemoryPressureLevel>( + pressure_level)); +} + +} // namespace chromecast
diff --git a/chromecast/renderer/memory_pressure_observer_impl.h b/chromecast/renderer/memory_pressure_observer_impl.h new file mode 100644 index 0000000..2acca5c0 --- /dev/null +++ b/chromecast/renderer/memory_pressure_observer_impl.h
@@ -0,0 +1,29 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROMECAST_RENDERER_MEMORY_PRESSURE_OBSERVER_IMPL_H_ +#define CHROMECAST_RENDERER_MEMORY_PRESSURE_OBSERVER_IMPL_H_ + +#include "base/macros.h" +#include "chromecast/common/memory_pressure.mojom.h" +#include "mojo/public/cpp/bindings/binding.h" + +namespace chromecast { + +class MemoryPressureObserverImpl : public mojom::MemoryPressureObserver { + public: + MemoryPressureObserverImpl(mojom::MemoryPressureObserverPtr* proxy); + ~MemoryPressureObserverImpl() override; + + private: + void MemoryPressureLevelChanged(int32_t pressure_level) override; + + mojo::Binding<mojom::MemoryPressureObserver> binding_; + + DISALLOW_COPY_AND_ASSIGN(MemoryPressureObserverImpl); +}; + +} // namespace chromecast + +#endif // CHROMECAST_RENDERER_MEMORY_PRESSURE_OBSERVER_IMPL_H_
diff --git a/chromeos/system/fake_statistics_provider.cc b/chromeos/system/fake_statistics_provider.cc index 6c1f30e7..1d7ccf7 100644 --- a/chromeos/system/fake_statistics_provider.cc +++ b/chromeos/system/fake_statistics_provider.cc
@@ -14,7 +14,6 @@ } void FakeStatisticsProvider::StartLoadingMachineStatistics( - const scoped_refptr<base::TaskRunner>& file_task_runner, bool load_oem_manifest) { }
diff --git a/chromeos/system/fake_statistics_provider.h b/chromeos/system/fake_statistics_provider.h index 0de996b..3f78af3 100644 --- a/chromeos/system/fake_statistics_provider.h +++ b/chromeos/system/fake_statistics_provider.h
@@ -22,9 +22,7 @@ ~FakeStatisticsProvider() override; // StatisticsProvider implementation: - void StartLoadingMachineStatistics( - const scoped_refptr<base::TaskRunner>& file_task_runner, - bool load_oem_manifest) override; + void StartLoadingMachineStatistics(bool load_oem_manifest) override; bool GetMachineStatistic(const std::string& name, std::string* result) override; bool GetMachineFlag(const std::string& name, bool* result) override;
diff --git a/chromeos/system/statistics_provider.cc b/chromeos/system/statistics_provider.cc index c1ccac2..f2f2000 100644 --- a/chromeos/system/statistics_provider.cc +++ b/chromeos/system/statistics_provider.cc
@@ -23,6 +23,8 @@ #include "base/synchronization/waitable_event.h" #include "base/sys_info.h" #include "base/task_runner.h" +#include "base/task_scheduler/post_task.h" +#include "base/task_scheduler/task_traits.h" #include "base/threading/thread_restrictions.h" #include "base/time/time.h" #include "base/values.h" @@ -208,9 +210,7 @@ class StatisticsProviderImpl : public StatisticsProvider { public: // StatisticsProvider implementation: - void StartLoadingMachineStatistics( - const scoped_refptr<base::TaskRunner>& file_task_runner, - bool load_oem_manifest) override; + void StartLoadingMachineStatistics(bool load_oem_manifest) override; bool GetMachineStatistic(const std::string& name, std::string* result) override; bool GetMachineFlag(const std::string& name, bool* result) override; @@ -427,7 +427,6 @@ } void StatisticsProviderImpl::StartLoadingMachineStatistics( - const scoped_refptr<base::TaskRunner>& file_task_runner, bool load_oem_manifest) { CHECK(!load_statistics_started_); load_statistics_started_ = true; @@ -435,11 +434,12 @@ VLOG(1) << "Started loading statistics. Load OEM Manifest: " << load_oem_manifest; - file_task_runner->PostTask( + base::PostTaskWithTraits( FROM_HERE, - base::Bind(&StatisticsProviderImpl::LoadMachineStatistics, - base::Unretained(this), - load_oem_manifest)); + {base::MayBlock(), base::TaskPriority::BACKGROUND, + base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, + base::BindOnce(&StatisticsProviderImpl::LoadMachineStatistics, + base::Unretained(this), load_oem_manifest)); } void StatisticsProviderImpl::LoadMachineStatistics(bool load_oem_manifest) {
diff --git a/chromeos/system/statistics_provider.h b/chromeos/system/statistics_provider.h index 7f8b3c23..154336d 100644 --- a/chromeos/system/statistics_provider.h +++ b/chromeos/system/statistics_provider.h
@@ -10,10 +10,6 @@ #include "base/memory/ref_counted.h" #include "chromeos/chromeos_export.h" -namespace base { -class TaskRunner; -} - namespace chromeos { namespace system { @@ -91,11 +87,8 @@ // This interface provides access to Chrome OS statistics. class CHROMEOS_EXPORT StatisticsProvider { public: - // Starts loading the machine statistics. File operations are performed on - // |file_task_runner|. - virtual void StartLoadingMachineStatistics( - const scoped_refptr<base::TaskRunner>& file_task_runner, - bool load_oem_manifest) = 0; + // Starts loading the machine statistics. + virtual void StartLoadingMachineStatistics(bool load_oem_manifest) = 0; // Returns true if the named machine statistic (e.g. "hardware_class") is // found and stores it in |result| (if provided). Probing for the existence of
diff --git a/components/arc/arc_session.cc b/components/arc/arc_session.cc index 69e0423..99a846bb 100644 --- a/components/arc/arc_session.cc +++ b/components/arc/arc_session.cc
@@ -689,8 +689,6 @@ << (clean ? "cleanly" : "uncleanly"); if (container_instance_id != container_instance_id_) { - // This path is taken e.g. when an instance for login screen is Stop()ped - // by ArcSessionRunner. VLOG(1) << "Container instance id mismatch. Do nothing." << container_instance_id << " vs " << container_instance_id_; return;
diff --git a/components/arc/arc_session_runner.cc b/components/arc/arc_session_runner.cc index d16f5efc..e08cfa6 100644 --- a/components/arc/arc_session_runner.cc +++ b/components/arc/arc_session_runner.cc
@@ -223,16 +223,15 @@ } void ArcSessionRunner::EmitLoginPromptVisibleCalled() { - DCHECK(!arc_session_); // Since 'login-prompt-visible' Upstart signal starts all Upstart jobs the // container may depend on such as cras, EmitLoginPromptVisibleCalled() is the // safe place to start the container for login screen. - // TODO(yusukes): Once Chrome OS side is ready, uncomment the following: - - // arc_session_ = factory_.Run(); - // arc_session_->AddObserver(this); - // state_ = State::STARTING_FOR_LOGIN_SCREEN; - // arc_session_->StartForLoginScreen(); + DCHECK(!arc_session_); + DCHECK_EQ(state_, State::STOPPED); + arc_session_ = factory_.Run(); + arc_session_->AddObserver(this); + state_ = State::STARTING_FOR_LOGIN_SCREEN; + arc_session_->StartForLoginScreen(); } } // namespace arc
diff --git a/components/arc/arc_session_runner_unittest.cc b/components/arc/arc_session_runner_unittest.cc index 144d0b0b..f8f9cc4 100644 --- a/components/arc/arc_session_runner_unittest.cc +++ b/components/arc/arc_session_runner_unittest.cc
@@ -189,7 +189,7 @@ // Does the same with the mini instance for login screen. // TODO(yusukes): Enable the test once EmitLoginPromptVisibleCalled() is fully // enabled. -TEST_F(ArcSessionRunnerTest, DISABLED_BootFailureForLoginScreen) { +TEST_F(ArcSessionRunnerTest, BootFailureForLoginScreen) { ResetArcSessionFactory( base::Bind(&ArcSessionRunnerTest::CreateBootFailureArcSession, ArcStopReason::CRASH)); @@ -214,7 +214,7 @@ // is called. // TODO(yusukes): Enable the test once EmitLoginPromptVisibleCalled() is fully // enabled. -TEST_F(ArcSessionRunnerTest, DISABLED_StartWithLoginScreenInstance) { +TEST_F(ArcSessionRunnerTest, StartWithLoginScreenInstance) { EXPECT_TRUE(arc_session_runner()->IsStopped()); chromeos::DBusThreadManager::Get()
diff --git a/components/autofill/content/common/autofill_driver.mojom b/components/autofill/content/common/autofill_driver.mojom index 2d7574e9..46e79777 100644 --- a/components/autofill/content/common/autofill_driver.mojom +++ b/components/autofill/content/common/autofill_driver.mojom
@@ -88,6 +88,10 @@ // Never pass a free-form string as |log|. RecordSavePasswordProgress(string log); + // Notification that the user (not JavaScript) modified the value of a + // password field. + UserModifiedPasswordField(); + // Instructs the browser to show a popup with suggestions filled from data // associated with |key|. The popup will use |text_direction| for displaying // text.
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc index 2d520f3..c7c72ff 100644 --- a/components/autofill/content/renderer/password_autofill_agent.cc +++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -810,6 +810,9 @@ mutable_element.SetAutofilled(false); } } + + if (element.IsPasswordField()) + GetPasswordManagerDriver()->UserModifiedPasswordField(); } bool PasswordAutofillAgent::FillSuggestion(
diff --git a/components/autofill/content/renderer/renderer_save_password_progress_logger_unittest.cc b/components/autofill/content/renderer/renderer_save_password_progress_logger_unittest.cc index 364a7b1..b80e1c6 100644 --- a/components/autofill/content/renderer/renderer_save_password_progress_logger_unittest.cc +++ b/components/autofill/content/renderer/renderer_save_password_progress_logger_unittest.cc
@@ -72,6 +72,8 @@ log_ = log; } + void UserModifiedPasswordField() override {} + void SaveGenerationFieldDetectedByClassifier( const autofill::PasswordForm& password_form, const base::string16& generation_field) override {}
diff --git a/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc b/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc index dee837a7..48e362f 100644 --- a/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc +++ b/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc
@@ -11,7 +11,6 @@ #include <vector> #include "base/bind.h" -#include "base/debug/dump_without_crashing.h" #include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" #include "components/autofill/core/browser/proto/autofill_sync.pb.h" @@ -26,7 +25,6 @@ using base::Optional; using base::Time; -using base::debug::DumpWithoutCrashing; using sync_pb::AutofillSpecifics; using syncer::EntityChange; using syncer::EntityChangeList; @@ -283,12 +281,10 @@ AutofillWebDataService* web_data_service, AutofillWebDataBackend* web_data_backend) { web_data_service->GetDBUserData()->SetUserData( - UserDataKey(), - base::MakeUnique<AutocompleteSyncBridge>( - web_data_backend, - base::BindRepeating( - &ModelTypeChangeProcessor::Create, - base::BindRepeating(base::IgnoreResult(&DumpWithoutCrashing))))); + UserDataKey(), base::MakeUnique<AutocompleteSyncBridge>( + web_data_backend, + base::BindRepeating(&ModelTypeChangeProcessor::Create, + base::RepeatingClosure()))); } // static
diff --git a/components/autofill/ios/browser/resources/autofill_controller.js b/components/autofill/ios/browser/resources/autofill_controller.js index 899427d..8acb6ff 100644 --- a/components/autofill/ios/browser/resources/autofill_controller.js +++ b/components/autofill/ios/browser/resources/autofill_controller.js
@@ -805,10 +805,17 @@ } } - // Recursively invoke for all frames/iframes. - var frames = frame.frames; + // Recursively invoke for all iframes. + var frames = doc.getElementsByTagName("iframe"); for (var i = 0; i < frames.length; i++) { - extractFormsAndFormElements_(frames[i], minimumRequiredFields, forms); + // Check frame origin using only information available to the current frame + // (i.e. frames[i].src) to avoid triggering a SecurityError. Skip frames + // from different origin since we can't access the DOM elements to autofill. + if (!frames[i].src || + __gCrWeb.common.isSameOrigin(frame.location.href, frames[i].src)) { + extractFormsAndFormElements_( + frames[i].contentWindow, minimumRequiredFields, forms); + } } };
diff --git a/components/browsing_data/core/browsing_data_utils.cc b/components/browsing_data/core/browsing_data_utils.cc index 7dba88e..5e04932 100644 --- a/components/browsing_data/core/browsing_data_utils.cc +++ b/components/browsing_data/core/browsing_data_utils.cc
@@ -91,22 +91,6 @@ } } -void RecordDeletionFromTab(ClearBrowsingDataTab tab) { - UMA_HISTOGRAM_ENUMERATION("History.ClearBrowsingData.UserDeletedFromTab", tab, - browsing_data::ClearBrowsingDataTab::NUM_TYPES); - switch (tab) { - case ClearBrowsingDataTab::BASIC: - base::RecordAction(base::UserMetricsAction("ClearBrowsingData_BasicTab")); - break; - case ClearBrowsingDataTab::ADVANCED: - base::RecordAction( - base::UserMetricsAction("ClearBrowsingData_AdvancedTab")); - break; - case ClearBrowsingDataTab::NUM_TYPES: - NOTREACHED(); - } -} - base::string16 GetCounterTextFromResult( const BrowsingDataCounter::Result* result) { base::string16 text;
diff --git a/components/browsing_data/core/browsing_data_utils.h b/components/browsing_data/core/browsing_data_utils.h index 09d434fc..d97e68cd 100644 --- a/components/browsing_data/core/browsing_data_utils.h +++ b/components/browsing_data/core/browsing_data_utils.h
@@ -54,9 +54,6 @@ // Records the UMA action of a change of the clear browsing data time period. void RecordTimePeriodChange(TimePeriod period); -// Records the UMA action and histogram of a data deletion from |tab|. -void RecordDeletionFromTab(ClearBrowsingDataTab tab); - // Constructs the text to be displayed by a counter from the given |result|. // Currently this can only be used for counters for which the Result is // defined in components/browsing_data/core/counters.
diff --git a/components/chrome_cleaner/public/interfaces/chrome_prompt.mojom b/components/chrome_cleaner/public/interfaces/chrome_prompt.mojom index e935de9d57..0208967 100644 --- a/components/chrome_cleaner/public/interfaces/chrome_prompt.mojom +++ b/components/chrome_cleaner/public/interfaces/chrome_prompt.mojom
@@ -16,16 +16,15 @@ [Extensible] enum PromptAcceptance { UNSPECIFIED = 0, - // The Chrome prompt was not shown to the user (for example, due to an - // experiment run that shouldn't prompt the user or because the user has - // been prompted recently). - NOT_SHOWN = 1, - // The user explicitly accepted the Chrome prompt. - ACCEPTED = 2, + // The user explicitly accepted the cleanup operation and cleaner logs + // upload is allowed. + ACCEPTED_WITH_LOGS = 1, + // The user explicitly accepted the cleanup operation and cleaner logs + // upload is not allowed. + ACCEPTED_WITHOUT_LOGS = 2, // The user explicitly denied the Chrome prompt. DENIED = 3, - // The user didn't interact with the Chrome prompt after a while. - IGNORED = 4, + NUM_VALUES, }; struct FilePath {
diff --git a/components/content_settings/core/browser/content_settings_default_provider.cc b/components/content_settings/core/browser/content_settings_default_provider.cc index 6ea077f..d0cb24cc 100644 --- a/components/content_settings/core/browser/content_settings_default_provider.cc +++ b/components/content_settings/core/browser/content_settings_default_provider.cc
@@ -19,6 +19,7 @@ #include "components/content_settings/core/browser/website_settings_registry.h" #include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings_pattern.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "components/content_settings/core/common/pref_names.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_registry.h"
diff --git a/components/content_settings/core/browser/content_settings_pref.cc b/components/content_settings/core/browser/content_settings_pref.cc index 99e132b..49c2112b 100644 --- a/components/content_settings/core/browser/content_settings_pref.cc +++ b/components/content_settings/core/browser/content_settings_pref.cc
@@ -19,6 +19,7 @@ #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings_pattern.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "components/content_settings/core/common/pref_names.h" #include "components/prefs/scoped_user_pref_update.h" #include "services/preferences/public/cpp/dictionary_value_update.h"
diff --git a/components/content_settings/core/browser/content_settings_utils.cc b/components/content_settings/core/browser/content_settings_utils.cc index 55d33720..2efa8f7 100644 --- a/components/content_settings/core/browser/content_settings_utils.cc +++ b/components/content_settings/core/browser/content_settings_utils.cc
@@ -6,15 +6,14 @@ #include <stddef.h> -#include <memory> #include <vector> #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/string_split.h" #include "base/values.h" #include "components/content_settings/core/browser/host_content_settings_map.h" +#include "components/content_settings/core/common/content_settings_utils.h" namespace { @@ -120,34 +119,6 @@ return pattern_pair; } -ContentSetting ValueToContentSetting(const base::Value* value) { - ContentSetting setting = CONTENT_SETTING_DEFAULT; - bool valid = ParseContentSettingValue(value, &setting); - DCHECK(valid); - return setting; -} - -bool ParseContentSettingValue(const base::Value* value, - ContentSetting* setting) { - if (!value) { - *setting = CONTENT_SETTING_DEFAULT; - return true; - } - int int_value = -1; - if (!value->GetAsInteger(&int_value)) - return false; - *setting = IntToContentSetting(int_value); - return *setting != CONTENT_SETTING_DEFAULT; -} - -std::unique_ptr<base::Value> ContentSettingToValue(ContentSetting setting) { - if (setting <= CONTENT_SETTING_DEFAULT || - setting >= CONTENT_SETTING_NUM_SETTINGS) { - return nullptr; - } - return base::MakeUnique<base::Value>(setting); -} - void GetRendererContentSettingRules(const HostContentSettingsMap* map, RendererContentSettingRules* rules) { #if !defined(OS_ANDROID) @@ -158,12 +129,10 @@ #else // Android doesn't use image content settings, so ALLOW rule is added for // all origins. - rules->image_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_ALLOW, - std::string(), - map->is_incognito())); + rules->image_rules.push_back(ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), + ContentSettingToValue(CONTENT_SETTING_ALLOW), std::string(), + map->is_incognito())); #endif map->GetSettingsForOneType( CONTENT_SETTINGS_TYPE_JAVASCRIPT,
diff --git a/components/content_settings/core/browser/content_settings_utils.h b/components/content_settings/core/browser/content_settings_utils.h index fdcaf0b..476398d7 100644 --- a/components/content_settings/core/browser/content_settings_utils.h +++ b/components/content_settings/core/browser/content_settings_utils.h
@@ -5,7 +5,6 @@ #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ -#include <memory> #include <string> #include <utility> @@ -14,10 +13,6 @@ #include "components/content_settings/core/common/content_settings_pattern.h" #include "components/content_settings/core/common/content_settings_types.h" -namespace base { -class Value; -} - class HostContentSettingsMap; namespace content_settings { @@ -58,25 +53,12 @@ // Returns true if |name| specifies a valid content setting, false otherwise. bool ContentSettingFromString(const std::string& name, ContentSetting* setting); -// Converts |Value| to |ContentSetting|. -ContentSetting ValueToContentSetting(const base::Value* value); - -// Converts a |Value| to a |ContentSetting|. Returns true if |value| encodes -// a valid content setting, false otherwise. Note that |CONTENT_SETTING_DEFAULT| -// is encoded as a NULL value, so it is not allowed as an integer value. -bool ParseContentSettingValue(const base::Value* value, - ContentSetting* setting); - PatternPair ParsePatternString(const std::string& pattern_str); std::string CreatePatternString( const ContentSettingsPattern& item_pattern, const ContentSettingsPattern& top_level_frame_pattern); -// Returns a |base::Value*| representation of |setting| if |setting| is -// a valid content setting. Otherwise, returns a nullptr. -std::unique_ptr<base::Value> ContentSettingToValue(ContentSetting setting); - // Populates |rules| with content setting rules for content types that are // handled by the renderer. void GetRendererContentSettingRules(const HostContentSettingsMap* map,
diff --git a/components/content_settings/core/browser/cookie_settings.cc b/components/content_settings/core/browser/cookie_settings.cc index e9603c7..6dbac81c 100644 --- a/components/content_settings/core/browser/cookie_settings.cc +++ b/components/content_settings/core/browser/cookie_settings.cc
@@ -9,6 +9,7 @@ #include "components/content_settings/core/browser/content_settings_utils.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings_pattern.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "components/content_settings/core/common/pref_names.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_service.h"
diff --git a/components/content_settings/core/browser/host_content_settings_map.cc b/components/content_settings/core/browser/host_content_settings_map.cc index 92c7e2a3..19483f29 100644 --- a/components/content_settings/core/browser/host_content_settings_map.cc +++ b/components/content_settings/core/browser/host_content_settings_map.cc
@@ -16,6 +16,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/clock.h" +#include "base/values.h" #include "build/build_config.h" #include "components/content_settings/core/browser/content_settings_default_provider.h" #include "components/content_settings/core/browser/content_settings_details.h" @@ -29,6 +30,7 @@ #include "components/content_settings/core/browser/content_settings_utils.h" #include "components/content_settings/core/browser/website_settings_registry.h" #include "components/content_settings/core/common/content_settings_pattern.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "components/content_settings/core/common/pref_names.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_service.h" @@ -529,7 +531,7 @@ if (setting_entry.source != "preference") continue; // Migrate ALLOW settings only. - if (setting_entry.setting != CONTENT_SETTING_ALLOW) + if (setting_entry.GetContentSetting() != CONTENT_SETTING_ALLOW) continue; // Skip default settings. if (setting_entry.primary_pattern == ContentSettingsPattern::Wildcard()) @@ -736,7 +738,7 @@ while (rule_iterator->HasNext()) { const content_settings::Rule& rule = rule_iterator->Next(); - ContentSetting setting_value = CONTENT_SETTING_DEFAULT; + std::unique_ptr<base::Value> setting_value; // TODO(bauerb): Return rules as a list of values, not content settings. // Handle the case using base::Values for its exceptions and default // setting. Here we assume all the exceptions are granted as @@ -745,12 +747,13 @@ content_type) && rule.value.get() && rule.primary_pattern != ContentSettingsPattern::Wildcard()) { - setting_value = CONTENT_SETTING_ALLOW; + setting_value = + content_settings::ContentSettingToValue(CONTENT_SETTING_ALLOW); } else { - setting_value = content_settings::ValueToContentSetting(rule.value.get()); + setting_value = base::MakeUnique<base::Value>(*(rule.value)); } settings->push_back(ContentSettingPatternSource( - rule.primary_pattern, rule.secondary_pattern, setting_value, + rule.primary_pattern, rule.secondary_pattern, std::move(setting_value), kProviderNamesSourceMap[provider_type].provider_name, incognito)); } }
diff --git a/components/content_settings/core/common/BUILD.gn b/components/content_settings/core/common/BUILD.gn index 42404221..a70021e 100644 --- a/components/content_settings/core/common/BUILD.gn +++ b/components/content_settings/core/common/BUILD.gn
@@ -13,6 +13,8 @@ "content_settings_pattern_parser.cc", "content_settings_pattern_parser.h", "content_settings_types.h", + "content_settings_utils.cc", + "content_settings_utils.h", "pref_names.cc", "pref_names.h", ] @@ -21,6 +23,8 @@ deps = [ "//base", + "//mojo/common:common_custom_types", + "//mojo/common:struct_traits", "//mojo/public/cpp/bindings:struct_traits", "//net", "//url", @@ -47,4 +51,8 @@ sources = [ "content_settings.mojom", ] + + public_deps = [ + "//mojo/common:common_custom_types", + ] }
diff --git a/components/content_settings/core/common/DEPS b/components/content_settings/core/common/DEPS index 4e501b2..54fa71b 100644 --- a/components/content_settings/core/common/DEPS +++ b/components/content_settings/core/common/DEPS
@@ -1,4 +1,5 @@ include_rules = [ + "+mojo/common", "+mojo/public/cpp/bindings", "+net/base", "+testing",
diff --git a/components/content_settings/core/common/OWNERS b/components/content_settings/core/common/OWNERS index ac44cd00..fda0d85 100644 --- a/components/content_settings/core/common/OWNERS +++ b/components/content_settings/core/common/OWNERS
@@ -3,3 +3,6 @@ per-file *_struct_traits*.*=set noparent per-file *_struct_traits*.*=file://ipc/SECURITY_OWNERS + +per-file *.typemap=set noparent +per-file *.typemap=file://ipc/SECURITY_OWNERS
diff --git a/components/content_settings/core/common/content_settings.cc b/components/content_settings/core/common/content_settings.cc index 4bee639..072906a 100644 --- a/components/content_settings/core/common/content_settings.cc +++ b/components/content_settings/core/common/content_settings.cc
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "base/stl_util.h" #include "build/build_config.h" +#include "components/content_settings/core/common/content_settings_utils.h" ContentSetting IntToContentSetting(int content_setting) { return ((content_setting < 0) || @@ -78,21 +79,38 @@ ContentSettingPatternSource::ContentSettingPatternSource( const ContentSettingsPattern& primary_pattern, const ContentSettingsPattern& secondary_pattern, - ContentSetting setting, + std::unique_ptr<base::Value> setting_value, const std::string& source, bool incognito) : primary_pattern(primary_pattern), secondary_pattern(secondary_pattern), - setting(setting), + setting_value(std::move(setting_value)), source(source), incognito(incognito) {} -ContentSettingPatternSource::ContentSettingPatternSource() - : setting(CONTENT_SETTING_DEFAULT), incognito(false) { -} +ContentSettingPatternSource::ContentSettingPatternSource() : incognito(false) {} ContentSettingPatternSource::ContentSettingPatternSource( - const ContentSettingPatternSource& other) = default; + const ContentSettingPatternSource& other) { + *this = other; +} + +ContentSettingPatternSource& ContentSettingPatternSource::operator=( + const ContentSettingPatternSource& other) { + primary_pattern = other.primary_pattern; + secondary_pattern = other.secondary_pattern; + if (other.setting_value) + setting_value = base::MakeUnique<base::Value>(*(other.setting_value)); + source = other.source; + incognito = other.incognito; + return *this; +} + +ContentSettingPatternSource::~ContentSettingPatternSource() {} + +ContentSetting ContentSettingPatternSource::GetContentSetting() const { + return content_settings::ValueToContentSetting(setting_value.get()); +} RendererContentSettingRules::RendererContentSettingRules() {}
diff --git a/components/content_settings/core/common/content_settings.h b/components/content_settings/core/common/content_settings.h index c441e28..e28e51e 100644 --- a/components/content_settings/core/common/content_settings.h +++ b/components/content_settings/core/common/content_settings.h
@@ -7,9 +7,12 @@ #include <stddef.h> +#include <memory> #include <string> #include <vector> +#include "base/memory/ptr_util.h" +#include "base/values.h" #include "components/content_settings/core/common/content_settings_pattern.h" #include "components/content_settings/core/common/content_settings_types.h" @@ -43,14 +46,19 @@ struct ContentSettingPatternSource { ContentSettingPatternSource(const ContentSettingsPattern& primary_pattern, const ContentSettingsPattern& secondary_patttern, - ContentSetting setting, + std::unique_ptr<base::Value> setting_value, const std::string& source, bool incognito); ContentSettingPatternSource(const ContentSettingPatternSource& other); ContentSettingPatternSource(); + ContentSettingPatternSource& operator=( + const ContentSettingPatternSource& other); + ~ContentSettingPatternSource(); + ContentSetting GetContentSetting() const; + ContentSettingsPattern primary_pattern; ContentSettingsPattern secondary_pattern; - ContentSetting setting; + std::unique_ptr<base::Value> setting_value; std::string source; bool incognito; };
diff --git a/components/content_settings/core/common/content_settings.mojom b/components/content_settings/core/common/content_settings.mojom index 5c4c5d9..3669aec 100644 --- a/components/content_settings/core/common/content_settings.mojom +++ b/components/content_settings/core/common/content_settings.mojom
@@ -4,6 +4,8 @@ module content_settings.mojom; +import "mojo/common/values.mojom"; + // This mirrors the C++ type in content_settings_pattern.h. struct PatternParts { // Lowercase string of the URL scheme to match. This string is empty if the @@ -59,7 +61,7 @@ struct ContentSettingPatternSource { ContentSettingsPattern primary_pattern; ContentSettingsPattern secondary_pattern; - ContentSetting setting; + mojo.common.mojom.Value setting_value; string source; bool incognito; };
diff --git a/components/content_settings/core/common/content_settings_struct_traits.cc b/components/content_settings/core/common/content_settings_struct_traits.cc index 11ad9c9..b5bac4a 100644 --- a/components/content_settings/core/common/content_settings_struct_traits.cc +++ b/components/content_settings/core/common/content_settings_struct_traits.cc
@@ -88,7 +88,8 @@ out->incognito = data.incognito(); return data.ReadPrimaryPattern(&out->primary_pattern) && data.ReadSecondaryPattern(&out->secondary_pattern) && - data.ReadSetting(&out->setting) && data.ReadSource(&out->source); + data.ReadSettingValue(&out->setting_value) && + data.ReadSource(&out->source); } // static
diff --git a/components/content_settings/core/common/content_settings_struct_traits.h b/components/content_settings/core/common/content_settings_struct_traits.h index 10c78ef..ab3fee4 100644 --- a/components/content_settings/core/common/content_settings_struct_traits.h +++ b/components/content_settings/core/common/content_settings_struct_traits.h
@@ -7,8 +7,11 @@ #include <string> +#include "base/memory/ptr_util.h" +#include "base/values.h" #include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings.mojom.h" +#include "mojo/common/values_struct_traits.h" #include "mojo/public/cpp/bindings/enum_traits.h" #include "mojo/public/cpp/bindings/struct_traits.h" @@ -96,8 +99,9 @@ return r.secondary_pattern; } - static ContentSetting setting(const ContentSettingPatternSource& r) { - return r.setting; + static const std::unique_ptr<base::Value>& setting_value( + const ContentSettingPatternSource& r) { + return r.setting_value; } static const std::string& source(const ContentSettingPatternSource& r) {
diff --git a/components/content_settings/core/common/content_settings_utils.cc b/components/content_settings/core/common/content_settings_utils.cc new file mode 100644 index 0000000..3f86905 --- /dev/null +++ b/components/content_settings/core/common/content_settings_utils.cc
@@ -0,0 +1,47 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/content_settings/core/common/content_settings_utils.h" + +#include "base/memory/ptr_util.h" +#include "base/values.h" + +namespace content_settings { + +namespace { + +// Converts a |Value| to a |ContentSetting|. Returns true if |value| encodes +// a valid content setting, false otherwise. Note that |CONTENT_SETTING_DEFAULT| +// is encoded as a NULL value, so it is not allowed as an integer value. +bool ParseContentSettingValue(const base::Value* value, + ContentSetting* setting) { + if (!value) { + *setting = CONTENT_SETTING_DEFAULT; + return true; + } + int int_value = -1; + if (!value->GetAsInteger(&int_value)) + return false; + *setting = IntToContentSetting(int_value); + return *setting != CONTENT_SETTING_DEFAULT; +} + +} // namespace + +ContentSetting ValueToContentSetting(const base::Value* value) { + ContentSetting setting = CONTENT_SETTING_DEFAULT; + bool valid = ParseContentSettingValue(value, &setting); + DCHECK(valid); + return setting; +} + +std::unique_ptr<base::Value> ContentSettingToValue(ContentSetting setting) { + if (setting <= CONTENT_SETTING_DEFAULT || + setting >= CONTENT_SETTING_NUM_SETTINGS) { + return nullptr; + } + return base::MakeUnique<base::Value>(setting); +} + +} // namespace content_settings
diff --git a/components/content_settings/core/common/content_settings_utils.h b/components/content_settings/core/common/content_settings_utils.h new file mode 100644 index 0000000..640483d --- /dev/null +++ b/components/content_settings/core/common/content_settings_utils.h
@@ -0,0 +1,27 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_UTILS_H_ +#define COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_UTILS_H_ + +#include <memory> + +#include "components/content_settings/core/common/content_settings.h" + +namespace base { +class Value; +} + +namespace content_settings { + +// Converts |value| to |ContentSetting|. +ContentSetting ValueToContentSetting(const base::Value* value); + +// Returns a base::Value representation of |setting| if |setting| is +// a valid content setting. Otherwise, returns a nullptr. +std::unique_ptr<base::Value> ContentSettingToValue(ContentSetting setting); + +} // namespace content_settings + +#endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_UTILS_H_
diff --git a/components/content_settings/core/test/content_settings_test_utils.cc b/components/content_settings/core/test/content_settings_test_utils.cc index 9ec3edb..a0a8372b 100644 --- a/components/content_settings/core/test/content_settings_test_utils.cc +++ b/components/content_settings/core/test/content_settings_test_utils.cc
@@ -7,6 +7,7 @@ #include "components/content_settings/core/browser/content_settings_observable_provider.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings_types.h" +#include "components/content_settings/core/common/content_settings_utils.h" namespace content_settings {
diff --git a/components/cronet/android/BUILD.gn b/components/cronet/android/BUILD.gn index b5f646d..230ecf0 100644 --- a/components/cronet/android/BUILD.gn +++ b/components/cronet/android/BUILD.gn
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//base/android/jni_generator/jni_exception_list.gni") import("//build/buildflag_header.gni") import("//build/config/android/config.gni") import("//build/config/android/rules.gni") @@ -25,6 +26,12 @@ jni_package = "cronet" } +generate_jni_registration("cronet_jni_registration") { + target = ":cronet_sample_apk" + output = "$root_gen_dir/components/cronet/android/${target_name}.h" + exception_files = jni_exception_files +} + java_cpp_enum("effective_connection_type_java") { sources = [ "//net/nqe/effective_connection_type.h", @@ -165,6 +172,7 @@ deps = [ ":cronet_android_cert_proto", ":cronet_jni_headers", + ":cronet_jni_registration", ":cronet_version_header", "//base", "//base/third_party/dynamic_annotations", @@ -532,6 +540,9 @@ ] include_dirs = [ _cronet_version_header_include_dir ] + + configs -= [ "//build/config/android:hide_all_but_jni_onload" ] + configs += [ "//build/config/android:hide_all_but_jni" ] } android_resources("cronet_test_apk_resources") {
diff --git a/components/cronet/android/cronet_library_loader.cc b/components/cronet/android/cronet_library_loader.cc index 72c416e..b7aa07a 100644 --- a/components/cronet/android/cronet_library_loader.cc +++ b/components/cronet/android/cronet_library_loader.cc
@@ -19,6 +19,7 @@ #include "base/message_loop/message_loop.h" #include "base/metrics/statistics_recorder.h" #include "components/cronet/android/cronet_bidirectional_stream_adapter.h" +#include "components/cronet/android/cronet_jni_registration.h" #include "components/cronet/android/cronet_upload_data_stream_adapter.h" #include "components/cronet/android/cronet_url_request_adapter.h" #include "components/cronet/android/cronet_url_request_context_adapter.h" @@ -84,6 +85,11 @@ jint CronetOnLoad(JavaVM* vm, void* reserved) { base::android::InitVM(vm); JNIEnv* env = base::android::AttachCurrentThread(); + if (!RegisterMainDexNatives(env) || !RegisterNonMainDexNatives(env)) { + return -1; + } + // TODO(agrieve): Delete this block, this is a no-op now. + // https://crbug.com/683256. if (!RegisterJNI(env) || !NativeInit()) { return -1; }
diff --git a/components/cronet/android/test/experimental_options_test.cc b/components/cronet/android/test/experimental_options_test.cc index e33fabf..8804e56 100644 --- a/components/cronet/android/test/experimental_options_test.cc +++ b/components/cronet/android/test/experimental_options_test.cc
@@ -28,14 +28,23 @@ net::URLRequestContext* context = TestUtil::GetURLRequestContext(jcontext_adapter); net::HostCache* cache = context->host_resolver()->GetHostCache(); - net::HostCache::Key key("host-cache-test-host", - net::ADDRESS_FAMILY_UNSPECIFIED, 0); + const std::string hostname = "host-cache-test-host"; + + // Create multiple keys to ensure the test works in a variety of network + // conditions. + net::HostCache::Key key1(hostname, net::ADDRESS_FAMILY_UNSPECIFIED, 0); + net::HostCache::Key key2( + hostname, net::ADDRESS_FAMILY_IPV4, + net::HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6); + net::IPAddress address; CHECK(address.AssignFromIPLiteral(address_string)); net::AddressList address_list = net::AddressList::CreateFromIPAddress(address, 0); net::HostCache::Entry entry(net::OK, address_list); - cache->Set(key, entry, base::TimeTicks::Now(), + cache->Set(key1, entry, base::TimeTicks::Now(), + base::TimeDelta::FromSeconds(1)); + cache->Set(key2, entry, base::TimeTicks::Now(), base::TimeDelta::FromSeconds(1)); } } // namespace
diff --git a/components/cronet/ios/BUILD.gn b/components/cronet/ios/BUILD.gn index dfe018b5..3244295 100644 --- a/components/cronet/ios/BUILD.gn +++ b/components/cronet/ios/BUILD.gn
@@ -269,7 +269,7 @@ } action(_target_name) { - script = "//components/cronet/tools/dummy.py" + script = "//build/config/ios/dummy.py" outputs = [ "$root_out_dir/Static/$_output_name", ]
diff --git a/components/cronet/tools/dummy.py b/components/cronet/tools/dummy.py deleted file mode 100755 index a216b12..0000000 --- a/components/cronet/tools/dummy.py +++ /dev/null
@@ -1,7 +0,0 @@ -#!/usr/bin/python -# Copyright 2017 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Provides empty action to expose static framwork output from subdirectory. -"""
diff --git a/components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc b/components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc index 5caa2a4..aaec299 100644 --- a/components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc +++ b/components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc
@@ -771,11 +771,11 @@ std::unique_ptr<net::URLRequest> request = CreateRequestByType(content::RESOURCE_TYPE_MEDIA, false, true); net::HttpRequestHeaders headers; - headers.SetHeader(chrome_proxy_accept_transform_header(), "foo"); + headers.SetHeader(chrome_proxy_accept_transform_header(), "empty-image"); NotifyBeforeSendHeaders(&headers, request.get(), true); std::string header_value; headers.GetHeader(chrome_proxy_accept_transform_header(), &header_value); - EXPECT_EQ("foo", header_value); + EXPECT_EQ("empty-image", header_value); } TEST_F(ContentLoFiDeciderTest, IsSlowPagePreviewRequested) {
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc index 626d794..7bef41ff 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
@@ -54,6 +54,17 @@ namespace { +// Values of the UMA DataReductionProxy.Protocol.NotAcceptingTransform histogram +// defined in metrics/histograms/histograms.xml. This enum must remain +// synchronized with DataReductionProxyProtocolNotAcceptingTransformReason in +// tools/metrics/histograms/enums.xml. +enum NotAcceptingTransformReason { + NOT_ACCEPTING_TRANSFORM_DISABLED = 0, + NOT_ACCEPTING_TRANSFORM_BLACKLISTED = 1, + NOT_ACCEPTING_TRANSFORM_CELLULAR_ONLY = 2, + NOT_ACCEPTING_TRANSFORM_REASON_BOUNDARY +}; + // Values of the UMA DataReductionProxy.NetworkChangeEvents histograms. // This enum must remain synchronized with the enum of the same // name in metrics/histograms/histograms.xml. @@ -1073,7 +1084,11 @@ // For the transition to server-driven previews decisions, we will // use existing Lo-Fi flags for disabling and cellular-only mode. // TODO(dougarnett): Refactor flag names as part of bug 725645. - if (params::IsLoFiDisabledViaFlags()) { + if (params::IsLoFiDisabledViaFlags() || lofi_off()) { + UMA_HISTOGRAM_ENUMERATION( + "DataReductionProxy.Protocol.NotAcceptingTransform", + NOT_ACCEPTING_TRANSFORM_DISABLED, + NOT_ACCEPTING_TRANSFORM_REASON_BOUNDARY); return false; } @@ -1083,11 +1098,20 @@ if (IsBlackListedOrDisabled(request, previews_decider, previews::PreviewsType::LITE_PAGE)) { + UMA_HISTOGRAM_ENUMERATION( + "DataReductionProxy.Protocol.NotAcceptingTransform", + NOT_ACCEPTING_TRANSFORM_BLACKLISTED, + NOT_ACCEPTING_TRANSFORM_REASON_BOUNDARY); return false; } - if (params::IsLoFiCellularOnlyViaFlags()) { - return net::NetworkChangeNotifier::IsConnectionCellular(connection_type_); + if (params::IsLoFiCellularOnlyViaFlags() && + !net::NetworkChangeNotifier::IsConnectionCellular(connection_type_)) { + UMA_HISTOGRAM_ENUMERATION( + "DataReductionProxy.Protocol.NotAcceptingTransform", + NOT_ACCEPTING_TRANSFORM_CELLULAR_ONLY, + NOT_ACCEPTING_TRANSFORM_REASON_BOUNDARY); + return false; } return true;
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc index 32ac3582..8dc44167 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc
@@ -1544,7 +1544,11 @@ base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitAndEnableFeature( features::kDataReductionProxyDecidesTransform); + base::FieldTrialList field_trial_list(nullptr); + base::FieldTrialList::CreateFieldTrial( + "DataReductionProxyPreviewsBlackListTransition", "Enabled"); + base::HistogramTester histogram_tester; net::TestURLRequestContext context_; net::TestDelegate delegate_; std::unique_ptr<net::URLRequest> request = context_.CreateRequest( @@ -1552,7 +1556,7 @@ request->SetLoadFlags(request->load_flags() | net::LOAD_MAIN_FRAME_DEPRECATED); std::unique_ptr<TestPreviewsDecider> previews_decider = - base::MakeUnique<TestPreviewsDecider>(false); + base::MakeUnique<TestPreviewsDecider>(true); // Verify true for no flags. EXPECT_TRUE(config()->ShouldAcceptServerPreview(*request.get(), @@ -1565,6 +1569,9 @@ switches::kDataReductionProxyLoFiValueDisabled); EXPECT_FALSE(config()->ShouldAcceptServerPreview(*request.get(), *previews_decider.get())); + histogram_tester.ExpectBucketCount( + "DataReductionProxy.Protocol.NotAcceptingTransform", + 0 /* NOT_ACCEPTING_TRANSFORM_DISABLED */, 1); // Verify true for Slow Connection flag. base::CommandLine::ForCurrentProcess()->InitFromArgv(0, NULL); @@ -1574,12 +1581,6 @@ EXPECT_TRUE(config()->ShouldAcceptServerPreview(*request.get(), *previews_decider.get())); - // Verify PreviewsDecider check. - previews_decider = base::MakeUnique<TestPreviewsDecider>(true); - EXPECT_TRUE(config()->ShouldAcceptServerPreview(*request.get(), - *previews_decider.get())); - previews_decider = base::MakeUnique<TestPreviewsDecider>(false); - // Verify false for Cellular Only flag and WIFI connection. base::CommandLine::ForCurrentProcess()->InitFromArgv(0, NULL); base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( @@ -1589,6 +1590,9 @@ net::NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI); EXPECT_FALSE(config()->ShouldAcceptServerPreview(*request.get(), *previews_decider.get())); + histogram_tester.ExpectBucketCount( + "DataReductionProxy.Protocol.NotAcceptingTransform", + 2 /* NOT_ACCEPTING_TRANSFORM_CELLULAR_ONLY */, 1); // Verify true for Cellular Only flag and 3G connection. config()->SetConnectionTypeForTesting( @@ -1596,18 +1600,22 @@ EXPECT_TRUE(config()->ShouldAcceptServerPreview(*request.get(), *previews_decider.get())); - { - // Verfiy true for always on. - base::CommandLine::ForCurrentProcess()->InitFromArgv(0, NULL); - base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( - switches::kDataReductionProxyLoFi, - switches::kDataReductionProxyLoFiValueAlwaysOn); - base::FieldTrialList field_trial_list(nullptr); - base::FieldTrialList::CreateFieldTrial( - "DataReductionProxyPreviewsBlackListTransition", "Enabled"); - EXPECT_TRUE(config()->ShouldAcceptServerPreview(*request.get(), - *previews_decider.get())); - } + // Verify PreviewsDecider check. + previews_decider = base::MakeUnique<TestPreviewsDecider>(false); + EXPECT_FALSE(config()->ShouldAcceptServerPreview(*request.get(), + *previews_decider.get())); + histogram_tester.ExpectBucketCount( + "DataReductionProxy.Protocol.NotAcceptingTransform", + 1 /* NOT_ACCEPTING_TRANSFORM_BLACKLISTED */, 1); + previews_decider = base::MakeUnique<TestPreviewsDecider>(true); + + // Verfiy true for always on. + base::CommandLine::ForCurrentProcess()->InitFromArgv(0, NULL); + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + switches::kDataReductionProxyLoFi, + switches::kDataReductionProxyLoFiValueAlwaysOn); + EXPECT_TRUE(config()->ShouldAcceptServerPreview(*request.get(), + *previews_decider.get())); } } // namespace data_reduction_proxy
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc index 465ec6c..12d3470d 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
@@ -43,6 +43,20 @@ namespace { +// Values of the UMA DataReductionProxy.Protocol.AcceptTransform histogram +// defined in metrics/histograms/histograms.xml. This enum must remain +// synchronized with DataReductionProxyProtocolAcceptTransformEvent in +// tools/metrics/histograms/enums.xml. +enum AcceptTransformEvent { + LITE_PAGE_REQUESTED = 0, + LITE_PAGE_TRANSFORM_RECEIVED = 1, + EMPTY_IMAGE_POLICY_DIRECTIVE_RECEIVED = 2, + EMPTY_IMAGE_REQUESTED = 3, + EMPTY_IMAGE_TRANSFORM_RECEIVED = 4, + COMPRESSED_VIDEO_REQUESTED = 5, + ACCEPT_TRANSFORM_EVENT_BOUNDARY +}; + // Records the occurrence of |sample| in |name| histogram. UMA macros are not // used because the |name| is not static. void RecordNewContentLengthHistogram(const std::string& name, int64_t sample) { @@ -165,6 +179,56 @@ received_content_length); } +void RecordAcceptTransformEvent(AcceptTransformEvent event) { + UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.Protocol.AcceptTransform", + event, ACCEPT_TRANSFORM_EVENT_BOUNDARY); +} + +void RecordAcceptTransformSentUMA( + const net::HttpRequestHeaders& request_headers) { + switch (ParseRequestTransform(request_headers)) { + case TRANSFORM_LITE_PAGE: + RecordAcceptTransformEvent(LITE_PAGE_REQUESTED); + break; + case TRANSFORM_EMPTY_IMAGE: + RecordAcceptTransformEvent(EMPTY_IMAGE_REQUESTED); + break; + case TRANSFORM_COMPRESSED_VIDEO: + RecordAcceptTransformEvent(COMPRESSED_VIDEO_REQUESTED); + break; + case TRANSFORM_NONE: + break; + case TRANSFORM_PAGE_POLICIES_EMPTY_IMAGE: + NOTREACHED(); + break; + } +} + +void RecordAcceptTransformReceivedUMA(const net::URLRequest& request) { + net::HttpResponseHeaders* response_headers = request.response_headers(); + if (!response_headers) { + return; + } + + switch (ParseResponseTransform(*response_headers)) { + case TRANSFORM_LITE_PAGE: + RecordAcceptTransformEvent(LITE_PAGE_TRANSFORM_RECEIVED); + break; + case TRANSFORM_PAGE_POLICIES_EMPTY_IMAGE: + RecordAcceptTransformEvent(EMPTY_IMAGE_POLICY_DIRECTIVE_RECEIVED); + break; + case TRANSFORM_EMPTY_IMAGE: + RecordAcceptTransformEvent(EMPTY_IMAGE_TRANSFORM_RECEIVED); + break; + case TRANSFORM_NONE: + break; + case TRANSFORM_COMPRESSED_VIDEO: + // Compressed video response would instead be a redirect to resource. + NOTREACHED(); + break; + } +} + // Verifies that the chrome proxy related request headers are set correctly. // |via_chrome_proxy| is true if the request is being fetched via Chrome Data // Saver proxy. @@ -373,6 +437,7 @@ data_reduction_proxy_request_options_->AddRequestHeader(headers, page_id); VerifyHttpRequestHeaders(true, *headers); + RecordAcceptTransformSentUMA(*headers); } void DataReductionProxyNetworkDelegate::OnBeforeRedirectInternal( @@ -456,6 +521,7 @@ CalculateAndRecordDataUsage(*request, request_type); RecordContentLength(*request, request_type, original_content_length); + RecordAcceptTransformReceivedUMA(*request); } void DataReductionProxyNetworkDelegate::OnHeadersReceivedInternal(
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc index e80b933a..dba17a0 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
@@ -242,7 +242,8 @@ std::string header_value; if (headers.GetHeader(chrome_proxy_accept_transform_header(), &header_value)) { - return header_value == empty_image_directive(); + return header_value == empty_image_directive() || + header_value == lite_page_directive(); } return false; } @@ -2164,6 +2165,89 @@ GetSavings()); } +TEST_F(DataReductionProxyNetworkDelegateTest, TestAcceptTransformHistogram) { + Init(USE_INSECURE_PROXY, false); + base::HistogramTester histogram_tester; + + // Verify lite page request. + net::HttpRequestHeaders request_headers; + request_headers.SetHeader("chrome-proxy-accept-transform", "lite-page"); + FetchURLRequest(GURL(kTestURL), &request_headers, std::string(), 140, 0); + histogram_tester.ExpectTotalCount( + "DataReductionProxy.Protocol.AcceptTransform", 1); + histogram_tester.ExpectBucketCount( + "DataReductionProxy.Protocol.AcceptTransform", + 0 /* LITE_PAGE_REQUESTED */, 1); + // Check legacy histogram too: + histogram_tester.ExpectBucketCount( + "DataReductionProxy.LoFi.TransformationType", + NO_TRANSFORMATION_LITE_PAGE_REQUESTED, 1); + + // Verify empty image request. + request_headers.SetHeader("chrome-proxy-accept-transform", "empty-image"); + FetchURLRequest(GURL(kTestURL), &request_headers, std::string(), 140, 0); + histogram_tester.ExpectTotalCount( + "DataReductionProxy.Protocol.AcceptTransform", 2); + histogram_tester.ExpectBucketCount( + "DataReductionProxy.Protocol.AcceptTransform", + 3 /* EMPTY_IMAGE_REQUESTED */, 1); + + // Verify lite page response. + std::string response_headers = + "HTTP/1.1 200 OK\r\n" + "Chrome-Proxy-Content-Transform: lite-page\r\n" + "Date: Wed, 28 Nov 2007 09:40:09 GMT\r\n" + "Expires: Mon, 24 Nov 2014 12:45:26 GMT\r\n" + "Via: 1.1 Chrome-Compression-Proxy\r\n" + "x-original-content-length: 200\r\n" + "\r\n"; + auto request = + FetchURLRequest(GURL(kTestURL), nullptr, response_headers, 140, 0); + EXPECT_TRUE(DataReductionProxyData::GetData(*request)->lite_page_received()); + histogram_tester.ExpectTotalCount( + "DataReductionProxy.Protocol.AcceptTransform", 3); + histogram_tester.ExpectBucketCount( + "DataReductionProxy.Protocol.AcceptTransform", + 1 /* LITE_PAGE_TRANSFORM_RECEIVED */, 1); + // Check legacy histogram too: + histogram_tester.ExpectBucketCount( + "DataReductionProxy.LoFi.TransformationType", LITE_PAGE, 1); + + // Verify page policy response. + response_headers = + "HTTP/1.1 200 OK\r\n" + "Chrome-Proxy: page-policies=empty-image\r\n" + "Date: Wed, 28 Nov 2007 09:40:09 GMT\r\n" + "Expires: Mon, 24 Nov 2014 12:45:26 GMT\r\n" + "Via: 1.1 Chrome-Compression-Proxy\r\n" + "x-original-content-length: 200\r\n" + "\r\n"; + request = FetchURLRequest(GURL(kTestURL), nullptr, response_headers, 140, 0); + EXPECT_FALSE(DataReductionProxyData::GetData(*request)->lite_page_received()); + histogram_tester.ExpectTotalCount( + "DataReductionProxy.Protocol.AcceptTransform", 4); + histogram_tester.ExpectBucketCount( + "DataReductionProxy.Protocol.AcceptTransform", + 2 /* EMPTY_IMAGE_POLICY_DIRECTIVE_RECEIVED */, 1); + + // Verify empty image response. + response_headers = + "HTTP/1.1 200 OK\r\n" + "Chrome-Proxy-Content-Transform: empty-image\r\n" + "Date: Wed, 28 Nov 2007 09:40:09 GMT\r\n" + "Expires: Mon, 24 Nov 2014 12:45:26 GMT\r\n" + "Via: 1.1 Chrome-Compression-Proxy\r\n" + "x-original-content-length: 200\r\n" + "\r\n"; + request = FetchURLRequest(GURL(kTestURL), nullptr, response_headers, 140, 0); + EXPECT_TRUE(DataReductionProxyData::GetData(*request)->lofi_received()); + histogram_tester.ExpectTotalCount( + "DataReductionProxy.Protocol.AcceptTransform", 5); + histogram_tester.ExpectBucketCount( + "DataReductionProxy.Protocol.AcceptTransform", + 4 /* EMPTY_IMAGE_TRANSFORM_RECEIVED */, 1); +} + } // namespace } // namespace data_reduction_proxy
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc index faec819e..6af9128 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc
@@ -120,7 +120,8 @@ } } else if (params::AreLitePagesEnabledViaFlags()) { experiments_.push_back(chrome_proxy_experiment_force_lite_page()); - } else if (params::IsLoFiOnViaFlags()) { + } else if (params::IsLoFiAlwaysOnViaFlags() || + params::IsLoFiCellularOnlyViaFlags()) { experiments_.push_back(chrome_proxy_experiment_force_empty_image()); } else { // If no other "exp" directive is forced by flags, add the field trial
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc index 3b84422..acbf5bb 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc
@@ -379,6 +379,34 @@ VerifyExpectedHeader(expected_header, kPageIdValue); } +TEST_F(DataReductionProxyRequestOptionsTest, TestExperimentOtherLoFiFlags) { + std::string expected_header; + std::vector<std::string> expected_experiments; + + // No "exp=force_*" is set for SlowConnectionOnly flag. + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + switches::kDataReductionProxyLoFi, + switches::kDataReductionProxyLoFiValueSlowConnectionsOnly); + expected_experiments.clear(); + SetHeaderExpectations(kExpectedSession, kExpectedCredentials, std::string(), + kClientStr, kExpectedBuild, kExpectedPatch, kPageId, + expected_experiments, &expected_header); + CreateRequestOptions(kVersion); + VerifyExpectedHeader(expected_header, kPageIdValue); + + // "exp=force_empty_image" is set for CellularOnly flag. + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + switches::kDataReductionProxyLoFi, + switches::kDataReductionProxyLoFiValueAlwaysOn); + expected_experiments.clear(); + expected_experiments.push_back(chrome_proxy_experiment_force_empty_image()); + SetHeaderExpectations(kExpectedSession, kExpectedCredentials, std::string(), + kClientStr, kExpectedBuild, kExpectedPatch, kPageId, + expected_experiments, &expected_header); + CreateRequestOptions(kVersion); + VerifyExpectedHeader(expected_header, kPageIdValue); +} + TEST_F(DataReductionProxyRequestOptionsTest, GetSessionKeyFromRequestHeaders) { const struct { std::string chrome_proxy_header_key;
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.cc b/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.cc index ef1e77fa..b5e5e05 100644 --- a/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.cc +++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.cc
@@ -30,7 +30,8 @@ const char kChromeProxyHeader[] = "chrome-proxy"; const char kDataReductionPassThroughHeader[] = - "Chrome-Proxy-Accept-Transform: identity\nCache-Control: no-cache"; + "Chrome-Proxy-Accept-Transform: identity\r\nCache-Control: " + "no-cache\r\n\r\n"; const char kChromeProxyECTHeader[] = "chrome-proxy-ect"; const char kChromeProxyAcceptTransformHeader[] = "chrome-proxy-accept-transform"; @@ -43,6 +44,8 @@ const char kEmptyImageDirective[] = "empty-image"; const char kLitePageDirective[] = "lite-page"; const char kCompressedVideoDirective[] = "compressed-video"; +const char kIdentityDirective[] = "identity"; +const char kChromeProxyPagePoliciesDirective[] = "page-policies"; // The legacy Chrome-Proxy response header directive for LoFi images. const char kLegacyChromeProxyLoFiResponseDirective[] = "q=low"; @@ -121,6 +124,30 @@ url_chain.back()) != url_chain.rend(); } +data_reduction_proxy::TransformDirective ParsePagePolicyDirective( + const std::string chrome_proxy_header_value) { + for (const auto& directive : base::SplitStringPiece( + chrome_proxy_header_value, ",", base::TRIM_WHITESPACE, + base::SPLIT_WANT_NONEMPTY)) { + if (!base::StartsWith(directive, kChromeProxyPagePoliciesDirective, + base::CompareCase::INSENSITIVE_ASCII)) { + continue; + } + + // Check policy directive for empty-image entry. + base::StringPiece page_policies_value = base::StringPiece(directive).substr( + arraysize(kChromeProxyPagePoliciesDirective)); + for (const auto& policy : + base::SplitStringPiece(page_policies_value, "|", base::TRIM_WHITESPACE, + base::SPLIT_WANT_NONEMPTY)) { + if (base::LowerCaseEqualsASCII(policy, kEmptyImageDirective)) { + return data_reduction_proxy::TRANSFORM_PAGE_POLICIES_EMPTY_IMAGE; + } + } + } + return data_reduction_proxy::TRANSFORM_NONE; +} + } // namespace namespace data_reduction_proxy { @@ -169,6 +196,56 @@ return kIfHeavyQualifier; } +TransformDirective ParseRequestTransform( + const net::HttpRequestHeaders& headers) { + std::string accept_transform_value; + if (!headers.GetHeader(chrome_proxy_accept_transform_header(), + &accept_transform_value)) { + return TRANSFORM_NONE; + } + + if (base::LowerCaseEqualsASCII(accept_transform_value, + lite_page_directive())) { + return TRANSFORM_LITE_PAGE; + } else if (base::LowerCaseEqualsASCII(accept_transform_value, + empty_image_directive())) { + return TRANSFORM_EMPTY_IMAGE; + } else if (base::LowerCaseEqualsASCII(accept_transform_value, + compressed_video_directive())) { + return TRANSFORM_COMPRESSED_VIDEO; + } else { + return TRANSFORM_NONE; + } +} + +TransformDirective ParseResponseTransform( + const net::HttpResponseHeaders& headers) { + std::string content_transform_value; + if (!headers.GetNormalizedHeader(chrome_proxy_content_transform_header(), + &content_transform_value)) { + // No content-transform so check for page-policies in chrome-proxy header. + std::string chrome_proxy_header_value; + if (headers.GetNormalizedHeader(chrome_proxy_header(), + &chrome_proxy_header_value)) { + return ParsePagePolicyDirective(chrome_proxy_header_value); + } + } else if (base::LowerCaseEqualsASCII(content_transform_value, + lite_page_directive())) { + return TRANSFORM_LITE_PAGE; + } else if (base::LowerCaseEqualsASCII(content_transform_value, + empty_image_directive())) { + return TRANSFORM_EMPTY_IMAGE; + } else if (base::LowerCaseEqualsASCII(content_transform_value, + kIdentityDirective)) { + // Open Original Image - not really a transform. + return TRANSFORM_NONE; + } else { + NOTREACHED() << "Unexpected content transform header: " + << content_transform_value; + } + return TRANSFORM_NONE; +} + bool IsEmptyImagePreview(const net::HttpResponseHeaders& headers) { return IsPreviewType(headers, kEmptyImageDirective) || headers.HasHeaderValue(kChromeProxyHeader,
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h b/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h index d65f8e2..f48ff2d 100644 --- a/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h +++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h
@@ -11,6 +11,8 @@ #include "base/macros.h" #include "base/strings/string_piece.h" #include "base/time/time.h" +#include "net/http/http_request_headers.h" +#include "net/http/http_response_headers.h" #include "net/proxy/proxy_service.h" class GURL; @@ -21,6 +23,15 @@ namespace data_reduction_proxy { +// Transform directives that may be parsed out of http headers. +enum TransformDirective { + TRANSFORM_NONE, + TRANSFORM_LITE_PAGE, + TRANSFORM_EMPTY_IMAGE, + TRANSFORM_COMPRESSED_VIDEO, + TRANSFORM_PAGE_POLICIES_EMPTY_IMAGE, +}; + // Values of the UMA DataReductionProxy.BypassType{Primary|Fallback} and // DataReductionProxy.BlockType{Primary|Fallback} histograms. This enum must // remain synchronized with the enum of the same name in @@ -117,6 +128,18 @@ // that an empty image has been provided. bool IsEmptyImagePreview(const net::HttpResponseHeaders& headers); +// Retrieves the accepted transform type, if any, from |headers|. +TransformDirective ParseRequestTransform( + const net::HttpRequestHeaders& headers); + +// Retrieves the transform directive (whether applied or a page policy), if any, +// from |headers|. +// Note if the response headers contains both an applied content transform and +// a page policies directive, only the applied content transform type will +// be returned. +TransformDirective ParseResponseTransform( + const net::HttpResponseHeaders& headers); + // Returns true if the provided value of the Chrome-Proxy-Content-Transform // response header that is provided in |content_transform_value| indicates that // an empty image has been provided.
diff --git a/components/data_use_measurement/core/data_use_recorder.cc b/components/data_use_measurement/core/data_use_recorder.cc index 6d7282b..c4864e5 100644 --- a/components/data_use_measurement/core/data_use_recorder.cc +++ b/components/data_use_measurement/core/data_use_recorder.cc
@@ -56,6 +56,12 @@ pending_url_requests_.erase(request_it); } +base::TimeTicks DataUseRecorder::GetPendingURLRequestStartTime( + net::URLRequest* request) { + auto request_it = pending_url_requests_.find(request); + return request_it->second.started_time; +} + void DataUseRecorder::RemoveAllPendingURLRequests() { pending_url_requests_.clear(); }
diff --git a/components/data_use_measurement/core/data_use_recorder.h b/components/data_use_measurement/core/data_use_recorder.h index e66b8fb6..aa2dedb 100644 --- a/components/data_use_measurement/core/data_use_recorder.h +++ b/components/data_use_measurement/core/data_use_recorder.h
@@ -12,6 +12,7 @@ #include "base/macros.h" #include "base/supports_user_data.h" +#include "base/time/time.h" #include "components/data_use_measurement/core/data_use.h" #include "net/base/net_export.h" @@ -29,11 +30,17 @@ public: // Stores network data used by a URLRequest. struct URLRequestDataUse { - URLRequestDataUse() : bytes_received(0), bytes_sent(0) {} + URLRequestDataUse() + : bytes_received(0), + bytes_sent(0), + started_time(base::TimeTicks::Now()) {} int64_t bytes_received; int64_t bytes_sent; + // Time the request started and associated with the DataUseRecorder. + base::TimeTicks started_time; + private: DISALLOW_COPY_AND_ASSIGN(URLRequestDataUse); }; @@ -78,6 +85,8 @@ void MovePendingURLRequestTo(DataUseRecorder* other, net::URLRequest* request); + base::TimeTicks GetPendingURLRequestStartTime(net::URLRequest* request); + // Clears the list of pending URLRequests that ascribe data use to this // recorder. void RemoveAllPendingURLRequests();
diff --git a/components/drive/change_list_processor_unittest.cc b/components/drive/change_list_processor_unittest.cc index bffb86dd..bd68317 100644 --- a/components/drive/change_list_processor_unittest.cc +++ b/components/drive/change_list_processor_unittest.cc
@@ -32,8 +32,8 @@ namespace { -const int64_t kBaseResourceListChangestamp = 123; -const char kRootId[] = "fake_root"; +constexpr int64_t kBaseResourceListChangestamp = 123; +constexpr char kRootId[] = "fake_root"; enum FileOrDirectory { FILE, @@ -137,23 +137,40 @@ about_resource->set_root_folder_id(kRootId); ChangeListProcessor processor(metadata_.get(), nullptr); - return processor.Apply(std::move(about_resource), std::move(changes), - false /* is_delta_update */); + return processor.ApplyUserChangeList(std::move(about_resource), + std::move(changes), + false /* is_delta_update */); } - // Applies the |changes| to |metadata_| as a delta update. Delta changelists - // should contain their changestamp in themselves. - FileError ApplyChangeList(std::vector<std::unique_ptr<ChangeList>> changes, - FileChange* changed_files) { + // Applies |changes| to |metadata_| as a delta update. The |changes| are + // treated as user's changelists. Delta changelists should contain their + // changestamp in themselves. + FileError ApplyUserChangeList( + std::vector<std::unique_ptr<ChangeList>> changes, + FileChange* changed_files) { std::unique_ptr<google_apis::AboutResource> about_resource( new google_apis::AboutResource); about_resource->set_largest_change_id(kBaseResourceListChangestamp); about_resource->set_root_folder_id(kRootId); ChangeListProcessor processor(metadata_.get(), nullptr); + FileError error = processor.ApplyUserChangeList(std::move(about_resource), + std::move(changes), + true /* is_delta_update */); + *changed_files = processor.changed_files(); + return error; + } + + // Applies the |changes| to |metadata_| as a delta update. Delta changelists + // should contain their changestamp in themselves. |team_drive_id| is the + // Team Drive's ID which is giving the change. + FileError ApplyTeamDriveChangeList( + const std::string& team_drive_id, + std::vector<std::unique_ptr<ChangeList>> changes, + FileChange* changed_files) { + ChangeListProcessor processor(metadata_.get(), nullptr); FileError error = - processor.Apply(std::move(about_resource), std::move(changes), - true /* is_delta_update */); + processor.ApplyTeamDriveChangeList(team_drive_id, std::move(changes)); *changed_files = processor.changed_files(); return error; } @@ -250,7 +267,7 @@ FileChange changed_files; EXPECT_EQ(FILE_ERROR_OK, - ApplyChangeList(std::move(change_lists), &changed_files)); + ApplyUserChangeList(std::move(change_lists), &changed_files)); int64_t changestamp = 0; EXPECT_EQ(FILE_ERROR_OK, metadata_->GetLargestChangestamp(&changestamp)); @@ -266,6 +283,88 @@ base::FilePath::FromUTF8Unsafe("drive/root/New Directory"))); } +TEST_F(ChangeListProcessorTest, DeltaFileAddedInNewDirectoryByTeamDriveChange) { + constexpr int64_t kBaseResourceListChangestampForTeamDrive = 12; + constexpr char kTeamDriveId[] = "theTeamDriveId"; + + std::vector<std::unique_ptr<ChangeList>> change_lists; + change_lists.push_back(base::MakeUnique<ChangeList>()); + + // Set up a Team Drive root directory. + ResourceEntry team_drive; + team_drive.set_title("My Team Drive"); + team_drive.set_resource_id(kTeamDriveId); + team_drive.set_parent_local_id(util::kDriveTeamDrivesDirLocalId); + team_drive.mutable_file_info()->set_is_directory(true); + + change_lists.push_back(base::MakeUnique<ChangeList>()); + change_lists[0]->mutable_entries()->push_back(team_drive); + change_lists[0]->set_largest_changestamp(kBaseResourceListChangestamp); + change_lists[0]->mutable_parent_resource_ids()->push_back(""); + + EXPECT_EQ(FILE_ERROR_OK, ApplyFullResourceList(CreateBaseChangeList())); + FileChange changed_files; + EXPECT_EQ(FILE_ERROR_OK, + ApplyUserChangeList(std::move(change_lists), &changed_files)); + std::unique_ptr<ResourceEntry> team_drive_root = + GetResourceEntry("drive/team_drives/My Team Drive"); + ASSERT_TRUE(team_drive_root); + EXPECT_FALSE(team_drive_root->local_id().empty()); + change_lists.clear(); + change_lists.push_back(base::MakeUnique<ChangeList>()); + + // Add files to the Team Drive directory. + ResourceEntry new_folder; + new_folder.set_resource_id("new_folder_resource_id"); + new_folder.set_title("New Directory"); + new_folder.mutable_file_info()->set_is_directory(true); + change_lists[0]->mutable_entries()->push_back(new_folder); + change_lists[0]->mutable_parent_resource_ids()->push_back(kTeamDriveId); + + ResourceEntry new_file; + new_file.set_resource_id("file_added_in_new_dir_id"); + new_file.set_title("File in new dir.txt"); + change_lists[0]->mutable_entries()->push_back(new_file); + change_lists[0]->mutable_parent_resource_ids()->push_back( + new_folder.resource_id()); + + change_lists[0]->set_largest_changestamp( + kBaseResourceListChangestampForTeamDrive); + + EXPECT_EQ(FILE_ERROR_OK, + ApplyTeamDriveChangeList(kTeamDriveId, std::move(change_lists), + &changed_files)); + + std::unique_ptr<ResourceEntry> result_team_drive_root = + GetResourceEntry("drive/team_drives/My Team Drive"); + EXPECT_EQ(kBaseResourceListChangestampForTeamDrive, + result_team_drive_root->directory_specific_info().changestamp()); + + // The "My Drive" root directory entry should be kept unchanged. + std::unique_ptr<ResourceEntry> result_drive_root = + GetResourceEntry("drive/root"); + EXPECT_EQ(kBaseResourceListChangestamp, + result_drive_root->directory_specific_info().changestamp()); + + // The largest changestamp in the header, which holds next change ID of the + // user's change list, should also be kept unchanged. Otherwise loading Team + // Drive's change list would break the syncing of the user's change. + int64_t changestamp = 0; + EXPECT_EQ(FILE_ERROR_OK, metadata_->GetLargestChangestamp(&changestamp)); + EXPECT_EQ(kBaseResourceListChangestamp, changestamp); + + EXPECT_TRUE( + GetResourceEntry("drive/team_drives/My Team Drive/New Directory")); + EXPECT_TRUE(GetResourceEntry( + "drive/team_drives/My Team Drive/New Directory/File in new dir.txt")); + + EXPECT_EQ(2U, changed_files.size()); + EXPECT_TRUE(changed_files.count(base::FilePath::FromUTF8Unsafe( + "drive/team_drives/My Team Drive/New Directory/File in new dir.txt"))); + EXPECT_TRUE(changed_files.count(base::FilePath::FromUTF8Unsafe( + "drive/team_drives/My Team Drive/New Directory"))); +} + TEST_F(ChangeListProcessorTest, DeltaDirMovedFromRootToDirectory) { std::vector<std::unique_ptr<ChangeList>> change_lists; change_lists.push_back(base::MakeUnique<ChangeList>()); @@ -285,7 +384,7 @@ FileChange changed_files; EXPECT_EQ(FILE_ERROR_OK, - ApplyChangeList(std::move(change_lists), &changed_files)); + ApplyUserChangeList(std::move(change_lists), &changed_files)); int64_t changestamp = 0; EXPECT_EQ(FILE_ERROR_OK, metadata_->GetLargestChangestamp(&changestamp)); @@ -321,7 +420,7 @@ EXPECT_EQ(FILE_ERROR_OK, ApplyFullResourceList(CreateBaseChangeList())); FileChange changed_files; EXPECT_EQ(FILE_ERROR_OK, - ApplyChangeList(std::move(change_lists), &changed_files)); + ApplyUserChangeList(std::move(change_lists), &changed_files)); int64_t changestamp = 0; EXPECT_EQ(FILE_ERROR_OK, metadata_->GetLargestChangestamp(&changestamp)); @@ -354,7 +453,7 @@ EXPECT_EQ(FILE_ERROR_OK, ApplyFullResourceList(CreateBaseChangeList())); FileChange changed_files; EXPECT_EQ(FILE_ERROR_OK, - ApplyChangeList(std::move(change_lists), &changed_files)); + ApplyUserChangeList(std::move(change_lists), &changed_files)); EXPECT_EQ(2U, changed_files.size()); EXPECT_TRUE(changed_files.count(base::FilePath::FromUTF8Unsafe( "drive/root/Directory 1/SubDirectory File 1.txt"))); @@ -393,7 +492,7 @@ EXPECT_EQ(FILE_ERROR_OK, ApplyFullResourceList(CreateBaseChangeList())); FileChange changed_files; EXPECT_EQ(FILE_ERROR_OK, - ApplyChangeList(std::move(change_lists), &changed_files)); + ApplyUserChangeList(std::move(change_lists), &changed_files)); int64_t changestamp = 0; EXPECT_EQ(FILE_ERROR_OK, metadata_->GetLargestChangestamp(&changestamp)); @@ -414,7 +513,7 @@ // Apply. EXPECT_EQ(FILE_ERROR_OK, - ApplyChangeList(std::move(change_lists), &changed_files)); + ApplyUserChangeList(std::move(change_lists), &changed_files)); EXPECT_EQ(FILE_ERROR_OK, metadata_->GetLargestChangestamp(&changestamp)); EXPECT_EQ(16687, changestamp); EXPECT_FALSE(GetResourceEntry("drive/root/Added file.txt")); @@ -442,7 +541,7 @@ EXPECT_EQ(FILE_ERROR_OK, ApplyFullResourceList(CreateBaseChangeList())); FileChange changed_files; EXPECT_EQ(FILE_ERROR_OK, - ApplyChangeList(std::move(change_lists), &changed_files)); + ApplyUserChangeList(std::move(change_lists), &changed_files)); int64_t changestamp = 0; EXPECT_EQ(FILE_ERROR_OK, metadata_->GetLargestChangestamp(&changestamp)); EXPECT_EQ(16730, changestamp); @@ -464,7 +563,7 @@ // Apply. EXPECT_EQ(FILE_ERROR_OK, - ApplyChangeList(std::move(change_lists), &changed_files)); + ApplyUserChangeList(std::move(change_lists), &changed_files)); EXPECT_EQ(FILE_ERROR_OK, metadata_->GetLargestChangestamp(&changestamp)); EXPECT_EQ(16770, changestamp); EXPECT_FALSE(GetResourceEntry("drive/root/Directory 1/Added file.txt")); @@ -504,7 +603,7 @@ EXPECT_EQ(FILE_ERROR_OK, ApplyFullResourceList(CreateBaseChangeList())); FileChange changed_files; EXPECT_EQ(FILE_ERROR_OK, - ApplyChangeList(std::move(change_lists), &changed_files)); + ApplyUserChangeList(std::move(change_lists), &changed_files)); int64_t changestamp = 0; EXPECT_EQ(FILE_ERROR_OK, metadata_->GetLargestChangestamp(&changestamp)); @@ -609,7 +708,7 @@ FileChange changed_files; EXPECT_EQ(FILE_ERROR_OK, - ApplyChangeList(std::move(change_lists), &changed_files)); + ApplyUserChangeList(std::move(change_lists), &changed_files)); // "new_file" should be added under drive/other. ResourceEntry entry; @@ -654,7 +753,7 @@ // Apply the change. FileChange changed_files; EXPECT_EQ(FILE_ERROR_OK, - ApplyChangeList(std::move(change_lists), &changed_files)); + ApplyUserChangeList(std::move(change_lists), &changed_files)); // The change is rejected due to the old modification date. ResourceEntry entry; @@ -683,7 +782,7 @@ FileChange changed_files; EXPECT_EQ(FILE_ERROR_OK, - ApplyChangeList(std::move(change_lists), &changed_files)); + ApplyUserChangeList(std::move(change_lists), &changed_files)); int64_t changestamp = 0; EXPECT_EQ(FILE_ERROR_OK, metadata_->GetLargestChangestamp(&changestamp)); @@ -707,7 +806,7 @@ change_lists[0]->set_largest_changestamp(kBaseResourceListChangestamp + 2); change_lists[0]->mutable_parent_resource_ids()->push_back(""); EXPECT_EQ(FILE_ERROR_OK, - ApplyChangeList(std::move(change_lists), &changed_files)); + ApplyUserChangeList(std::move(change_lists), &changed_files)); EXPECT_EQ( FILE_ERROR_OK, metadata_->GetResourceEntryByPath( @@ -722,7 +821,7 @@ change_lists[0]->mutable_parent_resource_ids()->push_back(""); change_lists[0]->mutable_entries()->push_back(team_drive); EXPECT_EQ(FILE_ERROR_OK, - ApplyChangeList(std::move(change_lists), &changed_files)); + ApplyUserChangeList(std::move(change_lists), &changed_files)); EXPECT_EQ( FILE_ERROR_NOT_FOUND, metadata_->GetResourceEntryByPath(
diff --git a/components/drive/chromeos/change_list_loader.cc b/components/drive/chromeos/change_list_loader.cc index 1229dda..1c5f3c76 100644 --- a/components/drive/chromeos/change_list_loader.cc +++ b/components/drive/chromeos/change_list_loader.cc
@@ -582,7 +582,7 @@ loader_controller_->ScheduleRun(base::Bind( &drive::util::RunAsyncTask, base::RetainedRef(blocking_task_runner_), FROM_HERE, - base::Bind(&ChangeListProcessor::Apply, + base::Bind(&ChangeListProcessor::ApplyUserChangeList, base::Unretained(change_list_processor), base::Passed(&about_resource), base::Passed(&change_lists), is_delta_update),
diff --git a/components/drive/chromeos/change_list_processor.cc b/components/drive/chromeos/change_list_processor.cc index 2806636..c99934f 100644 --- a/components/drive/chromeos/change_list_processor.cc +++ b/components/drive/chromeos/change_list_processor.cc
@@ -130,7 +130,7 @@ ChangeListProcessor::~ChangeListProcessor() { } -FileError ChangeListProcessor::Apply( +FileError ChangeListProcessor::ApplyUserChangeList( std::unique_ptr<google_apis::AboutResource> about_resource, std::vector<std::unique_ptr<ChangeList>> change_lists, bool is_delta_update) { @@ -151,18 +151,28 @@ DCHECK(!about_resource->root_folder_id().empty()); } - ChangeListToEntryMapUMAStats uma_stats; - ConvertChangeListsToMap(std::move(change_lists), largest_changestamp, - &uma_stats); - - FileError error = - ApplyEntryMap(largest_changestamp, std::move(about_resource)); + ResourceEntry root; + // Update the resource ID of the entry for "My Drive" directory. + FileError error = resource_metadata_->GetResourceEntryByPath( + util::GetDriveMyDriveRootPath(), &root); if (error != FILE_ERROR_OK) { - DLOG(ERROR) << "ApplyEntryMap failed: " << FileErrorToString(error); + LOG(ERROR) << "Failed to get root entry: " << FileErrorToString(error); + return error; + } + root.set_resource_id(about_resource->root_folder_id()); + error = resource_metadata_->RefreshEntry(root); + if (error != FILE_ERROR_OK) { + LOG(ERROR) << "Failed to update root entry: " << FileErrorToString(error); return error; } - // Update changestamp. + ChangeListToEntryMapUMAStats uma_stats; + error = ApplyChangeListInternal(std::move(change_lists), largest_changestamp, + &root, &uma_stats); + if (error != FILE_ERROR_OK) + return error; + + // Update changestamp in the metadata header. error = resource_metadata_->SetLargestChangestamp(largest_changestamp); if (error != FILE_ERROR_OK) { DLOG(ERROR) << "SetLargestChangeStamp failed: " << FileErrorToString(error); @@ -176,6 +186,63 @@ return FILE_ERROR_OK; } +FileError ChangeListProcessor::ApplyTeamDriveChangeList( + const std::string& team_drive_id, + std::vector<std::unique_ptr<ChangeList>> change_lists) { + DCHECK(!change_lists.empty()); + int64_t largest_changestamp = 0; + // The changestamp appears in the first page of the change list. + // The changestamp does not appear in the full resource list. + largest_changestamp = change_lists[0]->largest_changestamp(); + if (change_lists[0]->largest_changestamp() < 0) { + LOG(ERROR) << "Received changeList with invalid largestChangestamp: " + << largest_changestamp << " (team_drive_id=" << team_drive_id + << "). Ignored."; + return FILE_ERROR_FAILED; + } + + std::string local_id; + FileError error = + resource_metadata_->GetIdByResourceId(team_drive_id, &local_id); + if (error != FILE_ERROR_OK) { + LOG(ERROR) << "Failed to get local ID of a Team Drive root entry: " + << FileErrorToString(error); + return error; + } + ResourceEntry root; + error = resource_metadata_->GetResourceEntryById(local_id, &root); + if (error != FILE_ERROR_OK) { + LOG(ERROR) << "Failed to get Team Drive root entry: " + << FileErrorToString(error); + return error; + } + + ChangeListToEntryMapUMAStats uma_stats; + error = ApplyChangeListInternal(std::move(change_lists), largest_changestamp, + &root, &uma_stats); + return error; +} + +FileError ChangeListProcessor::ApplyChangeListInternal( + std::vector<std::unique_ptr<ChangeList>> change_lists, + int64_t largest_changestamp, + ResourceEntry* root, + ChangeListToEntryMapUMAStats* uma_stats) { + ConvertChangeListsToMap(std::move(change_lists), largest_changestamp, + uma_stats); + FileError error = ApplyEntryMap(root->resource_id()); + if (error != FILE_ERROR_OK) { + DLOG(ERROR) << "ApplyEntryMap failed: " << FileErrorToString(error); + return error; + } + // Update changestamp of the root entry. + root->mutable_directory_specific_info()->set_changestamp(largest_changestamp); + error = resource_metadata_->RefreshEntry(*root); + if (error != FILE_ERROR_OK) + DLOG(ERROR) << "RefreshEntry failed: " << FileErrorToString(error); + return error; +} + void ChangeListProcessor::ConvertChangeListsToMap( std::vector<std::unique_ptr<ChangeList>> change_lists, int64_t largest_changestamp, @@ -211,27 +278,7 @@ } FileError ChangeListProcessor::ApplyEntryMap( - int64_t changestamp, - std::unique_ptr<google_apis::AboutResource> about_resource) { - DCHECK(about_resource); - - // Create the entry for "My Drive" directory with the latest changestamp. - ResourceEntry root; - FileError error = resource_metadata_->GetResourceEntryByPath( - util::GetDriveMyDriveRootPath(), &root); - if (error != FILE_ERROR_OK) { - LOG(ERROR) << "Failed to get root entry: " << FileErrorToString(error); - return error; - } - - root.mutable_directory_specific_info()->set_changestamp(changestamp); - root.set_resource_id(about_resource->root_folder_id()); - error = resource_metadata_->RefreshEntry(root); - if (error != FILE_ERROR_OK) { - LOG(ERROR) << "Failed to update root entry: " << FileErrorToString(error); - return error; - } - + const std::string& root_resource_id) { // Gather the set of changes in the old path. // Note that we want to notify the change in both old and new paths (suppose // /a/b/c is moved to /x/y/c. We want to notify both "/a/b" and "/x/y".) @@ -323,7 +370,7 @@ // Skip root entry in the change list. We don't expect servers to send // root entry, but we should better be defensive (see crbug.com/297259). ResourceEntryMap::iterator it = entries[i]; - if (it->first != root.resource_id()) { + if (it->first != root_resource_id) { FileError error = ApplyEntry(it->second); if (error != FILE_ERROR_OK) { LOG(ERROR) << "ApplyEntry failed: " << FileErrorToString(error)
diff --git a/components/drive/chromeos/change_list_processor.h b/components/drive/chromeos/change_list_processor.h index d60c723..2bb6cba 100644 --- a/components/drive/chromeos/change_list_processor.h +++ b/components/drive/chromeos/change_list_processor.h
@@ -114,15 +114,28 @@ base::CancellationFlag* in_shutdown); ~ChangeListProcessor(); - // Applies change lists or full resource lists to |resource_metadata_|. + // Applies user's change lists or full resource lists to + // |resource_metadata_|. // // |is_delta_update| determines the type of input data to process, whether // it is full resource lists (false) or change lists (true). // // Must be run on the same task runner as |resource_metadata_| uses. - FileError Apply(std::unique_ptr<google_apis::AboutResource> about_resource, - std::vector<std::unique_ptr<ChangeList>> change_lists, - bool is_delta_update); + FileError ApplyUserChangeList( + std::unique_ptr<google_apis::AboutResource> about_resource, + std::vector<std::unique_ptr<ChangeList>> change_lists, + bool is_delta_update); + + // Applies Team Drive's change lists to |resource_metadata_|. + // + // |change_lists| must not be an empty list, although it can consist of a + // single ChangeList object whose |items_| is emtpy. + // |team_drive_id| is the Team Drive's ID which gave the change lists. + // + // Must be run on the same task runner as |resource_metadata_| uses. + FileError ApplyTeamDriveChangeList( + const std::string& team_drive_id, + std::vector<std::unique_ptr<ChangeList>> change_lists); // The set of changed files as a result of change list processing. const FileChange& changed_files() const { return *changed_files_; } @@ -148,6 +161,14 @@ typedef std::map<std::string /* resource_id */, std::string /* parent_resource_id*/> ParentResourceIdMap; + // Common logic between ApplyTeamDriveChangeList and ApplyUserChangeList. + // Applies the |change_lists| to |resource_metadta_|. + FileError ApplyChangeListInternal( + std::vector<std::unique_ptr<ChangeList>> change_lists, + int64_t largest_changestamp, + ResourceEntry* root, + ChangeListToEntryMapUMAStats* uma_stats); + // Converts the |change_lists| to |entry_map_| and |parent_resource_id_map_|, // to be applied by ApplyEntryMap() later. void ConvertChangeListsToMap( @@ -156,10 +177,8 @@ ChangeListToEntryMapUMAStats* uma_stats); // Applies the pre-processed metadata from entry_map_ onto the resource - // metadata. |about_resource| must not be null. - FileError ApplyEntryMap( - int64_t changestamp, - std::unique_ptr<google_apis::AboutResource> about_resource); + // metadata. + FileError ApplyEntryMap(const std::string& root_resource_id); // Apply |entry| to resource_metadata_. FileError ApplyEntry(const ResourceEntry& entry); @@ -167,6 +186,10 @@ // Adds the directories changed by the update on |entry| to |changed_dirs_|. void UpdateChangedDirs(const ResourceEntry& entry); + // Sets the largest changestamp of a Team Drive's change list. + FileError SetTeamDriveLargestChangestamp(const std::string& team_drive_id, + int64_t value); + ResourceMetadata* resource_metadata_; // Not owned. base::CancellationFlag* in_shutdown_; // Not owned.
diff --git a/components/drive/chromeos/file_system.cc b/components/drive/chromeos/file_system.cc index 955c950..5d6d756 100644 --- a/components/drive/chromeos/file_system.cc +++ b/components/drive/chromeos/file_system.cc
@@ -288,7 +288,6 @@ JobScheduler* scheduler, internal::ResourceMetadata* resource_metadata, base::SequencedTaskRunner* blocking_task_runner, - base::SingleThreadTaskRunner* file_task_runner, const base::FilePath& temporary_file_directory) : pref_service_(pref_service), logger_(logger), @@ -297,7 +296,6 @@ resource_metadata_(resource_metadata), last_update_check_error_(FILE_ERROR_OK), blocking_task_runner_(blocking_task_runner), - file_task_runner_(file_task_runner), temporary_file_directory_(temporary_file_directory), weak_ptr_factory_(this) { ResetComponents(); @@ -404,9 +402,8 @@ loader_controller_.get())); get_file_for_saving_operation_.reset( new file_system::GetFileForSavingOperation( - logger_, blocking_task_runner_.get(), file_task_runner_.get(), - delegate, scheduler_, resource_metadata_, cache_, - temporary_file_directory_)); + logger_, blocking_task_runner_.get(), delegate, scheduler_, + resource_metadata_, cache_, temporary_file_directory_)); set_property_operation_.reset(new file_system::SetPropertyOperation( blocking_task_runner_.get(), delegate, resource_metadata_)); }
diff --git a/components/drive/chromeos/file_system.h b/components/drive/chromeos/file_system.h index a679f88..8cd78612 100644 --- a/components/drive/chromeos/file_system.h +++ b/components/drive/chromeos/file_system.h
@@ -25,7 +25,6 @@ namespace base { class SequencedTaskRunner; -class SingleThreadTaskRunner; } // namespace base namespace google_apis { @@ -75,7 +74,6 @@ JobScheduler* scheduler, internal::ResourceMetadata* resource_metadata, base::SequencedTaskRunner* blocking_task_runner, - base::SingleThreadTaskRunner* file_task_runner, const base::FilePath& temporary_file_directory); ~FileSystem() override; @@ -282,7 +280,6 @@ base::ObserverList<FileSystemObserver> observers_; scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; - scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; base::FilePath temporary_file_directory_;
diff --git a/components/drive/chromeos/file_system/get_file_for_saving_operation.cc b/components/drive/chromeos/file_system/get_file_for_saving_operation.cc index 34c2e5b..47577026 100644 --- a/components/drive/chromeos/file_system/get_file_for_saving_operation.cc +++ b/components/drive/chromeos/file_system/get_file_for_saving_operation.cc
@@ -40,7 +40,6 @@ GetFileForSavingOperation::GetFileForSavingOperation( EventLogger* logger, base::SequencedTaskRunner* blocking_task_runner, - base::SingleThreadTaskRunner* file_task_runner, OperationDelegate* delegate, JobScheduler* scheduler, internal::ResourceMetadata* metadata, @@ -55,13 +54,12 @@ metadata, cache, temporary_file_directory)), - file_write_watcher_(new internal::FileWriteWatcher(file_task_runner)), + file_write_watcher_(new internal::FileWriteWatcher(blocking_task_runner)), blocking_task_runner_(blocking_task_runner), delegate_(delegate), metadata_(metadata), cache_(cache), - weak_ptr_factory_(this) { -} + weak_ptr_factory_(this) {} GetFileForSavingOperation::~GetFileForSavingOperation() { }
diff --git a/components/drive/chromeos/file_system/get_file_for_saving_operation.h b/components/drive/chromeos/file_system/get_file_for_saving_operation.h index dd2138c..e7548014 100644 --- a/components/drive/chromeos/file_system/get_file_for_saving_operation.h +++ b/components/drive/chromeos/file_system/get_file_for_saving_operation.h
@@ -18,7 +18,6 @@ class FilePath; class ScopedClosureRunner; class SequencedTaskRunner; -class SingleThreadTaskRunner; } // namespace base namespace drive { @@ -47,7 +46,6 @@ public: GetFileForSavingOperation(EventLogger* logger, base::SequencedTaskRunner* blocking_task_runner, - base::SingleThreadTaskRunner* file_task_runner, OperationDelegate* delegate, JobScheduler* scheduler, internal::ResourceMetadata* metadata,
diff --git a/components/drive/file_system/get_file_for_saving_operation_unittest.cc b/components/drive/file_system/get_file_for_saving_operation_unittest.cc index 7fa3e8c..c8de261 100644 --- a/components/drive/file_system/get_file_for_saving_operation_unittest.cc +++ b/components/drive/file_system/get_file_for_saving_operation_unittest.cc
@@ -19,7 +19,6 @@ #include "components/drive/file_system/operation_test_base.h" #include "components/drive/file_write_watcher.h" #include "components/drive/job_scheduler.h" -#include "content/public/browser/browser_thread.h" #include "content/public/test/test_utils.h" #include "google_apis/drive/test_util.h" #include "testing/gtest/include/gtest/gtest.h" @@ -66,18 +65,14 @@ void SetUp() override { OperationTestBase::SetUp(); - file_task_runner_ = content::BrowserThread::GetTaskRunnerForThread( - content::BrowserThread::FILE); - operation_.reset(new GetFileForSavingOperation( - logger(), blocking_task_runner(), file_task_runner_.get(), &delegate_, - scheduler(), metadata(), cache(), temp_dir())); + logger(), blocking_task_runner(), &delegate_, scheduler(), metadata(), + cache(), temp_dir())); operation_->file_write_watcher_for_testing()->DisableDelayForTesting(); } TestDelegate delegate_; std::unique_ptr<GetFileForSavingOperation> operation_; - scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; }; TEST_F(GetFileForSavingOperationTest, GetFileForSaving_Exist) {
diff --git a/components/drive/file_system_unittest.cc b/components/drive/file_system_unittest.cc index 395be83..643715d 100644 --- a/components/drive/file_system_unittest.cc +++ b/components/drive/file_system_unittest.cc
@@ -33,7 +33,6 @@ #include "components/drive/service/fake_drive_service.h" #include "components/drive/service/test_util.h" #include "components/prefs/testing_pref_service.h" -#include "content/public/browser/browser_thread.h" #include "content/public/test/test_browser_thread_bundle.h" #include "google_apis/drive/drive_api_parser.h" #include "google_apis/drive/test_util.h" @@ -146,12 +145,10 @@ const base::FilePath temp_file_dir = temp_dir_.GetPath().AppendASCII("tmp"); ASSERT_TRUE(base::CreateDirectory(temp_file_dir)); - file_task_runner_ = content::BrowserThread::GetTaskRunnerForThread( - content::BrowserThread::FILE); file_system_.reset(new FileSystem( pref_service_.get(), logger_.get(), cache_.get(), scheduler_.get(), resource_metadata_.get(), base::ThreadTaskRunnerHandle::Get().get(), - file_task_runner_.get(), temp_file_dir)); + temp_file_dir)); file_system_->AddObserver(mock_directory_observer_.get()); // Disable delaying so that the sync starts immediately. @@ -331,7 +328,6 @@ std::unique_ptr<internal::FileCache, test_util::DestroyHelperForTests> cache_; std::unique_ptr<internal::ResourceMetadata, test_util::DestroyHelperForTests> resource_metadata_; - scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; std::unique_ptr<FileSystem> file_system_; };
diff --git a/components/drive/file_write_watcher.cc b/components/drive/file_write_watcher.cc index 9c813298f..a4828af 100644 --- a/components/drive/file_write_watcher.cc +++ b/components/drive/file_write_watcher.cc
@@ -16,7 +16,7 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" -#include "base/single_thread_task_runner.h" +#include "base/sequenced_task_runner.h" #include "base/timer/timer.h" #include "google_apis/drive/task_util.h" @@ -32,13 +32,14 @@ // UI thread and FILE thread, and does all the main tasks in the FILE thread. class FileWriteWatcher::FileWriteWatcherImpl { public: - explicit FileWriteWatcherImpl(base::SingleThreadTaskRunner* file_task_runner); + explicit FileWriteWatcherImpl( + base::SequencedTaskRunner* blocking_task_runner); - // Forwards the call to DestoryOnFileThread(). This method must be used to - // destruct the instance. + // Forwards the call to DestoryOnBlockingThread(). This method must be used + // to destruct the instance. void Destroy(); - // Forwards the call to StartWatchOnFileThread(). |on_start_callback| is + // Forwards the call to StartWatchOnBlockingThread(). |on_start_callback| is // called back on the caller (UI) thread when the watch has started. // |on_write_callback| is called when a write has happened to the path. void StartWatch(const base::FilePath& path, @@ -50,11 +51,11 @@ private: ~FileWriteWatcherImpl(); - void DestroyOnFileThread(); + void DestroyOnBlockingThread(); - void StartWatchOnFileThread(const base::FilePath& path, - const StartWatchCallback& on_start_callback, - const base::Closure& on_write_callback); + void StartWatchOnBlockingThread(const base::FilePath& path, + const StartWatchCallback& on_start_callback, + const base::Closure& on_write_callback); void OnWriteEvent(const base::FilePath& path, bool error); @@ -73,7 +74,7 @@ base::TimeDelta delay_; std::map<base::FilePath, std::unique_ptr<PathWatchInfo>> watchers_; - scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; + scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; base::ThreadChecker thread_checker_; @@ -84,18 +85,17 @@ }; FileWriteWatcher::FileWriteWatcherImpl::FileWriteWatcherImpl( - base::SingleThreadTaskRunner* file_task_runner) + base::SequencedTaskRunner* blocking_task_runner) : delay_(base::TimeDelta::FromSeconds(kWriteEventDelayInSeconds)), - file_task_runner_(file_task_runner), - weak_ptr_factory_(this) { -} + blocking_task_runner_(blocking_task_runner), + weak_ptr_factory_(this) {} void FileWriteWatcher::FileWriteWatcherImpl::Destroy() { DCHECK(thread_checker_.CalledOnValidThread()); // Just forwarding the call to FILE thread. - file_task_runner_->PostTask( - FROM_HERE, base::Bind(&FileWriteWatcherImpl::DestroyOnFileThread, + blocking_task_runner_->PostTask( + FROM_HERE, base::Bind(&FileWriteWatcherImpl::DestroyOnBlockingThread, base::Unretained(this))); } @@ -106,30 +106,25 @@ DCHECK(thread_checker_.CalledOnValidThread()); // Forwarding the call to FILE thread and relaying the |callback|. - file_task_runner_->PostTask( + blocking_task_runner_->PostTask( FROM_HERE, - base::Bind(&FileWriteWatcherImpl::StartWatchOnFileThread, + base::Bind(&FileWriteWatcherImpl::StartWatchOnBlockingThread, base::Unretained(this), path, google_apis::CreateRelayCallback(on_start_callback), google_apis::CreateRelayCallback(on_write_callback))); } FileWriteWatcher::FileWriteWatcherImpl::~FileWriteWatcherImpl() { - DCHECK(file_task_runner_->BelongsToCurrentThread()); } -void FileWriteWatcher::FileWriteWatcherImpl::DestroyOnFileThread() { - DCHECK(file_task_runner_->BelongsToCurrentThread()); - +void FileWriteWatcher::FileWriteWatcherImpl::DestroyOnBlockingThread() { delete this; } -void FileWriteWatcher::FileWriteWatcherImpl::StartWatchOnFileThread( +void FileWriteWatcher::FileWriteWatcherImpl::StartWatchOnBlockingThread( const base::FilePath& path, const StartWatchCallback& on_start_callback, const base::Closure& on_write_callback) { - DCHECK(file_task_runner_->BelongsToCurrentThread()); - auto it = watchers_.find(path); if (it != watchers_.end()) { // We are already watching the path. @@ -153,8 +148,6 @@ void FileWriteWatcher::FileWriteWatcherImpl::OnWriteEvent( const base::FilePath& path, bool error) { - DCHECK(file_task_runner_->BelongsToCurrentThread()); - if (error) return; @@ -174,8 +167,6 @@ void FileWriteWatcher::FileWriteWatcherImpl::InvokeCallback( const base::FilePath& path) { - DCHECK(file_task_runner_->BelongsToCurrentThread()); - auto it = watchers_.find(path); DCHECK(it != watchers_.end()); @@ -188,9 +179,8 @@ } FileWriteWatcher::FileWriteWatcher( - base::SingleThreadTaskRunner* file_task_runner) - : watcher_impl_(new FileWriteWatcherImpl(file_task_runner)) { -} + base::SequencedTaskRunner* blocking_task_runner) + : watcher_impl_(new FileWriteWatcherImpl(blocking_task_runner)) {} FileWriteWatcher::~FileWriteWatcher() { DCHECK(thread_checker_.CalledOnValidThread());
diff --git a/components/drive/file_write_watcher.h b/components/drive/file_write_watcher.h index 276d3af..1b3a5c7 100644 --- a/components/drive/file_write_watcher.h +++ b/components/drive/file_write_watcher.h
@@ -14,7 +14,7 @@ namespace base { class FilePath; -class SingleThreadTaskRunner; +class SequencedTaskRunner; } // namespace base namespace drive { @@ -29,7 +29,7 @@ // without any special handling about Drive. class FileWriteWatcher { public: - explicit FileWriteWatcher(base::SingleThreadTaskRunner* file_task_runner); + explicit FileWriteWatcher(base::SequencedTaskRunner* blocking_task_runner); ~FileWriteWatcher(); // Starts watching the modification to |path|. When it successfully started
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc index 565afe4..c9be39b 100644 --- a/components/exo/shell_surface.cc +++ b/components/exo/shell_surface.cc
@@ -1118,6 +1118,50 @@ } } +void ShellSurface::OnGestureEvent(ui::GestureEvent* event) { + if (!resizer_) { + views::View::OnGestureEvent(event); + return; + } + + if (event->handled()) + return; + + // TODO(domlaskowski): Handle touch dragging/resizing for BoundsMode::SHELL. + // See crbug.com/738606. + switch (event->type()) { + case ui::ET_GESTURE_END: { + ScopedConfigure scoped_configure(this, false); + EndDrag(false /* revert */); + break; + } + case ui::ET_GESTURE_SCROLL_BEGIN: + case ui::ET_GESTURE_SCROLL_END: + case ui::ET_GESTURE_SCROLL_UPDATE: + case ui::ET_GESTURE_TAP: + case ui::ET_GESTURE_TAP_DOWN: + case ui::ET_GESTURE_TAP_CANCEL: + case ui::ET_GESTURE_TAP_UNCONFIRMED: + case ui::ET_GESTURE_DOUBLE_TAP: + case ui::ET_GESTURE_BEGIN: + case ui::ET_GESTURE_TWO_FINGER_TAP: + case ui::ET_GESTURE_PINCH_BEGIN: + case ui::ET_GESTURE_PINCH_END: + case ui::ET_GESTURE_PINCH_UPDATE: + case ui::ET_GESTURE_LONG_PRESS: + case ui::ET_GESTURE_LONG_TAP: + case ui::ET_GESTURE_SWIPE: + case ui::ET_GESTURE_SHOW_PRESS: + case ui::ET_SCROLL: + case ui::ET_SCROLL_FLING_START: + case ui::ET_SCROLL_FLING_CANCEL: + break; + default: + NOTREACHED(); + break; + } +} + //////////////////////////////////////////////////////////////////////////////// // ui::AcceleratorTarget overrides:
diff --git a/components/exo/shell_surface.h b/components/exo/shell_surface.h index 8f570c7e..ab05c116 100644 --- a/components/exo/shell_surface.h +++ b/components/exo/shell_surface.h
@@ -271,6 +271,7 @@ // Overridden from ui::EventHandler: void OnKeyEvent(ui::KeyEvent* event) override; void OnMouseEvent(ui::MouseEvent* event) override; + void OnGestureEvent(ui::GestureEvent* event) override; // Overridden from ui::AcceleratorTarget: bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
diff --git a/components/exo/wayland/BUILD.gn b/components/exo/wayland/BUILD.gn index 4a851040..55aae92 100644 --- a/components/exo/wayland/BUILD.gn +++ b/components/exo/wayland/BUILD.gn
@@ -58,7 +58,10 @@ ] if (use_ozone) { - deps += [ "//third_party/wayland-protocols:linux_dmabuf_protocol" ] + deps += [ + "//third_party/mesa:wayland_drm_protocol", + "//third_party/wayland-protocols:linux_dmabuf_protocol", + ] configs += [ ":libdrm" ] if (is_chromeos) {
diff --git a/components/exo/wayland/server.cc b/components/exo/wayland/server.cc index cbc0be7..d477e07c 100644 --- a/components/exo/wayland/server.cc +++ b/components/exo/wayland/server.cc
@@ -84,6 +84,7 @@ #if defined(USE_OZONE) #include <drm_fourcc.h> #include <linux-dmabuf-unstable-v1-server-protocol.h> +#include <wayland-drm-server-protocol.h> #if defined(OS_CHROMEOS) #include "ui/base/ime/chromeos/ime_keyboard.h" #include "ui/base/ime/chromeos/input_method_manager.h" @@ -481,6 +482,128 @@ #if defined(USE_OZONE) //////////////////////////////////////////////////////////////////////////////// +// wl_drm_interface: + +const struct drm_supported_format { + uint32_t drm_format; + gfx::BufferFormat buffer_format; +} drm_supported_formats[] = { + {WL_DRM_FORMAT_RGB565, gfx::BufferFormat::BGR_565}, + {WL_DRM_FORMAT_XBGR8888, gfx::BufferFormat::RGBX_8888}, + {WL_DRM_FORMAT_ABGR8888, gfx::BufferFormat::RGBA_8888}, + {WL_DRM_FORMAT_XRGB8888, gfx::BufferFormat::BGRX_8888}, + {WL_DRM_FORMAT_ARGB8888, gfx::BufferFormat::BGRA_8888}, + {WL_DRM_FORMAT_NV12, gfx::BufferFormat::YUV_420_BIPLANAR}, + {WL_DRM_FORMAT_YVU420, gfx::BufferFormat::YVU_420}}; + +void drm_authenticate(wl_client* client, wl_resource* resource, uint32_t id) { + wl_drm_send_authenticated(resource); +} + +void drm_create_buffer(wl_client* client, + wl_resource* resource, + uint32_t id, + uint32_t name, + int32_t width, + int32_t height, + uint32_t stride, + uint32_t format) { + wl_resource_post_error(resource, WL_DRM_ERROR_INVALID_NAME, + "GEM names are not supported"); +} + +void drm_create_planar_buffer(wl_client* client, + wl_resource* resource, + uint32_t id, + uint32_t name, + int32_t width, + int32_t height, + uint32_t format, + int32_t offset0, + int32_t stride0, + int32_t offset1, + int32_t stride1, + int32_t offset2, + int32_t stride3) { + wl_resource_post_error(resource, WL_DRM_ERROR_INVALID_NAME, + "GEM names are not supported"); +} + +void drm_create_prime_buffer(wl_client* client, + wl_resource* resource, + uint32_t id, + int32_t name, + int32_t width, + int32_t height, + uint32_t format, + int32_t offset0, + int32_t stride0, + int32_t offset1, + int32_t stride1, + int32_t offset2, + int32_t stride2) { + const auto* supported_format = + std::find_if(drm_supported_formats, + drm_supported_formats + arraysize(drm_supported_formats), + [format](const drm_supported_format& supported_format) { + return supported_format.drm_format == format; + }); + if (supported_format == + (drm_supported_formats + arraysize(drm_supported_formats))) { + wl_resource_post_error(resource, WL_DRM_ERROR_INVALID_FORMAT, + "invalid format 0x%x", format); + return; + } + + std::vector<gfx::NativePixmapPlane> planes; + planes.emplace_back(stride0, offset0, 0, 0); + planes.emplace_back(stride1, offset1, 0, 0); + planes.emplace_back(stride2, offset2, 0, 0); + std::vector<base::ScopedFD> fds; + + size_t num_planes = + gfx::NumberOfPlanesForBufferFormat(supported_format->buffer_format); + planes.resize(num_planes); + fds.push_back(base::ScopedFD(name)); + + std::unique_ptr<Buffer> buffer = + GetUserDataAs<Display>(resource)->CreateLinuxDMABufBuffer( + gfx::Size(width, height), supported_format->buffer_format, planes, + std::move(fds)); + if (!buffer) { + wl_resource_post_no_memory(resource); + return; + } + + wl_resource* buffer_resource = + wl_resource_create(client, &wl_buffer_interface, 1, id); + + buffer->set_release_callback(base::Bind(&HandleBufferReleaseCallback, + base::Unretained(buffer_resource))); + + SetImplementation(buffer_resource, &buffer_implementation, std::move(buffer)); +} + +const struct wl_drm_interface drm_implementation = { + drm_authenticate, drm_create_buffer, drm_create_planar_buffer, + drm_create_prime_buffer}; + +const uint32_t drm_version = 2; + +void bind_drm(wl_client* client, void* data, uint32_t version, uint32_t id) { + wl_resource* resource = wl_resource_create( + client, &wl_drm_interface, std::min(version, drm_version), id); + + wl_resource_set_implementation(resource, &drm_implementation, data, nullptr); + + if (version >= 2) + wl_drm_send_capabilities(resource, WL_DRM_CAPABILITY_PRIME); + + for (const auto& supported_format : drm_supported_formats) + wl_drm_send_format(resource, supported_format.drm_format); +} + +//////////////////////////////////////////////////////////////////////////////// // linux_buffer_params_interface: const struct dmabuf_supported_format { @@ -3971,6 +4094,8 @@ compositor_version, display_, bind_compositor); wl_global_create(wl_display_.get(), &wl_shm_interface, 1, display_, bind_shm); #if defined(USE_OZONE) + wl_global_create(wl_display_.get(), &wl_drm_interface, drm_version, display_, + bind_drm); wl_global_create(wl_display_.get(), &zwp_linux_dmabuf_v1_interface, 2, display_, bind_linux_dmabuf); #endif
diff --git a/components/flags_ui/resources/flags.html b/components/flags_ui/resources/flags.html index c58d11f..5e2edd9a 100644 --- a/components/flags_ui/resources/flags.html +++ b/components/flags_ui/resources/flags.html
@@ -15,7 +15,6 @@ <script src="chrome://resources/js/util.js"></script> <script src="chrome://flags/flags.js"></script> -<script src="chrome://flags/strings.js"></script> </head> <body> <div id="body-container" style="visibility:hidden">
diff --git a/components/metrics/drive_metrics_provider.cc b/components/metrics/drive_metrics_provider.cc index 22ad089..b067337 100644 --- a/components/metrics/drive_metrics_provider.cc +++ b/components/metrics/drive_metrics_provider.cc
@@ -12,17 +12,15 @@ #include "base/logging.h" #include "base/metrics/histogram_macros.h" #include "base/path_service.h" -#include "base/task_runner_util.h" +#include "base/task_scheduler/post_task.h" +#include "base/task_scheduler/task_traits.h" +#include "base/threading/thread_restrictions.h" #include "base/time/time.h" namespace metrics { -DriveMetricsProvider::DriveMetricsProvider( - scoped_refptr<base::SequencedTaskRunner> file_thread, - int local_state_path_key) - : file_thread_(file_thread), - local_state_path_key_(local_state_path_key), - weak_ptr_factory_(this) {} +DriveMetricsProvider::DriveMetricsProvider(int local_state_path_key) + : local_state_path_key_(local_state_path_key), weak_ptr_factory_(this) {} DriveMetricsProvider::~DriveMetricsProvider() {} @@ -35,9 +33,11 @@ } void DriveMetricsProvider::GetDriveMetrics(const base::Closure& done_callback) { - base::PostTaskAndReplyWithResult( - file_thread_.get(), FROM_HERE, - base::Bind(&DriveMetricsProvider::GetDriveMetricsOnFileThread, + base::PostTaskWithTraitsAndReplyWithResult( + FROM_HERE, + {base::MayBlock(), base::TaskPriority::BACKGROUND, + base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, + base::Bind(&DriveMetricsProvider::GetDriveMetricsOnBackgroundThread, local_state_path_key_), base::Bind(&DriveMetricsProvider::GotDriveMetrics, weak_ptr_factory_.GetWeakPtr(), done_callback)); @@ -48,7 +48,10 @@ // static DriveMetricsProvider::DriveMetrics -DriveMetricsProvider::GetDriveMetricsOnFileThread(int local_state_path_key) { +DriveMetricsProvider::GetDriveMetricsOnBackgroundThread( + int local_state_path_key) { + base::ThreadRestrictions::AssertIOAllowed(); + DriveMetricsProvider::DriveMetrics metrics; QuerySeekPenalty(base::FILE_EXE, &metrics.app_drive); QuerySeekPenalty(local_state_path_key, &metrics.user_data_drive); @@ -82,7 +85,7 @@ void DriveMetricsProvider::GotDriveMetrics( const base::Closure& done_callback, const DriveMetricsProvider::DriveMetrics& metrics) { - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); metrics_ = metrics; done_callback.Run(); }
diff --git a/components/metrics/drive_metrics_provider.h b/components/metrics/drive_metrics_provider.h index cab799d..280b0ae 100644 --- a/components/metrics/drive_metrics_provider.h +++ b/components/metrics/drive_metrics_provider.h
@@ -10,8 +10,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" -#include "base/sequenced_task_runner.h" -#include "base/threading/thread_checker.h" +#include "base/sequence_checker.h" #include "components/metrics/metrics_provider.h" #include "components/metrics/proto/system_profile.pb.h" @@ -23,13 +22,9 @@ // Provides metrics about the local drives on a user's computer. Currently only // checks to see if they incur a seek-time penalty (e.g. if they're SSDs). -// -// Defers gathering metrics until after "rush hour" (startup) so as to not bog -// down the file thread. class DriveMetricsProvider : public metrics::MetricsProvider { public: - DriveMetricsProvider(scoped_refptr<base::SequencedTaskRunner> file_thread, - int local_state_path_key); + explicit DriveMetricsProvider(int local_state_path_key); ~DriveMetricsProvider() override; // metrics::MetricsDataProvider: @@ -60,15 +55,16 @@ static bool HasSeekPenalty(const base::FilePath& path, bool* has_seek_penalty); - // Gather metrics about various drives on |file_thread_|. - static DriveMetrics GetDriveMetricsOnFileThread(int local_state_path_key); + // Gather metrics about various drives. Should be run on a background thread. + static DriveMetrics GetDriveMetricsOnBackgroundThread( + int local_state_path_key); // Tries to determine whether there is a penalty for seeking on the drive that // hosts |path_service_key| (for example: the drive that holds "Local State"). static void QuerySeekPenalty(int path_service_key, SeekPenaltyResponse* response); - // Called when metrics are done being gathered from the FILE thread. + // Called when metrics are done being gathered asynchronously. // |done_callback| is the callback that should be called once all metrics are // gathered. void GotDriveMetrics(const base::Closure& done_callback, @@ -78,10 +74,6 @@ void FillDriveMetrics(const SeekPenaltyResponse& response, metrics::SystemProfileProto::Hardware::Drive* drive); - // The thread on which file operations are performed (supplied by the - // embedder). - scoped_refptr<base::SequencedTaskRunner> file_thread_; - // The key to give to base::PathService to obtain the path to local state // (supplied by the embedder). int local_state_path_key_; @@ -89,7 +81,7 @@ // Information gathered about various important drives. DriveMetrics metrics_; - base::ThreadChecker thread_checker_; + SEQUENCE_CHECKER(sequence_checker_); base::WeakPtrFactory<DriveMetricsProvider> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(DriveMetricsProvider);
diff --git a/components/metrics/file_metrics_provider.cc b/components/metrics/file_metrics_provider.cc index 61297c6e..52696dc 100644 --- a/components/metrics/file_metrics_provider.cc +++ b/components/metrics/file_metrics_provider.cc
@@ -546,6 +546,26 @@ RecordEmbeddedProfileResult(EMBEDDED_PROFILE_FOUND); } else { RecordEmbeddedProfileResult(EMBEDDED_PROFILE_DROPPED); + + // TODO(bcwhite): Remove these once crbug/695880 is resolved. + + int histogram_count = 0; + base::PersistentHistogramAllocator::Iterator histogram_iter( + source->allocator.get()); + while (histogram_iter.GetNext()) { + ++histogram_count; + } + UMA_HISTOGRAM_COUNTS_10000( + "UMA.FileMetricsProvider.EmbeddedProfile.DroppedHistogramCount", + histogram_count); + + base::File::Info info; + if (base::GetFileInfo(source->path, &info)) { + UMA_HISTOGRAM_CUSTOM_COUNTS( + "UMA.FileMetricsProvider.EmbeddedProfile.DroppedFileAge", + (base::Time::Now() - info.last_modified).InMinutes(), 1, + base::TimeDelta::FromDays(30).InMinutes(), 50); + } } // Regardless of whether this source was successfully recorded, it is never
diff --git a/components/navigation_interception/intercept_navigation_delegate.cc b/components/navigation_interception/intercept_navigation_delegate.cc index b8cd316..b6a3b11 100644 --- a/components/navigation_interception/intercept_navigation_delegate.cc +++ b/components/navigation_interception/intercept_navigation_delegate.cc
@@ -89,7 +89,7 @@ InterceptNavigationDelegate::CreateThrottleFor( content::NavigationHandle* handle) { return base::MakeUnique<InterceptNavigationThrottle>( - handle, base::Bind(&CheckIfShouldIgnoreNavigationOnUIThread), false); + handle, base::Bind(&CheckIfShouldIgnoreNavigationOnUIThread)); } // static
diff --git a/components/navigation_interception/intercept_navigation_throttle.cc b/components/navigation_interception/intercept_navigation_throttle.cc index a6bbcd0..db7a1dd1 100644 --- a/components/navigation_interception/intercept_navigation_throttle.cc +++ b/components/navigation_interception/intercept_navigation_throttle.cc
@@ -12,38 +12,11 @@ namespace navigation_interception { -namespace { - -using ChecksPerformedCallback = base::Callback<void(bool)>; - -// This is used to run |should_ignore_callback| if it can destroy the -// WebContents (and the InterceptNavigationThrottle along). In that case, -// |on_checks_performed_callback| will be a no-op. -void RunCallback( - content::WebContents* web_contents, - const NavigationParams& navigation_params, - InterceptNavigationThrottle::CheckCallback should_ignore_callback, - ChecksPerformedCallback on_checks_performed_callback, - base::WeakPtr<InterceptNavigationThrottle> throttle) { - bool should_ignore_navigation = - should_ignore_callback.Run(web_contents, navigation_params); - - // If the InterceptNavigationThrottle that called RunCallback is still alive - // after |should_ignore_callback| has run, this will run - // InterceptNavigationThrottle::OnAsynchronousChecksPerformed. - on_checks_performed_callback.Run(should_ignore_navigation); -} - -} // namespace - InterceptNavigationThrottle::InterceptNavigationThrottle( content::NavigationHandle* navigation_handle, - CheckCallback should_ignore_callback, - bool run_callback_synchronously) + CheckCallback should_ignore_callback) : content::NavigationThrottle(navigation_handle), - should_ignore_callback_(should_ignore_callback), - run_callback_synchronously_(run_callback_synchronously), - weak_factory_(this) {} + should_ignore_callback_(should_ignore_callback) {} InterceptNavigationThrottle::~InterceptNavigationThrottle() {} @@ -72,58 +45,11 @@ navigation_handle()->GetPageTransition(), is_redirect, navigation_handle()->IsExternalProtocol(), true, navigation_handle()->GetBaseURLForDataURL()); - - if (run_callback_synchronously_) { - bool should_ignore_navigation = should_ignore_callback_.Run( - navigation_handle()->GetWebContents(), navigation_params); - return should_ignore_navigation - ? content::NavigationThrottle::CANCEL_AND_IGNORE - : content::NavigationThrottle::PROCEED; - } - - // When the callback can potentially destroy the WebContents, along with the - // NavigationHandle and this InterceptNavigationThrottle, it should be run - // asynchronously. This will ensure that no objects on the stack can be - // deleted, and that the stack does not unwind through them in a deleted - // state. - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - base::Bind(&InterceptNavigationThrottle::RunCallbackAsynchronously, - weak_factory_.GetWeakPtr(), navigation_params)); - return DEFER; -} - -void InterceptNavigationThrottle::RunCallbackAsynchronously( - const NavigationParams& navigation_params) { - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - - // Run the callback in a helper function as it may lead ot the destruction of - // this InterceptNavigationThrottle. - RunCallback( - navigation_handle()->GetWebContents(), navigation_params, - should_ignore_callback_, - base::Bind(&InterceptNavigationThrottle::OnAsynchronousChecksPerformed, - weak_factory_.GetWeakPtr()), - weak_factory_.GetWeakPtr()); - - // DO NOT ADD CODE AFTER HERE: at this point the InterceptNavigationThrottle - // may have been destroyed by the |should_ignore_callback_|. Adding code here - // will cause use-after-free bugs. - // - // Code that needs to act on the result of the |should_ignore_callback_| - // should be put inside OnAsynchronousChecksPerformed. This function will be - // called after |should_ignore_callback_| has run, if this - // InterceptNavigationThrottle is still alive. -} - -void InterceptNavigationThrottle::OnAsynchronousChecksPerformed( - bool should_ignore_navigation) { - if (should_ignore_navigation) { - navigation_handle()->CancelDeferredNavigation( - content::NavigationThrottle::CANCEL_AND_IGNORE); - } else { - navigation_handle()->Resume(); - } + bool should_ignore_navigation = should_ignore_callback_.Run( + navigation_handle()->GetWebContents(), navigation_params); + return should_ignore_navigation + ? content::NavigationThrottle::CANCEL_AND_IGNORE + : content::NavigationThrottle::PROCEED; } } // namespace navigation_interception
diff --git a/components/navigation_interception/intercept_navigation_throttle.h b/components/navigation_interception/intercept_navigation_throttle.h index 09158b8..7607fd5f 100644 --- a/components/navigation_interception/intercept_navigation_throttle.h +++ b/components/navigation_interception/intercept_navigation_throttle.h
@@ -30,8 +30,7 @@ CheckCallback; InterceptNavigationThrottle(content::NavigationHandle* navigation_handle, - CheckCallback should_ignore_callback, - bool run_callback_synchronously); + CheckCallback should_ignore_callback); ~InterceptNavigationThrottle() override; // content::NavigationThrottle implementation: @@ -42,19 +41,8 @@ private: ThrottleCheckResult CheckIfShouldIgnoreNavigation(bool is_redirect); - // Called to perform the checks asynchronously - void RunCallbackAsynchronously(const NavigationParams& navigation_params); - void OnAsynchronousChecksPerformed(bool should_ignore_navigation); - CheckCallback should_ignore_callback_; - // Whether the callback will be run synchronously or not. If the callback can - // lead to the destruction of the WebContents, this should be false. - // Otherwise this should be true. - const bool run_callback_synchronously_; - - base::WeakPtrFactory<InterceptNavigationThrottle> weak_factory_; - DISALLOW_COPY_AND_ASSIGN(InterceptNavigationThrottle); };
diff --git a/components/navigation_interception/intercept_navigation_throttle_unittest.cc b/components/navigation_interception/intercept_navigation_throttle_unittest.cc index a6d27c49..0b3ed14 100644 --- a/components/navigation_interception/intercept_navigation_throttle_unittest.cc +++ b/components/navigation_interception/intercept_navigation_throttle_unittest.cc
@@ -68,8 +68,7 @@ base::MakeUnique<InterceptNavigationThrottle>( test_handle.get(), base::Bind(&MockInterceptCallbackReceiver::ShouldIgnoreNavigation, - base::Unretained(mock_callback_receiver_.get())), - true)); + base::Unretained(mock_callback_receiver_.get())))); return test_handle->CallWillStartRequestForTesting( is_post, content::Referrer(), false, ui::PAGE_TRANSITION_LINK, false); } @@ -82,8 +81,7 @@ base::MakeUnique<InterceptNavigationThrottle>( test_handle.get(), base::Bind(&MockInterceptCallbackReceiver::ShouldIgnoreNavigation, - base::Unretained(mock_callback_receiver_.get())), - true)); + base::Unretained(mock_callback_receiver_.get())))); test_handle->CallWillStartRequestForTesting( true, content::Referrer(), false, ui::PAGE_TRANSITION_LINK, false); return test_handle->CallWillRedirectRequestForTesting(GURL(kTestUrl), false,
diff --git a/components/net_log/chrome_net_log.cc b/components/net_log/chrome_net_log.cc index 5ec2e55..304b992 100644 --- a/components/net_log/chrome_net_log.cc +++ b/components/net_log/chrome_net_log.cc
@@ -29,8 +29,7 @@ net::NetLogCaptureMode log_file_mode, const base::CommandLine::StringType& command_line_string, const std::string& channel_string) - : net_log_file_writer_( - new NetLogFileWriter(this, command_line_string, channel_string)) { + : net_log_file_writer_(new NetLogFileWriter(this)) { if (!log_file.empty()) { // Much like logging.h, bypass threading restrictions by using fopen // directly. Have to write on a thread that's shutdown to handle events on @@ -73,6 +72,12 @@ trace_net_log_observer_->StopWatchForTraceStart(); } +NetLogFileWriter* ChromeNetLog::net_log_file_writer() { + if (!net_log_file_writer_) + net_log_file_writer_ = base::WrapUnique(new NetLogFileWriter(this)); + return net_log_file_writer_.get(); +} + // static std::unique_ptr<base::Value> ChromeNetLog::GetConstants( const base::CommandLine::StringType& command_line_string,
diff --git a/components/net_log/chrome_net_log.h b/components/net_log/chrome_net_log.h index bca0d288..30ccb9e 100644 --- a/components/net_log/chrome_net_log.h +++ b/components/net_log/chrome_net_log.h
@@ -30,6 +30,12 @@ // as its observers. class ChromeNetLog : public net::NetLog { public: + // The parameters to the constructor are only used for command-line based + // NetLog writing (which starts immediately after construction). + // + // TODO(eroman): This would be clearer as a separate method to configure and + // start this logging mode. + // // The log is saved to |log_file|. // |log_file_mode| is the mode used to log in |log_file|. // If |log_file| is empty, only a temporary log is created, and @@ -40,7 +46,9 @@ const std::string& channel_string); ~ChromeNetLog() override; - NetLogFileWriter* net_log_file_writer() { return net_log_file_writer_.get(); } + // TODO(eroman): Rename this to something clearer. Perhaps + // |net_export_file_writer()|. + NetLogFileWriter* net_log_file_writer(); // Returns a Value containing constants needed to load a log file. // Safe to call on any thread.
diff --git a/components/net_log/net_log_file_writer.cc b/components/net_log/net_log_file_writer.cc index 8be69a73..a1907ea 100644 --- a/components/net_log/net_log_file_writer.cc +++ b/components/net_log/net_log_file_writer.cc
@@ -109,17 +109,12 @@ } // namespace -NetLogFileWriter::NetLogFileWriter( - ChromeNetLog* chrome_net_log, - const base::CommandLine::StringType& command_line_string, - const std::string& channel_string) +NetLogFileWriter::NetLogFileWriter(ChromeNetLog* chrome_net_log) : state_(STATE_UNINITIALIZED), log_exists_(false), log_capture_mode_known_(false), log_capture_mode_(net::NetLogCaptureMode::Default()), chrome_net_log_(chrome_net_log), - command_line_string_(command_line_string), - channel_string_(channel_string), default_log_base_dir_getter_(base::Bind(&base::GetTempDir)), weak_ptr_factory_(this) {} @@ -169,6 +164,8 @@ void NetLogFileWriter::StartNetLog( const base::FilePath& log_path, net::NetLogCaptureMode capture_mode, + const base::CommandLine::StringType& command_line_string, + const std::string& channel_string, const URLRequestContextGetterList& context_getters) { DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(file_task_runner_); @@ -186,7 +183,7 @@ NotifyStateObserversAsync(); std::unique_ptr<base::Value> constants( - ChromeNetLog::GetConstants(command_line_string_, channel_string_)); + ChromeNetLog::GetConstants(command_line_string, channel_string)); // Instantiate a FileNetLogObserver in unbounded mode. file_net_log_observer_ = net::FileNetLogObserver::CreateUnbounded( file_task_runner_, log_path_, std::move(constants));
diff --git a/components/net_log/net_log_file_writer.h b/components/net_log/net_log_file_writer.h index 1f741c9e..49899c3 100644 --- a/components/net_log/net_log_file_writer.h +++ b/components/net_log/net_log_file_writer.h
@@ -105,6 +105,8 @@ // thread. void StartNetLog(const base::FilePath& log_path, net::NetLogCaptureMode capture_mode, + const base::CommandLine::StringType& command_line_string, + const std::string& channel_string, const URLRequestContextGetterList& context_getters); // Stops collecting NetLog data into the file. It is a no-op if @@ -149,9 +151,7 @@ protected: // Constructs a NetLogFileWriter. Only one instance is created in browser // process. - NetLogFileWriter(ChromeNetLog* chrome_net_log, - const base::CommandLine::StringType& command_line_string, - const std::string& channel_string); + explicit NetLogFileWriter(ChromeNetLog* chrome_net_log); private: friend class ChromeNetLog; @@ -228,9 +228,6 @@ // List of StateObservers to notify on state changes. base::ObserverList<StateObserver, true> state_observer_list_; - const base::CommandLine::StringType command_line_string_; - const std::string channel_string_; - // Used by unit tests to override the default log base directory retrieved // during initialization. This getter is initialized to base::GetTempDir(). DirectoryGetter default_log_base_dir_getter_;
diff --git a/components/net_log/net_log_file_writer_unittest.cc b/components/net_log/net_log_file_writer_unittest.cc index bfae99d..8e42583 100644 --- a/components/net_log/net_log_file_writer_unittest.cc +++ b/components/net_log/net_log_file_writer_unittest.cc
@@ -257,12 +257,9 @@ NetLogFileWriterTest() : net_log_(base::FilePath(), net::NetLogCaptureMode::Default(), - base::CommandLine::ForCurrentProcess()->GetCommandLineString(), + base::CommandLine::StringType(), kChannelString), - net_log_file_writer_( - &net_log_, - base::CommandLine::ForCurrentProcess()->GetCommandLineString(), - kChannelString), + net_log_file_writer_(&net_log_), file_thread_("NetLogFileWriter file thread"), net_thread_("NetLogFileWriter net thread") {} @@ -337,7 +334,8 @@ const std::string& expected_capture_mode_string, const URLRequestContextGetterList& context_getters) { net_log_file_writer_.StartNetLog(custom_log_path, capture_mode, - context_getters); + base::CommandLine::StringType(), + kChannelString, context_getters); std::unique_ptr<base::DictionaryValue> state = test_state_observer_.WaitForNewState(); ::testing::AssertionResult result = @@ -503,14 +501,17 @@ // Calling StartNetLog() again should be a no-op. Try doing StartNetLog() // with various capture modes; they should all be ignored and result in no // state change. - net_log_file_writer_.StartNetLog(base::FilePath(), capture_modes[i], - URLRequestContextGetterList()); - net_log_file_writer_.StartNetLog(base::FilePath(), - capture_modes[(i + 1) % 3], - URLRequestContextGetterList()); - net_log_file_writer_.StartNetLog(base::FilePath(), - capture_modes[(i + 2) % 3], - URLRequestContextGetterList()); + net_log_file_writer_.StartNetLog( + base::FilePath(), capture_modes[i], base::CommandLine::StringType(), + kChannelString, URLRequestContextGetterList()); + net_log_file_writer_.StartNetLog( + base::FilePath(), capture_modes[(i + 1) % 3], + base::CommandLine::StringType(), kChannelString, + URLRequestContextGetterList()); + net_log_file_writer_.StartNetLog( + base::FilePath(), capture_modes[(i + 2) % 3], + base::CommandLine::StringType(), kChannelString, + URLRequestContextGetterList()); // StopNetLog(), should result in state change. The capture mode should // match that of the first StartNetLog() call (called by @@ -748,9 +749,10 @@ // process from completing, so this ensures that StartNetLog() is received // before |net_log_file_writer_| finishes initialization, which means this // should be a no-op. - net_log_file_writer_.StartNetLog(base::FilePath(), - net::NetLogCaptureMode::Default(), - URLRequestContextGetterList()); + net_log_file_writer_.StartNetLog( + base::FilePath(), net::NetLogCaptureMode::Default(), + base::CommandLine::StringType(), kChannelString, + URLRequestContextGetterList()); // Now run the main message loop. Make sure StartNetLog() was ignored by // checking that the next two states are "initializing" followed by @@ -779,9 +781,10 @@ // from completing, so this ensures StartNetLog() is received before // |net_log_file_writer_| finishes stopping, which means this should be a // no-op. - net_log_file_writer_.StartNetLog(base::FilePath(), - net::NetLogCaptureMode::Default(), - URLRequestContextGetterList()); + net_log_file_writer_.StartNetLog( + base::FilePath(), net::NetLogCaptureMode::Default(), + base::CommandLine::StringType(), kChannelString, + URLRequestContextGetterList()); // Now run the main message loop. Make sure the last StartNetLog() was // ignored by checking that the next two states are "stopping-log" followed by
diff --git a/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc b/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc index 1526cc92e..6fb19b3 100644 --- a/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc +++ b/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc
@@ -1012,6 +1012,78 @@ } TEST_F(RemoteSuggestionsSignedOutFetcherTest, + ShouldReportInvalidListErrorForInvalidTimestampButValidJson) { + // This is valid json, but it does not represent a valid suggestion + // (creationTime is invalid). + const std::string kValidJsonStr = + "{\"categories\" : [{" + " \"id\": 1," + " \"localizedTitle\": \"Articles for You\"," + " \"suggestions\" : [{" + " \"ids\" : [\"http://localhost/foobar\"]," + " \"title\" : \"Foo Barred from Baz\"," + " \"snippet\" : \"...\"," + " \"fullPageUrl\" : \"http://localhost/foobar\"," + " \"creationTime\" : \"INVALID_2016-06-30T11:01:37.000Z\"," + " \"expirationTime\" : \"2016-07-01T11:01:37.000Z\"," + " \"attribution\" : \"Foo News\"," + " \"imageUrl\" : \"http://localhost/foobar.jpg\"," + " \"ampUrl\" : \"http://localhost/amp\"," + " \"faviconUrl\" : \"http://localhost/favicon.ico\" " + " }]" + "}]}"; + SetFakeResponse(/*response_data=*/kValidJsonStr, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); + EXPECT_CALL( + mock_callback(), + Run(Field(&Status::code, StatusCode::TEMPORARY_ERROR), + /*fetched_categories=*/Property( + &base::Optional<std::vector<FetchedCategory>>::has_value, false))) + .Times(1); + fetcher().FetchSnippets(test_params(), + ToSnippetsAvailableCallback(&mock_callback())); + FastForwardUntilNoTasksRemain(); + EXPECT_THAT(fetcher().GetLastStatusForDebugging(), + StartsWith("Invalid / empty list")); +} + +TEST_F(RemoteSuggestionsSignedOutFetcherTest, + ShouldReportInvalidListErrorForInvalidUrlButValidJson) { + // This is valid json, but it does not represent a valid suggestion + // (URL is invalid). + const std::string kValidJsonStr = + "{\"categories\" : [{" + " \"id\": 1," + " \"localizedTitle\": \"Articles for You\"," + " \"suggestions\" : [{" + " \"ids\" : [\"NOT A URL\"]," + " \"title\" : \"Foo Barred from Baz\"," + " \"snippet\" : \"...\"," + " \"fullPageUrl\" : \"NOT A URL\"," + " \"creationTime\" : \"2016-06-30T11:01:37.000Z\"," + " \"expirationTime\" : \"2016-07-01T11:01:37.000Z\"," + " \"attribution\" : \"Foo News\"," + " \"imageUrl\" : \"http://localhost/foobar.jpg\"," + " \"ampUrl\" : \"http://localhost/amp\"," + " \"faviconUrl\" : \"http://localhost/favicon.ico\" " + " }]" + "}]}"; + SetFakeResponse(/*response_data=*/kValidJsonStr, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); + EXPECT_CALL( + mock_callback(), + Run(Field(&Status::code, StatusCode::TEMPORARY_ERROR), + /*fetched_categories=*/Property( + &base::Optional<std::vector<FetchedCategory>>::has_value, false))) + .Times(1); + fetcher().FetchSnippets(test_params(), + ToSnippetsAvailableCallback(&mock_callback())); + FastForwardUntilNoTasksRemain(); + EXPECT_THAT(fetcher().GetLastStatusForDebugging(), + StartsWith("Invalid / empty list")); +} + +TEST_F(RemoteSuggestionsSignedOutFetcherTest, ShouldReportRequestFailureAsTemporaryError) { SetFakeResponse(/*response_data=*/std::string(), net::HTTP_NOT_FOUND, net::URLRequestStatus::FAILED);
diff --git a/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc b/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc index 2f3a222..6b0dc65 100644 --- a/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc +++ b/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc
@@ -449,12 +449,6 @@ kSuggestionAmpUrl, /*score=*/1); } -std::string GetSuggestionWithTimes(const base::Time& content_creation_time, - const base::Time& expiry_time) { - return GetSuggestionWithUrlAndTimes(kSuggestionUrl, content_creation_time, - expiry_time); -} - std::string GetSuggestionWithUrl(const std::string& url) { return GetSuggestionWithUrlAndTimes(url, GetDefaultCreationTime(), GetDefaultExpirationTime()); @@ -465,16 +459,6 @@ GetDefaultExpirationTime()); } -std::string GetExpiredSuggestion() { - return GetSuggestionWithTimes(GetDefaultCreationTime(), base::Time::Now()); -} - -std::string GetInvalidSuggestion() { - std::string json_str = GetSuggestion(); - // Make the json invalid by removing the final closing brace. - return json_str.substr(0, json_str.size() - 1); -} - using ServeImageCallback = base::Callback<void( const std::string&, base::Callback<void(const std::string&, @@ -921,6 +905,7 @@ auto provider = MakeSuggestionsProvider( /*use_mock_suggestions_fetcher=*/true, /*set_empty_response=*/true); + // TODO(vitaliii): Inline the vector creation in FetchTheseSuggestions. std::vector<FetchedCategory> fetched_categories; fetched_categories.push_back( FetchedCategoryBuilder() @@ -1438,6 +1423,7 @@ ElementsAre(Pointee(Property(&RemoteSuggestion::id, first)))); std::string second("http://second"); + fetched_categories.clear(); fetched_categories.push_back( FetchedCategoryBuilder() .SetCategory(articles_category()) @@ -1501,6 +1487,7 @@ EXPECT_THAT(suggestions, SizeIs(1)); EXPECT_THAT(suggestions[0].id().id_within_category(), Eq("second")); }); + fetched_categories.clear(); fetched_categories.push_back( FetchedCategoryBuilder() .SetCategory(articles_category()) @@ -1577,6 +1564,7 @@ "http://old.com/")))); // Now fetch more, but first prepare a response. + fetched_categories.clear(); fetched_categories.push_back( FetchedCategoryBuilder() .SetCategory(articles_category()) @@ -1649,6 +1637,7 @@ std::move(fetched_categories)); // Now fetch more on the surface B. The response is the same as before. + fetched_categories.clear(); fetched_categories.push_back(FetchedCategory( articles_category(), BuildRemoteCategoryInfo(base::UTF8ToUTF16("title"), @@ -1685,17 +1674,35 @@ TEST_F(RemoteSuggestionsProviderImplTest, ClearHistoryShouldDeleteArchivedSuggestions) { auto provider = MakeSuggestionsProvider( - /*use_mock_suggestions_fetcher=*/false, /*set_empty_response=*/false); + /*use_mock_suggestions_fetcher=*/true, /*set_empty_response=*/false); // First get suggestions into the archived state which happens through // subsequent fetches. Then we verify the entries are gone from the 'archived' // state by trying to load their images (and we shouldn't even know the URLs // anymore). - LoadFromJSONString(provider.get(), - GetTestJson({GetSuggestionWithUrl("http://id-1"), - GetSuggestionWithUrl("http://id-2")})); - LoadFromJSONString(provider.get(), - GetTestJson({GetSuggestionWithUrl("http://new-id-1"), - GetSuggestionWithUrl("http://new-id-2")})); + std::vector<FetchedCategory> fetched_categories; + fetched_categories.push_back( + FetchedCategoryBuilder() + .SetCategory(articles_category()) + .AddSuggestionViaBuilder( + RemoteSuggestionBuilder().AddId("http://id-1")) + .AddSuggestionViaBuilder( + RemoteSuggestionBuilder().AddId("http://id-2")) + .Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); + fetched_categories.clear(); + fetched_categories.push_back( + FetchedCategoryBuilder() + .SetCategory(articles_category()) + .AddSuggestionViaBuilder( + RemoteSuggestionBuilder().AddId("http://new-id-1")) + .AddSuggestionViaBuilder( + RemoteSuggestionBuilder().AddId("http://new-id-2")) + .Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); // Make sure images of both batches are available. This is to sanity check our // assumptions for the test are right. ServeImageCallback cb = @@ -1737,8 +1744,12 @@ TEST_F(RemoteSuggestionsProviderImplTest, ReturnFetchRequestEmptyBeforeInit) { auto provider = MakeSuggestionsProviderWithoutInitialization( - /*use_mock_suggestions_fetcher=*/false, + /*use_mock_suggestions_fetcher=*/true, /*use_mock_prefetched_pages_tracker=*/false); + auto* mock_fetcher = static_cast<StrictMock<MockRemoteSuggestionsFetcher>*>( + suggestions_fetcher()); + RemoteSuggestionsFetcher::SnippetsAvailableCallback snippets_callback; + EXPECT_CALL(*mock_fetcher, FetchSnippets(_, _)).Times(0); MockFunction<void(Status, const std::vector<ContentSuggestion>&)> loaded; EXPECT_CALL(loaded, Call(Field(&Status::code, StatusCode::TEMPORARY_ERROR), IsEmpty())); @@ -1818,12 +1829,18 @@ TEST_F(RemoteSuggestionsProviderImplTest, Dismiss) { auto provider = MakeSuggestionsProvider( - /*use_mock_suggestions_fetcher=*/false, /*set_empty_response=*/true); + /*use_mock_suggestions_fetcher=*/true, /*set_empty_response=*/true); - std::string json_str(GetTestJson( - {GetSuggestionWithSources("http://site.com", "Source 1", "")})); - - LoadFromJSONString(provider.get(), json_str); + std::vector<FetchedCategory> fetched_categories; + const FetchedCategoryBuilder category_builder = + FetchedCategoryBuilder() + .SetCategory(articles_category()) + .AddSuggestionViaBuilder( + RemoteSuggestionBuilder().AddId("http://site.com")); + fetched_categories.push_back(category_builder.Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); ASSERT_THAT(provider->GetSuggestionsForTesting(articles_category()), SizeIs(1)); @@ -1857,14 +1874,22 @@ EXPECT_EQ(1, image.Width()); // Make sure that fetching the same suggestion again does not re-add it. - LoadFromJSONString(provider.get(), json_str); + fetched_categories.clear(); + fetched_categories.push_back(category_builder.Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); EXPECT_THAT(provider->GetSuggestionsForTesting(articles_category()), IsEmpty()); // The suggestion should stay dismissed even after re-creating the provider. - ResetSuggestionsProvider(&provider, /*use_mock_suggestions_fetcher=*/false, + ResetSuggestionsProvider(&provider, /*use_mock_suggestions_fetcher=*/true, /*set_empty_response=*/true); - LoadFromJSONString(provider.get(), json_str); + fetched_categories.clear(); + fetched_categories.push_back(category_builder.Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); EXPECT_THAT(provider->GetSuggestionsForTesting(articles_category()), IsEmpty()); @@ -1872,18 +1897,31 @@ provider->ClearDismissedSuggestionsForDebugging(articles_category()); EXPECT_THAT(provider->GetSuggestionsForTesting(articles_category()), IsEmpty()); - LoadFromJSONString(provider.get(), json_str); + fetched_categories.clear(); + fetched_categories.push_back(category_builder.Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); EXPECT_THAT(provider->GetSuggestionsForTesting(articles_category()), SizeIs(1)); } TEST_F(RemoteSuggestionsProviderImplTest, GetDismissed) { auto provider = MakeSuggestionsProvider( - /*use_mock_suggestions_fetcher=*/false, /*set_empty_response=*/true); + /*use_mock_suggestions_fetcher=*/true, /*set_empty_response=*/true); - LoadFromJSONString(provider.get(), GetTestJson({GetSuggestion()})); + std::vector<FetchedCategory> fetched_categories; + fetched_categories.push_back( + FetchedCategoryBuilder() + .SetCategory(articles_category()) + .AddSuggestionViaBuilder( + RemoteSuggestionBuilder().AddId("http://site.com")) + .Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); - provider->DismissSuggestion(MakeArticleID(kSuggestionUrl)); + provider->DismissSuggestion(MakeArticleID("http://site.com")); provider->GetDismissedSuggestionsForDebugging( articles_category(), @@ -1893,7 +1931,8 @@ std::vector<ContentSuggestion> dismissed_suggestions) { EXPECT_EQ(1u, dismissed_suggestions.size()); for (auto& suggestion : dismissed_suggestions) { - EXPECT_EQ(test->MakeArticleID(kSuggestionUrl), suggestion.id()); + EXPECT_EQ(test->MakeArticleID("http://site.com"), + suggestion.id()); } }, provider.get(), this)); @@ -1913,28 +1952,21 @@ base::RunLoop().RunUntilIdle(); } -TEST_F(RemoteSuggestionsProviderImplTest, CreationTimestampParseFail) { - auto provider = MakeSuggestionsProvider( - /*use_mock_suggestions_fetcher=*/false, /*set_empty_response=*/true); - - std::string json = GetSuggestionWithTimes(GetDefaultCreationTime(), - GetDefaultExpirationTime()); - base::ReplaceFirstSubstringAfterOffset( - &json, 0, FormatTime(GetDefaultCreationTime()), "aaa1448459205"); - std::string json_str(GetTestJson({json})); - - LoadFromJSONString(provider.get(), json_str); - EXPECT_THAT(provider->GetSuggestionsForTesting(articles_category()), - IsEmpty()); -} - TEST_F(RemoteSuggestionsProviderImplTest, RemoveExpiredDismissedContent) { auto provider = MakeSuggestionsProvider( - /*use_mock_suggestions_fetcher=*/false, /*set_empty_response=*/true); + /*use_mock_suggestions_fetcher=*/true, /*set_empty_response=*/true); - std::string json_str1(GetTestJson({GetExpiredSuggestion()})); - // Load it. - LoadFromJSONString(provider.get(), json_str1); + std::vector<FetchedCategory> fetched_categories; + fetched_categories.push_back( + FetchedCategoryBuilder() + .SetCategory(articles_category()) + .AddSuggestionViaBuilder(RemoteSuggestionBuilder() + .AddId("http://first/") + .SetExpiryDate(base::Time::Now())) + .Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); // Load the image to store it in the database. // TODO(tschumann): Introduce some abstraction to nicely work with image // fetching expectations. @@ -1943,45 +1975,71 @@ EXPECT_CALL(*image_fetcher(), StartOrQueueNetworkRequest(_, _, _, _)) .WillOnce(WithArgs<0, 2>(Invoke(CreateFunctor(cb)))); image_decoder()->SetDecodedImage(gfx::test::CreateImage(1, 1)); - gfx::Image image = FetchImage(provider.get(), MakeArticleID(kSuggestionUrl)); + gfx::Image image = FetchImage(provider.get(), MakeArticleID("http://first/")); EXPECT_FALSE(image.IsEmpty()); EXPECT_EQ(1, image.Width()); // Dismiss the suggestion provider->DismissSuggestion( - ContentSuggestion::ID(articles_category(), kSuggestionUrl)); + ContentSuggestion::ID(articles_category(), "http://first/")); // Load a different suggestion - this will clear the expired dismissed ones. - std::string json_str2(GetTestJson({GetSuggestionWithUrl(kSuggestionUrl2)})); - LoadFromJSONString(provider.get(), json_str2); + fetched_categories.clear(); + fetched_categories.push_back( + FetchedCategoryBuilder() + .SetCategory(articles_category()) + .AddSuggestionViaBuilder( + RemoteSuggestionBuilder().AddId("http://second/")) + .Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); EXPECT_THAT(provider->GetDismissedSuggestionsForTesting(articles_category()), IsEmpty()); // Verify the image got removed, too. EXPECT_TRUE( - FetchImage(provider.get(), MakeArticleID(kSuggestionUrl)).IsEmpty()); + FetchImage(provider.get(), MakeArticleID("http://first/")).IsEmpty()); } TEST_F(RemoteSuggestionsProviderImplTest, ExpiredContentNotRemoved) { auto provider = MakeSuggestionsProvider( - /*use_mock_suggestions_fetcher=*/false, /*set_empty_response=*/true); + /*use_mock_suggestions_fetcher=*/true, /*set_empty_response=*/true); - std::string json_str(GetTestJson({GetExpiredSuggestion()})); + std::vector<FetchedCategory> fetched_categories; + fetched_categories.push_back( + FetchedCategoryBuilder() + .SetCategory(articles_category()) + .AddSuggestionViaBuilder( + RemoteSuggestionBuilder().SetExpiryDate(base::Time::Now())) + .Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); - LoadFromJSONString(provider.get(), json_str); EXPECT_THAT(provider->GetSuggestionsForTesting(articles_category()), SizeIs(1)); } TEST_F(RemoteSuggestionsProviderImplTest, TestSingleSource) { auto provider = MakeSuggestionsProvider( - /*use_mock_suggestions_fetcher=*/false, /*set_empty_response=*/true); + /*use_mock_suggestions_fetcher=*/true, /*set_empty_response=*/true); - std::string json_str(GetTestJson({GetSuggestionWithSources( - "http://source1.com", "Source 1", "http://source1.amp.com")})); + std::vector<FetchedCategory> fetched_categories; + fetched_categories.push_back( + FetchedCategoryBuilder() + .SetCategory(articles_category()) + .AddSuggestionViaBuilder(RemoteSuggestionBuilder() + .AddId("http://source1.com") + .SetUrl("http://source1.com") + .SetPublisher("Source 1") + .SetAmpUrl("http://source1.amp.com")) + .Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); - LoadFromJSONString(provider.get(), json_str); ASSERT_THAT(provider->GetSuggestionsForTesting(articles_category()), SizeIs(1)); const RemoteSuggestion& suggestion = @@ -1992,64 +2050,87 @@ EXPECT_EQ(suggestion.amp_url(), GURL("http://source1.amp.com")); } -TEST_F(RemoteSuggestionsProviderImplTest, TestSingleSourceWithMalformedUrl) { - auto provider = MakeSuggestionsProvider( - /*use_mock_suggestions_fetcher=*/false, /*set_empty_response=*/true); - - std::string json_str(GetTestJson({GetSuggestionWithSources( - "ceci n'est pas un url", "Source 1", "http://source1.amp.com")})); - - LoadFromJSONString(provider.get(), json_str); - EXPECT_THAT(provider->GetSuggestionsForTesting(articles_category()), - IsEmpty()); -} - TEST_F(RemoteSuggestionsProviderImplTest, TestSingleSourceWithMissingData) { auto provider = MakeSuggestionsProvider( - /*use_mock_suggestions_fetcher=*/false, /*set_empty_response=*/true); + /*use_mock_suggestions_fetcher=*/true, /*set_empty_response=*/true); - std::string json_str( - GetTestJson({GetSuggestionWithSources("http://source1.com", "", "")})); + std::vector<FetchedCategory> fetched_categories; + fetched_categories.push_back( + FetchedCategoryBuilder() + .SetCategory(articles_category()) + .AddSuggestionViaBuilder( + RemoteSuggestionBuilder().SetPublisher("").SetAmpUrl("")) + .Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); - LoadFromJSONString(provider.get(), json_str); EXPECT_THAT(provider->GetSuggestionsForTesting(articles_category()), IsEmpty()); } TEST_F(RemoteSuggestionsProviderImplTest, LogNumArticlesHistogram) { auto provider = MakeSuggestionsProvider( - /*use_mock_suggestions_fetcher=*/false, /*set_empty_response=*/true); + /*use_mock_suggestions_fetcher=*/true, /*set_empty_response=*/true); base::HistogramTester tester; - LoadFromJSONString(provider.get(), GetTestJson({GetInvalidSuggestion()})); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::TEMPORARY_ERROR, "message"), + base::nullopt); EXPECT_THAT(tester.GetAllSamples("NewTabPage.Snippets.NumArticles"), ElementsAre(base::Bucket(/*min=*/0, /*count=*/1))); - - // Invalid JSON shouldn't contribute to NumArticlesFetched. + // Fetch error shouldn't contribute to NumArticlesFetched. EXPECT_THAT(tester.GetAllSamples("NewTabPage.Snippets.NumArticlesFetched"), IsEmpty()); - // Valid JSON with empty list. - LoadFromJSONString(provider.get(), GetTestJson(std::vector<std::string>())); + // Emptry categories list. + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::vector<FetchedCategory>()); EXPECT_THAT(tester.GetAllSamples("NewTabPage.Snippets.NumArticles"), ElementsAre(base::Bucket(/*min=*/0, /*count=*/2))); EXPECT_THAT(tester.GetAllSamples("NewTabPage.Snippets.NumArticlesFetched"), + IsEmpty()); + + // Empty articles category. + std::vector<FetchedCategory> fetched_categories; + fetched_categories.push_back( + FetchedCategoryBuilder().SetCategory(articles_category()).Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); + EXPECT_THAT(tester.GetAllSamples("NewTabPage.Snippets.NumArticles"), + ElementsAre(base::Bucket(/*min=*/0, /*count=*/3))); + EXPECT_THAT(tester.GetAllSamples("NewTabPage.Snippets.NumArticlesFetched"), ElementsAre(base::Bucket(/*min=*/0, /*count=*/1))); // Suggestion list should be populated with size 1. - LoadFromJSONString(provider.get(), GetTestJson({GetSuggestion()})); + const FetchedCategoryBuilder category_builder = + FetchedCategoryBuilder() + .SetCategory(articles_category()) + .AddSuggestionViaBuilder( + RemoteSuggestionBuilder().AddId("http://site.com/")); + fetched_categories.clear(); + fetched_categories.push_back(category_builder.Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); EXPECT_THAT(tester.GetAllSamples("NewTabPage.Snippets.NumArticles"), - ElementsAre(base::Bucket(/*min=*/0, /*count=*/2), + ElementsAre(base::Bucket(/*min=*/0, /*count=*/3), base::Bucket(/*min=*/1, /*count=*/1))); EXPECT_THAT(tester.GetAllSamples("NewTabPage.Snippets.NumArticlesFetched"), ElementsAre(base::Bucket(/*min=*/0, /*count=*/1), base::Bucket(/*min=*/1, /*count=*/1))); // Duplicate suggestion shouldn't increase the list size. - LoadFromJSONString(provider.get(), GetTestJson({GetSuggestion()})); + fetched_categories.clear(); + fetched_categories.push_back(category_builder.Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); EXPECT_THAT(tester.GetAllSamples("NewTabPage.Snippets.NumArticles"), - ElementsAre(base::Bucket(/*min=*/0, /*count=*/2), + ElementsAre(base::Bucket(/*min=*/0, /*count=*/3), base::Bucket(/*min=*/1, /*count=*/2))); EXPECT_THAT(tester.GetAllSamples("NewTabPage.Snippets.NumArticlesFetched"), ElementsAre(base::Bucket(/*min=*/0, /*count=*/1), @@ -2060,10 +2141,14 @@ // Dismissing a suggestion should decrease the list size. This will only be // logged after the next fetch. - provider->DismissSuggestion(MakeArticleID(kSuggestionUrl)); - LoadFromJSONString(provider.get(), GetTestJson({GetSuggestion()})); + provider->DismissSuggestion(MakeArticleID("http://site.com/")); + fetched_categories.clear(); + fetched_categories.push_back(category_builder.Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); EXPECT_THAT(tester.GetAllSamples("NewTabPage.Snippets.NumArticles"), - ElementsAre(base::Bucket(/*min=*/0, /*count=*/3), + ElementsAre(base::Bucket(/*min=*/0, /*count=*/4), base::Bucket(/*min=*/1, /*count=*/2))); // Dismissed suggestions shouldn't influence NumArticlesFetched. EXPECT_THAT(tester.GetAllSamples("NewTabPage.Snippets.NumArticlesFetched"), @@ -2076,10 +2161,8 @@ TEST_F(RemoteSuggestionsProviderImplTest, DismissShouldRespectAllKnownUrls) { auto provider = MakeSuggestionsProvider( - /*use_mock_suggestions_fetcher=*/false, /*set_empty_response=*/true); + /*use_mock_suggestions_fetcher=*/true, /*set_empty_response=*/true); - const base::Time creation = GetDefaultCreationTime(); - const base::Time expiry = GetDefaultExpirationTime(); const std::vector<std::string> source_urls = { "http://mashable.com/2016/05/11/stolen", "http://www.aol.com/article/2016/05/stolen-doggie"}; @@ -2089,10 +2172,20 @@ "http://t2.gstatic.com/images?q=tbn:3"}; // Add the suggestion from the mashable domain. - LoadFromJSONString(provider.get(), - GetTestJson({GetSuggestionWithUrlAndTimesAndSource( - source_urls, source_urls[0], creation, expiry, - publishers[0], amp_urls[0], /*score=*/1)})); + std::vector<FetchedCategory> fetched_categories; + fetched_categories.push_back( + FetchedCategoryBuilder() + .SetCategory(articles_category()) + .AddSuggestionViaBuilder(RemoteSuggestionBuilder() + .AddId(source_urls[0]) + .AddId(source_urls[1]) + .SetUrl(source_urls[0]) + .SetAmpUrl(amp_urls[0]) + .SetPublisher(publishers[0])) + .Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); ASSERT_THAT(provider->GetSuggestionsForTesting(articles_category()), SizeIs(1)); // Dismiss the suggestion via the mashable source corpus ID. @@ -2101,19 +2194,38 @@ IsEmpty()); // The same article from the AOL domain should now be detected as dismissed. - LoadFromJSONString(provider.get(), - GetTestJson({GetSuggestionWithUrlAndTimesAndSource( - source_urls, source_urls[1], creation, expiry, - publishers[1], amp_urls[1], /*score=*/1)})); + fetched_categories.clear(); + fetched_categories.push_back( + FetchedCategoryBuilder() + .SetCategory(articles_category()) + .AddSuggestionViaBuilder(RemoteSuggestionBuilder() + .AddId(source_urls[0]) + .AddId(source_urls[1]) + .SetUrl(source_urls[1]) + .SetAmpUrl(amp_urls[1]) + .SetPublisher(publishers[1])) + .Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); EXPECT_THAT(provider->GetSuggestionsForTesting(articles_category()), IsEmpty()); } TEST_F(RemoteSuggestionsProviderImplTest, ImageReturnedWithTheSameId) { auto provider = MakeSuggestionsProvider( - /*use_mock_suggestions_fetcher=*/false, /*set_empty_response=*/true); + /*use_mock_suggestions_fetcher=*/true, /*set_empty_response=*/true); - LoadFromJSONString(provider.get(), GetTestJson({GetSuggestion()})); + std::vector<FetchedCategory> fetched_categories; + fetched_categories.push_back( + FetchedCategoryBuilder() + .SetCategory(articles_category()) + .AddSuggestionViaBuilder( + RemoteSuggestionBuilder().AddId(kSuggestionUrl)) + .Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); gfx::Image image; MockFunction<void(const gfx::Image&)> image_fetched; @@ -2137,7 +2249,7 @@ TEST_F(RemoteSuggestionsProviderImplTest, EmptyImageReturnedForNonExistentId) { auto provider = MakeSuggestionsProvider( - /*use_mock_suggestions_fetcher=*/false, /*set_empty_response=*/true); + /*use_mock_suggestions_fetcher=*/true, /*set_empty_response=*/true); // Create a non-empty image so that we can test the image gets updated. gfx::Image image = gfx::test::CreateImage(1, 1); @@ -2145,7 +2257,7 @@ EXPECT_CALL(image_fetched, Call(_)).WillOnce(SaveArg<0>(&image)); provider->FetchSuggestionImage( - MakeArticleID(kSuggestionUrl2), + MakeArticleID("nonexistent"), base::Bind(&MockFunction<void(const gfx::Image&)>::Call, base::Unretained(&image_fetched))); @@ -2159,7 +2271,7 @@ // Therefore, we simply put in some data making sure that if the provider asks // the database, it will get a wrong answer. auto provider = MakeSuggestionsProvider( - /*use_mock_suggestions_fetcher=*/false, /*set_empty_response=*/true); + /*use_mock_suggestions_fetcher=*/true, /*set_empty_response=*/true); ContentSuggestion::ID unknown_id = MakeArticleID(kSuggestionUrl2); database()->SaveImage(unknown_id.id_within_category(), "some image blob"); @@ -2182,16 +2294,24 @@ TEST_F(RemoteSuggestionsProviderImplTest, ClearHistoryRemovesAllSuggestions) { auto provider = MakeSuggestionsProvider( - /*use_mock_suggestions_fetcher=*/false, /*set_empty_response=*/true); + /*use_mock_suggestions_fetcher=*/true, /*set_empty_response=*/true); - std::string first_suggestion = GetSuggestionWithUrl("http://url1.com"); - std::string second_suggestion = GetSuggestionWithUrl("http://url2.com"); - std::string json_str = GetTestJson({first_suggestion, second_suggestion}); - LoadFromJSONString(provider.get(), json_str); + std::vector<FetchedCategory> fetched_categories; + fetched_categories.push_back( + FetchedCategoryBuilder() + .SetCategory(articles_category()) + .AddSuggestionViaBuilder( + RemoteSuggestionBuilder().AddId("http://first/")) + .AddSuggestionViaBuilder( + RemoteSuggestionBuilder().AddId("http://second/")) + .Build()); + FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, + Status(StatusCode::SUCCESS, "message"), + std::move(fetched_categories)); ASSERT_THAT(provider->GetSuggestionsForTesting(articles_category()), SizeIs(2)); - provider->DismissSuggestion(MakeArticleID("http://url1.com")); + provider->DismissSuggestion(MakeArticleID("http://first/")); ASSERT_THAT(observer().SuggestionsForCategory(articles_category()), Not(IsEmpty())); ASSERT_THAT(provider->GetDismissedSuggestionsForTesting(articles_category()), @@ -2426,13 +2546,12 @@ suggestions_fetcher()); std::vector<FetchedCategory> fetched_categories; - fetched_categories.push_back(FetchedCategory( - articles_category(), - BuildRemoteCategoryInfo(base::UTF8ToUTF16("title"), - /*allow_fetching_more_results=*/true))); - - fetched_categories[0].suggestions.push_back( - CreateTestRemoteSuggestion("http://abc.com/")); + fetched_categories.push_back( + FetchedCategoryBuilder() + .SetCategory(articles_category()) + .AddSuggestionViaBuilder( + RemoteSuggestionBuilder().AddId("http://abc.com/")) + .Build()); ASSERT_TRUE(fetched_categories[0].suggestions[0]->is_complete()); FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, @@ -2466,16 +2585,14 @@ suggestions_fetcher()); std::vector<FetchedCategory> fetched_categories; - fetched_categories.push_back(FetchedCategory( - articles_category(), - BuildRemoteCategoryInfo(base::UTF8ToUTF16("title"), - /*allow_fetching_more_results=*/true))); - + FetchedCategoryBuilder category_builder; + category_builder.SetCategory(articles_category()); const int kSuggestionsCount = kMaxExcludedDismissedIds + 1; for (int i = 0; i < kSuggestionsCount; ++i) { - fetched_categories[0].suggestions.push_back(CreateTestRemoteSuggestion( + category_builder.AddSuggestionViaBuilder(RemoteSuggestionBuilder().AddId( base::StringPrintf("http://abc.com/%d/", i))); } + fetched_categories.push_back(category_builder.Build()); FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, Status(StatusCode::SUCCESS, "message"), @@ -2512,16 +2629,14 @@ suggestions_fetcher()); std::vector<FetchedCategory> fetched_categories; - fetched_categories.push_back(FetchedCategory( - articles_category(), - BuildRemoteCategoryInfo(base::UTF8ToUTF16("title"), - /*allow_fetching_more_results=*/true))); - + FetchedCategoryBuilder category_builder; + category_builder.SetCategory(articles_category()); const int kSuggestionsCount = kMaxExcludedDismissedIds + 1; for (int i = 0; i < kSuggestionsCount; ++i) { - fetched_categories[0].suggestions.push_back(CreateTestRemoteSuggestion( + category_builder.AddSuggestionViaBuilder(RemoteSuggestionBuilder().AddId( base::StringPrintf("http://abc.com/%d/", i))); } + fetched_categories.push_back(category_builder.Build()); FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, Status(StatusCode::SUCCESS, "message"), @@ -2566,25 +2681,24 @@ // Add article suggestions. std::vector<FetchedCategory> fetched_categories; - fetched_categories.push_back(FetchedCategory( - articles_category(), - BuildRemoteCategoryInfo(base::UTF8ToUTF16("title"), - /*allow_fetching_more_results=*/true))); - + FetchedCategoryBuilder first_category_builder; + first_category_builder.SetCategory(articles_category()); const int kSuggestionsPerCategory = 2; for (int i = 0; i < kSuggestionsPerCategory; ++i) { - fetched_categories[0].suggestions.push_back(CreateTestRemoteSuggestion( - base::StringPrintf("http://abc.com/%d/", i))); + first_category_builder.AddSuggestionViaBuilder( + RemoteSuggestionBuilder().AddId( + base::StringPrintf("http://abc.com/%d/", i))); } + fetched_categories.push_back(first_category_builder.Build()); // Add other category suggestions. - fetched_categories.push_back(FetchedCategory( - other_category(), - BuildRemoteCategoryInfo(base::UTF8ToUTF16("title"), - /*allow_fetching_more_results=*/true))); + FetchedCategoryBuilder second_category_builder; + second_category_builder.SetCategory(other_category()); for (int i = 0; i < kSuggestionsPerCategory; ++i) { - fetched_categories[1].suggestions.push_back(CreateTestRemoteSuggestion( - base::StringPrintf("http://other.com/%d/", i))); + second_category_builder.AddSuggestionViaBuilder( + RemoteSuggestionBuilder().AddId( + base::StringPrintf("http://other.com/%d/", i))); } + fetched_categories.push_back(second_category_builder.Build()); FetchTheseSuggestions(provider.get(), /*interactive_request=*/true, Status(StatusCode::SUCCESS, "message"),
diff --git a/components/omnibox/browser/shortcuts_backend.cc b/components/omnibox/browser/shortcuts_backend.cc index b34cd402..9f412b3 100644 --- a/components/omnibox/browser/shortcuts_backend.cc +++ b/components/omnibox/browser/shortcuts_backend.cc
@@ -16,6 +16,7 @@ #include "base/i18n/case_conversion.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_util.h" +#include "base/task_scheduler/post_task.h" #include "base/threading/thread_task_runner_handle.h" #include "components/history/core/browser/history_service.h" #include "components/omnibox/browser/autocomplete_input.h" @@ -68,7 +69,6 @@ TemplateURLService* template_url_service, std::unique_ptr<SearchTermsData> search_terms_data, history::HistoryService* history_service, - scoped_refptr<base::SequencedTaskRunner> db_runner, base::FilePath database_path, bool suppress_db) : template_url_service_(template_url_service), @@ -76,7 +76,9 @@ current_state_(NOT_INITIALIZED), history_service_observer_(this), main_runner_(base::ThreadTaskRunnerHandle::Get()), - db_runner_(db_runner), + db_runner_(base::CreateSequencedTaskRunnerWithTraits( + {base::MayBlock(), base::TaskPriority::BACKGROUND, + base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})), no_db_access_(suppress_db) { if (!suppress_db) db_ = new ShortcutsDatabase(database_path);
diff --git a/components/omnibox/browser/shortcuts_backend.h b/components/omnibox/browser/shortcuts_backend.h index 07e29382..ce8536e 100644 --- a/components/omnibox/browser/shortcuts_backend.h +++ b/components/omnibox/browser/shortcuts_backend.h
@@ -54,7 +54,6 @@ ShortcutsBackend(TemplateURLService* template_url_service, std::unique_ptr<SearchTermsData> search_terms_data, history::HistoryService* history_service, - scoped_refptr<base::SequencedTaskRunner> db_runner, base::FilePath database_path, bool suppress_db);
diff --git a/components/omnibox/browser/shortcuts_backend_unittest.cc b/components/omnibox/browser/shortcuts_backend_unittest.cc index fad5ae7..d534c6c 100644 --- a/components/omnibox/browser/shortcuts_backend_unittest.cc +++ b/components/omnibox/browser/shortcuts_backend_unittest.cc
@@ -9,11 +9,10 @@ #include "base/files/scoped_temp_dir.h" #include "base/macros.h" #include "base/memory/ptr_util.h" -#include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" -#include "base/threading/thread.h" +#include "base/test/scoped_task_environment.h" #include "components/history/core/browser/history_service.h" #include "components/history/core/test/history_service_test_util.h" #include "components/omnibox/browser/shortcuts_constants.h" @@ -60,8 +59,7 @@ TemplateURLService* GetTemplateURLService(); private: - base::MessageLoop message_loop_; - base::Thread db_thread_; + base::test::ScopedTaskEnvironment scoped_task_environment_; base::ScopedTempDir profile_dir_; std::unique_ptr<TemplateURLService> template_url_service_; std::unique_ptr<history::HistoryService> history_service_; @@ -75,9 +73,7 @@ }; ShortcutsBackendTest::ShortcutsBackendTest() - : db_thread_("Test DB thread"), - load_notified_(false), - changed_notified_(false) {} + : load_notified_(false), changed_notified_(false) {} ShortcutsDatabase::Shortcut::MatchCore ShortcutsBackendTest::MatchCoreForTesting(const std::string& url, @@ -116,25 +112,22 @@ history::CreateHistoryService(profile_dir_.GetPath(), true); ASSERT_TRUE(history_service_); - db_thread_.Start(); base::FilePath shortcuts_database_path = profile_dir_.GetPath().Append(kShortcutsDatabaseName); backend_ = new ShortcutsBackend( template_url_service_.get(), base::MakeUnique<SearchTermsData>(), - history_service_.get(), db_thread_.task_runner(), shortcuts_database_path, - false); + history_service_.get(), shortcuts_database_path, false); ASSERT_TRUE(backend_.get()); backend_->AddObserver(this); } void ShortcutsBackendTest::TearDown() { backend_->RemoveObserver(this); - db_thread_.Stop(); + scoped_task_environment_.RunUntilIdle(); } void ShortcutsBackendTest::OnShortcutsLoaded() { load_notified_ = true; - base::MessageLoop::current()->QuitWhenIdle(); } void ShortcutsBackendTest::OnShortcutsChanged() { @@ -146,7 +139,7 @@ ASSERT_FALSE(load_notified_); ASSERT_FALSE(backend_->initialized()); backend_->Init(); - base::RunLoop().Run(); + scoped_task_environment_.RunUntilIdle(); EXPECT_TRUE(load_notified_); EXPECT_TRUE(backend_->initialized()); }
diff --git a/components/omnibox/browser/shortcuts_provider_unittest.cc b/components/omnibox/browser/shortcuts_provider_unittest.cc index a31bbbbf..d15678b 100644 --- a/components/omnibox/browser/shortcuts_provider_unittest.cc +++ b/components/omnibox/browser/shortcuts_provider_unittest.cc
@@ -17,12 +17,11 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" -#include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/scoped_task_environment.h" #include "base/test/sequenced_worker_pool_owner.h" -#include "base/threading/thread.h" #include "components/history/core/browser/history_service.h" #include "components/history/core/browser/url_database.h" #include "components/history/core/test/history_service_test_util.h" @@ -182,24 +181,19 @@ class FakeAutocompleteProviderClient : public testing::NiceMock<MockAutocompleteProviderClient> { public: - FakeAutocompleteProviderClient() - : db_thread_("Test DB thread"), pool_owner_(3, "Background Pool") { + FakeAutocompleteProviderClient() : pool_owner_(3, "Background Pool") { set_template_url_service(base::MakeUnique<TemplateURLService>(nullptr, 0)); if (history_dir_.CreateUniqueTempDir()) { history_service_ = history::CreateHistoryService(history_dir_.GetPath(), true); } - db_thread_.Start(); shortcuts_backend_ = new ShortcutsBackend( GetTemplateURLService(), base::MakeUnique<SearchTermsData>(), - history_service_.get(), db_thread_.task_runner(), base::FilePath(), - true); + history_service_.get(), base::FilePath(), true); shortcuts_backend_->Init(); } - ~FakeAutocompleteProviderClient() override { db_thread_.Stop(); } - history::HistoryService* GetHistoryService() override { return history_service_.get(); } @@ -213,7 +207,7 @@ } private: - base::Thread db_thread_; + base::test::ScopedTaskEnvironment scoped_task_environment_; base::SequencedWorkerPoolOwner pool_owner_; base::ScopedTempDir history_dir_; std::unique_ptr<history::HistoryService> history_service_; @@ -267,7 +261,6 @@ const ShortcutsDatabase::Shortcut& shortcut, int max_relevance); - base::MessageLoop message_loop_; std::unique_ptr<FakeAutocompleteProviderClient> client_; scoped_refptr<ShortcutsProvider> provider_; }; @@ -285,9 +278,6 @@ } void ShortcutsProviderTest::TearDown() { - // Run all pending tasks or else some threads hold on to the message loop - // and prevent it from being deleted. - base::RunLoop().RunUntilIdle(); provider_ = NULL; }
diff --git a/components/password_manager/content/browser/content_password_manager_driver.cc b/components/password_manager/content/browser/content_password_manager_driver.cc index 88fa1f0..879f8e2f 100644 --- a/components/password_manager/content/browser/content_password_manager_driver.cc +++ b/components/password_manager/content/browser/content_password_manager_driver.cc
@@ -13,6 +13,7 @@ #include "components/password_manager/core/browser/log_manager.h" #include "components/password_manager/core/browser/password_manager.h" #include "components/password_manager/core/browser/password_manager_client.h" +#include "components/password_manager/core/browser/password_manager_metrics_recorder.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/child_process_security_policy.h" #include "content/public/browser/navigation_entry.h" @@ -318,6 +319,10 @@ client_->GetLogManager()->LogSavePasswordProgress(log); } +void ContentPasswordManagerDriver::UserModifiedPasswordField() { + client_->GetMetricsRecorder().RecordUserModifiedPasswordField(); +} + bool ContentPasswordManagerDriver::CheckChildProcessSecurityPolicy( const GURL& url, BadMessageReason reason) {
diff --git a/components/password_manager/content/browser/content_password_manager_driver.h b/components/password_manager/content/browser/content_password_manager_driver.h index c7a867a..e801e78 100644 --- a/components/password_manager/content/browser/content_password_manager_driver.h +++ b/components/password_manager/content/browser/content_password_manager_driver.h
@@ -107,6 +107,7 @@ void ShowNotSecureWarning(base::i18n::TextDirection text_direction, const gfx::RectF& bounds) override; void RecordSavePasswordProgress(const std::string& log) override; + void UserModifiedPasswordField() override; void SaveGenerationFieldDetectedByClassifier( const autofill::PasswordForm& password_form, const base::string16& generation_field) override;
diff --git a/components/password_manager/core/browser/BUILD.gn b/components/password_manager/core/browser/BUILD.gn index ef39e4c..4a2ce05 100644 --- a/components/password_manager/core/browser/BUILD.gn +++ b/components/password_manager/core/browser/BUILD.gn
@@ -98,6 +98,8 @@ "password_manager_driver.h", "password_manager_internals_service.cc", "password_manager_internals_service.h", + "password_manager_metrics_recorder.cc", + "password_manager_metrics_recorder.h", "password_manager_metrics_util.cc", "password_manager_metrics_util.h", "password_manager_util.cc", @@ -120,6 +122,8 @@ "password_ui_utils.h", "psl_matching_helper.cc", "psl_matching_helper.h", + "site_affiliation/asset_link_data.cc", + "site_affiliation/asset_link_data.h", "site_affiliation/asset_link_retriever.cc", "site_affiliation/asset_link_retriever.h", "sql_table_builder.cc", @@ -146,6 +150,13 @@ "password_reuse_detector_consumer.cc", "password_reuse_detector_consumer.h", ] + + if (is_win || is_mac || (is_linux && !is_chromeos)) { + sources += [ + "password_store_signin_notifier.cc", + "password_store_signin_notifier.h", + ] + } } public_deps = [ @@ -315,6 +326,7 @@ "password_form_manager_unittest.cc", "password_form_metrics_recorder_unittest.cc", "password_generation_manager_unittest.cc", + "password_manager_metrics_recorder_unittest.cc", "password_manager_unittest.cc", "password_manager_util_unittest.cc", "password_store_default_unittest.cc", @@ -323,6 +335,7 @@ "password_syncable_service_unittest.cc", "password_ui_utils_unittest.cc", "psl_matching_helper_unittest.cc", + "site_affiliation/asset_link_data_unittest.cc", "site_affiliation/asset_link_retriever_unittest.cc", "sql_table_builder_unittest.cc", "statistics_table_unittest.cc",
diff --git a/components/password_manager/core/browser/android_affiliation/affiliated_match_helper.cc b/components/password_manager/core/browser/android_affiliation/affiliated_match_helper.cc index b08c98f..b4c85c64 100644 --- a/components/password_manager/core/browser/android_affiliation/affiliated_match_helper.cc +++ b/components/password_manager/core/browser/android_affiliation/affiliated_match_helper.cc
@@ -125,10 +125,6 @@ barrier_closure.Run(); } -void AffiliatedMatchHelper::TrimAffiliationCache() { - affiliation_service_->TrimCache(); -} - // static bool AffiliatedMatchHelper::IsValidAndroidCredential( const PasswordStore::FormDigest& form) {
diff --git a/components/password_manager/core/browser/android_affiliation/affiliated_match_helper.h b/components/password_manager/core/browser/android_affiliation/affiliated_match_helper.h index 42b3c727..2266160 100644 --- a/components/password_manager/core/browser/android_affiliation/affiliated_match_helper.h +++ b/components/password_manager/core/browser/android_affiliation/affiliated_match_helper.h
@@ -89,9 +89,6 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> forms, const PasswordFormsCallback& result_callback); - // Removes cached affiliation data that is no longer needed. - void TrimAffiliationCache(); - // Returns whether or not |form| represents an Android credential. static bool IsValidAndroidCredential(const PasswordStore::FormDigest& form);
diff --git a/components/password_manager/core/browser/android_affiliation/affiliation_backend.cc b/components/password_manager/core/browser/android_affiliation/affiliation_backend.cc index 43cd38e..4221dafe 100644 --- a/components/password_manager/core/browser/android_affiliation/affiliation_backend.cc +++ b/components/password_manager/core/browser/android_affiliation/affiliation_backend.cc
@@ -98,15 +98,6 @@ facet_managers_.erase(facet_uri); } -void AffiliationBackend::TrimCache() { - DCHECK(thread_checker_ && thread_checker_->CalledOnValidThread()); - - std::vector<AffiliatedFacetsWithUpdateTime> all_affiliations; - cache_->GetAllAffiliations(&all_affiliations); - for (const auto& affiliation : all_affiliations) - DiscardCachedDataIfNoLongerNeeded(affiliation.facets); -} - void AffiliationBackend::TrimCacheForFacet(const FacetURI& facet_uri) { DCHECK(thread_checker_ && thread_checker_->CalledOnValidThread());
diff --git a/components/password_manager/core/browser/android_affiliation/affiliation_backend.h b/components/password_manager/core/browser/android_affiliation/affiliation_backend.h index 3f1f140..467cc650 100644 --- a/components/password_manager/core/browser/android_affiliation/affiliation_backend.h +++ b/components/password_manager/core/browser/android_affiliation/affiliation_backend.h
@@ -81,7 +81,6 @@ void Prefetch(const FacetURI& facet_uri, const base::Time& keep_fresh_until); void CancelPrefetch(const FacetURI& facet_uri, const base::Time& keep_fresh_until); - void TrimCache(); void TrimCacheForFacet(const FacetURI& facet_uri); // Deletes the cache database file at |db_path|, and all auxiliary files. The
diff --git a/components/password_manager/core/browser/android_affiliation/affiliation_backend_unittest.cc b/components/password_manager/core/browser/android_affiliation/affiliation_backend_unittest.cc index b02cd72..9f91baf 100644 --- a/components/password_manager/core/browser/android_affiliation/affiliation_backend_unittest.cc +++ b/components/password_manager/core/browser/android_affiliation/affiliation_backend_unittest.cc
@@ -793,76 +793,6 @@ EXPECT_FALSE(backend_task_runner()->HasPendingTask()); } -// Verify removal of equivalence classes that contain only facets for which -// there are no FacetManagers. -TEST_F(AffiliationBackendTest, TrimCacheDiscardsDataWithoutFacetManagers) { - ASSERT_NO_FATAL_FAILURE(GetAffiliationsAndExpectFetchAndThenResult( - FacetURI::FromCanonicalSpec(kTestFacetURIAlpha1), - GetTestEquivalenceClassAlpha())); - ASSERT_NO_FATAL_FAILURE(PrefetchAndExpectFetch( - FacetURI::FromCanonicalSpec(kTestFacetURIBeta1), - backend_task_runner()->Now() + GetShortTestPeriod())); - Prefetch(FacetURI::FromCanonicalSpec(kTestFacetURIBeta2), base::Time::Max()); - ASSERT_NO_FATAL_FAILURE(ExpectNoFetchNeeded()); - EXPECT_EQ(2u, GetNumOfEquivalenceClassInDatabase()); - - AdvanceTime(GetShortTestPeriod()); - - // Worst-case scenario: the first prefetch has just expired, the other has - // just been canceled when TrimCache() is called; plus immediately afterwards - // the backend is destroyed. - ASSERT_NO_FATAL_FAILURE(CancelPrefetch( - FacetURI::FromCanonicalSpec(kTestFacetURIBeta2), base::Time::Max())); - backend()->TrimCache(); - DestroyBackend(); - EXPECT_EQ(0u, GetNumOfEquivalenceClassInDatabase()); -} - -// Verify removal of equivalence classes that contain only facets for which -// there are only FacetManagers that do not need the data. -TEST_F(AffiliationBackendTest, - TrimCacheDiscardsDataNoLongerNeededByFacetManagers) { - FacetURI facet_uri(FacetURI::FromCanonicalSpec(kTestFacetURIAlpha1)); - - // Set up some stale data in the database. - ASSERT_NO_FATAL_FAILURE(GetAffiliationsAndExpectFetchAndThenResult( - facet_uri, GetTestEquivalenceClassAlpha())); - AdvanceTime(GetCacheHardExpiryPeriod()); - EXPECT_FALSE(IsCachedDataFreshForFacet(facet_uri)); - - // Now start prefetching the same facet, but keep the network fetch hanging. - Prefetch(facet_uri, base::Time::Max()); - ASSERT_TRUE(mock_fetch_throttler()->has_signaled_network_request_needed()); - EXPECT_EQ(1u, GetNumOfEquivalenceClassInDatabase()); - - // The already stale data should be removed regardless of the active prefetch. - backend()->TrimCache(); - EXPECT_EQ(0u, GetNumOfEquivalenceClassInDatabase()); - - mock_fetch_throttler()->reset_signaled_network_request_needed(); -} - -// Verify preservation of equivalence classes that contain >= 1 facet for which -// there is a FacetManager claiming that it needs to keep the data. -TEST_F(AffiliationBackendTest, TrimCacheRetainsDataThatNeededByFacetManagers) { - FacetURI facet_uri(FacetURI::FromCanonicalSpec(kTestFacetURIAlpha1)); - - ASSERT_NO_FATAL_FAILURE(PrefetchAndExpectFetch( - facet_uri, backend_task_runner()->Now() + GetCacheHardExpiryPeriod())); - backend()->TrimCache(); - - // Also verify that the last update time of the affiliation data is preserved, - // i.e., that it expires when it would normally have expired. - AdvanceTime(GetCacheHardExpiryPeriod() - Epsilon()); - EXPECT_TRUE(IsCachedDataFreshForFacet(facet_uri)); - ASSERT_NO_FATAL_FAILURE(ExpectThatEquivalenceClassIsServedFromCache( - GetTestEquivalenceClassAlpha())); - AdvanceTime(Epsilon()); - EXPECT_FALSE(IsCachedDataFreshForFacet(facet_uri)); - ASSERT_NO_FATAL_FAILURE( - GetAffiliationsAndExpectFailureWithoutFetch(facet_uri)); -} - // Verify that TrimCacheForFacet() only removes the equivalence class for the // given facet, and preserves others (even if they could be discarded). TEST_F(AffiliationBackendTest,
diff --git a/components/password_manager/core/browser/android_affiliation/affiliation_service.cc b/components/password_manager/core/browser/android_affiliation/affiliation_service.cc index 5646562..71463423 100644 --- a/components/password_manager/core/browser/android_affiliation/affiliation_service.cc +++ b/components/password_manager/core/browser/android_affiliation/affiliation_service.cc
@@ -82,14 +82,6 @@ base::Unretained(backend_), facet_uri, keep_fresh_until)); } -void AffiliationService::TrimCache() { - DCHECK(thread_checker_.CalledOnValidThread()); - DCHECK(backend_); - backend_task_runner_->PostTask( - FROM_HERE, - base::Bind(&AffiliationBackend::TrimCache, base::Unretained(backend_))); -} - void AffiliationService::TrimCacheForFacet(const FacetURI& facet_uri) { DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(backend_); @@ -98,12 +90,4 @@ base::Unretained(backend_), facet_uri)); } -// static -void AffiliationService::DeleteCache( - const base::FilePath& db_path, - base::SingleThreadTaskRunner* backend_task_runner) { - backend_task_runner->PostTask( - FROM_HERE, base::Bind(&AffiliationBackend::DeleteCache, db_path)); -} - } // namespace password_manager
diff --git a/components/password_manager/core/browser/android_affiliation/affiliation_service.h b/components/password_manager/core/browser/android_affiliation/affiliation_service.h index 835cccd9..5e94a3a 100644 --- a/components/password_manager/core/browser/android_affiliation/affiliation_service.h +++ b/components/password_manager/core/browser/android_affiliation/affiliation_service.h
@@ -139,19 +139,11 @@ // Wipes results of on-demand fetches and expired prefetches from the cache, // but retains information corresponding to facets that are being kept fresh. // As no required data is deleted, there will be no network requests directly - // triggered by this call. - // - // The second version will only potentially remove data corresponding to the - // given |facet_uri|, but still only as long as the data is no longer needed. - virtual void TrimCache(); + // triggered by this call. It will only potentially remove data + // corresponding to the given |facet_uri|, but still only as long as the + // data is no longer needed. virtual void TrimCacheForFacet(const FacetURI& facet_uri); - // Posts a task to the |backend_task_runner| to delete the cache database file - // at |db_path|, and all auxiliary files. The database must be closed before - // calling this. - static void DeleteCache(const base::FilePath& db_path, - base::SingleThreadTaskRunner* backend_task_runner); - private: // The backend, owned by this AffiliationService instance, but living on the // DB thread. It will be deleted asynchronously during shutdown on the DB
diff --git a/components/password_manager/core/browser/hash_password_manager.cc b/components/password_manager/core/browser/hash_password_manager.cc index 62d4596d..a12d7bd7 100644 --- a/components/password_manager/core/browser/hash_password_manager.cc +++ b/components/password_manager/core/browser/hash_password_manager.cc
@@ -4,20 +4,33 @@ #include "components/password_manager/core/browser/hash_password_manager.h" +#include "base/base64.h" #include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" +#include "components/os_crypt/os_crypt.h" #include "components/password_manager/core/common/password_manager_pref_names.h" #include "components/prefs/pref_service.h" +#include "crypto/random.h" + +namespace { +constexpr size_t kSyncPasswordSaltLength = 16; +constexpr char kSeparator = '.'; +} // namespace namespace password_manager { -void HashPasswordManager::SavePasswordHash(const base::string16& password) { - if (prefs_) { - // TODO(crbug.com/657041) Implement creating a salt, hash calculation, - // encrypting and saving of hash of |password| into preference - // kSyncPasswordHash. - prefs_->SetString(prefs::kSyncPasswordHash, std::string()); - } +bool HashPasswordManager::SavePasswordHash(const base::string16& password) { + if (!prefs_) + return false; + + std::string salt = CreateRandomSalt(); + // TODO(crbug.com/657041) Implement hash calculation. + prefs_->SetString(prefs::kSyncPasswordHash, std::string()); + + // Password length and salt are stored together. + std::string length_salt = LengthAndSaltToString(salt, password.size()); + return EncryptAndSaveToPrefs(prefs::kSyncPasswordLengthAndHashSalt, + length_salt); } void HashPasswordManager::ClearSavedPasswordHash() { @@ -28,11 +41,77 @@ base::Optional<SyncPasswordData> HashPasswordManager::RetrievePasswordHash() { if (!prefs_ || !prefs_->HasPrefPath(prefs::kSyncPasswordHash)) return base::Optional<SyncPasswordData>(); + SyncPasswordData result; - if (!base::StringToUint64(prefs_->GetString(prefs::kSyncPasswordHash), - &result.hash)) - return base::Optional<SyncPasswordData>(); + std::string hash_str = + RetrivedDecryptedStringFromPrefs(prefs::kSyncPasswordHash); + // TODO(crbug.com/657041) Add checking of hash correctness retrieving when + // hash calculation is implemented. + if (!base::StringToUint64(hash_str, &result.hash)) + result.hash = 0; + + StringToLengthAndSalt( + RetrivedDecryptedStringFromPrefs(prefs::kSyncPasswordLengthAndHashSalt), + &result.length, &result.salt); return result; } +std::string HashPasswordManager::CreateRandomSalt() { + char buffer[kSyncPasswordSaltLength]; + crypto::RandBytes(buffer, kSyncPasswordSaltLength); + // Explicit std::string constructor with a string length must be used in order + // to avoid treating '\0' symbols as a string ends. + std::string result(buffer, kSyncPasswordSaltLength); + return result; +} + +std::string HashPasswordManager::LengthAndSaltToString(const std::string& salt, + size_t password_length) { + return base::SizeTToString(password_length) + kSeparator + salt; +} + +void HashPasswordManager::StringToLengthAndSalt(const std::string& s, + size_t* password_length, + std::string* salt) { + DCHECK(s.find(kSeparator) != std::string::npos); + DCHECK(salt); + size_t separator_index = s.find(kSeparator); + std::string prefix = s.substr(0, separator_index); + + bool is_converted = base::StringToSizeT(prefix, password_length); + DCHECK(is_converted); + + *salt = s.substr(separator_index + 1); +} + +bool HashPasswordManager::EncryptAndSaveToPrefs(const std::string& pref_name, + const std::string& s) { + DCHECK(prefs_); + std::string encrypted_text; + if (!OSCrypt::EncryptString(s, &encrypted_text)) + return false; + std::string encrypted_base64_text; + base::Base64Encode(encrypted_text, &encrypted_base64_text); + prefs_->SetString(pref_name, encrypted_base64_text); + return true; +} + +std::string HashPasswordManager::RetrivedDecryptedStringFromPrefs( + const std::string& pref_name) { + DCHECK(prefs_); + std::string encrypted_base64_text = prefs_->GetString(pref_name); + if (encrypted_base64_text.empty()) + return std::string(); + + std::string encrypted_text; + if (!base::Base64Decode(encrypted_base64_text, &encrypted_text)) + return std::string(); + + std::string plain_text; + if (!OSCrypt::DecryptString(encrypted_text, &plain_text)) + return std::string(); + + return plain_text; +} + } // namespace password_manager
diff --git a/components/password_manager/core/browser/hash_password_manager.h b/components/password_manager/core/browser/hash_password_manager.h index dd30872..03b17211 100644 --- a/components/password_manager/core/browser/hash_password_manager.h +++ b/components/password_manager/core/browser/hash_password_manager.h
@@ -15,7 +15,8 @@ struct SyncPasswordData { uint64_t hash; - // TODO(crbug.com/722414): Add salt. + std::string salt; + size_t length; }; // Responsible for saving, clearing, retrieving and encryption of a sync @@ -26,7 +27,7 @@ HashPasswordManager() = default; ~HashPasswordManager() = default; - void SavePasswordHash(const base::string16& password); + bool SavePasswordHash(const base::string16& password); void ClearSavedPasswordHash(); // Returns empty if no hash is available. @@ -35,6 +36,26 @@ void set_prefs(PrefService* prefs) { prefs_ = prefs; } private: + std::string CreateRandomSalt(); + + // Packs |salt| and |password_length| to a string. + std::string LengthAndSaltToString(const std::string& salt, + size_t password_length); + + // Unpacks |salt| and |password_length| from a string |s|. + void StringToLengthAndSalt(const std::string& s, + size_t* password_length, + std::string* salt); + + // Saves encrypted string |s| in a preference |pref_name|. Return true on + // success. + bool EncryptAndSaveToPrefs(const std::string& pref_name, + const std::string& s); + + // Retrieves and decrypts string value from a preference |pref_name|. Return + // an empty string on failure. + std::string RetrivedDecryptedStringFromPrefs(const std::string& pref_name); + PrefService* prefs_ = nullptr; DISALLOW_COPY_AND_ASSIGN(HashPasswordManager);
diff --git a/components/password_manager/core/browser/hash_password_manager_unittest.cc b/components/password_manager/core/browser/hash_password_manager_unittest.cc index b647090..06ef4c445 100644 --- a/components/password_manager/core/browser/hash_password_manager_unittest.cc +++ b/components/password_manager/core/browser/hash_password_manager_unittest.cc
@@ -5,6 +5,7 @@ #include "components/password_manager/core/browser/hash_password_manager.h" #include "base/strings/utf_string_conversions.h" +#include "components/os_crypt/os_crypt_mocker.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" @@ -15,18 +16,24 @@ class HashPasswordManagerTest : public testing::Test { public: - // testing::Test: - void SetUp() override; + HashPasswordManagerTest() { + prefs_.registry()->RegisterStringPref(prefs::kSyncPasswordHash, + std::string(), + PrefRegistry::NO_REGISTRATION_FLAGS); + prefs_.registry()->RegisterStringPref(prefs::kSyncPasswordLengthAndHashSalt, + std::string(), + PrefRegistry::NO_REGISTRATION_FLAGS); +#if defined(OS_MACOSX) + // Mock Keychain. There is a call to Keychain on initializling + // PasswordReuseDetector, so it should be mocked. + OSCryptMocker::SetUpWithSingleton(); +#endif + } protected: TestingPrefServiceSimple prefs_; }; -void HashPasswordManagerTest::SetUp() { - prefs_.registry()->RegisterStringPref(prefs::kSyncPasswordHash, std::string(), - PrefRegistry::NO_REGISTRATION_FLAGS); -} - TEST_F(HashPasswordManagerTest, Saving) { ASSERT_FALSE(prefs_.HasPrefPath(prefs::kSyncPasswordHash)); HashPasswordManager hash_password_manager; @@ -49,8 +56,15 @@ HashPasswordManager hash_password_manager; hash_password_manager.set_prefs(&prefs_); hash_password_manager.SavePasswordHash(base::ASCIIToUTF16("sync_password")); - // TODO(crbug.com/657041) Fix this text when hash calculation is implemented. - EXPECT_FALSE(hash_password_manager.RetrievePasswordHash()); + EXPECT_TRUE(prefs_.HasPrefPath(prefs::kSyncPasswordLengthAndHashSalt)); + + base::Optional<SyncPasswordData> sync_password_date = + hash_password_manager.RetrievePasswordHash(); + ASSERT_TRUE(sync_password_date); + EXPECT_EQ(13u, sync_password_date->length); + EXPECT_EQ(16u, sync_password_date->salt.size()); + // TODO(crbug.com/657041) Add proper checking of hash when hash calculation is + // implemented. } } // namespace
diff --git a/components/password_manager/core/browser/login_database.cc b/components/password_manager/core/browser/login_database.cc index 5dd266f..e7726d2 100644 --- a/components/password_manager/core/browser/login_database.cc +++ b/components/password_manager/core/browser/login_database.cc
@@ -361,6 +361,7 @@ builder->AddColumn("date_created", "INTEGER NOT NULL"); builder->AddColumn("blacklisted_by_user", "INTEGER NOT NULL"); builder->AddColumn("scheme", "INTEGER NOT NULL"); + builder->AddIndex("logins_signon", {"signon_realm"}); builder->SealVersion(); unsigned version = builder->SealVersion(); DCHECK_EQ(1u, version);
diff --git a/components/password_manager/core/browser/mock_password_store.h b/components/password_manager/core/browser/mock_password_store.h index fe210f3d..7c67c9b 100644 --- a/components/password_manager/core/browser/mock_password_store.h +++ b/components/password_manager/core/browser/mock_password_store.h
@@ -82,6 +82,10 @@ void(const base::string16&, const std::string&, PasswordReuseDetectorConsumer*)); +#if !defined(OS_CHROMEOS) + MOCK_METHOD1(SaveSyncPasswordHash, void(const base::string16&)); + MOCK_METHOD0(ClearSyncPasswordHash, void()); +#endif #endif PasswordStoreSync* GetSyncInterface() { return this; }
diff --git a/components/password_manager/core/browser/password_form_manager_unittest.cc b/components/password_manager/core/browser/password_form_manager_unittest.cc index 225ac0f..61e0c39a 100644 --- a/components/password_manager/core/browser/password_form_manager_unittest.cc +++ b/components/password_manager/core/browser/password_form_manager_unittest.cc
@@ -13,6 +13,8 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" +#include "base/metrics/metrics_hashes.h" +#include "base/strings/string_piece.h" #include "base/strings/utf_string_conversions.h" #include "base/test/histogram_tester.h" #include "base/test/scoped_feature_list.h" @@ -39,6 +41,7 @@ #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "components/prefs/testing_pref_service.h" +#include "components/ukm/test_ukm_recorder.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -708,6 +711,30 @@ client()->mock_driver()->mock_autofill_download_manager()); } + // Returns the sample values of |metric_value| in events named |event_name|. + std::vector<int64_t> GetAllUkmSamples( + const ukm::TestUkmRecorder& test_ukm_recorder, + base::StringPiece event_name, + base::StringPiece metric_name) { + std::vector<int64_t> values; + const ukm::UkmSource* source = + test_ukm_recorder.GetSourceForSourceId(client()->GetUkmSourceId()); + if (!source) + return values; + + for (size_t i = 0; i < test_ukm_recorder.entries_count(); ++i) { + const ukm::mojom::UkmEntry* entry = test_ukm_recorder.GetEntry(i); + if (entry->event_hash != base::HashMetricName(event_name)) + continue; + + for (const ukm::mojom::UkmMetricPtr& metric : entry->metrics) { + if (metric->metric_hash == base::HashMetricName(metric_name)) + values.push_back(metric->value); + } + } + return values; + } + PasswordForm* observed_form() { return &observed_form_; } PasswordForm* saved_match() { return &saved_match_; } PasswordForm* psl_saved_match() { return &psl_saved_match_; } @@ -3452,6 +3479,7 @@ SCOPED_TRACE(test_case.expected_histogram_sample_generated); base::HistogramTester histogram_tester; + ukm::TestUkmRecorder test_ukm_recorder; std::vector<PasswordForm> suppressed_forms; for (const auto* form_data : test_case.simulated_suppressed_forms) { @@ -3460,6 +3488,11 @@ form_data->password_value, form_data->manual_or_generated)); } + // Bind the UKM SourceId to any URL, it does not matter. The SourceId + // needs to be bound, though, for reporting to happen. + client()->GetUkmRecorder()->UpdateSourceURL(client()->GetUkmSourceId(), + GURL("https://example.com/")); + std::vector<const PasswordForm*> suppressed_forms_ptrs; for (const auto& form : suppressed_forms) suppressed_forms_ptrs.push_back(&form); @@ -3485,11 +3518,27 @@ ::testing::ElementsAre( base::Bucket(test_case.expected_histogram_sample_generated, 1))); EXPECT_THAT( + GetAllUkmSamples( + test_ukm_recorder, "PasswordForm", + "SuppressedAccount.Generated." + + std::string(suppression_params.expected_histogram_suffix)), + ::testing::ElementsAre( + test_case.expected_histogram_sample_generated / + PasswordFormMetricsRecorder::kMaxNumActionsTakenNew)); + EXPECT_THAT( histogram_tester.GetAllSamples( "PasswordManager.SuppressedAccount.Manual." + std::string(suppression_params.expected_histogram_suffix)), ::testing::ElementsAre( base::Bucket(test_case.expected_histogram_sample_manual, 1))); + EXPECT_THAT( + GetAllUkmSamples( + test_ukm_recorder, "PasswordForm", + "SuppressedAccount.Manual." + + std::string(suppression_params.expected_histogram_suffix)), + ::testing::ElementsAre( + test_case.expected_histogram_sample_manual / + PasswordFormMetricsRecorder::kMaxNumActionsTakenNew)); } } }
diff --git a/components/password_manager/core/browser/password_form_metrics_recorder.cc b/components/password_manager/core/browser/password_form_metrics_recorder.cc index 3e585dd..930e99e7 100644 --- a/components/password_manager/core/browser/password_form_metrics_recorder.cc +++ b/components/password_manager/core/browser/password_form_metrics_recorder.cc
@@ -158,56 +158,73 @@ void PasswordFormMetricsRecorder::RecordHistogramsOnSuppressedAccounts( bool observed_form_origin_has_cryptographic_scheme, const FormFetcher& form_fetcher, - const PasswordForm& pending_credentials) const { + const PasswordForm& pending_credentials) { UMA_HISTOGRAM_BOOLEAN("PasswordManager.QueryingSuppressedAccountsFinished", form_fetcher.DidCompleteQueryingSuppressedForms()); if (!form_fetcher.DidCompleteQueryingSuppressedForms()) return; + SuppressedAccountExistence best_match = kSuppressedAccountNone; + if (!observed_form_origin_has_cryptographic_scheme) { + best_match = GetBestMatchingSuppressedAccount( + form_fetcher.GetSuppressedHTTPSForms(), PasswordForm::TYPE_GENERATED, + pending_credentials); UMA_HISTOGRAM_ENUMERATION( "PasswordManager.SuppressedAccount.Generated.HTTPSNotHTTP", - GetHistogramSampleForSuppressedAccounts( - form_fetcher.GetSuppressedHTTPSForms(), - PasswordForm::TYPE_GENERATED, pending_credentials), + GetHistogramSampleForSuppressedAccounts(best_match), kMaxSuppressedAccountStats); + RecordUkmMetric("SuppressedAccount.Generated.HTTPSNotHTTP", best_match); + + best_match = GetBestMatchingSuppressedAccount( + form_fetcher.GetSuppressedHTTPSForms(), PasswordForm::TYPE_MANUAL, + pending_credentials); UMA_HISTOGRAM_ENUMERATION( "PasswordManager.SuppressedAccount.Manual.HTTPSNotHTTP", - GetHistogramSampleForSuppressedAccounts( - form_fetcher.GetSuppressedHTTPSForms(), PasswordForm::TYPE_MANUAL, - pending_credentials), + GetHistogramSampleForSuppressedAccounts(best_match), kMaxSuppressedAccountStats); + RecordUkmMetric("SuppressedAccount.Manual.HTTPSNotHTTP", best_match); } + best_match = GetBestMatchingSuppressedAccount( + form_fetcher.GetSuppressedPSLMatchingForms(), + PasswordForm::TYPE_GENERATED, pending_credentials); UMA_HISTOGRAM_ENUMERATION( "PasswordManager.SuppressedAccount.Generated.PSLMatching", - GetHistogramSampleForSuppressedAccounts( - form_fetcher.GetSuppressedPSLMatchingForms(), - PasswordForm::TYPE_GENERATED, pending_credentials), + GetHistogramSampleForSuppressedAccounts(best_match), kMaxSuppressedAccountStats); + RecordUkmMetric("SuppressedAccount.Generated.PSLMatching", best_match); + best_match = GetBestMatchingSuppressedAccount( + form_fetcher.GetSuppressedPSLMatchingForms(), PasswordForm::TYPE_MANUAL, + pending_credentials); UMA_HISTOGRAM_ENUMERATION( "PasswordManager.SuppressedAccount.Manual.PSLMatching", - GetHistogramSampleForSuppressedAccounts( - form_fetcher.GetSuppressedPSLMatchingForms(), - PasswordForm::TYPE_MANUAL, pending_credentials), + GetHistogramSampleForSuppressedAccounts(best_match), kMaxSuppressedAccountStats); + RecordUkmMetric("SuppressedAccount.Manual.PSLMatching", best_match); + best_match = GetBestMatchingSuppressedAccount( + form_fetcher.GetSuppressedSameOrganizationNameForms(), + PasswordForm::TYPE_GENERATED, pending_credentials); UMA_HISTOGRAM_ENUMERATION( "PasswordManager.SuppressedAccount.Generated.SameOrganizationName", - GetHistogramSampleForSuppressedAccounts( - form_fetcher.GetSuppressedSameOrganizationNameForms(), - PasswordForm::TYPE_GENERATED, pending_credentials), + GetHistogramSampleForSuppressedAccounts(best_match), kMaxSuppressedAccountStats); + RecordUkmMetric("SuppressedAccount.Generated.SameOrganizationName", + best_match); + best_match = GetBestMatchingSuppressedAccount( + form_fetcher.GetSuppressedSameOrganizationNameForms(), + PasswordForm::TYPE_MANUAL, pending_credentials); UMA_HISTOGRAM_ENUMERATION( "PasswordManager.SuppressedAccount.Manual.SameOrganizationName", - GetHistogramSampleForSuppressedAccounts( - form_fetcher.GetSuppressedSameOrganizationNameForms(), - PasswordForm::TYPE_MANUAL, pending_credentials), + GetHistogramSampleForSuppressedAccounts(best_match), kMaxSuppressedAccountStats); + RecordUkmMetric("SuppressedAccount.Manual.SameOrganizationName", best_match); } -int PasswordFormMetricsRecorder::GetHistogramSampleForSuppressedAccounts( +PasswordFormMetricsRecorder::SuppressedAccountExistence +PasswordFormMetricsRecorder::GetBestMatchingSuppressedAccount( const std::vector<const PasswordForm*>& suppressed_forms, PasswordForm::Type manual_or_generated, const PasswordForm& pending_credentials) const { @@ -228,7 +245,11 @@ best_matching_account = std::max(best_matching_account, current_account); } + return best_matching_account; +} +int PasswordFormMetricsRecorder::GetHistogramSampleForSuppressedAccounts( + SuppressedAccountExistence best_matching_account) const { // Encoding: most significant digit is the |best_matching_account|. int mixed_base_encoding = 0; mixed_base_encoding += best_matching_account;
diff --git a/components/password_manager/core/browser/password_form_metrics_recorder.h b/components/password_manager/core/browser/password_form_metrics_recorder.h index fd36b54..277bb9a 100644 --- a/components/password_manager/core/browser/password_form_metrics_recorder.h +++ b/components/password_manager/core/browser/password_form_metrics_recorder.h
@@ -165,7 +165,7 @@ void RecordHistogramsOnSuppressedAccounts( bool observed_form_origin_has_cryptographic_scheme, const FormFetcher& form_fetcher, - const autofill::PasswordForm& pending_credentials) const; + const autofill::PasswordForm& pending_credentials); // Converts the "ActionsTaken" fields (using ManagerActionNew) into an int so // they can be logged to UMA. @@ -179,21 +179,26 @@ // When supplied with the list of all |suppressed_forms| that belong to // certain suppressed credential type (see FormFetcher::GetSuppressed*), - // filters that list down to forms that are either |manual_or_generated|, and - // based on that, computes the histogram sample that is a mixed-based - // representation of a combination of four attributes: + // filters that list down to forms whose type matches |manual_or_generated|, + // and selects the suppressed account that matches |pending_credentials| most + // closely. |pending_credentials| stores credentials when the form was + // submitted but success was still unknown. It contains credentials that are + // ready to be written (saved or updated) to a password store. + SuppressedAccountExistence GetBestMatchingSuppressedAccount( + const std::vector<const autofill::PasswordForm*>& suppressed_forms, + autofill::PasswordForm::Type manual_or_generated, + const autofill::PasswordForm& pending_credentials) const; + + // Encodes a UMA histogram sample for |best_matching_account| and + // GetActionsTakenNew(). This is a mixed-based representation of a combination + // of four attributes: // -- whether there were suppressed credentials (and if so, their relation to // the submitted username/password). // -- whether the |observed_form_| got ultimately submitted // -- what action the password manager performed (|manager_action_|), // -- and what action the user performed (|user_action_|_). - // |pending_credentials| stores credentials when the form was submitted but - // success was still unknown. It contains credentials that are ready to be - // written (saved or updated) to a password store. int GetHistogramSampleForSuppressedAccounts( - const std::vector<const autofill::PasswordForm*>& suppressed_forms, - autofill::PasswordForm::Type manual_or_generated, - const autofill::PasswordForm& pending_credentials) const; + SuppressedAccountExistence best_matching_account) const; // Records a metric into |ukm_entry_builder_| if it is not nullptr. void RecordUkmMetric(const char* metric_name, int64_t value);
diff --git a/components/password_manager/core/browser/password_form_metrics_recorder_unittest.cc b/components/password_manager/core/browser/password_form_metrics_recorder_unittest.cc index 92bd5e4..6ec82889 100644 --- a/components/password_manager/core/browser/password_form_metrics_recorder_unittest.cc +++ b/components/password_manager/core/browser/password_form_metrics_recorder_unittest.cc
@@ -15,12 +15,12 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -namespace { -constexpr char kTestUrl[] = "https://www.example.com/"; -} - namespace password_manager { +namespace { + +constexpr char kTestUrl[] = "https://www.example.com/"; + // Create a UkmEntryBuilder with a SourceId that is initialized for kTestUrl. std::unique_ptr<ukm::UkmEntryBuilder> CreateUkmEntryBuilder( ukm::TestUkmRecorder* test_ukm_recorder) { @@ -38,12 +38,12 @@ int64_t value, int64_t expected_count) { const ukm::UkmSource* source = test_ukm_recorder->GetSourceForUrl(kTestUrl); - ASSERT_NE(nullptr, source); + ASSERT_TRUE(source); ASSERT_EQ(1U, test_ukm_recorder->entries_count()); const ukm::mojom::UkmEntry* entry = test_ukm_recorder->GetEntry(0); - int occurrences = 0; + int64_t occurrences = 0; for (const ukm::mojom::UkmMetricPtr& metric : entry->metrics) { if (metric->metric_hash == base::HashMetricName(metric_name) && metric->value == value) @@ -52,6 +52,8 @@ EXPECT_EQ(expected_count, occurrences) << metric_name << ": " << value; } +} // namespace + // Test the metrics recorded around password generation and the user's // interaction with the offer to generate passwords. TEST(PasswordFormMetricsRecorder, Generation) {
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc index 4499d51b..2cd6ade 100644 --- a/components/password_manager/core/browser/password_manager.cc +++ b/components/password_manager/core/browser/password_manager.cc
@@ -28,6 +28,7 @@ #include "components/password_manager/core/browser/password_form_manager.h" #include "components/password_manager/core/browser/password_manager_client.h" #include "components/password_manager/core/browser/password_manager_driver.h" +#include "components/password_manager/core/browser/password_manager_metrics_recorder.h" #include "components/password_manager/core/browser/password_manager_metrics_util.h" #include "components/password_manager/core/browser/password_manager_util.h" #include "components/password_manager/core/common/password_manager_features.h" @@ -157,6 +158,9 @@ registry->RegisterBooleanPref(prefs::kWasObsoleteHttpDataCleaned, false); registry->RegisterStringPref(prefs::kSyncPasswordHash, std::string(), PrefRegistry::NO_REGISTRATION_FLAGS); + registry->RegisterStringPref(prefs::kSyncPasswordLengthAndHashSalt, + std::string(), + PrefRegistry::NO_REGISTRATION_FLAGS); #if defined(OS_MACOSX) registry->RegisterIntegerPref( prefs::kKeychainMigrationStatus, @@ -267,13 +271,17 @@ } if (!is_saving_and_filling_enabled) { - RecordFailure(SAVING_DISABLED, form.origin, logger.get()); + client_->GetMetricsRecorder().RecordProvisionalSaveFailure( + PasswordManagerMetricsRecorder::SAVING_DISABLED, main_frame_url_, + form.origin, logger.get()); return; } // No password to save? Then don't. if (PasswordFormManager::PasswordToSave(form).empty()) { - RecordFailure(EMPTY_PASSWORD, form.origin, logger.get()); + client_->GetMetricsRecorder().RecordProvisionalSaveFailure( + PasswordManagerMetricsRecorder::EMPTY_PASSWORD, main_frame_url_, + form.origin, logger.get()); return; } @@ -281,10 +289,9 @@ metrics_util::LogShouldBlockPasswordForSameOriginButDifferentScheme( should_block); if (should_block) { - if (logger) - logger->LogSuccessiveOrigins( - Logger::STRING_BLOCK_PASSWORD_SAME_ORIGIN_INSECURE_SCHEME, - main_frame_url_.GetOrigin(), form.origin.GetOrigin()); + client_->GetMetricsRecorder().RecordProvisionalSaveFailure( + PasswordManagerMetricsRecorder::SAVING_ON_HTTP_AFTER_HTTPS, + main_frame_url_, form.origin, logger.get()); return; } @@ -341,7 +348,9 @@ // first loading the page containing the form. Don't offer to save // passwords in this case. if (matched_manager_it == pending_login_managers_.end()) { - RecordFailure(NO_MATCHING_FORM, form.origin, logger.get()); + client_->GetMetricsRecorder().RecordProvisionalSaveFailure( + PasswordManagerMetricsRecorder::NO_MATCHING_FORM, main_frame_url_, + form.origin, logger.get()); return; } @@ -414,43 +423,6 @@ return !pending_login_managers_.empty(); } -void PasswordManager::RecordFailure(ProvisionalSaveFailure failure, - const GURL& form_origin, - BrowserSavePasswordProgressLogger* logger) { - UMA_HISTOGRAM_ENUMERATION( - "PasswordManager.ProvisionalSaveFailure", failure, MAX_FAILURE_VALUE); - - if (logger) { - switch (failure) { - case SAVING_DISABLED: - logger->LogMessage(Logger::STRING_SAVING_DISABLED); - break; - case EMPTY_PASSWORD: - logger->LogMessage(Logger::STRING_EMPTY_PASSWORD); - break; - case MATCHING_NOT_COMPLETE: - logger->LogMessage(Logger::STRING_MATCHING_NOT_COMPLETE); - break; - case NO_MATCHING_FORM: - logger->LogMessage(Logger::STRING_NO_MATCHING_FORM); - break; - case FORM_BLACKLISTED: - logger->LogMessage(Logger::STRING_FORM_BLACKLISTED); - break; - case INVALID_FORM: - logger->LogMessage(Logger::STRING_INVALID_FORM); - break; - case SYNC_CREDENTIAL: - logger->LogMessage(Logger::STRING_SYNC_CREDENTIAL); - break; - case MAX_FAILURE_VALUE: - NOTREACHED(); - return; - } - logger->LogMessage(Logger::STRING_DECISION_DROP); - } -} - void PasswordManager::AddSubmissionCallback( const PasswordSubmittedCallback& callback) { submission_callbacks_.push_back(callback); @@ -596,9 +568,9 @@ FormFetcher::State::WAITING) { // We have a provisional save manager, but it didn't finish matching yet. // We just give up. - RecordFailure(MATCHING_NOT_COMPLETE, - provisional_save_manager_->observed_form().origin, - logger.get()); + client_->GetMetricsRecorder().RecordProvisionalSaveFailure( + PasswordManagerMetricsRecorder::MATCHING_NOT_COMPLETE, main_frame_url_, + provisional_save_manager_->observed_form().origin, logger.get()); provisional_save_manager_.reset(); return false; } @@ -747,9 +719,9 @@ if (!client_->GetStoreResultFilter()->ShouldSave( *provisional_save_manager_->submitted_form())) { provisional_save_manager_->WipeStoreCopyIfOutdated(); - RecordFailure(SYNC_CREDENTIAL, - provisional_save_manager_->observed_form().origin, - logger.get()); + client_->GetMetricsRecorder().RecordProvisionalSaveFailure( + PasswordManagerMetricsRecorder::SYNC_CREDENTIAL, main_frame_url_, + provisional_save_manager_->observed_form().origin, logger.get()); provisional_save_manager_.reset(); return; }
diff --git a/components/password_manager/core/browser/password_manager.h b/components/password_manager/core/browser/password_manager.h index c3eb149..6828108 100644 --- a/components/password_manager/core/browser/password_manager.h +++ b/components/password_manager/core/browser/password_manager.h
@@ -33,7 +33,6 @@ namespace password_manager { -class BrowserSavePasswordProgressLogger; class PasswordManagerClient; class PasswordManagerDriver; class PasswordFormManager; @@ -191,25 +190,6 @@ PasswordManagerTest, ShouldBlockPasswordForSameOriginButDifferentSchemeTest); - enum ProvisionalSaveFailure { - SAVING_DISABLED, - EMPTY_PASSWORD, - NO_MATCHING_FORM, - MATCHING_NOT_COMPLETE, - FORM_BLACKLISTED, - INVALID_FORM, - SYNC_CREDENTIAL, - MAX_FAILURE_VALUE - }; - - // Log failure for UMA. Logs additional metrics if the |form_origin| - // corresponds to one of the top, explicitly monitored websites. For some - // values of |failure| also sends logs to the internals page through |logger|, - // it |logger| is not NULL. - void RecordFailure(ProvisionalSaveFailure failure, - const GURL& form_origin, - BrowserSavePasswordProgressLogger* logger); - // Returns true if we can show possible usernames to users in cases where // the username for the form is ambigious. bool OtherPossibleUsernamesEnabled() const;
diff --git a/components/password_manager/core/browser/password_manager_client.h b/components/password_manager/core/browser/password_manager_client.h index bea1c4c..1053080f 100644 --- a/components/password_manager/core/browser/password_manager_client.h +++ b/components/password_manager/core/browser/password_manager_client.h
@@ -33,6 +33,7 @@ class LogManager; class PasswordFormManager; class PasswordManager; +class PasswordManagerMetricsRecorder; class PasswordStore; enum PasswordSyncState { @@ -223,6 +224,12 @@ // and its last committed main frame navigation. virtual ukm::SourceId GetUkmSourceId() = 0; + // Gets a metrics recorder for the currently committed navigation. + // As PasswordManagerMetricsRecorder submits metrics on destruction, a new + // instance will be returned for each committed navigation. A caller must not + // hold on to the pointer. + virtual PasswordManagerMetricsRecorder& GetMetricsRecorder() = 0; + private: DISALLOW_COPY_AND_ASSIGN(PasswordManagerClient); };
diff --git a/components/password_manager/core/browser/password_manager_metrics_recorder.cc b/components/password_manager/core/browser/password_manager_metrics_recorder.cc new file mode 100644 index 0000000..96590d5 --- /dev/null +++ b/components/password_manager/core/browser/password_manager_metrics_recorder.cc
@@ -0,0 +1,97 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/password_manager/core/browser/password_manager_metrics_recorder.h" + +#include "base/metrics/histogram_macros.h" +#include "components/autofill/core/common/save_password_progress_logger.h" +#include "components/password_manager/core/browser/browser_save_password_progress_logger.h" +#include "url/gurl.h" + +// Shorten the name to spare line breaks. The code provides enough context +// already. +typedef autofill::SavePasswordProgressLogger Logger; + +namespace password_manager { + +PasswordManagerMetricsRecorder::PasswordManagerMetricsRecorder( + std::unique_ptr<ukm::UkmEntryBuilder> ukm_entry_builder) + : ukm_entry_builder_(std::move(ukm_entry_builder)) {} + +PasswordManagerMetricsRecorder::PasswordManagerMetricsRecorder( + PasswordManagerMetricsRecorder&& that) = default; + +PasswordManagerMetricsRecorder::~PasswordManagerMetricsRecorder() { + if (user_modified_password_field_) + RecordUkmMetric("UserModifiedPasswordField", 1); +} + +PasswordManagerMetricsRecorder& PasswordManagerMetricsRecorder::operator=( + PasswordManagerMetricsRecorder&& that) = default; + +// static +std::unique_ptr<ukm::UkmEntryBuilder> +PasswordManagerMetricsRecorder::CreateUkmEntryBuilder( + ukm::UkmRecorder* ukm_recorder, + ukm::SourceId source_id) { + if (!ukm_recorder) + return nullptr; + return ukm_recorder->GetEntryBuilder(source_id, "PageWithPassword"); +} + +void PasswordManagerMetricsRecorder::RecordUserModifiedPasswordField() { + user_modified_password_field_ = true; +} + +void PasswordManagerMetricsRecorder::RecordProvisionalSaveFailure( + ProvisionalSaveFailure failure, + const GURL& main_frame_url, + const GURL& form_origin, + BrowserSavePasswordProgressLogger* logger) { + UMA_HISTOGRAM_ENUMERATION("PasswordManager.ProvisionalSaveFailure", failure, + MAX_FAILURE_VALUE); + + if (logger) { + switch (failure) { + case SAVING_DISABLED: + logger->LogMessage(Logger::STRING_SAVING_DISABLED); + break; + case EMPTY_PASSWORD: + logger->LogMessage(Logger::STRING_EMPTY_PASSWORD); + break; + case MATCHING_NOT_COMPLETE: + logger->LogMessage(Logger::STRING_MATCHING_NOT_COMPLETE); + break; + case NO_MATCHING_FORM: + logger->LogMessage(Logger::STRING_NO_MATCHING_FORM); + break; + case FORM_BLACKLISTED: + logger->LogMessage(Logger::STRING_FORM_BLACKLISTED); + break; + case INVALID_FORM: + logger->LogMessage(Logger::STRING_INVALID_FORM); + break; + case SYNC_CREDENTIAL: + logger->LogMessage(Logger::STRING_SYNC_CREDENTIAL); + break; + case SAVING_ON_HTTP_AFTER_HTTPS: + logger->LogSuccessiveOrigins( + Logger::STRING_BLOCK_PASSWORD_SAME_ORIGIN_INSECURE_SCHEME, + main_frame_url.GetOrigin(), form_origin.GetOrigin()); + break; + case MAX_FAILURE_VALUE: + NOTREACHED(); + return; + } + logger->LogMessage(Logger::STRING_DECISION_DROP); + } +} + +void PasswordManagerMetricsRecorder::RecordUkmMetric(const char* metric_name, + int64_t value) { + if (ukm_entry_builder_) + ukm_entry_builder_->AddMetric(metric_name, value); +} + +} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_manager_metrics_recorder.h b/components/password_manager/core/browser/password_manager_metrics_recorder.h new file mode 100644 index 0000000..26dbd52e --- /dev/null +++ b/components/password_manager/core/browser/password_manager_metrics_recorder.h
@@ -0,0 +1,94 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_METRICS_RECORDER_H_ +#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_METRICS_RECORDER_H_ + +#include <stdint.h> + +#include <memory> + +#include "base/macros.h" +#include "components/ukm/public/ukm_recorder.h" + +class GURL; + +namespace password_manager { + +// Internal namespace is intended for component wide access only. +namespace internal { + +constexpr char kUkmUserModifiedPasswordField[] = "UserModifiedPasswordField"; + +} // namespace internal + +class BrowserSavePasswordProgressLogger; + +// The pupose of this class is to record various types of metrics about the +// behavior of the PasswordManager and its interaction with the user and the +// page. +// The PasswordManagerMetricsRecorder flushes metrics on destruction. As such +// any owner needs to destroy this instance when navigations are committed. +class PasswordManagerMetricsRecorder { + public: + // Reasons why the password manager failed to do a provisional saving and + // therefore did not offer the user to save a password. + enum ProvisionalSaveFailure { + SAVING_DISABLED, + EMPTY_PASSWORD, + NO_MATCHING_FORM, + MATCHING_NOT_COMPLETE, + FORM_BLACKLISTED, + INVALID_FORM, + SYNC_CREDENTIAL, + SAVING_ON_HTTP_AFTER_HTTPS, + MAX_FAILURE_VALUE + }; + + // |ukm_entry_builder| is the destination into which UKM metrics are recorded. + // It may be nullptr, in which case no UKM metrics are recorded. This should + // be created via the static CreateUkmEntryBuilder() method of this class. + explicit PasswordManagerMetricsRecorder( + std::unique_ptr<ukm::UkmEntryBuilder> ukm_entry_builder); + explicit PasswordManagerMetricsRecorder( + PasswordManagerMetricsRecorder&& that); + ~PasswordManagerMetricsRecorder(); + + PasswordManagerMetricsRecorder& operator=( + PasswordManagerMetricsRecorder&& that); + + // Creates a UkmEntryBuilder that can be used to record metrics into the event + // "PageWithPassword". |source_id| should be bound the the correct URL in the + // |ukm_recorder| when this function is called. + static std::unique_ptr<ukm::UkmEntryBuilder> CreateUkmEntryBuilder( + ukm::UkmRecorder* ukm_recorder, + ukm::SourceId source_id); + + // Records that the user has modified a password field on a page. This may be + // called multiple times but a single metric will be reported. + void RecordUserModifiedPasswordField(); + + // Log failure to provisionally save a password to in the PasswordManager to + // UMA and the |logger|. + void RecordProvisionalSaveFailure(ProvisionalSaveFailure failure, + const GURL& main_frame_url, + const GURL& form_origin, + BrowserSavePasswordProgressLogger* logger); + + private: + // Records a metric into |ukm_entry_builder_| if it is not nullptr. + void RecordUkmMetric(const char* metric_name, int64_t value); + + // Records URL keyed metrics (UKMs) and submits them on its destruction. May + // be a nullptr in which case no recording is expected. + std::unique_ptr<ukm::UkmEntryBuilder> ukm_entry_builder_; + + bool user_modified_password_field_ = false; + + DISALLOW_COPY_AND_ASSIGN(PasswordManagerMetricsRecorder); +}; + +} // namespace password_manager + +#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_METRICS_RECORDER_H_
diff --git a/components/password_manager/core/browser/password_manager_metrics_recorder_unittest.cc b/components/password_manager/core/browser/password_manager_metrics_recorder_unittest.cc new file mode 100644 index 0000000..d3c1119f --- /dev/null +++ b/components/password_manager/core/browser/password_manager_metrics_recorder_unittest.cc
@@ -0,0 +1,87 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/password_manager/core/browser/password_manager_metrics_recorder.h" + +#include <memory> + +#include "base/metrics/metrics_hashes.h" +#include "components/ukm/public/ukm_recorder.h" +#include "components/ukm/test_ukm_recorder.h" +#include "components/ukm/ukm_source.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace password_manager { + +namespace { +constexpr char kTestUrl[] = "https://www.example.com/"; + +// Create a UkmEntryBuilder with a SourceId that is initialized for kTestUrl. +std::unique_ptr<ukm::UkmEntryBuilder> CreateUkmEntryBuilder( + ukm::TestUkmRecorder* test_ukm_recorder) { + ukm::SourceId source_id = test_ukm_recorder->GetNewSourceID(); + static_cast<ukm::UkmRecorder*>(test_ukm_recorder) + ->UpdateSourceURL(source_id, GURL(kTestUrl)); + return PasswordManagerMetricsRecorder::CreateUkmEntryBuilder( + test_ukm_recorder, source_id); +} + +// Verifies that the metric |metric_name| was recorded with value |value| in the +// single entry of |test_ukm_recorder| exactly |expected_count| times. +void ExpectUkmValueCount(ukm::TestUkmRecorder* test_ukm_recorder, + const char* metric_name, + int64_t value, + int64_t expected_count) { + const ukm::UkmSource* source = test_ukm_recorder->GetSourceForUrl(kTestUrl); + ASSERT_TRUE(source); + + ASSERT_EQ(1U, test_ukm_recorder->entries_count()); + const ukm::mojom::UkmEntry* entry = test_ukm_recorder->GetEntry(0); + + int64_t occurrences = 0; + for (const ukm::mojom::UkmMetricPtr& metric : entry->metrics) { + if (metric->metric_hash == base::HashMetricName(metric_name) && + metric->value == value) + ++occurrences; + } + EXPECT_EQ(expected_count, occurrences) << metric_name << ": " << value; +} + +} // namespace + +TEST(PasswordManagerMetricsRecorder, UserModifiedPasswordField) { + ukm::TestUkmRecorder test_ukm_recorder; + { + PasswordManagerMetricsRecorder recorder( + CreateUkmEntryBuilder(&test_ukm_recorder)); + recorder.RecordUserModifiedPasswordField(); + } + ExpectUkmValueCount(&test_ukm_recorder, + internal::kUkmUserModifiedPasswordField, 1, 1); +} + +TEST(PasswordManagerMetricsRecorder, UserModifiedPasswordFieldMultipleTimes) { + ukm::TestUkmRecorder test_ukm_recorder; + { + PasswordManagerMetricsRecorder recorder( + CreateUkmEntryBuilder(&test_ukm_recorder)); + // Multiple calls should not create more than one entry. + recorder.RecordUserModifiedPasswordField(); + recorder.RecordUserModifiedPasswordField(); + } + ExpectUkmValueCount(&test_ukm_recorder, + internal::kUkmUserModifiedPasswordField, 1, 1); +} + +TEST(PasswordManagerMetricsRecorder, UserModifiedPasswordFieldNotCalled) { + ukm::TestUkmRecorder test_ukm_recorder; + { + PasswordManagerMetricsRecorder recorder( + CreateUkmEntryBuilder(&test_ukm_recorder)); + } + ExpectUkmValueCount(&test_ukm_recorder, + internal::kUkmUserModifiedPasswordField, 1, 0); +} + +} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_manager_util.cc b/components/password_manager/core/browser/password_manager_util.cc index 5065028..e28624cd 100644 --- a/components/password_manager/core/browser/password_manager_util.cc +++ b/components/password_manager/core/browser/password_manager_util.cc
@@ -12,7 +12,6 @@ #include "components/password_manager/core/browser/log_manager.h" #include "components/sync/driver/sync_service.h" #include "crypto/openssl_util.h" -#include "crypto/sha2.h" #include "third_party/boringssl/src/include/openssl/evp.h" namespace password_manager_util { @@ -86,20 +85,6 @@ return log_manager && log_manager->IsLoggingActive(); } -uint64_t Calculate37BitsOfSHA256Hash(const base::StringPiece16& text) { - constexpr size_t kBytesFromSha256Hash = 5; - uint8_t hash[kBytesFromSha256Hash]; - base::StringPiece text_8bits(reinterpret_cast<const char*>(text.data()), - text.size() * 2); - crypto::SHA256HashString(text_8bits, hash, kBytesFromSha256Hash); - uint64_t hash37 = ((static_cast<uint64_t>(hash[0]))) | - ((static_cast<uint64_t>(hash[1])) << 8) | - ((static_cast<uint64_t>(hash[2])) << 16) | - ((static_cast<uint64_t>(hash[3])) << 24) | - (((static_cast<uint64_t>(hash[4])) & 0x1F) << 32); - return hash37; -} - uint64_t CalculateSyncPasswordHash(const base::StringPiece16& text, const std::string& salt) { crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
diff --git a/components/password_manager/core/browser/password_manager_util.h b/components/password_manager/core/browser/password_manager_util.h index d5cf331..b23906a 100644 --- a/components/password_manager/core/browser/password_manager_util.h +++ b/components/password_manager/core/browser/password_manager_util.h
@@ -49,9 +49,6 @@ // and required to always return non-null. bool IsLoggingActive(const password_manager::PasswordManagerClient* client); -// Returns 37 bits from Sha256 hash. -uint64_t Calculate37BitsOfSHA256Hash(const base::StringPiece16& text); - // Calculates 37 bits hash for a sync password. The calculation is based on a // slow hash function. The running time is ~10^{-4} seconds on Desktop. uint64_t CalculateSyncPasswordHash(const base::StringPiece16& text,
diff --git a/components/password_manager/core/browser/password_manager_util_unittest.cc b/components/password_manager/core/browser/password_manager_util_unittest.cc index ae4d26f5..9dc7b88 100644 --- a/components/password_manager/core/browser/password_manager_util_unittest.cc +++ b/components/password_manager/core/browser/password_manager_util_unittest.cc
@@ -58,22 +58,6 @@ EXPECT_THAT(forms, UnorderedPasswordFormElementsAre(&expected_forms)); } -TEST(PasswordManagerUtil, Calculate37BitsOfSHA256Hash) { - const char* kInputData[] = {"", "password", "secret"}; - - constexpr uint64_t kExpectedResult[] = { - UINT64_C(0x1842c4b0e3), UINT64_C(0x55d0601e2), UINT64_C(0x8b9dea8b3)}; - - ASSERT_EQ(arraysize(kInputData), arraysize(kExpectedResult)); - - for (size_t i = 0; i < arraysize(kInputData); ++i) { - base::string16 input = base::UTF8ToUTF16(kInputData[i]); - - EXPECT_EQ(kExpectedResult[i], - password_manager_util::Calculate37BitsOfSHA256Hash(input)); - } -} - TEST(PasswordManagerUtil, CalculateSyncPasswordHash) { const char* kPlainText[] = {"", "password", "password", "secret"}; const char* kSalt[] = {"", "salt", "123", "456"};
diff --git a/components/password_manager/core/browser/password_store.cc b/components/password_manager/core/browser/password_store.cc index 35fccbc..46b25fb 100644 --- a/components/password_manager/core/browser/password_store.cc +++ b/components/password_manager/core/browser/password_store.cc
@@ -22,6 +22,10 @@ #include "components/password_manager/core/browser/password_syncable_service.h" #include "components/password_manager/core/browser/statistics_table.h" +#if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) +#include "components/password_manager/core/browser/password_store_signin_notifier.h" +#endif + using autofill::PasswordForm; namespace password_manager { @@ -189,11 +193,6 @@ base::Callback<bool(const GURL&)>(origin_filter), completion)); } -void PasswordStore::TrimAffiliationCache() { - if (affiliated_match_helper_) - affiliated_match_helper_->TrimAffiliationCache(); -} - void PasswordStore::GetLogins(const FormDigest& form, PasswordStoreConsumer* consumer) { // Per http://crbug.com/121738, we deliberately ignore saved logins for @@ -314,6 +313,10 @@ // The AffiliationService must be destroyed from the main thread. affiliated_match_helper_.reset(); shutdown_called_ = true; +#if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) + if (notifier_) + notifier_->UnsubscribeFromSigninEvents(); +#endif } base::WeakPtr<syncer::SyncableService> @@ -333,7 +336,9 @@ base::Passed(&check_reuse_request), input, domain)); } +#if !defined(OS_CHROMEOS) void PasswordStore::SaveSyncPasswordHash(const base::string16& password) { + // TODO(crbug.com/657041): Log success of saving password hash to UMA. hash_password_manager_.SavePasswordHash(password); base::Optional<SyncPasswordData> sync_password_data = hash_password_manager_.RetrievePasswordHash(); @@ -345,6 +350,15 @@ hash_password_manager_.ClearSavedPasswordHash(); ScheduleTask(base::Bind(&PasswordStore::ClearSyncPasswordHashImpl, this)); } + +void PasswordStore::SetPasswordStoreSigninNotifier( + std::unique_ptr<PasswordStoreSigninNotifier> notifier) { + DCHECK(!notifier_); + DCHECK(notifier); + notifier_ = std::move(notifier); + notifier_->SubscribeToSigninEvents(this); +} +#endif #endif PasswordStore::~PasswordStore() {
diff --git a/components/password_manager/core/browser/password_store.h b/components/password_manager/core/browser/password_store.h index 0518991..3d94d90 100644 --- a/components/password_manager/core/browser/password_store.h +++ b/components/password_manager/core/browser/password_store.h
@@ -28,7 +28,6 @@ #include "components/password_manager/core/browser/password_reuse_detector_consumer.h" #endif -class PasswordStoreProxyMac; class PrefService; namespace autofill { @@ -43,6 +42,7 @@ class AffiliatedMatchHelper; class PasswordStoreConsumer; +class PasswordStoreSigninNotifier; class PasswordSyncableService; struct InteractionsStats; @@ -174,10 +174,6 @@ const base::Callback<bool(const GURL&)>& origin_filter, const base::Closure& completion); - // Removes cached affiliation data that is no longer needed; provided that - // affiliation-based matching is enabled. - void TrimAffiliationCache(); - // Searches for a matching PasswordForm, and notifies |consumer| on // completion. The request will be cancelled if the consumer is destroyed. virtual void GetLogins(const FormDigest& form, @@ -260,11 +256,17 @@ const std::string& domain, PasswordReuseDetectorConsumer* consumer); +#if !defined(OS_CHROMEOS) // Saves a hash of |password| for password reuse checking. - void SaveSyncPasswordHash(const base::string16& password); + virtual void SaveSyncPasswordHash(const base::string16& password); // Clears the saved sync password hash. - void ClearSyncPasswordHash(); + virtual void ClearSyncPasswordHash(); + + // Shouldn't be called more than once, |notifier| must be not nullptr. + void SetPasswordStoreSigninNotifier( + std::unique_ptr<PasswordStoreSigninNotifier> notifier); +#endif #endif protected: @@ -451,8 +453,6 @@ FRIEND_TEST_ALL_PREFIXES(PasswordStoreTest, GetLoginImpl); FRIEND_TEST_ALL_PREFIXES(PasswordStoreTest, UpdatePasswordsStoredForAffiliatedWebsites); - // TODO(vasilii): remove this together with PasswordStoreProxyMac. - friend class ::PasswordStoreProxyMac; // Schedule the given |func| to be run in the PasswordStore's own thread with // responses delivered to |consumer| on the current thread. @@ -600,7 +600,11 @@ #if !defined(OS_ANDROID) && !defined(OS_IOS) std::unique_ptr<PasswordReuseDetector> reuse_detector_; HashPasswordManager hash_password_manager_; +#if !defined(OS_CHROMEOS) + std::unique_ptr<PasswordStoreSigninNotifier> notifier_; #endif +#endif + bool is_propagating_password_changes_to_web_credentials_enabled_; bool shutdown_called_;
diff --git a/components/password_manager/core/browser/password_store_factory_util.cc b/components/password_manager/core/browser/password_store_factory_util.cc index d692a742..28b7724 100644 --- a/components/password_manager/core/browser/password_store_factory_util.cc +++ b/components/password_manager/core/browser/password_store_factory_util.cc
@@ -75,18 +75,6 @@ } } -void TrimOrDeleteAffiliationCacheForStoreAndPath( - PasswordStore* password_store, - const base::FilePath& profile_path, - scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner) { - if (password_store && password_store->affiliated_match_helper()) { - password_store->TrimAffiliationCache(); - } else { - AffiliationService::DeleteCache(GetAffiliationDatabasePath(profile_path), - db_thread_runner.get()); - } -} - std::unique_ptr<LoginDatabase> CreateLoginDatabase( const base::FilePath& profile_path) { base::FilePath login_db_file_path = profile_path.Append(kLoginDataFileName);
diff --git a/components/password_manager/core/browser/password_store_factory_util.h b/components/password_manager/core/browser/password_store_factory_util.h index bb9371a..6f3a707 100644 --- a/components/password_manager/core/browser/password_store_factory_util.h +++ b/components/password_manager/core/browser/password_store_factory_util.h
@@ -33,15 +33,6 @@ const base::FilePath& profile_path, scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner); -// Trims the affiliation cache (placed in |profile_path|) for |password_store| -// if affiliation-based matching is enabled, and completely deletes it -// otherwise. The AffiliationService will use |db_thread_runner| as its backend -// thread. -void TrimOrDeleteAffiliationCacheForStoreAndPath( - PasswordStore* password_store, - const base::FilePath& profile_path, - scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner); - // Creates a LoginDatabase. Looks in |profile_path| for the database file. // Does not call LoginDatabase::Init() -- to avoid UI jank, that needs to be // called by PasswordStore::Init() on the background thread.
diff --git a/components/password_manager/core/browser/password_store_signin_notifier.cc b/components/password_manager/core/browser/password_store_signin_notifier.cc new file mode 100644 index 0000000..6b1786a --- /dev/null +++ b/components/password_manager/core/browser/password_store_signin_notifier.cc
@@ -0,0 +1,25 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/password_manager/core/browser/password_store_signin_notifier.h" + +#include "components/password_manager/core/browser/password_store.h" + +namespace password_manager { + +PasswordStoreSigninNotifier::PasswordStoreSigninNotifier() {} + +PasswordStoreSigninNotifier::~PasswordStoreSigninNotifier() {} + +void PasswordStoreSigninNotifier::NotifySignin(const std::string& password) { + if (store_) + store_->SaveSyncPasswordHash(base::UTF8ToUTF16(password)); +} + +void PasswordStoreSigninNotifier::NotifySignedOut() { + if (store_) + store_->ClearSyncPasswordHash(); +} + +} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_store_signin_notifier.h b/components/password_manager/core/browser/password_store_signin_notifier.h new file mode 100644 index 0000000..65e8c89 --- /dev/null +++ b/components/password_manager/core/browser/password_store_signin_notifier.h
@@ -0,0 +1,47 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_SIGNIN_NOTIFIER_H_ +#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_SIGNIN_NOTIFIER_H_ + +#include <string> + +#include "base/macros.h" +#include "base/strings/utf_string_conversions.h" + +namespace password_manager { + +class PasswordStore; + +// Abstract class for notifying PasswordStore about Chrome sign-in events. +// The logic of receiving sign-in events and notifying PasswordStore is split +// in the base abstract class (this class, in components/) and an +// implementation (in the chrome/browser/), because components/ doesn't know +// anything about Chrome sign-in. +class PasswordStoreSigninNotifier { + public: + PasswordStoreSigninNotifier(); + virtual ~PasswordStoreSigninNotifier(); + + virtual void SubscribeToSigninEvents(PasswordStore* store) = 0; + virtual void UnsubscribeFromSigninEvents() = 0; + + protected: + void set_store(PasswordStore* store) { store_ = store; } + + // Passes sign-in to |store_|. + void NotifySignin(const std::string& password); + + // Passes signed-out to |store_|. + void NotifySignedOut(); + + private: + PasswordStore* store_ = nullptr; // weak + + DISALLOW_COPY_AND_ASSIGN(PasswordStoreSigninNotifier); +}; + +} // namespace password_manager + +#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_SIGNIN_NOTIFIER_H_
diff --git a/components/password_manager/core/browser/password_store_unittest.cc b/components/password_manager/core/browser/password_store_unittest.cc index 3329dba3..e95ed71 100644 --- a/components/password_manager/core/browser/password_store_unittest.cc +++ b/components/password_manager/core/browser/password_store_unittest.cc
@@ -31,6 +31,7 @@ #include "components/password_manager/core/browser/password_reuse_detector.h" #include "components/password_manager/core/browser/password_store_consumer.h" #include "components/password_manager/core/browser/password_store_default.h" +#include "components/password_manager/core/browser/password_store_signin_notifier.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" @@ -91,6 +92,12 @@ } }; +class MockPasswordStoreSigninNotifier : public PasswordStoreSigninNotifier { + public: + MOCK_METHOD1(SubscribeToSigninEvents, void(PasswordStore* store)); + MOCK_METHOD0(UnsubscribeFromSigninEvents, void()); +}; + class StartSyncFlareMock { public: StartSyncFlareMock() {} @@ -980,6 +987,7 @@ base::RunLoop().RunUntilIdle(); } +#if !defined(OS_CHROMEOS) TEST_F(PasswordStoreTest, SavingClearingSyncPassword) { scoped_refptr<PasswordStoreDefault> store(new PasswordStoreDefault( base::ThreadTaskRunnerHandle::Get(), base::ThreadTaskRunnerHandle::Get(), @@ -988,6 +996,9 @@ TestingPrefServiceSimple prefs; prefs.registry()->RegisterStringPref(prefs::kSyncPasswordHash, std::string(), PrefRegistry::NO_REGISTRATION_FLAGS); + prefs.registry()->RegisterStringPref(prefs::kSyncPasswordLengthAndHashSalt, + std::string(), + PrefRegistry::NO_REGISTRATION_FLAGS); ASSERT_FALSE(prefs.HasPrefPath(prefs::kSyncPasswordHash)); store->Init(syncer::SyncableService::StartSyncFlare(), &prefs); @@ -1010,6 +1021,27 @@ store->ShutdownOnUIThread(); base::RunLoop().RunUntilIdle(); } + +TEST_F(PasswordStoreTest, SubscriptionAndUnsubscriptionFromSignInEvents) { + scoped_refptr<PasswordStoreDefault> store(new PasswordStoreDefault( + base::ThreadTaskRunnerHandle::Get(), base::ThreadTaskRunnerHandle::Get(), + base::MakeUnique<LoginDatabase>(test_login_db_file_path()))); + + std::unique_ptr<MockPasswordStoreSigninNotifier> notifier = + base::MakeUnique<MockPasswordStoreSigninNotifier>(); + MockPasswordStoreSigninNotifier* notifier_weak = notifier.get(); + + // Check that |store| is subscribed to sign-in events. + EXPECT_CALL(*notifier_weak, SubscribeToSigninEvents(store.get())); + store->SetPasswordStoreSigninNotifier(std::move(notifier)); + testing::Mock::VerifyAndClearExpectations(store.get()); + + // Check that |store| is unsubscribed from sign-in events on shutdown. + EXPECT_CALL(*notifier_weak, UnsubscribeFromSigninEvents()); + store->ShutdownOnUIThread(); + base::RunLoop().RunUntilIdle(); +} +#endif #endif } // namespace password_manager
diff --git a/components/password_manager/core/browser/site_affiliation/asset_link_data.cc b/components/password_manager/core/browser/site_affiliation/asset_link_data.cc new file mode 100644 index 0000000..e20be71 --- /dev/null +++ b/components/password_manager/core/browser/site_affiliation/asset_link_data.cc
@@ -0,0 +1,88 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/password_manager/core/browser/site_affiliation/asset_link_data.h" + +#include <algorithm> +#include <utility> + +#include "base/json/json_reader.h" +#include "base/json/json_value_converter.h" +#include "base/values.h" + +namespace password_manager { +namespace { + +constexpr char kGetLoginsRelation[] = + "delegate_permission/common.get_login_creds"; +constexpr char kWebNamespace[] = "web"; + +struct Target { + std::string target_namespace; + std::string site; + + static void RegisterJSONConverter( + base::JSONValueConverter<Target>* converter) { + converter->RegisterStringField("namespace", &Target::target_namespace); + converter->RegisterStringField("site", &Target::site); + } +}; + +struct Statement { + std::string include; + std::vector<std::unique_ptr<std::string>> relations; + Target target; + + static void RegisterJSONConverter( + base::JSONValueConverter<Statement>* converter) { + converter->RegisterStringField("include", &Statement::include); + converter->RegisterRepeatedString("relation", &Statement::relations); + converter->RegisterNestedField("target", &Statement::target); + } +}; + +} // namespace + +AssetLinkData::AssetLinkData() = default; + +AssetLinkData::AssetLinkData(AssetLinkData&& other) noexcept = default; + +AssetLinkData::~AssetLinkData() = default; + +AssetLinkData& AssetLinkData::operator=(AssetLinkData&& other) = default; + +bool AssetLinkData::Parse(const std::string& data) { + std::unique_ptr<base::Value> value = base::JSONReader::Read(data); + if (!value || !value->is_list()) + return false; + const base::Value::ListStorage& list_storage = value->GetList(); + base::JSONValueConverter<Statement> converter; + for (const auto& item : list_storage) { + Statement statement; + if (converter.Convert(item, &statement)) { + if (!statement.include.empty()) { + // The statement is an 'include' statement. + GURL include(statement.include); + if (include.is_valid() && include.SchemeIs(url::kHttpsScheme)) + includes_.push_back(std::move(include)); + } else if (std::any_of(statement.relations.begin(), + statement.relations.end(), + [](const std::unique_ptr<std::string>& relation) { + return *relation == kGetLoginsRelation; + })) { + // 'get_login_creds' statement. Only web HTTPS targets are interesting. + if (statement.target.target_namespace == kWebNamespace) { + GURL site(statement.target.site); + if (site.is_valid() && site.SchemeIs(url::kHttpsScheme)) + targets_.push_back(std::move(site)); + } + } + } else { + return false; + } + } + return true; +} + +} // namespace password_manager
diff --git a/components/password_manager/core/browser/site_affiliation/asset_link_data.h b/components/password_manager/core/browser/site_affiliation/asset_link_data.h new file mode 100644 index 0000000..0f376629 --- /dev/null +++ b/components/password_manager/core/browser/site_affiliation/asset_link_data.h
@@ -0,0 +1,44 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_SITE_AFFILIATION_ASSET_LINK_DATA_H_ +#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_SITE_AFFILIATION_ASSET_LINK_DATA_H_ + +#include <string> +#include <vector> + +#include "base/macros.h" +#include "url/gurl.h" + +namespace password_manager { + +// The class parses an asset link file. The spec for the format is +// https://github.com/google/digitalassetlinks/blob/master/well-known/details.md +// The class cares only about two types of statements: +// - includes. Those are just a reference to a file to be loaded and parsed. +// - "get_login_creds" permission to a web page. That means that the target is +// allowed to get the credentials saved for the source. +// Only HTTPS URLs are taken into account. +class AssetLinkData { + public: + AssetLinkData(); + AssetLinkData(AssetLinkData&& other) noexcept; + ~AssetLinkData(); + + AssetLinkData& operator=(AssetLinkData&& other); + + bool Parse(const std::string& data); + + const std::vector<GURL>& includes() const { return includes_; } + const std::vector<GURL>& targets() const { return targets_; } + + private: + std::vector<GURL> includes_; + std::vector<GURL> targets_; + + DISALLOW_COPY_AND_ASSIGN(AssetLinkData); +}; + +} // namespace password_manager +#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_SITE_AFFILIATION_ASSET_LINK_DATA_H_
diff --git a/components/password_manager/core/browser/site_affiliation/asset_link_data_unittest.cc b/components/password_manager/core/browser/site_affiliation/asset_link_data_unittest.cc new file mode 100644 index 0000000..2a8ca787 --- /dev/null +++ b/components/password_manager/core/browser/site_affiliation/asset_link_data_unittest.cc
@@ -0,0 +1,226 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <components/password_manager/core/browser/site_affiliation/asset_link_data.h> + +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace password_manager { +namespace { + +using ::testing::IsEmpty; +using ::testing::ElementsAre; +using ::testing::UnorderedElementsAre; + +TEST(AssetLinkData, NonJSON) { + constexpr char json[] = u8R"([trash])"; + AssetLinkData data; + EXPECT_FALSE(data.Parse(json)); + EXPECT_THAT(data.includes(), IsEmpty()); + EXPECT_THAT(data.targets(), IsEmpty()); +} + +TEST(AssetLinkData, NotList) { + constexpr char json[] = + u8R"({ + "include": "https://example/.well-known/assetlinks.json" + })"; + AssetLinkData data; + EXPECT_FALSE(data.Parse(json)); + EXPECT_THAT(data.includes(), IsEmpty()); + EXPECT_THAT(data.targets(), IsEmpty()); +} + +TEST(AssetLinkData, IncludeWrongValue) { + constexpr char json[] = + u8R"([{ + "include": 24 + }])"; + AssetLinkData data; + EXPECT_FALSE(data.Parse(json)); + EXPECT_THAT(data.includes(), IsEmpty()); + EXPECT_THAT(data.targets(), IsEmpty()); +} + +TEST(AssetLinkData, IncludeFile) { + constexpr char json[] = + u8R"([{ + "include": "https://example/.well-known/assetlinks.json" + }])"; + AssetLinkData data; + EXPECT_TRUE(data.Parse(json)); + EXPECT_THAT(data.includes(), + ElementsAre(GURL("https://example/.well-known/assetlinks.json"))); + EXPECT_THAT(data.targets(), IsEmpty()); +} + +TEST(AssetLinkData, IncludeHTTPFile) { + constexpr char json[] = + u8R"([{ + "include": "http://example/.well-known/assetlinks.json" + }])"; + AssetLinkData data; + EXPECT_TRUE(data.Parse(json)); + EXPECT_THAT(data.includes(), IsEmpty()); + EXPECT_THAT(data.targets(), IsEmpty()); +} + +TEST(AssetLinkData, IncludeInvalidFile) { + constexpr char json[] = + u8R"([{ + "include": "www.example/assetlinks.json" + }])"; + AssetLinkData data; + data.Parse(json); + EXPECT_THAT(data.includes(), IsEmpty()); + EXPECT_THAT(data.targets(), IsEmpty()); +} + +TEST(AssetLinkData, HandleURLsPermission) { + constexpr char json[] = + u8R"([{ + "relation": ["delegate_permission/common.handle_all_urls"], + "target": { + "namespace": "web", + "site": "https://www.google.com" + } + },{ + "relation": ["delegate_permission/common.handle_all_urls"], + "target": { + "namespace": "android_app", + "package_name": "org.digitalassetlinks.sampleapp", + "sha256_cert_fingerprints": ["10:39:38:EE:45:37:E5:9E:8E:E7:92:F6"] + } + }])"; + AssetLinkData data; + EXPECT_TRUE(data.Parse(json)); + EXPECT_THAT(data.includes(), IsEmpty()); + EXPECT_THAT(data.targets(), IsEmpty()); +} + +TEST(AssetLinkData, BrokenRelation) { + constexpr char json[] = + u8R"([{ + "relation": "delegate_permission/common.get_login_creds", + "target": { + "namespace": "web", + "site": "https://www.google.com" + } + }])"; + AssetLinkData data; + EXPECT_FALSE(data.Parse(json)); + EXPECT_THAT(data.includes(), IsEmpty()); + EXPECT_THAT(data.targets(), IsEmpty()); +} + +TEST(AssetLinkData, GetLoginCredsPermission) { + constexpr char json[] = + u8R"([{ + "relation": ["delegate_permission/common.get_login_creds"], + "target": { + "namespace": "web", + "site": "https://www.google.com" + } + },{ + "relation": ["delegate_permission/common.get_login_creds"], + "target": { + "namespace": "android_app", + "package_name": "org.digitalassetlinks.sampleapp", + "sha256_cert_fingerprints": ["10:39:38:EE:45:37:E5:9E:8E:E7:92:F6"] + } + },{ + "relation": ["delegate_permission/common.get_login_creds"], + "target": { + "namespace": "web", + "site": "https://www.google.ru" + } + },{ + "relation": ["delegate_permission/common.get_login_creds"], + "target": { + "namespace": "web", + "site": "http://example.com" + } + } + ])"; + AssetLinkData data; + EXPECT_TRUE(data.Parse(json)); + EXPECT_THAT(data.includes(), IsEmpty()); + EXPECT_THAT(data.targets(), + UnorderedElementsAre(GURL("https://www.google.com"), + GURL("https://www.google.ru"))); +} + +TEST(AssetLinkData, MultiplePermissions) { + constexpr char json[] = + u8R"([{ + "relation": ["something","delegate_permission/common.get_login_creds"], + "target": { + "namespace": "web", + "site": "https://www.google.com" + } + },{ + "relation": ["delegate_permission/common.get_login_creds", + "delegate_permission/common.handle_all_urls"], + "target": { + "namespace": "android_app", + "package_name": "org.digitalassetlinks.sampleapp", + "sha256_cert_fingerprints": ["10:39:38:EE:45:37:E5:9E:8E:E7:92:F6"] + } + },{ + "relation": ["delegate_permission/common.get_login_creds", "something"], + "target": { + "namespace": "web", + "site": "https://www.google.ru" + } + },{ + "relation": ["trash"], + "target": { + "namespace": "web", + "site": "https://www.google.de" + } + } + ])"; + AssetLinkData data; + EXPECT_TRUE(data.Parse(json)); + EXPECT_THAT(data.includes(), IsEmpty()); + EXPECT_THAT(data.targets(), ElementsAre(GURL("https://www.google.com"), + GURL("https://www.google.ru"))); +} + +TEST(AssetLinkData, MixedStatements) { + constexpr char json[] = + u8R"([{ + "relation": ["delegate_permission/common.get_login_creds"], + "target": { + "namespace": "web", + "site": "https://www.google.com" + } + },{ + "relation": ["unknown", "unknown"], + "target": { + "key": "value", + "key2": 12 + } + },{ + "include": "https://go/assetlinks.json" + },{ + "relation": ["delegate_permission/common.get_login_creds"], + "key": 1234, + "target": { + "namespace": "web", + "site": "https://www.google.de", + "key": "additional_value" + } + } + ])"; + AssetLinkData data; + EXPECT_TRUE(data.Parse(json)); + EXPECT_THAT(data.includes(), ElementsAre(GURL("https://go/assetlinks.json"))); + EXPECT_THAT(data.targets(), ElementsAre(GURL("https://www.google.com"), + GURL("https://www.google.de"))); +} + +} // namespace +} // namespace password_manager
diff --git a/components/password_manager/core/browser/site_affiliation/asset_link_retriever.cc b/components/password_manager/core/browser/site_affiliation/asset_link_retriever.cc index dabc0e4c..22ca913 100644 --- a/components/password_manager/core/browser/site_affiliation/asset_link_retriever.cc +++ b/components/password_manager/core/browser/site_affiliation/asset_link_retriever.cc
@@ -6,7 +6,11 @@ #include <utility> +#include "base/bind.h" #include "base/logging.h" +#include "base/memory/ptr_util.h" +#include "base/task_runner_util.h" +#include "base/task_scheduler/post_task.h" #include "net/base/load_flags.h" #include "net/http/http_status_code.h" #include "net/traffic_annotation/network_traffic_annotation.h" @@ -67,9 +71,29 @@ if (error_) { state_ = State::FINISHED; } else { - // TODO(crbug.com/630555): Start parsing here. + state_ = State::PARSING; + std::string response_string; + source->GetResponseAsString(&response_string); + scoped_refptr<base::TaskRunner> task_runner = + base::CreateTaskRunnerWithTraits({base::TaskPriority::USER_BLOCKING}); + auto data = base::MakeUnique<AssetLinkData>(); + AssetLinkData* data_raw = data.get(); + base::PostTaskAndReplyWithResult( + task_runner.get(), FROM_HERE, + base::BindOnce(&AssetLinkData::Parse, base::Unretained(data_raw), + std::move(response_string)), + base::BindOnce(&AssetLinkRetriever::OnResponseParsed, this, + base::Passed(&data))); } fetcher_.reset(); } +void AssetLinkRetriever::OnResponseParsed(std::unique_ptr<AssetLinkData> data, + bool result) { + error_ = !result; + if (result) + data_ = std::move(*data); + state_ = State::FINISHED; +} + } // namespace password_manager
diff --git a/components/password_manager/core/browser/site_affiliation/asset_link_retriever.h b/components/password_manager/core/browser/site_affiliation/asset_link_retriever.h index 42ae1a1..2beecdf 100644 --- a/components/password_manager/core/browser/site_affiliation/asset_link_retriever.h +++ b/components/password_manager/core/browser/site_affiliation/asset_link_retriever.h
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "components/password_manager/core/browser/site_affiliation/asset_link_data.h" #include "net/url_request/url_fetcher_delegate.h" #include "url/gurl.h" @@ -29,6 +30,7 @@ enum class State { INACTIVE, NETWORK_REQUEST, + PARSING, FINISHED, }; @@ -42,6 +44,9 @@ bool error() const { return error_; } + const std::vector<GURL>& includes() const { return data_.includes(); } + const std::vector<GURL>& targets() const { return data_.targets(); } + private: friend class base::RefCounted<AssetLinkRetriever>; ~AssetLinkRetriever() override; @@ -49,6 +54,8 @@ // net::URLFetcherDelegate: void OnURLFetchComplete(const net::URLFetcher* source) override; + void OnResponseParsed(std::unique_ptr<AssetLinkData> data, bool result); + // URL of the file retrieved. const GURL url_; @@ -58,6 +65,9 @@ // Whether the reading finished with error. bool error_; + // Actual data from the asset link. + AssetLinkData data_; + std::unique_ptr<net::URLFetcher> fetcher_; DISALLOW_COPY_AND_ASSIGN(AssetLinkRetriever);
diff --git a/components/password_manager/core/browser/site_affiliation/asset_link_retriever_unittest.cc b/components/password_manager/core/browser/site_affiliation/asset_link_retriever_unittest.cc index 700dbec5..df4fb29e 100644 --- a/components/password_manager/core/browser/site_affiliation/asset_link_retriever_unittest.cc +++ b/components/password_manager/core/browser/site_affiliation/asset_link_retriever_unittest.cc
@@ -9,11 +9,15 @@ #include "base/test/scoped_task_environment.h" #include "net/url_request/test_url_fetcher_factory.h" #include "net/url_request/url_request_test_util.h" +#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" namespace password_manager { namespace { +using ::testing::IsEmpty; +using ::testing::ElementsAre; + constexpr char kAssetLinkFile[] = "https://example.com/.well-known/assetlinks.json"; @@ -98,11 +102,64 @@ factory().SetFakeResponse(GURL(kAssetLinkFile), std::string(), net::HTTP_FOUND, net::URLRequestStatus::CANCELED); asset_link_retriever->Start(request_context()); + EXPECT_EQ(AssetLinkRetriever::State::NETWORK_REQUEST, + asset_link_retriever->state()); RunUntilIdle(); EXPECT_EQ(AssetLinkRetriever::State::FINISHED, asset_link_retriever->state()); EXPECT_TRUE(asset_link_retriever->error()); } +// Load a valid asset links resource. +TEST_F(AssetLinkRetrieverTest, LoadValidFile) { + scoped_refptr<AssetLinkRetriever> asset_link_retriever = + base::MakeRefCounted<AssetLinkRetriever>(GURL(kAssetLinkFile)); + EXPECT_EQ(AssetLinkRetriever::State::INACTIVE, asset_link_retriever->state()); + + constexpr char json[] = + u8R"([{ + "relation": ["delegate_permission/common.get_login_creds"], + "target": { + "namespace": "web", + "site": "https://www.google.com" + } + },{ + "include": "https://go/assetlinks.json" + }])"; + factory().SetFakeResponse(GURL(kAssetLinkFile), json, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); + asset_link_retriever->Start(request_context()); + EXPECT_EQ(AssetLinkRetriever::State::NETWORK_REQUEST, + asset_link_retriever->state()); + + RunUntilIdle(); + EXPECT_EQ(AssetLinkRetriever::State::FINISHED, asset_link_retriever->state()); + EXPECT_FALSE(asset_link_retriever->error()); + EXPECT_THAT(asset_link_retriever->includes(), + ElementsAre(GURL("https://go/assetlinks.json"))); + EXPECT_THAT(asset_link_retriever->targets(), + ElementsAre(GURL("https://www.google.com"))); +} + +// Load a broken resource. +TEST_F(AssetLinkRetrieverTest, LoadInvalidFile) { + scoped_refptr<AssetLinkRetriever> asset_link_retriever = + base::MakeRefCounted<AssetLinkRetriever>(GURL(kAssetLinkFile)); + EXPECT_EQ(AssetLinkRetriever::State::INACTIVE, asset_link_retriever->state()); + + constexpr char json[] = u8R"([{111}])"; + factory().SetFakeResponse(GURL(kAssetLinkFile), json, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); + asset_link_retriever->Start(request_context()); + EXPECT_EQ(AssetLinkRetriever::State::NETWORK_REQUEST, + asset_link_retriever->state()); + + RunUntilIdle(); + EXPECT_EQ(AssetLinkRetriever::State::FINISHED, asset_link_retriever->state()); + EXPECT_TRUE(asset_link_retriever->error()); + EXPECT_THAT(asset_link_retriever->includes(), IsEmpty()); + EXPECT_THAT(asset_link_retriever->targets(), IsEmpty()); +} + } // namespace } // namespace password_manager
diff --git a/components/password_manager/core/browser/sql_table_builder.cc b/components/password_manager/core/browser/sql_table_builder.cc index 390e2d8..f49caa65 100644 --- a/components/password_manager/core/browser/sql_table_builder.cc +++ b/components/password_manager/core/browser/sql_table_builder.cc
@@ -5,10 +5,12 @@ #include "components/password_manager/core/browser/sql_table_builder.h" #include <algorithm> +#include <set> #include <utility> -#include <vector> #include "base/numerics/safe_conversions.h" +#include "base/stl_util.h" +#include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "sql/connection.h" #include "sql/transaction.h" @@ -27,6 +29,9 @@ } // namespace +// static +unsigned constexpr SQLTableBuilder::kInvalidVersion; + struct SQLTableBuilder::Column { std::string name; std::string type; @@ -45,34 +50,49 @@ bool gets_previous_data; }; +struct SQLTableBuilder::Index { + // The name of this index. + std::string name; + // The names of columns this index is built from. + std::vector<std::string> columns; + // The first version this index is part of. + unsigned min_version; + // The last version this index is part of. The value of kInvalidVersion + // means that it is part of all versions since |min_version|. + unsigned max_version; +}; + SQLTableBuilder::SQLTableBuilder(const std::string& table_name) : table_name_(table_name) {} SQLTableBuilder::~SQLTableBuilder() = default; -void SQLTableBuilder::AddColumn(const std::string& name, - const std::string& type) { - DCHECK(FindLastByName(name) == columns_.rend()); - Column column = {name, type, false, sealed_version_ + 1, kInvalidVersion, - false}; - columns_.push_back(std::move(column)); +void SQLTableBuilder::AddColumn(std::string name, std::string type) { + DCHECK(FindLastColumnByName(name) == columns_.rend()); + columns_.push_back({std::move(name), std::move(type), false, + sealed_version_ + 1, kInvalidVersion, false}); } -void SQLTableBuilder::AddColumnToUniqueKey(const std::string& name, - const std::string& type) { - AddColumn(name, type); +void SQLTableBuilder::AddColumnToUniqueKey(std::string name, std::string type) { + AddColumn(std::move(name), std::move(type)); columns_.back().part_of_unique_key = true; } void SQLTableBuilder::RenameColumn(const std::string& old_name, const std::string& new_name) { - auto old_column = FindLastByName(old_name); + auto old_column = FindLastColumnByName(old_name); DCHECK(old_column != columns_.rend()); - if (old_name == new_name) // The easy case. return; - DCHECK_NE("signon_realm", old_name); + DCHECK(FindLastColumnByName(new_name) == columns_.rend()); + // Check there is no index in the current version that references |old_name|. + DCHECK(std::none_of(indices_.begin(), indices_.end(), + [this, &old_name](const Index& index) { + return index.max_version == kInvalidVersion && + base::ContainsValue(index.columns, old_name); + })); + if (sealed_version_ != kInvalidVersion && old_column->min_version <= sealed_version_) { // This column exists in the last sealed version. Therefore it cannot be @@ -96,9 +116,14 @@ // Removes column |name|. |name| must have been added in the past. void SQLTableBuilder::DropColumn(const std::string& name) { - auto column = FindLastByName(name); + auto column = FindLastColumnByName(name); DCHECK(column != columns_.rend()); - DCHECK_NE("signon_realm", name); + // Check there is no index in the current version that references |old_name|. + DCHECK(std::none_of(indices_.begin(), indices_.end(), + [this, &name](const Index& index) { + return index.max_version == kInvalidVersion && + base::ContainsValue(index.columns, name); + })); if (sealed_version_ != kInvalidVersion && column->min_version <= sealed_version_) { // This column exists in the last sealed version. Therefore it cannot be @@ -112,8 +137,73 @@ } } +void SQLTableBuilder::AddIndex(std::string name, + std::vector<std::string> columns) { + DCHECK(!columns.empty()); + // Check if all entries of |columns| are unique. + DCHECK_EQ(std::set<std::string>(columns.begin(), columns.end()).size(), + columns.size()); + // |name| must not have been added before. + DCHECK(FindLastIndexByName(name) == indices_.rend()); + // Check that all referenced columns are present in the last version by making + // sure that the inner predicate applies to all columns names in |columns|. + DCHECK(std::all_of( + columns.begin(), columns.end(), [this](const std::string& column_name) { + // Check if there is any column with the required name which is also + // present in the latest version. Note that we don't require the last + // version to be sealed. + return std::any_of(columns_.begin(), columns_.end(), + [&column_name](const Column& column) { + return column.name == column_name && + column.max_version == kInvalidVersion; + }); + })); + indices_.push_back({std::move(name), std::move(columns), sealed_version_ + 1, + kInvalidVersion}); +} + +void SQLTableBuilder::RenameIndex(const std::string& old_name, + const std::string& new_name) { + auto old_index = FindLastIndexByName(old_name); + // Check that there is an index with the old name. + DCHECK(old_index != indices_.rend()); + if (old_name == new_name) // The easy case. + return; + + // Check that there is no index with the new name. + DCHECK(FindLastIndexByName(new_name) == indices_.rend()); + // Check that there is at least one sealed version. + DCHECK_NE(sealed_version_, kInvalidVersion); + // Check that the old index has been added before the last version was sealed. + DCHECK_LE(old_index->min_version, sealed_version_); + // Check that the old index has not been renamed or deleted yet. + DCHECK_EQ(old_index->max_version, kInvalidVersion); + // This index exists in the last sealed version. Therefore it cannot be + // just replaced, it needs to be kept for generating the migration code. + old_index->max_version = sealed_version_; + // Add the new index. + indices_.push_back( + {new_name, old_index->columns, sealed_version_ + 1, kInvalidVersion}); +} + +void SQLTableBuilder::DropIndex(const std::string& name) { + auto index = FindLastIndexByName(name); + // Check that an index with the name exists. + DCHECK(index != indices_.rend()); + // Check that this index exists in the last sealed version and hasn't been + // renamed or deleted yet. + // Check that there is at least one sealed version. + DCHECK_NE(sealed_version_, kInvalidVersion); + // Check that the index has been added before the last version was sealed. + DCHECK_LE(index->min_version, sealed_version_); + // Check that the index has not been renamed or deleted yet. + DCHECK_EQ(index->max_version, kInvalidVersion); + // This index exists in the last sealed version. Therefore it cannot be + // just deleted, it needs to be kept for generating the migration code. + index->max_version = sealed_version_; +} + unsigned SQLTableBuilder::SealVersion() { - DCHECK(FindLastByName("signon_realm") != columns_.rend()); if (sealed_version_ == kInvalidVersion) { DCHECK_EQ(std::string(), unique_constraint_); // First sealed version, time to compute the UNIQUE string. @@ -147,20 +237,30 @@ std::string names; // Names and types of the current columns. for (const Column& column : columns_) { - if (IsInLastVersion(column)) + if (IsColumnInLastVersion(column)) Append(column.name + " " + column.type, &names); } + std::vector<std::string> + create_index_sqls; // CREATE INDEX statements for the current indices. + for (const Index& index : indices_) { + if (IsIndexInLastVersion(index)) { + create_index_sqls.push_back(base::StringPrintf( + "CREATE INDEX %s ON %s (%s)", index.name.c_str(), table_name_.c_str(), + base::JoinString(index.columns, ", ").c_str())); + } + } + sql::Transaction transaction(db); return transaction.Begin() && db->Execute(base::StringPrintf("CREATE TABLE %s (%s, %s)", table_name_.c_str(), names.c_str(), unique_constraint_.c_str()) .c_str()) && - db->Execute( - base::StringPrintf("CREATE INDEX %s_signon ON %s (signon_realm)", - table_name_.c_str(), table_name_.c_str()) - .c_str()) && + std::all_of(create_index_sqls.begin(), create_index_sqls.end(), + [&db](const std::string& sql) { + return db->Execute(sql.c_str()); + }) && transaction.Commit(); } @@ -168,7 +268,7 @@ DCHECK(IsVersionLastAndSealed(sealed_version_)); std::string result; for (const Column& column : columns_) { - if (IsInLastVersion(column)) + if (IsColumnInLastVersion(column)) Append(column.name, &result); } return result; @@ -178,7 +278,7 @@ DCHECK(IsVersionLastAndSealed(sealed_version_)); std::string result; for (const Column& column : columns_) { - if (IsInLastVersion(column) && !column.part_of_unique_key) + if (IsColumnInLastVersion(column) && !column.part_of_unique_key) Append(column.name + "=?", &result); } return result; @@ -188,7 +288,7 @@ DCHECK(IsVersionLastAndSealed(sealed_version_)); std::string result; for (const Column& column : columns_) { - if (IsInLastVersion(column) && column.part_of_unique_key) { + if (IsColumnInLastVersion(column) && column.part_of_unique_key) { if (!result.empty()) result += " AND "; result += column.name + "=?"; @@ -197,11 +297,28 @@ return result; } +std::string SQLTableBuilder::ListAllIndexNames() const { + DCHECK(IsVersionLastAndSealed(sealed_version_)); + std::string result; + for (const Index& index : indices_) { + if (IsIndexInLastVersion(index)) + Append(index.name, &result); + } + return result; +} + size_t SQLTableBuilder::NumberOfColumns() const { DCHECK(IsVersionLastAndSealed(sealed_version_)); return base::checked_cast<size_t>(std::count_if( columns_.begin(), columns_.end(), - [this](const Column& column) { return (IsInLastVersion(column)); })); + [this](const Column& column) { return IsColumnInLastVersion(column); })); +} + +size_t SQLTableBuilder::NumberOfIndices() const { + DCHECK(IsVersionLastAndSealed(sealed_version_)); + return base::checked_cast<size_t>(std::count_if( + indices_.begin(), indices_.end(), + [this](const Index& index) { return IsIndexInLastVersion(index); })); } bool SQLTableBuilder::MigrateToNextFrom(unsigned old_version, @@ -226,8 +343,7 @@ DCHECK(!column->part_of_unique_key); // This column was deleted after |old_version|. It can have two reasons: needs_temp_table = true; - auto next_column = column; - ++next_column; + auto next_column = std::next(column); if (next_column != columns_.end() && next_column->gets_previous_data) { // (1) The column is being renamed. DCHECK_EQ(column->type, next_column->type); @@ -281,10 +397,6 @@ temp_table_name.c_str(), table_name_.c_str()) .c_str()) && - db->Execute( - base::StringPrintf("CREATE INDEX %s_signon ON %s (signon_realm)", - table_name_.c_str(), table_name_.c_str()) - .c_str()) && transaction.Commit())) { return false; } @@ -306,36 +418,83 @@ } } - return true; + return MigrateIndicesToNextFrom(old_version, db); } -std::list<SQLTableBuilder::Column>::reverse_iterator -SQLTableBuilder::FindLastByName(const std::string& name) { +bool SQLTableBuilder::MigrateIndicesToNextFrom(unsigned old_version, + sql::Connection* db) { + DCHECK_LT(old_version, sealed_version_); + DCHECK(IsVersionLastAndSealed(sealed_version_)); + sql::Transaction transaction(db); + if (!transaction.Begin()) + return false; + + for (const auto& index : indices_) { + std::string sql; + if (index.max_version <= old_version) { + // Index is not supposed to exist in the new version. + sql = base::StringPrintf("DROP INDEX IF EXISTS %s", index.name.c_str()); + } else if (index.min_version <= old_version + 1) { + // Index is supposed to exist in the new version. + sql = base::StringPrintf("CREATE INDEX IF NOT EXISTS %s ON %s (%s)", + index.name.c_str(), table_name_.c_str(), + base::JoinString(index.columns, ", ").c_str()); + } else { + continue; + } + + if (!db->Execute(sql.c_str())) + return false; + } + + return transaction.Commit(); +} + +std::vector<SQLTableBuilder::Column>::reverse_iterator +SQLTableBuilder::FindLastColumnByName(const std::string& name) { return std::find_if( columns_.rbegin(), columns_.rend(), [&name](const Column& column) { return name == column.name; }); } +std::vector<SQLTableBuilder::Index>::reverse_iterator +SQLTableBuilder::FindLastIndexByName(const std::string& name) { + return std::find_if( + indices_.rbegin(), indices_.rend(), + [&name](const Index& index) { return name == index.name; }); +} + bool SQLTableBuilder::IsVersionLastAndSealed(unsigned version) const { // Is |version| the last sealed one? if (sealed_version_ != version) return false; // Is the current version the last sealed one? In other words, is there - // either a column added past the sealed version (min_version > sealed) or - // deleted one version after the sealed (max_version == sealed)? - return columns_.end() == - std::find_if(columns_.begin(), columns_.end(), + // neither a column or index added past the sealed version (min_version > + // sealed) nor deleted one version after the sealed (max_version == sealed)? + return std::none_of(columns_.begin(), columns_.end(), [this](const Column& column) { return column.min_version > sealed_version_ || column.max_version == sealed_version_; + }) && + std::none_of(indices_.begin(), indices_.end(), + [this](const Index& index) { + return index.min_version > sealed_version_ || + index.max_version == sealed_version_; }); } -bool SQLTableBuilder::IsInLastVersion(const Column& column) const { +bool SQLTableBuilder::IsColumnInLastVersion(const Column& column) const { DCHECK(IsVersionLastAndSealed(sealed_version_)); return (column.min_version <= sealed_version_ && (column.max_version == kInvalidVersion || column.max_version >= sealed_version_)); } +bool SQLTableBuilder::IsIndexInLastVersion(const Index& index) const { + DCHECK(IsVersionLastAndSealed(sealed_version_)); + return (index.min_version <= sealed_version_ && + (index.max_version == kInvalidVersion || + index.max_version >= sealed_version_)); +} + } // namespace password_manager
diff --git a/components/password_manager/core/browser/sql_table_builder.h b/components/password_manager/core/browser/sql_table_builder.h index 5604656..8407186d 100644 --- a/components/password_manager/core/browser/sql_table_builder.h +++ b/components/password_manager/core/browser/sql_table_builder.h
@@ -6,8 +6,8 @@ #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_SQL_TABLE_BUILDER_H_ #include <limits> -#include <list> #include <string> +#include <vector> #include "base/macros.h" @@ -20,10 +20,6 @@ // Use this class to represent the versioned evolution of a SQLite table // structure and generate creating and migrating statements for it. // -// One value is currently hard-coded, because it is the same in the current -// use-cases: -// * The index is built for column "signon_realm" which is expected to exist. -// // Usage example: // // SQLTableBuilder builder("logins"); @@ -39,9 +35,9 @@ // DCHECK_EQ(1u, version); // // // Now, assuming that |db| has a table "logins" in a state corresponding -// // version 0, this will migrate it to version 1: +// // version 0, this will migrate it to the latest version: // sql::Connection* db = ...; -// builder.MigrateToNextFrom(0, db); +// builder.MigrateFrom(0, db); // // // And assuming |db| has no table called "logins", this will create one // // in a state corresponding the latest sealed version: @@ -55,26 +51,41 @@ // Adds a column in the table description, with |name| and |type|. |name| // must not have been added to the table in this version before. - void AddColumn(const std::string& name, const std::string& type); + void AddColumn(std::string name, std::string type); // As AddColumn but also adds column |name| to the unique key of the table. // SealVersion must not have been called yet (the builder does not currently // support migration code for changing the unique key between versions). - void AddColumnToUniqueKey(const std::string& name, const std::string& type); + void AddColumnToUniqueKey(std::string name, std::string type); - // Renames column |old_name| to |new_name|. |old_name| must have been added in - // the past. The column "signon_realm" must not be renamed. + // Renames column |old_name| to |new_name|. |new_name| can not exist already. + // |old_name| must have been added in the past. Furthermore, there must be no + // index in this version referencing |old_name|. void RenameColumn(const std::string& old_name, const std::string& new_name); - // Removes column |name|. |name| must have been added in the past. The column - // "signon_realm" must not be renamed. + // Removes column |name|. |name| must have been added in the past. + // Furthermore, there must be no index in this version referencing |name|. void DropColumn(const std::string& name); + // Adds an index in the table description, with |name| and on columns + // |columns|. |name| must not have been added to the table in this version + // before. Furthermore, |columns| must be non-empty, and every column + // referenced in |columns| must be unique and exist in the current version. + void AddIndex(std::string name, std::vector<std::string> columns); + + // Renames index |old_name| to |new_name|. |new_name| can not exist already + // and |old_name| must have been added in a previously sealed version, and can + // not have been renamed already. + void RenameIndex(const std::string& old_name, const std::string& new_name); + + // Removes index |name|. |name| must have been added in a previously sealed + // version. + void DropIndex(const std::string& name); + // Increments the internal version counter and marks the current state of the // table as that version. Returns the sealed version. Calling any of the - // *Column* methods above will result in starting a new version which is not - // considered sealed. The first version is 0. The column "signon_realm" must - // be present in |columns_| every time this is called, and at least one call + // *Column* and *Index* methods above will result in starting a new version + // which is not considered sealed. The first version is 0. At least one call // to AddColumnToUniqueKey must have been done before this is called the first // time. unsigned SealVersion(); @@ -102,14 +113,25 @@ // " AND ". std::string ListAllUniqueKeyNames() const; + // Returns the comma-separated list of all index names present in the last + // version. The last version must be sealed. + std::string ListAllIndexNames() const; + // Returns the number of all columns present in the last version. The last // version must be sealed. size_t NumberOfColumns() const; + // Returns the number of all indices present in the last version. The last + // version must be sealed. + size_t NumberOfIndices() const; + private: // Stores the information about one column (name, type, etc.). struct Column; + // Stores the information about one index (name, columns, etc.). + struct Index; + static unsigned constexpr kInvalidVersion = std::numeric_limits<unsigned>::max(); @@ -119,9 +141,22 @@ // at least |old_version + 1| and sealed. Returns true on success. bool MigrateToNextFrom(unsigned old_version, sql::Connection* db); + // Assuming that the database connected through |db| contains a table called + // |table_name_| in a state described by version |old_version|, migrates it + // indices to version |old_version + 1|. The current version known to the + // builder must be at least |old_version + 1| and sealed. Returns true on + // success. + bool MigrateIndicesToNextFrom(unsigned old_version, sql::Connection* db); + // Looks up column named |name| in |columns_|. If present, returns the last // one. - std::list<Column>::reverse_iterator FindLastByName(const std::string& name); + std::vector<Column>::reverse_iterator FindLastColumnByName( + const std::string& name); + + // Looks up index named |name| in |indices_|. If present, returns the last + // one. + std::vector<Index>::reverse_iterator FindLastIndexByName( + const std::string& name); // Returns whether the last version is |version| and whether it was sealed // (by calling SealVersion with no table modifications afterwards). @@ -129,12 +164,18 @@ // Whether |column| is present in the last version. The last version must be // sealed. - bool IsInLastVersion(const Column& column) const; + bool IsColumnInLastVersion(const Column& column) const; + + // Whether |index| is present in the last version. The last version must be + // sealed. + bool IsIndexInLastVersion(const Index& index) const; // Last sealed version, kInvalidVersion means "none". unsigned sealed_version_ = kInvalidVersion; - std::list<Column> columns_; // Columns of the table, across all versions. + std::vector<Column> columns_; // Columns of the table, across all versions. + + std::vector<Index> indices_; // Indices of the table, across all versions. // The "UNIQUE" part of an SQL CREATE TABLE constraint. This value is // computed dring sealing the first version (0).
diff --git a/components/password_manager/core/browser/sql_table_builder_unittest.cc b/components/password_manager/core/browser/sql_table_builder_unittest.cc index 3ba0ad7..3fbe38a8 100644 --- a/components/password_manager/core/browser/sql_table_builder_unittest.cc +++ b/components/password_manager/core/browser/sql_table_builder_unittest.cc
@@ -68,7 +68,6 @@ EXPECT_TRUE(builder()->MigrateFrom(0, db())); EXPECT_TRUE(builder()->CreateTable(db())); EXPECT_TRUE(db()->DoesTableExist("my_logins_table")); - EXPECT_TRUE(db()->DoesIndexExist("my_logins_table_signon")); EXPECT_TRUE(db()->DoesColumnExist("my_logins_table", "signon_realm")); EXPECT_TRUE(IsColumnOfType("signon_realm", "VARCHAR NOT NULL")); } @@ -79,12 +78,33 @@ EXPECT_TRUE(builder()->MigrateFrom(0, db())); EXPECT_TRUE(builder()->CreateTable(db())); EXPECT_TRUE(db()->DoesTableExist("my_logins_table")); - EXPECT_TRUE(db()->DoesIndexExist("my_logins_table_signon")); EXPECT_TRUE(db()->DoesColumnExist("my_logins_table", "signon_realm")); EXPECT_TRUE(db()->DoesColumnExist("my_logins_table", "password_value")); EXPECT_TRUE(IsColumnOfType("password_value", "BLOB")); } +TEST_F(SQLTableBuilderTest, AddIndex) { + builder()->AddIndex("my_logins_table_signon", {"signon_realm"}); + EXPECT_EQ(0u, builder()->SealVersion()); + EXPECT_TRUE(builder()->MigrateFrom(0, db())); + EXPECT_TRUE(builder()->CreateTable(db())); + EXPECT_TRUE(db()->DoesTableExist("my_logins_table")); + EXPECT_TRUE(db()->DoesIndexExist("my_logins_table_signon")); +} + +TEST_F(SQLTableBuilderTest, AddIndexOnMultipleColumns) { + builder()->AddColumn("column_1", "BLOB"); + builder()->AddColumn("column_2", "BLOB"); + builder()->AddIndex("my_index", {"column_1", "column_2"}); + EXPECT_EQ(0u, builder()->SealVersion()); + EXPECT_TRUE(builder()->MigrateFrom(0, db())); + EXPECT_TRUE(builder()->CreateTable(db())); + EXPECT_TRUE(db()->DoesTableExist("my_logins_table")); + EXPECT_TRUE(db()->DoesColumnExist("my_logins_table", "column_1")); + EXPECT_TRUE(db()->DoesColumnExist("my_logins_table", "column_2")); + EXPECT_TRUE(db()->DoesIndexExist("my_index")); +} + TEST_F(SQLTableBuilderTest, RenameColumn_InSameVersion) { builder()->AddColumn("old_name", "BLOB"); builder()->RenameColumn("old_name", "password_value"); @@ -108,6 +128,22 @@ EXPECT_TRUE(IsColumnOfType("password_value", "BLOB")); } +// There is no test for renaming an index in the same version, as this is a +// misuse of the API. Instead of invoking |builder()->AddIndex("foo", ...)| and +// |builder->RenameIndex("foo", "bar")| callers should simply use +// |builder->AddIndex("bar", ...)|. + +TEST_F(SQLTableBuilderTest, RenameIndex_InNextVersion) { + builder()->AddIndex("old_index", {"signon_realm"}); + EXPECT_EQ(0u, builder()->SealVersion()); + builder()->RenameIndex("old_index", "new_index"); + EXPECT_EQ(1u, builder()->SealVersion()); + EXPECT_TRUE(builder()->CreateTable(db())); + EXPECT_TRUE(db()->DoesTableExist("my_logins_table")); + EXPECT_FALSE(db()->DoesIndexExist("old_index")); + EXPECT_TRUE(db()->DoesIndexExist("new_index")); +} + TEST_F(SQLTableBuilderTest, RenameColumn_SameNameInSameVersion) { builder()->AddColumn("name", "BLOB"); builder()->RenameColumn("name", "name"); @@ -129,6 +165,16 @@ EXPECT_TRUE(IsColumnOfType("name", "BLOB")); } +TEST_F(SQLTableBuilderTest, RenameIndex_SameNameInNextVersion) { + builder()->AddIndex("my_index", {"signon_realm"}); + EXPECT_EQ(0u, builder()->SealVersion()); + builder()->RenameIndex("my_index", "my_index"); + EXPECT_EQ(1u, builder()->SealVersion()); + EXPECT_TRUE(builder()->CreateTable(db())); + EXPECT_TRUE(db()->DoesTableExist("my_logins_table")); + EXPECT_TRUE(db()->DoesIndexExist("my_index")); +} + TEST_F(SQLTableBuilderTest, DropColumn_InSameVersion) { builder()->AddColumn("password_value", "BLOB"); builder()->DropColumn("password_value"); @@ -148,15 +194,29 @@ EXPECT_FALSE(db()->DoesColumnExist("my_logins_table", "password_value")); } +TEST_F(SQLTableBuilderTest, DropIndex_InNextVersion) { + builder()->AddIndex("my_index", {"signon_realm"}); + EXPECT_EQ(0u, builder()->SealVersion()); + builder()->DropIndex("my_index"); + EXPECT_EQ(1u, builder()->SealVersion()); + EXPECT_TRUE(builder()->CreateTable(db())); + EXPECT_TRUE(db()->DoesTableExist("my_logins_table")); + EXPECT_FALSE(db()->DoesIndexExist("my_index")); +} + TEST_F(SQLTableBuilderTest, MigrateFrom) { // First, create a table at version 0, with some columns. builder()->AddColumn("for_renaming", "INTEGER DEFAULT 100"); builder()->AddColumn("for_deletion", "INTEGER"); + builder()->AddIndex("my_signon_index", {"signon_realm"}); + builder()->AddIndex("my_changing_index_v0", {"for_renaming", "for_deletion"}); EXPECT_EQ(0u, builder()->SealVersion()); EXPECT_TRUE(builder()->CreateTable(db())); EXPECT_TRUE(db()->DoesTableExist("my_logins_table")); EXPECT_TRUE(db()->DoesColumnExist("my_logins_table", "for_renaming")); EXPECT_TRUE(db()->DoesColumnExist("my_logins_table", "for_deletion")); + EXPECT_TRUE(db()->DoesIndexExist("my_signon_index")); + EXPECT_TRUE(db()->DoesIndexExist("my_changing_index_v0")); EXPECT_TRUE( db()->Execute("INSERT INTO my_logins_table (signon_realm, for_renaming, " "for_deletion) VALUES ('abc', 123, 456)")); @@ -172,21 +232,28 @@ EXPECT_TRUE(first_check.Succeeded()); // Now, specify some modifications for version 1. + builder()->DropIndex("my_changing_index_v0"); builder()->RenameColumn("for_renaming", "renamed"); builder()->DropColumn("for_deletion"); builder()->AddColumn("new_column", "INTEGER DEFAULT 789"); + builder()->AddIndex("my_changing_index_v1", {"renamed", "new_column"}); EXPECT_EQ(1u, builder()->SealVersion()); // The migration should have the following effect: // * The renamed column should keep its non-default value. // * The succession of column removal and addition should not result in the // values from the deleted column to be copied to the added one. + // * Only the signon index and the second version of the changing index should + // be present in the last version. EXPECT_TRUE(builder()->MigrateFrom(0, db())); EXPECT_FALSE(db()->DoesColumnExist("my_logins_table", "for_renaming")); EXPECT_FALSE(db()->DoesColumnExist("my_logins_table", "for_deletion")); EXPECT_TRUE(db()->DoesColumnExist("my_logins_table", "renamed")); EXPECT_TRUE(IsColumnOfType("renamed", "INTEGER")); EXPECT_TRUE(db()->DoesColumnExist("my_logins_table", "new_column")); + EXPECT_TRUE(db()->DoesIndexExist("my_signon_index")); + EXPECT_FALSE(db()->DoesIndexExist("my_changing_index_v0")); + EXPECT_TRUE(db()->DoesIndexExist("my_changing_index_v1")); sql::Statement second_check( db()->GetCachedStatement(SQL_FROM_HERE, retrieval)); EXPECT_TRUE(second_check.Step()); @@ -198,7 +265,7 @@ EXPECT_TRUE(second_check.Succeeded()); } -TEST_F(SQLTableBuilderTest, MigrateFrom_RenameAndAdd) { +TEST_F(SQLTableBuilderTest, MigrateFrom_RenameAndAddColumns) { builder()->AddColumn("old_name", "INTEGER"); EXPECT_EQ(0u, builder()->SealVersion()); @@ -222,7 +289,27 @@ EXPECT_EQ("signon_realm=?", builder()->ListAllUniqueKeyNames()); } -TEST_F(SQLTableBuilderTest, MigrateFrom_RenameAndAddAndDrop) { +TEST_F(SQLTableBuilderTest, MigrateFrom_RenameAndAddIndices) { + builder()->AddIndex("old_name", {"signon_realm"}); + EXPECT_EQ(0u, builder()->SealVersion()); + + EXPECT_TRUE(builder()->CreateTable(db())); + + builder()->RenameIndex("old_name", "new_name"); + EXPECT_EQ(1u, builder()->SealVersion()); + + builder()->AddIndex("added", {"signon_realm"}); + EXPECT_EQ(2u, builder()->SealVersion()); + + EXPECT_TRUE(builder()->MigrateFrom(0, db())); + EXPECT_FALSE(db()->DoesIndexExist("old_name")); + EXPECT_TRUE(db()->DoesIndexExist("added")); + EXPECT_TRUE(db()->DoesIndexExist("new_name")); + EXPECT_EQ(2u, builder()->NumberOfIndices()); + EXPECT_EQ("new_name, added", builder()->ListAllIndexNames()); +} + +TEST_F(SQLTableBuilderTest, MigrateFrom_RenameAndAddAndDropColumns) { builder()->AddColumnToUniqueKey("uni", "VARCHAR NOT NULL"); builder()->AddColumn("old_name", "INTEGER"); EXPECT_EQ(0u, builder()->SealVersion()); @@ -250,4 +337,27 @@ EXPECT_EQ("signon_realm=? AND uni=?", builder()->ListAllUniqueKeyNames()); } +TEST_F(SQLTableBuilderTest, MigrateFrom_RenameAndAddAndDropIndices) { + builder()->AddIndex("old_name", {"signon_realm"}); + EXPECT_EQ(0u, builder()->SealVersion()); + + EXPECT_TRUE(builder()->CreateTable(db())); + + builder()->RenameIndex("old_name", "new_name"); + EXPECT_EQ(1u, builder()->SealVersion()); + + builder()->AddIndex("added", {"signon_realm"}); + EXPECT_EQ(2u, builder()->SealVersion()); + + builder()->DropIndex("added"); + EXPECT_EQ(3u, builder()->SealVersion()); + + EXPECT_TRUE(builder()->MigrateFrom(0, db())); + EXPECT_FALSE(db()->DoesIndexExist("old_name")); + EXPECT_FALSE(db()->DoesIndexExist("added")); + EXPECT_TRUE(db()->DoesIndexExist("new_name")); + EXPECT_EQ(1u, builder()->NumberOfColumns()); + EXPECT_EQ("new_name", builder()->ListAllIndexNames()); +} + } // namespace password_manager
diff --git a/components/password_manager/core/browser/stub_password_manager_client.cc b/components/password_manager/core/browser/stub_password_manager_client.cc index 0f91970..f31ab34 100644 --- a/components/password_manager/core/browser/stub_password_manager_client.cc +++ b/components/password_manager/core/browser/stub_password_manager_client.cc
@@ -14,7 +14,10 @@ StubPasswordManagerClient::StubPasswordManagerClient() : ukm_source_id_(ukm::UkmRecorder::Get() ? ukm::UkmRecorder::Get()->GetNewSourceID() - : 0) {} + : 0), + metrics_recorder_(PasswordManagerMetricsRecorder::CreateUkmEntryBuilder( + ukm::UkmRecorder::Get(), + ukm_source_id_)) {} StubPasswordManagerClient::~StubPasswordManagerClient() {} @@ -90,4 +93,9 @@ return ukm_source_id_; } +PasswordManagerMetricsRecorder& +StubPasswordManagerClient::GetMetricsRecorder() { + return metrics_recorder_; +} + } // namespace password_manager
diff --git a/components/password_manager/core/browser/stub_password_manager_client.h b/components/password_manager/core/browser/stub_password_manager_client.h index 17ea899..dd5c47c0 100644 --- a/components/password_manager/core/browser/stub_password_manager_client.h +++ b/components/password_manager/core/browser/stub_password_manager_client.h
@@ -7,6 +7,7 @@ #include "base/macros.h" #include "components/password_manager/core/browser/password_manager_client.h" +#include "components/password_manager/core/browser/password_manager_metrics_recorder.h" #include "components/password_manager/core/browser/stub_credentials_filter.h" #include "components/password_manager/core/browser/stub_log_manager.h" @@ -53,11 +54,13 @@ #endif ukm::UkmRecorder* GetUkmRecorder() override; ukm::SourceId GetUkmSourceId() override; + PasswordManagerMetricsRecorder& GetMetricsRecorder() override; private: const StubCredentialsFilter credentials_filter_; StubLogManager log_manager_; ukm::SourceId ukm_source_id_; + PasswordManagerMetricsRecorder metrics_recorder_; DISALLOW_COPY_AND_ASSIGN(StubPasswordManagerClient); };
diff --git a/components/password_manager/core/common/password_manager_features.cc b/components/password_manager/core/common/password_manager_features.cc index eb0e30f..5dce1e7e 100644 --- a/components/password_manager/core/common/password_manager_features.cc +++ b/components/password_manager/core/common/password_manager_features.cc
@@ -44,7 +44,7 @@ base::FEATURE_DISABLED_BY_DEFAULT}; // Control whether users can view and copy passwords. This is only used for -// Android, the desktop version of Chrome always allows users to view +// mobile, the desktop version of Chrome always allows users to view // passwords. const base::Feature kViewPasswords = {"view-passwords", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/components/password_manager/core/common/password_manager_pref_names.cc b/components/password_manager/core/common/password_manager_pref_names.cc index 34f10ea..7166f1e 100644 --- a/components/password_manager/core/common/password_manager_pref_names.cc +++ b/components/password_manager/core/common/password_manager_pref_names.cc
@@ -41,5 +41,8 @@ const char kSyncPasswordHash[] = "profile.sync_password_hash"; +const char kSyncPasswordLengthAndHashSalt[] = + "profile.sync_password_length_and_hash_salt"; + } // namespace prefs } // namespace password_manager
diff --git a/components/password_manager/core/common/password_manager_pref_names.h b/components/password_manager/core/common/password_manager_pref_names.h index 9f05a76..a63e35b 100644 --- a/components/password_manager/core/common/password_manager_pref_names.h +++ b/components/password_manager/core/common/password_manager_pref_names.h
@@ -68,9 +68,14 @@ // Number of times the Chrome Sign in promo popped up. extern const char kNumberSignInPasswordPromoShown[]; -// String that represent the sync password hash. +// String that represents the sync password hash. extern const char kSyncPasswordHash[]; +// String that represents the sync password length and salt. Its format is +// encrypted and converted to base64 string "<password length, as ascii +// int>.<16 char salt>". +extern const char kSyncPasswordLengthAndHashSalt[]; + } // namespace prefs } // namespace password_manager
diff --git a/components/payments/content/origin_security_checker.cc b/components/payments/content/origin_security_checker.cc index 2098608..e25f558 100644 --- a/components/payments/content/origin_security_checker.cc +++ b/components/payments/content/origin_security_checker.cc
@@ -23,7 +23,7 @@ // static bool OriginSecurityChecker::IsOriginLocalhostOrFile(const GURL& url) { return url.is_valid() && - (net::IsLocalhost(url.HostNoBrackets()) || url.SchemeIsFile()); + (net::IsLocalhost(url.HostNoBracketsPiece()) || url.SchemeIsFile()); } } // namespace payments
diff --git a/components/payments/content/payment_request_spec.cc b/components/payments/content/payment_request_spec.cc index fc3f5ca5..fce3e29 100644 --- a/components/payments/content/payment_request_spec.cc +++ b/components/payments/content/payment_request_spec.cc
@@ -186,29 +186,19 @@ method_data_entry->supported_types) { autofill::CreditCard::CardType card_type = GetBasicCardType(type); method_data.supported_types.insert(card_type); - supported_card_types_set_.insert(card_type); } method_data_vector.push_back(std::move(method_data)); } - // TODO(rouslan): Parse card types (credit, debit, prepaid) in data_util, so - // iOS can use it as well. http://crbug.com/602665 data_util::ParseBasicCardSupportedNetworks(method_data_vector, &supported_card_networks_, &basic_card_specified_networks_); supported_card_networks_set_.insert(supported_card_networks_.begin(), supported_card_networks_.end()); - // Omitting the card types means all 3 card types are supported. - if (supported_card_types_set_.empty()) { - supported_card_types_set_.insert(autofill::CreditCard::CARD_TYPE_CREDIT); - supported_card_types_set_.insert(autofill::CreditCard::CARD_TYPE_DEBIT); - supported_card_types_set_.insert(autofill::CreditCard::CARD_TYPE_PREPAID); - } - - // Let the user decide whether an unknown card type should be used. - supported_card_types_set_.insert(autofill::CreditCard::CARD_TYPE_UNKNOWN); + data_util::ParseSupportedCardTypes(method_data_vector, + &supported_card_types_set_); } void PaymentRequestSpec::UpdateSelectedShippingOption(bool after_update) {
diff --git a/components/payments/core/payment_request_data_util.cc b/components/payments/core/payment_request_data_util.cc index 8a9585f7..bee795f 100644 --- a/components/payments/core/payment_request_data_util.cc +++ b/components/payments/core/payment_request_data_util.cc
@@ -4,6 +4,7 @@ #include "components/payments/core/payment_request_data_util.h" +#include "base/stl_util.h" #include "base/strings/string16.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" @@ -11,7 +12,6 @@ #include "components/autofill/core/browser/autofill_country.h" #include "components/autofill/core/browser/autofill_data_util.h" #include "components/autofill/core/browser/autofill_profile.h" -#include "components/autofill/core/browser/credit_card.h" #include "components/autofill/core/browser/field_types.h" #include "components/autofill/core/browser/personal_data_manager.h" #include "components/autofill/core/browser/validation.h" @@ -154,6 +154,36 @@ } } +void ParseSupportedCardTypes( + const std::vector<PaymentMethodData>& method_data, + std::set<autofill::CreditCard::CardType>* out_supported_card_types_set) { + DCHECK(out_supported_card_types_set->empty()); + + for (const PaymentMethodData& method_data_entry : method_data) { + // Ignore |supported_types| if |supported_methods| does not contain + // "basic_card". + if (!base::ContainsValue(method_data_entry.supported_methods, "basic-card")) + continue; + + for (const autofill::CreditCard::CardType& card_type : + method_data_entry.supported_types) { + out_supported_card_types_set->insert(card_type); + } + } + + // Omitting the card types means all 3 card types are supported. + if (out_supported_card_types_set->empty()) { + out_supported_card_types_set->insert( + autofill::CreditCard::CARD_TYPE_CREDIT); + out_supported_card_types_set->insert(autofill::CreditCard::CARD_TYPE_DEBIT); + out_supported_card_types_set->insert( + autofill::CreditCard::CARD_TYPE_PREPAID); + } + + // Let the user decide whether an unknown card type should be used. + out_supported_card_types_set->insert(autofill::CreditCard::CARD_TYPE_UNKNOWN); +} + base::string16 GetFormattedPhoneNumberForDisplay( const autofill::AutofillProfile& profile, const std::string& locale) {
diff --git a/components/payments/core/payment_request_data_util.h b/components/payments/core/payment_request_data_util.h index c3c1adb..93b80f1 100644 --- a/components/payments/core/payment_request_data_util.h +++ b/components/payments/core/payment_request_data_util.h
@@ -10,10 +10,10 @@ #include <vector> #include "base/strings/string16.h" +#include "components/autofill/core/browser/credit_card.h" namespace autofill { class AutofillProfile; -class CreditCard; } // namespace autofill namespace payments { @@ -52,6 +52,14 @@ std::vector<std::string>* out_supported_networks, std::set<std::string>* out_basic_card_supported_networks); +// Parses the supported card types (e.g., credit, debit, prepaid) from +// supportedTypes. |out_supported_card_types_set| is expected to be empty. It +// will always contain autofill::CreditCard::CARD_TYPE_UNKNOWN after the call. +// Also, it gets filled with all of the card types if supportedTypes is empty. +void ParseSupportedCardTypes( + const std::vector<PaymentMethodData>& method_data, + std::set<autofill::CreditCard::CardType>* out_supported_card_types_set); + // Returns the phone number from the given |profile| formatted for display. base::string16 GetFormattedPhoneNumberForDisplay( const autofill::AutofillProfile& profile,
diff --git a/components/policy/core/common/async_policy_loader.cc b/components/policy/core/common/async_policy_loader.cc index e1df60ee..b0edee2e 100644 --- a/components/policy/core/common/async_policy_loader.cc +++ b/components/policy/core/common/async_policy_loader.cc
@@ -21,18 +21,17 @@ // Amount of time to wait for the files on disk to settle before trying to load // them. This alleviates the problem of reading partially written files and // makes it possible to batch quasi-simultaneous changes. -const int kSettleIntervalSeconds = 5; +constexpr TimeDelta kSettleInterval = TimeDelta::FromSeconds(5); // The time interval for rechecking policy. This is the fallback in case the // implementation never detects changes. -const int kReloadIntervalSeconds = 15 * 60; +constexpr TimeDelta kReloadInterval = TimeDelta::FromMinutes(15); } // namespace AsyncPolicyLoader::AsyncPolicyLoader( const scoped_refptr<base::SequencedTaskRunner>& task_runner) - : task_runner_(task_runner), - weak_factory_(this) {} + : task_runner_(task_runner) {} AsyncPolicyLoader::~AsyncPolicyLoader() {} @@ -63,7 +62,7 @@ schema_map_->FilterBundle(bundle.get()); update_callback_.Run(std::move(bundle)); - ScheduleNextReload(TimeDelta::FromSeconds(kReloadIntervalSeconds)); + ScheduleNextReload(kReloadInterval); } std::unique_ptr<PolicyBundle> AsyncPolicyLoader::InitialLoad( @@ -93,7 +92,7 @@ Reload(false); // Start periodic refreshes. - ScheduleNextReload(TimeDelta::FromSeconds(kReloadIntervalSeconds)); + ScheduleNextReload(kReloadInterval); } void AsyncPolicyLoader::RefreshPolicies(scoped_refptr<SchemaMap> schema_map) { @@ -118,8 +117,6 @@ return true; // If there was a change since the last recorded modification, wait some more. - const TimeDelta kSettleInterval( - TimeDelta::FromSeconds(kSettleIntervalSeconds)); if (last_modification != last_modification_time_) { last_modification_time_ = last_modification; last_modification_clock_ = now;
diff --git a/components/policy/core/common/async_policy_loader.h b/components/policy/core/common/async_policy_loader.h index b15578cf..04ea60b9 100644 --- a/components/policy/core/common/async_policy_loader.h +++ b/components/policy/core/common/async_policy_loader.h
@@ -30,9 +30,10 @@ // // All methods are invoked on the background |task_runner_|, including the // destructor. The only exceptions are the constructor (which may be called on -// any thread), and the initial Load() which is called on the thread that owns -// the provider. -// LastModificationTime() is also invoked once on that thread at startup. +// any thread), InitialLoad() which is called on the thread that owns the +// provider and the calls of Load() and LastModificationTime() during the +// initial load. +// Also, during tests the destructor may be called on the main thread. class POLICY_EXPORT AsyncPolicyLoader { public: explicit AsyncPolicyLoader( @@ -96,8 +97,8 @@ // before retrying when this returns false. bool IsSafeToReload(const base::Time& now, base::TimeDelta* delay); - // Task runner to run background threads. - scoped_refptr<base::SequencedTaskRunner> task_runner_; + // Task runner for running background jobs. + const scoped_refptr<base::SequencedTaskRunner> task_runner_; // Callback for updates, passed in Init(). UpdateCallback update_callback_; @@ -115,7 +116,7 @@ scoped_refptr<SchemaMap> schema_map_; // Used to get WeakPtrs for the periodic reload task. - base::WeakPtrFactory<AsyncPolicyLoader> weak_factory_; + base::WeakPtrFactory<AsyncPolicyLoader> weak_factory_{this}; DISALLOW_COPY_AND_ASSIGN(AsyncPolicyLoader); };
diff --git a/components/policy/core/common/cloud/component_cloud_policy_service.cc b/components/policy/core/common/cloud/component_cloud_policy_service.cc index 456ab5fa..ce3a5a43 100644 --- a/components/policy/core/common/cloud/component_cloud_policy_service.cc +++ b/components/policy/core/common/cloud/component_cloud_policy_service.cc
@@ -126,6 +126,8 @@ bool has_credentials_set_ = false; std::unique_ptr<ScopedResponseMap> last_fetched_policy_; + SEQUENCE_CHECKER(sequence_checker_); + DISALLOW_COPY_AND_ASSIGN(Backend); }; @@ -140,11 +142,17 @@ service_task_runner_(service_task_runner), cache_(std::move(cache)), external_policy_data_fetcher_(std::move(external_policy_data_fetcher)), - store_(this, cache_.get()) {} + store_(this, cache_.get()) { + // This class is allowed to be instantiated on any thread. + DETACH_FROM_SEQUENCE(sequence_checker_); +} -ComponentCloudPolicyService::Backend::~Backend() {} +ComponentCloudPolicyService::Backend::~Backend() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +} void ComponentCloudPolicyService::Backend::ClearCache() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DVLOG(1) << "Clearing cache"; store_.Clear(); has_credentials_set_ = false; @@ -156,6 +164,7 @@ const std::string& device_id, const std::string& public_key, int public_key_version) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(!username.empty()); DCHECK(!dm_token.empty()); DVLOG(1) << "Updating credentials: username = " << username @@ -171,6 +180,8 @@ } void ComponentCloudPolicyService::Backend::InitIfNeeded() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (initialized_) return; @@ -202,6 +213,7 @@ void ComponentCloudPolicyService::Backend::SetFetchedPolicy( std::unique_ptr<ScopedResponseMap> responses) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DVLOG(2) << "Updating last fetched policies (count = " << responses->size() << ")"; last_fetched_policy_ = std::move(responses); @@ -210,6 +222,8 @@ void ComponentCloudPolicyService::Backend:: OnComponentCloudPolicyStoreUpdated() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (!initialized_) { // Ignore notifications triggered by the initial Purge or Clear. return; @@ -224,6 +238,8 @@ } void ComponentCloudPolicyService::Backend::UpdateWithLastFetchedPolicy() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (!has_credentials_set_ || !last_fetched_policy_ || !initialized_) return; @@ -352,6 +368,7 @@ void ComponentCloudPolicyService::OnRefreshSchedulerStarted( CloudPolicyCore* core) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Ignored. }
diff --git a/components/policy/core/common/cloud/component_cloud_policy_store.cc b/components/policy/core/common/cloud/component_cloud_policy_store.cc index 0928108f..231a502 100644 --- a/components/policy/core/common/cloud/component_cloud_policy_store.cc +++ b/components/policy/core/common/cloud/component_cloud_policy_store.cc
@@ -291,6 +291,7 @@ } void ComponentCloudPolicyStore::Clear() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); for (const DomainConstants& constants : kDomains) { cache_->Clear(constants.proto_cache_key); cache_->Clear(constants.data_cache_key); @@ -309,6 +310,8 @@ std::unique_ptr<em::PolicyFetchResponse> proto, em::PolicyData* policy_data, em::ExternalPolicyData* payload) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + std::string policy_type; if (!GetPolicyType(ns.domain, &policy_type)) { LOG(ERROR) << "Bad policy type " << ns.domain << ".";
diff --git a/components/policy/core/common/cloud/user_cloud_policy_manager.cc b/components/policy/core/common/cloud/user_cloud_policy_manager.cc index cf68675..a2dba23 100644 --- a/components/policy/core/common/cloud/user_cloud_policy_manager.cc +++ b/components/policy/core/common/cloud/user_cloud_policy_manager.cc
@@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/debug/crash_logging.h" #include "base/memory/ptr_util.h" #include "base/sequenced_task_runner.h" #include "components/policy/core/common/cloud/cloud_external_data_manager.h" @@ -56,6 +57,16 @@ PrefService* local_state, scoped_refptr<net::URLRequestContextGetter> request_context, std::unique_ptr<CloudPolicyClient> client) { + // TODO(emaxx): Remove the crash key after the crashes tracked at + // https://crbug.com/685996 are fixed. + if (core()->client()) { + base::debug::SetCrashKeyToStackTrace( + "user-cloud-policy-manager-connect-trace", connect_callstack_); + } else { + connect_callstack_ = base::debug::StackTrace(); + } + CHECK(!core()->client()); + CreateComponentCloudPolicyService( dm_protocol::kChromeExtensionPolicyType, component_policy_cache_path_, request_context, client.get(), schema_registry());
diff --git a/components/policy/core/common/cloud/user_cloud_policy_manager.h b/components/policy/core/common/cloud/user_cloud_policy_manager.h index a8bfd453..f5e4d586 100644 --- a/components/policy/core/common/cloud/user_cloud_policy_manager.h +++ b/components/policy/core/common/cloud/user_cloud_policy_manager.h
@@ -9,6 +9,7 @@ #include <string> #include "base/compiler_specific.h" +#include "base/debug/stack_trace.h" #include "base/files/file_path.h" #include "base/macros.h" #include "base/memory/ref_counted.h" @@ -93,6 +94,11 @@ // Manages external data referenced by policies. std::unique_ptr<CloudExternalDataManager> external_data_manager_; + // Stack trace of the previous Connect() method call. + // TODO(emaxx): Remove after the crashes tracked at https://crbug.com/685996 + // are fixed. + base::debug::StackTrace connect_callstack_; + DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManager); };
diff --git a/components/policy/core/common/config_dir_policy_loader.cc b/components/policy/core/common/config_dir_policy_loader.cc index 91f3067..5b5c0d5 100644 --- a/components/policy/core/common/config_dir_policy_loader.cc +++ b/components/policy/core/common/config_dir_policy_loader.cc
@@ -64,11 +64,15 @@ scoped_refptr<base::SequencedTaskRunner> task_runner, const base::FilePath& config_dir, PolicyScope scope) - : AsyncPolicyLoader(task_runner), config_dir_(config_dir), scope_(scope) {} + : AsyncPolicyLoader(task_runner), + task_runner_(task_runner), + config_dir_(config_dir), + scope_(scope) {} ConfigDirPolicyLoader::~ConfigDirPolicyLoader() {} void ConfigDirPolicyLoader::InitOnBackgroundThread() { + DCHECK(task_runner_->RunsTasksInCurrentSequence()); base::FilePathWatcher::Callback callback = base::Bind(&ConfigDirPolicyLoader::OnFileUpdated, base::Unretained(this)); mandatory_watcher_.Watch(config_dir_.Append(kMandatoryConfigDir), false, @@ -229,6 +233,7 @@ void ConfigDirPolicyLoader::OnFileUpdated(const base::FilePath& path, bool error) { + DCHECK(task_runner_->RunsTasksInCurrentSequence()); if (!error) Reload(false); }
diff --git a/components/policy/core/common/config_dir_policy_loader.h b/components/policy/core/common/config_dir_policy_loader.h index 707ecab5..8956353 100644 --- a/components/policy/core/common/config_dir_policy_loader.h +++ b/components/policy/core/common/config_dir_policy_loader.h
@@ -50,11 +50,14 @@ // Callback for the FilePathWatchers. void OnFileUpdated(const base::FilePath& path, bool error); + // Task runner for running background jobs. + const scoped_refptr<base::SequencedTaskRunner> task_runner_; + // The directory containing the policy files. - base::FilePath config_dir_; + const base::FilePath config_dir_; // Policies loaded by this provider will have this scope. - PolicyScope scope_; + const PolicyScope scope_; // Watchers for events on the mandatory and recommended subdirectories of // |config_dir_|.
diff --git a/components/policy/core/common/schema_map.cc b/components/policy/core/common/schema_map.cc index dd2a329..0779cd3 100644 --- a/components/policy/core/common/schema_map.cc +++ b/components/policy/core/common/schema_map.cc
@@ -24,41 +24,42 @@ } const ComponentMap* SchemaMap::GetComponents(PolicyDomain domain) const { - DomainMap::const_iterator it = map_.find(domain); - return it == map_.end() ? NULL : &it->second; + const auto it = map_.find(domain); + return it == map_.end() ? nullptr : &it->second; } const Schema* SchemaMap::GetSchema(const PolicyNamespace& ns) const { const ComponentMap* map = GetComponents(ns.domain); if (!map) - return NULL; - ComponentMap::const_iterator it = map->find(ns.component_id); - return it == map->end() ? NULL : &it->second; + return nullptr; + const auto it = map->find(ns.component_id); + return it == map->end() ? nullptr : &it->second; } void SchemaMap::FilterBundle(PolicyBundle* bundle) const { - for (PolicyBundle::iterator it = bundle->begin(); it != bundle->end(); ++it) { + for (const auto& bundle_item : *bundle) { + const PolicyNamespace& ns = bundle_item.first; + const std::unique_ptr<PolicyMap>& policy_map = bundle_item.second; + // Chrome policies are not filtered, so that typos appear in about:policy. // Everything else gets filtered, so that components only see valid policy. - if (it->first.domain == POLICY_DOMAIN_CHROME) + if (ns.domain == POLICY_DOMAIN_CHROME) continue; - const Schema* schema = GetSchema(it->first); + const Schema* schema = GetSchema(ns); if (!schema) { - it->second->Clear(); + policy_map->Clear(); continue; } if (!schema->valid()) { // Don't serve unknown policies. - it->second->Clear(); + policy_map->Clear(); continue; } - PolicyMap* map = it->second.get(); - for (PolicyMap::const_iterator it_map = map->begin(); - it_map != map->end();) { + for (auto it_map = policy_map->begin(); it_map != policy_map->end();) { const std::string& policy_name = it_map->first; const base::Value* policy_value = it_map->second.value.get(); Schema policy_schema = schema->GetProperty(policy_name); @@ -71,21 +72,22 @@ &error_path, &error)) { LOG(ERROR) << "Dropping policy " << policy_name << " of component " - << it->first.component_id << " due to error at " + << ns.component_id << " due to error at " << (error_path.empty() ? "root" : error_path) << ": " << error; - map->Erase(policy_name); + policy_map->Erase(policy_name); } } } } bool SchemaMap::HasComponents() const { - for (DomainMap::const_iterator domain = map_.begin(); - domain != map_.end(); ++domain) { - if (domain->first == POLICY_DOMAIN_CHROME) + for (const auto& item : map_) { + const PolicyDomain& domain = item.first; + const ComponentMap& component_map = item.second; + if (domain == POLICY_DOMAIN_CHROME) continue; - if (!domain->second.empty()) + if (!component_map.empty()) return true; } return false; @@ -101,12 +103,12 @@ void SchemaMap::GetNamespacesNotInOther(const SchemaMap* other, PolicyNamespaceList* list) const { list->clear(); - for (DomainMap::const_iterator domain = map_.begin(); - domain != map_.end(); ++domain) { - const ComponentMap& components = domain->second; - for (ComponentMap::const_iterator comp = components.begin(); - comp != components.end(); ++comp) { - PolicyNamespace ns(domain->first, comp->first); + for (const auto& item : map_) { + const PolicyDomain& domain = item.first; + const ComponentMap& component_map = item.second; + for (const auto& comp : component_map) { + const std::string& component_id = comp.first; + const PolicyNamespace ns(domain, component_id); if (!other->GetSchema(ns)) list->push_back(ns); }
diff --git a/components/policy/core/common/schema_map.h b/components/policy/core/common/schema_map.h index a8a5cc3..bf6f85a 100644 --- a/components/policy/core/common/schema_map.h +++ b/components/policy/core/common/schema_map.h
@@ -23,10 +23,12 @@ // Contains a mapping of policy namespaces (domain + component ID) to its // corresponding Schema. +// This class is thread-safe. class POLICY_EXPORT SchemaMap : public base::RefCountedThreadSafe<SchemaMap> { public: SchemaMap(); // Takes ownership of |map| (its contents will be swapped). + // TODO(emaxx): Change to use move semantics. explicit SchemaMap(DomainMap& map); const DomainMap& GetDomains() const;
diff --git a/components/policy/core/common/schema_registry.cc b/components/policy/core/common/schema_registry.cc index 5b282b6c..ff5a4b1 100644 --- a/components/policy/core/common/schema_registry.cc +++ b/components/policy/core/common/schema_registry.cc
@@ -29,6 +29,7 @@ void SchemaRegistry::RegisterComponent(const PolicyNamespace& ns, const Schema& schema) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); ComponentMap map; map[ns.component_id] = schema; RegisterComponents(ns.domain, map); @@ -36,6 +37,7 @@ void SchemaRegistry::RegisterComponents(PolicyDomain domain, const ComponentMap& components) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Don't issue notifications if nothing is being registered. if (components.empty()) return; @@ -51,6 +53,7 @@ } void SchemaRegistry::UnregisterComponent(const PolicyNamespace& ns) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DomainMap map(schema_map_->GetDomains()); if (map[ns.domain].erase(ns.component_id) != 0) { schema_map_ = new SchemaMap(map); @@ -61,6 +64,7 @@ } bool SchemaRegistry::IsReady() const { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); for (int i = 0; i < POLICY_DOMAIN_SIZE; ++i) { if (!domains_ready_[i]) return false; @@ -69,6 +73,7 @@ } void SchemaRegistry::SetDomainReady(PolicyDomain domain) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (domains_ready_[domain]) return; domains_ready_[domain] = true; @@ -79,32 +84,39 @@ } void SchemaRegistry::SetAllDomainsReady() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); for (int i = 0; i < POLICY_DOMAIN_SIZE; ++i) SetDomainReady(static_cast<PolicyDomain>(i)); } void SchemaRegistry::SetExtensionsDomainsReady() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); SetDomainReady(POLICY_DOMAIN_EXTENSIONS); SetDomainReady(POLICY_DOMAIN_SIGNIN_EXTENSIONS); } void SchemaRegistry::AddObserver(Observer* observer) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); observers_.AddObserver(observer); } void SchemaRegistry::RemoveObserver(Observer* observer) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); observers_.RemoveObserver(observer); } void SchemaRegistry::AddInternalObserver(InternalObserver* observer) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); internal_observers_.AddObserver(observer); } void SchemaRegistry::RemoveInternalObserver(InternalObserver* observer) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); internal_observers_.RemoveObserver(observer); } void SchemaRegistry::Notify(bool has_new_schemas) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); for (auto& observer : observers_) observer.OnSchemaRegistryUpdated(has_new_schemas); } @@ -120,6 +132,7 @@ CombinedSchemaRegistry::~CombinedSchemaRegistry() {} void CombinedSchemaRegistry::Track(SchemaRegistry* registry) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); registries_.insert(registry); registry->AddObserver(this); registry->AddInternalObserver(this); @@ -132,6 +145,7 @@ void CombinedSchemaRegistry::RegisterComponents( PolicyDomain domain, const ComponentMap& components) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DomainMap map(own_schema_map_->GetDomains()); for (ComponentMap::const_iterator it = components.begin(); it != components.end(); ++it) { @@ -142,6 +156,7 @@ } void CombinedSchemaRegistry::UnregisterComponent(const PolicyNamespace& ns) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DomainMap map(own_schema_map_->GetDomains()); if (map[ns.domain].erase(ns.component_id) != 0) { own_schema_map_ = new SchemaMap(map); @@ -152,11 +167,13 @@ } void CombinedSchemaRegistry::OnSchemaRegistryUpdated(bool has_new_schemas) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); Combine(has_new_schemas); } void CombinedSchemaRegistry::OnSchemaRegistryShuttingDown( SchemaRegistry* registry) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); registry->RemoveObserver(this); registry->RemoveInternalObserver(this); if (registries_.erase(registry) != 0) { @@ -168,6 +185,7 @@ } void CombinedSchemaRegistry::Combine(bool has_new_schemas) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // If two registries publish a Schema for the same component then it's // undefined which version gets in the combined registry. // @@ -214,6 +232,7 @@ void ForwardingSchemaRegistry::RegisterComponents( PolicyDomain domain, const ComponentMap& components) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // POLICY_DOMAIN_CHROME is skipped to avoid spurious updates when a new // Profile is created. If the ForwardingSchemaRegistry is used outside // device-level accounts then this should become configurable. @@ -223,22 +242,26 @@ } void ForwardingSchemaRegistry::UnregisterComponent(const PolicyNamespace& ns) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (wrapped_) wrapped_->UnregisterComponent(ns); // Ignore otherwise. } void ForwardingSchemaRegistry::OnSchemaRegistryUpdated(bool has_new_schemas) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); schema_map_ = wrapped_->schema_map(); Notify(has_new_schemas); } void ForwardingSchemaRegistry::OnSchemaRegistryReady() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); UpdateReadiness(); } void ForwardingSchemaRegistry::OnSchemaRegistryShuttingDown( SchemaRegistry* registry) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_EQ(wrapped_, registry); wrapped_->RemoveObserver(this); wrapped_->RemoveInternalObserver(this); @@ -247,6 +270,7 @@ } void ForwardingSchemaRegistry::UpdateReadiness() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (wrapped_->IsReady()) SetAllDomainsReady(); }
diff --git a/components/policy/core/common/schema_registry.h b/components/policy/core/common/schema_registry.h index fbe9d4d..a1d26a5 100644 --- a/components/policy/core/common/schema_registry.h +++ b/components/policy/core/common/schema_registry.h
@@ -91,6 +91,8 @@ protected: void Notify(bool has_new_schemas); + SEQUENCE_CHECKER(sequence_checker_); + scoped_refptr<SchemaMap> schema_map_; private: @@ -98,8 +100,6 @@ base::ObserverList<InternalObserver, true> internal_observers_; bool domains_ready_[POLICY_DOMAIN_SIZE]; - SEQUENCE_CHECKER(sequence_checker_); - DISALLOW_COPY_AND_ASSIGN(SchemaRegistry); };
diff --git a/components/safe_browsing/base_blocking_page.cc b/components/safe_browsing/base_blocking_page.cc index 31d08bd..efecb26 100644 --- a/components/safe_browsing/base_blocking_page.cc +++ b/components/safe_browsing/base_blocking_page.cc
@@ -362,4 +362,14 @@ sb_error_ui_ = std::move(sb_error_ui); } +// static +bool BaseBlockingPage::ShouldReportThreatDetails(SBThreatType threat_type) { + return threat_type == SB_THREAT_TYPE_URL_PHISHING || + threat_type == SB_THREAT_TYPE_URL_MALWARE || + threat_type == SB_THREAT_TYPE_URL_UNWANTED || + threat_type == SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING || + threat_type == SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE || + threat_type == SB_THREAT_TYPE_URL_PASSWORD_PROTECTION_PHISHING; +} + } // namespace safe_browsing
diff --git a/components/safe_browsing/base_blocking_page.h b/components/safe_browsing/base_blocking_page.h index d4a8c674..1757d2e 100644 --- a/components/safe_browsing/base_blocking_page.h +++ b/components/safe_browsing/base_blocking_page.h
@@ -11,6 +11,7 @@ #include "base/macros.h" #include "components/safe_browsing/base_ui_manager.h" +#include "components/safe_browsing_db/v4_protocol_manager_util.h" #include "components/security_interstitials/content/security_interstitial_page.h" #include "components/security_interstitials/core/base_safe_browsing_error_ui.h" #include "components/security_interstitials/core/metrics_helper.h" @@ -52,6 +53,9 @@ void OnDontProceed() override; void CommandReceived(const std::string& command) override; + // Checks the threat type to decide if we should report ThreatDetails. + static bool ShouldReportThreatDetails(SBThreatType threat_type); + protected: // Don't instantiate this class directly, use ShowBlockingPage instead. BaseBlockingPage(
diff --git a/components/signin/core/browser/dice_header_helper.cc b/components/signin/core/browser/dice_header_helper.cc index c451e8b..4d8aade0 100644 --- a/components/signin/core/browser/dice_header_helper.cc +++ b/components/signin/core/browser/dice_header_helper.cc
@@ -16,11 +16,14 @@ namespace { -const char kActionAttrName[] = "action"; -const char kAuthUserAttrName[] = "authuser"; -const char kAuthorizationCodeAttrName[] = "authorization_code"; -const char kEmailAttrName[] = "email"; -const char kIdAttrName[] = "id"; +const char kSigninActionAttrName[] = "action"; +const char kSigninAuthUserAttrName[] = "authuser"; +const char kSigninAuthorizationCodeAttrName[] = "authorization_code"; +const char kSigninEmailAttrName[] = "email"; +const char kSigninIdAttrName[] = "id"; +const char kSignoutEmailAttrName[] = "email"; +const char kSignoutSessionIndexAttrName[] = "sessionindex"; +const char kSignoutObfuscatedIDAttrName[] = "obfuscatedid"; // Determines the Dice action that has been passed from Gaia in the header. DiceAction GetDiceActionFromHeader(const std::string& value) { @@ -28,8 +31,6 @@ return DiceAction::SIGNIN; else if (value == "SIGNOUT") return DiceAction::SIGNOUT; - else if (value == "SINGLE_SESSION_SIGN_OUT") - return DiceAction::SINGLE_SESSION_SIGNOUT; else return DiceAction::NONE; } @@ -37,42 +38,88 @@ } // namespace // static -DiceResponseParams DiceHeaderHelper::BuildDiceResponseParams( +DiceResponseParams DiceHeaderHelper::BuildDiceSigninResponseParams( const std::string& header_value) { DCHECK(!header_value.empty()); DiceResponseParams params; + DiceResponseParams::SigninInfo& info = params.signin_info; ResponseHeaderDictionary header_dictionary = ParseAccountConsistencyResponseHeader(header_value); ResponseHeaderDictionary::const_iterator it = header_dictionary.begin(); for (; it != header_dictionary.end(); ++it) { const std::string key_name(it->first); const std::string value(it->second); - if (key_name == kActionAttrName) { + if (key_name == kSigninActionAttrName) { params.user_intention = GetDiceActionFromHeader(value); - } else if (key_name == kIdAttrName) { - params.gaia_id = value; - } else if (key_name == kEmailAttrName) { - params.email = value; - } else if (key_name == kAuthUserAttrName) { - bool parse_success = base::StringToInt(value, ¶ms.session_index); + } else if (key_name == kSigninIdAttrName) { + info.gaia_id = value; + } else if (key_name == kSigninEmailAttrName) { + info.email = value; + } else if (key_name == kSigninAuthUserAttrName) { + bool parse_success = base::StringToInt(value, &info.session_index); if (!parse_success) - params.session_index = -1; - } else if (key_name == kAuthorizationCodeAttrName) { - params.authorization_code = value; + info.session_index = -1; + } else if (key_name == kSigninAuthorizationCodeAttrName) { + info.authorization_code = value; } else { DLOG(WARNING) << "Unexpected Gaia header attribute '" << key_name << "'."; } } - if (params.gaia_id.empty() || params.email.empty() || - params.session_index == -1) { - DLOG(WARNING) << "Missing parameters for Dice header."; + if (params.user_intention != DiceAction::SIGNIN) { + DLOG(WARNING) + << "Only SIGNIN is supported through X-Chrome-ID-Consistency-Response :" + << header_value; params.user_intention = DiceAction::NONE; } - if (params.user_intention == DiceAction::SIGNIN && - params.authorization_code.empty()) { - DLOG(WARNING) << "Missing authorization code for Dice SIGNIN."; + if (info.gaia_id.empty() || info.email.empty() || info.session_index == -1 || + info.authorization_code.empty()) { + DLOG(WARNING) << "Missing header parameters for Dice SIGNIN: " + << header_value; + params.user_intention = DiceAction::NONE; + } + + return params; +} + +// static +DiceResponseParams DiceHeaderHelper::BuildDiceSignoutResponseParams( + const std::string& header_value) { + // Google internal documentation of this header at: + // http://go/gaia-response-headers + DCHECK(!header_value.empty()); + DiceResponseParams params; + params.user_intention = DiceAction::SIGNOUT; + DiceResponseParams::SignoutInfo& info = params.signout_info; + ResponseHeaderDictionary header_dictionary = + ParseAccountConsistencyResponseHeader(header_value); + ResponseHeaderDictionary::const_iterator it = header_dictionary.begin(); + for (; it != header_dictionary.end(); ++it) { + const std::string key_name(it->first); + const std::string value(it->second); + if (key_name == kSignoutObfuscatedIDAttrName) { + info.gaia_id.push_back(value); + // The Gaia ID is wrapped in quotes. + base::TrimString(value, "\"", &info.gaia_id.back()); + } else if (key_name == kSignoutEmailAttrName) { + // The email is wrapped in quotes. + info.email.push_back(value); + base::TrimString(value, "\"", &info.email.back()); + } else if (key_name == kSignoutSessionIndexAttrName) { + int session_index = -1; + bool parse_success = base::StringToInt(value, &session_index); + if (parse_success) + info.session_index.push_back(session_index); + } else { + DLOG(WARNING) << "Unexpected Gaia header attribute '" << key_name << "'."; + } + } + + if ((info.gaia_id.size() != info.email.size()) || + (info.gaia_id.size() != info.session_index.size())) { + DLOG(WARNING) << "Invalid parameter count for Dice SIGNOUT header: " + << header_value; params.user_intention = DiceAction::NONE; }
diff --git a/components/signin/core/browser/dice_header_helper.h b/components/signin/core/browser/dice_header_helper.h index 2afdbdf..d83fa03 100644 --- a/components/signin/core/browser/dice_header_helper.h +++ b/components/signin/core/browser/dice_header_helper.h
@@ -21,7 +21,12 @@ // Returns the parameters contained in the X-Chrome-ID-Consistency-Response // response header. - static DiceResponseParams BuildDiceResponseParams( + static DiceResponseParams BuildDiceSigninResponseParams( + const std::string& header_value); + + // Returns the parameters contained in the Google-Accounts-SignOut response + // header. + static DiceResponseParams BuildDiceSignoutResponseParams( const std::string& header_value); // Returns the header value for Dice requests. Returns the empty string when
diff --git a/components/signin/core/browser/fake_signin_manager.cc b/components/signin/core/browser/fake_signin_manager.cc index 32caba9..339e062 100644 --- a/components/signin/core/browser/fake_signin_manager.cc +++ b/components/signin/core/browser/fake_signin_manager.cc
@@ -31,7 +31,8 @@ : SigninManager(client, token_service, account_tracker_service, - cookie_manager_service) {} + cookie_manager_service), + token_service_(token_service) {} FakeSigninManager::~FakeSigninManager() {} @@ -91,6 +92,8 @@ const std::string account_id = GetAuthenticatedAccountId(); const std::string username = GetAuthenticatedAccountInfo().email; authenticated_account_id_.clear(); + if (token_service_) + token_service_->RevokeAllCredentials(); for (auto& observer : observer_list_) observer.GoogleSignedOut(account_id, username);
diff --git a/components/signin/core/browser/fake_signin_manager.h b/components/signin/core/browser/fake_signin_manager.h index 5ba63b8..e0168754 100644 --- a/components/signin/core/browser/fake_signin_manager.h +++ b/components/signin/core/browser/fake_signin_manager.h
@@ -66,6 +66,8 @@ // Username specified in StartSignInWithRefreshToken() call. std::string username_; + + ProfileOAuth2TokenService* token_service_; }; #endif // !defined (OS_CHROMEOS)
diff --git a/components/signin/core/browser/signin_header_helper.cc b/components/signin/core/browser/signin_header_helper.cc index 1c1bbc86..0a326c1 100644 --- a/components/signin/core/browser/signin_header_helper.cc +++ b/components/signin/core/browser/signin_header_helper.cc
@@ -35,15 +35,19 @@ is_same_tab(false) { } -ManageAccountsParams::ManageAccountsParams(const ManageAccountsParams& other) = +ManageAccountsParams::ManageAccountsParams(const ManageAccountsParams&) = default; +// Trivial constructors and destructors. DiceResponseParams::DiceResponseParams() : user_intention(DiceAction::NONE) {} - DiceResponseParams::~DiceResponseParams() {} - -DiceResponseParams::DiceResponseParams(const DiceResponseParams& other) = - default; +DiceResponseParams::DiceResponseParams(const DiceResponseParams&) = default; +DiceResponseParams::SigninInfo::SigninInfo() {} +DiceResponseParams::SigninInfo::~SigninInfo() {} +DiceResponseParams::SigninInfo::SigninInfo(const SigninInfo&) = default; +DiceResponseParams::SignoutInfo::SignoutInfo() {} +DiceResponseParams::SignoutInfo::~SignoutInfo() {} +DiceResponseParams::SignoutInfo::SignoutInfo(const SignoutInfo&) = default; bool SettingsAllowSigninCookies( const content_settings::CookieSettings* cookie_settings) { @@ -90,17 +94,19 @@ const std::string& header_value) { ResponseHeaderDictionary dictionary; for (const base::StringPiece& field : - base::SplitStringPiece(header_value, ",", base::KEEP_WHITESPACE, + base::SplitStringPiece(header_value, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) { size_t delim = field.find_first_of('='); if (delim == std::string::npos) { DLOG(WARNING) << "Unexpected Gaia header field '" << field << "'."; continue; } - dictionary[field.substr(0, delim).as_string()] = net::UnescapeURLComponent( - field.substr(delim + 1).as_string(), - net::UnescapeRule::PATH_SEPARATORS | - net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS); + dictionary.insert( + {field.substr(0, delim).as_string(), + net::UnescapeURLComponent( + field.substr(delim + 1).as_string(), + net::UnescapeRule::PATH_SEPARATORS | + net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS)}); } return dictionary; } @@ -155,8 +161,14 @@ } #if BUILDFLAG(ENABLE_DICE_SUPPORT) -DiceResponseParams BuildDiceResponseParams(const std::string& header_value) { - return DiceHeaderHelper::BuildDiceResponseParams(header_value); +DiceResponseParams BuildDiceSigninResponseParams( + const std::string& header_value) { + return DiceHeaderHelper::BuildDiceSigninResponseParams(header_value); +} + +DiceResponseParams BuildDiceSignoutResponseParams( + const std::string& header_value) { + return DiceHeaderHelper::BuildDiceSignoutResponseParams(header_value); } #endif
diff --git a/components/signin/core/browser/signin_header_helper.h b/components/signin/core/browser/signin_header_helper.h index 47ba5d8..06b72cb3 100644 --- a/components/signin/core/browser/signin_header_helper.h +++ b/components/signin/core/browser/signin_header_helper.h
@@ -7,6 +7,7 @@ #include <map> #include <string> +#include <vector> #include "components/signin/core/common/signin_features.h" #include "url/gurl.h" @@ -50,7 +51,6 @@ NONE, SIGNIN, // Sign in an account. SIGNOUT, // Sign out of all sessions. - SINGLE_SESSION_SIGNOUT // Sign out of a single session. }; // Struct describing the parameters received in the manage account header. @@ -73,27 +73,43 @@ // Struct describing the parameters received in the Dice response header. struct DiceResponseParams { + struct SigninInfo { + SigninInfo(); + SigninInfo(const SigninInfo&); + ~SigninInfo(); + // Gaia ID of the account signed in. + std::string gaia_id; + // Email of the account signed in. + std::string email; + // Session index for the account signed in. + int session_index; + // Authorization code to fetch a refresh token. + std::string authorization_code; + }; + + struct SignoutInfo { + SignoutInfo(); + SignoutInfo(const SignoutInfo&); + ~SignoutInfo(); + // Gaia IDs of the accounts signed out. + std::vector<std::string> gaia_id; + // Emails of the accounts signed out. + std::vector<std::string> email; + // Session indices for the accounts signed out. + std::vector<int> session_index; + }; + DiceResponseParams(); ~DiceResponseParams(); DiceResponseParams(const DiceResponseParams& other); DiceAction user_intention; - // Gaia ID of the account signed in or signed out (which may be a secondary - // account). When |user_intention| is SIGNOUT, this is the ID of the primary - // account. - std::string gaia_id; + // Populated when |user_intention| is SIGNIN. + SigninInfo signin_info; - // Email of the account signed in or signed out. When |user_intention| is - // SIGNOUT, this is the email of the primary account. - std::string email; - - // Session index for the account signed in or signed out. When - // |user_intention| is SIGNOUT, this is 0. - int session_index; - - // Optional. Must be set when |user_intention| is SIGNIN. - std::string authorization_code; + // Populated when |user_intention| is SIGNOUT. + SignoutInfo signout_info; }; // Base class for managing the signin headers (Dice and Chrome-Connected). @@ -116,7 +132,7 @@ virtual ~SigninHeaderHelper() {} // Dictionary of fields in a account consistency response header. - using ResponseHeaderDictionary = std::map<std::string, std::string>; + using ResponseHeaderDictionary = std::multimap<std::string, std::string>; // Parses the account consistency response header. Its expected format is // "key1=value1,key2=value2,...". @@ -160,7 +176,15 @@ // response header. // Returns DiceAction::NONE in case of error (such as missing or malformed // parameters). -DiceResponseParams BuildDiceResponseParams(const std::string& header_value); +DiceResponseParams BuildDiceSigninResponseParams( + const std::string& header_value); + +// Returns the parameters contained in the Google-Accounts-SignOut response +// header. +// Returns DiceAction::NONE in case of error (such as missing or malformed +// parameters). +DiceResponseParams BuildDiceSignoutResponseParams( + const std::string& header_value); #endif } // namespace signin
diff --git a/components/signin/core/browser/signin_header_helper_unittest.cc b/components/signin/core/browser/signin_header_helper_unittest.cc index bce77931..bade766e 100644 --- a/components/signin/core/browser/signin_header_helper_unittest.cc +++ b/components/signin/core/browser/signin_header_helper_unittest.cc
@@ -236,7 +236,7 @@ } TEST_F(SigninHeaderHelperTest, TestDiceInvalidResponseParams) { - DiceResponseParams params = BuildDiceResponseParams("blah"); + DiceResponseParams params = BuildDiceSigninResponseParams("blah"); EXPECT_EQ(DiceAction::NONE, params.user_intention); } @@ -248,41 +248,78 @@ { // Signin response. - DiceResponseParams params = BuildDiceResponseParams(base::StringPrintf( - "action=SIGNIN,id=%s,email=%s,authuser=%i,authorization_code=%s", - kGaiaID, kEmail, kSessionIndex, kAuthorizationCode)); + DiceResponseParams params = + BuildDiceSigninResponseParams(base::StringPrintf( + "action=SIGNIN,id=%s,email=%s,authuser=%i,authorization_code=%s", + kGaiaID, kEmail, kSessionIndex, kAuthorizationCode)); EXPECT_EQ(DiceAction::SIGNIN, params.user_intention); - EXPECT_EQ(kGaiaID, params.gaia_id); - EXPECT_EQ(kEmail, params.email); - EXPECT_EQ(kSessionIndex, params.session_index); - EXPECT_EQ(kAuthorizationCode, params.authorization_code); + EXPECT_EQ(kGaiaID, params.signin_info.gaia_id); + EXPECT_EQ(kEmail, params.signin_info.email); + EXPECT_EQ(kSessionIndex, params.signin_info.session_index); + EXPECT_EQ(kAuthorizationCode, params.signin_info.authorization_code); } { // Signout response. - DiceResponseParams params = BuildDiceResponseParams( - base::StringPrintf("action=SIGNOUT,id=%s,email=%s,authuser=%i", kGaiaID, - kEmail, kSessionIndex)); - EXPECT_EQ(DiceAction::SIGNOUT, params.user_intention); - EXPECT_EQ(kGaiaID, params.gaia_id); - EXPECT_EQ(kEmail, params.email); - EXPECT_EQ(kSessionIndex, params.session_index); - EXPECT_EQ("", params.authorization_code); + // Note: Gaia responses typically have a whitespace after the commas, and + // some fields are wrapped in quotes. + DiceResponseParams params = BuildDiceSignoutResponseParams( + base::StringPrintf("email=\"%s\", sessionindex=%i, obfuscatedid=\"%s\"", + kEmail, kSessionIndex, kGaiaID)); + ASSERT_EQ(DiceAction::SIGNOUT, params.user_intention); + EXPECT_EQ(1u, params.signout_info.gaia_id.size()); + EXPECT_EQ(1u, params.signout_info.email.size()); + EXPECT_EQ(1u, params.signout_info.session_index.size()); + EXPECT_EQ(kGaiaID, params.signout_info.gaia_id[0]); + EXPECT_EQ(kEmail, params.signout_info.email[0]); + EXPECT_EQ(kSessionIndex, params.signout_info.session_index[0]); + } + + { + // Multi-Signout response. + const char kEmail2[] = "bar@example.com"; + const char kGaiaID2[] = "gaia_id_2"; + const int kSessionIndex2 = 2; + DiceResponseParams params = + BuildDiceSignoutResponseParams(base::StringPrintf( + "email=\"%s\", sessionindex=%i, obfuscatedid=\"%s\", " + "email=\"%s\", sessionindex=%i, obfuscatedid=\"%s\"", + kEmail, kSessionIndex, kGaiaID, kEmail2, kSessionIndex2, kGaiaID2)); + ASSERT_EQ(DiceAction::SIGNOUT, params.user_intention); + EXPECT_EQ(2u, params.signout_info.gaia_id.size()); + EXPECT_EQ(2u, params.signout_info.email.size()); + EXPECT_EQ(2u, params.signout_info.session_index.size()); + EXPECT_EQ(kGaiaID, params.signout_info.gaia_id[0]); + EXPECT_EQ(kEmail, params.signout_info.email[0]); + EXPECT_EQ(kSessionIndex, params.signout_info.session_index[0]); + EXPECT_EQ(kGaiaID2, params.signout_info.gaia_id[1]); + EXPECT_EQ(kEmail2, params.signout_info.email[1]); + EXPECT_EQ(kSessionIndex2, params.signout_info.session_index[1]); } { // Missing authorization code. - DiceResponseParams params = BuildDiceResponseParams( + DiceResponseParams params = BuildDiceSigninResponseParams( base::StringPrintf("action=SIGNIN,id=%s,email=%s,authuser=%i", kGaiaID, kEmail, kSessionIndex)); EXPECT_EQ(DiceAction::NONE, params.user_intention); } { - // Missing non-optional field (email). - DiceResponseParams params = BuildDiceResponseParams(base::StringPrintf( - "action=SIGNIN,id=%s,authuser=%i,authorization_code=%s", kGaiaID, - kSessionIndex, kAuthorizationCode)); + // Missing email in SIGNIN. + DiceResponseParams params = + BuildDiceSigninResponseParams(base::StringPrintf( + "action=SIGNIN,id=%s,authuser=%i,authorization_code=%s", kGaiaID, + kSessionIndex, kAuthorizationCode)); + EXPECT_EQ(DiceAction::NONE, params.user_intention); + } + + { + // Missing email in signout. + DiceResponseParams params = BuildDiceSignoutResponseParams( + base::StringPrintf("email=%s, sessionindex=%i, obfuscatedid=%s, " + "sessionindex=2, obfuscatedid=bar", + kEmail, kSessionIndex, kGaiaID)); EXPECT_EQ(DiceAction::NONE, params.user_intention); } }
diff --git a/components/signin/core/browser/signin_manager_base.cc b/components/signin/core/browser/signin_manager_base.cc index df12573..14ad0380 100644 --- a/components/signin/core/browser/signin_manager_base.cc +++ b/components/signin/core/browser/signin_manager_base.cc
@@ -232,7 +232,9 @@ return false; } -void SigninManagerBase::Shutdown() {} +void SigninManagerBase::Shutdown() { + on_shutdown_callback_list_.Notify(); +} void SigninManagerBase::AddObserver(Observer* observer) { observer_list_.AddObserver(observer);
diff --git a/components/signin/core/browser/signin_manager_base.h b/components/signin/core/browser/signin_manager_base.h index ddf20d8..7eb2952 100644 --- a/components/signin/core/browser/signin_manager_base.h +++ b/components/signin/core/browser/signin_manager_base.h
@@ -26,6 +26,7 @@ #include <memory> #include <string> +#include "base/callback_list.h" #include "base/compiler_specific.h" #include "base/logging.h" #include "base/macros.h" @@ -132,6 +133,15 @@ // Gives access to the SigninClient instance associated with this instance. SigninClient* signin_client() const { return client_; } + // Adds a callback that will be called when this instance is shut down.Not + // intended for general usage, but rather for usage only by the Identity + // Service implementation during the time period of conversion of Chrome to + // use the Identity Service. + std::unique_ptr<base::CallbackList<void()>::Subscription> + RegisterOnShutdownCallback(const base::Closure& cb) { + return on_shutdown_callback_list_.Add(cb); + } + protected: AccountTrackerService* account_tracker_service() const { return account_tracker_service_; @@ -169,6 +179,9 @@ base::ObserverList<signin_internals_util::SigninDiagnosticsObserver, true> signin_diagnostics_observers_; + // The list of callbacks notified on shutdown. + base::CallbackList<void()> on_shutdown_callback_list_; + base::WeakPtrFactory<SigninManagerBase> weak_pointer_factory_; DISALLOW_COPY_AND_ASSIGN(SigninManagerBase);
diff --git a/components/tracing/BUILD.gn b/components/tracing/BUILD.gn index f0dc431..fa026f0 100644 --- a/components/tracing/BUILD.gn +++ b/components/tracing/BUILD.gn
@@ -35,18 +35,16 @@ deps = [ "//base", "//ipc", + "//services/resource_coordinator/public/cpp:resource_coordinator_cpp", ] - if (is_win) { - deps += [ "//base/win:pe_image" ] - } - public_deps = [ "//components/tracing/proto:protos", ] if (is_nacl) { sources -= [ "common/process_metrics_memory_dump_provider.cc" ] + deps -= [ "//services/resource_coordinator/public/cpp:resource_coordinator_cpp" ] } } @@ -96,7 +94,6 @@ sources = [ "child/child_trace_message_filter_unittest.cc", "common/graphics_memory_dump_provider_android_unittest.cc", - "common/process_metrics_memory_dump_provider_unittest.cc", "core/proto_utils_unittest.cc", "core/proto_zero_message_unittest.cc", "core/scattered_stream_writer_unittest.cc",
diff --git a/components/tracing/common/DEPS b/components/tracing/common/DEPS new file mode 100644 index 0000000..7545091 --- /dev/null +++ b/components/tracing/common/DEPS
@@ -0,0 +1,7 @@ +specific_include_rules = { + # TODO(hjd): crbug.com/728199 Remove once service knows which + # processes to collect OS dumps. + 'process_metrics_memory_dump_provider\.cc': [ + "+services/resource_coordinator/public/cpp/memory_instrumentation", + ], +}
diff --git a/components/tracing/common/process_metrics_memory_dump_provider.cc b/components/tracing/common/process_metrics_memory_dump_provider.cc index 1486eef..023fb5d 100644 --- a/components/tracing/common/process_metrics_memory_dump_provider.cc +++ b/components/tracing/common/process_metrics_memory_dump_provider.cc
@@ -4,767 +4,26 @@ #include "components/tracing/common/process_metrics_memory_dump_provider.h" -#include <fcntl.h> -#include <stdint.h> - -#include <map> - -#include "base/files/file_util.h" -#include "base/files/scoped_file.h" -#include "base/format_macros.h" -#include "base/lazy_instance.h" -#include "base/logging.h" -#include "base/memory/ptr_util.h" -#include "base/process/process_metrics.h" -#include "base/strings/string_number_conversions.h" -#include "base/strings/string_util.h" -#include "base/trace_event/memory_dump_manager.h" -#include "base/trace_event/process_memory_dump.h" -#include "base/trace_event/process_memory_maps.h" -#include "base/trace_event/process_memory_totals.h" -#include "build/build_config.h" - -#if defined(OS_MACOSX) -#include <libproc.h> -#include <mach/mach.h> -#include <mach/mach_vm.h> -#include <mach/shared_region.h> -#include <sys/param.h> - -#include <mach-o/dyld_images.h> -#include <mach-o/loader.h> -#include <mach/mach.h> - -#include "base/numerics/safe_math.h" -#include "base/process/process_metrics.h" -#endif // defined(OS_MACOSX) - -#if defined(OS_WIN) -#include <psapi.h> -#include <tchar.h> -#include <windows.h> - -#include <base/strings/sys_string_conversions.h> -#include <base/win/pe_image.h> -#include <base/win/win_util.h> -#endif // defined(OS_WIN) +#include "services/resource_coordinator/public/cpp/memory_instrumentation/process_metrics_memory_dump_provider.h" namespace tracing { -namespace { - -base::LazyInstance< - std::map<base::ProcessId, - std::unique_ptr<ProcessMetricsMemoryDumpProvider>>>::Leaky - g_dump_providers_map = LAZY_INSTANCE_INITIALIZER; - -#if defined(OS_LINUX) || defined(OS_ANDROID) -const char kClearPeakRssCommand[] = "5"; - -const uint32_t kMaxLineSize = 4096; - -bool ParseSmapsHeader(const char* header_line, - base::trace_event::ProcessMemoryMaps::VMRegion* region) { - // e.g., "00400000-00421000 r-xp 00000000 fc:01 1234 /foo.so\n" - bool res = true; // Whether this region should be appended or skipped. - uint64_t end_addr = 0; - char protection_flags[5] = {0}; - char mapped_file[kMaxLineSize]; - - if (sscanf(header_line, "%" SCNx64 "-%" SCNx64 " %4c %*s %*s %*s%4095[^\n]\n", - ®ion->start_address, &end_addr, protection_flags, - mapped_file) != 4) - return false; - - if (end_addr > region->start_address) { - region->size_in_bytes = end_addr - region->start_address; - } else { - // This is not just paranoia, it can actually happen (See crbug.com/461237). - region->size_in_bytes = 0; - res = false; - } - - region->protection_flags = 0; - if (protection_flags[0] == 'r') { - region->protection_flags |= - base::trace_event::ProcessMemoryMaps::VMRegion::kProtectionFlagsRead; - } - if (protection_flags[1] == 'w') { - region->protection_flags |= - base::trace_event::ProcessMemoryMaps::VMRegion::kProtectionFlagsWrite; - } - if (protection_flags[2] == 'x') { - region->protection_flags |= - base::trace_event::ProcessMemoryMaps::VMRegion::kProtectionFlagsExec; - } - if (protection_flags[3] == 's') { - region->protection_flags |= - base::trace_event::ProcessMemoryMaps::VMRegion::kProtectionFlagsMayshare; - } - - region->mapped_file = mapped_file; - base::TrimWhitespaceASCII(region->mapped_file, base::TRIM_ALL, - ®ion->mapped_file); - - return res; -} - -uint64_t ReadCounterBytes(char* counter_line) { - uint64_t counter_value = 0; - int res = sscanf(counter_line, "%*s %" SCNu64 " kB", &counter_value); - return res == 1 ? counter_value * 1024 : 0; -} - -uint32_t ParseSmapsCounter( - char* counter_line, - base::trace_event::ProcessMemoryMaps::VMRegion* region) { - // A smaps counter lines looks as follows: "RSS: 0 Kb\n" - uint32_t res = 1; - char counter_name[20]; - int did_read = sscanf(counter_line, "%19[^\n ]", counter_name); - if (did_read != 1) - return 0; - - if (strcmp(counter_name, "Pss:") == 0) { - region->byte_stats_proportional_resident = ReadCounterBytes(counter_line); - } else if (strcmp(counter_name, "Private_Dirty:") == 0) { - region->byte_stats_private_dirty_resident = ReadCounterBytes(counter_line); - } else if (strcmp(counter_name, "Private_Clean:") == 0) { - region->byte_stats_private_clean_resident = ReadCounterBytes(counter_line); - } else if (strcmp(counter_name, "Shared_Dirty:") == 0) { - region->byte_stats_shared_dirty_resident = ReadCounterBytes(counter_line); - } else if (strcmp(counter_name, "Shared_Clean:") == 0) { - region->byte_stats_shared_clean_resident = ReadCounterBytes(counter_line); - } else if (strcmp(counter_name, "Swap:") == 0) { - region->byte_stats_swapped = ReadCounterBytes(counter_line); - } else { - res = 0; - } - - return res; -} - -uint32_t ReadLinuxProcSmapsFile(FILE* smaps_file, - base::trace_event::ProcessMemoryMaps* pmm) { - if (!smaps_file) - return 0; - - fseek(smaps_file, 0, SEEK_SET); - - char line[kMaxLineSize]; - const uint32_t kNumExpectedCountersPerRegion = 6; - uint32_t counters_parsed_for_current_region = 0; - uint32_t num_valid_regions = 0; - base::trace_event::ProcessMemoryMaps::VMRegion region; - bool should_add_current_region = false; - for (;;) { - line[0] = '\0'; - if (fgets(line, kMaxLineSize, smaps_file) == nullptr || !strlen(line)) - break; - if (isxdigit(line[0]) && !isupper(line[0])) { - region = base::trace_event::ProcessMemoryMaps::VMRegion(); - counters_parsed_for_current_region = 0; - should_add_current_region = ParseSmapsHeader(line, ®ion); - } else { - counters_parsed_for_current_region += ParseSmapsCounter(line, ®ion); - DCHECK_LE(counters_parsed_for_current_region, - kNumExpectedCountersPerRegion); - if (counters_parsed_for_current_region == kNumExpectedCountersPerRegion) { - if (should_add_current_region) { - pmm->AddVMRegion(region); - ++num_valid_regions; - should_add_current_region = false; - } - } - } - } - return num_valid_regions; -} - -bool GetResidentAndSharedPagesFromStatmFile(int fd, - uint64_t* resident_pages, - uint64_t* shared_pages) { - lseek(fd, 0, SEEK_SET); - char line[kMaxLineSize]; - int res = read(fd, line, kMaxLineSize - 1); - if (res <= 0) - return false; - line[res] = '\0'; - int num_scanned = - sscanf(line, "%*s %" SCNu64 " %" SCNu64, resident_pages, shared_pages); - return num_scanned == 2; -} - -#endif // defined(OS_LINUX) || defined(OS_ANDROID) - -std::unique_ptr<base::ProcessMetrics> CreateProcessMetrics( - base::ProcessId process) { - if (process == base::kNullProcessId) - return base::ProcessMetrics::CreateCurrentProcessMetrics(); -#if defined(OS_LINUX) || defined(OS_ANDROID) - // Just pass ProcessId instead of handle since they are the same in linux and - // android. - return base::ProcessMetrics::CreateProcessMetrics(process); -#else - // Creating process metrics for child processes in mac or windows requires - // additional information like ProcessHandle or port provider. - NOTREACHED(); - return std::unique_ptr<base::ProcessMetrics>(); -#endif // defined(OS_LINUX) || defined(OS_ANDROID) -} - -} // namespace - -// static -uint64_t ProcessMetricsMemoryDumpProvider::rss_bytes_for_testing = 0; - -// static -ProcessMetricsMemoryDumpProvider::FactoryFunction - ProcessMetricsMemoryDumpProvider::factory_for_testing = nullptr; - -#if defined(OS_LINUX) || defined(OS_ANDROID) - -// static -FILE* ProcessMetricsMemoryDumpProvider::proc_smaps_for_testing = nullptr; - -// static -int ProcessMetricsMemoryDumpProvider::fast_polling_statm_fd_for_testing = -1; - -bool ProcessMetricsMemoryDumpProvider::DumpProcessMemoryMaps( - const base::trace_event::MemoryDumpArgs& args, - base::trace_event::ProcessMemoryDump* pmd) { - uint32_t res = 0; - if (proc_smaps_for_testing) { - res = ReadLinuxProcSmapsFile(proc_smaps_for_testing, pmd->process_mmaps()); - } else { - std::string file_name = "/proc/" + (process_ == base::kNullProcessId - ? "self" - : base::IntToString(process_)) + - "/smaps"; - base::ScopedFILE smaps_file(fopen(file_name.c_str(), "r")); - res = ReadLinuxProcSmapsFile(smaps_file.get(), pmd->process_mmaps()); - } - - if (res) - pmd->set_has_process_mmaps(); - return res; -} -#endif // defined(OS_LINUX) || defined(OS_ANDROID) - -#if defined(OS_WIN) -bool ProcessMetricsMemoryDumpProvider::DumpProcessMemoryMaps( - const base::trace_event::MemoryDumpArgs& args, - base::trace_event::ProcessMemoryDump* pmd) { - std::vector<HMODULE> modules; - if (!base::win::GetLoadedModulesSnapshot(::GetCurrentProcess(), &modules)) - return false; - - // Query the base address for each module, and attach it to the dump. - for (size_t i = 0; i < modules.size(); ++i) { - wchar_t module_name[MAX_PATH]; - if (!::GetModuleFileName(modules[i], module_name, MAX_PATH)) - continue; - - MODULEINFO module_info; - if (!::GetModuleInformation(::GetCurrentProcess(), modules[i], - &module_info, sizeof(MODULEINFO))) { - continue; - } - base::trace_event::ProcessMemoryMaps::VMRegion region; - region.size_in_bytes = module_info.SizeOfImage; - region.mapped_file = base::SysWideToNativeMB(module_name); - region.start_address = reinterpret_cast<uint64_t>(module_info.lpBaseOfDll); - - // The PE header field |TimeDateStamp| is required to build the PE code - // identifier which is used as a key to query symbols servers. - base::win::PEImage pe_image(module_info.lpBaseOfDll); - region.module_timestamp = pe_image.GetNTHeaders()->FileHeader.TimeDateStamp; - - pmd->process_mmaps()->AddVMRegion(region); - } - if (!pmd->process_mmaps()->vm_regions().empty()) - pmd->set_has_process_mmaps(); - return true; -} -#endif // defined(OS_WIN) - -#if defined(OS_MACOSX) - -namespace { - -using VMRegion = base::trace_event::ProcessMemoryMaps::VMRegion; - -bool IsAddressInSharedRegion(uint64_t address) { - return address >= SHARED_REGION_BASE_X86_64 && - address < (SHARED_REGION_BASE_X86_64 + SHARED_REGION_SIZE_X86_64); -} - -bool IsRegionContainedInRegion(const VMRegion& containee, - const VMRegion& container) { - uint64_t containee_end_address = - containee.start_address + containee.size_in_bytes; - uint64_t container_end_address = - container.start_address + container.size_in_bytes; - return containee.start_address >= container.start_address && - containee_end_address <= container_end_address; -} - -bool DoRegionsIntersect(const VMRegion& a, const VMRegion& b) { - uint64_t a_end_address = a.start_address + a.size_in_bytes; - uint64_t b_end_address = b.start_address + b.size_in_bytes; - return a.start_address < b_end_address && b.start_address < a_end_address; -} - -// Creates VMRegions for all dyld images. Returns whether the operation -// succeeded. -bool GetDyldRegions(std::vector<VMRegion>* regions) { - task_dyld_info_data_t dyld_info; - mach_msg_type_number_t count = TASK_DYLD_INFO_COUNT; - kern_return_t kr = - task_info(mach_task_self(), TASK_DYLD_INFO, - reinterpret_cast<task_info_t>(&dyld_info), &count); - if (kr != KERN_SUCCESS) - return false; - - const struct dyld_all_image_infos* all_image_infos = - reinterpret_cast<const struct dyld_all_image_infos*>( - dyld_info.all_image_info_addr); - - bool emitted_linkedit_from_dyld_shared_cache = false; - for (size_t i = 0; i < all_image_infos->infoArrayCount; i++) { - const char* image_name = all_image_infos->infoArray[i].imageFilePath; - - // The public definition for dyld_all_image_infos/dyld_image_info is wrong - // for 64-bit platforms. We explicitly cast to struct mach_header_64 even - // though the public definition claims that this is a struct mach_header. - const struct mach_header_64* const header = - reinterpret_cast<const struct mach_header_64* const>( - all_image_infos->infoArray[i].imageLoadAddress); - - uint64_t next_command = reinterpret_cast<uint64_t>(header + 1); - uint64_t command_end = next_command + header->sizeofcmds; - uint64_t slide = 0; - for (unsigned int j = 0; j < header->ncmds; ++j) { - // Ensure that next_command doesn't run past header->sizeofcmds. - if (next_command + sizeof(struct load_command) > command_end) - return false; - const struct load_command* load_cmd = - reinterpret_cast<const struct load_command*>(next_command); - next_command += load_cmd->cmdsize; - - if (load_cmd->cmd == LC_SEGMENT_64) { - if (load_cmd->cmdsize < sizeof(segment_command_64)) - return false; - const segment_command_64* seg = - reinterpret_cast<const segment_command_64*>(load_cmd); - if (strcmp(seg->segname, SEG_PAGEZERO) == 0) - continue; - if (strcmp(seg->segname, SEG_TEXT) == 0) { - slide = reinterpret_cast<uint64_t>(header) - seg->vmaddr; - } - - // Avoid emitting LINKEDIT regions in the dyld shared cache, since they - // all overlap. - if (IsAddressInSharedRegion(seg->vmaddr) && - strcmp(seg->segname, SEG_LINKEDIT) == 0) { - if (emitted_linkedit_from_dyld_shared_cache) { - continue; - } else { - emitted_linkedit_from_dyld_shared_cache = true; - image_name = "dyld shared cache combined __LINKEDIT"; - } - } - - uint32_t protection_flags = 0; - if (seg->initprot & VM_PROT_READ) - protection_flags |= VMRegion::kProtectionFlagsRead; - if (seg->initprot & VM_PROT_WRITE) - protection_flags |= VMRegion::kProtectionFlagsWrite; - if (seg->initprot & VM_PROT_EXECUTE) - protection_flags |= VMRegion::kProtectionFlagsExec; - - VMRegion region; - region.size_in_bytes = seg->vmsize; - region.protection_flags = protection_flags; - region.mapped_file = image_name; - region.start_address = slide + seg->vmaddr; - - // We intentionally avoid setting any page information, which is not - // available from dyld. The fields will be populated later. - regions->push_back(region); - } - } - } - return true; -} - -void PopulateByteStats(VMRegion* region, - const vm_region_top_info_data_t& info) { - uint64_t dirty_bytes = - (info.private_pages_resident + info.shared_pages_resident) * PAGE_SIZE; - switch (info.share_mode) { - case SM_LARGE_PAGE: - case SM_PRIVATE: - case SM_COW: - region->byte_stats_private_dirty_resident = dirty_bytes; - case SM_SHARED: - case SM_PRIVATE_ALIASED: - case SM_TRUESHARED: - case SM_SHARED_ALIASED: - region->byte_stats_shared_dirty_resident = dirty_bytes; - break; - case SM_EMPTY: - break; - default: - NOTREACHED(); - break; - } -} - -// Creates VMRegions using mach vm syscalls. Returns whether the operation -// succeeded. -bool GetAllRegions(std::vector<VMRegion>* regions) { - const int pid = getpid(); - task_t task = mach_task_self(); - mach_vm_size_t size = 0; - mach_vm_address_t address = MACH_VM_MIN_ADDRESS; - while (true) { - base::CheckedNumeric<mach_vm_address_t> next_address(address); - next_address += size; - if (!next_address.IsValid()) - return false; - address = next_address.ValueOrDie(); - mach_vm_address_t address_copy = address; - - vm_region_top_info_data_t info; - base::MachVMRegionResult result = - base::GetTopInfo(task, &size, &address, &info); - if (result == base::MachVMRegionResult::Error) - return false; - if (result == base::MachVMRegionResult::Finished) - break; - - vm_region_basic_info_64 basic_info; - mach_vm_size_t dummy_size = 0; - result = base::GetBasicInfo(task, &dummy_size, &address_copy, &basic_info); - if (result == base::MachVMRegionResult::Error) - return false; - if (result == base::MachVMRegionResult::Finished) - break; - - VMRegion region; - PopulateByteStats(®ion, info); - - if (basic_info.protection & VM_PROT_READ) - region.protection_flags |= VMRegion::kProtectionFlagsRead; - if (basic_info.protection & VM_PROT_WRITE) - region.protection_flags |= VMRegion::kProtectionFlagsWrite; - if (basic_info.protection & VM_PROT_EXECUTE) - region.protection_flags |= VMRegion::kProtectionFlagsExec; - - char buffer[MAXPATHLEN]; - int length = proc_regionfilename(pid, address, buffer, MAXPATHLEN); - if (length != 0) - region.mapped_file.assign(buffer, length); - - // There's no way to get swapped or clean bytes without doing a - // very expensive syscalls that crawls every single page in the memory - // object. - region.start_address = address; - region.size_in_bytes = size; - regions->push_back(region); - } - return true; -} - -void AddRegionByteStats(VMRegion* dest, const VMRegion& source) { - dest->byte_stats_private_dirty_resident += - source.byte_stats_private_dirty_resident; - dest->byte_stats_private_clean_resident += - source.byte_stats_private_clean_resident; - dest->byte_stats_shared_dirty_resident += - source.byte_stats_shared_dirty_resident; - dest->byte_stats_shared_clean_resident += - source.byte_stats_shared_clean_resident; - dest->byte_stats_swapped += source.byte_stats_swapped; - dest->byte_stats_proportional_resident += - source.byte_stats_proportional_resident; -} - -} // namespace - -bool ProcessMetricsMemoryDumpProvider::DumpProcessMemoryMaps( - const base::trace_event::MemoryDumpArgs& args, - base::trace_event::ProcessMemoryDump* pmd) { - using VMRegion = base::trace_event::ProcessMemoryMaps::VMRegion; - - std::vector<VMRegion> dyld_regions; - if (!GetDyldRegions(&dyld_regions)) - return false; - std::vector<VMRegion> all_regions; - if (!GetAllRegions(&all_regions)) - return false; - - // Merge information from dyld regions and all regions. - for (const VMRegion& region : all_regions) { - bool skip = false; - const bool in_shared_region = IsAddressInSharedRegion(region.start_address); - for (VMRegion& dyld_region : dyld_regions) { - // If this region is fully contained in a dyld region, then add the bytes - // stats. - if (IsRegionContainedInRegion(region, dyld_region)) { - AddRegionByteStats(&dyld_region, region); - skip = true; - break; - } - - // Check to see if the region is likely used for the dyld shared cache. - if (in_shared_region) { - // This region is likely used for the dyld shared cache. Don't record - // any byte stats since: - // 1. It's not possible to figure out which dyld regions the byte - // stats correspond to. - // 2. The region is likely shared by non-Chrome processes, so there's - // no point in charging the pages towards Chrome. - if (DoRegionsIntersect(region, dyld_region)) { - skip = true; - break; - } - } - } - if (skip) - continue; - pmd->process_mmaps()->AddVMRegion(region); - } - - for (VMRegion& region : dyld_regions) { - pmd->process_mmaps()->AddVMRegion(region); - } - - pmd->set_has_process_mmaps(); - return true; -} -#endif // defined(OS_MACOSX) - +// TODO(hjd): crbug.com/728199 Remove once service knows which +// processes to collect OS dumps from. // static void ProcessMetricsMemoryDumpProvider::RegisterForProcess( base::ProcessId process) { - std::unique_ptr<ProcessMetricsMemoryDumpProvider> owned_provider; - if (factory_for_testing) { - owned_provider = factory_for_testing(process); - } else { - owned_provider = std::unique_ptr<ProcessMetricsMemoryDumpProvider>( - new ProcessMetricsMemoryDumpProvider(process)); - } - - ProcessMetricsMemoryDumpProvider* provider = owned_provider.get(); - bool did_insert = - g_dump_providers_map.Get() - .insert(std::make_pair(process, std::move(owned_provider))) - .second; - if (!did_insert) { - DLOG(ERROR) << "ProcessMetricsMemoryDumpProvider already registered for " - << (process == base::kNullProcessId - ? "current process" - : "process id " + base::IntToString(process)); - return; - } - base::trace_event::MemoryDumpProvider::Options options; - options.target_pid = process; - options.is_fast_polling_supported = true; - base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( - provider, "ProcessMemoryMetrics", nullptr, options); + memory_instrumentation::ProcessMetricsMemoryDumpProvider::RegisterForProcess( + process); } +// TODO(hjd): crbug.com/728199 Remove once service knows which +// processes to collect OS dumps from. // static void ProcessMetricsMemoryDumpProvider::UnregisterForProcess( base::ProcessId process) { - auto iter = g_dump_providers_map.Get().find(process); - if (iter == g_dump_providers_map.Get().end()) - return; - base::trace_event::MemoryDumpManager::GetInstance() - ->UnregisterAndDeleteDumpProviderSoon(std::move(iter->second)); - g_dump_providers_map.Get().erase(iter); -} - -ProcessMetricsMemoryDumpProvider::ProcessMetricsMemoryDumpProvider( - base::ProcessId process) - : process_(process), - process_metrics_(CreateProcessMetrics(process)), - is_rss_peak_resettable_(true) {} - -ProcessMetricsMemoryDumpProvider::~ProcessMetricsMemoryDumpProvider() {} - -// Called at trace dump point time. Creates a snapshot of the memory maps for -// the current process. -bool ProcessMetricsMemoryDumpProvider::OnMemoryDump( - const base::trace_event::MemoryDumpArgs& args, - base::trace_event::ProcessMemoryDump* pmd) { - bool res = DumpProcessTotals(args, pmd); - - if (args.level_of_detail == - base::trace_event::MemoryDumpLevelOfDetail::DETAILED) - res &= DumpProcessMemoryMaps(args, pmd); - return res; -} - -bool ProcessMetricsMemoryDumpProvider::DumpProcessTotals( - const base::trace_event::MemoryDumpArgs& args, - base::trace_event::ProcessMemoryDump* pmd) { -#if defined(OS_MACOSX) - size_t private_bytes; - size_t shared_bytes; - size_t resident_bytes; - size_t locked_bytes; - if (!process_metrics_->GetMemoryBytes(&private_bytes, &shared_bytes, - &resident_bytes, &locked_bytes)) { - return false; - } - uint64_t rss_bytes = resident_bytes; - pmd->process_totals()->SetExtraFieldInBytes("private_bytes", private_bytes); - pmd->process_totals()->SetExtraFieldInBytes("shared_bytes", shared_bytes); - pmd->process_totals()->SetExtraFieldInBytes("locked_bytes", locked_bytes); - - base::trace_event::ProcessMemoryTotals::PlatformPrivateFootprint footprint; - base::ProcessMetrics::TaskVMInfo info = process_metrics_->GetTaskVMInfo(); - footprint.phys_footprint_bytes = info.phys_footprint; - footprint.internal_bytes = info.internal; - footprint.compressed_bytes = info.compressed; - - pmd->process_totals()->SetPlatformPrivateFootprint(footprint); -#else - uint64_t rss_bytes = process_metrics_->GetWorkingSetSize(); -#endif // defined(OS_MACOSX) - if (rss_bytes_for_testing) - rss_bytes = rss_bytes_for_testing; - - // rss_bytes will be 0 if the process ended while dumping. - if (!rss_bytes) - return false; - - uint64_t peak_rss_bytes = 0; - -#if defined(OS_LINUX) || defined(OS_ANDROID) - base::trace_event::ProcessMemoryTotals::PlatformPrivateFootprint footprint; - - base::ScopedFD autoclose; - int statm_fd = fast_polling_statm_fd_.get(); - if (statm_fd == -1) { - autoclose = OpenStatm(); - statm_fd = autoclose.get(); - } - if (statm_fd == -1) - return false; - const static size_t page_size = base::GetPageSize(); - uint64_t resident_pages; - uint64_t shared_pages; - bool success = GetResidentAndSharedPagesFromStatmFile( - statm_fd, &resident_pages, &shared_pages); - if (!success) - return false; - - footprint.rss_anon_bytes = (resident_pages - shared_pages) * page_size; - footprint.vm_swap_bytes = process_metrics_->GetVmSwapBytes(); - pmd->process_totals()->SetPlatformPrivateFootprint(footprint); -#endif // defined(OS_LINUX) || defined(OS_ANDROID) - -#if defined(OS_WIN) - { - size_t private_bytes; - base::trace_event::ProcessMemoryTotals::PlatformPrivateFootprint footprint; - process_metrics_->GetMemoryBytes(&private_bytes, nullptr); - footprint.private_bytes = private_bytes; - pmd->process_totals()->SetPlatformPrivateFootprint(footprint); - } -#endif - -#if !defined(OS_IOS) - peak_rss_bytes = process_metrics_->GetPeakWorkingSetSize(); -#if defined(OS_LINUX) || defined(OS_ANDROID) - if (is_rss_peak_resettable_) { - std::string clear_refs_file = - "/proc/" + - (process_ == base::kNullProcessId ? "self" - : base::IntToString(process_)) + - "/clear_refs"; - int clear_refs_fd = open(clear_refs_file.c_str(), O_WRONLY); - if (clear_refs_fd > 0 && - base::WriteFileDescriptor(clear_refs_fd, kClearPeakRssCommand, - sizeof(kClearPeakRssCommand))) { - pmd->process_totals()->set_is_peak_rss_resetable(true); - } else { - is_rss_peak_resettable_ = false; - } - close(clear_refs_fd); - } -#elif defined(OS_WIN) - if (args.level_of_detail == - base::trace_event::MemoryDumpLevelOfDetail::DETAILED) { - uint64_t pss_bytes = 0; - bool res = process_metrics_->GetProportionalSetSizeBytes(&pss_bytes); - if (res) { - base::trace_event::ProcessMemoryMaps::VMRegion region; - region.byte_stats_proportional_resident = pss_bytes; - pmd->process_mmaps()->AddVMRegion(region); - pmd->set_has_process_mmaps(); - } - } - -#endif -#endif // !defined(OS_IOS) - - pmd->process_totals()->set_resident_set_bytes(rss_bytes); - pmd->set_has_process_totals(); - pmd->process_totals()->set_peak_resident_set_bytes(peak_rss_bytes); - - // Returns true even if other metrics failed, since rss is reported. - return true; -} - -#if defined(OS_LINUX) || defined(OS_ANDROID) -base::ScopedFD ProcessMetricsMemoryDumpProvider::OpenStatm() { - std::string name = - "/proc/" + - (process_ == base::kNullProcessId ? "self" - : base::IntToString(process_)) + - "/statm"; - base::ScopedFD fd = base::ScopedFD(open(name.c_str(), O_RDONLY)); - DCHECK(fd.is_valid()); - return fd; -} -#endif // defined(OS_LINUX) || defined(OS_ANDROID) - -void ProcessMetricsMemoryDumpProvider::PollFastMemoryTotal( - uint64_t* memory_total) { - *memory_total = 0; -#if defined(OS_LINUX) || defined(OS_ANDROID) - - int statm_fd = fast_polling_statm_fd_for_testing; - if (statm_fd == -1) { - if (!fast_polling_statm_fd_.is_valid()) - fast_polling_statm_fd_ = OpenStatm(); - statm_fd = fast_polling_statm_fd_.get(); - if (statm_fd == -1) - return; - } - - uint64_t resident_pages = 0; - uint64_t ignored_shared_pages = 0; - if (!GetResidentAndSharedPagesFromStatmFile(statm_fd, &resident_pages, - &ignored_shared_pages)) - return; - - static size_t page_size = base::GetPageSize(); - *memory_total = resident_pages * page_size; -#else - *memory_total = process_metrics_->GetWorkingSetSize(); -#endif -} - -void ProcessMetricsMemoryDumpProvider::SuspendFastMemoryPolling() { -#if defined(OS_LINUX) || defined(OS_ANDROID) - fast_polling_statm_fd_.reset(); -#endif + memory_instrumentation::ProcessMetricsMemoryDumpProvider:: + UnregisterForProcess(process); } } // namespace tracing
diff --git a/components/tracing/common/process_metrics_memory_dump_provider.h b/components/tracing/common/process_metrics_memory_dump_provider.h index d3c5334..eb89e62 100644 --- a/components/tracing/common/process_metrics_memory_dump_provider.h +++ b/components/tracing/common/process_metrics_memory_dump_provider.h
@@ -5,20 +5,12 @@ #ifndef COMPONENTS_TRACING_COMMON_PROCESS_MEMORY_METRICS_DUMP_PROVIDER_H_ #define COMPONENTS_TRACING_COMMON_PROCESS_MEMORY_METRICS_DUMP_PROVIDER_H_ -#include <memory> - -#include "base/files/scoped_file.h" -#include "base/gtest_prod_util.h" -#include "base/macros.h" #include "base/process/process_handle.h" #include "base/trace_event/memory_dump_provider.h" -#include "build/build_config.h" #include "components/tracing/tracing_export.h" -namespace base { -class ProcessMetrics; -} - +// TODO(hjd): The actual impl lives in service/resource_coordinator. Update the +// callsites and remove this file. namespace tracing { // Dump provider which collects process-wide memory stats. @@ -29,64 +21,10 @@ static void RegisterForProcess(base::ProcessId process); static void UnregisterForProcess(base::ProcessId process); - ~ProcessMetricsMemoryDumpProvider() override; - - // MemoryDumpProvider implementation. - bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, - base::trace_event::ProcessMemoryDump* pmd) override; - void PollFastMemoryTotal(uint64_t* memory_total) override; - void SuspendFastMemoryPolling() override; - - protected: - ProcessMetricsMemoryDumpProvider(base::ProcessId process); private: - using FactoryFunction = - std::unique_ptr<ProcessMetricsMemoryDumpProvider> (*)(base::ProcessId); - - FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, - ParseProcSmaps); - FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, DumpRSS); - FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, - TestPollFastMemoryTotal); -#if defined(OS_MACOSX) - FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, - TestMachOReading); - FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, - NoDuplicateRegions); -#elif defined(OS_WIN) - FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, - TestWinModuleReading); -#elif defined(OS_LINUX) || defined(OS_ANDROID) - FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, - DoubleRegister); -#endif - - bool DumpProcessTotals(const base::trace_event::MemoryDumpArgs& args, - base::trace_event::ProcessMemoryDump* pmd); - bool DumpProcessMemoryMaps(const base::trace_event::MemoryDumpArgs& args, - base::trace_event::ProcessMemoryDump* pmd); - - static uint64_t rss_bytes_for_testing; - static FactoryFunction factory_for_testing; - -#if defined(OS_LINUX) || defined(OS_ANDROID) - static FILE* proc_smaps_for_testing; - static int fast_polling_statm_fd_for_testing; - - base::ScopedFD fast_polling_statm_fd_; - - base::ScopedFD OpenStatm(); -#endif - - base::ProcessId process_; - std::unique_ptr<base::ProcessMetrics> process_metrics_; - - // The peak may not be resettable on all the processes if the linux kernel is - // older than http://bit.ly/reset_rss or only on child processes if yama LSM - // sandbox is enabled. - bool is_rss_peak_resettable_; - + ProcessMetricsMemoryDumpProvider(); + ~ProcessMetricsMemoryDumpProvider() override; DISALLOW_COPY_AND_ASSIGN(ProcessMetricsMemoryDumpProvider); };
diff --git a/components/tracing/common/process_metrics_memory_dump_provider_unittest.cc b/components/tracing/common/process_metrics_memory_dump_provider_unittest.cc deleted file mode 100644 index b28d3f2..0000000 --- a/components/tracing/common/process_metrics_memory_dump_provider_unittest.cc +++ /dev/null
@@ -1,414 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/tracing/common/process_metrics_memory_dump_provider.h" - -#include <stdint.h> - -#include <memory> -#include <unordered_set> - -#include "base/files/file_util.h" -#include "base/memory/ptr_util.h" -#include "base/process/process_metrics.h" -#include "base/trace_event/memory_dump_manager.h" -#include "base/trace_event/process_memory_dump.h" -#include "base/trace_event/process_memory_maps.h" -#include "base/trace_event/process_memory_totals.h" -#include "base/trace_event/trace_event_argument.h" -#include "testing/gtest/include/gtest/gtest.h" - -#if defined(OS_MACOSX) -#include <libgen.h> -#include <mach-o/dyld.h> -#endif - -#if defined(OS_WIN) -#include <base/strings/sys_string_conversions.h> -#endif - -namespace tracing { - -#if defined(OS_LINUX) || defined(OS_ANDROID) -namespace { -const char kTestSmaps1[] = - "00400000-004be000 r-xp 00000000 fc:01 1234 /file/1\n" - "Size: 760 kB\n" - "Rss: 296 kB\n" - "Pss: 162 kB\n" - "Shared_Clean: 228 kB\n" - "Shared_Dirty: 0 kB\n" - "Private_Clean: 0 kB\n" - "Private_Dirty: 68 kB\n" - "Referenced: 296 kB\n" - "Anonymous: 68 kB\n" - "AnonHugePages: 0 kB\n" - "Swap: 4 kB\n" - "KernelPageSize: 4 kB\n" - "MMUPageSize: 4 kB\n" - "Locked: 0 kB\n" - "VmFlags: rd ex mr mw me dw sd\n" - "ff000000-ff800000 -w-p 00001080 fc:01 0 /file/name with space\n" - "Size: 0 kB\n" - "Rss: 192 kB\n" - "Pss: 128 kB\n" - "Shared_Clean: 120 kB\n" - "Shared_Dirty: 4 kB\n" - "Private_Clean: 60 kB\n" - "Private_Dirty: 8 kB\n" - "Referenced: 296 kB\n" - "Anonymous: 0 kB\n" - "AnonHugePages: 0 kB\n" - "Swap: 0 kB\n" - "KernelPageSize: 4 kB\n" - "MMUPageSize: 4 kB\n" - "Locked: 0 kB\n" - "VmFlags: rd ex mr mw me dw sd"; - -const char kTestSmaps2[] = - // An invalid region, with zero size and overlapping with the last one - // (See crbug.com/461237). - "7fe7ce79c000-7fe7ce79c000 ---p 00000000 00:00 0 \n" - "Size: 4 kB\n" - "Rss: 0 kB\n" - "Pss: 0 kB\n" - "Shared_Clean: 0 kB\n" - "Shared_Dirty: 0 kB\n" - "Private_Clean: 0 kB\n" - "Private_Dirty: 0 kB\n" - "Referenced: 0 kB\n" - "Anonymous: 0 kB\n" - "AnonHugePages: 0 kB\n" - "Swap: 0 kB\n" - "KernelPageSize: 4 kB\n" - "MMUPageSize: 4 kB\n" - "Locked: 0 kB\n" - "VmFlags: rd ex mr mw me dw sd\n" - // A invalid region with its range going backwards. - "00400000-00200000 ---p 00000000 00:00 0 \n" - "Size: 4 kB\n" - "Rss: 0 kB\n" - "Pss: 0 kB\n" - "Shared_Clean: 0 kB\n" - "Shared_Dirty: 0 kB\n" - "Private_Clean: 0 kB\n" - "Private_Dirty: 0 kB\n" - "Referenced: 0 kB\n" - "Anonymous: 0 kB\n" - "AnonHugePages: 0 kB\n" - "Swap: 0 kB\n" - "KernelPageSize: 4 kB\n" - "MMUPageSize: 4 kB\n" - "Locked: 0 kB\n" - "VmFlags: rd ex mr mw me dw sd\n" - // A good anonymous region at the end. - "7fe7ce79c000-7fe7ce7a8000 ---p 00000000 00:00 0 \n" - "Size: 48 kB\n" - "Rss: 40 kB\n" - "Pss: 32 kB\n" - "Shared_Clean: 16 kB\n" - "Shared_Dirty: 12 kB\n" - "Private_Clean: 8 kB\n" - "Private_Dirty: 4 kB\n" - "Referenced: 40 kB\n" - "Anonymous: 16 kB\n" - "AnonHugePages: 0 kB\n" - "Swap: 0 kB\n" - "KernelPageSize: 4 kB\n" - "MMUPageSize: 4 kB\n" - "Locked: 0 kB\n" - "VmFlags: rd wr mr mw me ac sd\n"; - -const char kTestStatm[] = "200 100 20 2 3 4"; - -void CreateTempFileWithContents(const char* contents, base::ScopedFILE* file) { - base::FilePath temp_path; - FILE* temp_file = CreateAndOpenTemporaryFile(&temp_path); - file->reset(temp_file); - ASSERT_TRUE(temp_file); - - ASSERT_TRUE( - base::WriteFileDescriptor(fileno(temp_file), contents, strlen(contents))); -} - -} // namespace -#endif // defined(OS_LINUX) || defined(OS_ANDROID) - -class MockMemoryDumpProvider : public ProcessMetricsMemoryDumpProvider { - public: - MockMemoryDumpProvider(base::ProcessId process); - ~MockMemoryDumpProvider() override; -}; - -std::unordered_set<MockMemoryDumpProvider*> g_live_mocks; -std::unordered_set<MockMemoryDumpProvider*> g_dead_mocks; - -MockMemoryDumpProvider::MockMemoryDumpProvider(base::ProcessId process) - : ProcessMetricsMemoryDumpProvider(process) { - g_live_mocks.insert(this); -} - -MockMemoryDumpProvider::~MockMemoryDumpProvider() { - g_live_mocks.erase(this); - g_dead_mocks.insert(this); -} - -TEST(ProcessMetricsMemoryDumpProviderTest, DumpRSS) { - const base::trace_event::MemoryDumpArgs high_detail_args = { - base::trace_event::MemoryDumpLevelOfDetail::DETAILED}; - std::unique_ptr<ProcessMetricsMemoryDumpProvider> pmtdp( - new ProcessMetricsMemoryDumpProvider(base::kNullProcessId)); - std::unique_ptr<base::trace_event::ProcessMemoryDump> pmd_before( - new base::trace_event::ProcessMemoryDump(nullptr, high_detail_args)); - std::unique_ptr<base::trace_event::ProcessMemoryDump> pmd_after( - new base::trace_event::ProcessMemoryDump(nullptr, high_detail_args)); - - ProcessMetricsMemoryDumpProvider::rss_bytes_for_testing = 1024; - pmtdp->OnMemoryDump(high_detail_args, pmd_before.get()); - - // Pretend that the RSS of the process increased of +1M. - const size_t kAllocSize = 1048576; - ProcessMetricsMemoryDumpProvider::rss_bytes_for_testing += kAllocSize; - - pmtdp->OnMemoryDump(high_detail_args, pmd_after.get()); - - ProcessMetricsMemoryDumpProvider::rss_bytes_for_testing = 0; - - ASSERT_TRUE(pmd_before->has_process_totals()); - ASSERT_TRUE(pmd_after->has_process_totals()); - - const uint64_t rss_before = - pmd_before->process_totals()->resident_set_bytes(); - const uint64_t rss_after = pmd_after->process_totals()->resident_set_bytes(); - - EXPECT_NE(0U, rss_before); - EXPECT_NE(0U, rss_after); - - EXPECT_EQ(rss_after - rss_before, kAllocSize); -} - -#if defined(OS_LINUX) || defined(OS_ANDROID) -TEST(ProcessMetricsMemoryDumpProviderTest, ParseProcSmaps) { - const uint32_t kProtR = - base::trace_event::ProcessMemoryMaps::VMRegion::kProtectionFlagsRead; - const uint32_t kProtW = - base::trace_event::ProcessMemoryMaps::VMRegion::kProtectionFlagsWrite; - const uint32_t kProtX = - base::trace_event::ProcessMemoryMaps::VMRegion::kProtectionFlagsExec; - const base::trace_event::MemoryDumpArgs dump_args = { - base::trace_event::MemoryDumpLevelOfDetail::DETAILED}; - - std::unique_ptr<ProcessMetricsMemoryDumpProvider> pmmdp( - new ProcessMetricsMemoryDumpProvider(base::kNullProcessId)); - - // Emulate an empty /proc/self/smaps. - base::trace_event::ProcessMemoryDump pmd_invalid(nullptr /* session_state */, - dump_args); - base::ScopedFILE empty_file(OpenFile(base::FilePath("/dev/null"), "r")); - ASSERT_TRUE(empty_file.get()); - ProcessMetricsMemoryDumpProvider::proc_smaps_for_testing = empty_file.get(); - pmmdp->OnMemoryDump(dump_args, &pmd_invalid); - ASSERT_FALSE(pmd_invalid.has_process_mmaps()); - - // Parse the 1st smaps file. - base::trace_event::ProcessMemoryDump pmd_1(nullptr /* session_state */, - dump_args); - base::ScopedFILE temp_file1; - CreateTempFileWithContents(kTestSmaps1, &temp_file1); - ProcessMetricsMemoryDumpProvider::proc_smaps_for_testing = temp_file1.get(); - pmmdp->OnMemoryDump(dump_args, &pmd_1); - ASSERT_TRUE(pmd_1.has_process_mmaps()); - const auto& regions_1 = pmd_1.process_mmaps()->vm_regions(); - ASSERT_EQ(2UL, regions_1.size()); - - EXPECT_EQ(0x00400000UL, regions_1[0].start_address); - EXPECT_EQ(0x004be000UL - 0x00400000UL, regions_1[0].size_in_bytes); - EXPECT_EQ(kProtR | kProtX, regions_1[0].protection_flags); - EXPECT_EQ("/file/1", regions_1[0].mapped_file); - EXPECT_EQ(162 * 1024UL, regions_1[0].byte_stats_proportional_resident); - EXPECT_EQ(228 * 1024UL, regions_1[0].byte_stats_shared_clean_resident); - EXPECT_EQ(0UL, regions_1[0].byte_stats_shared_dirty_resident); - EXPECT_EQ(0UL, regions_1[0].byte_stats_private_clean_resident); - EXPECT_EQ(68 * 1024UL, regions_1[0].byte_stats_private_dirty_resident); - EXPECT_EQ(4 * 1024UL, regions_1[0].byte_stats_swapped); - - EXPECT_EQ(0xff000000UL, regions_1[1].start_address); - EXPECT_EQ(0xff800000UL - 0xff000000UL, regions_1[1].size_in_bytes); - EXPECT_EQ(kProtW, regions_1[1].protection_flags); - EXPECT_EQ("/file/name with space", regions_1[1].mapped_file); - EXPECT_EQ(128 * 1024UL, regions_1[1].byte_stats_proportional_resident); - EXPECT_EQ(120 * 1024UL, regions_1[1].byte_stats_shared_clean_resident); - EXPECT_EQ(4 * 1024UL, regions_1[1].byte_stats_shared_dirty_resident); - EXPECT_EQ(60 * 1024UL, regions_1[1].byte_stats_private_clean_resident); - EXPECT_EQ(8 * 1024UL, regions_1[1].byte_stats_private_dirty_resident); - EXPECT_EQ(0 * 1024UL, regions_1[1].byte_stats_swapped); - - // Parse the 2nd smaps file. - base::trace_event::ProcessMemoryDump pmd_2(nullptr /* session_state */, - dump_args); - base::ScopedFILE temp_file2; - CreateTempFileWithContents(kTestSmaps2, &temp_file2); - ProcessMetricsMemoryDumpProvider::proc_smaps_for_testing = temp_file2.get(); - pmmdp->OnMemoryDump(dump_args, &pmd_2); - ASSERT_TRUE(pmd_2.has_process_mmaps()); - const auto& regions_2 = pmd_2.process_mmaps()->vm_regions(); - ASSERT_EQ(1UL, regions_2.size()); - EXPECT_EQ(0x7fe7ce79c000UL, regions_2[0].start_address); - EXPECT_EQ(0x7fe7ce7a8000UL - 0x7fe7ce79c000UL, regions_2[0].size_in_bytes); - EXPECT_EQ(0U, regions_2[0].protection_flags); - EXPECT_EQ("", regions_2[0].mapped_file); - EXPECT_EQ(32 * 1024UL, regions_2[0].byte_stats_proportional_resident); - EXPECT_EQ(16 * 1024UL, regions_2[0].byte_stats_shared_clean_resident); - EXPECT_EQ(12 * 1024UL, regions_2[0].byte_stats_shared_dirty_resident); - EXPECT_EQ(8 * 1024UL, regions_2[0].byte_stats_private_clean_resident); - EXPECT_EQ(4 * 1024UL, regions_2[0].byte_stats_private_dirty_resident); - EXPECT_EQ(0 * 1024UL, regions_2[0].byte_stats_swapped); -} - -TEST(ProcessMetricsMemoryDumpProviderTest, DoubleRegister) { - auto factory = [](base::ProcessId process) { - return std::unique_ptr<ProcessMetricsMemoryDumpProvider>( - new MockMemoryDumpProvider(process)); - }; - ProcessMetricsMemoryDumpProvider::factory_for_testing = factory; - ProcessMetricsMemoryDumpProvider::RegisterForProcess(1); - ProcessMetricsMemoryDumpProvider::RegisterForProcess(1); - ASSERT_EQ(1u, g_live_mocks.size()); - ASSERT_EQ(1u, g_dead_mocks.size()); - auto* manager = base::trace_event::MemoryDumpManager::GetInstance(); - MockMemoryDumpProvider* live_mock = *g_live_mocks.begin(); - EXPECT_TRUE(manager->IsDumpProviderRegisteredForTesting(live_mock)); - auto* dead_mock = *g_dead_mocks.begin(); - EXPECT_FALSE(manager->IsDumpProviderRegisteredForTesting(dead_mock)); - ProcessMetricsMemoryDumpProvider::UnregisterForProcess(1); - g_live_mocks.clear(); - g_dead_mocks.clear(); -} - -#endif // defined(OS_LINUX) || defined(OS_ANDROID) - -TEST(ProcessMetricsMemoryDumpProviderTest, TestPollFastMemoryTotal) { - ProcessMetricsMemoryDumpProvider mdp(base::kNullProcessId); - - uint64_t total1, total2; - mdp.PollFastMemoryTotal(&total1); - ASSERT_GT(total1, 0u); - size_t kBufSize = 16 * 1024 * 1024; - auto buf = base::MakeUnique<char[]>(kBufSize); - for (size_t i = 0; i < kBufSize; i++) - buf[i] = *((volatile char*)&buf[i]) + 1; - mdp.PollFastMemoryTotal(&total2); - ASSERT_GT(total2, 0u); - EXPECT_GT(total2, total1 + kBufSize / 2); - -#if defined(OS_LINUX) || defined(OS_ANDROID) - EXPECT_GE(mdp.fast_polling_statm_fd_.get(), 0); - - base::ScopedFILE temp_file; - CreateTempFileWithContents(kTestStatm, &temp_file); - mdp.fast_polling_statm_fd_for_testing = fileno(temp_file.get()); - size_t page_size = base::GetPageSize(); - uint64_t value; - mdp.PollFastMemoryTotal(&value); - EXPECT_EQ(100 * page_size, value); - - mdp.SuspendFastMemoryPolling(); - EXPECT_FALSE(mdp.fast_polling_statm_fd_.is_valid()); -#else - mdp.SuspendFastMemoryPolling(); -#endif -} - -#if defined(OS_WIN) - -void DummyFunction() {} - -TEST(ProcessMetricsMemoryDumpProviderTest, TestWinModuleReading) { - using VMRegion = base::trace_event::ProcessMemoryMaps::VMRegion; - - ProcessMetricsMemoryDumpProvider mdp(base::kNullProcessId); - base::trace_event::MemoryDumpArgs args; - base::trace_event::ProcessMemoryDump dump(nullptr, args); - ASSERT_TRUE(mdp.DumpProcessMemoryMaps(args, &dump)); - ASSERT_TRUE(dump.has_process_mmaps()); - - wchar_t module_name[MAX_PATH]; - DWORD result = GetModuleFileName(nullptr, module_name, MAX_PATH); - ASSERT_TRUE(result); - std::string executable_name = base::SysWideToNativeMB(module_name); - - HMODULE module_containing_dummy = nullptr; - uintptr_t dummy_function_address = - reinterpret_cast<uintptr_t>(&DummyFunction); - result = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, - reinterpret_cast<LPCWSTR>(dummy_function_address), - &module_containing_dummy); - ASSERT_TRUE(result); - result = GetModuleFileName(nullptr, module_name, MAX_PATH); - ASSERT_TRUE(result); - std::string module_containing_dummy_name = - base::SysWideToNativeMB(module_name); - - bool found_executable = false; - bool found_region_with_dummy = false; - for (const VMRegion& region : dump.process_mmaps()->vm_regions()) { - EXPECT_NE(0u, region.start_address); - EXPECT_NE(0u, region.size_in_bytes); - - if (region.mapped_file.find(executable_name) != std::string::npos) - found_executable = true; - - if (dummy_function_address >= region.start_address && - dummy_function_address < region.start_address + region.size_in_bytes) { - found_region_with_dummy = true; - EXPECT_EQ(module_containing_dummy_name, region.mapped_file); - } - } - EXPECT_TRUE(found_executable); - EXPECT_TRUE(found_region_with_dummy); -} -#endif - -#if defined(OS_MACOSX) -TEST(ProcessMetricsMemoryDumpProviderTest, TestMachOReading) { - using VMRegion = base::trace_event::ProcessMemoryMaps::VMRegion; - ProcessMetricsMemoryDumpProvider mdp(base::kNullProcessId); - base::trace_event::MemoryDumpArgs args; - base::trace_event::ProcessMemoryDump dump(nullptr, args); - ASSERT_TRUE(mdp.DumpProcessMemoryMaps(args, &dump)); - ASSERT_TRUE(dump.has_process_mmaps()); - uint32_t size = 100; - char full_path[size]; - int result = _NSGetExecutablePath(full_path, &size); - ASSERT_EQ(0, result); - std::string name = basename(full_path); - - uint64_t components_unittests_resident_pages = 0; - bool found_appkit = false; - for (const VMRegion& region : dump.process_mmaps()->vm_regions()) { - EXPECT_NE(0u, region.start_address); - EXPECT_NE(0u, region.size_in_bytes); - - EXPECT_LT(region.size_in_bytes, 1ull << 32); - uint32_t required_protection_flags = - VMRegion::kProtectionFlagsRead | VMRegion::kProtectionFlagsExec; - if (region.mapped_file.find(name) != std::string::npos && - region.protection_flags == required_protection_flags) { - components_unittests_resident_pages += - region.byte_stats_private_dirty_resident + - region.byte_stats_shared_dirty_resident + - region.byte_stats_private_clean_resident + - region.byte_stats_shared_clean_resident; - } - - if (region.mapped_file.find("AppKit") != std::string::npos) { - found_appkit = true; - } - } - EXPECT_GT(components_unittests_resident_pages, 0u); - EXPECT_TRUE(found_appkit); -} - -#endif // defined(OS_MACOSX) -} // namespace tracing
diff --git a/components/tracing/common/trace_config_file_unittest.cc b/components/tracing/common/trace_config_file_unittest.cc index 2c7df54..471d6762 100644 --- a/components/tracing/common/trace_config_file_unittest.cc +++ b/components/tracing/common/trace_config_file_unittest.cc
@@ -16,16 +16,15 @@ namespace { const char kTraceConfig[] = - "{" + "{" "\"enable_argument_filter\":true," "\"enable_systrace\":true," "\"excluded_categories\":[\"excluded\",\"exc_pattern*\"]," "\"included_categories\":[\"included\"," - "\"inc_pattern*\"," - "\"disabled-by-default-cc\"]," - "\"record_mode\":\"record-continuously\"," - "\"synthetic_delays\":[\"test.Delay1;16\",\"test.Delay2;32\"]" - "}"; + "\"inc_pattern*\"," + "\"disabled-by-default-cc\"]," + "\"record_mode\":\"record-continuously\"" + "}"; std::string GetTraceConfigFileContent(std::string trace_config, std::string startup_duration,
diff --git a/components/translate/core/browser/translate_language_list.cc b/components/translate/core/browser/translate_language_list.cc index 1663fd7..b5d27cf 100644 --- a/components/translate/core/browser/translate_language_list.cc +++ b/components/translate/core/browser/translate_language_list.cc
@@ -155,8 +155,8 @@ TranslateLanguageList::TranslateLanguageList() : resource_requests_allowed_(false), request_pending_(false) { // We default to our hard coded list of languages in - // |kDefaultSupportedLanguages|. This list will be overriden by a server - // providing supported langauges list. + // |kDefaultSupportedLanguages|. This list will be overridden by a server + // providing supported languages list. for (size_t i = 0; i < arraysize(kDefaultSupportedLanguages); ++i) supported_languages_.insert(kDefaultSupportedLanguages[i]);
diff --git a/components/translate/core/browser/translate_language_list.h b/components/translate/core/browser/translate_language_list.h index 1b6dadb3..e35f7811 100644 --- a/components/translate/core/browser/translate_language_list.h +++ b/components/translate/core/browser/translate_language_list.h
@@ -71,7 +71,9 @@ static const char kTargetLanguagesKey[]; private: + FRIEND_TEST_ALL_PREFIXES(TranslateLanguageListTest, IsSupportedLanguage); FRIEND_TEST_ALL_PREFIXES(TranslateLanguageListTest, SetSupportedLanguages); + FRIEND_TEST_ALL_PREFIXES(TranslateLanguageListTest, TranslateLanguageUrl); // Callback function called when TranslateURLFetcher::Request() is finished. void OnLanguageListFetchComplete(int id,
diff --git a/components/translate/core/browser/translate_language_list_unittest.cc b/components/translate/core/browser/translate_language_list_unittest.cc index 5173130..870a383 100644 --- a/components/translate/core/browser/translate_language_list_unittest.cc +++ b/components/translate/core/browser/translate_language_list_unittest.cc
@@ -4,11 +4,18 @@ #include "components/translate/core/browser/translate_language_list.h" +#include <string> +#include <vector> + +#include "base/test/scoped_command_line.h" #include "components/translate/core/browser/translate_download_manager.h" #include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" namespace translate { +// Test that the supported languages can be explicitly set using +// SetSupportedLanguages(). TEST(TranslateLanguageListTest, SetSupportedLanguages) { std::string language_list( "{" @@ -27,4 +34,67 @@ manager->ResetForTesting(); } +// Test that the language code back-off of locale is done correctly (where +// required). +TEST(TranslateLanguageListTest, GetLanguageCode) { + TranslateLanguageList language_list; + EXPECT_EQ("en", language_list.GetLanguageCode("en")); + // Test backoff of unsupported locale. + EXPECT_EQ("en", language_list.GetLanguageCode("en-US")); + // Test supported locale not backed off. + EXPECT_EQ("zh-CN", language_list.GetLanguageCode("zh-CN")); +} + +// Test that the translation URL is correctly generated, and that the +// translate-security-origin command-line flag correctly overrides the default +// value. +TEST(TranslateLanguageListTest, TranslateLanguageUrl) { + TranslateLanguageList language_list; + + // Test default security origin. + // The command-line override switch should not be set by default. + EXPECT_FALSE(base::CommandLine::ForCurrentProcess()->HasSwitch( + "translate-security-origin")); + EXPECT_EQ("https://translate.googleapis.com/translate_a/l?client=chrome", + language_list.TranslateLanguageUrl().spec()); + + // Test command-line security origin. + base::test::ScopedCommandLine scoped_command_line; + // Set the override switch. + scoped_command_line.GetProcessCommandLine()->AppendSwitchASCII( + "translate-security-origin", "https://example.com"); + EXPECT_EQ("https://example.com/translate_a/l?client=chrome", + language_list.TranslateLanguageUrl().spec()); +} + +// Test that IsSupportedLanguage() is true for languages that should be +// supported, and false for invalid languages. +TEST(TranslateLanguageListTest, IsSupportedLanguage) { + TranslateLanguageList language_list; + EXPECT_TRUE(language_list.IsSupportedLanguage("en")); + EXPECT_TRUE(language_list.IsSupportedLanguage("zh-CN")); + EXPECT_FALSE(language_list.IsSupportedLanguage("xx")); +} + +// Sanity test for the default set of supported languages. The default set of +// languages should be large (> 100) and must contain very common languages. +// If either of these tests are not true, the default language configuration is +// likely to be incorrect. +TEST(TranslateLanguageListTest, GetSupportedLanguages) { + TranslateLanguageList language_list; + std::vector<std::string> languages; + language_list.GetSupportedLanguages(&languages); + // Check there are a lot of default languages. + EXPECT_GE(languages.size(), 100ul); + // Check that some very common languages are there. + const auto begin = languages.begin(); + const auto end = languages.end(); + EXPECT_NE(end, std::find(begin, end, "en")); + EXPECT_NE(end, std::find(begin, end, "es")); + EXPECT_NE(end, std::find(begin, end, "fr")); + EXPECT_NE(end, std::find(begin, end, "ru")); + EXPECT_NE(end, std::find(begin, end, "zh-CN")); + EXPECT_NE(end, std::find(begin, end, "zh-TW")); +} + } // namespace translate
diff --git a/components/ukm/public/ukm_recorder.h b/components/ukm/public/ukm_recorder.h index c56b448..c4c18b97 100644 --- a/components/ukm/public/ukm_recorder.h +++ b/components/ukm/public/ukm_recorder.h
@@ -45,6 +45,7 @@ } namespace password_manager { +class PasswordManagerMetricsRecorder; class PasswordFormMetricsRecorder; } @@ -95,6 +96,7 @@ friend content::MediaInternals; friend content::RenderFrameImpl; friend content::RenderWidgetHostLatencyTracker; + friend password_manager::PasswordManagerMetricsRecorder; friend password_manager::PasswordFormMetricsRecorder; friend resource_coordinator::CoordinationUnitManager; FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, AddEntryWithEmptyMetrics);
diff --git a/components/update_client/background_downloader_win.cc b/components/update_client/background_downloader_win.cc index 0abf44a..51ec40a 100644 --- a/components/update_client/background_downloader_win.cc +++ b/components/update_client/background_downloader_win.cc
@@ -22,6 +22,7 @@ #include "base/files/file_util.h" #include "base/location.h" #include "base/macros.h" +#include "base/metrics/histogram_macros.h" #include "base/sequenced_task_runner.h" #include "base/strings/sys_string_conversions.h" #include "base/win/scoped_co_mem.h" @@ -423,6 +424,20 @@ return S_OK; } +// Returns the number of jobs in the BITS queue which were created by this +// downloader. +HRESULT GetBackgroundDownloaderJobCount( + const ScopedComPtr<IBackgroundCopyManager>& bits_manager, + size_t* num_jobs) { + std::vector<ScopedComPtr<IBackgroundCopyJob>> jobs; + const HRESULT hr = FindBitsJobIf([](IBackgroundCopyJob*) { return true; }, + bits_manager.Get(), &jobs); + if (FAILED(hr)) + return hr; + *num_jobs = jobs.size(); + return S_OK; +} + } // namespace BackgroundDownloader::BackgroundDownloader( @@ -715,6 +730,10 @@ IBackgroundCopyJob** job) { DCHECK(task_runner()->RunsTasksInCurrentSequence()); + size_t num_jobs = 0; + GetBackgroundDownloaderJobCount(bits_manager_, &num_jobs); + UMA_HISTOGRAM_COUNTS_100("UpdateClient.BackgroundDownloaderJobs", num_jobs); + ScopedComPtr<IBackgroundCopyJob> p; HRESULT hr = CreateOrOpenJob(url, p.GetAddressOf()); if (FAILED(hr))
diff --git a/components/user_manager/known_user.cc b/components/user_manager/known_user.cc index 22db652..5de67a0 100644 --- a/components/user_manager/known_user.cc +++ b/components/user_manager/known_user.cc
@@ -10,6 +10,7 @@ #include <utility> #include "base/logging.h" +#include "base/metrics/histogram_macros.h" #include "base/values.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/scoped_user_pref_update.h" @@ -456,8 +457,13 @@ bool WasProfileEverInitialized(const AccountId& account_id) { bool profile_ever_initialized; - if (GetBooleanPref(account_id, kProfileEverInitialized, - &profile_ever_initialized)) + const bool pref_set = GetBooleanPref(account_id, kProfileEverInitialized, + &profile_ever_initialized); + // TODO(atwilson): Remove migration code below once this UMA stat reports + // that migration is completed - crbug.com/736760. + UMA_HISTOGRAM_BOOLEAN("UserManager.ProfileEverInitializedMigrationCompleted", + pref_set); + if (pref_set) return profile_ever_initialized; // Sessions created before we started setting the session_initialized flag
diff --git a/components/variations/variations_seed_store.cc b/components/variations/variations_seed_store.cc index 2bf003ae..73cb6b4 100644 --- a/components/variations/variations_seed_store.cc +++ b/components/variations/variations_seed_store.cc
@@ -10,7 +10,6 @@ #include "base/macros.h" #include "base/metrics/histogram_macros.h" #include "base/numerics/safe_math.h" -#include "base/sha1.h" #include "base/strings/string_number_conversions.h" #include "build/build_config.h" #include "components/prefs/pref_registry_simple.h" @@ -163,6 +162,9 @@ bool is_delta_compressed, bool is_gzip_compressed, VariationsSeed* parsed_seed) { + UMA_HISTOGRAM_BOOLEAN("Variations.StoreSeed.HasCountry", + !country_code.empty()); + // If the data is gzip compressed, first uncompress it. std::string ungzipped_data; if (is_gzip_compressed) {
diff --git a/components/viz/common/gpu/README.md b/components/viz/common/gpu/README.md new file mode 100644 index 0000000..f05f292 --- /dev/null +++ b/components/viz/common/gpu/README.md
@@ -0,0 +1,9 @@ +# gpu/ + +This directory contains viz APIs for access to the gpu services. + +## ContextProvider + +The primary interface to control access to the gpu and lifetime of client-side +gpu control structures (such as the GLES2Implementation that gives access to +the command buffer).
diff --git a/components/viz/common/quads/README.md b/components/viz/common/quads/README.md new file mode 100644 index 0000000..c6295e1 --- /dev/null +++ b/components/viz/common/quads/README.md
@@ -0,0 +1,8 @@ +# quads/ + +This directory contains the transport data structures for submitting frames +from the viz client to the service, and returning data back to the client. + +The root of the structure for submitting frames is CompositorFrame. +Viz-specific types that are included in the CompositorFrame are all part +of this directory, including RenderPass, DrawQuads and SharedQuadState.
diff --git a/components/viz/common/resources/README.md b/components/viz/common/resources/README.md new file mode 100644 index 0000000..70939e68 --- /dev/null +++ b/components/viz/common/resources/README.md
@@ -0,0 +1,7 @@ +# resources/ + +This directory contains abstractions and helpers to allocate and use both +gpu and software resources. + +This code provides means to decide on texture formats, including compressed +formats, or classes to manage the lifetime and (re)-use of resources.
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn index 9b0aa5f..2516ef2 100644 --- a/components/viz/service/BUILD.gn +++ b/components/viz/service/BUILD.gn
@@ -9,20 +9,20 @@ component("service") { sources = [ - "display_compositor/buffer_queue.cc", - "display_compositor/buffer_queue.h", - "display_compositor/compositor_overlay_candidate_validator.h", - "display_compositor/display_output_surface.cc", - "display_compositor/display_output_surface.h", - "display_compositor/display_provider.h", - "display_compositor/gpu_display_provider.cc", - "display_compositor/gpu_display_provider.h", - "display_compositor/in_process_gpu_memory_buffer_manager.cc", - "display_compositor/in_process_gpu_memory_buffer_manager.h", - "display_compositor/server_shared_bitmap_manager.cc", - "display_compositor/server_shared_bitmap_manager.h", - "display_compositor/shared_bitmap_allocation_notifier_impl.cc", - "display_compositor/shared_bitmap_allocation_notifier_impl.h", + "display_embedder/buffer_queue.cc", + "display_embedder/buffer_queue.h", + "display_embedder/compositor_overlay_candidate_validator.h", + "display_embedder/display_output_surface.cc", + "display_embedder/display_output_surface.h", + "display_embedder/display_provider.h", + "display_embedder/gpu_display_provider.cc", + "display_embedder/gpu_display_provider.h", + "display_embedder/in_process_gpu_memory_buffer_manager.cc", + "display_embedder/in_process_gpu_memory_buffer_manager.h", + "display_embedder/server_shared_bitmap_manager.cc", + "display_embedder/server_shared_bitmap_manager.h", + "display_embedder/shared_bitmap_allocation_notifier_impl.cc", + "display_embedder/shared_bitmap_allocation_notifier_impl.h", "frame_sinks/frame_eviction_manager.cc", "frame_sinks/frame_eviction_manager.h", "frame_sinks/frame_evictor.cc", @@ -62,24 +62,24 @@ if (is_mac) { sources += [ - "display_compositor/compositor_overlay_candidate_validator_mac.h", - "display_compositor/compositor_overlay_candidate_validator_mac.mm", + "display_embedder/compositor_overlay_candidate_validator_mac.h", + "display_embedder/compositor_overlay_candidate_validator_mac.mm", ] } if (is_android) { sources += [ - "display_compositor/compositor_overlay_candidate_validator_android.cc", - "display_compositor/compositor_overlay_candidate_validator_android.h", + "display_embedder/compositor_overlay_candidate_validator_android.cc", + "display_embedder/compositor_overlay_candidate_validator_android.h", ] } if (use_ozone) { sources += [ - "display_compositor/compositor_overlay_candidate_validator_ozone.cc", - "display_compositor/compositor_overlay_candidate_validator_ozone.h", - "display_compositor/display_output_surface_ozone.cc", - "display_compositor/display_output_surface_ozone.h", + "display_embedder/compositor_overlay_candidate_validator_ozone.cc", + "display_embedder/compositor_overlay_candidate_validator_ozone.h", + "display_embedder/display_output_surface_ozone.cc", + "display_embedder/display_output_surface_ozone.h", ] public_deps += [ "//ui/ozone" ] @@ -87,8 +87,8 @@ if (is_win) { sources += [ - "display_compositor/compositor_overlay_candidate_validator_win.cc", - "display_compositor/compositor_overlay_candidate_validator_win.h", + "display_embedder/compositor_overlay_candidate_validator_win.cc", + "display_embedder/compositor_overlay_candidate_validator_win.h", ] } } @@ -97,12 +97,12 @@ source_set("unit_tests") { testonly = true sources = [ - "display_compositor/buffer_queue_unittest.cc", - "display_compositor/server_shared_bitmap_manager_unittest.cc", + "display_embedder/buffer_queue_unittest.cc", + "display_embedder/server_shared_bitmap_manager_unittest.cc", ] if (!use_aura && !is_mac) { - sources -= [ "display_compositor/buffer_queue_unittest.cc" ] + sources -= [ "display_embedder/buffer_queue_unittest.cc" ] } configs += [
diff --git a/components/viz/service/display/README.md b/components/viz/service/display/README.md new file mode 100644 index 0000000..9d70d66 --- /dev/null +++ b/components/viz/service/display/README.md
@@ -0,0 +1,12 @@ +# display/ + +This directory is the implementation of the Display Compositor. + +The Display Compositor combines frames submitted to the viz service through +frame sinks, and combines them into a single gpu or software resource to be +presented to the user. + +This directory is agnostic w.r.t. platform-specific presentation details, which +are abstracted behind OutputSurface and SoftwareOutputDevice. Through these +APIs, it supports either compositing gpu resources (textures) into a single +texture/framebuffer, or software resources (bitmaps) into a single bitmap.
diff --git a/components/viz/service/display_compositor/buffer_queue.cc b/components/viz/service/display_compositor/buffer_queue.cc deleted file mode 100644 index 10e4008..0000000 --- a/components/viz/service/display_compositor/buffer_queue.cc +++ /dev/null
@@ -1,303 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/viz/service/display_compositor/buffer_queue.h" - -#include "base/containers/adapters.h" -#include "base/memory/ptr_util.h" -#include "build/build_config.h" -#include "components/viz/common/gl_helper.h" -#include "gpu/GLES2/gl2extchromium.h" -#include "gpu/command_buffer/client/gles2_interface.h" -#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" -#include "gpu/command_buffer/common/gpu_memory_buffer_support.h" -#include "third_party/skia/include/core/SkRect.h" -#include "third_party/skia/include/core/SkRegion.h" -#include "ui/display/types/display_snapshot.h" -#include "ui/gfx/gpu_memory_buffer.h" -#include "ui/gfx/skia_util.h" - -namespace viz { - -BufferQueue::BufferQueue(gpu::gles2::GLES2Interface* gl, - uint32_t texture_target, - uint32_t internal_format, - gfx::BufferFormat format, - GLHelper* gl_helper, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, - gpu::SurfaceHandle surface_handle) - : gl_(gl), - fbo_(0), - allocated_count_(0), - texture_target_(texture_target), - internal_format_(internal_format), - format_(format), - gl_helper_(gl_helper), - gpu_memory_buffer_manager_(gpu_memory_buffer_manager), - surface_handle_(surface_handle) { - DCHECK(gpu::IsImageFormatCompatibleWithGpuMemoryBufferFormat(internal_format, - format_)); -} - -BufferQueue::~BufferQueue() { - FreeAllSurfaces(); - - if (fbo_) - gl_->DeleteFramebuffers(1, &fbo_); -} - -void BufferQueue::Initialize() { - gl_->GenFramebuffers(1, &fbo_); -} - -void BufferQueue::BindFramebuffer() { - gl_->BindFramebuffer(GL_FRAMEBUFFER, fbo_); - - if (!current_surface_) - current_surface_ = GetNextSurface(); - - if (current_surface_) { - gl_->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, - texture_target_, current_surface_->texture, 0); - if (current_surface_->stencil) { - gl_->FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, - GL_RENDERBUFFER, current_surface_->stencil); - } - } -} - -void BufferQueue::CopyBufferDamage(int texture, - int source_texture, - const gfx::Rect& new_damage, - const gfx::Rect& old_damage) { - gl_helper_->CopySubBufferDamage(texture_target_, texture, source_texture, - SkRegion(gfx::RectToSkIRect(new_damage)), - SkRegion(gfx::RectToSkIRect(old_damage))); -} - -void BufferQueue::UpdateBufferDamage(const gfx::Rect& damage) { - if (displayed_surface_) - displayed_surface_->damage.Union(damage); - for (auto& surface : available_surfaces_) - surface->damage.Union(damage); - for (auto& surface : in_flight_surfaces_) { - if (surface) - surface->damage.Union(damage); - } -} - -void BufferQueue::SwapBuffers(const gfx::Rect& damage) { - if (current_surface_) { - if (damage != gfx::Rect(size_)) { - // Copy damage from the most recently swapped buffer. In the event that - // the buffer was destroyed and failed to recreate, pick from the most - // recently available buffer. - uint32_t texture_id = 0; - for (auto& surface : base::Reversed(in_flight_surfaces_)) { - if (surface) { - texture_id = surface->texture; - break; - } - } - if (!texture_id && displayed_surface_) - texture_id = displayed_surface_->texture; - - if (texture_id) { - CopyBufferDamage(current_surface_->texture, texture_id, damage, - current_surface_->damage); - } - } - current_surface_->damage = gfx::Rect(); - } - UpdateBufferDamage(damage); - in_flight_surfaces_.push_back(std::move(current_surface_)); - // Some things reset the framebuffer (CopySubBufferDamage, some GLRenderer - // paths), so ensure we restore it here. - gl_->BindFramebuffer(GL_FRAMEBUFFER, fbo_); -} - -void BufferQueue::Reshape(const gfx::Size& size, - float scale_factor, - const gfx::ColorSpace& color_space, - bool use_stencil) { - if (size == size_ && color_space == color_space_ && - use_stencil == use_stencil_) - return; -#if !defined(OS_MACOSX) - // TODO(ccameron): This assert is being hit on Mac try jobs. Determine if that - // is cause for concern or if it is benign. - // http://crbug.com/524624 - DCHECK(!current_surface_); -#endif - size_ = size; - color_space_ = color_space; - use_stencil_ = use_stencil; - - gl_->BindFramebuffer(GL_FRAMEBUFFER, fbo_); - gl_->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, - texture_target_, 0, 0); - gl_->FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, - GL_RENDERBUFFER, 0); - - FreeAllSurfaces(); -} - -void BufferQueue::RecreateBuffers() { - // We need to recreate the buffers, for whatever reason the old ones are not - // presentable on the device anymore. - // Unused buffers can be freed directly, they will be re-allocated as needed. - // Any in flight, current or displayed surface must be replaced. - available_surfaces_.clear(); - - // Recreate all in-flight surfaces and put the recreated copies in the queue. - for (auto& surface : in_flight_surfaces_) - surface = RecreateBuffer(std::move(surface)); - - current_surface_ = RecreateBuffer(std::move(current_surface_)); - displayed_surface_ = RecreateBuffer(std::move(displayed_surface_)); - - if (current_surface_) { - // If we have a texture bound, we will need to re-bind it. - gl_->BindFramebuffer(GL_FRAMEBUFFER, fbo_); - gl_->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, - texture_target_, current_surface_->texture, 0); - } -} - -std::unique_ptr<BufferQueue::AllocatedSurface> BufferQueue::RecreateBuffer( - std::unique_ptr<AllocatedSurface> surface) { - if (!surface) - return nullptr; - - std::unique_ptr<AllocatedSurface> new_surface(GetNextSurface()); - if (!new_surface) - return nullptr; - - new_surface->damage = surface->damage; - - // Copy the entire texture. - CopyBufferDamage(new_surface->texture, surface->texture, gfx::Rect(), - gfx::Rect(size_)); - return new_surface; -} - -void BufferQueue::PageFlipComplete() { - // Early out when no surface is in-flight. This can happen when using - // overlays and page flipping without changing the primary plane. - if (in_flight_surfaces_.empty()) - return; - if (displayed_surface_) - available_surfaces_.push_back(std::move(displayed_surface_)); - displayed_surface_ = std::move(in_flight_surfaces_.front()); - in_flight_surfaces_.pop_front(); -} - -uint32_t BufferQueue::GetCurrentTextureId() const { - // Return current surface texture if bound. - if (current_surface_) - return current_surface_->texture; - - // Return in-flight or displayed surface texture if no surface is - // currently bound. This can happen when using overlays and surface - // damage is empty. Note: |in_flight_surfaces_| entries can be null - // as a result of calling FreeAllSurfaces(). - if (!in_flight_surfaces_.empty() && in_flight_surfaces_.back()) - return in_flight_surfaces_.back()->texture; - if (displayed_surface_) - return displayed_surface_->texture; - - return 0; -} - -void BufferQueue::FreeAllSurfaces() { - displayed_surface_.reset(); - current_surface_.reset(); - // This is intentionally not emptied since the swap buffers acks are still - // expected to arrive. - for (auto& surface : in_flight_surfaces_) - surface = nullptr; - available_surfaces_.clear(); -} - -void BufferQueue::FreeSurfaceResources(AllocatedSurface* surface) { - if (!surface->texture) - return; - - gl_->BindTexture(texture_target_, surface->texture); - gl_->ReleaseTexImage2DCHROMIUM(texture_target_, surface->image); - gl_->DeleteTextures(1, &surface->texture); - gl_->DestroyImageCHROMIUM(surface->image); - if (surface->stencil) - gl_->DeleteRenderbuffers(1, &surface->stencil); - surface->buffer.reset(); - allocated_count_--; -} - -std::unique_ptr<BufferQueue::AllocatedSurface> BufferQueue::GetNextSurface() { - if (!available_surfaces_.empty()) { - std::unique_ptr<AllocatedSurface> surface = - std::move(available_surfaces_.back()); - available_surfaces_.pop_back(); - return surface; - } - - GLuint texture; - gl_->GenTextures(1, &texture); - - GLuint stencil = 0; - if (use_stencil_) { - gl_->GenRenderbuffers(1, &stencil); - gl_->BindRenderbuffer(GL_RENDERBUFFER, stencil); - gl_->RenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, size_.width(), - size_.height()); - gl_->BindRenderbuffer(GL_RENDERBUFFER, 0); - } - - // We don't want to allow anything more than triple buffering. - DCHECK_LT(allocated_count_, 4U); - std::unique_ptr<gfx::GpuMemoryBuffer> buffer( - gpu_memory_buffer_manager_->CreateGpuMemoryBuffer( - size_, format_, gfx::BufferUsage::SCANOUT, surface_handle_)); - if (!buffer.get()) { - gl_->DeleteTextures(1, &texture); - DLOG(ERROR) << "Failed to allocate GPU memory buffer"; - return nullptr; - } - buffer->SetColorSpaceForScanout(color_space_); - - uint32_t id = - gl_->CreateImageCHROMIUM(buffer->AsClientBuffer(), size_.width(), - size_.height(), internal_format_); - if (!id) { - LOG(ERROR) << "Failed to allocate backing image surface"; - gl_->DeleteTextures(1, &texture); - return nullptr; - } - - allocated_count_++; - gl_->BindTexture(texture_target_, texture); - gl_->BindTexImage2DCHROMIUM(texture_target_, id); - return base::MakeUnique<AllocatedSurface>(this, std::move(buffer), texture, - id, stencil, gfx::Rect(size_)); -} - -BufferQueue::AllocatedSurface::AllocatedSurface( - BufferQueue* buffer_queue, - std::unique_ptr<gfx::GpuMemoryBuffer> buffer, - uint32_t texture, - uint32_t image, - uint32_t stencil, - const gfx::Rect& rect) - : buffer_queue(buffer_queue), - buffer(buffer.release()), - texture(texture), - image(image), - stencil(stencil), - damage(rect) {} - -BufferQueue::AllocatedSurface::~AllocatedSurface() { - buffer_queue->FreeSurfaceResources(this); -} - -} // namespace viz
diff --git a/components/viz/service/display_compositor/buffer_queue.h b/components/viz/service/display_compositor/buffer_queue.h deleted file mode 100644 index bac1b85e..0000000 --- a/components/viz/service/display_compositor/buffer_queue.h +++ /dev/null
@@ -1,136 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_BUFFER_QUEUE_H_ -#define COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_BUFFER_QUEUE_H_ - -#include <stddef.h> - -#include <deque> -#include <memory> -#include <vector> - -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "components/viz/service/viz_service_export.h" -#include "gpu/ipc/common/surface_handle.h" -#include "ui/gfx/buffer_types.h" -#include "ui/gfx/color_space.h" -#include "ui/gfx/geometry/rect.h" -#include "ui/gfx/geometry/size.h" - -namespace gfx { -class GpuMemoryBuffer; -} - -namespace gpu { -class GpuMemoryBufferManager; - -namespace gles2 { -class GLES2Interface; -} -} - -namespace viz { - -class GLHelper; - -// Provides a surface that manages its own buffers, backed by GpuMemoryBuffers -// created using CHROMIUM_image. Double/triple buffering is implemented -// internally. Doublebuffering occurs if PageFlipComplete is called before the -// next BindFramebuffer call, otherwise it creates extra buffers. -class VIZ_SERVICE_EXPORT BufferQueue { - public: - BufferQueue(gpu::gles2::GLES2Interface* gl, - uint32_t texture_target, - uint32_t internal_format, - gfx::BufferFormat format, - GLHelper* gl_helper, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, - gpu::SurfaceHandle surface_handle); - virtual ~BufferQueue(); - - void Initialize(); - - void BindFramebuffer(); - void SwapBuffers(const gfx::Rect& damage); - void PageFlipComplete(); - void Reshape(const gfx::Size& size, - float scale_factor, - const gfx::ColorSpace& color_space, - bool use_stencil); - void RecreateBuffers(); - uint32_t GetCurrentTextureId() const; - - uint32_t fbo() const { return fbo_; } - uint32_t internal_format() const { return internal_format_; } - - private: - friend class BufferQueueTest; - friend class AllocatedSurface; - - struct VIZ_SERVICE_EXPORT AllocatedSurface { - AllocatedSurface(BufferQueue* buffer_queue, - std::unique_ptr<gfx::GpuMemoryBuffer> buffer, - uint32_t texture, - uint32_t image, - uint32_t stencil, - const gfx::Rect& rect); - ~AllocatedSurface(); - BufferQueue* const buffer_queue; - std::unique_ptr<gfx::GpuMemoryBuffer> buffer; - const uint32_t texture; - const uint32_t image; - const uint32_t stencil; - gfx::Rect damage; // This is the damage for this frame from the previous. - }; - - void FreeAllSurfaces(); - - void FreeSurfaceResources(AllocatedSurface* surface); - - // Copy everything that is in |copy_rect|, except for what is in - // |exclude_rect| from |source_texture| to |texture|. - virtual void CopyBufferDamage(int texture, - int source_texture, - const gfx::Rect& new_damage, - const gfx::Rect& old_damage); - - void UpdateBufferDamage(const gfx::Rect& damage); - - // Return a surface, available to be drawn into. - std::unique_ptr<AllocatedSurface> GetNextSurface(); - - std::unique_ptr<AllocatedSurface> RecreateBuffer( - std::unique_ptr<AllocatedSurface> surface); - - gpu::gles2::GLES2Interface* const gl_; - gfx::Size size_; - gfx::ColorSpace color_space_; - bool use_stencil_ = false; - uint32_t fbo_; - size_t allocated_count_; - uint32_t texture_target_; - uint32_t internal_format_; - gfx::BufferFormat format_; - // This surface is currently bound. This may be nullptr if no surface has - // been bound, or if allocation failed at bind. - std::unique_ptr<AllocatedSurface> current_surface_; - // The surface currently on the screen, if any. - std::unique_ptr<AllocatedSurface> displayed_surface_; - // These are free for use, and are not nullptr. - std::vector<std::unique_ptr<AllocatedSurface>> available_surfaces_; - // These have been swapped but are not displayed yet. Entries of this deque - // may be nullptr, if they represent frames that have been destroyed. - std::deque<std::unique_ptr<AllocatedSurface>> in_flight_surfaces_; - GLHelper* gl_helper_; - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; - gpu::SurfaceHandle surface_handle_; - - DISALLOW_COPY_AND_ASSIGN(BufferQueue); -}; - -} // namespace viz - -#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_BUFFER_QUEUE_H_
diff --git a/components/viz/service/display_compositor/buffer_queue_unittest.cc b/components/viz/service/display_compositor/buffer_queue_unittest.cc deleted file mode 100644 index 1c77f9e..0000000 --- a/components/viz/service/display_compositor/buffer_queue_unittest.cc +++ /dev/null
@@ -1,680 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/viz/service/display_compositor/buffer_queue.h" - -#include <stddef.h> -#include <stdint.h> - -#include <set> -#include <utility> - -#include "base/memory/ptr_util.h" -#include "cc/test/test_context_provider.h" -#include "cc/test/test_gpu_memory_buffer_manager.h" -#include "cc/test/test_web_graphics_context_3d.h" -#include "components/viz/common/gl_helper.h" -#include "gpu/GLES2/gl2extchromium.h" -#include "testing/gmock/include/gmock/gmock.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "third_party/khronos/GLES2/gl2ext.h" -#include "ui/display/types/display_snapshot.h" - -using ::testing::_; -using ::testing::Expectation; -using ::testing::Ne; -using ::testing::Return; - -namespace viz { - -class StubGpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { - public: - explicit StubGpuMemoryBufferImpl(size_t* set_color_space_count) - : set_color_space_count_(set_color_space_count) {} - - // Overridden from gfx::GpuMemoryBuffer: - bool Map() override { return false; } - void* memory(size_t plane) override { return nullptr; } - void Unmap() override {} - gfx::Size GetSize() const override { return gfx::Size(); } - gfx::BufferFormat GetFormat() const override { - return gfx::BufferFormat::BGRX_8888; - } - int stride(size_t plane) const override { return 0; } - gfx::GpuMemoryBufferId GetId() const override { - return gfx::GpuMemoryBufferId(0); - } - void SetColorSpaceForScanout(const gfx::ColorSpace& color_space) override { - *set_color_space_count_ += 1; - } - gfx::GpuMemoryBufferHandle GetHandle() const override { - return gfx::GpuMemoryBufferHandle(); - } - ClientBuffer AsClientBuffer() override { - return reinterpret_cast<ClientBuffer>(this); - } - - size_t* set_color_space_count_; -}; - -class StubGpuMemoryBufferManager : public cc::TestGpuMemoryBufferManager { - public: - StubGpuMemoryBufferManager() : allocate_succeeds_(true) {} - - size_t set_color_space_count() const { return set_color_space_count_; } - - void set_allocate_succeeds(bool value) { allocate_succeeds_ = value; } - - std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( - const gfx::Size& size, - gfx::BufferFormat format, - gfx::BufferUsage usage, - gpu::SurfaceHandle surface_handle) override { - if (!surface_handle) { - return TestGpuMemoryBufferManager::CreateGpuMemoryBuffer( - size, format, usage, surface_handle); - } - if (allocate_succeeds_) - return base::WrapUnique<gfx::GpuMemoryBuffer>( - new StubGpuMemoryBufferImpl(&set_color_space_count_)); - return nullptr; - } - - private: - bool allocate_succeeds_; - size_t set_color_space_count_ = 0; -}; - -#if defined(OS_WIN) -const gpu::SurfaceHandle kFakeSurfaceHandle = - reinterpret_cast<gpu::SurfaceHandle>(1); -#else -const gpu::SurfaceHandle kFakeSurfaceHandle = 1; -#endif - -class MockBufferQueue : public BufferQueue { - public: - MockBufferQueue(gpu::gles2::GLES2Interface* gl, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, - unsigned int target, - unsigned int internalformat) - : BufferQueue(gl, - target, - internalformat, - display::DisplaySnapshot::PrimaryFormat(), - nullptr, - gpu_memory_buffer_manager, - kFakeSurfaceHandle) {} - MOCK_METHOD4(CopyBufferDamage, - void(int, int, const gfx::Rect&, const gfx::Rect&)); -}; - -class BufferQueueTest : public ::testing::Test { - public: - BufferQueueTest() : doublebuffering_(true), first_frame_(true) {} - - void SetUp() override { - InitWithContext(cc::TestWebGraphicsContext3D::Create()); - } - - void InitWithContext(std::unique_ptr<cc::TestWebGraphicsContext3D> context) { - context_provider_ = cc::TestContextProvider::Create(std::move(context)); - context_provider_->BindToCurrentThread(); - gpu_memory_buffer_manager_.reset(new StubGpuMemoryBufferManager); - mock_output_surface_ = new MockBufferQueue(context_provider_->ContextGL(), - gpu_memory_buffer_manager_.get(), - GL_TEXTURE_2D, GL_RGB); - output_surface_.reset(mock_output_surface_); - output_surface_->Initialize(); - } - - unsigned current_surface() { - return output_surface_->current_surface_ - ? output_surface_->current_surface_->image - : 0; - } - const std::vector<std::unique_ptr<BufferQueue::AllocatedSurface>>& - available_surfaces() { - return output_surface_->available_surfaces_; - } - std::deque<std::unique_ptr<BufferQueue::AllocatedSurface>>& - in_flight_surfaces() { - return output_surface_->in_flight_surfaces_; - } - - const BufferQueue::AllocatedSurface* displayed_frame() { - return output_surface_->displayed_surface_.get(); - } - const BufferQueue::AllocatedSurface* current_frame() { - return output_surface_->current_surface_.get(); - } - const BufferQueue::AllocatedSurface* next_frame() { - return output_surface_->available_surfaces_.back().get(); - } - const gfx::Size size() { return output_surface_->size_; } - - int CountBuffers() { - int n = available_surfaces().size() + in_flight_surfaces().size() + - (displayed_frame() ? 1 : 0); - if (current_surface()) - n++; - return n; - } - - // Check that each buffer is unique if present. - void CheckUnique() { - std::set<unsigned> buffers; - EXPECT_TRUE(InsertUnique(&buffers, current_surface())); - if (displayed_frame()) - EXPECT_TRUE(InsertUnique(&buffers, displayed_frame()->image)); - for (auto& surface : available_surfaces()) - EXPECT_TRUE(InsertUnique(&buffers, surface->image)); - for (auto& surface : in_flight_surfaces()) { - if (surface) - EXPECT_TRUE(InsertUnique(&buffers, surface->image)); - } - } - - void SwapBuffers() { - output_surface_->SwapBuffers(gfx::Rect(output_surface_->size_)); - } - - void SendDamagedFrame(const gfx::Rect& damage) { - // We don't care about the GL-level implementation here, just how it uses - // damage rects. - output_surface_->BindFramebuffer(); - output_surface_->SwapBuffers(damage); - if (doublebuffering_ || !first_frame_) - output_surface_->PageFlipComplete(); - first_frame_ = false; - } - - void SendFullFrame() { SendDamagedFrame(gfx::Rect(output_surface_->size_)); } - - protected: - bool InsertUnique(std::set<unsigned>* set, unsigned value) { - if (!value) - return true; - if (set->find(value) != set->end()) - return false; - set->insert(value); - return true; - } - - scoped_refptr<cc::TestContextProvider> context_provider_; - std::unique_ptr<StubGpuMemoryBufferManager> gpu_memory_buffer_manager_; - std::unique_ptr<BufferQueue> output_surface_; - MockBufferQueue* mock_output_surface_; - bool doublebuffering_; - bool first_frame_; -}; - -namespace { -const gfx::Size screen_size = gfx::Size(30, 30); -const gfx::Rect screen_rect = gfx::Rect(screen_size); -const gfx::Rect small_damage = gfx::Rect(gfx::Size(10, 10)); -const gfx::Rect large_damage = gfx::Rect(gfx::Size(20, 20)); -const gfx::Rect overlapping_damage = gfx::Rect(gfx::Size(5, 20)); - -GLuint CreateImageDefault() { - static GLuint id = 0; - return ++id; -} - -class MockedContext : public cc::TestWebGraphicsContext3D { - public: - MockedContext() { - ON_CALL(*this, createImageCHROMIUM(_, _, _, _)) - .WillByDefault(testing::InvokeWithoutArgs(&CreateImageDefault)); - } - MOCK_METHOD2(bindFramebuffer, void(GLenum, GLuint)); - MOCK_METHOD2(bindTexture, void(GLenum, GLuint)); - MOCK_METHOD2(bindTexImage2DCHROMIUM, void(GLenum, GLint)); - MOCK_METHOD4(createImageCHROMIUM, - GLuint(ClientBuffer, GLsizei, GLsizei, GLenum)); - MOCK_METHOD1(destroyImageCHROMIUM, void(GLuint)); - MOCK_METHOD5(framebufferTexture2D, - void(GLenum, GLenum, GLenum, GLuint, GLint)); -}; - -class BufferQueueMockedContextTest : public BufferQueueTest { - public: - void SetUp() override { - context_ = new MockedContext(); - InitWithContext(std::unique_ptr<cc::TestWebGraphicsContext3D>(context_)); - } - - protected: - MockedContext* context_; -}; - -scoped_refptr<cc::TestContextProvider> CreateMockedContextProvider( - MockedContext** context) { - std::unique_ptr<MockedContext> owned_context(new MockedContext); - *context = owned_context.get(); - scoped_refptr<cc::TestContextProvider> context_provider = - cc::TestContextProvider::Create(std::move(owned_context)); - context_provider->BindToCurrentThread(); - return context_provider; -} - -std::unique_ptr<BufferQueue> CreateBufferQueue( - unsigned int target, - gpu::gles2::GLES2Interface* gl, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) { - std::unique_ptr<BufferQueue> buffer_queue(new BufferQueue( - gl, target, GL_RGB, display::DisplaySnapshot::PrimaryFormat(), nullptr, - gpu_memory_buffer_manager, kFakeSurfaceHandle)); - buffer_queue->Initialize(); - return buffer_queue; -} - -TEST(BufferQueueStandaloneTest, FboInitialization) { - MockedContext* context; - scoped_refptr<cc::TestContextProvider> context_provider = - CreateMockedContextProvider(&context); - std::unique_ptr<StubGpuMemoryBufferManager> gpu_memory_buffer_manager( - new StubGpuMemoryBufferManager); - std::unique_ptr<BufferQueue> output_surface = - CreateBufferQueue(GL_TEXTURE_2D, context_provider->ContextGL(), - gpu_memory_buffer_manager.get()); - - EXPECT_CALL(*context, bindFramebuffer(GL_FRAMEBUFFER, Ne(0U))); - ON_CALL(*context, framebufferTexture2D(_, _, _, _, _)) - .WillByDefault(Return()); - - output_surface->Reshape(gfx::Size(10, 20), 1.0f, gfx::ColorSpace(), false); -} - -TEST(BufferQueueStandaloneTest, FboBinding) { - GLenum targets[] = {GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_ARB}; - for (size_t i = 0; i < 2; ++i) { - GLenum target = targets[i]; - - MockedContext* context; - scoped_refptr<cc::TestContextProvider> context_provider = - CreateMockedContextProvider(&context); - std::unique_ptr<StubGpuMemoryBufferManager> gpu_memory_buffer_manager( - new StubGpuMemoryBufferManager); - std::unique_ptr<BufferQueue> output_surface = CreateBufferQueue( - target, context_provider->ContextGL(), gpu_memory_buffer_manager.get()); - - EXPECT_CALL(*context, bindTexture(target, Ne(0U))); - EXPECT_CALL(*context, destroyImageCHROMIUM(1)); - Expectation image = - EXPECT_CALL(*context, createImageCHROMIUM(_, 0, 0, GL_RGB)) - .WillOnce(Return(1)); - Expectation fb = - EXPECT_CALL(*context, bindFramebuffer(GL_FRAMEBUFFER, Ne(0U))); - Expectation tex = EXPECT_CALL(*context, bindTexture(target, Ne(0U))); - Expectation bind_tex = - EXPECT_CALL(*context, bindTexImage2DCHROMIUM(target, 1)) - .After(tex, image); - EXPECT_CALL(*context, - framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, - target, Ne(0U), _)) - .After(fb, bind_tex); - - output_surface->BindFramebuffer(); - } -} - -TEST(BufferQueueStandaloneTest, CheckBoundFramebuffer) { - scoped_refptr<cc::TestContextProvider> context_provider = - cc::TestContextProvider::Create(); - context_provider->BindToCurrentThread(); - std::unique_ptr<StubGpuMemoryBufferManager> gpu_memory_buffer_manager; - std::unique_ptr<BufferQueue> output_surface; - gpu_memory_buffer_manager.reset(new StubGpuMemoryBufferManager); - - std::unique_ptr<GLHelper> gl_helper; - gl_helper.reset(new GLHelper(context_provider->ContextGL(), - context_provider->ContextSupport())); - - output_surface.reset(new BufferQueue( - context_provider->ContextGL(), GL_TEXTURE_2D, GL_RGB, - display::DisplaySnapshot::PrimaryFormat(), gl_helper.get(), - gpu_memory_buffer_manager.get(), kFakeSurfaceHandle)); - output_surface->Initialize(); - output_surface->Reshape(screen_size, 1.0f, gfx::ColorSpace(), false); - // Trigger a sub-buffer copy to exercise all paths. - output_surface->BindFramebuffer(); - output_surface->SwapBuffers(screen_rect); - output_surface->PageFlipComplete(); - output_surface->BindFramebuffer(); - output_surface->SwapBuffers(small_damage); - - int current_fbo = 0; - context_provider->ContextGL()->GetIntegerv(GL_FRAMEBUFFER_BINDING, - ¤t_fbo); - EXPECT_EQ(static_cast<int>(output_surface->fbo()), current_fbo); -} - -TEST_F(BufferQueueTest, PartialSwapReuse) { - output_surface_->Reshape(screen_size, 1.0f, gfx::ColorSpace(), false); - ASSERT_TRUE(doublebuffering_); - EXPECT_CALL(*mock_output_surface_, - CopyBufferDamage(_, _, small_damage, screen_rect)) - .Times(1); - EXPECT_CALL(*mock_output_surface_, - CopyBufferDamage(_, _, small_damage, small_damage)) - .Times(1); - EXPECT_CALL(*mock_output_surface_, - CopyBufferDamage(_, _, large_damage, small_damage)) - .Times(1); - SendFullFrame(); - SendDamagedFrame(small_damage); - SendDamagedFrame(small_damage); - SendDamagedFrame(large_damage); - // Verify that the damage has propagated. - EXPECT_EQ(next_frame()->damage, large_damage); -} - -TEST_F(BufferQueueTest, PartialSwapFullFrame) { - output_surface_->Reshape(screen_size, 1.0f, gfx::ColorSpace(), false); - ASSERT_TRUE(doublebuffering_); - EXPECT_CALL(*mock_output_surface_, - CopyBufferDamage(_, _, small_damage, screen_rect)) - .Times(1); - SendFullFrame(); - SendDamagedFrame(small_damage); - SendFullFrame(); - SendFullFrame(); - EXPECT_EQ(next_frame()->damage, screen_rect); -} - -TEST_F(BufferQueueTest, PartialSwapOverlapping) { - output_surface_->Reshape(screen_size, 1.0f, gfx::ColorSpace(), false); - ASSERT_TRUE(doublebuffering_); - EXPECT_CALL(*mock_output_surface_, - CopyBufferDamage(_, _, small_damage, screen_rect)) - .Times(1); - EXPECT_CALL(*mock_output_surface_, - CopyBufferDamage(_, _, overlapping_damage, small_damage)) - .Times(1); - - SendFullFrame(); - SendDamagedFrame(small_damage); - SendDamagedFrame(overlapping_damage); - EXPECT_EQ(next_frame()->damage, overlapping_damage); -} - -TEST_F(BufferQueueTest, MultipleBindCalls) { - // Check that multiple bind calls do not create or change surfaces. - output_surface_->BindFramebuffer(); - EXPECT_EQ(1, CountBuffers()); - unsigned int fb = current_surface(); - output_surface_->BindFramebuffer(); - EXPECT_EQ(1, CountBuffers()); - EXPECT_EQ(fb, current_surface()); -} - -TEST_F(BufferQueueTest, CheckDoubleBuffering) { - // Check buffer flow through double buffering path. - EXPECT_EQ(0, CountBuffers()); - output_surface_->BindFramebuffer(); - EXPECT_EQ(1, CountBuffers()); - EXPECT_NE(0U, current_surface()); - EXPECT_FALSE(displayed_frame()); - SwapBuffers(); - EXPECT_EQ(1U, in_flight_surfaces().size()); - output_surface_->PageFlipComplete(); - EXPECT_EQ(0U, in_flight_surfaces().size()); - EXPECT_TRUE(displayed_frame()->texture); - output_surface_->BindFramebuffer(); - EXPECT_EQ(2, CountBuffers()); - CheckUnique(); - EXPECT_NE(0U, current_surface()); - EXPECT_EQ(0U, in_flight_surfaces().size()); - EXPECT_TRUE(displayed_frame()->texture); - SwapBuffers(); - CheckUnique(); - EXPECT_EQ(1U, in_flight_surfaces().size()); - EXPECT_TRUE(displayed_frame()->texture); - output_surface_->PageFlipComplete(); - CheckUnique(); - EXPECT_EQ(0U, in_flight_surfaces().size()); - EXPECT_EQ(1U, available_surfaces().size()); - EXPECT_TRUE(displayed_frame()->texture); - output_surface_->BindFramebuffer(); - EXPECT_EQ(2, CountBuffers()); - CheckUnique(); - EXPECT_TRUE(available_surfaces().empty()); -} - -TEST_F(BufferQueueTest, CheckTripleBuffering) { - // Check buffer flow through triple buffering path. - - // This bit is the same sequence tested in the doublebuffering case. - output_surface_->BindFramebuffer(); - EXPECT_FALSE(displayed_frame()); - SwapBuffers(); - output_surface_->PageFlipComplete(); - output_surface_->BindFramebuffer(); - SwapBuffers(); - - EXPECT_EQ(2, CountBuffers()); - CheckUnique(); - EXPECT_EQ(1U, in_flight_surfaces().size()); - EXPECT_TRUE(displayed_frame()->texture); - output_surface_->BindFramebuffer(); - EXPECT_EQ(3, CountBuffers()); - CheckUnique(); - EXPECT_NE(0U, current_surface()); - EXPECT_EQ(1U, in_flight_surfaces().size()); - EXPECT_TRUE(displayed_frame()->texture); - output_surface_->PageFlipComplete(); - EXPECT_EQ(3, CountBuffers()); - CheckUnique(); - EXPECT_NE(0U, current_surface()); - EXPECT_EQ(0U, in_flight_surfaces().size()); - EXPECT_TRUE(displayed_frame()->texture); - EXPECT_EQ(1U, available_surfaces().size()); -} - -TEST_F(BufferQueueTest, CheckCorrectBufferOrdering) { - const size_t kSwapCount = 3; - for (size_t i = 0; i < kSwapCount; ++i) { - output_surface_->BindFramebuffer(); - SwapBuffers(); - } - - EXPECT_EQ(kSwapCount, in_flight_surfaces().size()); - for (size_t i = 0; i < kSwapCount; ++i) { - unsigned int next_texture_id = in_flight_surfaces().front()->texture; - output_surface_->PageFlipComplete(); - EXPECT_EQ(displayed_frame()->texture, next_texture_id); - } -} - -TEST_F(BufferQueueTest, ReshapeWithInFlightSurfaces) { - const size_t kSwapCount = 3; - for (size_t i = 0; i < kSwapCount; ++i) { - output_surface_->BindFramebuffer(); - SwapBuffers(); - } - - output_surface_->Reshape(gfx::Size(10, 20), 1.0f, gfx::ColorSpace(), false); - EXPECT_EQ(3u, in_flight_surfaces().size()); - - for (size_t i = 0; i < kSwapCount; ++i) { - output_surface_->PageFlipComplete(); - EXPECT_FALSE(displayed_frame()); - } - - // The dummy surfacess left should be discarded. - EXPECT_EQ(0u, available_surfaces().size()); -} - -TEST_F(BufferQueueTest, SwapAfterReshape) { - DCHECK_EQ(0u, gpu_memory_buffer_manager_->set_color_space_count()); - const size_t kSwapCount = 3; - for (size_t i = 0; i < kSwapCount; ++i) { - output_surface_->BindFramebuffer(); - SwapBuffers(); - } - DCHECK_EQ(kSwapCount, gpu_memory_buffer_manager_->set_color_space_count()); - - output_surface_->Reshape(gfx::Size(10, 20), 1.0f, gfx::ColorSpace(), false); - DCHECK_EQ(kSwapCount, gpu_memory_buffer_manager_->set_color_space_count()); - - for (size_t i = 0; i < kSwapCount; ++i) { - output_surface_->BindFramebuffer(); - SwapBuffers(); - } - DCHECK_EQ(2 * kSwapCount, - gpu_memory_buffer_manager_->set_color_space_count()); - EXPECT_EQ(2 * kSwapCount, in_flight_surfaces().size()); - - for (size_t i = 0; i < kSwapCount; ++i) { - output_surface_->PageFlipComplete(); - EXPECT_FALSE(displayed_frame()); - } - - CheckUnique(); - - for (size_t i = 0; i < kSwapCount; ++i) { - unsigned int next_texture_id = in_flight_surfaces().front()->texture; - output_surface_->PageFlipComplete(); - EXPECT_EQ(displayed_frame()->texture, next_texture_id); - EXPECT_TRUE(displayed_frame()); - } - - DCHECK_EQ(2 * kSwapCount, - gpu_memory_buffer_manager_->set_color_space_count()); - for (size_t i = 0; i < kSwapCount; ++i) { - output_surface_->BindFramebuffer(); - SwapBuffers(); - output_surface_->PageFlipComplete(); - } - DCHECK_EQ(2 * kSwapCount, - gpu_memory_buffer_manager_->set_color_space_count()); -} - -TEST_F(BufferQueueMockedContextTest, RecreateBuffers) { - // This setup is to easily get one frame in each of: - // - currently bound for drawing. - // - in flight to GPU. - // - currently displayed. - // - free frame. - // This tests buffers in all states. - // Bind/swap pushes frames into the in flight list, then the PageFlipComplete - // calls pull one frame into displayed and another into the free list. - output_surface_->BindFramebuffer(); - SwapBuffers(); - output_surface_->BindFramebuffer(); - SwapBuffers(); - output_surface_->BindFramebuffer(); - SwapBuffers(); - output_surface_->BindFramebuffer(); - output_surface_->PageFlipComplete(); - output_surface_->PageFlipComplete(); - // We should have one buffer in each possible state right now, including one - // being drawn to. - ASSERT_EQ(1U, in_flight_surfaces().size()); - ASSERT_EQ(1U, available_surfaces().size()); - EXPECT_TRUE(displayed_frame()); - EXPECT_TRUE(current_frame()); - - auto* current = current_frame(); - auto* displayed = displayed_frame(); - auto* in_flight = in_flight_surfaces().front().get(); - auto* available = available_surfaces().front().get(); - - // Expect all 4 images to be destroyed, 3 of the existing textures to be - // copied from and 3 new images to be created. - EXPECT_CALL(*context_, createImageCHROMIUM(_, 0, 0, GL_RGB)).Times(3); - Expectation copy1 = EXPECT_CALL(*mock_output_surface_, - CopyBufferDamage(_, displayed->texture, _, _)) - .Times(1); - Expectation copy2 = EXPECT_CALL(*mock_output_surface_, - CopyBufferDamage(_, current->texture, _, _)) - .Times(1); - Expectation copy3 = EXPECT_CALL(*mock_output_surface_, - CopyBufferDamage(_, in_flight->texture, _, _)) - .Times(1); - - EXPECT_CALL(*context_, destroyImageCHROMIUM(displayed->image)) - .Times(1) - .After(copy1); - EXPECT_CALL(*context_, destroyImageCHROMIUM(current->image)) - .Times(1) - .After(copy2); - EXPECT_CALL(*context_, destroyImageCHROMIUM(in_flight->image)) - .Times(1) - .After(copy3); - EXPECT_CALL(*context_, destroyImageCHROMIUM(available->image)).Times(1); - // After copying, we expect the framebuffer binding to be updated. - EXPECT_CALL(*context_, bindFramebuffer(_, _)) - .After(copy1) - .After(copy2) - .After(copy3); - EXPECT_CALL(*context_, framebufferTexture2D(_, _, _, _, _)) - .After(copy1) - .After(copy2) - .After(copy3); - - output_surface_->RecreateBuffers(); - testing::Mock::VerifyAndClearExpectations(context_); - testing::Mock::VerifyAndClearExpectations(mock_output_surface_); - - // All free buffers should be destroyed, the remaining buffers should all - // be replaced but still valid. - EXPECT_EQ(1U, in_flight_surfaces().size()); - EXPECT_EQ(0U, available_surfaces().size()); - EXPECT_TRUE(displayed_frame()); - EXPECT_TRUE(current_frame()); -} - -TEST_F(BufferQueueTest, AllocateFails) { - output_surface_->Reshape(screen_size, 1.0f, gfx::ColorSpace(), false); - - // Succeed in the two swaps. - output_surface_->BindFramebuffer(); - EXPECT_TRUE(current_frame()); - output_surface_->SwapBuffers(screen_rect); - - // Fail the next surface allocation. - gpu_memory_buffer_manager_->set_allocate_succeeds(false); - output_surface_->BindFramebuffer(); - EXPECT_FALSE(current_frame()); - output_surface_->SwapBuffers(screen_rect); - EXPECT_FALSE(current_frame()); - - // Try another swap. It should copy the buffer damage from the back - // surface. - gpu_memory_buffer_manager_->set_allocate_succeeds(true); - output_surface_->BindFramebuffer(); - unsigned int source_texture = in_flight_surfaces().front()->texture; - unsigned int target_texture = current_frame()->texture; - testing::Mock::VerifyAndClearExpectations(mock_output_surface_); - EXPECT_CALL(*mock_output_surface_, - CopyBufferDamage(target_texture, source_texture, small_damage, _)) - .Times(1); - output_surface_->SwapBuffers(small_damage); - testing::Mock::VerifyAndClearExpectations(mock_output_surface_); - - // Destroy the just-created buffer, and try another swap. The copy should - // come from the displayed surface (because both in-flight surfaces are - // gone now). - output_surface_->PageFlipComplete(); - in_flight_surfaces().back().reset(); - EXPECT_EQ(2u, in_flight_surfaces().size()); - for (auto& surface : in_flight_surfaces()) - EXPECT_FALSE(surface); - output_surface_->BindFramebuffer(); - source_texture = displayed_frame()->texture; - EXPECT_TRUE(current_frame()); - EXPECT_TRUE(displayed_frame()); - target_texture = current_frame()->texture; - testing::Mock::VerifyAndClearExpectations(mock_output_surface_); - EXPECT_CALL(*mock_output_surface_, - CopyBufferDamage(target_texture, source_texture, small_damage, _)) - .Times(1); - output_surface_->SwapBuffers(small_damage); - testing::Mock::VerifyAndClearExpectations(mock_output_surface_); -} - -} // namespace -} // namespace viz
diff --git a/components/viz/service/display_compositor/compositor_overlay_candidate_validator.h b/components/viz/service/display_compositor/compositor_overlay_candidate_validator.h deleted file mode 100644 index 7101bd2..0000000 --- a/components/viz/service/display_compositor/compositor_overlay_candidate_validator.h +++ /dev/null
@@ -1,28 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_H_ -#define COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_H_ - -#include "base/macros.h" -#include "cc/output/overlay_candidate_validator.h" -#include "components/viz/service/viz_service_export.h" - -namespace viz { - -class VIZ_SERVICE_EXPORT CompositorOverlayCandidateValidator - : public cc::OverlayCandidateValidator { - public: - CompositorOverlayCandidateValidator() {} - ~CompositorOverlayCandidateValidator() override {} - - virtual void SetSoftwareMirrorMode(bool enabled) = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(CompositorOverlayCandidateValidator); -}; - -} // namespace viz - -#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_H_
diff --git a/components/viz/service/display_compositor/compositor_overlay_candidate_validator_android.cc b/components/viz/service/display_compositor/compositor_overlay_candidate_validator_android.cc deleted file mode 100644 index 0c68b39..0000000 --- a/components/viz/service/display_compositor/compositor_overlay_candidate_validator_android.cc +++ /dev/null
@@ -1,68 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator_android.h" - -#include <memory> - -#include "base/memory/ptr_util.h" -#include "cc/output/overlay_processor.h" -#include "cc/output/overlay_strategy_underlay.h" -#include "ui/gfx/geometry/rect_conversions.h" - -namespace viz { - -CompositorOverlayCandidateValidatorAndroid:: - CompositorOverlayCandidateValidatorAndroid() {} - -CompositorOverlayCandidateValidatorAndroid:: - ~CompositorOverlayCandidateValidatorAndroid() {} - -void CompositorOverlayCandidateValidatorAndroid::GetStrategies( - cc::OverlayProcessor::StrategyList* strategies) { - strategies->push_back(base::MakeUnique<cc::OverlayStrategyUnderlay>(this)); -} - -void CompositorOverlayCandidateValidatorAndroid::CheckOverlaySupport( - cc::OverlayCandidateList* candidates) { - // There should only be at most a single overlay candidate: the video quad. - // There's no check that the presented candidate is really a video frame for - // a fullscreen video. Instead it's assumed that if a quad is marked as - // overlayable, it's a fullscreen video quad. - DCHECK_LE(candidates->size(), 1u); - - if (!candidates->empty()) { - cc::OverlayCandidate& candidate = candidates->front(); - - // This quad either will be promoted, or would be if it were backed by a - // SurfaceView. Record that it should get a promotion hint. - candidates->AddPromotionHint(candidate); - - if (candidate.is_backed_by_surface_texture) { - // This quad would be promoted if it were backed by a SurfaceView. Since - // it isn't, we can't promote it. - return; - } - - candidate.display_rect = - gfx::RectF(gfx::ToEnclosingRect(candidate.display_rect)); - candidate.overlay_handled = true; - candidate.plane_z_order = -1; - } -} - -bool CompositorOverlayCandidateValidatorAndroid::AllowCALayerOverlays() { - return false; -} - -bool CompositorOverlayCandidateValidatorAndroid::AllowDCLayerOverlays() { - return false; -} - -// Overlays will still be allowed when software mirroring is enabled, even -// though they won't appear in the mirror. -void CompositorOverlayCandidateValidatorAndroid::SetSoftwareMirrorMode( - bool enabled) {} - -} // namespace viz
diff --git a/components/viz/service/display_compositor/compositor_overlay_candidate_validator_android.h b/components/viz/service/display_compositor/compositor_overlay_candidate_validator_android.h deleted file mode 100644 index 4a78513d..0000000 --- a/components/viz/service/display_compositor/compositor_overlay_candidate_validator_android.h +++ /dev/null
@@ -1,41 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_ANDROID_H_ -#define COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_ANDROID_H_ - -#include "base/macros.h" -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator.h" -#include "components/viz/service/viz_service_export.h" - -namespace viz { - -// An overlay validator for supporting fullscreen video underlays on Android. -// Things are a bit different on Android compared with other platforms. By the -// time a video frame is marked as overlayable it means the video decoder was -// outputting to a Surface that we can't read back from. As a result, the -// overlay must always succeed, or the video won't be visible. This is one of of -// the reasons that only fullscreen is supported: we have to be sure that -// nothing will cause the overlay to be rejected, because there's no fallback to -// gl compositing. -class VIZ_SERVICE_EXPORT CompositorOverlayCandidateValidatorAndroid - : public CompositorOverlayCandidateValidator { - public: - CompositorOverlayCandidateValidatorAndroid(); - ~CompositorOverlayCandidateValidatorAndroid() override; - - void GetStrategies(cc::OverlayProcessor::StrategyList* strategies) override; - void CheckOverlaySupport(cc::OverlayCandidateList* surfaces) override; - bool AllowCALayerOverlays() override; - bool AllowDCLayerOverlays() override; - - void SetSoftwareMirrorMode(bool enabled) override; - - private: - DISALLOW_COPY_AND_ASSIGN(CompositorOverlayCandidateValidatorAndroid); -}; - -} // namespace viz - -#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_ANDROID_H_
diff --git a/components/viz/service/display_compositor/compositor_overlay_candidate_validator_mac.h b/components/viz/service/display_compositor/compositor_overlay_candidate_validator_mac.h deleted file mode 100644 index bee638b..0000000 --- a/components/viz/service/display_compositor/compositor_overlay_candidate_validator_mac.h +++ /dev/null
@@ -1,40 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_MAC_H_ -#define COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_MAC_H_ - -#include <memory> - -#include "base/macros.h" -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator.h" -#include "components/viz/service/viz_service_export.h" - -namespace viz { - -class VIZ_SERVICE_EXPORT CompositorOverlayCandidateValidatorMac - : public CompositorOverlayCandidateValidator { - public: - explicit CompositorOverlayCandidateValidatorMac(bool ca_layer_disabled); - ~CompositorOverlayCandidateValidatorMac() override; - - // cc::OverlayCandidateValidator implementation. - void GetStrategies(cc::OverlayProcessor::StrategyList* strategies) override; - bool AllowCALayerOverlays() override; - bool AllowDCLayerOverlays() override; - void CheckOverlaySupport(cc::OverlayCandidateList* surfaces) override; - - // CompositorOverlayCandidateValidator implementation. - void SetSoftwareMirrorMode(bool enabled) override; - - private: - bool software_mirror_active_; - const bool ca_layer_disabled_; - - DISALLOW_COPY_AND_ASSIGN(CompositorOverlayCandidateValidatorMac); -}; - -} // namespace viz - -#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_MAC_H_
diff --git a/components/viz/service/display_compositor/compositor_overlay_candidate_validator_mac.mm b/components/viz/service/display_compositor/compositor_overlay_candidate_validator_mac.mm deleted file mode 100644 index 3175f1f..0000000 --- a/components/viz/service/display_compositor/compositor_overlay_candidate_validator_mac.mm +++ /dev/null
@@ -1,37 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator_mac.h" - -#include <stddef.h> - -namespace viz { - -CompositorOverlayCandidateValidatorMac::CompositorOverlayCandidateValidatorMac( - bool ca_layer_disabled) - : software_mirror_active_(false), ca_layer_disabled_(ca_layer_disabled) {} - -CompositorOverlayCandidateValidatorMac:: - ~CompositorOverlayCandidateValidatorMac() {} - -void CompositorOverlayCandidateValidatorMac::GetStrategies( - cc::OverlayProcessor::StrategyList* strategies) {} - -bool CompositorOverlayCandidateValidatorMac::AllowCALayerOverlays() { - return !ca_layer_disabled_ && !software_mirror_active_; -} - -bool CompositorOverlayCandidateValidatorMac::AllowDCLayerOverlays() { - return false; -} - -void CompositorOverlayCandidateValidatorMac::CheckOverlaySupport( - cc::OverlayCandidateList* surfaces) {} - -void CompositorOverlayCandidateValidatorMac::SetSoftwareMirrorMode( - bool enabled) { - software_mirror_active_ = enabled; -} - -} // namespace viz
diff --git a/components/viz/service/display_compositor/compositor_overlay_candidate_validator_ozone.cc b/components/viz/service/display_compositor/compositor_overlay_candidate_validator_ozone.cc deleted file mode 100644 index ed1a7d8..0000000 --- a/components/viz/service/display_compositor/compositor_overlay_candidate_validator_ozone.cc +++ /dev/null
@@ -1,128 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator_ozone.h" - -#include <stddef.h> - -#include <utility> - -#include "base/bind.h" -#include "base/memory/ptr_util.h" -#include "base/strings/string_split.h" -#include "cc/output/overlay_strategy_fullscreen.h" -#include "cc/output/overlay_strategy_single_on_top.h" -#include "cc/output/overlay_strategy_underlay.h" -#include "cc/output/overlay_strategy_underlay_cast.h" -#include "ui/ozone/public/overlay_candidates_ozone.h" - -namespace viz { -namespace { -// Templated function used to create an OverlayProcessor::Strategy -// of type |S|. -template <typename S> -std::unique_ptr<cc::OverlayProcessor::Strategy> MakeOverlayStrategy( - CompositorOverlayCandidateValidatorOzone* capability_checker) { - return base::MakeUnique<S>(capability_checker); -} - -} // namespace - -// |overlay_candidates| is an object used to answer questions about possible -// overlays configuarations. -// |strategies_string| is a comma-separated string containing all the overaly -// strategies that should be returned by GetStrategies. -// If |strategies_string| is empty "single-on-top,underlay" will be used as -// default. -CompositorOverlayCandidateValidatorOzone:: - CompositorOverlayCandidateValidatorOzone( - std::unique_ptr<ui::OverlayCandidatesOzone> overlay_candidates, - std::string strategies_string) - : overlay_candidates_(std::move(overlay_candidates)), - software_mirror_active_(false) { - if (!strategies_string.length()) - strategies_string = "single-on-top,underlay"; - - for (const auto& strategy_name : - base::SplitStringPiece(strategies_string, ",", base::TRIM_WHITESPACE, - base::SPLIT_WANT_NONEMPTY)) { - if (strategy_name == "single-fullscreen") { - strategies_instantiators_.push_back( - base::Bind(MakeOverlayStrategy<cc::OverlayStrategyFullscreen>)); - } else if (strategy_name == "single-on-top") { - strategies_instantiators_.push_back( - base::Bind(MakeOverlayStrategy<cc::OverlayStrategySingleOnTop>)); - } else if (strategy_name == "underlay") { - strategies_instantiators_.push_back( - base::Bind(MakeOverlayStrategy<cc::OverlayStrategyUnderlay>)); - } else if (strategy_name == "cast") { - strategies_instantiators_.push_back( - base::Bind(MakeOverlayStrategy<cc::OverlayStrategyUnderlayCast>)); - } else { - LOG(WARNING) << "Unrecognized overlay strategy " << strategy_name; - } - } -} - -CompositorOverlayCandidateValidatorOzone:: - ~CompositorOverlayCandidateValidatorOzone() {} - -void CompositorOverlayCandidateValidatorOzone::GetStrategies( - cc::OverlayProcessor::StrategyList* strategies) { - for (auto& instantiator : strategies_instantiators_) - strategies->push_back(instantiator.Run(this)); -} - -bool CompositorOverlayCandidateValidatorOzone::AllowCALayerOverlays() { - return false; -} - -bool CompositorOverlayCandidateValidatorOzone::AllowDCLayerOverlays() { - return false; -} - -void CompositorOverlayCandidateValidatorOzone::CheckOverlaySupport( - cc::OverlayCandidateList* surfaces) { - // SW mirroring copies out of the framebuffer, so we can't remove any - // quads for overlaying, otherwise the output is incorrect. - if (software_mirror_active_) { - for (size_t i = 0; i < surfaces->size(); i++) { - surfaces->at(i).overlay_handled = false; - } - return; - } - - DCHECK_GE(2U, surfaces->size()); - ui::OverlayCandidatesOzone::OverlaySurfaceCandidateList ozone_surface_list; - ozone_surface_list.resize(surfaces->size()); - - for (size_t i = 0; i < surfaces->size(); i++) { - ozone_surface_list.at(i).transform = surfaces->at(i).transform; - ozone_surface_list.at(i).format = surfaces->at(i).format; - ozone_surface_list.at(i).display_rect = surfaces->at(i).display_rect; - ozone_surface_list.at(i).crop_rect = surfaces->at(i).uv_rect; - ozone_surface_list.at(i).quad_rect_in_target_space = - surfaces->at(i).quad_rect_in_target_space; - ozone_surface_list.at(i).clip_rect = surfaces->at(i).clip_rect; - ozone_surface_list.at(i).is_clipped = surfaces->at(i).is_clipped; - ozone_surface_list.at(i).plane_z_order = surfaces->at(i).plane_z_order; - ozone_surface_list.at(i).buffer_size = - surfaces->at(i).resource_size_in_pixels; - } - - overlay_candidates_->CheckOverlaySupport(&ozone_surface_list); - DCHECK_EQ(surfaces->size(), ozone_surface_list.size()); - - for (size_t i = 0; i < surfaces->size(); i++) { - surfaces->at(i).overlay_handled = ozone_surface_list.at(i).overlay_handled; - surfaces->at(i).display_rect = ozone_surface_list.at(i).display_rect; - } -} - -void CompositorOverlayCandidateValidatorOzone::SetSoftwareMirrorMode( - bool enabled) { - software_mirror_active_ = enabled; -} - -} // namespace viz
diff --git a/components/viz/service/display_compositor/compositor_overlay_candidate_validator_ozone.h b/components/viz/service/display_compositor/compositor_overlay_candidate_validator_ozone.h deleted file mode 100644 index c9862cc..0000000 --- a/components/viz/service/display_compositor/compositor_overlay_candidate_validator_ozone.h +++ /dev/null
@@ -1,55 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_OZONE_H_ -#define COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_OZONE_H_ - -#include <memory> - -#include "base/callback.h" -#include "base/macros.h" -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator.h" -#include "components/viz/service/viz_service_export.h" -#include "ui/gfx/native_widget_types.h" - -namespace ui { -class OverlayCandidatesOzone; -} - -namespace viz { - -class VIZ_SERVICE_EXPORT CompositorOverlayCandidateValidatorOzone - : public CompositorOverlayCandidateValidator { - public: - CompositorOverlayCandidateValidatorOzone( - std::unique_ptr<ui::OverlayCandidatesOzone> overlay_candidates, - std::string strategies_string); - ~CompositorOverlayCandidateValidatorOzone() override; - - // cc::OverlayCandidateValidator implementation. - void GetStrategies(cc::OverlayProcessor::StrategyList* strategies) override; - bool AllowCALayerOverlays() override; - bool AllowDCLayerOverlays() override; - void CheckOverlaySupport(cc::OverlayCandidateList* surfaces) override; - - // CompositorOverlayCandidateValidator implementation. - void SetSoftwareMirrorMode(bool enabled) override; - - private: - std::unique_ptr<ui::OverlayCandidatesOzone> overlay_candidates_; - // Callback declaration to allocate a new OverlayProcessor::Strategy. - using StrategyInstantiator = - base::Callback<std::unique_ptr<cc::OverlayProcessor::Strategy>( - CompositorOverlayCandidateValidatorOzone*)>; - // List callbacks used to instantiate OverlayProcessor::Strategy - // as defined by |strategies_string| paramter in the constructor. - std::vector<StrategyInstantiator> strategies_instantiators_; - bool software_mirror_active_; - - DISALLOW_COPY_AND_ASSIGN(CompositorOverlayCandidateValidatorOzone); -}; - -} // namespace viz - -#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_OZONE_H_
diff --git a/components/viz/service/display_compositor/compositor_overlay_candidate_validator_win.cc b/components/viz/service/display_compositor/compositor_overlay_candidate_validator_win.cc deleted file mode 100644 index 88037edb..0000000 --- a/components/viz/service/display_compositor/compositor_overlay_candidate_validator_win.cc +++ /dev/null
@@ -1,39 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator_win.h" - -#include "cc/output/overlay_processor.h" - -namespace viz { - -CompositorOverlayCandidateValidatorWin:: - CompositorOverlayCandidateValidatorWin() {} - -CompositorOverlayCandidateValidatorWin:: - ~CompositorOverlayCandidateValidatorWin() {} - -void CompositorOverlayCandidateValidatorWin::GetStrategies( - cc::OverlayProcessor::StrategyList* strategies) {} - -void CompositorOverlayCandidateValidatorWin::CheckOverlaySupport( - cc::OverlayCandidateList* candidates) { - NOTIMPLEMENTED(); -} - -bool CompositorOverlayCandidateValidatorWin::AllowCALayerOverlays() { - return false; -} - -bool CompositorOverlayCandidateValidatorWin::AllowDCLayerOverlays() { - return true; -} - -void CompositorOverlayCandidateValidatorWin::SetSoftwareMirrorMode( - bool enabled) { - // Software mirroring isn't supported on Windows. - NOTIMPLEMENTED(); -} - -} // namespace viz
diff --git a/components/viz/service/display_compositor/compositor_overlay_candidate_validator_win.h b/components/viz/service/display_compositor/compositor_overlay_candidate_validator_win.h deleted file mode 100644 index 18eaf301..0000000 --- a/components/viz/service/display_compositor/compositor_overlay_candidate_validator_win.h +++ /dev/null
@@ -1,35 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_WIN_H_ -#define COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_WIN_H_ - -#include "base/macros.h" -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator.h" -#include "components/viz/service/viz_service_export.h" - -namespace viz { - -// This is a simple overlay candidate validator that promotes everything -// possible to an overlay. -class VIZ_SERVICE_EXPORT CompositorOverlayCandidateValidatorWin - : public CompositorOverlayCandidateValidator { - public: - CompositorOverlayCandidateValidatorWin(); - ~CompositorOverlayCandidateValidatorWin() override; - - void GetStrategies(cc::OverlayProcessor::StrategyList* strategies) override; - void CheckOverlaySupport(cc::OverlayCandidateList* surfaces) override; - bool AllowCALayerOverlays() override; - bool AllowDCLayerOverlays() override; - - void SetSoftwareMirrorMode(bool enabled) override; - - private: - DISALLOW_COPY_AND_ASSIGN(CompositorOverlayCandidateValidatorWin); -}; - -} // namespace viz - -#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_WIN_H_
diff --git a/components/viz/service/display_compositor/display_output_surface.cc b/components/viz/service/display_compositor/display_output_surface.cc deleted file mode 100644 index 28e026b..0000000 --- a/components/viz/service/display_compositor/display_output_surface.cc +++ /dev/null
@@ -1,148 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/viz/service/display_compositor/display_output_surface.h" - -#include <stdint.h> - -#include "base/bind.h" -#include "base/memory/ptr_util.h" -#include "base/threading/thread_task_runner_handle.h" -#include "cc/output/context_provider.h" -#include "cc/output/output_surface_client.h" -#include "cc/output/output_surface_frame.h" -#include "cc/scheduler/begin_frame_source.h" -#include "gpu/command_buffer/client/context_support.h" -#include "gpu/command_buffer/client/gles2_interface.h" - -namespace viz { - -DisplayOutputSurface::DisplayOutputSurface( - scoped_refptr<cc::InProcessContextProvider> context_provider, - cc::SyntheticBeginFrameSource* synthetic_begin_frame_source) - : cc::OutputSurface(context_provider), - synthetic_begin_frame_source_(synthetic_begin_frame_source), - weak_ptr_factory_(this) { - capabilities_.flipped_output_surface = - context_provider->ContextCapabilities().flips_vertically; - capabilities_.supports_stencil = - context_provider->ContextCapabilities().num_stencil_bits > 0; - context_provider->SetSwapBuffersCompletionCallback( - base::Bind(&DisplayOutputSurface::OnGpuSwapBuffersCompleted, - weak_ptr_factory_.GetWeakPtr())); - context_provider->SetUpdateVSyncParametersCallback( - base::Bind(&DisplayOutputSurface::OnVSyncParametersUpdated, - weak_ptr_factory_.GetWeakPtr())); -} - -DisplayOutputSurface::~DisplayOutputSurface() {} - -void DisplayOutputSurface::BindToClient(cc::OutputSurfaceClient* client) { - DCHECK(client); - DCHECK(!client_); - client_ = client; -} - -void DisplayOutputSurface::EnsureBackbuffer() {} - -void DisplayOutputSurface::DiscardBackbuffer() { - context_provider()->ContextGL()->DiscardBackbufferCHROMIUM(); -} - -void DisplayOutputSurface::BindFramebuffer() { - context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); -} - -void DisplayOutputSurface::SetDrawRectangle(const gfx::Rect& rect) { - if (set_draw_rectangle_for_frame_) - return; - DCHECK(gfx::Rect(size_).Contains(rect)); - DCHECK(has_set_draw_rectangle_since_last_resize_ || - (gfx::Rect(size_) == rect)); - set_draw_rectangle_for_frame_ = true; - has_set_draw_rectangle_since_last_resize_ = true; - context_provider()->ContextGL()->SetDrawRectangleCHROMIUM( - rect.x(), rect.y(), rect.width(), rect.height()); -} - -void DisplayOutputSurface::Reshape(const gfx::Size& size, - float device_scale_factor, - const gfx::ColorSpace& color_space, - bool has_alpha, - bool use_stencil) { - size_ = size; - has_set_draw_rectangle_since_last_resize_ = false; - context_provider()->ContextGL()->ResizeCHROMIUM( - size.width(), size.height(), device_scale_factor, has_alpha); -} - -void DisplayOutputSurface::SwapBuffers(cc::OutputSurfaceFrame frame) { - DCHECK(context_provider_); - - if (frame.latency_info.size() > 0) - context_provider_->ContextSupport()->AddLatencyInfo(frame.latency_info); - - set_draw_rectangle_for_frame_ = false; - if (frame.sub_buffer_rect) { - context_provider_->ContextSupport()->PartialSwapBuffers( - *frame.sub_buffer_rect); - } else { - context_provider_->ContextSupport()->Swap(); - } -} - -uint32_t DisplayOutputSurface::GetFramebufferCopyTextureFormat() { - // TODO(danakj): What attributes are used for the default framebuffer here? - // Can it have alpha? cc::InProcessContextProvider doesn't take any - // attributes. - return GL_RGB; -} - -cc::OverlayCandidateValidator* -DisplayOutputSurface::GetOverlayCandidateValidator() const { - return nullptr; -} - -bool DisplayOutputSurface::IsDisplayedAsOverlayPlane() const { - return false; -} - -unsigned DisplayOutputSurface::GetOverlayTextureId() const { - return 0; -} - -bool DisplayOutputSurface::SurfaceIsSuspendForRecycle() const { - return false; -} - -bool DisplayOutputSurface::HasExternalStencilTest() const { - return false; -} - -void DisplayOutputSurface::ApplyExternalStencil() {} - -void DisplayOutputSurface::DidReceiveSwapBuffersAck(gfx::SwapResult result) { - client_->DidReceiveSwapBuffersAck(); -} - -void DisplayOutputSurface::OnGpuSwapBuffersCompleted( - const std::vector<ui::LatencyInfo>& latency_info, - gfx::SwapResult result, - const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) { - for (const auto& latency : latency_info) { - if (latency.latency_components().size() > 0) - latency_tracker_.OnGpuSwapBuffersCompleted(latency); - } - DidReceiveSwapBuffersAck(result); -} - -void DisplayOutputSurface::OnVSyncParametersUpdated(base::TimeTicks timebase, - base::TimeDelta interval) { - // TODO(brianderson): We should not be receiving 0 intervals. - synthetic_begin_frame_source_->OnUpdateVSyncParameters( - timebase, - interval.is_zero() ? cc::BeginFrameArgs::DefaultInterval() : interval); -} - -} // namespace viz
diff --git a/components/viz/service/display_compositor/display_output_surface.h b/components/viz/service/display_compositor/display_output_surface.h deleted file mode 100644 index c2ce94a..0000000 --- a/components/viz/service/display_compositor/display_output_surface.h +++ /dev/null
@@ -1,78 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_DISPLAY_OUTPUT_SURFACE_H_ -#define COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_DISPLAY_OUTPUT_SURFACE_H_ - -#include <memory> - -#include "cc/output/in_process_context_provider.h" -#include "cc/output/output_surface.h" -#include "ui/latency/latency_tracker.h" - -namespace cc { -class SyntheticBeginFrameSource; -} - -namespace viz { - -// An OutputSurface implementation that directly draws and -// swaps to an actual GL surface. -class DisplayOutputSurface : public cc::OutputSurface { - public: - DisplayOutputSurface( - scoped_refptr<cc::InProcessContextProvider> context_provider, - cc::SyntheticBeginFrameSource* synthetic_begin_frame_source); - ~DisplayOutputSurface() override; - - // cc::OutputSurface implementation - void BindToClient(cc::OutputSurfaceClient* client) override; - void EnsureBackbuffer() override; - void DiscardBackbuffer() override; - void BindFramebuffer() override; - void SetDrawRectangle(const gfx::Rect& draw_rectangle) override; - void Reshape(const gfx::Size& size, - float device_scale_factor, - const gfx::ColorSpace& color_space, - bool has_alpha, - bool use_stencil) override; - void SwapBuffers(cc::OutputSurfaceFrame frame) override; - uint32_t GetFramebufferCopyTextureFormat() override; - cc::OverlayCandidateValidator* GetOverlayCandidateValidator() const override; - bool IsDisplayedAsOverlayPlane() const override; - unsigned GetOverlayTextureId() const override; - bool SurfaceIsSuspendForRecycle() const override; - bool HasExternalStencilTest() const override; - void ApplyExternalStencil() override; - - protected: - cc::OutputSurfaceClient* client() const { return client_; } - - // Called when a swap completion is signaled from ImageTransportSurface. - virtual void DidReceiveSwapBuffersAck(gfx::SwapResult result); - - private: - // Called when a swap completion is signaled from ImageTransportSurface. - void OnGpuSwapBuffersCompleted( - const std::vector<ui::LatencyInfo>& latency_info, - gfx::SwapResult result, - const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac); - void OnVSyncParametersUpdated(base::TimeTicks timebase, - base::TimeDelta interval); - - cc::OutputSurfaceClient* client_ = nullptr; - cc::SyntheticBeginFrameSource* const synthetic_begin_frame_source_; - ui::LatencyTracker latency_tracker_; - - bool set_draw_rectangle_for_frame_ = false; - // True if the draw rectangle has been set at all since the last resize. - bool has_set_draw_rectangle_since_last_resize_ = false; - gfx::Size size_; - - base::WeakPtrFactory<DisplayOutputSurface> weak_ptr_factory_; -}; - -} // namespace viz - -#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_DISPLAY_OUTPUT_SURFACE_H_
diff --git a/components/viz/service/display_compositor/display_output_surface_ozone.cc b/components/viz/service/display_compositor/display_output_surface_ozone.cc deleted file mode 100644 index 8f9bc01ea..0000000 --- a/components/viz/service/display_compositor/display_output_surface_ozone.cc +++ /dev/null
@@ -1,126 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/viz/service/display_compositor/display_output_surface_ozone.h" - -#include <utility> - -#include "base/bind.h" -#include "base/memory/ptr_util.h" -#include "cc/output/context_provider.h" -#include "cc/output/output_surface_client.h" -#include "cc/output/output_surface_frame.h" -#include "cc/scheduler/begin_frame_source.h" -#include "components/viz/service/display_compositor/buffer_queue.h" -#include "gpu/command_buffer/client/context_support.h" -#include "gpu/command_buffer/client/gles2_interface.h" -#include "ui/display/types/display_snapshot.h" - -namespace viz { - -DisplayOutputSurfaceOzone::DisplayOutputSurfaceOzone( - scoped_refptr<cc::InProcessContextProvider> context_provider, - gfx::AcceleratedWidget widget, - cc::SyntheticBeginFrameSource* synthetic_begin_frame_source, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, - uint32_t target, - uint32_t internalformat) - : DisplayOutputSurface(context_provider, synthetic_begin_frame_source), - gl_helper_(context_provider->ContextGL(), - context_provider->ContextSupport()) { - capabilities_.uses_default_gl_framebuffer = false; - capabilities_.flipped_output_surface = true; - // Set |max_frames_pending| to 2 for surfaceless, which aligns scheduling - // more closely with the previous surfaced behavior. - // With a surface, swap buffer ack used to return early, before actually - // presenting the back buffer, enabling the browser compositor to run ahead. - // Surfaceless implementation acks at the time of actual buffer swap, which - // shifts the start of the new frame forward relative to the old - // implementation. - capabilities_.max_frames_pending = 2; - - buffer_queue_.reset( - new BufferQueue(context_provider->ContextGL(), target, internalformat, - display::DisplaySnapshot::PrimaryFormat(), &gl_helper_, - gpu_memory_buffer_manager, widget)); - buffer_queue_->Initialize(); -} - -DisplayOutputSurfaceOzone::~DisplayOutputSurfaceOzone() { - // TODO(rjkroege): Support cleanup. -} - -void DisplayOutputSurfaceOzone::BindFramebuffer() { - DCHECK(buffer_queue_); - buffer_queue_->BindFramebuffer(); -} - -// We call this on every frame that a value changes, but changing the size once -// we've allocated backing NativePixmapOzone instances will cause a DCHECK -// because Chrome never Reshape(s) after the first one from (0,0). NB: this -// implies that screen size changes need to be plumbed differently. In -// particular, we must create the native window in the size that the hardware -// reports. -void DisplayOutputSurfaceOzone::Reshape(const gfx::Size& size, - float device_scale_factor, - const gfx::ColorSpace& color_space, - bool has_alpha, - bool use_stencil) { - reshape_size_ = size; - DisplayOutputSurface::Reshape(size, device_scale_factor, color_space, - has_alpha, use_stencil); - buffer_queue_->Reshape(size, device_scale_factor, color_space, use_stencil); -} - -void DisplayOutputSurfaceOzone::SwapBuffers(cc::OutputSurfaceFrame frame) { - DCHECK(buffer_queue_); - - // TODO(rjkroege): What if swap happens again before DidReceiveSwapBuffersAck - // then it would see the wrong size? - DCHECK(reshape_size_ == frame.size); - swap_size_ = reshape_size_; - - gfx::Rect damage_rect = - frame.sub_buffer_rect ? *frame.sub_buffer_rect : gfx::Rect(swap_size_); - // Use previous buffer when damage rect is empty. This avoids unnecessary - // partial swap work and makes it possible to support empty swaps on devices - // where partial swaps are disabled. - if (!damage_rect.IsEmpty()) - buffer_queue_->SwapBuffers(damage_rect); - - DisplayOutputSurface::SwapBuffers(std::move(frame)); -} - -uint32_t DisplayOutputSurfaceOzone::GetFramebufferCopyTextureFormat() { - return buffer_queue_->internal_format(); -} - -bool DisplayOutputSurfaceOzone::IsDisplayedAsOverlayPlane() const { - // TODO(rjkroege): implement remaining overlay functionality. - return true; -} - -unsigned DisplayOutputSurfaceOzone::GetOverlayTextureId() const { - return buffer_queue_->GetCurrentTextureId(); -} - -void DisplayOutputSurfaceOzone::DidReceiveSwapBuffersAck( - gfx::SwapResult result) { - bool force_swap = false; - if (result == gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS) { - // Even through the swap failed, this is a fixable error so we can pretend - // it succeeded to the rest of the system. - result = gfx::SwapResult::SWAP_ACK; - buffer_queue_->RecreateBuffers(); - force_swap = true; - } - - buffer_queue_->PageFlipComplete(); - client()->DidReceiveSwapBuffersAck(); - - if (force_swap) - client()->SetNeedsRedrawRect(gfx::Rect(swap_size_)); -} - -} // namespace viz
diff --git a/components/viz/service/display_compositor/display_output_surface_ozone.h b/components/viz/service/display_compositor/display_output_surface_ozone.h deleted file mode 100644 index 0e1b4db..0000000 --- a/components/viz/service/display_compositor/display_output_surface_ozone.h +++ /dev/null
@@ -1,78 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_DISPLAY_OUTPUT_SURFACE_OZONE_H_ -#define COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_DISPLAY_OUTPUT_SURFACE_OZONE_H_ - -#include <memory> - -#include "base/memory/weak_ptr.h" -#include "cc/output/context_provider.h" -#include "cc/output/in_process_context_provider.h" -#include "cc/output/output_surface.h" -#include "components/viz/common/gl_helper.h" -#include "components/viz/service/display_compositor/display_output_surface.h" -#include "ui/gfx/geometry/size.h" -#include "ui/gfx/native_widget_types.h" -#include "ui/gfx/swap_result.h" -#include "ui/gl/gl_surface.h" - -namespace cc { -class SyntheticBeginFrameSource; -} - -namespace gpu { -class GpuMemoryBufferManager; -} - -namespace viz { - -class BufferQueue; - -// An OutputSurface implementation that directly draws and swap to a GL -// "surfaceless" surface (aka one backed by a buffer managed explicitly in -// mus/ozone. This class is adapted from -// GpuSurfacelessBrowserCompositorOutputSurface. -class DisplayOutputSurfaceOzone : public DisplayOutputSurface { - public: - DisplayOutputSurfaceOzone( - scoped_refptr<cc::InProcessContextProvider> context_provider, - gfx::AcceleratedWidget widget, - cc::SyntheticBeginFrameSource* synthetic_begin_frame_source, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, - uint32_t target, - uint32_t internalformat); - - ~DisplayOutputSurfaceOzone() override; - - // TODO(rjkroege): Implement the equivalent of Reflector. - - private: - // cc::OutputSurface implementation. - void BindFramebuffer() override; - void Reshape(const gfx::Size& size, - float device_scale_factor, - const gfx::ColorSpace& color_space, - bool has_alpha, - bool use_stencil) override; - void SwapBuffers(cc::OutputSurfaceFrame frame) override; - uint32_t GetFramebufferCopyTextureFormat() override; - bool IsDisplayedAsOverlayPlane() const override; - unsigned GetOverlayTextureId() const override; - - // DisplayOutputSurface: - void DidReceiveSwapBuffersAck(gfx::SwapResult result) override; - - GLHelper gl_helper_; - std::unique_ptr<BufferQueue> buffer_queue_; - - gfx::Size reshape_size_; - gfx::Size swap_size_; - - DISALLOW_COPY_AND_ASSIGN(DisplayOutputSurfaceOzone); -}; - -} // namespace viz - -#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_DISPLAY_OUTPUT_SURFACE_OZONE_H_
diff --git a/components/viz/service/display_compositor/display_provider.h b/components/viz/service/display_compositor/display_provider.h deleted file mode 100644 index 07442d16..0000000 --- a/components/viz/service/display_compositor/display_provider.h +++ /dev/null
@@ -1,36 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_DISPLAY_PROVIDER_H_ -#define COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_DISPLAY_PROVIDER_H_ - -#include <memory> - -#include "gpu/ipc/common/surface_handle.h" - -namespace cc { -class BeginFrameSource; -class Display; -class FrameSinkId; -} - -namespace viz { - -// Handles creating new cc::Displays and related classes for -// FrameSinkManagerImpl. -class DisplayProvider { - public: - virtual ~DisplayProvider() {} - - // Creates a new cc::Display for |surface_handle| with |frame_sink_id|. Will - // also create cc::BeginFrameSource and return it in |begin_frame_source|. - virtual std::unique_ptr<cc::Display> CreateDisplay( - const cc::FrameSinkId& frame_sink_id, - gpu::SurfaceHandle surface_handle, - std::unique_ptr<cc::BeginFrameSource>* begin_frame_source) = 0; -}; - -} // namespace viz - -#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_DISPLAY_PROVIDER_H_
diff --git a/components/viz/service/display_compositor/gpu_display_provider.cc b/components/viz/service/display_compositor/gpu_display_provider.cc deleted file mode 100644 index 683daf0..0000000 --- a/components/viz/service/display_compositor/gpu_display_provider.cc +++ /dev/null
@@ -1,109 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/viz/service/display_compositor/gpu_display_provider.h" - -#include <utility> - -#include "base/command_line.h" -#include "base/memory/ptr_util.h" -#include "base/threading/thread_task_runner_handle.h" -#include "cc/base/switches.h" -#include "cc/output/in_process_context_provider.h" -#include "cc/output/texture_mailbox_deleter.h" -#include "cc/scheduler/begin_frame_source.h" -#include "cc/surfaces/display.h" -#include "cc/surfaces/display_scheduler.h" -#include "components/viz/service/display_compositor/display_output_surface.h" -#include "components/viz/service/display_compositor/in_process_gpu_memory_buffer_manager.h" -#include "components/viz/service/display_compositor/server_shared_bitmap_manager.h" -#include "gpu/command_buffer/client/shared_memory_limits.h" -#include "gpu/command_buffer/service/image_factory.h" -#include "gpu/ipc/service/gpu_channel_manager.h" -#include "gpu/ipc/service/gpu_memory_buffer_factory.h" - -#if defined(USE_OZONE) -#include "components/viz/service/display_compositor/display_output_surface_ozone.h" -#include "gpu/command_buffer/client/gles2_interface.h" -#endif - -namespace { - -gpu::ImageFactory* GetImageFactory(gpu::GpuChannelManager* channel_manager) { - auto* buffer_factory = channel_manager->gpu_memory_buffer_factory(); - return buffer_factory ? buffer_factory->AsImageFactory() : nullptr; -} - -} // namespace - -namespace viz { - -GpuDisplayProvider::GpuDisplayProvider( - scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service, - gpu::GpuChannelManager* gpu_channel_manager) - : gpu_service_(std::move(gpu_service)), - gpu_memory_buffer_manager_( - base::MakeUnique<InProcessGpuMemoryBufferManager>( - gpu_channel_manager)), - image_factory_(GetImageFactory(gpu_channel_manager)), - task_runner_(base::ThreadTaskRunnerHandle::Get()) {} - -GpuDisplayProvider::~GpuDisplayProvider() = default; - -std::unique_ptr<cc::Display> GpuDisplayProvider::CreateDisplay( - const cc::FrameSinkId& frame_sink_id, - gpu::SurfaceHandle surface_handle, - std::unique_ptr<cc::BeginFrameSource>* begin_frame_source) { - auto synthetic_begin_frame_source = - base::MakeUnique<cc::DelayBasedBeginFrameSource>( - base::MakeUnique<cc::DelayBasedTimeSource>(task_runner_.get())); - - scoped_refptr<cc::InProcessContextProvider> context_provider = - new cc::InProcessContextProvider( - gpu_service_, surface_handle, gpu_memory_buffer_manager_.get(), - image_factory_, gpu::SharedMemoryLimits(), - nullptr /* shared_context */); - - // TODO(rjkroege): If there is something better to do than CHECK, add it. - CHECK(context_provider->BindToCurrentThread()); - - std::unique_ptr<cc::OutputSurface> display_output_surface; - if (context_provider->ContextCapabilities().surfaceless) { -#if defined(USE_OZONE) - display_output_surface = base::MakeUnique<DisplayOutputSurfaceOzone>( - std::move(context_provider), surface_handle, - synthetic_begin_frame_source.get(), gpu_memory_buffer_manager_.get(), - GL_TEXTURE_2D, GL_RGB); -#else - NOTREACHED(); -#endif - } else { - display_output_surface = base::MakeUnique<DisplayOutputSurface>( - std::move(context_provider), synthetic_begin_frame_source.get()); - } - - int max_frames_pending = - display_output_surface->capabilities().max_frames_pending; - DCHECK_GT(max_frames_pending, 0); - - auto scheduler = base::MakeUnique<cc::DisplayScheduler>( - synthetic_begin_frame_source.get(), task_runner_.get(), - max_frames_pending); - - cc::RendererSettings settings; - settings.show_overdraw_feedback = - base::CommandLine::ForCurrentProcess()->HasSwitch( - cc::switches::kShowOverdrawFeedback); - - // The ownership of the BeginFrameSource is transfered to the caller. - *begin_frame_source = std::move(synthetic_begin_frame_source); - - return base::MakeUnique<cc::Display>( - ServerSharedBitmapManager::current(), gpu_memory_buffer_manager_.get(), - settings, frame_sink_id, std::move(display_output_surface), - std::move(scheduler), - base::MakeUnique<cc::TextureMailboxDeleter>(task_runner_.get())); -} - -} // namespace viz
diff --git a/components/viz/service/display_compositor/gpu_display_provider.h b/components/viz/service/display_compositor/gpu_display_provider.h deleted file mode 100644 index ab936fe..0000000 --- a/components/viz/service/display_compositor/gpu_display_provider.h +++ /dev/null
@@ -1,54 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_GPU_DISPLAY_PROVIDER_H_ -#define COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_GPU_DISPLAY_PROVIDER_H_ - -#include <memory> - -#include "base/compiler_specific.h" -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "cc/surfaces/frame_sink_id.h" -#include "components/viz/service/display_compositor/display_provider.h" -#include "components/viz/service/viz_service_export.h" -#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" -#include "gpu/ipc/common/surface_handle.h" -#include "gpu/ipc/in_process_command_buffer.h" - -namespace gpu { -class GpuChannelManager; -class ImageFactory; -} - -namespace viz { - -// In-process implementation of DisplayProvider. -class VIZ_SERVICE_EXPORT GpuDisplayProvider - : public NON_EXPORTED_BASE(DisplayProvider) { - public: - GpuDisplayProvider( - scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service, - gpu::GpuChannelManager* gpu_channel_manager); - ~GpuDisplayProvider() override; - - // DisplayProvider: - std::unique_ptr<cc::Display> CreateDisplay( - const cc::FrameSinkId& frame_sink_id, - gpu::SurfaceHandle surface_handle, - std::unique_ptr<cc::BeginFrameSource>* begin_frame_source) override; - - private: - scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service_; - std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager_; - gpu::ImageFactory* image_factory_; - - scoped_refptr<base::SingleThreadTaskRunner> task_runner_; - - DISALLOW_COPY_AND_ASSIGN(GpuDisplayProvider); -}; - -} // namespace viz - -#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_GPU_DISPLAY_PROVIDER_H_
diff --git a/components/viz/service/display_compositor/in_process_gpu_memory_buffer_manager.cc b/components/viz/service/display_compositor/in_process_gpu_memory_buffer_manager.cc deleted file mode 100644 index 26f0015f..0000000 --- a/components/viz/service/display_compositor/in_process_gpu_memory_buffer_manager.cc +++ /dev/null
@@ -1,51 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/viz/service/display_compositor/in_process_gpu_memory_buffer_manager.h" - -#include "gpu/ipc/client/gpu_memory_buffer_impl.h" -#include "gpu/ipc/service/gpu_channel_manager.h" -#include "gpu/ipc/service/gpu_memory_buffer_factory.h" - -namespace viz { - -InProcessGpuMemoryBufferManager::InProcessGpuMemoryBufferManager( - gpu::GpuChannelManager* channel_manager) - : client_id_(1), channel_manager_(channel_manager), weak_factory_(this) { - weak_ptr_ = weak_factory_.GetWeakPtr(); -} - -InProcessGpuMemoryBufferManager::~InProcessGpuMemoryBufferManager() {} - -std::unique_ptr<gfx::GpuMemoryBuffer> -InProcessGpuMemoryBufferManager::CreateGpuMemoryBuffer( - const gfx::Size& size, - gfx::BufferFormat format, - gfx::BufferUsage usage, - gpu::SurfaceHandle surface_handle) { - gfx::GpuMemoryBufferId id(next_gpu_memory_id_++); - gfx::GpuMemoryBufferHandle buffer_handle = - channel_manager_->gpu_memory_buffer_factory()->CreateGpuMemoryBuffer( - id, size, format, usage, client_id_, surface_handle); - return gpu::GpuMemoryBufferImpl::CreateFromHandle( - buffer_handle, size, format, usage, - base::Bind(&InProcessGpuMemoryBufferManager::DestroyGpuMemoryBuffer, - weak_ptr_, id, client_id_)); -} - -void InProcessGpuMemoryBufferManager::SetDestructionSyncToken( - gfx::GpuMemoryBuffer* buffer, - const gpu::SyncToken& sync_token) { - static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token( - sync_token); -} - -void InProcessGpuMemoryBufferManager::DestroyGpuMemoryBuffer( - gfx::GpuMemoryBufferId id, - int client_id, - const gpu::SyncToken& sync_token) { - channel_manager_->DestroyGpuMemoryBuffer(id, client_id, sync_token); -} - -} // namespace viz
diff --git a/components/viz/service/display_compositor/in_process_gpu_memory_buffer_manager.h b/components/viz/service/display_compositor/in_process_gpu_memory_buffer_manager.h deleted file mode 100644 index 4be5c8c..0000000 --- a/components/viz/service/display_compositor/in_process_gpu_memory_buffer_manager.h +++ /dev/null
@@ -1,47 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_IN_PROCESS_GPU_MEMORY_BUFFER_MANAGER_H_ -#define COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_IN_PROCESS_GPU_MEMORY_BUFFER_MANAGER_H_ - -#include "base/memory/weak_ptr.h" -#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" - -namespace gpu { -class GpuChannelManager; -} - -namespace viz { - -class InProcessGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager { - public: - explicit InProcessGpuMemoryBufferManager( - gpu::GpuChannelManager* channel_manager); - - ~InProcessGpuMemoryBufferManager() override; - - // gpu::GpuMemoryBufferManager: - std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( - const gfx::Size& size, - gfx::BufferFormat format, - gfx::BufferUsage usage, - gpu::SurfaceHandle surface_handle) override; - void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, - const gpu::SyncToken& sync_token) override; - - private: - void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, - int client_id, - const gpu::SyncToken& sync_token); - const int client_id_; - int next_gpu_memory_id_ = 1; - gpu::GpuChannelManager* channel_manager_; - base::WeakPtr<InProcessGpuMemoryBufferManager> weak_ptr_; - base::WeakPtrFactory<InProcessGpuMemoryBufferManager> weak_factory_; - DISALLOW_COPY_AND_ASSIGN(InProcessGpuMemoryBufferManager); -}; - -} // namespace viz - -#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_IN_PROCESS_GPU_MEMORY_BUFFER_MANAGER_H_
diff --git a/components/viz/service/display_compositor/server_shared_bitmap_manager.cc b/components/viz/service/display_compositor/server_shared_bitmap_manager.cc deleted file mode 100644 index ae9cd9a..0000000 --- a/components/viz/service/display_compositor/server_shared_bitmap_manager.cc +++ /dev/null
@@ -1,191 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/viz/service/display_compositor/server_shared_bitmap_manager.h" - -#include <stdint.h> - -#include <utility> - -#include "base/lazy_instance.h" -#include "base/macros.h" -#include "base/memory/ptr_util.h" -#include "base/memory/ref_counted.h" -#include "base/strings/string_number_conversions.h" -#include "base/strings/stringprintf.h" -#include "base/trace_event/process_memory_dump.h" -#include "ui/gfx/geometry/size.h" - -namespace viz { - -class BitmapData : public base::RefCountedThreadSafe<BitmapData> { - public: - explicit BitmapData(size_t buffer_size) : buffer_size(buffer_size) {} - std::unique_ptr<base::SharedMemory> memory; - std::unique_ptr<uint8_t[]> pixels; - size_t buffer_size; - - private: - friend class base::RefCountedThreadSafe<BitmapData>; - ~BitmapData() {} - DISALLOW_COPY_AND_ASSIGN(BitmapData); -}; - -namespace { - -class ServerSharedBitmap : public cc::SharedBitmap { - public: - ServerSharedBitmap(uint8_t* pixels, - scoped_refptr<BitmapData> bitmap_data, - const cc::SharedBitmapId& id, - ServerSharedBitmapManager* manager) - : SharedBitmap(pixels, id), - bitmap_data_(bitmap_data), - manager_(manager) {} - - ~ServerSharedBitmap() override { - if (manager_) - manager_->FreeSharedMemoryFromMap(id()); - } - - // cc::SharedBitmap: - base::SharedMemoryHandle GetSharedMemoryHandle() const override { - if (!bitmap_data_->memory) - return base::SharedMemoryHandle(); - return bitmap_data_->memory->handle(); - } - - private: - scoped_refptr<BitmapData> bitmap_data_; - ServerSharedBitmapManager* manager_; -}; - -} // namespace - -base::LazyInstance<ServerSharedBitmapManager>::DestructorAtExit - g_shared_memory_manager = LAZY_INSTANCE_INITIALIZER; - -ServerSharedBitmapManager::ServerSharedBitmapManager() = default; - -ServerSharedBitmapManager::~ServerSharedBitmapManager() { - DCHECK(handle_map_.empty()); -} - -ServerSharedBitmapManager* ServerSharedBitmapManager::current() { - return g_shared_memory_manager.Pointer(); -} - -std::unique_ptr<cc::SharedBitmap> -ServerSharedBitmapManager::AllocateSharedBitmap(const gfx::Size& size) { - base::AutoLock lock(lock_); - size_t bitmap_size; - if (!cc::SharedBitmap::SizeInBytes(size, &bitmap_size)) - return nullptr; - - scoped_refptr<BitmapData> data(new BitmapData(bitmap_size)); - // Bitmaps allocated in server don't need to be shared to other processes, so - // allocate them with new instead. - data->pixels = std::unique_ptr<uint8_t[]>(new uint8_t[bitmap_size]); - - cc::SharedBitmapId id = cc::SharedBitmap::GenerateId(); - handle_map_[id] = data; - return base::MakeUnique<ServerSharedBitmap>(data->pixels.get(), data, id, - this); -} - -std::unique_ptr<cc::SharedBitmap> -ServerSharedBitmapManager::GetSharedBitmapFromId(const gfx::Size& size, - const cc::SharedBitmapId& id) { - base::AutoLock lock(lock_); - auto it = handle_map_.find(id); - if (it == handle_map_.end()) - return nullptr; - - BitmapData* data = it->second.get(); - - size_t bitmap_size; - if (!cc::SharedBitmap::SizeInBytes(size, &bitmap_size) || - bitmap_size > data->buffer_size) - return nullptr; - - if (data->pixels) { - return base::MakeUnique<ServerSharedBitmap>(data->pixels.get(), data, id, - nullptr); - } - if (!data->memory->memory()) { - return nullptr; - } - - return base::MakeUnique<ServerSharedBitmap>( - static_cast<uint8_t*>(data->memory->memory()), data, id, nullptr); -} - -bool ServerSharedBitmapManager::OnMemoryDump( - const base::trace_event::MemoryDumpArgs& args, - base::trace_event::ProcessMemoryDump* pmd) { - base::AutoLock lock(lock_); - - for (const auto& bitmap : handle_map_) { - base::trace_event::MemoryAllocatorDump* dump = - pmd->CreateAllocatorDump(base::StringPrintf( - "sharedbitmap/%s", - base::HexEncode(bitmap.first.name, sizeof(bitmap.first.name)) - .c_str())); - if (!dump) - return false; - - dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, - base::trace_event::MemoryAllocatorDump::kUnitsBytes, - bitmap.second->buffer_size); - - // Generate a global GUID used to share this allocation with renderer - // processes. - auto guid = cc::GetSharedBitmapGUIDForTracing(bitmap.first); - base::UnguessableToken shared_memory_guid; - if (bitmap.second->memory) { - shared_memory_guid = bitmap.second->memory->handle().GetGUID(); - pmd->CreateSharedMemoryOwnershipEdge( - dump->guid(), guid, shared_memory_guid, 0 /* importance*/); - } else { - pmd->CreateSharedGlobalAllocatorDump(guid); - pmd->AddOwnershipEdge(dump->guid(), guid); - } - } - - return true; -} - -bool ServerSharedBitmapManager::ChildAllocatedSharedBitmap( - size_t buffer_size, - const base::SharedMemoryHandle& handle, - const cc::SharedBitmapId& id) { - base::AutoLock lock(lock_); - if (handle_map_.find(id) != handle_map_.end()) - return false; - auto data = base::MakeRefCounted<BitmapData>(buffer_size); - data->memory = base::MakeUnique<base::SharedMemory>(handle, false); - data->memory->Map(data->buffer_size); - data->memory->Close(); - handle_map_[id] = std::move(data); - return true; -} - -void ServerSharedBitmapManager::ChildDeletedSharedBitmap( - const cc::SharedBitmapId& id) { - base::AutoLock lock(lock_); - handle_map_.erase(id); -} - -size_t ServerSharedBitmapManager::AllocatedBitmapCount() const { - base::AutoLock lock(lock_); - return handle_map_.size(); -} - -void ServerSharedBitmapManager::FreeSharedMemoryFromMap( - const cc::SharedBitmapId& id) { - base::AutoLock lock(lock_); - handle_map_.erase(id); -} - -} // namespace viz
diff --git a/components/viz/service/display_compositor/server_shared_bitmap_manager.h b/components/viz/service/display_compositor/server_shared_bitmap_manager.h deleted file mode 100644 index 3908634..0000000 --- a/components/viz/service/display_compositor/server_shared_bitmap_manager.h +++ /dev/null
@@ -1,71 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_SERVER_SHARED_BITMAP_MANAGER_H_ -#define COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_SERVER_SHARED_BITMAP_MANAGER_H_ - -#include <memory> -#include <unordered_map> - -#include "base/memory/ref_counted.h" -#include "base/memory/shared_memory.h" -#include "base/synchronization/lock.h" -#include "base/trace_event/memory_dump_provider.h" -#include "cc/resources/shared_bitmap_manager.h" -#include "components/viz/service/viz_service_export.h" - -namespace viz { -class BitmapData; - -// A SharedBitmapManager implementation that lives in-process with the -// display compositor. It returns SharedBitmaps that can be transported -// over Mojo/IPC to the display compositor, but which are backed by -// non-shared memory. This is a cheaper implementation by using -// malloc/free, but can only be used in the same process as the display -// compositor. -class VIZ_SERVICE_EXPORT ServerSharedBitmapManager - : public cc::SharedBitmapManager, - public base::trace_event::MemoryDumpProvider { - public: - ServerSharedBitmapManager(); - ~ServerSharedBitmapManager() override; - - static ServerSharedBitmapManager* current(); - - // cc::SharedBitmapManager implementation. - std::unique_ptr<cc::SharedBitmap> AllocateSharedBitmap( - const gfx::Size& size) override; - std::unique_ptr<cc::SharedBitmap> GetSharedBitmapFromId( - const gfx::Size& size, - const cc::SharedBitmapId&) override; - - // base::trace_event::MemoryDumpProvider implementation. - bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, - base::trace_event::ProcessMemoryDump* pmd) override; - - size_t AllocatedBitmapCount() const; - - void FreeSharedMemoryFromMap(const cc::SharedBitmapId& id); - - private: - friend class SharedBitmapAllocationNotifierImpl; - - bool ChildAllocatedSharedBitmap(size_t buffer_size, - const base::SharedMemoryHandle& handle, - const cc::SharedBitmapId& id); - void ChildDeletedSharedBitmap(const cc::SharedBitmapId& id); - - mutable base::Lock lock_; - - std::unordered_map<cc::SharedBitmapId, - scoped_refptr<BitmapData>, - cc::SharedBitmapIdHash> - handle_map_; - - DISALLOW_COPY_AND_ASSIGN(ServerSharedBitmapManager); -}; - -} // namespace viz - -#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_SERVER_SHARED_BITMAP_MANAGER_H_
diff --git a/components/viz/service/display_compositor/server_shared_bitmap_manager_unittest.cc b/components/viz/service/display_compositor/server_shared_bitmap_manager_unittest.cc deleted file mode 100644 index 87da76e..0000000 --- a/components/viz/service/display_compositor/server_shared_bitmap_manager_unittest.cc +++ /dev/null
@@ -1,169 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/viz/service/display_compositor/server_shared_bitmap_manager.h" - -#include "base/memory/ptr_util.h" -#include "components/viz/service/display_compositor/shared_bitmap_allocation_notifier_impl.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace viz { -namespace { - -class ServerSharedBitmapManagerTest : public testing::Test { - protected: - void SetUp() override { - manager_ = base::MakeUnique<ServerSharedBitmapManager>(); - } - - void TearDown() override { manager_.reset(); } - - ServerSharedBitmapManager* manager() const { return manager_.get(); } - - private: - std::unique_ptr<ServerSharedBitmapManager> manager_; -}; - -TEST_F(ServerSharedBitmapManagerTest, TestCreate) { - gfx::Size bitmap_size(1, 1); - size_t size_in_bytes; - EXPECT_TRUE(cc::SharedBitmap::SizeInBytes(bitmap_size, &size_in_bytes)); - std::unique_ptr<base::SharedMemory> bitmap(new base::SharedMemory()); - bitmap->CreateAndMapAnonymous(size_in_bytes); - memset(bitmap->memory(), 0xff, size_in_bytes); - cc::SharedBitmapId id = cc::SharedBitmap::GenerateId(); - - SharedBitmapAllocationNotifierImpl notifier(manager()); - base::SharedMemoryHandle handle = bitmap->handle().Duplicate(); - notifier.ChildAllocatedSharedBitmap(size_in_bytes, handle, id); - - std::unique_ptr<cc::SharedBitmap> large_bitmap; - large_bitmap = manager()->GetSharedBitmapFromId(gfx::Size(1024, 1024), id); - EXPECT_TRUE(large_bitmap.get() == NULL); - - std::unique_ptr<cc::SharedBitmap> very_large_bitmap; - very_large_bitmap = - manager()->GetSharedBitmapFromId(gfx::Size(1, (1 << 30) | 1), id); - EXPECT_TRUE(very_large_bitmap.get() == NULL); - - std::unique_ptr<cc::SharedBitmap> negative_size_bitmap; - negative_size_bitmap = - manager()->GetSharedBitmapFromId(gfx::Size(-1, 1024), id); - EXPECT_TRUE(negative_size_bitmap.get() == NULL); - - cc::SharedBitmapId id2 = cc::SharedBitmap::GenerateId(); - std::unique_ptr<cc::SharedBitmap> invalid_bitmap; - invalid_bitmap = manager()->GetSharedBitmapFromId(bitmap_size, id2); - EXPECT_TRUE(invalid_bitmap.get() == NULL); - - std::unique_ptr<cc::SharedBitmap> shared_bitmap; - shared_bitmap = manager()->GetSharedBitmapFromId(bitmap_size, id); - ASSERT_TRUE(shared_bitmap.get() != NULL); - EXPECT_EQ(memcmp(shared_bitmap->pixels(), bitmap->memory(), 4), 0); - - std::unique_ptr<cc::SharedBitmap> large_bitmap2; - large_bitmap2 = manager()->GetSharedBitmapFromId(gfx::Size(1024, 1024), id); - EXPECT_TRUE(large_bitmap2.get() == NULL); - - std::unique_ptr<cc::SharedBitmap> shared_bitmap2; - shared_bitmap2 = manager()->GetSharedBitmapFromId(bitmap_size, id); - EXPECT_TRUE(shared_bitmap2->pixels() == shared_bitmap->pixels()); - shared_bitmap2.reset(); - EXPECT_EQ(memcmp(shared_bitmap->pixels(), bitmap->memory(), size_in_bytes), - 0); - - notifier.DidDeleteSharedBitmap(id); - - memset(bitmap->memory(), 0, size_in_bytes); - - EXPECT_EQ(memcmp(shared_bitmap->pixels(), bitmap->memory(), size_in_bytes), - 0); - bitmap.reset(); - shared_bitmap.reset(); -} - -TEST_F(ServerSharedBitmapManagerTest, ServiceDestroyed) { - gfx::Size bitmap_size(1, 1); - size_t size_in_bytes; - EXPECT_TRUE(cc::SharedBitmap::SizeInBytes(bitmap_size, &size_in_bytes)); - std::unique_ptr<base::SharedMemory> bitmap(new base::SharedMemory()); - bitmap->CreateAndMapAnonymous(size_in_bytes); - memset(bitmap->memory(), 0xff, size_in_bytes); - cc::SharedBitmapId id = cc::SharedBitmap::GenerateId(); - - // This outlives the SharedBitmapAllocationNotifier. - std::unique_ptr<cc::SharedBitmap> shared_bitmap; - - { - SharedBitmapAllocationNotifierImpl notifier(manager()); - base::SharedMemoryHandle handle = bitmap->handle().Duplicate(); - notifier.ChildAllocatedSharedBitmap(size_in_bytes, handle, id); - - shared_bitmap = manager()->GetSharedBitmapFromId(bitmap_size, id); - ASSERT_TRUE(shared_bitmap.get() != NULL); - - EXPECT_EQ(1u, manager()->AllocatedBitmapCount()); - } - EXPECT_EQ(0u, manager()->AllocatedBitmapCount()); - - std::unique_ptr<cc::SharedBitmap> shared_bitmap2; - shared_bitmap2 = manager()->GetSharedBitmapFromId(bitmap_size, id); - EXPECT_FALSE(!!shared_bitmap2); - EXPECT_EQ(memcmp(shared_bitmap->pixels(), bitmap->memory(), size_in_bytes), - 0); -} - -TEST_F(ServerSharedBitmapManagerTest, AddDuplicate) { - gfx::Size bitmap_size(1, 1); - size_t size_in_bytes; - EXPECT_TRUE(cc::SharedBitmap::SizeInBytes(bitmap_size, &size_in_bytes)); - std::unique_ptr<base::SharedMemory> bitmap(new base::SharedMemory()); - bitmap->CreateAndMapAnonymous(size_in_bytes); - memset(bitmap->memory(), 0xff, size_in_bytes); - cc::SharedBitmapId id = cc::SharedBitmap::GenerateId(); - - SharedBitmapAllocationNotifierImpl notifier(manager()); - - base::SharedMemoryHandle handle = bitmap->handle().Duplicate(); - notifier.ChildAllocatedSharedBitmap(size_in_bytes, handle, id); - - std::unique_ptr<base::SharedMemory> bitmap2(new base::SharedMemory()); - bitmap2->CreateAndMapAnonymous(size_in_bytes); - memset(bitmap2->memory(), 0x00, size_in_bytes); - - notifier.ChildAllocatedSharedBitmap(size_in_bytes, bitmap2->handle(), id); - - std::unique_ptr<cc::SharedBitmap> shared_bitmap; - shared_bitmap = manager()->GetSharedBitmapFromId(bitmap_size, id); - ASSERT_TRUE(shared_bitmap.get() != NULL); - EXPECT_EQ(memcmp(shared_bitmap->pixels(), bitmap->memory(), size_in_bytes), - 0); - notifier.DidDeleteSharedBitmap(id); -} - -TEST_F(ServerSharedBitmapManagerTest, SharedMemoryHandle) { - gfx::Size bitmap_size(1, 1); - size_t size_in_bytes; - EXPECT_TRUE(cc::SharedBitmap::SizeInBytes(bitmap_size, &size_in_bytes)); - std::unique_ptr<base::SharedMemory> bitmap(new base::SharedMemory()); - auto shared_memory_guid = bitmap->handle().GetGUID(); - bitmap->CreateAndMapAnonymous(size_in_bytes); - memset(bitmap->memory(), 0xff, size_in_bytes); - cc::SharedBitmapId id = cc::SharedBitmap::GenerateId(); - - SharedBitmapAllocationNotifierImpl notifier(manager()); - - base::SharedMemoryHandle handle = bitmap->handle().Duplicate(); - notifier.ChildAllocatedSharedBitmap(size_in_bytes, handle, id); - - std::unique_ptr<cc::SharedBitmap> shared_bitmap; - shared_bitmap = manager()->GetSharedBitmapFromId(gfx::Size(1, 1), id); - EXPECT_EQ(shared_bitmap->GetSharedMemoryHandle().GetGUID(), - shared_memory_guid); - - notifier.DidDeleteSharedBitmap(id); -} - -} // namespace -} // namespace viz
diff --git a/components/viz/service/display_compositor/shared_bitmap_allocation_notifier_impl.cc b/components/viz/service/display_compositor/shared_bitmap_allocation_notifier_impl.cc deleted file mode 100644 index 5e102f04..0000000 --- a/components/viz/service/display_compositor/shared_bitmap_allocation_notifier_impl.cc +++ /dev/null
@@ -1,51 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/viz/service/display_compositor/shared_bitmap_allocation_notifier_impl.h" - -#include "components/viz/service/display_compositor/server_shared_bitmap_manager.h" -#include "mojo/public/cpp/system/platform_handle.h" - -namespace viz { - -SharedBitmapAllocationNotifierImpl::SharedBitmapAllocationNotifierImpl( - ServerSharedBitmapManager* manager) - : manager_(manager), binding_(this) {} - -SharedBitmapAllocationNotifierImpl::~SharedBitmapAllocationNotifierImpl() { - for (const auto& id : owned_bitmaps_) - manager_->ChildDeletedSharedBitmap(id); -} - -void SharedBitmapAllocationNotifierImpl::Bind( - cc::mojom::SharedBitmapAllocationNotifierAssociatedRequest request) { - binding_.Bind(std::move(request)); -} - -void SharedBitmapAllocationNotifierImpl::DidAllocateSharedBitmap( - mojo::ScopedSharedBufferHandle buffer, - const cc::SharedBitmapId& id) { - base::SharedMemoryHandle memory_handle; - size_t size; - MojoResult result = mojo::UnwrapSharedMemoryHandle( - std::move(buffer), &memory_handle, &size, NULL); - DCHECK_EQ(result, MOJO_RESULT_OK); - this->ChildAllocatedSharedBitmap(size, memory_handle, id); -} - -void SharedBitmapAllocationNotifierImpl::DidDeleteSharedBitmap( - const cc::SharedBitmapId& id) { - manager_->ChildDeletedSharedBitmap(id); - owned_bitmaps_.erase(id); -} - -void SharedBitmapAllocationNotifierImpl::ChildAllocatedSharedBitmap( - size_t buffer_size, - const base::SharedMemoryHandle& handle, - const cc::SharedBitmapId& id) { - if (manager_->ChildAllocatedSharedBitmap(buffer_size, handle, id)) - owned_bitmaps_.insert(id); -} - -} // namespace viz
diff --git a/components/viz/service/display_compositor/shared_bitmap_allocation_notifier_impl.h b/components/viz/service/display_compositor/shared_bitmap_allocation_notifier_impl.h deleted file mode 100644 index 35e63b2..0000000 --- a/components/viz/service/display_compositor/shared_bitmap_allocation_notifier_impl.h +++ /dev/null
@@ -1,47 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_SHARED_BITMAP_ALLOCATION_NOTIFIER_IMPL_H_ -#define COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_SHARED_BITMAP_ALLOCATION_NOTIFIER_IMPL_H_ - -#include <unordered_set> - -#include "cc/ipc/shared_bitmap_allocation_notifier.mojom.h" -#include "cc/resources/shared_bitmap.h" -#include "components/viz/service/viz_service_export.h" -#include "mojo/public/cpp/bindings/associated_binding.h" - -namespace viz { -class ServerSharedBitmapManager; - -class VIZ_SERVICE_EXPORT SharedBitmapAllocationNotifierImpl - : NON_EXPORTED_BASE(public cc::mojom::SharedBitmapAllocationNotifier) { - public: - explicit SharedBitmapAllocationNotifierImpl( - ServerSharedBitmapManager* manager); - - ~SharedBitmapAllocationNotifierImpl() override; - - void Bind(cc::mojom::SharedBitmapAllocationNotifierAssociatedRequest request); - - // cc::mojom::SharedBitmapAllocationNotifier overrides: - void DidAllocateSharedBitmap(mojo::ScopedSharedBufferHandle buffer, - const cc::SharedBitmapId& id) override; - void DidDeleteSharedBitmap(const cc::SharedBitmapId& id) override; - - void ChildAllocatedSharedBitmap(size_t buffer_size, - const base::SharedMemoryHandle& handle, - const cc::SharedBitmapId& id); - - private: - ServerSharedBitmapManager* const manager_; - mojo::AssociatedBinding<cc::mojom::SharedBitmapAllocationNotifier> binding_; - std::unordered_set<cc::SharedBitmapId, cc::SharedBitmapIdHash> owned_bitmaps_; - - DISALLOW_COPY_AND_ASSIGN(SharedBitmapAllocationNotifierImpl); -}; - -} // namespace viz - -#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_SHARED_BITMAP_ALLOCATION_NOTIFIER_IMPL_H_
diff --git a/components/viz/service/display_compositor/DEPS b/components/viz/service/display_embedder/DEPS similarity index 100% rename from components/viz/service/display_compositor/DEPS rename to components/viz/service/display_embedder/DEPS
diff --git a/components/viz/service/display_compositor/OWNERS b/components/viz/service/display_embedder/OWNERS similarity index 100% rename from components/viz/service/display_compositor/OWNERS rename to components/viz/service/display_embedder/OWNERS
diff --git a/components/viz/service/display_embedder/README.md b/components/viz/service/display_embedder/README.md new file mode 100644 index 0000000..f7f83c6f --- /dev/null +++ b/components/viz/service/display_embedder/README.md
@@ -0,0 +1,6 @@ +# display_embedder + +This directory contains the implementation used to embed a Display Compositor +for a specific platform. That includes code for managing presentation of the +Display Compositor's output to the user. +
diff --git a/components/viz/service/display_embedder/buffer_queue.cc b/components/viz/service/display_embedder/buffer_queue.cc new file mode 100644 index 0000000..2049239a --- /dev/null +++ b/components/viz/service/display_embedder/buffer_queue.cc
@@ -0,0 +1,303 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/viz/service/display_embedder/buffer_queue.h" + +#include "base/containers/adapters.h" +#include "base/memory/ptr_util.h" +#include "build/build_config.h" +#include "components/viz/common/gl_helper.h" +#include "gpu/GLES2/gl2extchromium.h" +#include "gpu/command_buffer/client/gles2_interface.h" +#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" +#include "gpu/command_buffer/common/gpu_memory_buffer_support.h" +#include "third_party/skia/include/core/SkRect.h" +#include "third_party/skia/include/core/SkRegion.h" +#include "ui/display/types/display_snapshot.h" +#include "ui/gfx/gpu_memory_buffer.h" +#include "ui/gfx/skia_util.h" + +namespace viz { + +BufferQueue::BufferQueue(gpu::gles2::GLES2Interface* gl, + uint32_t texture_target, + uint32_t internal_format, + gfx::BufferFormat format, + GLHelper* gl_helper, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, + gpu::SurfaceHandle surface_handle) + : gl_(gl), + fbo_(0), + allocated_count_(0), + texture_target_(texture_target), + internal_format_(internal_format), + format_(format), + gl_helper_(gl_helper), + gpu_memory_buffer_manager_(gpu_memory_buffer_manager), + surface_handle_(surface_handle) { + DCHECK(gpu::IsImageFormatCompatibleWithGpuMemoryBufferFormat(internal_format, + format_)); +} + +BufferQueue::~BufferQueue() { + FreeAllSurfaces(); + + if (fbo_) + gl_->DeleteFramebuffers(1, &fbo_); +} + +void BufferQueue::Initialize() { + gl_->GenFramebuffers(1, &fbo_); +} + +void BufferQueue::BindFramebuffer() { + gl_->BindFramebuffer(GL_FRAMEBUFFER, fbo_); + + if (!current_surface_) + current_surface_ = GetNextSurface(); + + if (current_surface_) { + gl_->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + texture_target_, current_surface_->texture, 0); + if (current_surface_->stencil) { + gl_->FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, + GL_RENDERBUFFER, current_surface_->stencil); + } + } +} + +void BufferQueue::CopyBufferDamage(int texture, + int source_texture, + const gfx::Rect& new_damage, + const gfx::Rect& old_damage) { + gl_helper_->CopySubBufferDamage(texture_target_, texture, source_texture, + SkRegion(gfx::RectToSkIRect(new_damage)), + SkRegion(gfx::RectToSkIRect(old_damage))); +} + +void BufferQueue::UpdateBufferDamage(const gfx::Rect& damage) { + if (displayed_surface_) + displayed_surface_->damage.Union(damage); + for (auto& surface : available_surfaces_) + surface->damage.Union(damage); + for (auto& surface : in_flight_surfaces_) { + if (surface) + surface->damage.Union(damage); + } +} + +void BufferQueue::SwapBuffers(const gfx::Rect& damage) { + if (current_surface_) { + if (damage != gfx::Rect(size_)) { + // Copy damage from the most recently swapped buffer. In the event that + // the buffer was destroyed and failed to recreate, pick from the most + // recently available buffer. + uint32_t texture_id = 0; + for (auto& surface : base::Reversed(in_flight_surfaces_)) { + if (surface) { + texture_id = surface->texture; + break; + } + } + if (!texture_id && displayed_surface_) + texture_id = displayed_surface_->texture; + + if (texture_id) { + CopyBufferDamage(current_surface_->texture, texture_id, damage, + current_surface_->damage); + } + } + current_surface_->damage = gfx::Rect(); + } + UpdateBufferDamage(damage); + in_flight_surfaces_.push_back(std::move(current_surface_)); + // Some things reset the framebuffer (CopySubBufferDamage, some GLRenderer + // paths), so ensure we restore it here. + gl_->BindFramebuffer(GL_FRAMEBUFFER, fbo_); +} + +void BufferQueue::Reshape(const gfx::Size& size, + float scale_factor, + const gfx::ColorSpace& color_space, + bool use_stencil) { + if (size == size_ && color_space == color_space_ && + use_stencil == use_stencil_) + return; +#if !defined(OS_MACOSX) + // TODO(ccameron): This assert is being hit on Mac try jobs. Determine if that + // is cause for concern or if it is benign. + // http://crbug.com/524624 + DCHECK(!current_surface_); +#endif + size_ = size; + color_space_ = color_space; + use_stencil_ = use_stencil; + + gl_->BindFramebuffer(GL_FRAMEBUFFER, fbo_); + gl_->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + texture_target_, 0, 0); + gl_->FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, + GL_RENDERBUFFER, 0); + + FreeAllSurfaces(); +} + +void BufferQueue::RecreateBuffers() { + // We need to recreate the buffers, for whatever reason the old ones are not + // presentable on the device anymore. + // Unused buffers can be freed directly, they will be re-allocated as needed. + // Any in flight, current or displayed surface must be replaced. + available_surfaces_.clear(); + + // Recreate all in-flight surfaces and put the recreated copies in the queue. + for (auto& surface : in_flight_surfaces_) + surface = RecreateBuffer(std::move(surface)); + + current_surface_ = RecreateBuffer(std::move(current_surface_)); + displayed_surface_ = RecreateBuffer(std::move(displayed_surface_)); + + if (current_surface_) { + // If we have a texture bound, we will need to re-bind it. + gl_->BindFramebuffer(GL_FRAMEBUFFER, fbo_); + gl_->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + texture_target_, current_surface_->texture, 0); + } +} + +std::unique_ptr<BufferQueue::AllocatedSurface> BufferQueue::RecreateBuffer( + std::unique_ptr<AllocatedSurface> surface) { + if (!surface) + return nullptr; + + std::unique_ptr<AllocatedSurface> new_surface(GetNextSurface()); + if (!new_surface) + return nullptr; + + new_surface->damage = surface->damage; + + // Copy the entire texture. + CopyBufferDamage(new_surface->texture, surface->texture, gfx::Rect(), + gfx::Rect(size_)); + return new_surface; +} + +void BufferQueue::PageFlipComplete() { + // Early out when no surface is in-flight. This can happen when using + // overlays and page flipping without changing the primary plane. + if (in_flight_surfaces_.empty()) + return; + if (displayed_surface_) + available_surfaces_.push_back(std::move(displayed_surface_)); + displayed_surface_ = std::move(in_flight_surfaces_.front()); + in_flight_surfaces_.pop_front(); +} + +uint32_t BufferQueue::GetCurrentTextureId() const { + // Return current surface texture if bound. + if (current_surface_) + return current_surface_->texture; + + // Return in-flight or displayed surface texture if no surface is + // currently bound. This can happen when using overlays and surface + // damage is empty. Note: |in_flight_surfaces_| entries can be null + // as a result of calling FreeAllSurfaces(). + if (!in_flight_surfaces_.empty() && in_flight_surfaces_.back()) + return in_flight_surfaces_.back()->texture; + if (displayed_surface_) + return displayed_surface_->texture; + + return 0; +} + +void BufferQueue::FreeAllSurfaces() { + displayed_surface_.reset(); + current_surface_.reset(); + // This is intentionally not emptied since the swap buffers acks are still + // expected to arrive. + for (auto& surface : in_flight_surfaces_) + surface = nullptr; + available_surfaces_.clear(); +} + +void BufferQueue::FreeSurfaceResources(AllocatedSurface* surface) { + if (!surface->texture) + return; + + gl_->BindTexture(texture_target_, surface->texture); + gl_->ReleaseTexImage2DCHROMIUM(texture_target_, surface->image); + gl_->DeleteTextures(1, &surface->texture); + gl_->DestroyImageCHROMIUM(surface->image); + if (surface->stencil) + gl_->DeleteRenderbuffers(1, &surface->stencil); + surface->buffer.reset(); + allocated_count_--; +} + +std::unique_ptr<BufferQueue::AllocatedSurface> BufferQueue::GetNextSurface() { + if (!available_surfaces_.empty()) { + std::unique_ptr<AllocatedSurface> surface = + std::move(available_surfaces_.back()); + available_surfaces_.pop_back(); + return surface; + } + + GLuint texture; + gl_->GenTextures(1, &texture); + + GLuint stencil = 0; + if (use_stencil_) { + gl_->GenRenderbuffers(1, &stencil); + gl_->BindRenderbuffer(GL_RENDERBUFFER, stencil); + gl_->RenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, size_.width(), + size_.height()); + gl_->BindRenderbuffer(GL_RENDERBUFFER, 0); + } + + // We don't want to allow anything more than triple buffering. + DCHECK_LT(allocated_count_, 4U); + std::unique_ptr<gfx::GpuMemoryBuffer> buffer( + gpu_memory_buffer_manager_->CreateGpuMemoryBuffer( + size_, format_, gfx::BufferUsage::SCANOUT, surface_handle_)); + if (!buffer.get()) { + gl_->DeleteTextures(1, &texture); + DLOG(ERROR) << "Failed to allocate GPU memory buffer"; + return nullptr; + } + buffer->SetColorSpaceForScanout(color_space_); + + uint32_t id = + gl_->CreateImageCHROMIUM(buffer->AsClientBuffer(), size_.width(), + size_.height(), internal_format_); + if (!id) { + LOG(ERROR) << "Failed to allocate backing image surface"; + gl_->DeleteTextures(1, &texture); + return nullptr; + } + + allocated_count_++; + gl_->BindTexture(texture_target_, texture); + gl_->BindTexImage2DCHROMIUM(texture_target_, id); + return base::MakeUnique<AllocatedSurface>(this, std::move(buffer), texture, + id, stencil, gfx::Rect(size_)); +} + +BufferQueue::AllocatedSurface::AllocatedSurface( + BufferQueue* buffer_queue, + std::unique_ptr<gfx::GpuMemoryBuffer> buffer, + uint32_t texture, + uint32_t image, + uint32_t stencil, + const gfx::Rect& rect) + : buffer_queue(buffer_queue), + buffer(buffer.release()), + texture(texture), + image(image), + stencil(stencil), + damage(rect) {} + +BufferQueue::AllocatedSurface::~AllocatedSurface() { + buffer_queue->FreeSurfaceResources(this); +} + +} // namespace viz
diff --git a/components/viz/service/display_embedder/buffer_queue.h b/components/viz/service/display_embedder/buffer_queue.h new file mode 100644 index 0000000..183487e --- /dev/null +++ b/components/viz/service/display_embedder/buffer_queue.h
@@ -0,0 +1,136 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_BUFFER_QUEUE_H_ +#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_BUFFER_QUEUE_H_ + +#include <stddef.h> + +#include <deque> +#include <memory> +#include <vector> + +#include "base/macros.h" +#include "base/memory/ref_counted.h" +#include "components/viz/service/viz_service_export.h" +#include "gpu/ipc/common/surface_handle.h" +#include "ui/gfx/buffer_types.h" +#include "ui/gfx/color_space.h" +#include "ui/gfx/geometry/rect.h" +#include "ui/gfx/geometry/size.h" + +namespace gfx { +class GpuMemoryBuffer; +} + +namespace gpu { +class GpuMemoryBufferManager; + +namespace gles2 { +class GLES2Interface; +} +} // namespace gpu + +namespace viz { + +class GLHelper; + +// Provides a surface that manages its own buffers, backed by GpuMemoryBuffers +// created using CHROMIUM_image. Double/triple buffering is implemented +// internally. Doublebuffering occurs if PageFlipComplete is called before the +// next BindFramebuffer call, otherwise it creates extra buffers. +class VIZ_SERVICE_EXPORT BufferQueue { + public: + BufferQueue(gpu::gles2::GLES2Interface* gl, + uint32_t texture_target, + uint32_t internal_format, + gfx::BufferFormat format, + GLHelper* gl_helper, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, + gpu::SurfaceHandle surface_handle); + virtual ~BufferQueue(); + + void Initialize(); + + void BindFramebuffer(); + void SwapBuffers(const gfx::Rect& damage); + void PageFlipComplete(); + void Reshape(const gfx::Size& size, + float scale_factor, + const gfx::ColorSpace& color_space, + bool use_stencil); + void RecreateBuffers(); + uint32_t GetCurrentTextureId() const; + + uint32_t fbo() const { return fbo_; } + uint32_t internal_format() const { return internal_format_; } + + private: + friend class BufferQueueTest; + friend class AllocatedSurface; + + struct VIZ_SERVICE_EXPORT AllocatedSurface { + AllocatedSurface(BufferQueue* buffer_queue, + std::unique_ptr<gfx::GpuMemoryBuffer> buffer, + uint32_t texture, + uint32_t image, + uint32_t stencil, + const gfx::Rect& rect); + ~AllocatedSurface(); + BufferQueue* const buffer_queue; + std::unique_ptr<gfx::GpuMemoryBuffer> buffer; + const uint32_t texture; + const uint32_t image; + const uint32_t stencil; + gfx::Rect damage; // This is the damage for this frame from the previous. + }; + + void FreeAllSurfaces(); + + void FreeSurfaceResources(AllocatedSurface* surface); + + // Copy everything that is in |copy_rect|, except for what is in + // |exclude_rect| from |source_texture| to |texture|. + virtual void CopyBufferDamage(int texture, + int source_texture, + const gfx::Rect& new_damage, + const gfx::Rect& old_damage); + + void UpdateBufferDamage(const gfx::Rect& damage); + + // Return a surface, available to be drawn into. + std::unique_ptr<AllocatedSurface> GetNextSurface(); + + std::unique_ptr<AllocatedSurface> RecreateBuffer( + std::unique_ptr<AllocatedSurface> surface); + + gpu::gles2::GLES2Interface* const gl_; + gfx::Size size_; + gfx::ColorSpace color_space_; + bool use_stencil_ = false; + uint32_t fbo_; + size_t allocated_count_; + uint32_t texture_target_; + uint32_t internal_format_; + gfx::BufferFormat format_; + // This surface is currently bound. This may be nullptr if no surface has + // been bound, or if allocation failed at bind. + std::unique_ptr<AllocatedSurface> current_surface_; + // The surface currently on the screen, if any. + std::unique_ptr<AllocatedSurface> displayed_surface_; + // These are free for use, and are not nullptr. + std::vector<std::unique_ptr<AllocatedSurface>> available_surfaces_; + // These have been swapped but are not displayed yet. Entries of this deque + // may be nullptr, if they represent frames that have been destroyed. + std::deque<std::unique_ptr<AllocatedSurface>> in_flight_surfaces_; + GLHelper* gl_helper_; + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; + gpu::SurfaceHandle surface_handle_; + + DISALLOW_COPY_AND_ASSIGN(BufferQueue); +}; + +} // namespace viz + +#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_BUFFER_QUEUE_H_
diff --git a/components/viz/service/display_embedder/buffer_queue_unittest.cc b/components/viz/service/display_embedder/buffer_queue_unittest.cc new file mode 100644 index 0000000..77baec1 --- /dev/null +++ b/components/viz/service/display_embedder/buffer_queue_unittest.cc
@@ -0,0 +1,681 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/viz/service/display_embedder/buffer_queue.h" + +#include <stddef.h> +#include <stdint.h> + +#include <set> +#include <utility> + +#include "base/memory/ptr_util.h" +#include "build/build_config.h" +#include "cc/test/test_context_provider.h" +#include "cc/test/test_gpu_memory_buffer_manager.h" +#include "cc/test/test_web_graphics_context_3d.h" +#include "components/viz/common/gl_helper.h" +#include "gpu/GLES2/gl2extchromium.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/khronos/GLES2/gl2ext.h" +#include "ui/display/types/display_snapshot.h" + +using ::testing::_; +using ::testing::Expectation; +using ::testing::Ne; +using ::testing::Return; + +namespace viz { + +class StubGpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { + public: + explicit StubGpuMemoryBufferImpl(size_t* set_color_space_count) + : set_color_space_count_(set_color_space_count) {} + + // Overridden from gfx::GpuMemoryBuffer: + bool Map() override { return false; } + void* memory(size_t plane) override { return nullptr; } + void Unmap() override {} + gfx::Size GetSize() const override { return gfx::Size(); } + gfx::BufferFormat GetFormat() const override { + return gfx::BufferFormat::BGRX_8888; + } + int stride(size_t plane) const override { return 0; } + gfx::GpuMemoryBufferId GetId() const override { + return gfx::GpuMemoryBufferId(0); + } + void SetColorSpaceForScanout(const gfx::ColorSpace& color_space) override { + *set_color_space_count_ += 1; + } + gfx::GpuMemoryBufferHandle GetHandle() const override { + return gfx::GpuMemoryBufferHandle(); + } + ClientBuffer AsClientBuffer() override { + return reinterpret_cast<ClientBuffer>(this); + } + + size_t* set_color_space_count_; +}; + +class StubGpuMemoryBufferManager : public cc::TestGpuMemoryBufferManager { + public: + StubGpuMemoryBufferManager() : allocate_succeeds_(true) {} + + size_t set_color_space_count() const { return set_color_space_count_; } + + void set_allocate_succeeds(bool value) { allocate_succeeds_ = value; } + + std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( + const gfx::Size& size, + gfx::BufferFormat format, + gfx::BufferUsage usage, + gpu::SurfaceHandle surface_handle) override { + if (!surface_handle) { + return TestGpuMemoryBufferManager::CreateGpuMemoryBuffer( + size, format, usage, surface_handle); + } + if (allocate_succeeds_) + return base::WrapUnique<gfx::GpuMemoryBuffer>( + new StubGpuMemoryBufferImpl(&set_color_space_count_)); + return nullptr; + } + + private: + bool allocate_succeeds_; + size_t set_color_space_count_ = 0; +}; + +#if defined(OS_WIN) +const gpu::SurfaceHandle kFakeSurfaceHandle = + reinterpret_cast<gpu::SurfaceHandle>(1); +#else +const gpu::SurfaceHandle kFakeSurfaceHandle = 1; +#endif + +class MockBufferQueue : public BufferQueue { + public: + MockBufferQueue(gpu::gles2::GLES2Interface* gl, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, + unsigned int target, + unsigned int internalformat) + : BufferQueue(gl, + target, + internalformat, + display::DisplaySnapshot::PrimaryFormat(), + nullptr, + gpu_memory_buffer_manager, + kFakeSurfaceHandle) {} + MOCK_METHOD4(CopyBufferDamage, + void(int, int, const gfx::Rect&, const gfx::Rect&)); +}; + +class BufferQueueTest : public ::testing::Test { + public: + BufferQueueTest() : doublebuffering_(true), first_frame_(true) {} + + void SetUp() override { + InitWithContext(cc::TestWebGraphicsContext3D::Create()); + } + + void InitWithContext(std::unique_ptr<cc::TestWebGraphicsContext3D> context) { + context_provider_ = cc::TestContextProvider::Create(std::move(context)); + context_provider_->BindToCurrentThread(); + gpu_memory_buffer_manager_.reset(new StubGpuMemoryBufferManager); + mock_output_surface_ = new MockBufferQueue(context_provider_->ContextGL(), + gpu_memory_buffer_manager_.get(), + GL_TEXTURE_2D, GL_RGB); + output_surface_.reset(mock_output_surface_); + output_surface_->Initialize(); + } + + unsigned current_surface() { + return output_surface_->current_surface_ + ? output_surface_->current_surface_->image + : 0; + } + const std::vector<std::unique_ptr<BufferQueue::AllocatedSurface>>& + available_surfaces() { + return output_surface_->available_surfaces_; + } + std::deque<std::unique_ptr<BufferQueue::AllocatedSurface>>& + in_flight_surfaces() { + return output_surface_->in_flight_surfaces_; + } + + const BufferQueue::AllocatedSurface* displayed_frame() { + return output_surface_->displayed_surface_.get(); + } + const BufferQueue::AllocatedSurface* current_frame() { + return output_surface_->current_surface_.get(); + } + const BufferQueue::AllocatedSurface* next_frame() { + return output_surface_->available_surfaces_.back().get(); + } + const gfx::Size size() { return output_surface_->size_; } + + int CountBuffers() { + int n = available_surfaces().size() + in_flight_surfaces().size() + + (displayed_frame() ? 1 : 0); + if (current_surface()) + n++; + return n; + } + + // Check that each buffer is unique if present. + void CheckUnique() { + std::set<unsigned> buffers; + EXPECT_TRUE(InsertUnique(&buffers, current_surface())); + if (displayed_frame()) + EXPECT_TRUE(InsertUnique(&buffers, displayed_frame()->image)); + for (auto& surface : available_surfaces()) + EXPECT_TRUE(InsertUnique(&buffers, surface->image)); + for (auto& surface : in_flight_surfaces()) { + if (surface) + EXPECT_TRUE(InsertUnique(&buffers, surface->image)); + } + } + + void SwapBuffers() { + output_surface_->SwapBuffers(gfx::Rect(output_surface_->size_)); + } + + void SendDamagedFrame(const gfx::Rect& damage) { + // We don't care about the GL-level implementation here, just how it uses + // damage rects. + output_surface_->BindFramebuffer(); + output_surface_->SwapBuffers(damage); + if (doublebuffering_ || !first_frame_) + output_surface_->PageFlipComplete(); + first_frame_ = false; + } + + void SendFullFrame() { SendDamagedFrame(gfx::Rect(output_surface_->size_)); } + + protected: + bool InsertUnique(std::set<unsigned>* set, unsigned value) { + if (!value) + return true; + if (set->find(value) != set->end()) + return false; + set->insert(value); + return true; + } + + scoped_refptr<cc::TestContextProvider> context_provider_; + std::unique_ptr<StubGpuMemoryBufferManager> gpu_memory_buffer_manager_; + std::unique_ptr<BufferQueue> output_surface_; + MockBufferQueue* mock_output_surface_; + bool doublebuffering_; + bool first_frame_; +}; + +namespace { +const gfx::Size screen_size = gfx::Size(30, 30); +const gfx::Rect screen_rect = gfx::Rect(screen_size); +const gfx::Rect small_damage = gfx::Rect(gfx::Size(10, 10)); +const gfx::Rect large_damage = gfx::Rect(gfx::Size(20, 20)); +const gfx::Rect overlapping_damage = gfx::Rect(gfx::Size(5, 20)); + +GLuint CreateImageDefault() { + static GLuint id = 0; + return ++id; +} + +class MockedContext : public cc::TestWebGraphicsContext3D { + public: + MockedContext() { + ON_CALL(*this, createImageCHROMIUM(_, _, _, _)) + .WillByDefault(testing::InvokeWithoutArgs(&CreateImageDefault)); + } + MOCK_METHOD2(bindFramebuffer, void(GLenum, GLuint)); + MOCK_METHOD2(bindTexture, void(GLenum, GLuint)); + MOCK_METHOD2(bindTexImage2DCHROMIUM, void(GLenum, GLint)); + MOCK_METHOD4(createImageCHROMIUM, + GLuint(ClientBuffer, GLsizei, GLsizei, GLenum)); + MOCK_METHOD1(destroyImageCHROMIUM, void(GLuint)); + MOCK_METHOD5(framebufferTexture2D, + void(GLenum, GLenum, GLenum, GLuint, GLint)); +}; + +class BufferQueueMockedContextTest : public BufferQueueTest { + public: + void SetUp() override { + context_ = new MockedContext(); + InitWithContext(std::unique_ptr<cc::TestWebGraphicsContext3D>(context_)); + } + + protected: + MockedContext* context_; +}; + +scoped_refptr<cc::TestContextProvider> CreateMockedContextProvider( + MockedContext** context) { + std::unique_ptr<MockedContext> owned_context(new MockedContext); + *context = owned_context.get(); + scoped_refptr<cc::TestContextProvider> context_provider = + cc::TestContextProvider::Create(std::move(owned_context)); + context_provider->BindToCurrentThread(); + return context_provider; +} + +std::unique_ptr<BufferQueue> CreateBufferQueue( + unsigned int target, + gpu::gles2::GLES2Interface* gl, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) { + std::unique_ptr<BufferQueue> buffer_queue(new BufferQueue( + gl, target, GL_RGB, display::DisplaySnapshot::PrimaryFormat(), nullptr, + gpu_memory_buffer_manager, kFakeSurfaceHandle)); + buffer_queue->Initialize(); + return buffer_queue; +} + +TEST(BufferQueueStandaloneTest, FboInitialization) { + MockedContext* context; + scoped_refptr<cc::TestContextProvider> context_provider = + CreateMockedContextProvider(&context); + std::unique_ptr<StubGpuMemoryBufferManager> gpu_memory_buffer_manager( + new StubGpuMemoryBufferManager); + std::unique_ptr<BufferQueue> output_surface = + CreateBufferQueue(GL_TEXTURE_2D, context_provider->ContextGL(), + gpu_memory_buffer_manager.get()); + + EXPECT_CALL(*context, bindFramebuffer(GL_FRAMEBUFFER, Ne(0U))); + ON_CALL(*context, framebufferTexture2D(_, _, _, _, _)) + .WillByDefault(Return()); + + output_surface->Reshape(gfx::Size(10, 20), 1.0f, gfx::ColorSpace(), false); +} + +TEST(BufferQueueStandaloneTest, FboBinding) { + GLenum targets[] = {GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_ARB}; + for (size_t i = 0; i < 2; ++i) { + GLenum target = targets[i]; + + MockedContext* context; + scoped_refptr<cc::TestContextProvider> context_provider = + CreateMockedContextProvider(&context); + std::unique_ptr<StubGpuMemoryBufferManager> gpu_memory_buffer_manager( + new StubGpuMemoryBufferManager); + std::unique_ptr<BufferQueue> output_surface = CreateBufferQueue( + target, context_provider->ContextGL(), gpu_memory_buffer_manager.get()); + + EXPECT_CALL(*context, bindTexture(target, Ne(0U))); + EXPECT_CALL(*context, destroyImageCHROMIUM(1)); + Expectation image = + EXPECT_CALL(*context, createImageCHROMIUM(_, 0, 0, GL_RGB)) + .WillOnce(Return(1)); + Expectation fb = + EXPECT_CALL(*context, bindFramebuffer(GL_FRAMEBUFFER, Ne(0U))); + Expectation tex = EXPECT_CALL(*context, bindTexture(target, Ne(0U))); + Expectation bind_tex = + EXPECT_CALL(*context, bindTexImage2DCHROMIUM(target, 1)) + .After(tex, image); + EXPECT_CALL(*context, + framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + target, Ne(0U), _)) + .After(fb, bind_tex); + + output_surface->BindFramebuffer(); + } +} + +TEST(BufferQueueStandaloneTest, CheckBoundFramebuffer) { + scoped_refptr<cc::TestContextProvider> context_provider = + cc::TestContextProvider::Create(); + context_provider->BindToCurrentThread(); + std::unique_ptr<StubGpuMemoryBufferManager> gpu_memory_buffer_manager; + std::unique_ptr<BufferQueue> output_surface; + gpu_memory_buffer_manager.reset(new StubGpuMemoryBufferManager); + + std::unique_ptr<GLHelper> gl_helper; + gl_helper.reset(new GLHelper(context_provider->ContextGL(), + context_provider->ContextSupport())); + + output_surface.reset(new BufferQueue( + context_provider->ContextGL(), GL_TEXTURE_2D, GL_RGB, + display::DisplaySnapshot::PrimaryFormat(), gl_helper.get(), + gpu_memory_buffer_manager.get(), kFakeSurfaceHandle)); + output_surface->Initialize(); + output_surface->Reshape(screen_size, 1.0f, gfx::ColorSpace(), false); + // Trigger a sub-buffer copy to exercise all paths. + output_surface->BindFramebuffer(); + output_surface->SwapBuffers(screen_rect); + output_surface->PageFlipComplete(); + output_surface->BindFramebuffer(); + output_surface->SwapBuffers(small_damage); + + int current_fbo = 0; + context_provider->ContextGL()->GetIntegerv(GL_FRAMEBUFFER_BINDING, + ¤t_fbo); + EXPECT_EQ(static_cast<int>(output_surface->fbo()), current_fbo); +} + +TEST_F(BufferQueueTest, PartialSwapReuse) { + output_surface_->Reshape(screen_size, 1.0f, gfx::ColorSpace(), false); + ASSERT_TRUE(doublebuffering_); + EXPECT_CALL(*mock_output_surface_, + CopyBufferDamage(_, _, small_damage, screen_rect)) + .Times(1); + EXPECT_CALL(*mock_output_surface_, + CopyBufferDamage(_, _, small_damage, small_damage)) + .Times(1); + EXPECT_CALL(*mock_output_surface_, + CopyBufferDamage(_, _, large_damage, small_damage)) + .Times(1); + SendFullFrame(); + SendDamagedFrame(small_damage); + SendDamagedFrame(small_damage); + SendDamagedFrame(large_damage); + // Verify that the damage has propagated. + EXPECT_EQ(next_frame()->damage, large_damage); +} + +TEST_F(BufferQueueTest, PartialSwapFullFrame) { + output_surface_->Reshape(screen_size, 1.0f, gfx::ColorSpace(), false); + ASSERT_TRUE(doublebuffering_); + EXPECT_CALL(*mock_output_surface_, + CopyBufferDamage(_, _, small_damage, screen_rect)) + .Times(1); + SendFullFrame(); + SendDamagedFrame(small_damage); + SendFullFrame(); + SendFullFrame(); + EXPECT_EQ(next_frame()->damage, screen_rect); +} + +TEST_F(BufferQueueTest, PartialSwapOverlapping) { + output_surface_->Reshape(screen_size, 1.0f, gfx::ColorSpace(), false); + ASSERT_TRUE(doublebuffering_); + EXPECT_CALL(*mock_output_surface_, + CopyBufferDamage(_, _, small_damage, screen_rect)) + .Times(1); + EXPECT_CALL(*mock_output_surface_, + CopyBufferDamage(_, _, overlapping_damage, small_damage)) + .Times(1); + + SendFullFrame(); + SendDamagedFrame(small_damage); + SendDamagedFrame(overlapping_damage); + EXPECT_EQ(next_frame()->damage, overlapping_damage); +} + +TEST_F(BufferQueueTest, MultipleBindCalls) { + // Check that multiple bind calls do not create or change surfaces. + output_surface_->BindFramebuffer(); + EXPECT_EQ(1, CountBuffers()); + unsigned int fb = current_surface(); + output_surface_->BindFramebuffer(); + EXPECT_EQ(1, CountBuffers()); + EXPECT_EQ(fb, current_surface()); +} + +TEST_F(BufferQueueTest, CheckDoubleBuffering) { + // Check buffer flow through double buffering path. + EXPECT_EQ(0, CountBuffers()); + output_surface_->BindFramebuffer(); + EXPECT_EQ(1, CountBuffers()); + EXPECT_NE(0U, current_surface()); + EXPECT_FALSE(displayed_frame()); + SwapBuffers(); + EXPECT_EQ(1U, in_flight_surfaces().size()); + output_surface_->PageFlipComplete(); + EXPECT_EQ(0U, in_flight_surfaces().size()); + EXPECT_TRUE(displayed_frame()->texture); + output_surface_->BindFramebuffer(); + EXPECT_EQ(2, CountBuffers()); + CheckUnique(); + EXPECT_NE(0U, current_surface()); + EXPECT_EQ(0U, in_flight_surfaces().size()); + EXPECT_TRUE(displayed_frame()->texture); + SwapBuffers(); + CheckUnique(); + EXPECT_EQ(1U, in_flight_surfaces().size()); + EXPECT_TRUE(displayed_frame()->texture); + output_surface_->PageFlipComplete(); + CheckUnique(); + EXPECT_EQ(0U, in_flight_surfaces().size()); + EXPECT_EQ(1U, available_surfaces().size()); + EXPECT_TRUE(displayed_frame()->texture); + output_surface_->BindFramebuffer(); + EXPECT_EQ(2, CountBuffers()); + CheckUnique(); + EXPECT_TRUE(available_surfaces().empty()); +} + +TEST_F(BufferQueueTest, CheckTripleBuffering) { + // Check buffer flow through triple buffering path. + + // This bit is the same sequence tested in the doublebuffering case. + output_surface_->BindFramebuffer(); + EXPECT_FALSE(displayed_frame()); + SwapBuffers(); + output_surface_->PageFlipComplete(); + output_surface_->BindFramebuffer(); + SwapBuffers(); + + EXPECT_EQ(2, CountBuffers()); + CheckUnique(); + EXPECT_EQ(1U, in_flight_surfaces().size()); + EXPECT_TRUE(displayed_frame()->texture); + output_surface_->BindFramebuffer(); + EXPECT_EQ(3, CountBuffers()); + CheckUnique(); + EXPECT_NE(0U, current_surface()); + EXPECT_EQ(1U, in_flight_surfaces().size()); + EXPECT_TRUE(displayed_frame()->texture); + output_surface_->PageFlipComplete(); + EXPECT_EQ(3, CountBuffers()); + CheckUnique(); + EXPECT_NE(0U, current_surface()); + EXPECT_EQ(0U, in_flight_surfaces().size()); + EXPECT_TRUE(displayed_frame()->texture); + EXPECT_EQ(1U, available_surfaces().size()); +} + +TEST_F(BufferQueueTest, CheckCorrectBufferOrdering) { + const size_t kSwapCount = 3; + for (size_t i = 0; i < kSwapCount; ++i) { + output_surface_->BindFramebuffer(); + SwapBuffers(); + } + + EXPECT_EQ(kSwapCount, in_flight_surfaces().size()); + for (size_t i = 0; i < kSwapCount; ++i) { + unsigned int next_texture_id = in_flight_surfaces().front()->texture; + output_surface_->PageFlipComplete(); + EXPECT_EQ(displayed_frame()->texture, next_texture_id); + } +} + +TEST_F(BufferQueueTest, ReshapeWithInFlightSurfaces) { + const size_t kSwapCount = 3; + for (size_t i = 0; i < kSwapCount; ++i) { + output_surface_->BindFramebuffer(); + SwapBuffers(); + } + + output_surface_->Reshape(gfx::Size(10, 20), 1.0f, gfx::ColorSpace(), false); + EXPECT_EQ(3u, in_flight_surfaces().size()); + + for (size_t i = 0; i < kSwapCount; ++i) { + output_surface_->PageFlipComplete(); + EXPECT_FALSE(displayed_frame()); + } + + // The dummy surfacess left should be discarded. + EXPECT_EQ(0u, available_surfaces().size()); +} + +TEST_F(BufferQueueTest, SwapAfterReshape) { + DCHECK_EQ(0u, gpu_memory_buffer_manager_->set_color_space_count()); + const size_t kSwapCount = 3; + for (size_t i = 0; i < kSwapCount; ++i) { + output_surface_->BindFramebuffer(); + SwapBuffers(); + } + DCHECK_EQ(kSwapCount, gpu_memory_buffer_manager_->set_color_space_count()); + + output_surface_->Reshape(gfx::Size(10, 20), 1.0f, gfx::ColorSpace(), false); + DCHECK_EQ(kSwapCount, gpu_memory_buffer_manager_->set_color_space_count()); + + for (size_t i = 0; i < kSwapCount; ++i) { + output_surface_->BindFramebuffer(); + SwapBuffers(); + } + DCHECK_EQ(2 * kSwapCount, + gpu_memory_buffer_manager_->set_color_space_count()); + EXPECT_EQ(2 * kSwapCount, in_flight_surfaces().size()); + + for (size_t i = 0; i < kSwapCount; ++i) { + output_surface_->PageFlipComplete(); + EXPECT_FALSE(displayed_frame()); + } + + CheckUnique(); + + for (size_t i = 0; i < kSwapCount; ++i) { + unsigned int next_texture_id = in_flight_surfaces().front()->texture; + output_surface_->PageFlipComplete(); + EXPECT_EQ(displayed_frame()->texture, next_texture_id); + EXPECT_TRUE(displayed_frame()); + } + + DCHECK_EQ(2 * kSwapCount, + gpu_memory_buffer_manager_->set_color_space_count()); + for (size_t i = 0; i < kSwapCount; ++i) { + output_surface_->BindFramebuffer(); + SwapBuffers(); + output_surface_->PageFlipComplete(); + } + DCHECK_EQ(2 * kSwapCount, + gpu_memory_buffer_manager_->set_color_space_count()); +} + +TEST_F(BufferQueueMockedContextTest, RecreateBuffers) { + // This setup is to easily get one frame in each of: + // - currently bound for drawing. + // - in flight to GPU. + // - currently displayed. + // - free frame. + // This tests buffers in all states. + // Bind/swap pushes frames into the in flight list, then the PageFlipComplete + // calls pull one frame into displayed and another into the free list. + output_surface_->BindFramebuffer(); + SwapBuffers(); + output_surface_->BindFramebuffer(); + SwapBuffers(); + output_surface_->BindFramebuffer(); + SwapBuffers(); + output_surface_->BindFramebuffer(); + output_surface_->PageFlipComplete(); + output_surface_->PageFlipComplete(); + // We should have one buffer in each possible state right now, including one + // being drawn to. + ASSERT_EQ(1U, in_flight_surfaces().size()); + ASSERT_EQ(1U, available_surfaces().size()); + EXPECT_TRUE(displayed_frame()); + EXPECT_TRUE(current_frame()); + + auto* current = current_frame(); + auto* displayed = displayed_frame(); + auto* in_flight = in_flight_surfaces().front().get(); + auto* available = available_surfaces().front().get(); + + // Expect all 4 images to be destroyed, 3 of the existing textures to be + // copied from and 3 new images to be created. + EXPECT_CALL(*context_, createImageCHROMIUM(_, 0, 0, GL_RGB)).Times(3); + Expectation copy1 = EXPECT_CALL(*mock_output_surface_, + CopyBufferDamage(_, displayed->texture, _, _)) + .Times(1); + Expectation copy2 = EXPECT_CALL(*mock_output_surface_, + CopyBufferDamage(_, current->texture, _, _)) + .Times(1); + Expectation copy3 = EXPECT_CALL(*mock_output_surface_, + CopyBufferDamage(_, in_flight->texture, _, _)) + .Times(1); + + EXPECT_CALL(*context_, destroyImageCHROMIUM(displayed->image)) + .Times(1) + .After(copy1); + EXPECT_CALL(*context_, destroyImageCHROMIUM(current->image)) + .Times(1) + .After(copy2); + EXPECT_CALL(*context_, destroyImageCHROMIUM(in_flight->image)) + .Times(1) + .After(copy3); + EXPECT_CALL(*context_, destroyImageCHROMIUM(available->image)).Times(1); + // After copying, we expect the framebuffer binding to be updated. + EXPECT_CALL(*context_, bindFramebuffer(_, _)) + .After(copy1) + .After(copy2) + .After(copy3); + EXPECT_CALL(*context_, framebufferTexture2D(_, _, _, _, _)) + .After(copy1) + .After(copy2) + .After(copy3); + + output_surface_->RecreateBuffers(); + testing::Mock::VerifyAndClearExpectations(context_); + testing::Mock::VerifyAndClearExpectations(mock_output_surface_); + + // All free buffers should be destroyed, the remaining buffers should all + // be replaced but still valid. + EXPECT_EQ(1U, in_flight_surfaces().size()); + EXPECT_EQ(0U, available_surfaces().size()); + EXPECT_TRUE(displayed_frame()); + EXPECT_TRUE(current_frame()); +} + +TEST_F(BufferQueueTest, AllocateFails) { + output_surface_->Reshape(screen_size, 1.0f, gfx::ColorSpace(), false); + + // Succeed in the two swaps. + output_surface_->BindFramebuffer(); + EXPECT_TRUE(current_frame()); + output_surface_->SwapBuffers(screen_rect); + + // Fail the next surface allocation. + gpu_memory_buffer_manager_->set_allocate_succeeds(false); + output_surface_->BindFramebuffer(); + EXPECT_FALSE(current_frame()); + output_surface_->SwapBuffers(screen_rect); + EXPECT_FALSE(current_frame()); + + // Try another swap. It should copy the buffer damage from the back + // surface. + gpu_memory_buffer_manager_->set_allocate_succeeds(true); + output_surface_->BindFramebuffer(); + unsigned int source_texture = in_flight_surfaces().front()->texture; + unsigned int target_texture = current_frame()->texture; + testing::Mock::VerifyAndClearExpectations(mock_output_surface_); + EXPECT_CALL(*mock_output_surface_, + CopyBufferDamage(target_texture, source_texture, small_damage, _)) + .Times(1); + output_surface_->SwapBuffers(small_damage); + testing::Mock::VerifyAndClearExpectations(mock_output_surface_); + + // Destroy the just-created buffer, and try another swap. The copy should + // come from the displayed surface (because both in-flight surfaces are + // gone now). + output_surface_->PageFlipComplete(); + in_flight_surfaces().back().reset(); + EXPECT_EQ(2u, in_flight_surfaces().size()); + for (auto& surface : in_flight_surfaces()) + EXPECT_FALSE(surface); + output_surface_->BindFramebuffer(); + source_texture = displayed_frame()->texture; + EXPECT_TRUE(current_frame()); + EXPECT_TRUE(displayed_frame()); + target_texture = current_frame()->texture; + testing::Mock::VerifyAndClearExpectations(mock_output_surface_); + EXPECT_CALL(*mock_output_surface_, + CopyBufferDamage(target_texture, source_texture, small_damage, _)) + .Times(1); + output_surface_->SwapBuffers(small_damage); + testing::Mock::VerifyAndClearExpectations(mock_output_surface_); +} + +} // namespace +} // namespace viz
diff --git a/components/viz/service/display_embedder/compositor_overlay_candidate_validator.h b/components/viz/service/display_embedder/compositor_overlay_candidate_validator.h new file mode 100644 index 0000000..cbed76c --- /dev/null +++ b/components/viz/service/display_embedder/compositor_overlay_candidate_validator.h
@@ -0,0 +1,28 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_H_ +#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_H_ + +#include "base/macros.h" +#include "cc/output/overlay_candidate_validator.h" +#include "components/viz/service/viz_service_export.h" + +namespace viz { + +class VIZ_SERVICE_EXPORT CompositorOverlayCandidateValidator + : public cc::OverlayCandidateValidator { + public: + CompositorOverlayCandidateValidator() {} + ~CompositorOverlayCandidateValidator() override {} + + virtual void SetSoftwareMirrorMode(bool enabled) = 0; + + private: + DISALLOW_COPY_AND_ASSIGN(CompositorOverlayCandidateValidator); +}; + +} // namespace viz + +#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_H_
diff --git a/components/viz/service/display_embedder/compositor_overlay_candidate_validator_android.cc b/components/viz/service/display_embedder/compositor_overlay_candidate_validator_android.cc new file mode 100644 index 0000000..6c3a73a2 --- /dev/null +++ b/components/viz/service/display_embedder/compositor_overlay_candidate_validator_android.cc
@@ -0,0 +1,68 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator_android.h" + +#include <memory> + +#include "base/memory/ptr_util.h" +#include "cc/output/overlay_processor.h" +#include "cc/output/overlay_strategy_underlay.h" +#include "ui/gfx/geometry/rect_conversions.h" + +namespace viz { + +CompositorOverlayCandidateValidatorAndroid:: + CompositorOverlayCandidateValidatorAndroid() {} + +CompositorOverlayCandidateValidatorAndroid:: + ~CompositorOverlayCandidateValidatorAndroid() {} + +void CompositorOverlayCandidateValidatorAndroid::GetStrategies( + cc::OverlayProcessor::StrategyList* strategies) { + strategies->push_back(base::MakeUnique<cc::OverlayStrategyUnderlay>(this)); +} + +void CompositorOverlayCandidateValidatorAndroid::CheckOverlaySupport( + cc::OverlayCandidateList* candidates) { + // There should only be at most a single overlay candidate: the video quad. + // There's no check that the presented candidate is really a video frame for + // a fullscreen video. Instead it's assumed that if a quad is marked as + // overlayable, it's a fullscreen video quad. + DCHECK_LE(candidates->size(), 1u); + + if (!candidates->empty()) { + cc::OverlayCandidate& candidate = candidates->front(); + + // This quad either will be promoted, or would be if it were backed by a + // SurfaceView. Record that it should get a promotion hint. + candidates->AddPromotionHint(candidate); + + if (candidate.is_backed_by_surface_texture) { + // This quad would be promoted if it were backed by a SurfaceView. Since + // it isn't, we can't promote it. + return; + } + + candidate.display_rect = + gfx::RectF(gfx::ToEnclosingRect(candidate.display_rect)); + candidate.overlay_handled = true; + candidate.plane_z_order = -1; + } +} + +bool CompositorOverlayCandidateValidatorAndroid::AllowCALayerOverlays() { + return false; +} + +bool CompositorOverlayCandidateValidatorAndroid::AllowDCLayerOverlays() { + return false; +} + +// Overlays will still be allowed when software mirroring is enabled, even +// though they won't appear in the mirror. +void CompositorOverlayCandidateValidatorAndroid::SetSoftwareMirrorMode( + bool enabled) {} + +} // namespace viz
diff --git a/components/viz/service/display_embedder/compositor_overlay_candidate_validator_android.h b/components/viz/service/display_embedder/compositor_overlay_candidate_validator_android.h new file mode 100644 index 0000000..e9d3a30 --- /dev/null +++ b/components/viz/service/display_embedder/compositor_overlay_candidate_validator_android.h
@@ -0,0 +1,41 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_ANDROID_H_ +#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_ANDROID_H_ + +#include "base/macros.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator.h" +#include "components/viz/service/viz_service_export.h" + +namespace viz { + +// An overlay validator for supporting fullscreen video underlays on Android. +// Things are a bit different on Android compared with other platforms. By the +// time a video frame is marked as overlayable it means the video decoder was +// outputting to a Surface that we can't read back from. As a result, the +// overlay must always succeed, or the video won't be visible. This is one of of +// the reasons that only fullscreen is supported: we have to be sure that +// nothing will cause the overlay to be rejected, because there's no fallback to +// gl compositing. +class VIZ_SERVICE_EXPORT CompositorOverlayCandidateValidatorAndroid + : public CompositorOverlayCandidateValidator { + public: + CompositorOverlayCandidateValidatorAndroid(); + ~CompositorOverlayCandidateValidatorAndroid() override; + + void GetStrategies(cc::OverlayProcessor::StrategyList* strategies) override; + void CheckOverlaySupport(cc::OverlayCandidateList* surfaces) override; + bool AllowCALayerOverlays() override; + bool AllowDCLayerOverlays() override; + + void SetSoftwareMirrorMode(bool enabled) override; + + private: + DISALLOW_COPY_AND_ASSIGN(CompositorOverlayCandidateValidatorAndroid); +}; + +} // namespace viz + +#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_ANDROID_H_
diff --git a/components/viz/service/display_embedder/compositor_overlay_candidate_validator_mac.h b/components/viz/service/display_embedder/compositor_overlay_candidate_validator_mac.h new file mode 100644 index 0000000..aade5d1 --- /dev/null +++ b/components/viz/service/display_embedder/compositor_overlay_candidate_validator_mac.h
@@ -0,0 +1,40 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_MAC_H_ +#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_MAC_H_ + +#include <memory> + +#include "base/macros.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator.h" +#include "components/viz/service/viz_service_export.h" + +namespace viz { + +class VIZ_SERVICE_EXPORT CompositorOverlayCandidateValidatorMac + : public CompositorOverlayCandidateValidator { + public: + explicit CompositorOverlayCandidateValidatorMac(bool ca_layer_disabled); + ~CompositorOverlayCandidateValidatorMac() override; + + // cc::OverlayCandidateValidator implementation. + void GetStrategies(cc::OverlayProcessor::StrategyList* strategies) override; + bool AllowCALayerOverlays() override; + bool AllowDCLayerOverlays() override; + void CheckOverlaySupport(cc::OverlayCandidateList* surfaces) override; + + // CompositorOverlayCandidateValidator implementation. + void SetSoftwareMirrorMode(bool enabled) override; + + private: + bool software_mirror_active_; + const bool ca_layer_disabled_; + + DISALLOW_COPY_AND_ASSIGN(CompositorOverlayCandidateValidatorMac); +}; + +} // namespace viz + +#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_MAC_H_
diff --git a/components/viz/service/display_embedder/compositor_overlay_candidate_validator_mac.mm b/components/viz/service/display_embedder/compositor_overlay_candidate_validator_mac.mm new file mode 100644 index 0000000..fa2f5c7 --- /dev/null +++ b/components/viz/service/display_embedder/compositor_overlay_candidate_validator_mac.mm
@@ -0,0 +1,37 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator_mac.h" + +#include <stddef.h> + +namespace viz { + +CompositorOverlayCandidateValidatorMac::CompositorOverlayCandidateValidatorMac( + bool ca_layer_disabled) + : software_mirror_active_(false), ca_layer_disabled_(ca_layer_disabled) {} + +CompositorOverlayCandidateValidatorMac:: + ~CompositorOverlayCandidateValidatorMac() {} + +void CompositorOverlayCandidateValidatorMac::GetStrategies( + cc::OverlayProcessor::StrategyList* strategies) {} + +bool CompositorOverlayCandidateValidatorMac::AllowCALayerOverlays() { + return !ca_layer_disabled_ && !software_mirror_active_; +} + +bool CompositorOverlayCandidateValidatorMac::AllowDCLayerOverlays() { + return false; +} + +void CompositorOverlayCandidateValidatorMac::CheckOverlaySupport( + cc::OverlayCandidateList* surfaces) {} + +void CompositorOverlayCandidateValidatorMac::SetSoftwareMirrorMode( + bool enabled) { + software_mirror_active_ = enabled; +} + +} // namespace viz
diff --git a/components/viz/service/display_embedder/compositor_overlay_candidate_validator_ozone.cc b/components/viz/service/display_embedder/compositor_overlay_candidate_validator_ozone.cc new file mode 100644 index 0000000..de5ec40 --- /dev/null +++ b/components/viz/service/display_embedder/compositor_overlay_candidate_validator_ozone.cc
@@ -0,0 +1,128 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator_ozone.h" + +#include <stddef.h> + +#include <utility> + +#include "base/bind.h" +#include "base/memory/ptr_util.h" +#include "base/strings/string_split.h" +#include "cc/output/overlay_strategy_fullscreen.h" +#include "cc/output/overlay_strategy_single_on_top.h" +#include "cc/output/overlay_strategy_underlay.h" +#include "cc/output/overlay_strategy_underlay_cast.h" +#include "ui/ozone/public/overlay_candidates_ozone.h" + +namespace viz { +namespace { +// Templated function used to create an OverlayProcessor::Strategy +// of type |S|. +template <typename S> +std::unique_ptr<cc::OverlayProcessor::Strategy> MakeOverlayStrategy( + CompositorOverlayCandidateValidatorOzone* capability_checker) { + return base::MakeUnique<S>(capability_checker); +} + +} // namespace + +// |overlay_candidates| is an object used to answer questions about possible +// overlays configuarations. +// |strategies_string| is a comma-separated string containing all the overaly +// strategies that should be returned by GetStrategies. +// If |strategies_string| is empty "single-on-top,underlay" will be used as +// default. +CompositorOverlayCandidateValidatorOzone:: + CompositorOverlayCandidateValidatorOzone( + std::unique_ptr<ui::OverlayCandidatesOzone> overlay_candidates, + std::string strategies_string) + : overlay_candidates_(std::move(overlay_candidates)), + software_mirror_active_(false) { + if (!strategies_string.length()) + strategies_string = "single-on-top,underlay"; + + for (const auto& strategy_name : + base::SplitStringPiece(strategies_string, ",", base::TRIM_WHITESPACE, + base::SPLIT_WANT_NONEMPTY)) { + if (strategy_name == "single-fullscreen") { + strategies_instantiators_.push_back( + base::Bind(MakeOverlayStrategy<cc::OverlayStrategyFullscreen>)); + } else if (strategy_name == "single-on-top") { + strategies_instantiators_.push_back( + base::Bind(MakeOverlayStrategy<cc::OverlayStrategySingleOnTop>)); + } else if (strategy_name == "underlay") { + strategies_instantiators_.push_back( + base::Bind(MakeOverlayStrategy<cc::OverlayStrategyUnderlay>)); + } else if (strategy_name == "cast") { + strategies_instantiators_.push_back( + base::Bind(MakeOverlayStrategy<cc::OverlayStrategyUnderlayCast>)); + } else { + LOG(WARNING) << "Unrecognized overlay strategy " << strategy_name; + } + } +} + +CompositorOverlayCandidateValidatorOzone:: + ~CompositorOverlayCandidateValidatorOzone() {} + +void CompositorOverlayCandidateValidatorOzone::GetStrategies( + cc::OverlayProcessor::StrategyList* strategies) { + for (auto& instantiator : strategies_instantiators_) + strategies->push_back(instantiator.Run(this)); +} + +bool CompositorOverlayCandidateValidatorOzone::AllowCALayerOverlays() { + return false; +} + +bool CompositorOverlayCandidateValidatorOzone::AllowDCLayerOverlays() { + return false; +} + +void CompositorOverlayCandidateValidatorOzone::CheckOverlaySupport( + cc::OverlayCandidateList* surfaces) { + // SW mirroring copies out of the framebuffer, so we can't remove any + // quads for overlaying, otherwise the output is incorrect. + if (software_mirror_active_) { + for (size_t i = 0; i < surfaces->size(); i++) { + surfaces->at(i).overlay_handled = false; + } + return; + } + + DCHECK_GE(2U, surfaces->size()); + ui::OverlayCandidatesOzone::OverlaySurfaceCandidateList ozone_surface_list; + ozone_surface_list.resize(surfaces->size()); + + for (size_t i = 0; i < surfaces->size(); i++) { + ozone_surface_list.at(i).transform = surfaces->at(i).transform; + ozone_surface_list.at(i).format = surfaces->at(i).format; + ozone_surface_list.at(i).display_rect = surfaces->at(i).display_rect; + ozone_surface_list.at(i).crop_rect = surfaces->at(i).uv_rect; + ozone_surface_list.at(i).quad_rect_in_target_space = + surfaces->at(i).quad_rect_in_target_space; + ozone_surface_list.at(i).clip_rect = surfaces->at(i).clip_rect; + ozone_surface_list.at(i).is_clipped = surfaces->at(i).is_clipped; + ozone_surface_list.at(i).plane_z_order = surfaces->at(i).plane_z_order; + ozone_surface_list.at(i).buffer_size = + surfaces->at(i).resource_size_in_pixels; + } + + overlay_candidates_->CheckOverlaySupport(&ozone_surface_list); + DCHECK_EQ(surfaces->size(), ozone_surface_list.size()); + + for (size_t i = 0; i < surfaces->size(); i++) { + surfaces->at(i).overlay_handled = ozone_surface_list.at(i).overlay_handled; + surfaces->at(i).display_rect = ozone_surface_list.at(i).display_rect; + } +} + +void CompositorOverlayCandidateValidatorOzone::SetSoftwareMirrorMode( + bool enabled) { + software_mirror_active_ = enabled; +} + +} // namespace viz
diff --git a/components/viz/service/display_embedder/compositor_overlay_candidate_validator_ozone.h b/components/viz/service/display_embedder/compositor_overlay_candidate_validator_ozone.h new file mode 100644 index 0000000..4ba9429 --- /dev/null +++ b/components/viz/service/display_embedder/compositor_overlay_candidate_validator_ozone.h
@@ -0,0 +1,55 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_OZONE_H_ +#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_OZONE_H_ + +#include <memory> + +#include "base/callback.h" +#include "base/macros.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator.h" +#include "components/viz/service/viz_service_export.h" +#include "ui/gfx/native_widget_types.h" + +namespace ui { +class OverlayCandidatesOzone; +} + +namespace viz { + +class VIZ_SERVICE_EXPORT CompositorOverlayCandidateValidatorOzone + : public CompositorOverlayCandidateValidator { + public: + CompositorOverlayCandidateValidatorOzone( + std::unique_ptr<ui::OverlayCandidatesOzone> overlay_candidates, + std::string strategies_string); + ~CompositorOverlayCandidateValidatorOzone() override; + + // cc::OverlayCandidateValidator implementation. + void GetStrategies(cc::OverlayProcessor::StrategyList* strategies) override; + bool AllowCALayerOverlays() override; + bool AllowDCLayerOverlays() override; + void CheckOverlaySupport(cc::OverlayCandidateList* surfaces) override; + + // CompositorOverlayCandidateValidator implementation. + void SetSoftwareMirrorMode(bool enabled) override; + + private: + std::unique_ptr<ui::OverlayCandidatesOzone> overlay_candidates_; + // Callback declaration to allocate a new OverlayProcessor::Strategy. + using StrategyInstantiator = + base::Callback<std::unique_ptr<cc::OverlayProcessor::Strategy>( + CompositorOverlayCandidateValidatorOzone*)>; + // List callbacks used to instantiate OverlayProcessor::Strategy + // as defined by |strategies_string| paramter in the constructor. + std::vector<StrategyInstantiator> strategies_instantiators_; + bool software_mirror_active_; + + DISALLOW_COPY_AND_ASSIGN(CompositorOverlayCandidateValidatorOzone); +}; + +} // namespace viz + +#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_OZONE_H_
diff --git a/components/viz/service/display_embedder/compositor_overlay_candidate_validator_win.cc b/components/viz/service/display_embedder/compositor_overlay_candidate_validator_win.cc new file mode 100644 index 0000000..bb22c57 --- /dev/null +++ b/components/viz/service/display_embedder/compositor_overlay_candidate_validator_win.cc
@@ -0,0 +1,39 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator_win.h" + +#include "cc/output/overlay_processor.h" + +namespace viz { + +CompositorOverlayCandidateValidatorWin:: + CompositorOverlayCandidateValidatorWin() {} + +CompositorOverlayCandidateValidatorWin:: + ~CompositorOverlayCandidateValidatorWin() {} + +void CompositorOverlayCandidateValidatorWin::GetStrategies( + cc::OverlayProcessor::StrategyList* strategies) {} + +void CompositorOverlayCandidateValidatorWin::CheckOverlaySupport( + cc::OverlayCandidateList* candidates) { + NOTIMPLEMENTED(); +} + +bool CompositorOverlayCandidateValidatorWin::AllowCALayerOverlays() { + return false; +} + +bool CompositorOverlayCandidateValidatorWin::AllowDCLayerOverlays() { + return true; +} + +void CompositorOverlayCandidateValidatorWin::SetSoftwareMirrorMode( + bool enabled) { + // Software mirroring isn't supported on Windows. + NOTIMPLEMENTED(); +} + +} // namespace viz
diff --git a/components/viz/service/display_embedder/compositor_overlay_candidate_validator_win.h b/components/viz/service/display_embedder/compositor_overlay_candidate_validator_win.h new file mode 100644 index 0000000..c5a20c6 --- /dev/null +++ b/components/viz/service/display_embedder/compositor_overlay_candidate_validator_win.h
@@ -0,0 +1,35 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_WIN_H_ +#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_WIN_H_ + +#include "base/macros.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator.h" +#include "components/viz/service/viz_service_export.h" + +namespace viz { + +// This is a simple overlay candidate validator that promotes everything +// possible to an overlay. +class VIZ_SERVICE_EXPORT CompositorOverlayCandidateValidatorWin + : public CompositorOverlayCandidateValidator { + public: + CompositorOverlayCandidateValidatorWin(); + ~CompositorOverlayCandidateValidatorWin() override; + + void GetStrategies(cc::OverlayProcessor::StrategyList* strategies) override; + void CheckOverlaySupport(cc::OverlayCandidateList* surfaces) override; + bool AllowCALayerOverlays() override; + bool AllowDCLayerOverlays() override; + + void SetSoftwareMirrorMode(bool enabled) override; + + private: + DISALLOW_COPY_AND_ASSIGN(CompositorOverlayCandidateValidatorWin); +}; + +} // namespace viz + +#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_WIN_H_
diff --git a/components/viz/service/display_embedder/display_output_surface.cc b/components/viz/service/display_embedder/display_output_surface.cc new file mode 100644 index 0000000..04cf8f1 --- /dev/null +++ b/components/viz/service/display_embedder/display_output_surface.cc
@@ -0,0 +1,148 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/viz/service/display_embedder/display_output_surface.h" + +#include <stdint.h> + +#include "base/bind.h" +#include "base/memory/ptr_util.h" +#include "base/threading/thread_task_runner_handle.h" +#include "cc/output/context_provider.h" +#include "cc/output/output_surface_client.h" +#include "cc/output/output_surface_frame.h" +#include "cc/scheduler/begin_frame_source.h" +#include "gpu/command_buffer/client/context_support.h" +#include "gpu/command_buffer/client/gles2_interface.h" + +namespace viz { + +DisplayOutputSurface::DisplayOutputSurface( + scoped_refptr<cc::InProcessContextProvider> context_provider, + cc::SyntheticBeginFrameSource* synthetic_begin_frame_source) + : cc::OutputSurface(context_provider), + synthetic_begin_frame_source_(synthetic_begin_frame_source), + weak_ptr_factory_(this) { + capabilities_.flipped_output_surface = + context_provider->ContextCapabilities().flips_vertically; + capabilities_.supports_stencil = + context_provider->ContextCapabilities().num_stencil_bits > 0; + context_provider->SetSwapBuffersCompletionCallback( + base::Bind(&DisplayOutputSurface::OnGpuSwapBuffersCompleted, + weak_ptr_factory_.GetWeakPtr())); + context_provider->SetUpdateVSyncParametersCallback( + base::Bind(&DisplayOutputSurface::OnVSyncParametersUpdated, + weak_ptr_factory_.GetWeakPtr())); +} + +DisplayOutputSurface::~DisplayOutputSurface() {} + +void DisplayOutputSurface::BindToClient(cc::OutputSurfaceClient* client) { + DCHECK(client); + DCHECK(!client_); + client_ = client; +} + +void DisplayOutputSurface::EnsureBackbuffer() {} + +void DisplayOutputSurface::DiscardBackbuffer() { + context_provider()->ContextGL()->DiscardBackbufferCHROMIUM(); +} + +void DisplayOutputSurface::BindFramebuffer() { + context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); +} + +void DisplayOutputSurface::SetDrawRectangle(const gfx::Rect& rect) { + if (set_draw_rectangle_for_frame_) + return; + DCHECK(gfx::Rect(size_).Contains(rect)); + DCHECK(has_set_draw_rectangle_since_last_resize_ || + (gfx::Rect(size_) == rect)); + set_draw_rectangle_for_frame_ = true; + has_set_draw_rectangle_since_last_resize_ = true; + context_provider()->ContextGL()->SetDrawRectangleCHROMIUM( + rect.x(), rect.y(), rect.width(), rect.height()); +} + +void DisplayOutputSurface::Reshape(const gfx::Size& size, + float device_scale_factor, + const gfx::ColorSpace& color_space, + bool has_alpha, + bool use_stencil) { + size_ = size; + has_set_draw_rectangle_since_last_resize_ = false; + context_provider()->ContextGL()->ResizeCHROMIUM( + size.width(), size.height(), device_scale_factor, has_alpha); +} + +void DisplayOutputSurface::SwapBuffers(cc::OutputSurfaceFrame frame) { + DCHECK(context_provider_); + + if (frame.latency_info.size() > 0) + context_provider_->ContextSupport()->AddLatencyInfo(frame.latency_info); + + set_draw_rectangle_for_frame_ = false; + if (frame.sub_buffer_rect) { + context_provider_->ContextSupport()->PartialSwapBuffers( + *frame.sub_buffer_rect); + } else { + context_provider_->ContextSupport()->Swap(); + } +} + +uint32_t DisplayOutputSurface::GetFramebufferCopyTextureFormat() { + // TODO(danakj): What attributes are used for the default framebuffer here? + // Can it have alpha? cc::InProcessContextProvider doesn't take any + // attributes. + return GL_RGB; +} + +cc::OverlayCandidateValidator* +DisplayOutputSurface::GetOverlayCandidateValidator() const { + return nullptr; +} + +bool DisplayOutputSurface::IsDisplayedAsOverlayPlane() const { + return false; +} + +unsigned DisplayOutputSurface::GetOverlayTextureId() const { + return 0; +} + +bool DisplayOutputSurface::SurfaceIsSuspendForRecycle() const { + return false; +} + +bool DisplayOutputSurface::HasExternalStencilTest() const { + return false; +} + +void DisplayOutputSurface::ApplyExternalStencil() {} + +void DisplayOutputSurface::DidReceiveSwapBuffersAck(gfx::SwapResult result) { + client_->DidReceiveSwapBuffersAck(); +} + +void DisplayOutputSurface::OnGpuSwapBuffersCompleted( + const std::vector<ui::LatencyInfo>& latency_info, + gfx::SwapResult result, + const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) { + for (const auto& latency : latency_info) { + if (latency.latency_components().size() > 0) + latency_tracker_.OnGpuSwapBuffersCompleted(latency); + } + DidReceiveSwapBuffersAck(result); +} + +void DisplayOutputSurface::OnVSyncParametersUpdated(base::TimeTicks timebase, + base::TimeDelta interval) { + // TODO(brianderson): We should not be receiving 0 intervals. + synthetic_begin_frame_source_->OnUpdateVSyncParameters( + timebase, + interval.is_zero() ? cc::BeginFrameArgs::DefaultInterval() : interval); +} + +} // namespace viz
diff --git a/components/viz/service/display_embedder/display_output_surface.h b/components/viz/service/display_embedder/display_output_surface.h new file mode 100644 index 0000000..0dad061e --- /dev/null +++ b/components/viz/service/display_embedder/display_output_surface.h
@@ -0,0 +1,78 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_DISPLAY_OUTPUT_SURFACE_H_ +#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_DISPLAY_OUTPUT_SURFACE_H_ + +#include <memory> + +#include "cc/output/in_process_context_provider.h" +#include "cc/output/output_surface.h" +#include "ui/latency/latency_tracker.h" + +namespace cc { +class SyntheticBeginFrameSource; +} + +namespace viz { + +// An OutputSurface implementation that directly draws and +// swaps to an actual GL surface. +class DisplayOutputSurface : public cc::OutputSurface { + public: + DisplayOutputSurface( + scoped_refptr<cc::InProcessContextProvider> context_provider, + cc::SyntheticBeginFrameSource* synthetic_begin_frame_source); + ~DisplayOutputSurface() override; + + // cc::OutputSurface implementation + void BindToClient(cc::OutputSurfaceClient* client) override; + void EnsureBackbuffer() override; + void DiscardBackbuffer() override; + void BindFramebuffer() override; + void SetDrawRectangle(const gfx::Rect& draw_rectangle) override; + void Reshape(const gfx::Size& size, + float device_scale_factor, + const gfx::ColorSpace& color_space, + bool has_alpha, + bool use_stencil) override; + void SwapBuffers(cc::OutputSurfaceFrame frame) override; + uint32_t GetFramebufferCopyTextureFormat() override; + cc::OverlayCandidateValidator* GetOverlayCandidateValidator() const override; + bool IsDisplayedAsOverlayPlane() const override; + unsigned GetOverlayTextureId() const override; + bool SurfaceIsSuspendForRecycle() const override; + bool HasExternalStencilTest() const override; + void ApplyExternalStencil() override; + + protected: + cc::OutputSurfaceClient* client() const { return client_; } + + // Called when a swap completion is signaled from ImageTransportSurface. + virtual void DidReceiveSwapBuffersAck(gfx::SwapResult result); + + private: + // Called when a swap completion is signaled from ImageTransportSurface. + void OnGpuSwapBuffersCompleted( + const std::vector<ui::LatencyInfo>& latency_info, + gfx::SwapResult result, + const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac); + void OnVSyncParametersUpdated(base::TimeTicks timebase, + base::TimeDelta interval); + + cc::OutputSurfaceClient* client_ = nullptr; + cc::SyntheticBeginFrameSource* const synthetic_begin_frame_source_; + ui::LatencyTracker latency_tracker_; + + bool set_draw_rectangle_for_frame_ = false; + // True if the draw rectangle has been set at all since the last resize. + bool has_set_draw_rectangle_since_last_resize_ = false; + gfx::Size size_; + + base::WeakPtrFactory<DisplayOutputSurface> weak_ptr_factory_; +}; + +} // namespace viz + +#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_DISPLAY_OUTPUT_SURFACE_H_
diff --git a/components/viz/service/display_embedder/display_output_surface_ozone.cc b/components/viz/service/display_embedder/display_output_surface_ozone.cc new file mode 100644 index 0000000..a9d2dc5 --- /dev/null +++ b/components/viz/service/display_embedder/display_output_surface_ozone.cc
@@ -0,0 +1,126 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/viz/service/display_embedder/display_output_surface_ozone.h" + +#include <utility> + +#include "base/bind.h" +#include "base/memory/ptr_util.h" +#include "cc/output/context_provider.h" +#include "cc/output/output_surface_client.h" +#include "cc/output/output_surface_frame.h" +#include "cc/scheduler/begin_frame_source.h" +#include "components/viz/service/display_embedder/buffer_queue.h" +#include "gpu/command_buffer/client/context_support.h" +#include "gpu/command_buffer/client/gles2_interface.h" +#include "ui/display/types/display_snapshot.h" + +namespace viz { + +DisplayOutputSurfaceOzone::DisplayOutputSurfaceOzone( + scoped_refptr<cc::InProcessContextProvider> context_provider, + gfx::AcceleratedWidget widget, + cc::SyntheticBeginFrameSource* synthetic_begin_frame_source, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, + uint32_t target, + uint32_t internalformat) + : DisplayOutputSurface(context_provider, synthetic_begin_frame_source), + gl_helper_(context_provider->ContextGL(), + context_provider->ContextSupport()) { + capabilities_.uses_default_gl_framebuffer = false; + capabilities_.flipped_output_surface = true; + // Set |max_frames_pending| to 2 for surfaceless, which aligns scheduling + // more closely with the previous surfaced behavior. + // With a surface, swap buffer ack used to return early, before actually + // presenting the back buffer, enabling the browser compositor to run ahead. + // Surfaceless implementation acks at the time of actual buffer swap, which + // shifts the start of the new frame forward relative to the old + // implementation. + capabilities_.max_frames_pending = 2; + + buffer_queue_.reset( + new BufferQueue(context_provider->ContextGL(), target, internalformat, + display::DisplaySnapshot::PrimaryFormat(), &gl_helper_, + gpu_memory_buffer_manager, widget)); + buffer_queue_->Initialize(); +} + +DisplayOutputSurfaceOzone::~DisplayOutputSurfaceOzone() { + // TODO(rjkroege): Support cleanup. +} + +void DisplayOutputSurfaceOzone::BindFramebuffer() { + DCHECK(buffer_queue_); + buffer_queue_->BindFramebuffer(); +} + +// We call this on every frame that a value changes, but changing the size once +// we've allocated backing NativePixmapOzone instances will cause a DCHECK +// because Chrome never Reshape(s) after the first one from (0,0). NB: this +// implies that screen size changes need to be plumbed differently. In +// particular, we must create the native window in the size that the hardware +// reports. +void DisplayOutputSurfaceOzone::Reshape(const gfx::Size& size, + float device_scale_factor, + const gfx::ColorSpace& color_space, + bool has_alpha, + bool use_stencil) { + reshape_size_ = size; + DisplayOutputSurface::Reshape(size, device_scale_factor, color_space, + has_alpha, use_stencil); + buffer_queue_->Reshape(size, device_scale_factor, color_space, use_stencil); +} + +void DisplayOutputSurfaceOzone::SwapBuffers(cc::OutputSurfaceFrame frame) { + DCHECK(buffer_queue_); + + // TODO(rjkroege): What if swap happens again before DidReceiveSwapBuffersAck + // then it would see the wrong size? + DCHECK(reshape_size_ == frame.size); + swap_size_ = reshape_size_; + + gfx::Rect damage_rect = + frame.sub_buffer_rect ? *frame.sub_buffer_rect : gfx::Rect(swap_size_); + // Use previous buffer when damage rect is empty. This avoids unnecessary + // partial swap work and makes it possible to support empty swaps on devices + // where partial swaps are disabled. + if (!damage_rect.IsEmpty()) + buffer_queue_->SwapBuffers(damage_rect); + + DisplayOutputSurface::SwapBuffers(std::move(frame)); +} + +uint32_t DisplayOutputSurfaceOzone::GetFramebufferCopyTextureFormat() { + return buffer_queue_->internal_format(); +} + +bool DisplayOutputSurfaceOzone::IsDisplayedAsOverlayPlane() const { + // TODO(rjkroege): implement remaining overlay functionality. + return true; +} + +unsigned DisplayOutputSurfaceOzone::GetOverlayTextureId() const { + return buffer_queue_->GetCurrentTextureId(); +} + +void DisplayOutputSurfaceOzone::DidReceiveSwapBuffersAck( + gfx::SwapResult result) { + bool force_swap = false; + if (result == gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS) { + // Even through the swap failed, this is a fixable error so we can pretend + // it succeeded to the rest of the system. + result = gfx::SwapResult::SWAP_ACK; + buffer_queue_->RecreateBuffers(); + force_swap = true; + } + + buffer_queue_->PageFlipComplete(); + client()->DidReceiveSwapBuffersAck(); + + if (force_swap) + client()->SetNeedsRedrawRect(gfx::Rect(swap_size_)); +} + +} // namespace viz
diff --git a/components/viz/service/display_embedder/display_output_surface_ozone.h b/components/viz/service/display_embedder/display_output_surface_ozone.h new file mode 100644 index 0000000..46999009 --- /dev/null +++ b/components/viz/service/display_embedder/display_output_surface_ozone.h
@@ -0,0 +1,78 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_DISPLAY_OUTPUT_SURFACE_OZONE_H_ +#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_DISPLAY_OUTPUT_SURFACE_OZONE_H_ + +#include <memory> + +#include "base/memory/weak_ptr.h" +#include "cc/output/context_provider.h" +#include "cc/output/in_process_context_provider.h" +#include "cc/output/output_surface.h" +#include "components/viz/common/gl_helper.h" +#include "components/viz/service/display_embedder/display_output_surface.h" +#include "ui/gfx/geometry/size.h" +#include "ui/gfx/native_widget_types.h" +#include "ui/gfx/swap_result.h" +#include "ui/gl/gl_surface.h" + +namespace cc { +class SyntheticBeginFrameSource; +} + +namespace gpu { +class GpuMemoryBufferManager; +} + +namespace viz { + +class BufferQueue; + +// An OutputSurface implementation that directly draws and swap to a GL +// "surfaceless" surface (aka one backed by a buffer managed explicitly in +// mus/ozone. This class is adapted from +// GpuSurfacelessBrowserCompositorOutputSurface. +class DisplayOutputSurfaceOzone : public DisplayOutputSurface { + public: + DisplayOutputSurfaceOzone( + scoped_refptr<cc::InProcessContextProvider> context_provider, + gfx::AcceleratedWidget widget, + cc::SyntheticBeginFrameSource* synthetic_begin_frame_source, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, + uint32_t target, + uint32_t internalformat); + + ~DisplayOutputSurfaceOzone() override; + + // TODO(rjkroege): Implement the equivalent of Reflector. + + private: + // cc::OutputSurface implementation. + void BindFramebuffer() override; + void Reshape(const gfx::Size& size, + float device_scale_factor, + const gfx::ColorSpace& color_space, + bool has_alpha, + bool use_stencil) override; + void SwapBuffers(cc::OutputSurfaceFrame frame) override; + uint32_t GetFramebufferCopyTextureFormat() override; + bool IsDisplayedAsOverlayPlane() const override; + unsigned GetOverlayTextureId() const override; + + // DisplayOutputSurface: + void DidReceiveSwapBuffersAck(gfx::SwapResult result) override; + + GLHelper gl_helper_; + std::unique_ptr<BufferQueue> buffer_queue_; + + gfx::Size reshape_size_; + gfx::Size swap_size_; + + DISALLOW_COPY_AND_ASSIGN(DisplayOutputSurfaceOzone); +}; + +} // namespace viz + +#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_DISPLAY_OUTPUT_SURFACE_OZONE_H_
diff --git a/components/viz/service/display_embedder/display_provider.h b/components/viz/service/display_embedder/display_provider.h new file mode 100644 index 0000000..4b997c8 --- /dev/null +++ b/components/viz/service/display_embedder/display_provider.h
@@ -0,0 +1,36 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_DISPLAY_PROVIDER_H_ +#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_DISPLAY_PROVIDER_H_ + +#include <memory> + +#include "gpu/ipc/common/surface_handle.h" + +namespace cc { +class BeginFrameSource; +class Display; +class FrameSinkId; +} // namespace cc + +namespace viz { + +// Handles creating new cc::Displays and related classes for +// FrameSinkManagerImpl. +class DisplayProvider { + public: + virtual ~DisplayProvider() {} + + // Creates a new cc::Display for |surface_handle| with |frame_sink_id|. Will + // also create cc::BeginFrameSource and return it in |begin_frame_source|. + virtual std::unique_ptr<cc::Display> CreateDisplay( + const cc::FrameSinkId& frame_sink_id, + gpu::SurfaceHandle surface_handle, + std::unique_ptr<cc::BeginFrameSource>* begin_frame_source) = 0; +}; + +} // namespace viz + +#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_DISPLAY_PROVIDER_H_
diff --git a/components/viz/service/display_embedder/gpu_display_provider.cc b/components/viz/service/display_embedder/gpu_display_provider.cc new file mode 100644 index 0000000..aab7a8f --- /dev/null +++ b/components/viz/service/display_embedder/gpu_display_provider.cc
@@ -0,0 +1,109 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/viz/service/display_embedder/gpu_display_provider.h" + +#include <utility> + +#include "base/command_line.h" +#include "base/memory/ptr_util.h" +#include "base/threading/thread_task_runner_handle.h" +#include "cc/base/switches.h" +#include "cc/output/in_process_context_provider.h" +#include "cc/output/texture_mailbox_deleter.h" +#include "cc/scheduler/begin_frame_source.h" +#include "cc/surfaces/display.h" +#include "cc/surfaces/display_scheduler.h" +#include "components/viz/service/display_embedder/display_output_surface.h" +#include "components/viz/service/display_embedder/in_process_gpu_memory_buffer_manager.h" +#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h" +#include "gpu/command_buffer/client/shared_memory_limits.h" +#include "gpu/command_buffer/service/image_factory.h" +#include "gpu/ipc/service/gpu_channel_manager.h" +#include "gpu/ipc/service/gpu_memory_buffer_factory.h" + +#if defined(USE_OZONE) +#include "components/viz/service/display_embedder/display_output_surface_ozone.h" +#include "gpu/command_buffer/client/gles2_interface.h" +#endif + +namespace { + +gpu::ImageFactory* GetImageFactory(gpu::GpuChannelManager* channel_manager) { + auto* buffer_factory = channel_manager->gpu_memory_buffer_factory(); + return buffer_factory ? buffer_factory->AsImageFactory() : nullptr; +} + +} // namespace + +namespace viz { + +GpuDisplayProvider::GpuDisplayProvider( + scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service, + gpu::GpuChannelManager* gpu_channel_manager) + : gpu_service_(std::move(gpu_service)), + gpu_memory_buffer_manager_( + base::MakeUnique<InProcessGpuMemoryBufferManager>( + gpu_channel_manager)), + image_factory_(GetImageFactory(gpu_channel_manager)), + task_runner_(base::ThreadTaskRunnerHandle::Get()) {} + +GpuDisplayProvider::~GpuDisplayProvider() = default; + +std::unique_ptr<cc::Display> GpuDisplayProvider::CreateDisplay( + const cc::FrameSinkId& frame_sink_id, + gpu::SurfaceHandle surface_handle, + std::unique_ptr<cc::BeginFrameSource>* begin_frame_source) { + auto synthetic_begin_frame_source = + base::MakeUnique<cc::DelayBasedBeginFrameSource>( + base::MakeUnique<cc::DelayBasedTimeSource>(task_runner_.get())); + + scoped_refptr<cc::InProcessContextProvider> context_provider = + new cc::InProcessContextProvider( + gpu_service_, surface_handle, gpu_memory_buffer_manager_.get(), + image_factory_, gpu::SharedMemoryLimits(), + nullptr /* shared_context */); + + // TODO(rjkroege): If there is something better to do than CHECK, add it. + CHECK(context_provider->BindToCurrentThread()); + + std::unique_ptr<cc::OutputSurface> display_output_surface; + if (context_provider->ContextCapabilities().surfaceless) { +#if defined(USE_OZONE) + display_output_surface = base::MakeUnique<DisplayOutputSurfaceOzone>( + std::move(context_provider), surface_handle, + synthetic_begin_frame_source.get(), gpu_memory_buffer_manager_.get(), + GL_TEXTURE_2D, GL_RGB); +#else + NOTREACHED(); +#endif + } else { + display_output_surface = base::MakeUnique<DisplayOutputSurface>( + std::move(context_provider), synthetic_begin_frame_source.get()); + } + + int max_frames_pending = + display_output_surface->capabilities().max_frames_pending; + DCHECK_GT(max_frames_pending, 0); + + auto scheduler = base::MakeUnique<cc::DisplayScheduler>( + synthetic_begin_frame_source.get(), task_runner_.get(), + max_frames_pending); + + cc::RendererSettings settings; + settings.show_overdraw_feedback = + base::CommandLine::ForCurrentProcess()->HasSwitch( + cc::switches::kShowOverdrawFeedback); + + // The ownership of the BeginFrameSource is transfered to the caller. + *begin_frame_source = std::move(synthetic_begin_frame_source); + + return base::MakeUnique<cc::Display>( + ServerSharedBitmapManager::current(), gpu_memory_buffer_manager_.get(), + settings, frame_sink_id, std::move(display_output_surface), + std::move(scheduler), + base::MakeUnique<cc::TextureMailboxDeleter>(task_runner_.get())); +} + +} // namespace viz
diff --git a/components/viz/service/display_embedder/gpu_display_provider.h b/components/viz/service/display_embedder/gpu_display_provider.h new file mode 100644 index 0000000..3c21ebd --- /dev/null +++ b/components/viz/service/display_embedder/gpu_display_provider.h
@@ -0,0 +1,54 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_GPU_DISPLAY_PROVIDER_H_ +#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_GPU_DISPLAY_PROVIDER_H_ + +#include <memory> + +#include "base/compiler_specific.h" +#include "base/macros.h" +#include "base/memory/ref_counted.h" +#include "cc/surfaces/frame_sink_id.h" +#include "components/viz/service/display_embedder/display_provider.h" +#include "components/viz/service/viz_service_export.h" +#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" +#include "gpu/ipc/common/surface_handle.h" +#include "gpu/ipc/in_process_command_buffer.h" + +namespace gpu { +class GpuChannelManager; +class ImageFactory; +} // namespace gpu + +namespace viz { + +// In-process implementation of DisplayProvider. +class VIZ_SERVICE_EXPORT GpuDisplayProvider + : public NON_EXPORTED_BASE(DisplayProvider) { + public: + GpuDisplayProvider( + scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service, + gpu::GpuChannelManager* gpu_channel_manager); + ~GpuDisplayProvider() override; + + // DisplayProvider: + std::unique_ptr<cc::Display> CreateDisplay( + const cc::FrameSinkId& frame_sink_id, + gpu::SurfaceHandle surface_handle, + std::unique_ptr<cc::BeginFrameSource>* begin_frame_source) override; + + private: + scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service_; + std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager_; + gpu::ImageFactory* image_factory_; + + scoped_refptr<base::SingleThreadTaskRunner> task_runner_; + + DISALLOW_COPY_AND_ASSIGN(GpuDisplayProvider); +}; + +} // namespace viz + +#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_GPU_DISPLAY_PROVIDER_H_
diff --git a/components/viz/service/display_embedder/in_process_gpu_memory_buffer_manager.cc b/components/viz/service/display_embedder/in_process_gpu_memory_buffer_manager.cc new file mode 100644 index 0000000..fd4d44d --- /dev/null +++ b/components/viz/service/display_embedder/in_process_gpu_memory_buffer_manager.cc
@@ -0,0 +1,51 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/viz/service/display_embedder/in_process_gpu_memory_buffer_manager.h" + +#include "gpu/ipc/client/gpu_memory_buffer_impl.h" +#include "gpu/ipc/service/gpu_channel_manager.h" +#include "gpu/ipc/service/gpu_memory_buffer_factory.h" + +namespace viz { + +InProcessGpuMemoryBufferManager::InProcessGpuMemoryBufferManager( + gpu::GpuChannelManager* channel_manager) + : client_id_(1), channel_manager_(channel_manager), weak_factory_(this) { + weak_ptr_ = weak_factory_.GetWeakPtr(); +} + +InProcessGpuMemoryBufferManager::~InProcessGpuMemoryBufferManager() {} + +std::unique_ptr<gfx::GpuMemoryBuffer> +InProcessGpuMemoryBufferManager::CreateGpuMemoryBuffer( + const gfx::Size& size, + gfx::BufferFormat format, + gfx::BufferUsage usage, + gpu::SurfaceHandle surface_handle) { + gfx::GpuMemoryBufferId id(next_gpu_memory_id_++); + gfx::GpuMemoryBufferHandle buffer_handle = + channel_manager_->gpu_memory_buffer_factory()->CreateGpuMemoryBuffer( + id, size, format, usage, client_id_, surface_handle); + return gpu::GpuMemoryBufferImpl::CreateFromHandle( + buffer_handle, size, format, usage, + base::Bind(&InProcessGpuMemoryBufferManager::DestroyGpuMemoryBuffer, + weak_ptr_, id, client_id_)); +} + +void InProcessGpuMemoryBufferManager::SetDestructionSyncToken( + gfx::GpuMemoryBuffer* buffer, + const gpu::SyncToken& sync_token) { + static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token( + sync_token); +} + +void InProcessGpuMemoryBufferManager::DestroyGpuMemoryBuffer( + gfx::GpuMemoryBufferId id, + int client_id, + const gpu::SyncToken& sync_token) { + channel_manager_->DestroyGpuMemoryBuffer(id, client_id, sync_token); +} + +} // namespace viz
diff --git a/components/viz/service/display_embedder/in_process_gpu_memory_buffer_manager.h b/components/viz/service/display_embedder/in_process_gpu_memory_buffer_manager.h new file mode 100644 index 0000000..4074531d --- /dev/null +++ b/components/viz/service/display_embedder/in_process_gpu_memory_buffer_manager.h
@@ -0,0 +1,47 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_IN_PROCESS_GPU_MEMORY_BUFFER_MANAGER_H_ +#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_IN_PROCESS_GPU_MEMORY_BUFFER_MANAGER_H_ + +#include "base/memory/weak_ptr.h" +#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" + +namespace gpu { +class GpuChannelManager; +} + +namespace viz { + +class InProcessGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager { + public: + explicit InProcessGpuMemoryBufferManager( + gpu::GpuChannelManager* channel_manager); + + ~InProcessGpuMemoryBufferManager() override; + + // gpu::GpuMemoryBufferManager: + std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( + const gfx::Size& size, + gfx::BufferFormat format, + gfx::BufferUsage usage, + gpu::SurfaceHandle surface_handle) override; + void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, + const gpu::SyncToken& sync_token) override; + + private: + void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, + int client_id, + const gpu::SyncToken& sync_token); + const int client_id_; + int next_gpu_memory_id_ = 1; + gpu::GpuChannelManager* channel_manager_; + base::WeakPtr<InProcessGpuMemoryBufferManager> weak_ptr_; + base::WeakPtrFactory<InProcessGpuMemoryBufferManager> weak_factory_; + DISALLOW_COPY_AND_ASSIGN(InProcessGpuMemoryBufferManager); +}; + +} // namespace viz + +#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_IN_PROCESS_GPU_MEMORY_BUFFER_MANAGER_H_
diff --git a/components/viz/service/display_embedder/server_shared_bitmap_manager.cc b/components/viz/service/display_embedder/server_shared_bitmap_manager.cc new file mode 100644 index 0000000..3974284 --- /dev/null +++ b/components/viz/service/display_embedder/server_shared_bitmap_manager.cc
@@ -0,0 +1,191 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h" + +#include <stdint.h> + +#include <utility> + +#include "base/lazy_instance.h" +#include "base/macros.h" +#include "base/memory/ptr_util.h" +#include "base/memory/ref_counted.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/stringprintf.h" +#include "base/trace_event/process_memory_dump.h" +#include "ui/gfx/geometry/size.h" + +namespace viz { + +class BitmapData : public base::RefCountedThreadSafe<BitmapData> { + public: + explicit BitmapData(size_t buffer_size) : buffer_size(buffer_size) {} + std::unique_ptr<base::SharedMemory> memory; + std::unique_ptr<uint8_t[]> pixels; + size_t buffer_size; + + private: + friend class base::RefCountedThreadSafe<BitmapData>; + ~BitmapData() {} + DISALLOW_COPY_AND_ASSIGN(BitmapData); +}; + +namespace { + +class ServerSharedBitmap : public cc::SharedBitmap { + public: + ServerSharedBitmap(uint8_t* pixels, + scoped_refptr<BitmapData> bitmap_data, + const cc::SharedBitmapId& id, + ServerSharedBitmapManager* manager) + : SharedBitmap(pixels, id), + bitmap_data_(bitmap_data), + manager_(manager) {} + + ~ServerSharedBitmap() override { + if (manager_) + manager_->FreeSharedMemoryFromMap(id()); + } + + // cc::SharedBitmap: + base::SharedMemoryHandle GetSharedMemoryHandle() const override { + if (!bitmap_data_->memory) + return base::SharedMemoryHandle(); + return bitmap_data_->memory->handle(); + } + + private: + scoped_refptr<BitmapData> bitmap_data_; + ServerSharedBitmapManager* manager_; +}; + +} // namespace + +base::LazyInstance<ServerSharedBitmapManager>::DestructorAtExit + g_shared_memory_manager = LAZY_INSTANCE_INITIALIZER; + +ServerSharedBitmapManager::ServerSharedBitmapManager() = default; + +ServerSharedBitmapManager::~ServerSharedBitmapManager() { + DCHECK(handle_map_.empty()); +} + +ServerSharedBitmapManager* ServerSharedBitmapManager::current() { + return g_shared_memory_manager.Pointer(); +} + +std::unique_ptr<cc::SharedBitmap> +ServerSharedBitmapManager::AllocateSharedBitmap(const gfx::Size& size) { + base::AutoLock lock(lock_); + size_t bitmap_size; + if (!cc::SharedBitmap::SizeInBytes(size, &bitmap_size)) + return nullptr; + + scoped_refptr<BitmapData> data(new BitmapData(bitmap_size)); + // Bitmaps allocated in server don't need to be shared to other processes, so + // allocate them with new instead. + data->pixels = std::unique_ptr<uint8_t[]>(new uint8_t[bitmap_size]); + + cc::SharedBitmapId id = cc::SharedBitmap::GenerateId(); + handle_map_[id] = data; + return base::MakeUnique<ServerSharedBitmap>(data->pixels.get(), data, id, + this); +} + +std::unique_ptr<cc::SharedBitmap> +ServerSharedBitmapManager::GetSharedBitmapFromId(const gfx::Size& size, + const cc::SharedBitmapId& id) { + base::AutoLock lock(lock_); + auto it = handle_map_.find(id); + if (it == handle_map_.end()) + return nullptr; + + BitmapData* data = it->second.get(); + + size_t bitmap_size; + if (!cc::SharedBitmap::SizeInBytes(size, &bitmap_size) || + bitmap_size > data->buffer_size) + return nullptr; + + if (data->pixels) { + return base::MakeUnique<ServerSharedBitmap>(data->pixels.get(), data, id, + nullptr); + } + if (!data->memory->memory()) { + return nullptr; + } + + return base::MakeUnique<ServerSharedBitmap>( + static_cast<uint8_t*>(data->memory->memory()), data, id, nullptr); +} + +bool ServerSharedBitmapManager::OnMemoryDump( + const base::trace_event::MemoryDumpArgs& args, + base::trace_event::ProcessMemoryDump* pmd) { + base::AutoLock lock(lock_); + + for (const auto& bitmap : handle_map_) { + base::trace_event::MemoryAllocatorDump* dump = + pmd->CreateAllocatorDump(base::StringPrintf( + "sharedbitmap/%s", + base::HexEncode(bitmap.first.name, sizeof(bitmap.first.name)) + .c_str())); + if (!dump) + return false; + + dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, + base::trace_event::MemoryAllocatorDump::kUnitsBytes, + bitmap.second->buffer_size); + + // Generate a global GUID used to share this allocation with renderer + // processes. + auto guid = cc::GetSharedBitmapGUIDForTracing(bitmap.first); + base::UnguessableToken shared_memory_guid; + if (bitmap.second->memory) { + shared_memory_guid = bitmap.second->memory->handle().GetGUID(); + pmd->CreateSharedMemoryOwnershipEdge( + dump->guid(), guid, shared_memory_guid, 0 /* importance*/); + } else { + pmd->CreateSharedGlobalAllocatorDump(guid); + pmd->AddOwnershipEdge(dump->guid(), guid); + } + } + + return true; +} + +bool ServerSharedBitmapManager::ChildAllocatedSharedBitmap( + size_t buffer_size, + const base::SharedMemoryHandle& handle, + const cc::SharedBitmapId& id) { + base::AutoLock lock(lock_); + if (handle_map_.find(id) != handle_map_.end()) + return false; + auto data = base::MakeRefCounted<BitmapData>(buffer_size); + data->memory = base::MakeUnique<base::SharedMemory>(handle, false); + data->memory->Map(data->buffer_size); + data->memory->Close(); + handle_map_[id] = std::move(data); + return true; +} + +void ServerSharedBitmapManager::ChildDeletedSharedBitmap( + const cc::SharedBitmapId& id) { + base::AutoLock lock(lock_); + handle_map_.erase(id); +} + +size_t ServerSharedBitmapManager::AllocatedBitmapCount() const { + base::AutoLock lock(lock_); + return handle_map_.size(); +} + +void ServerSharedBitmapManager::FreeSharedMemoryFromMap( + const cc::SharedBitmapId& id) { + base::AutoLock lock(lock_); + handle_map_.erase(id); +} + +} // namespace viz
diff --git a/components/viz/service/display_embedder/server_shared_bitmap_manager.h b/components/viz/service/display_embedder/server_shared_bitmap_manager.h new file mode 100644 index 0000000..5f1bce3 --- /dev/null +++ b/components/viz/service/display_embedder/server_shared_bitmap_manager.h
@@ -0,0 +1,71 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SERVER_SHARED_BITMAP_MANAGER_H_ +#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SERVER_SHARED_BITMAP_MANAGER_H_ + +#include <memory> +#include <unordered_map> + +#include "base/memory/ref_counted.h" +#include "base/memory/shared_memory.h" +#include "base/synchronization/lock.h" +#include "base/trace_event/memory_dump_provider.h" +#include "cc/resources/shared_bitmap_manager.h" +#include "components/viz/service/viz_service_export.h" + +namespace viz { +class BitmapData; + +// A SharedBitmapManager implementation that lives in-process with the +// display compositor. It returns SharedBitmaps that can be transported +// over Mojo/IPC to the display compositor, but which are backed by +// non-shared memory. This is a cheaper implementation by using +// malloc/free, but can only be used in the same process as the display +// compositor. +class VIZ_SERVICE_EXPORT ServerSharedBitmapManager + : public cc::SharedBitmapManager, + public base::trace_event::MemoryDumpProvider { + public: + ServerSharedBitmapManager(); + ~ServerSharedBitmapManager() override; + + static ServerSharedBitmapManager* current(); + + // cc::SharedBitmapManager implementation. + std::unique_ptr<cc::SharedBitmap> AllocateSharedBitmap( + const gfx::Size& size) override; + std::unique_ptr<cc::SharedBitmap> GetSharedBitmapFromId( + const gfx::Size& size, + const cc::SharedBitmapId&) override; + + // base::trace_event::MemoryDumpProvider implementation. + bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, + base::trace_event::ProcessMemoryDump* pmd) override; + + size_t AllocatedBitmapCount() const; + + void FreeSharedMemoryFromMap(const cc::SharedBitmapId& id); + + private: + friend class SharedBitmapAllocationNotifierImpl; + + bool ChildAllocatedSharedBitmap(size_t buffer_size, + const base::SharedMemoryHandle& handle, + const cc::SharedBitmapId& id); + void ChildDeletedSharedBitmap(const cc::SharedBitmapId& id); + + mutable base::Lock lock_; + + std::unordered_map<cc::SharedBitmapId, + scoped_refptr<BitmapData>, + cc::SharedBitmapIdHash> + handle_map_; + + DISALLOW_COPY_AND_ASSIGN(ServerSharedBitmapManager); +}; + +} // namespace viz + +#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SERVER_SHARED_BITMAP_MANAGER_H_
diff --git a/components/viz/service/display_embedder/server_shared_bitmap_manager_unittest.cc b/components/viz/service/display_embedder/server_shared_bitmap_manager_unittest.cc new file mode 100644 index 0000000..1875f0a --- /dev/null +++ b/components/viz/service/display_embedder/server_shared_bitmap_manager_unittest.cc
@@ -0,0 +1,169 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h" + +#include "base/memory/ptr_util.h" +#include "components/viz/service/display_embedder/shared_bitmap_allocation_notifier_impl.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace viz { +namespace { + +class ServerSharedBitmapManagerTest : public testing::Test { + protected: + void SetUp() override { + manager_ = base::MakeUnique<ServerSharedBitmapManager>(); + } + + void TearDown() override { manager_.reset(); } + + ServerSharedBitmapManager* manager() const { return manager_.get(); } + + private: + std::unique_ptr<ServerSharedBitmapManager> manager_; +}; + +TEST_F(ServerSharedBitmapManagerTest, TestCreate) { + gfx::Size bitmap_size(1, 1); + size_t size_in_bytes; + EXPECT_TRUE(cc::SharedBitmap::SizeInBytes(bitmap_size, &size_in_bytes)); + std::unique_ptr<base::SharedMemory> bitmap(new base::SharedMemory()); + bitmap->CreateAndMapAnonymous(size_in_bytes); + memset(bitmap->memory(), 0xff, size_in_bytes); + cc::SharedBitmapId id = cc::SharedBitmap::GenerateId(); + + SharedBitmapAllocationNotifierImpl notifier(manager()); + base::SharedMemoryHandle handle = bitmap->handle().Duplicate(); + notifier.ChildAllocatedSharedBitmap(size_in_bytes, handle, id); + + std::unique_ptr<cc::SharedBitmap> large_bitmap; + large_bitmap = manager()->GetSharedBitmapFromId(gfx::Size(1024, 1024), id); + EXPECT_TRUE(large_bitmap.get() == NULL); + + std::unique_ptr<cc::SharedBitmap> very_large_bitmap; + very_large_bitmap = + manager()->GetSharedBitmapFromId(gfx::Size(1, (1 << 30) | 1), id); + EXPECT_TRUE(very_large_bitmap.get() == NULL); + + std::unique_ptr<cc::SharedBitmap> negative_size_bitmap; + negative_size_bitmap = + manager()->GetSharedBitmapFromId(gfx::Size(-1, 1024), id); + EXPECT_TRUE(negative_size_bitmap.get() == NULL); + + cc::SharedBitmapId id2 = cc::SharedBitmap::GenerateId(); + std::unique_ptr<cc::SharedBitmap> invalid_bitmap; + invalid_bitmap = manager()->GetSharedBitmapFromId(bitmap_size, id2); + EXPECT_TRUE(invalid_bitmap.get() == NULL); + + std::unique_ptr<cc::SharedBitmap> shared_bitmap; + shared_bitmap = manager()->GetSharedBitmapFromId(bitmap_size, id); + ASSERT_TRUE(shared_bitmap.get() != NULL); + EXPECT_EQ(memcmp(shared_bitmap->pixels(), bitmap->memory(), 4), 0); + + std::unique_ptr<cc::SharedBitmap> large_bitmap2; + large_bitmap2 = manager()->GetSharedBitmapFromId(gfx::Size(1024, 1024), id); + EXPECT_TRUE(large_bitmap2.get() == NULL); + + std::unique_ptr<cc::SharedBitmap> shared_bitmap2; + shared_bitmap2 = manager()->GetSharedBitmapFromId(bitmap_size, id); + EXPECT_TRUE(shared_bitmap2->pixels() == shared_bitmap->pixels()); + shared_bitmap2.reset(); + EXPECT_EQ(memcmp(shared_bitmap->pixels(), bitmap->memory(), size_in_bytes), + 0); + + notifier.DidDeleteSharedBitmap(id); + + memset(bitmap->memory(), 0, size_in_bytes); + + EXPECT_EQ(memcmp(shared_bitmap->pixels(), bitmap->memory(), size_in_bytes), + 0); + bitmap.reset(); + shared_bitmap.reset(); +} + +TEST_F(ServerSharedBitmapManagerTest, ServiceDestroyed) { + gfx::Size bitmap_size(1, 1); + size_t size_in_bytes; + EXPECT_TRUE(cc::SharedBitmap::SizeInBytes(bitmap_size, &size_in_bytes)); + std::unique_ptr<base::SharedMemory> bitmap(new base::SharedMemory()); + bitmap->CreateAndMapAnonymous(size_in_bytes); + memset(bitmap->memory(), 0xff, size_in_bytes); + cc::SharedBitmapId id = cc::SharedBitmap::GenerateId(); + + // This outlives the SharedBitmapAllocationNotifier. + std::unique_ptr<cc::SharedBitmap> shared_bitmap; + + { + SharedBitmapAllocationNotifierImpl notifier(manager()); + base::SharedMemoryHandle handle = bitmap->handle().Duplicate(); + notifier.ChildAllocatedSharedBitmap(size_in_bytes, handle, id); + + shared_bitmap = manager()->GetSharedBitmapFromId(bitmap_size, id); + ASSERT_TRUE(shared_bitmap.get() != NULL); + + EXPECT_EQ(1u, manager()->AllocatedBitmapCount()); + } + EXPECT_EQ(0u, manager()->AllocatedBitmapCount()); + + std::unique_ptr<cc::SharedBitmap> shared_bitmap2; + shared_bitmap2 = manager()->GetSharedBitmapFromId(bitmap_size, id); + EXPECT_FALSE(!!shared_bitmap2); + EXPECT_EQ(memcmp(shared_bitmap->pixels(), bitmap->memory(), size_in_bytes), + 0); +} + +TEST_F(ServerSharedBitmapManagerTest, AddDuplicate) { + gfx::Size bitmap_size(1, 1); + size_t size_in_bytes; + EXPECT_TRUE(cc::SharedBitmap::SizeInBytes(bitmap_size, &size_in_bytes)); + std::unique_ptr<base::SharedMemory> bitmap(new base::SharedMemory()); + bitmap->CreateAndMapAnonymous(size_in_bytes); + memset(bitmap->memory(), 0xff, size_in_bytes); + cc::SharedBitmapId id = cc::SharedBitmap::GenerateId(); + + SharedBitmapAllocationNotifierImpl notifier(manager()); + + base::SharedMemoryHandle handle = bitmap->handle().Duplicate(); + notifier.ChildAllocatedSharedBitmap(size_in_bytes, handle, id); + + std::unique_ptr<base::SharedMemory> bitmap2(new base::SharedMemory()); + bitmap2->CreateAndMapAnonymous(size_in_bytes); + memset(bitmap2->memory(), 0x00, size_in_bytes); + + notifier.ChildAllocatedSharedBitmap(size_in_bytes, bitmap2->handle(), id); + + std::unique_ptr<cc::SharedBitmap> shared_bitmap; + shared_bitmap = manager()->GetSharedBitmapFromId(bitmap_size, id); + ASSERT_TRUE(shared_bitmap.get() != NULL); + EXPECT_EQ(memcmp(shared_bitmap->pixels(), bitmap->memory(), size_in_bytes), + 0); + notifier.DidDeleteSharedBitmap(id); +} + +TEST_F(ServerSharedBitmapManagerTest, SharedMemoryHandle) { + gfx::Size bitmap_size(1, 1); + size_t size_in_bytes; + EXPECT_TRUE(cc::SharedBitmap::SizeInBytes(bitmap_size, &size_in_bytes)); + std::unique_ptr<base::SharedMemory> bitmap(new base::SharedMemory()); + auto shared_memory_guid = bitmap->handle().GetGUID(); + bitmap->CreateAndMapAnonymous(size_in_bytes); + memset(bitmap->memory(), 0xff, size_in_bytes); + cc::SharedBitmapId id = cc::SharedBitmap::GenerateId(); + + SharedBitmapAllocationNotifierImpl notifier(manager()); + + base::SharedMemoryHandle handle = bitmap->handle().Duplicate(); + notifier.ChildAllocatedSharedBitmap(size_in_bytes, handle, id); + + std::unique_ptr<cc::SharedBitmap> shared_bitmap; + shared_bitmap = manager()->GetSharedBitmapFromId(gfx::Size(1, 1), id); + EXPECT_EQ(shared_bitmap->GetSharedMemoryHandle().GetGUID(), + shared_memory_guid); + + notifier.DidDeleteSharedBitmap(id); +} + +} // namespace +} // namespace viz
diff --git a/components/viz/service/display_embedder/shared_bitmap_allocation_notifier_impl.cc b/components/viz/service/display_embedder/shared_bitmap_allocation_notifier_impl.cc new file mode 100644 index 0000000..ea52579d --- /dev/null +++ b/components/viz/service/display_embedder/shared_bitmap_allocation_notifier_impl.cc
@@ -0,0 +1,51 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/viz/service/display_embedder/shared_bitmap_allocation_notifier_impl.h" + +#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h" +#include "mojo/public/cpp/system/platform_handle.h" + +namespace viz { + +SharedBitmapAllocationNotifierImpl::SharedBitmapAllocationNotifierImpl( + ServerSharedBitmapManager* manager) + : manager_(manager), binding_(this) {} + +SharedBitmapAllocationNotifierImpl::~SharedBitmapAllocationNotifierImpl() { + for (const auto& id : owned_bitmaps_) + manager_->ChildDeletedSharedBitmap(id); +} + +void SharedBitmapAllocationNotifierImpl::Bind( + cc::mojom::SharedBitmapAllocationNotifierAssociatedRequest request) { + binding_.Bind(std::move(request)); +} + +void SharedBitmapAllocationNotifierImpl::DidAllocateSharedBitmap( + mojo::ScopedSharedBufferHandle buffer, + const cc::SharedBitmapId& id) { + base::SharedMemoryHandle memory_handle; + size_t size; + MojoResult result = mojo::UnwrapSharedMemoryHandle( + std::move(buffer), &memory_handle, &size, NULL); + DCHECK_EQ(result, MOJO_RESULT_OK); + this->ChildAllocatedSharedBitmap(size, memory_handle, id); +} + +void SharedBitmapAllocationNotifierImpl::DidDeleteSharedBitmap( + const cc::SharedBitmapId& id) { + manager_->ChildDeletedSharedBitmap(id); + owned_bitmaps_.erase(id); +} + +void SharedBitmapAllocationNotifierImpl::ChildAllocatedSharedBitmap( + size_t buffer_size, + const base::SharedMemoryHandle& handle, + const cc::SharedBitmapId& id) { + if (manager_->ChildAllocatedSharedBitmap(buffer_size, handle, id)) + owned_bitmaps_.insert(id); +} + +} // namespace viz
diff --git a/components/viz/service/display_embedder/shared_bitmap_allocation_notifier_impl.h b/components/viz/service/display_embedder/shared_bitmap_allocation_notifier_impl.h new file mode 100644 index 0000000..3c96618 --- /dev/null +++ b/components/viz/service/display_embedder/shared_bitmap_allocation_notifier_impl.h
@@ -0,0 +1,47 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SHARED_BITMAP_ALLOCATION_NOTIFIER_IMPL_H_ +#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SHARED_BITMAP_ALLOCATION_NOTIFIER_IMPL_H_ + +#include <unordered_set> + +#include "cc/ipc/shared_bitmap_allocation_notifier.mojom.h" +#include "cc/resources/shared_bitmap.h" +#include "components/viz/service/viz_service_export.h" +#include "mojo/public/cpp/bindings/associated_binding.h" + +namespace viz { +class ServerSharedBitmapManager; + +class VIZ_SERVICE_EXPORT SharedBitmapAllocationNotifierImpl + : NON_EXPORTED_BASE(public cc::mojom::SharedBitmapAllocationNotifier) { + public: + explicit SharedBitmapAllocationNotifierImpl( + ServerSharedBitmapManager* manager); + + ~SharedBitmapAllocationNotifierImpl() override; + + void Bind(cc::mojom::SharedBitmapAllocationNotifierAssociatedRequest request); + + // cc::mojom::SharedBitmapAllocationNotifier overrides: + void DidAllocateSharedBitmap(mojo::ScopedSharedBufferHandle buffer, + const cc::SharedBitmapId& id) override; + void DidDeleteSharedBitmap(const cc::SharedBitmapId& id) override; + + void ChildAllocatedSharedBitmap(size_t buffer_size, + const base::SharedMemoryHandle& handle, + const cc::SharedBitmapId& id); + + private: + ServerSharedBitmapManager* const manager_; + mojo::AssociatedBinding<cc::mojom::SharedBitmapAllocationNotifier> binding_; + std::unordered_set<cc::SharedBitmapId, cc::SharedBitmapIdHash> owned_bitmaps_; + + DISALLOW_COPY_AND_ASSIGN(SharedBitmapAllocationNotifierImpl); +}; + +} // namespace viz + +#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SHARED_BITMAP_ALLOCATION_NOTIFIER_IMPL_H_
diff --git a/components/viz/service/frame_sinks/DEPS b/components/viz/service/frame_sinks/DEPS index 2628c70..de07c6b 100644 --- a/components/viz/service/frame_sinks/DEPS +++ b/components/viz/service/frame_sinks/DEPS
@@ -3,5 +3,5 @@ "+cc/ipc", "+cc/surfaces", "+cc/scheduler", - "+components/viz/display_compositor", + "+components/viz/display_embedder", ]
diff --git a/components/viz/service/frame_sinks/frame_eviction_manager.cc b/components/viz/service/frame_sinks/frame_eviction_manager.cc index 980ba52b..d6ed398 100644 --- a/components/viz/service/frame_sinks/frame_eviction_manager.cc +++ b/components/viz/service/frame_sinks/frame_eviction_manager.cc
@@ -15,7 +15,7 @@ #include "base/memory/shared_memory.h" #include "base/sys_info.h" #include "build/build_config.h" -#include "components/viz/service/display_compositor/server_shared_bitmap_manager.h" +#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h" namespace viz { namespace {
diff --git a/components/viz/service/frame_sinks/frame_sink_manager_impl.cc b/components/viz/service/frame_sinks/frame_sink_manager_impl.cc index 6578bb2b..51ce97d 100644 --- a/components/viz/service/frame_sinks/frame_sink_manager_impl.cc +++ b/components/viz/service/frame_sinks/frame_sink_manager_impl.cc
@@ -12,7 +12,7 @@ #include "cc/scheduler/begin_frame_source.h" #include "cc/surfaces/display.h" #include "cc/surfaces/surface_dependency_tracker.h" -#include "components/viz/service/display_compositor/display_provider.h" +#include "components/viz/service/display_embedder/display_provider.h" #include "components/viz/service/frame_sinks/gpu_compositor_frame_sink.h" #include "components/viz/service/frame_sinks/gpu_root_compositor_frame_sink.h"
diff --git a/components/webauth/BUILD.gn b/components/webauth/BUILD.gn deleted file mode 100644 index 80da9afb..0000000 --- a/components/webauth/BUILD.gn +++ /dev/null
@@ -1,15 +0,0 @@ -# Copyright 2017 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//mojo/public/tools/bindings/mojom.gni") - -mojom("authenticator") { - sources = [ - "authenticator.mojom", - ] - - public_deps = [ - "//mojo/common:common_custom_types", - ] -}
diff --git a/components/webauth/authenticator.mojom b/components/webauth/authenticator.mojom deleted file mode 100644 index 1bf69a9..0000000 --- a/components/webauth/authenticator.mojom +++ /dev/null
@@ -1,89 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -[JavaPackage="org.chromium.webauth.mojom"] -module webauth.mojom; - -// This file describes the communication between the WebAuthentication renderer -// implementation and browser-side implementations to create scoped credentials -// and use already-created credentials to get assertions. -// See https://w3c.github.io/webauthn/. - -// The public key and attestation that is returned by an authenticator's -// call to makeCredential. -struct ScopedCredentialInfo { - // A blob of data containing the JSON serialization of client data passed - // to the authenticator. - array<uint8> client_data; - // A blob of data returned from the authenticator. - array<uint8> attestation; -}; - -// Information about the relying party and the user account held by that -// relying party. This information is used by the authenticator to create -// or retrieve an appropriate scoped credential for this account. -// These fields take arbitrary input. - -struct RelyingPartyAccount { - // Friendly name of the Relying Party, e.g. "Acme Corporation" - string relying_party_display_name; - // Friendly name associated with the user account, e.g. "John P. Smith" - string display_name; - // Identifier for the account, corresponding to no more than one credential - // per authenticator and Relying Party. - string id; - // Detailed name for the account, e.g. john.p.smith@example.com - string name; - // User image, if any. - // Todo make this url.mojom.Url in a followup CL - string image_url; -}; - -// Parameters that are used to generate an appropriate scoped credential. -struct ScopedCredentialParameters { - ScopedCredentialType type; - // TODO(kpaulhamus): add AlgorithmIdentifier algorithm; -}; - -// Optional parameters that are used during makeCredential. -struct ScopedCredentialOptions { - //TODO(kpaulhamus): Make this mojo.common.mojom.TimeDelta in followup CL - int32 timeout_seconds; - string relying_party_id; - array<ScopedCredentialDescriptor> exclude_list; - // TODO(kpaulhamus): add Extensions -}; - -enum ScopedCredentialType { - SCOPEDCRED, -}; - -// Describes the credentials that the relying party already knows about for -// the given account. If any of these are known to the authenticator, -// it should not create a new credential. -struct ScopedCredentialDescriptor { - ScopedCredentialType type; - // Blob representing a credential key handle. Up to 255 bytes for - // U2F authenticators. - array<uint8> id; - array<Transport> transports; -}; - -enum Transport { - USB, - NFC, - BLE, -}; - -// Interface to direct authenticators to create or use a scoped credential. -interface Authenticator { - // Gets the credential info for a new credential created by an authenticator - // for the given relying party and account. - // |attestation_challenge| is a blob passed from the relying party server. - MakeCredential(RelyingPartyAccount account_information, - array<ScopedCredentialParameters> crypto_parameters, - array<uint8> attestation_challenge, - ScopedCredentialOptions? options) - => (array<ScopedCredentialInfo> scoped_credentials); -};
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 457e51b..d7804b4 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -859,6 +859,8 @@ "indexed_db/list_set.h", "installedapp/installed_app_provider_impl_default.cc", "installedapp/installed_app_provider_impl_default.h", + "isolated_origin_util.cc", + "isolated_origin_util.h", "keyboard_lock/keyboard_lock_service_impl.cc", "keyboard_lock/keyboard_lock_service_impl.h", "leveldb_wrapper_impl.cc", @@ -1049,6 +1051,8 @@ "net/network_quality_observer_impl.h", "net/quota_policy_cookie_store.cc", "net/quota_policy_cookie_store.h", + "net/reporting_service_proxy.cc", + "net/reporting_service_proxy.h", "net/view_blob_internals_job_factory.cc", "net/view_blob_internals_job_factory.h", "net/view_http_cache_job_factory.cc", @@ -1528,6 +1532,8 @@ "web_contents/web_drag_source_mac.mm", "web_contents/web_drag_utils_win.cc", "web_contents/web_drag_utils_win.h", + "webauth/authenticator_impl.cc", + "webauth/authenticator_impl.h", "websockets/websocket_handshake_request_info_impl.cc", "websockets/websocket_handshake_request_info_impl.h", "websockets/websocket_impl.cc", @@ -1640,9 +1646,9 @@ deps += [ "//jingle:jingle_glue", - "//third_party/webrtc/base:rtc_base", "//third_party/webrtc/media:rtc_media_base", "//third_party/webrtc/modules/desktop_capture:primitives", + "//third_party/webrtc/rtc_base:rtc_base", "//third_party/webrtc_overrides:init_webrtc", ] }
diff --git a/content/browser/DEPS b/content/browser/DEPS index da28d41..b282c92 100644 --- a/content/browser/DEPS +++ b/content/browser/DEPS
@@ -3,7 +3,6 @@ # See comment in content/DEPS for which components are allowed. "+components/discardable_memory/common", "+components/discardable_memory/service", - "+components/display_compositor", "+components/filesystem", "+components/leveldb", "+components/link_header_util", @@ -117,7 +116,9 @@ "+third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerState.h", "+third_party/WebKit/public/platform/modules/serviceworker/service_worker_event_status.mojom.h", "+third_party/WebKit/public/platform/modules/serviceworker/service_worker_stream_handle.mojom.h", + "+third_party/WebKit/public/platform/modules/webauth/authenticator.mojom.h", "+third_party/WebKit/public/platform/modules/websockets/websocket.mojom.h", + "+third_party/WebKit/public/platform/reporting.mojom.h", "+third_party/WebKit/public/public_features.h", "+third_party/WebKit/public/web/WebAXEnums.h", "+third_party/WebKit/public/web/WebCompositionUnderline.h",
diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc index af077e5f..34484feb 100644 --- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
@@ -248,6 +248,11 @@ RunCSSTest(FILE_PATH_LITERAL("font-family.html")); } +IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, + AccessibilityCSSInlinePositionRelative) { + RunCSSTest(FILE_PATH_LITERAL("inline-position-relative.html")); +} + IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityCSSLanguage) { RunCSSTest(FILE_PATH_LITERAL("language.html")); } @@ -1405,8 +1410,9 @@ RunHtmlTest(FILE_PATH_LITERAL("modal-dialog-opened.html")); } +// http://crbug.com/738497 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, - AccessibilityModalDialogInIframeClosed) { + DISABLED_AccessibilityModalDialogInIframeClosed) { RunHtmlTest(FILE_PATH_LITERAL("modal-dialog-in-iframe-closed.html")); }
diff --git a/content/browser/android/ime_adapter_android.cc b/content/browser/android/ime_adapter_android.cc index 2b5904cf..c864386 100644 --- a/content/browser/android/ime_adapter_android.cc +++ b/content/browser/android/ime_adapter_android.cc
@@ -18,6 +18,7 @@ #include "content/browser/renderer_host/render_view_host_delegate.h" #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/render_widget_host_view_android.h" +#include "content/common/frame_messages.h" #include "content/common/input_messages.h" #include "content/common/view_messages.h" #include "content/public/browser/browser_thread.h" @@ -284,6 +285,17 @@ } } +void ImeAdapterAndroid::AdvanceFocusInForm(JNIEnv* env, + const JavaParamRef<jobject>& obj, + jint focus_type) { + RenderFrameHost* rfh = GetFocusedFrame(); + if (!rfh) + return; + + rfh->Send(new FrameMsg_AdvanceFocusInForm( + rfh->GetRoutingID(), static_cast<blink::WebFocusType>(focus_type))); +} + void ImeAdapterAndroid::SetEditableSelectionOffsets( JNIEnv*, const JavaParamRef<jobject>&,
diff --git a/content/browser/android/ime_adapter_android.h b/content/browser/android/ime_adapter_android.h index efe4fbb..25012d8a 100644 --- a/content/browser/android/ime_adapter_android.h +++ b/content/browser/android/ime_adapter_android.h
@@ -106,6 +106,10 @@ void UpdateState(const TextInputState& state); + void AdvanceFocusInForm(JNIEnv*, + const base::android::JavaParamRef<jobject>&, + jint); + private: RenderWidgetHostImpl* GetFocusedWidget(); RenderFrameHost* GetFocusedFrame();
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index 9486c42..20f9660d 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc
@@ -54,7 +54,7 @@ #include "components/tracing/common/trace_to_console.h" #include "components/tracing/common/tracing_switches.h" #include "components/viz/host/host_frame_sink_manager.h" -#include "components/viz/service/display_compositor/server_shared_bitmap_manager.h" +#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h" #include "components/viz/service/frame_sinks/frame_sink_manager_impl.h" #include "content/browser/browser_thread_impl.h" #include "content/browser/child_process_security_policy_impl.h"
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc index 94af97e..e8af7514 100644 --- a/content/browser/child_process_security_policy_impl.cc +++ b/content/browser/child_process_security_policy_impl.cc
@@ -17,6 +17,7 @@ #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "build/build_config.h" +#include "content/browser/isolated_origin_util.h" #include "content/browser/site_instance_impl.h" #include "content/common/site_isolation_policy.h" #include "content/public/browser/browser_context.h" @@ -1092,12 +1093,12 @@ void ChildProcessSecurityPolicyImpl::AddIsolatedOrigin( const url::Origin& origin) { - CHECK(!origin.unique()) - << "Cannot register a unique origin as an isolated origin."; - CHECK(!IsIsolatedOrigin(origin)) - << "Duplicate isolated origin: " << origin.Serialize(); + CHECK(IsolatedOriginUtil::IsValidIsolatedOrigin(origin)); base::AutoLock lock(lock_); + CHECK(!isolated_origins_.count(origin)) + << "Duplicate isolated origin: " << origin.Serialize(); + isolated_origins_.insert(origin); } @@ -1114,8 +1115,38 @@ bool ChildProcessSecurityPolicyImpl::IsIsolatedOrigin( const url::Origin& origin) { + url::Origin unused_result; + return GetMatchingIsolatedOrigin(origin, &unused_result); +} + +bool ChildProcessSecurityPolicyImpl::GetMatchingIsolatedOrigin( + const url::Origin& origin, + url::Origin* result) { + *result = url::Origin(); base::AutoLock lock(lock_); - return isolated_origins_.find(origin) != isolated_origins_.end(); + + // If multiple isolated origins are registered with a common domain suffix, + // return the most specific one. For example, if foo.isolated.com and + // isolated.com are both isolated origins, bar.foo.isolated.com should return + // foo.isolated.com. + bool found = false; + for (auto isolated_origin : isolated_origins_) { + if (IsolatedOriginUtil::DoesOriginMatchIsolatedOrigin(origin, + isolated_origin)) { + if (!found || result->host().length() < isolated_origin.host().length()) { + *result = isolated_origin; + found = true; + } + } + } + + return found; +} + +void ChildProcessSecurityPolicyImpl::RemoveIsolatedOriginForTesting( + const url::Origin& origin) { + base::AutoLock lock(lock_); + isolated_origins_.erase(origin); } } // namespace content
diff --git a/content/browser/child_process_security_policy_impl.h b/content/browser/child_process_security_policy_impl.h index c276ebd8..5a5e740 100644 --- a/content/browser/child_process_security_policy_impl.h +++ b/content/browser/child_process_security_policy_impl.h
@@ -209,17 +209,21 @@ // scheme+host+port tuple rather than scheme and eTLD+1 will be used. // SiteInstances for these origins will also use the full origin as site URL. // + // Subdomains of an isolated origin are considered to be part of that + // origin's site. For example, if https://isolated.foo.com is added as an + // isolated origin, then https://bar.isolated.foo.com will be considered part + // of the site for https://isolated.foo.com. + // // Note that |origin| must not be unique. URLs that render with // unique origins, such as data: URLs, are not supported. Suborigins (see // https://w3c.github.io/webappsec-suborigins/ -- not to be confused with // subdomains) and non-standard schemes are also not supported. Sandboxed - // frames (e.g., <iframe sandbox>) - // *are* supported, since process placement decisions will be based on the - // URLs such frames navigate to, and not the origin of committed documents - // (which might be unique). If an isolated origin opens an about:blank - // popup, it will stay in the isolated origin's process. Nested URLs - // (filesystem: and blob:) retain process isolation behavior of their inner - // origin. + // frames (e.g., <iframe sandbox>) *are* supported, since process placement + // decisions will be based on the URLs such frames navigate to, and not the + // origin of committed documents (which might be unique). If an isolated + // origin opens an about:blank popup, it will stay in the isolated origin's + // process. Nested URLs (filesystem: and blob:) retain process isolation + // behavior of their inner origin. void AddIsolatedOrigin(const url::Origin& origin); // Register a set of isolated origins as specified on the command line with @@ -228,9 +232,44 @@ // AddIsolatedOrigin for definition of an isolated origin. void AddIsolatedOriginsFromCommandLine(const std::string& origin_list); - // Helper to check whether an origin requires origin-wide process isolation. + // Check whether |origin| requires origin-wide process isolation. + // + // Subdomains of an isolated origin are considered part of that isolated + // origin. Thus, if https://isolated.foo.com/ had been added as an isolated + // origin, this will return true for https://isolated.foo.com/, + // https://bar.isolated.foo.com/, or https://baz.bar.isolated.foo.com/; and + // it will return false for https://foo.com/ or https://unisolated.foo.com/. + // + // Note that unlike site URLs for regular web sites, isolated origins care + // about port. bool IsIsolatedOrigin(const url::Origin& origin); + // This function will check whether |origin| requires process isolation, and + // if so, it will return true and put the most specific matching isolated + // origin into |result|. + // + // If |origin| does not require process isolation, this function will return + // false, and |result| will be a unique origin. This means that neither + // |origin|, nor any origins for which |origin| is a subdomain, have been + // registered as isolated origins. + // + // For example, if both https://isolated.com/ and + // https://bar.foo.isolated.com/ are registered as isolated origins, then the + // values returned in |result| are: + // https://isolated.com/ --> https://isolated.com/ + // https://foo.isolated.com/ --> https://isolated.com/ + // https://bar.foo.isolated.com/ --> https://bar.foo.isolated.com/ + // https://baz.bar.foo.isolated.com/ --> https://bar.foo.isolated.com/ + // https://unisolated.com/ --> (unique origin) + bool GetMatchingIsolatedOrigin(const url::Origin& origin, + url::Origin* result); + + // Removes a previously added isolated origin, currently only used in tests. + // + // TODO(alexmos): Exposing this more generally will require extra care, such + // as ensuring that there are no active SiteInstances in that origin. + void RemoveIsolatedOriginForTesting(const url::Origin& origin); + private: friend class ChildProcessSecurityPolicyInProcessBrowserTest; friend class ChildProcessSecurityPolicyTest;
diff --git a/content/browser/compositor/DEPS b/content/browser/compositor/DEPS index e40a3bf..30b67d5 100644 --- a/content/browser/compositor/DEPS +++ b/content/browser/compositor/DEPS
@@ -1,5 +1,7 @@ include_rules = [ - "+components/display_compositor", + "+components/viz/common", + "+components/viz/host", + "+components/viz/service", "+services/ui/public/cpp", "+ui/platform_window", ]
diff --git a/content/browser/compositor/browser_compositor_output_surface.cc b/content/browser/compositor/browser_compositor_output_surface.cc index dcf0887..cdf87e5 100644 --- a/content/browser/compositor/browser_compositor_output_surface.cc +++ b/content/browser/compositor/browser_compositor_output_surface.cc
@@ -13,7 +13,7 @@ #include "base/strings/string_number_conversions.h" #include "cc/output/output_surface_client.h" #include "cc/scheduler/begin_frame_source.h" -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator.h" #include "content/browser/compositor/reflector_impl.h" #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h"
diff --git a/content/browser/compositor/gpu_browser_compositor_output_surface.cc b/content/browser/compositor/gpu_browser_compositor_output_surface.cc index 3a881fa5..40d346e 100644 --- a/content/browser/compositor/gpu_browser_compositor_output_surface.cc +++ b/content/browser/compositor/gpu_browser_compositor_output_surface.cc
@@ -9,7 +9,7 @@ #include "build/build_config.h" #include "cc/output/output_surface_client.h" #include "cc/output/output_surface_frame.h" -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator.h" #include "content/browser/compositor/reflector_impl.h" #include "content/browser/compositor/reflector_texture.h" #include "content/browser/renderer_host/render_widget_host_impl.h"
diff --git a/content/browser/compositor/gpu_output_surface_mac.mm b/content/browser/compositor/gpu_output_surface_mac.mm index 2502586..a5596b3 100644 --- a/content/browser/compositor/gpu_output_surface_mac.mm +++ b/content/browser/compositor/gpu_output_surface_mac.mm
@@ -6,7 +6,7 @@ #include "cc/output/output_surface_client.h" #include "cc/output/output_surface_frame.h" -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator.h" #include "gpu/GLES2/gl2extchromium.h" #include "gpu/ipc/client/gpu_process_hosted_ca_layer_tree_params.h" #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h"
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc index b05459ac..f141430 100644 --- a/content/browser/compositor/gpu_process_transport_factory.cc +++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -32,8 +32,8 @@ #include "cc/surfaces/surface_manager.h" #include "components/viz/common/gl_helper.h" #include "components/viz/host/host_frame_sink_manager.h" -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator.h" -#include "components/viz/service/display_compositor/server_shared_bitmap_manager.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator.h" +#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h" #include "content/browser/browser_main_loop.h" #include "content/browser/compositor/browser_compositor_output_surface.h" #include "content/browser/compositor/gpu_browser_compositor_output_surface.h" @@ -74,11 +74,11 @@ #if defined(OS_WIN) #include "base/win/windows_version.h" -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator_win.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator_win.h" #include "content/browser/compositor/software_output_device_win.h" #include "ui/gfx/win/rendering_window_manager.h" #elif defined(USE_OZONE) -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator_ozone.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator_ozone.h" #include "content/browser/compositor/software_output_device_ozone.h" #include "ui/ozone/public/overlay_candidates_ozone.h" #include "ui/ozone/public/overlay_manager_ozone.h" @@ -87,7 +87,7 @@ #elif defined(USE_X11) #include "content/browser/compositor/software_output_device_x11.h" #elif defined(OS_MACOSX) -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator_mac.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator_mac.h" #include "content/browser/compositor/gpu_output_surface_mac.h" #include "content/browser/compositor/software_output_device_mac.h" #include "gpu/config/gpu_driver_bug_workaround_type.h" @@ -95,7 +95,7 @@ #include "ui/base/cocoa/remote_layer_api.h" #include "ui/base/ui_base_switches.h" #elif defined(OS_ANDROID) -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator_android.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator_android.h" #endif #if !defined(GPU_SURFACE_HANDLE_IS_ACCELERATED_WINDOW) #include "gpu/ipc/common/gpu_surface_tracker.h"
diff --git a/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc b/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc index 70e488b..c131834 100644 --- a/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc +++ b/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc
@@ -9,8 +9,8 @@ #include "cc/output/output_surface_client.h" #include "cc/output/output_surface_frame.h" #include "components/viz/common/gl_helper.h" -#include "components/viz/service/display_compositor/buffer_queue.h" -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator.h" +#include "components/viz/service/display_embedder/buffer_queue.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator.h" #include "content/browser/compositor/reflector_impl.h" #include "gpu/GLES2/gl2extchromium.h" #include "gpu/command_buffer/client/gles2_interface.h"
diff --git a/content/browser/compositor/offscreen_browser_compositor_output_surface.cc b/content/browser/compositor/offscreen_browser_compositor_output_surface.cc index 76c9ca1..866e8fbe 100644 --- a/content/browser/compositor/offscreen_browser_compositor_output_surface.cc +++ b/content/browser/compositor/offscreen_browser_compositor_output_surface.cc
@@ -11,7 +11,7 @@ #include "cc/output/output_surface_client.h" #include "cc/output/output_surface_frame.h" #include "cc/resources/resource_provider.h" -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator.h" #include "content/browser/compositor/reflector_impl.h" #include "content/browser/compositor/reflector_texture.h" #include "content/browser/renderer_host/render_widget_host_impl.h"
diff --git a/content/browser/compositor/reflector_impl_unittest.cc b/content/browser/compositor/reflector_impl_unittest.cc index 2328aef..e268774 100644 --- a/content/browser/compositor/reflector_impl_unittest.cc +++ b/content/browser/compositor/reflector_impl_unittest.cc
@@ -15,7 +15,7 @@ #include "cc/scheduler/delay_based_time_source.h" #include "cc/test/test_context_provider.h" #include "cc/test/test_web_graphics_context_3d.h" -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator.h" #include "content/browser/compositor/browser_compositor_output_surface.h" #include "content/browser/compositor/reflector_texture.h" #include "content/browser/compositor/test/no_transport_image_transport_factory.h" @@ -25,7 +25,7 @@ #include "ui/compositor/test/context_factories_for_test.h" #if defined(USE_OZONE) -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator_ozone.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator_ozone.h" #include "ui/ozone/public/overlay_candidates_ozone.h" #endif // defined(USE_OZONE)
diff --git a/content/browser/devtools/protocol/network_handler.cc b/content/browser/devtools/protocol/network_handler.cc index 5c2c7238..d2888de 100644 --- a/content/browser/devtools/protocol/network_handler.cc +++ b/content/browser/devtools/protocol/network_handler.cc
@@ -679,8 +679,7 @@ for (net::HttpRequestHeaders::Iterator it(headers); it.GetNext();) headers_dict->setString(it.name(), it.value()); frontend_->RequestWillBeSent( - request_id, version_id /* frameId */, version_id /* loaderId */, - "" /* documentURL */, + request_id, "" /* loader_id */, request.url.spec(), Network::Request::Create() .SetUrl(request.url.spec()) .SetMethod(request.method) @@ -750,7 +749,7 @@ response->SetRemoteIPAddress(head.socket_address.HostForURL()); response->SetRemotePort(head.socket_address.port()); frontend_->ResponseReceived( - request_id, version_id /* frameId */, version_id /* loaderId */, + request_id, "" /* loader_id */, base::TimeTicks::Now().ToInternalValue() / static_cast<double>(base::Time::kMicrosecondsPerSecond), Page::ResourceTypeEnum::Other, std::move(response)); @@ -796,8 +795,7 @@ for (net::HttpRequestHeaders::Iterator it(headers); it.GetNext();) headers_dict->setString(it.name(), it.value()); frontend_->RequestWillBeSent( - request_id, request_id /* frameId */, request_id /* loaderId */, - common_params.url.spec(), + request_id, "" /* loader_id */, common_params.url.spec(), Network::Request::Create() .SetUrl(common_params.url.spec()) .SetMethod(common_params.method)
diff --git a/content/browser/devtools/protocol/tracing_handler_unittest.cc b/content/browser/devtools/protocol/tracing_handler_unittest.cc index aa10c4e..0b1d7bc 100644 --- a/content/browser/devtools/protocol/tracing_handler_unittest.cc +++ b/content/browser/devtools/protocol/tracing_handler_unittest.cc
@@ -37,8 +37,7 @@ "}" "]" "}," - "\"record_mode\":\"record-continuously\"," - "\"synthetic_delays\":[\"test.Delay1;16\",\"test.Delay2;32\"]" + "\"record_mode\":\"record-continuously\"" "}"; const char kCustomTraceConfigStringDevToolsStyle[] = @@ -65,8 +64,7 @@ "}" "]" "}," - "\"recordMode\":\"recordContinuously\"," - "\"synthetic_delays\":[\"test.Delay1;16\",\"test.Delay2;32\"]" + "\"recordMode\":\"recordContinuously\"" "}"; } // namespace
diff --git a/content/browser/frame_host/mixed_content_navigation_throttle.cc b/content/browser/frame_host/mixed_content_navigation_throttle.cc index a267d39e..d0a7466 100644 --- a/content/browser/frame_host/mixed_content_navigation_throttle.cc +++ b/content/browser/frame_host/mixed_content_navigation_throttle.cc
@@ -70,7 +70,7 @@ // https://tools.ietf.org/html/draft-west-let-localhost-be-localhost-03. See: // https://crbug.com/691930. if (is_secure && url.SchemeIs(url::kHttpScheme) && - net::IsLocalHostname(url.HostNoBrackets(), nullptr)) { + net::IsLocalHostname(url.HostNoBracketsPiece(), nullptr)) { is_secure = false; }
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc index 789bf9b..9e6c1fc 100644 --- a/content/browser/frame_host/navigation_handle_impl.cc +++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -6,6 +6,7 @@ #include <iterator> +#include "base/debug/dump_without_crashing.h" #include "base/logging.h" #include "base/metrics/histogram_macros.h" #include "content/browser/appcache/appcache_navigation_handle.h" @@ -123,6 +124,7 @@ is_form_submission_(is_form_submission), expected_render_process_host_id_(ChildProcessHost::kInvalidUniqueID), weak_factory_(this) { + is_in_constructor = true; TRACE_EVENT_ASYNC_BEGIN2("navigation", "NavigationHandle", this, "frame_tree_node", frame_tree_node_->frame_tree_node_id(), "url", @@ -176,9 +178,15 @@ TRACE_EVENT_ASYNC_STEP_INTO0("navigation", "NavigationHandle", this, "Same document"); } + is_in_constructor = false; } NavigationHandleImpl::~NavigationHandleImpl() { + // TODO(arthursonzogni): Remove this when we understand the root cause behind + // crbug.com/704892. + if (is_in_constructor) + base::debug::DumpWithoutCrashing(); + // Inform the RenderProcessHost to no longer expect a navigation. if (expected_render_process_host_id_ != ChildProcessHost::kInvalidUniqueID) { RenderProcessHost* process = @@ -455,7 +463,7 @@ WillRedirectRequest(new_url, new_method_is_post ? "POST" : "GET", new_referrer_url, new_is_external_protocol, scoped_refptr<net::HttpResponseHeaders>(), - net::HttpResponseInfo::CONNECTION_INFO_UNKNOWN, + net::HttpResponseInfo::CONNECTION_INFO_UNKNOWN, nullptr, base::Bind(&UpdateThrottleCheckResult, &result)); // Reset the callback to ensure it will not be called later. @@ -616,15 +624,21 @@ bool new_is_external_protocol, scoped_refptr<net::HttpResponseHeaders> response_headers, net::HttpResponseInfo::ConnectionInfo connection_info, + RenderProcessHost* post_redirect_process, const ThrottleChecksFinishedCallback& callback) { TRACE_EVENT_ASYNC_STEP_INTO1("navigation", "NavigationHandle", this, "WillRedirectRequest", "url", new_url.possibly_invalid_spec()); + // TODO(arthursonzogni): Remove this when we understand the root cause behind + // crbug.com/704892 and crbug.com/736658 + if (IsRendererDebugURL(new_url)) + base::debug::DumpWithoutCrashing(); + // Update the navigation parameters. url_ = new_url; method_ = new_method; - UpdateSiteURL(); + UpdateSiteURL(post_redirect_process); if (!(transition_ & ui::PAGE_TRANSITION_CLIENT_REDIRECT)) { sanitized_referrer_.url = new_referrer_url; @@ -1154,17 +1168,26 @@ return false; } -void NavigationHandleImpl::UpdateSiteURL() { +void NavigationHandleImpl::UpdateSiteURL( + RenderProcessHost* post_redirect_process) { GURL new_site_url = SiteInstance::GetSiteForURL( frame_tree_node_->navigator()->GetController()->GetBrowserContext(), url_); - if (new_site_url == site_url_) + int post_redirect_process_id = post_redirect_process + ? post_redirect_process->GetID() + : ChildProcessHost::kInvalidUniqueID; + if (new_site_url == site_url_ && + post_redirect_process_id == expected_render_process_host_id_) { return; + } - // When redirecting cross-site, stop telling the speculative - // RenderProcessHost to expect a navigation commit. + // Stop expecting a navigation to the current site URL in the current expected + // process. SetExpectedProcess(nullptr); + + // Update the site URL and the expected process. site_url_ = new_site_url; + SetExpectedProcess(post_redirect_process); } } // namespace content
diff --git a/content/browser/frame_host/navigation_handle_impl.h b/content/browser/frame_host/navigation_handle_impl.h index 03ebb11..05fd51b5 100644 --- a/content/browser/frame_host/navigation_handle_impl.h +++ b/content/browser/frame_host/navigation_handle_impl.h
@@ -277,6 +277,11 @@ // |callback| will be called when all throttles check have completed. This // will allow the caller to cancel the navigation or let it proceed. // This will also inform the delegate that the request was redirected. + // + // PlzNavigate: |post_redirect_process| is the renderer process we expect to + // use to commit the navigation now that it has been redirected. It can be + // null if there is no live process that can be used. In that case, a suitable + // renderer process will be created at commit time. void WillRedirectRequest( const GURL& new_url, const std::string& new_method, @@ -284,6 +289,7 @@ bool new_is_external_protocol, scoped_refptr<net::HttpResponseHeaders> response_headers, net::HttpResponseInfo::ConnectionInfo connection_info, + RenderProcessHost* post_redirect_process, const ThrottleChecksFinishedCallback& callback); // Called when the URLRequest has delivered response headers and metadata. @@ -430,9 +436,10 @@ // Updates the destination site URL for this navigation. This is called on // redirects. - // PlzNavigate: When redirected cross-site, the speculative RenderProcessHost - // will stop expecting this navigation to commit. - void UpdateSiteURL(); + // PlzNavigate: |post_redirect_process| is the renderer process that should + // handle the navigation following the redirect if it can be handled by an + // existing RenderProcessHost. Otherwise, it should be null. + void UpdateSiteURL(RenderProcessHost* post_redirect_process); // See NavigationHandle for a description of those member variables. GURL url_; @@ -580,6 +587,10 @@ // in it. int expected_render_process_host_id_; + // TODO(arthursonzogni): Remove this when we understand the root cause behind + // crbug.com/704892. + bool is_in_constructor; + base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl);
diff --git a/content/browser/frame_host/navigation_handle_impl_unittest.cc b/content/browser/frame_host/navigation_handle_impl_unittest.cc index 64535f9..0cb0857 100644 --- a/content/browser/frame_host/navigation_handle_impl_unittest.cc +++ b/content/browser/frame_host/navigation_handle_impl_unittest.cc
@@ -156,7 +156,7 @@ // the NavigationHandleImplTest. test_handle_->WillRedirectRequest( GURL(), "GET", GURL(), false, scoped_refptr<net::HttpResponseHeaders>(), - net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1, + net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1, nullptr, base::Bind(&NavigationHandleImplTest::UpdateThrottleCheckResult, base::Unretained(this))); }
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc index dfdff523..ba72304c 100644 --- a/content/browser/frame_host/navigation_request.cc +++ b/content/browser/frame_host/navigation_request.cc
@@ -553,6 +553,25 @@ } } + // Compute the SiteInstance to use for the redirect and pass its + // RenderProcessHost if it has a process. Keep a reference if it has a + // process, so that the SiteInstance and its associated process aren't deleted + // before the navigation is ready to commit. + scoped_refptr<SiteInstance> site_instance = + frame_tree_node_->render_manager()->GetSiteInstanceForNavigationRequest( + *this); + speculative_site_instance_ = + site_instance->HasProcess() ? site_instance : nullptr; + + // Check what the process of the SiteInstance is. It will be passed to the + // NavigationHandle, and informed to expect a navigation to the redirected + // URL. + // Note: calling GetProcess on the SiteInstance can lead to the creation of a + // new process if it doesn't have one. In this case, it should only be called + // on a SiteInstance that already has a process. + RenderProcessHost* expected_process = + site_instance->HasProcess() ? site_instance->GetProcess() : nullptr; + // It's safe to use base::Unretained because this NavigationRequest owns the // NavigationHandle where the callback will be stored. bool is_external_protocol = @@ -560,7 +579,7 @@ navigation_handle_->WillRedirectRequest( common_params_.url, common_params_.method, common_params_.referrer.url, is_external_protocol, response->head.headers, - response->head.connection_info, + response->head.connection_info, expected_process, base::Bind(&NavigationRequest::OnRedirectChecksComplete, base::Unretained(this))); }
diff --git a/content/browser/frame_host/navigation_request.h b/content/browser/frame_host/navigation_request.h index 27568dc..014654a 100644 --- a/content/browser/frame_host/navigation_request.h +++ b/content/browser/frame_host/navigation_request.h
@@ -269,6 +269,12 @@ // The type of SiteInstance associated with this navigation. AssociatedSiteInstanceType associated_site_instance_type_; + // Stores the SiteInstance created on redirects to check if there is an + // existing RenderProcessHost that can commit the navigation so that the + // renderer process is not deleted while the navigation is ongoing. If the + // SiteInstance was a brand new SiteInstance, it is not stored. + scoped_refptr<SiteInstance> speculative_site_instance_; + // Whether the request may be transferred to a different process upon commit. // True for browser-initiated navigations and renderer-inititated navigations // started via the OpenURL path.
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index b352e00..3952b00a 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -45,6 +45,7 @@ #include "content/browser/loader/resource_dispatcher_host_impl.h" #include "content/browser/media/media_interface_proxy.h" #include "content/browser/media/session/media_session_service_impl.h" +#include "content/browser/payments/payment_app_context_impl.h" #include "content/browser/permissions/permission_service_context.h" #include "content/browser/permissions/permission_service_impl.h" #include "content/browser/presentation/presentation_service_impl.h" @@ -60,6 +61,8 @@ #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" #include "content/browser/shared_worker/shared_worker_service_impl.h" +#include "content/browser/storage_partition_impl.h" +#include "content/browser/webauth/authenticator_impl.h" #include "content/browser/websockets/websocket_manager.h" #include "content/browser/webui/url_data_manager_backend.h" #include "content/browser/webui/web_ui_controller_factory_registry.h" @@ -351,6 +354,16 @@ std::move(request)); } +void CreatePaymentManager(RenderFrameHostImpl* rfh, + const service_manager::BindSourceInfo& source_info, + payments::mojom::PaymentManagerRequest request) { + StoragePartitionImpl* storage_partition = + static_cast<StoragePartitionImpl*>(BrowserContext::GetStoragePartition( + rfh->GetSiteInstance()->GetBrowserContext(), rfh->GetSiteInstance())); + storage_partition->GetPaymentAppContext()->CreatePaymentManager( + source_info, std::move(request)); +} + } // namespace // static @@ -2923,6 +2936,14 @@ GetInterfaceRegistry()->AddInterface( base::Bind(&ForwardShapeDetectionRequest< shape_detection::mojom::TextDetectionRequest>)); + + GetInterfaceRegistry()->AddInterface( + base::Bind(&CreatePaymentManager, base::Unretained(this))); + + if (base::FeatureList::IsEnabled(features::kWebAuth)) { + GetInterfaceRegistry()->AddInterface( + base::Bind(&AuthenticatorImpl::Create, base::Unretained(this))); + } } void RenderFrameHostImpl::ResetWaitingState() {
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc index 8da3cb7c..25940df 100644 --- a/content/browser/frame_host/render_frame_host_manager.cc +++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -701,56 +701,19 @@ const NavigationRequest& request) { CHECK(IsBrowserSideNavigationEnabled()); - SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance(); - - SiteInstance* candidate_site_instance = - speculative_render_frame_host_ - ? speculative_render_frame_host_->GetSiteInstance() - : nullptr; - - bool was_server_redirect = request.navigation_handle() && - request.navigation_handle()->WasServerRedirect(); - - scoped_refptr<SiteInstance> dest_site_instance = GetSiteInstanceForNavigation( - request.common_params().url, request.source_site_instance(), - request.dest_site_instance(), candidate_site_instance, - request.common_params().transition, - request.restore_type() != RestoreType::NONE, request.is_view_source(), - was_server_redirect); - // The appropriate RenderFrameHost to commit the navigation. RenderFrameHostImpl* navigation_rfh = nullptr; - // Reuse the current RenderFrameHost if its SiteInstance matches the - // navigation's. - bool no_renderer_swap = current_site_instance == dest_site_instance.get(); + // First compute the SiteInstance to use for the navigation. + SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance(); + scoped_refptr<SiteInstance> dest_site_instance = + GetSiteInstanceForNavigationRequest(request); - if (frame_tree_node_->IsMainFrame()) { - // Renderer-initiated main frame navigations that may require a - // SiteInstance swap are sent to the browser via the OpenURL IPC and are - // afterwards treated as browser-initiated navigations. NavigationRequests - // marked as renderer-initiated are created by receiving a BeginNavigation - // IPC, and will then proceed in the same renderer. In site-per-process - // mode, it is possible for renderer-intiated navigations to be allowed to - // go cross-process. Check it first. - bool can_renderer_initiate_transfer = - render_frame_host_->IsRenderFrameLive() && - ShouldMakeNetworkRequestForURL(request.common_params().url) && - IsRendererTransferNeededForNavigation(render_frame_host_.get(), - request.common_params().url); - - no_renderer_swap |= - !request.may_transfer() && !can_renderer_initiate_transfer; - } else { - // Subframe navigations will use the current renderer, unless specifically - // allowed to swap processes. - no_renderer_swap |= !CanSubframeSwapProcess( - request.common_params().url, request.source_site_instance(), - request.dest_site_instance(), was_server_redirect); - } + // The SiteInstance determines whether to switch RenderFrameHost or not. + bool use_current_rfh = current_site_instance == dest_site_instance; bool notify_webui_of_rf_creation = false; - if (no_renderer_swap) { + if (use_current_rfh) { // GetFrameHostForNavigation will be called more than once during a // navigation (currently twice, on request and when it's about to commit in // the renderer). In the follow up calls an existing pending WebUI should @@ -1973,6 +1936,62 @@ return created; } +scoped_refptr<SiteInstance> +RenderFrameHostManager::GetSiteInstanceForNavigationRequest( + const NavigationRequest& request) { + // First, check if the navigation can switch SiteInstances. If not, the + // navigation should use the current SiteInstance. + SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance(); + bool no_renderer_swap_allowed = false; + bool was_server_redirect = request.navigation_handle() && + request.navigation_handle()->WasServerRedirect(); + + if (frame_tree_node_->IsMainFrame()) { + // Renderer-initiated main frame navigations that may require a + // SiteInstance swap are sent to the browser via the OpenURL IPC and are + // afterwards treated as browser-initiated navigations. NavigationRequests + // marked as renderer-initiated are created by receiving a BeginNavigation + // IPC, and will then proceed in the same renderer. In site-per-process + // mode, it is possible for renderer-intiated navigations to be allowed to + // go cross-process. Check it first. + bool can_renderer_initiate_transfer = + render_frame_host_->IsRenderFrameLive() && + ShouldMakeNetworkRequestForURL(request.common_params().url) && + IsRendererTransferNeededForNavigation(render_frame_host_.get(), + request.common_params().url); + + no_renderer_swap_allowed |= + !request.may_transfer() && !can_renderer_initiate_transfer; + } else { + // Subframe navigations will use the current renderer, unless specifically + // allowed to swap processes. + no_renderer_swap_allowed |= !CanSubframeSwapProcess( + request.common_params().url, request.source_site_instance(), + request.dest_site_instance(), was_server_redirect); + } + + if (no_renderer_swap_allowed) + return scoped_refptr<SiteInstance>(current_site_instance); + + // If the navigation can swap SiteInstances, compute the SiteInstance it + // should use. + // TODO(clamy): We should also consider as a candidate SiteInstance the + // speculative SiteInstance that was computed on redirects. + SiteInstance* candidate_site_instance = + speculative_render_frame_host_ + ? speculative_render_frame_host_->GetSiteInstance() + : nullptr; + + scoped_refptr<SiteInstance> dest_site_instance = GetSiteInstanceForNavigation( + request.common_params().url, request.source_site_instance(), + request.dest_site_instance(), candidate_site_instance, + request.common_params().transition, + request.restore_type() != RestoreType::NONE, request.is_view_source(), + was_server_redirect); + + return dest_site_instance; +} + bool RenderFrameHostManager::InitRenderFrame( RenderFrameHostImpl* render_frame_host) { if (render_frame_host->IsRenderFrameLive())
diff --git a/content/browser/frame_host/render_frame_host_manager.h b/content/browser/frame_host/render_frame_host_manager.h index da2d654..df0c3eda 100644 --- a/content/browser/frame_host/render_frame_host_manager.h +++ b/content/browser/frame_host/render_frame_host_manager.h
@@ -505,6 +505,15 @@ bool InitRenderView(RenderViewHostImpl* render_view_host, RenderFrameProxyHost* proxy); + // Returns the SiteInstance that should be used to host the navigation handled + // by |navigation_request|. + // Note: the SiteInstance returned by this function may not have an + // initialized RenderProcessHost. It will only be initialized when + // GetProcess() is called on the SiteInstance. In particular, calling this + // function will never lead to a process being created for the navigation. + scoped_refptr<SiteInstance> GetSiteInstanceForNavigationRequest( + const NavigationRequest& navigation_request); + private: friend class NavigatorTestWithBrowserSideNavigation; friend class RenderFrameHostManagerTest;
diff --git a/content/browser/isolated_origin_browsertest.cc b/content/browser/isolated_origin_browsertest.cc index 484cce2..838d33c6 100644 --- a/content/browser/isolated_origin_browsertest.cc +++ b/content/browser/isolated_origin_browsertest.cc
@@ -468,4 +468,38 @@ new_shell->web_contents()->GetMainFrame()->GetProcess()); } +// Check that subdomains on an isolated origin (e.g., bar.isolated.foo.com) +// also end up in the isolated origin's SiteInstance. +IN_PROC_BROWSER_TEST_F(IsolatedOriginTest, IsolatedOriginWithSubdomain) { + // Start on a page with an isolated origin with a same-site iframe. + GURL isolated_url(embedded_test_server()->GetURL("isolated.foo.com", + "/page_with_iframe.html")); + EXPECT_TRUE(NavigateToURL(shell(), isolated_url)); + + FrameTreeNode* root = web_contents()->GetFrameTree()->root(); + FrameTreeNode* child = root->child_at(0); + scoped_refptr<SiteInstance> isolated_instance = + web_contents()->GetSiteInstance(); + + // Navigate iframe to the isolated origin's subdomain. + GURL isolated_subdomain_url( + embedded_test_server()->GetURL("bar.isolated.foo.com", "/title1.html")); + NavigateIframeToURL(web_contents(), "test_iframe", isolated_subdomain_url); + EXPECT_EQ(child->current_url(), isolated_subdomain_url); + + EXPECT_EQ(isolated_instance, child->current_frame_host()->GetSiteInstance()); + EXPECT_FALSE(child->current_frame_host()->IsCrossProcessSubframe()); + EXPECT_EQ(isolated_url.GetOrigin(), + child->current_frame_host()->GetSiteInstance()->GetSiteURL()); + + // Now try navigating the main frame (renderer-initiated) to the isolated + // origin's subdomain. This should not swap processes. + TestNavigationObserver observer(web_contents()); + EXPECT_TRUE( + ExecuteScript(web_contents(), + "location.href = '" + isolated_subdomain_url.spec() + "'")); + observer.Wait(); + EXPECT_EQ(isolated_instance, web_contents()->GetSiteInstance()); +} + } // namespace content
diff --git a/content/browser/isolated_origin_util.cc b/content/browser/isolated_origin_util.cc new file mode 100644 index 0000000..fe25348 --- /dev/null +++ b/content/browser/isolated_origin_util.cc
@@ -0,0 +1,67 @@ +// Copyright (c) 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/isolated_origin_util.h" + +#include "base/strings/string_util.h" +#include "net/base/registry_controlled_domains/registry_controlled_domain.h" +#include "url/gurl.h" + +namespace content { + +// static +bool IsolatedOriginUtil::DoesOriginMatchIsolatedOrigin( + const url::Origin& origin, + const url::Origin& isolated_origin) { + // Don't match subdomains if the isolated origin is an IP address. + if (isolated_origin.GetURL().HostIsIPAddress()) + return origin == isolated_origin; + + if (origin.scheme() != isolated_origin.scheme()) + return false; + + if (origin.port() != isolated_origin.port()) + return false; + + // Subdomains of an isolated origin are considered to be in the same isolated + // origin. + return origin.DomainIs(isolated_origin.host()); +} + +// static +bool IsolatedOriginUtil::IsValidIsolatedOrigin(const url::Origin& origin) { + if (origin.unique()) + return false; + + // Isolated origins should have HTTP or HTTPS schemes. Hosts in other + // schemes may not be compatible with subdomain matching. + GURL origin_gurl = origin.GetURL(); + if (!origin_gurl.SchemeIsHTTPOrHTTPS()) + return false; + + // IP addresses are allowed. + if (origin_gurl.HostIsIPAddress()) + return true; + + // Disallow hosts such as http://co.uk/, which don't have a valid + // registry-controlled domain. This prevents subdomain matching from + // grouping unrelated sites on a registry into the same origin. + const bool has_registry_domain = + net::registry_controlled_domains::HostHasRegistryControlledDomain( + origin.host(), + net::registry_controlled_domains::INCLUDE_UNKNOWN_REGISTRIES, + net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); + if (!has_registry_domain) + return false; + + // For now, disallow hosts with a trailing dot. + // TODO(alexmos): Enabling this would require carefully thinking about + // whether hosts without a trailing dot should match it. + if (origin.host().back() == '.') + return false; + + return true; +} + +} // namespace content
diff --git a/content/browser/isolated_origin_util.h b/content/browser/isolated_origin_util.h new file mode 100644 index 0000000..4ee8037 --- /dev/null +++ b/content/browser/isolated_origin_util.h
@@ -0,0 +1,39 @@ +// Copyright (c) 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_ISOLATED_ORIGIN_UTIL_H_ +#define CONTENT_BROWSER_ISOLATED_ORIGIN_UTIL_H_ + +#include "content/common/content_export.h" +#include "url/origin.h" + +namespace content { + +class CONTENT_EXPORT IsolatedOriginUtil { + public: + // Checks whether |origin| matches the isolated origin specified by + // |isolated_origin|. Subdomains are considered to match isolated origins, + // so this will be true if + // (1) |origin| has the same scheme, host, and port as |isolated_origin|, or + // (2) |origin| has the same scheme and port as |isolated_origin|, and its + // host is a subdomain of |isolated_origin|'s host. + // This does not consider site URLs, which don't care about port. + // + // For example, if |isolated_origin| is https://isolated.foo.com, this will + // return true if |origin| is https://isolated.foo.com or + // https://bar.isolated.foo.com, but it will return false for an |origin| of + // https://unisolated.foo.com or https://foo.com. + static bool DoesOriginMatchIsolatedOrigin(const url::Origin& origin, + const url::Origin& isolated_origin); + + // Check if |origin| is a valid isolated origin. Invalid isolated origins + // include unique origins, origins that don't have an HTTP or HTTPS scheme, + // and origins without a valid registry-controlled domain. IP addresses are + // allowed. + static bool IsValidIsolatedOrigin(const url::Origin& origin); +}; + +} // namespace content + +#endif // CONTENT_BROWSER_ISOLATED_ORIGIN_UTIL_H_
diff --git a/content/browser/loader/navigation_resource_throttle.cc b/content/browser/loader/navigation_resource_throttle.cc index 950ffe2b..0d79161 100644 --- a/content/browser/loader/navigation_resource_throttle.cc +++ b/content/browser/loader/navigation_resource_throttle.cc
@@ -134,7 +134,7 @@ ->FilterURL(false, &new_validated_url); navigation_handle->WillRedirectRequest( new_validated_url, new_method, new_referrer_url, new_is_external_protocol, - headers, connection_info, + headers, connection_info, nullptr, base::Bind(&SendCheckResultToIOThread, callback)); }
diff --git a/content/browser/loader/navigation_url_loader_network_service.cc b/content/browser/loader/navigation_url_loader_network_service.cc index f6628597..588f30c 100644 --- a/content/browser/loader/navigation_url_loader_network_service.cc +++ b/content/browser/loader/navigation_url_loader_network_service.cc
@@ -63,28 +63,28 @@ net::NetworkTrafficAnnotationTag kTrafficAnnotation = net::DefineNetworkTrafficAnnotation("navigation_url_loader", R"( - semantics { - sender: "Navigation URL Loader" - description: - "This request is issued by a main frame navigation to fetch the " - "content of the page that is being navigated to." - trigger: - "Navigating Chrome (by clicking on a link, bookmark, history item, " - "using session restore, etc)." - data: - "Arbitrary site-controlled data can be included in the URL, HTTP " - "headers, and request body. Requests may include cookies and " - "site-specific credentials." - destination: WEBSITE - } - policy { - cookies_allowed: true - cookies_store: "user" - setting: "This feature cannot be disabled." - policy_exception_justification: - "Not implemented, without this type of request, Chrome would be " - "unable to navigate to websites." - })"); + semantics { + sender: "Navigation URL Loader" + description: + "This request is issued by a main frame navigation to fetch the " + "content of the page that is being navigated to." + trigger: + "Navigating Chrome (by clicking on a link, bookmark, history item, " + "using session restore, etc)." + data: + "Arbitrary site-controlled data can be included in the URL, HTTP " + "headers, and request body. Requests may include cookies and " + "site-specific credentials." + destination: WEBSITE + } + policy { + cookies_allowed: true + cookies_store: "user" + setting: "This feature cannot be disabled." + policy_exception_justification: + "Not implemented, without this type of request, Chrome would be " + "unable to navigate to websites." + })"); } // namespace @@ -139,7 +139,7 @@ web_contents_getter_), 0 /* routing_id? */, 0 /* request_id? */, mojom::kURLLoadOptionSendSSLInfo, *resource_request_, this, - net::MutableNetworkTrafficAnnotationTag(kTrafficAnnotation)); + kTrafficAnnotation); return; } @@ -187,7 +187,7 @@ std::move(start_loader_callback), GetContentClient()->browser()->CreateURLLoaderThrottles( web_contents_getter_), - *resource_request_, this); + *resource_request_, this, kTrafficAnnotation); DCHECK_GT(handler_index_, 0U); @@ -221,7 +221,7 @@ web_contents_getter_), 0 /* routing_id? */, 0 /* request_id? */, mojom::kURLLoadOptionSendSSLInfo, *resource_request_, this, - net::MutableNetworkTrafficAnnotationTag(kTrafficAnnotation)); + kTrafficAnnotation); } void FollowRedirect() {
diff --git a/content/browser/media/capture/DEPS b/content/browser/media/capture/DEPS index f84e43ef..6928a436 100644 --- a/content/browser/media/capture/DEPS +++ b/content/browser/media/capture/DEPS
@@ -1,5 +1,5 @@ include_rules = [ - "+components/display_compositor", + "+components/viz/common", "+third_party/libyuv", # For scaling in desktop_capture_device.cc. ]
diff --git a/content/browser/net/reporting_service_proxy.cc b/content/browser/net/reporting_service_proxy.cc new file mode 100644 index 0000000..c6785a2 --- /dev/null +++ b/content/browser/net/reporting_service_proxy.cc
@@ -0,0 +1,83 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/net/reporting_service_proxy.h" + +#include <memory> +#include <string> +#include <utility> + +#include "base/memory/ref_counted.h" +#include "base/values.h" +#include "content/public/browser/browser_context.h" +#include "content/public/browser/site_instance.h" +#include "content/public/browser/storage_partition.h" +#include "mojo/public/cpp/bindings/strong_binding.h" +#include "net/reporting/reporting_service.h" +#include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" +#include "third_party/WebKit/public/platform/reporting.mojom.h" +#include "url/gurl.h" + +namespace content { + +namespace { + +class ReportingServiceProxyImpl : public mojom::ReportingServiceProxy { + public: + ReportingServiceProxyImpl( + scoped_refptr<net::URLRequestContextGetter> request_context_getter) + : request_context_getter_(std::move(request_context_getter)) {} + + // mojom::ReportingServiceProxy: + void QueueReport(const GURL& url, + const std::string& group, + const std::string& type, + std::unique_ptr<base::Value> body) override { + std::unique_ptr<const base::Value> const_body = + base::WrapUnique(body.release()); + + net::URLRequestContext* request_context = + request_context_getter_->GetURLRequestContext(); + if (!request_context) + return; + + net::ReportingService* reporting_service = + request_context->reporting_service(); + if (!reporting_service) + return; + + reporting_service->QueueReport(url, group, type, std::move(const_body)); + } + + private: + scoped_refptr<net::URLRequestContextGetter> request_context_getter_; +}; + +void CreateReportingServiceProxyOnNetworkTaskRunner( + mojom::ReportingServiceProxyRequest request, + scoped_refptr<net::URLRequestContextGetter> request_context_getter) { + mojo::MakeStrongBinding(base::MakeUnique<ReportingServiceProxyImpl>( + std::move(request_context_getter)), + std::move(request)); +} + +} // namespace + +// static +void CreateReportingServiceProxy( + StoragePartition* storage_partition, + const service_manager::BindSourceInfo& source_info, + mojom::ReportingServiceProxyRequest request) { + scoped_refptr<net::URLRequestContextGetter> request_context_getter( + storage_partition->GetURLRequestContext()); + scoped_refptr<base::SingleThreadTaskRunner> network_task_runner( + request_context_getter->GetNetworkTaskRunner()); + network_task_runner->PostTask( + FROM_HERE, + base::BindOnce(&CreateReportingServiceProxyOnNetworkTaskRunner, + std::move(request), std::move(request_context_getter))); +} + +} // namespace content
diff --git a/content/browser/net/reporting_service_proxy.h b/content/browser/net/reporting_service_proxy.h new file mode 100644 index 0000000..a34c7074 --- /dev/null +++ b/content/browser/net/reporting_service_proxy.h
@@ -0,0 +1,25 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_NET_REPORTING_SERVICE_PROXY_H_ +#define CONTENT_BROWSER_NET_REPORTING_SERVICE_PROXY_H_ + +#include "third_party/WebKit/public/platform/reporting.mojom.h" + +namespace service_manager { +struct BindSourceInfo; +} // namespace service_manager + +namespace content { + +class StoragePartition; + +void CreateReportingServiceProxy( + StoragePartition* storage_partition, + const service_manager::BindSourceInfo& source_info, + mojom::ReportingServiceProxyRequest request); + +} // namespace content + +#endif // CONTENT_BROWSER_NET_REPORTING_SERVICE_PROXY_H_
diff --git a/content/browser/push_messaging/push_messaging_context.cc b/content/browser/push_messaging/push_messaging_context.cc index 23ffd26..83527fa 100644 --- a/content/browser/push_messaging/push_messaging_context.cc +++ b/content/browser/push_messaging/push_messaging_context.cc
@@ -31,10 +31,18 @@ DCHECK_CURRENTLY_ON(BrowserThread::UI); PushMessagingService* push_service = browser_context_->GetPushMessagingService(); - if (push_service != nullptr) { + if (push_service) { push_service->DidDeleteServiceWorkerRegistration(pattern.GetOrigin(), registration_id); } } +void PushMessagingContext::OnStorageWiped() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + PushMessagingService* push_service = + browser_context_->GetPushMessagingService(); + if (push_service) + push_service->DidDeleteServiceWorkerDatabase(); +} + } // namespace content
diff --git a/content/browser/push_messaging/push_messaging_context.h b/content/browser/push_messaging/push_messaging_context.h index a000531..2bde4ef 100644 --- a/content/browser/push_messaging/push_messaging_context.h +++ b/content/browser/push_messaging/push_messaging_context.h
@@ -30,6 +30,7 @@ // ServiceWorkerContextCoreObserver methods void OnRegistrationDeleted(int64_t registration_id, const GURL& pattern) override; + void OnStorageWiped() override; private: friend class base::RefCounted<PushMessagingContext>;
diff --git a/content/browser/renderer_host/DEPS b/content/browser/renderer_host/DEPS index 0e0663e2..ab29198 100644 --- a/content/browser/renderer_host/DEPS +++ b/content/browser/renderer_host/DEPS
@@ -1,6 +1,8 @@ include_rules = [ "+cc/switches.h", # For cc command line switches. - "+components/display_compositor", + "+components/viz/common", + "+components/viz/host", + "+components/viz/service", "+components/variations", "+services/ui/public", "+third_party/zlib",
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc index e0b8c93..6ef9fb42 100644 --- a/content/browser/renderer_host/compositor_impl_android.cc +++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -48,8 +48,8 @@ #include "cc/trees/layer_tree_settings.h" #include "components/viz/common/gl_helper.h" #include "components/viz/host/host_frame_sink_manager.h" -#include "components/viz/service/display_compositor/compositor_overlay_candidate_validator_android.h" -#include "components/viz/service/display_compositor/server_shared_bitmap_manager.h" +#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator_android.h" +#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h" #include "components/viz/service/frame_sinks/frame_sink_manager_impl.h" #include "content/browser/compositor/surface_utils.h" #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
diff --git a/content/browser/renderer_host/input/touch_selection_controller_client_aura_browsertest.cc b/content/browser/renderer_host/input/touch_selection_controller_client_aura_browsertest.cc index 2dccf4b9..2753ce1 100644 --- a/content/browser/renderer_host/input/touch_selection_controller_client_aura_browsertest.cc +++ b/content/browser/renderer_host/input/touch_selection_controller_client_aura_browsertest.cc
@@ -14,6 +14,7 @@ #include "content/browser/renderer_host/render_widget_host_view_aura.h" #include "content/browser/renderer_host/render_widget_host_view_event_handler.h" #include "content/browser/web_contents/web_contents_impl.h" +#include "content/public/browser/overscroll_configuration.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/content_browser_test.h" #include "content/public/test/content_browser_test_utils.h" @@ -652,24 +653,31 @@ selection_controller_client()->InitWaitForSelectionEvent( ui::SELECTION_HANDLES_CLEARED); + float event_x = 10.f; + const float event_y = 10.f; ui::GestureEventDetails scroll_begin_details(ui::ET_GESTURE_SCROLL_BEGIN); scroll_begin_details.set_device_type( ui::GestureDeviceType::DEVICE_TOUCHSCREEN); - ui::GestureEvent scroll_begin(10, 10, 0, ui::EventTimeForNow(), + ui::GestureEvent scroll_begin(event_x, event_y, 0, ui::EventTimeForNow(), scroll_begin_details); rwhva->OnGestureEvent(&scroll_begin); + const int window_width = rwhva->GetNativeView()->bounds().width(); + const float overscroll_threshold = + GetOverscrollConfig(OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHSCREEN); + const float scroll_amount = window_width * overscroll_threshold + 1; + event_x += scroll_amount; ui::GestureEventDetails scroll_update_details(ui::ET_GESTURE_SCROLL_UPDATE, - 200, 0); + scroll_amount, 0); scroll_update_details.set_device_type( ui::GestureDeviceType::DEVICE_TOUCHSCREEN); - ui::GestureEvent scroll_update(210, 10, 0, ui::EventTimeForNow(), + ui::GestureEvent scroll_update(event_x, event_y, 0, ui::EventTimeForNow(), scroll_update_details); rwhva->OnGestureEvent(&scroll_update); ui::GestureEventDetails scroll_end_details(ui::ET_GESTURE_SCROLL_END); scroll_end_details.set_device_type(ui::GestureDeviceType::DEVICE_TOUCHSCREEN); - ui::GestureEvent scroll_end(210, 10, 0, ui::EventTimeForNow(), + ui::GestureEvent scroll_end(event_x, event_y, 0, ui::EventTimeForNow(), scroll_end_details); rwhva->OnGestureEvent(&scroll_end);
diff --git a/content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc b/content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc index c982e896..c4b22ae 100644 --- a/content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc +++ b/content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc
@@ -22,7 +22,7 @@ #include "build/build_config.h" #include "cc/test/test_context_provider.h" #include "cc/test/test_web_graphics_context_3d.h" -#include "components/viz/service/display_compositor/buffer_queue.h" +#include "components/viz/service/display_embedder/buffer_queue.h" #include "content/browser/renderer_host/media/video_capture_controller.h" #include "media/base/video_frame.h" #include "media/capture/video/video_capture_buffer_pool_impl.h"
diff --git a/content/browser/renderer_host/overscroll_configuration.cc b/content/browser/renderer_host/overscroll_configuration.cc index 4ab27a8..2fc311f37 100644 --- a/content/browser/renderer_host/overscroll_configuration.cc +++ b/content/browser/renderer_host/overscroll_configuration.cc
@@ -11,15 +11,12 @@ namespace { -float g_horiz_threshold_complete = 0.25f; -float g_vert_threshold_complete = 0.20f; +const float kHorizThresholdComplete = 0.25f; +const float kVertThresholdComplete = 0.20f; -float g_horiz_threshold_start_touchscreen = 50.f; -float g_horiz_threshold_start_touchpad = 50.f; -float g_vert_threshold_start = 0.f; - -float g_horiz_resist_after = 30.f; -float g_vert_resist_after = 30.f; +const float kHorizThresholdStartTouchscreen = 50.f; +const float kHorizThresholdStartTouchpad = 50.f; +const float kVertThresholdStart = 0.f; float GetHorizontalStartThresholdMultiplier() { base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); @@ -44,34 +41,27 @@ float GetOverscrollConfig(OverscrollConfig config) { switch (config) { case OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE: - return g_horiz_threshold_complete; + return kHorizThresholdComplete; case OVERSCROLL_CONFIG_VERT_THRESHOLD_COMPLETE: - return g_vert_threshold_complete; + return kVertThresholdComplete; case OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHSCREEN: static const float horiz_threshold_start_touchscreen = GetHorizontalStartThresholdMultiplier() * - g_horiz_threshold_start_touchscreen; + kHorizThresholdStartTouchscreen; return horiz_threshold_start_touchscreen; case OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHPAD: static const float horiz_threshold_start_touchpad = GetHorizontalStartThresholdMultiplier() * - g_horiz_threshold_start_touchpad; + kHorizThresholdStartTouchpad; return horiz_threshold_start_touchpad; case OVERSCROLL_CONFIG_VERT_THRESHOLD_START: - return g_vert_threshold_start; - - case OVERSCROLL_CONFIG_HORIZ_RESIST_AFTER: - return g_horiz_resist_after; - - case OVERSCROLL_CONFIG_VERT_RESIST_AFTER: - return g_vert_resist_after; + return kVertThresholdStart; case OVERSCROLL_CONFIG_NONE: - case OVERSCROLL_CONFIG_COUNT: NOTREACHED(); }
diff --git a/content/browser/renderer_host/overscroll_controller.cc b/content/browser/renderer_host/overscroll_controller.cc index 7f32ae0..c5e978d4 100644 --- a/content/browser/renderer_host/overscroll_controller.cc +++ b/content/browser/renderer_host/overscroll_controller.cc
@@ -31,15 +31,9 @@ namespace content { -OverscrollController::OverscrollController() - : overscroll_mode_(OVERSCROLL_NONE), - scroll_state_(STATE_UNKNOWN), - overscroll_delta_x_(0.f), - overscroll_delta_y_(0.f), - delegate_(NULL) {} +OverscrollController::OverscrollController() {} -OverscrollController::~OverscrollController() { -} +OverscrollController::~OverscrollController() {} bool OverscrollController::ShouldProcessEvent( const blink::WebInputEvent& event) { @@ -182,6 +176,7 @@ void OverscrollController::Reset() { overscroll_mode_ = OVERSCROLL_NONE; + overscroll_source_ = OverscrollSource::NONE; overscroll_delta_x_ = overscroll_delta_y_ = 0.f; scroll_state_ = STATE_UNKNOWN; } @@ -208,16 +203,13 @@ // from the touchpad since it is sent based on a timeout not // when the user has stopped interacting. if (event.GetType() == blink::WebInputEvent::kGestureScrollEnd && - IsGestureEventFromTouchpad(event)) + IsGestureEventFromTouchpad(event)) { return false; + } if (!delegate_) return false; - gfx::Rect bounds = delegate_->GetVisibleBounds(); - if (bounds.IsEmpty()) - return false; - if (event.GetType() == blink::WebInputEvent::kGestureFlingStart) { // Check to see if the fling is in the same direction of the overscroll. const blink::WebGestureEvent gesture = @@ -244,13 +236,19 @@ } } + const gfx::Size size = overscroll_source_ == OverscrollSource::TOUCHPAD + ? delegate_->GetDisplaySize() + : delegate_->GetVisibleSize(); + if (size.IsEmpty()) + return false; + float ratio, threshold; if (overscroll_mode_ == OVERSCROLL_WEST || overscroll_mode_ == OVERSCROLL_EAST) { - ratio = fabs(overscroll_delta_x_) / bounds.width(); + ratio = fabs(overscroll_delta_x_) / size.width(); threshold = GetOverscrollConfig(OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE); } else { - ratio = fabs(overscroll_delta_y_) / bounds.height(); + ratio = fabs(overscroll_delta_y_) / size.height(); threshold = GetOverscrollConfig(OVERSCROLL_CONFIG_VERT_THRESHOLD_COMPLETE); } @@ -422,6 +420,7 @@ if (delegate_) delegate_->OnOverscrollComplete(overscroll_mode_); overscroll_mode_ = OVERSCROLL_NONE; + overscroll_source_ = OverscrollSource::NONE; overscroll_delta_x_ = overscroll_delta_y_ = 0.f; } @@ -435,6 +434,7 @@ OverscrollMode old_mode = overscroll_mode_; overscroll_mode_ = mode; + overscroll_source_ = source; if (overscroll_mode_ == OVERSCROLL_NONE) overscroll_delta_x_ = overscroll_delta_y_ = 0.f; else
diff --git a/content/browser/renderer_host/overscroll_controller.h b/content/browser/renderer_host/overscroll_controller.h index ebb9fc8..479dab6 100644 --- a/content/browser/renderer_host/overscroll_controller.h +++ b/content/browser/renderer_host/overscroll_controller.h
@@ -120,23 +120,26 @@ bool ShouldProcessEvent(const blink::WebInputEvent& event); // The current state of overscroll gesture. - OverscrollMode overscroll_mode_; + OverscrollMode overscroll_mode_ = OVERSCROLL_NONE; + + // Source of the current overscroll gesture. + OverscrollSource overscroll_source_ = OverscrollSource::NONE; // Used to keep track of the scrolling state. // If scrolling starts, and some scroll events are consumed at the beginning // of the scroll (i.e. some content on the web-page was scrolled), then do not // process any of the subsequent scroll events for generating overscroll // gestures. - ScrollState scroll_state_; + ScrollState scroll_state_ = STATE_UNKNOWN; // The amount of overscroll in progress. These values are invalid when // |overscroll_mode_| is set to OVERSCROLL_NONE. - float overscroll_delta_x_; - float overscroll_delta_y_; + float overscroll_delta_x_ = 0.f; + float overscroll_delta_y_ = 0.f; // The delegate that receives the overscroll updates. The delegate is not // owned by this controller. - OverscrollControllerDelegate* delegate_; + OverscrollControllerDelegate* delegate_ = nullptr; DISALLOW_COPY_AND_ASSIGN(OverscrollController); };
diff --git a/content/browser/renderer_host/overscroll_controller_delegate.h b/content/browser/renderer_host/overscroll_controller_delegate.h index 97e294bc..e2f8a8f 100644 --- a/content/browser/renderer_host/overscroll_controller_delegate.h +++ b/content/browser/renderer_host/overscroll_controller_delegate.h
@@ -9,7 +9,7 @@ #include "base/macros.h" #include "content/browser/renderer_host/overscroll_controller.h" #include "content/common/content_export.h" -#include "ui/gfx/geometry/rect.h" +#include "ui/gfx/geometry/size.h" namespace content { @@ -20,9 +20,12 @@ OverscrollControllerDelegate() {} virtual ~OverscrollControllerDelegate() {} - // Get the bounds of the view corresponding to the delegate. Overscroll-ending - // events will only be processed if the visible bounds are non-empty. - virtual gfx::Rect GetVisibleBounds() const = 0; + // Get the size of the view corresponding to the delegate. + virtual gfx::Size GetVisibleSize() const = 0; + + // Get the size of the display containing the view corresponding to the + // delegate. + virtual gfx::Size GetDisplaySize() const = 0; // This is called for each update in the overscroll amount. Returns true if // the delegate consumed the event.
diff --git a/content/browser/renderer_host/p2p/socket_host_throttler.cc b/content/browser/renderer_host/p2p/socket_host_throttler.cc index 90c42088..1cb6d42 100644 --- a/content/browser/renderer_host/p2p/socket_host_throttler.cc +++ b/content/browser/renderer_host/p2p/socket_host_throttler.cc
@@ -6,8 +6,8 @@ #include <utility> -#include "third_party/webrtc/base/ratelimiter.h" -#include "third_party/webrtc/base/timeutils.h" +#include "third_party/webrtc/rtc_base/ratelimiter.h" +#include "third_party/webrtc/rtc_base/timeutils.h" namespace content {
diff --git a/content/browser/renderer_host/p2p/socket_host_udp.h b/content/browser/renderer_host/p2p/socket_host_udp.h index 57a539b4..7179369 100644 --- a/content/browser/renderer_host/p2p/socket_host_udp.h +++ b/content/browser/renderer_host/p2p/socket_host_udp.h
@@ -24,7 +24,7 @@ #include "net/base/ip_endpoint.h" #include "net/socket/diff_serv_code_point.h" #include "net/socket/udp_server_socket.h" -#include "third_party/webrtc/base/asyncpacketsocket.h" +#include "third_party/webrtc/rtc_base/asyncpacketsocket.h" namespace content {
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc index 52fe2b6..5f4a396a 100644 --- a/content/browser/renderer_host/render_message_filter.cc +++ b/content/browser/renderer_host/render_message_filter.cc
@@ -20,7 +20,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/threading/thread.h" #include "build/build_config.h" -#include "components/viz/service/display_compositor/server_shared_bitmap_manager.h" +#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h" #include "content/browser/blob_storage/chrome_blob_storage_context.h" #include "content/browser/browser_main_loop.h" #include "content/browser/cache_storage/cache_storage_cache.h"
diff --git a/content/browser/renderer_host/render_message_filter.h b/content/browser/renderer_host/render_message_filter.h index 94b9e16..5cdea21 100644 --- a/content/browser/renderer_host/render_message_filter.h +++ b/content/browser/renderer_host/render_message_filter.h
@@ -20,7 +20,7 @@ #include "base/strings/string16.h" #include "build/build_config.h" #include "cc/resources/shared_bitmap_manager.h" -#include "components/viz/service/display_compositor/shared_bitmap_allocation_notifier_impl.h" +#include "components/viz/service/display_embedder/shared_bitmap_allocation_notifier_impl.h" #include "content/common/cache_storage/cache_storage_types.h" #include "content/common/render_message_filter.mojom.h" #include "content/public/browser/browser_associated_interface.h"
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 67c5e5d..32ad1d5 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -95,6 +95,7 @@ #include "content/browser/media/midi_host.h" #include "content/browser/memory/memory_coordinator_impl.h" #include "content/browser/mime_registry_impl.h" +#include "content/browser/net/reporting_service_proxy.h" #include "content/browser/notifications/notification_message_filter.h" #include "content/browser/notifications/platform_notification_context_impl.h" #include "content/browser/payments/payment_manager.h" @@ -186,6 +187,7 @@ #include "mojo/public/cpp/bindings/strong_binding.h" #include "net/url_request/url_request_context_getter.h" #include "ppapi/features/features.h" +#include "services/resource_coordinator/public/cpp/resource_coordinator_features.h" #include "services/resource_coordinator/public/cpp/resource_coordinator_interface.h" #include "services/service_manager/embedder/switches.h" #include "services/service_manager/public/cpp/binder_registry.h" @@ -528,6 +530,14 @@ std::move(request)); } +void CreateResourceCoordinatorProcessInterface( + RenderProcessHostImpl* render_process_host, + const service_manager::BindSourceInfo& source_info, + resource_coordinator::mojom::CoordinationUnitRequest request) { + render_process_host->GetProcessResourceCoordinator()->service()->AddBinding( + std::move(request)); +} + // Forwards service requests to Service Manager since the renderer cannot launch // out-of-process services on is own. template <typename R> @@ -1662,6 +1672,11 @@ registry->AddInterface( base::Bind(&metrics::CreateSingleSampleMetricsProvider)); + if (base::FeatureList::IsEnabled(features::kGlobalResourceCoordinator)) { + registry->AddInterface(base::Bind( + &CreateResourceCoordinatorProcessInterface, base::Unretained(this))); + } + if (base::FeatureList::IsEnabled(features::kOffMainThreadFetch)) { scoped_refptr<ServiceWorkerContextWrapper> service_worker_context( static_cast<ServiceWorkerContextWrapper*>( @@ -1671,6 +1686,9 @@ resource_message_filter_, service_worker_context)); } + registry->AddInterface( + base::Bind(&CreateReportingServiceProxy, storage_partition_impl_)); + // This is to support usage of WebSockets in cases in which there is no // associated RenderFrame (e.g., Shared Workers). AddUIThreadInterface(registry.get(),
diff --git a/content/browser/renderer_host/render_process_host_unittest.cc b/content/browser/renderer_host/render_process_host_unittest.cc index 59ab8b45..267eb83d 100644 --- a/content/browser/renderer_host/render_process_host_unittest.cc +++ b/content/browser/renderer_host/render_process_host_unittest.cc
@@ -434,8 +434,9 @@ } // Tests that RenderProcessHost reuse considers navigations correctly during -// redirects. -TEST_F(RenderProcessHostUnitTest, ReuseNavigationProcessRedirects) { +// redirects in a renderer-initiated navigation. +TEST_F(RenderProcessHostUnitTest, + ReuseNavigationProcessRedirectsRendererInitiated) { // This is only applicable to PlzNavigate. if (!IsBrowserSideNavigationEnabled()) return; @@ -468,9 +469,13 @@ SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE); EXPECT_EQ(main_test_rfh()->GetProcess(), site_instance->GetProcess()); - // Simulate a cross-site redirect. Getting RenderProcessHost with the - // REUSE_PENDING_OR_COMMITTED_SITE policy should not return the current - // process, whether for the old site or the new site. + // Simulate a cross-site redirect. Getting a RenderProcessHost with the + // REUSE_PENDING_OR_COMMITTED_SITE policy should return the current + // process for the new site since this is a renderer-intiated navigation which + // does not swap processes on cross-site redirects. However, getting a + // RenderProcessHost with the REUSE_PENDING_OR_COMMITTED_SITE policy should no + // longer return the current process for the initial site we were trying to + // navigate to. main_test_rfh()->SimulateRedirect(kRedirectUrl2); site_instance = SiteInstanceImpl::CreateForURL(browser_context(), kUrl); site_instance->set_process_reuse_policy( @@ -480,10 +485,10 @@ SiteInstanceImpl::CreateForURL(browser_context(), kRedirectUrl2); site_instance->set_process_reuse_policy( SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE); - EXPECT_NE(main_test_rfh()->GetProcess(), site_instance->GetProcess()); + EXPECT_EQ(main_test_rfh()->GetProcess(), site_instance->GetProcess()); // Once the navigation is ready to commit, Getting RenderProcessHost with the - // REUSE_PENDING_OR_COMMITTED_SITE policy should not return the current + // REUSE_PENDING_OR_COMMITTED_SITE policy should return the current // process for the final site, but not the initial one. main_test_rfh()->PrepareForCommit(); site_instance = SiteInstanceImpl::CreateForURL(browser_context(), kUrl); @@ -497,6 +502,87 @@ EXPECT_EQ(main_test_rfh()->GetProcess(), site_instance->GetProcess()); } +// Tests that RenderProcessHost reuse considers navigations correctly during +// redirects in a browser-initiated navigation. +TEST_F(RenderProcessHostUnitTest, + ReuseNavigationProcessRedirectsBrowserInitiated) { + // This is only applicable to PlzNavigate. + if (!IsBrowserSideNavigationEnabled()) + return; + + const GURL kInitialUrl("http://google.com"); + const GURL kUrl("http://foo.com"); + const GURL kRedirectUrl1("http://foo.com/redirect"); + const GURL kRedirectUrl2("http://bar.com"); + + NavigateAndCommit(kInitialUrl); + + // At first, trying to get a RenderProcessHost with the + // REUSE_PENDING_OR_COMMITTED_SITE policy should return a new process. + scoped_refptr<SiteInstanceImpl> site_instance = + SiteInstanceImpl::CreateForURL(browser_context(), kUrl); + site_instance->set_process_reuse_policy( + SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE); + EXPECT_NE(main_test_rfh()->GetProcess(), site_instance->GetProcess()); + + // Start a navigation. Now getting RenderProcessHost with the + // REUSE_PENDING_OR_COMMITTED_SITE policy should return the speculative + // process. + contents()->GetController().LoadURL(kUrl, Referrer(), + ui::PAGE_TRANSITION_TYPED, std::string()); + main_test_rfh()->SendBeforeUnloadACK(true); + int speculative_process_host_id = + contents()->GetPendingMainFrame()->GetProcess()->GetID(); + site_instance = SiteInstanceImpl::CreateForURL(browser_context(), kUrl); + site_instance->set_process_reuse_policy( + SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE); + EXPECT_EQ(speculative_process_host_id, site_instance->GetProcess()->GetID()); + + // Simulate a same-site redirect. Getting RenderProcessHost with the + // REUSE_PENDING_OR_COMMITTED_SITE policy should return the speculative + // process. + main_test_rfh()->SimulateRedirect(kRedirectUrl1); + site_instance = SiteInstanceImpl::CreateForURL(browser_context(), kUrl); + site_instance->set_process_reuse_policy( + SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE); + EXPECT_EQ(speculative_process_host_id, site_instance->GetProcess()->GetID()); + + // Simulate a cross-site redirect. Getting a RenderProcessHost with the + // REUSE_PENDING_OR_COMMITTED_SITE policy should no longer return the + // speculative process: neither for the new site nor for the initial site we + // were trying to navigate to. It shouldn't return the current process either. + main_test_rfh()->SimulateRedirect(kRedirectUrl2); + site_instance = SiteInstanceImpl::CreateForURL(browser_context(), kUrl); + site_instance->set_process_reuse_policy( + SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE); + EXPECT_NE(main_test_rfh()->GetProcess(), site_instance->GetProcess()); + EXPECT_NE(speculative_process_host_id, site_instance->GetProcess()->GetID()); + site_instance = + SiteInstanceImpl::CreateForURL(browser_context(), kRedirectUrl2); + site_instance->set_process_reuse_policy( + SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE); + EXPECT_NE(main_test_rfh()->GetProcess(), site_instance->GetProcess()); + EXPECT_NE(speculative_process_host_id, site_instance->GetProcess()->GetID()); + + // Once the navigation is ready to commit, Getting RenderProcessHost with the + // REUSE_PENDING_OR_COMMITTED_SITE policy should return the new speculative + // process for the final site, but not the initial one. The current process + // shouldn't be returned either. + main_test_rfh()->PrepareForCommit(); + speculative_process_host_id = + contents()->GetPendingMainFrame()->GetProcess()->GetID(); + site_instance = SiteInstanceImpl::CreateForURL(browser_context(), kUrl); + site_instance->set_process_reuse_policy( + SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE); + EXPECT_NE(main_test_rfh()->GetProcess(), site_instance->GetProcess()); + EXPECT_NE(speculative_process_host_id, site_instance->GetProcess()->GetID()); + site_instance = + SiteInstanceImpl::CreateForURL(browser_context(), kRedirectUrl2); + site_instance->set_process_reuse_policy( + SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE); + EXPECT_EQ(speculative_process_host_id, site_instance->GetProcess()->GetID()); +} + class EffectiveURLContentBrowserClient : public ContentBrowserClient { public: EffectiveURLContentBrowserClient(const GURL& url_to_modify,
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 0b90774..2146b973 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -31,7 +31,7 @@ #include "build/build_config.h" #include "cc/base/switches.h" #include "cc/output/compositor_frame.h" -#include "components/viz/service/display_compositor/server_shared_bitmap_manager.h" +#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h" #include "content/browser/accessibility/browser_accessibility_state_impl.h" #include "content/browser/bad_message.h" #include "content/browser/browser_plugin/browser_plugin_guest.h"
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc index 96696118b..5c5848c 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -34,8 +34,8 @@ #include "cc/test/fake_external_begin_frame_source.h" #include "cc/test/fake_surface_observer.h" #include "components/viz/common/gl_helper.h" -#include "components/viz/service/display_compositor/server_shared_bitmap_manager.h" -#include "components/viz/service/display_compositor/shared_bitmap_allocation_notifier_impl.h" +#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h" +#include "components/viz/service/display_embedder/shared_bitmap_allocation_notifier_impl.h" #include "content/browser/browser_thread_impl.h" #include "content/browser/compositor/test/no_transport_image_transport_factory.h" #include "content/browser/frame_host/render_widget_host_view_guest.h" @@ -91,6 +91,8 @@ #include "ui/compositor/compositor.h" #include "ui/compositor/layer_tree_owner.h" #include "ui/compositor/test/draw_waiter_for_test.h" +#include "ui/display/display.h" +#include "ui/display/screen.h" #include "ui/events/blink/blink_event_util.h" #include "ui/events/blink/web_input_event_traits.h" #include "ui/events/event.h" @@ -157,8 +159,14 @@ private: // Overridden from OverscrollControllerDelegate: - gfx::Rect GetVisibleBounds() const override { - return view_->IsShowing() ? view_->GetViewBounds() : gfx::Rect(); + gfx::Size GetVisibleSize() const override { + return view_->IsShowing() ? view_->GetViewBounds().size() : gfx::Size(); + } + + gfx::Size GetDisplaySize() const override { + return display::Screen::GetScreen() + ->GetDisplayNearestView(view_->GetNativeView()) + .size(); } bool OnOverscrollUpdate(float delta_x, float delta_y) override { @@ -1105,6 +1113,10 @@ return view_->overscroll_controller()->overscroll_mode_; } + OverscrollSource overscroll_source() const { + return view_->overscroll_controller()->overscroll_source_; + } + float overscroll_delta_x() const { return view_->overscroll_controller()->overscroll_delta_x_; } @@ -3807,6 +3819,7 @@ !wheel_scroll_latching_enabled_, -60, 1, 0, false, WebMouseWheelEvent::kPhaseChanged); // enqueued EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); // Receive ACK the first wheel event as not processed. @@ -3817,6 +3830,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); if (wheel_scrolling_mode_ == kAsyncWheelEvents) { @@ -3844,6 +3858,7 @@ } EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); } TEST_F(RenderWidgetHostViewAuraOverscrollTest, WheelNotPreciseScrollEvent) { @@ -3881,6 +3896,7 @@ !wheel_scroll_latching_enabled_, -20, 6, 1, true, WebMouseWheelEvent::kPhaseChanged); // enqueued, different modifiers EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); // Receive ACK the first wheel event as not processed. @@ -3892,6 +3908,7 @@ INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); if (wheel_scrolling_mode_ == kAsyncWheelEvents) { ExpectGestureScrollUpdateAfterNonBlockingMouseWheelACK(true); @@ -3922,6 +3939,7 @@ } EXPECT_EQ(OVERSCROLL_WEST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHPAD, overscroll_source()); EXPECT_EQ(OVERSCROLL_WEST, overscroll_delegate()->current_mode()); EXPECT_EQ(-81.f, overscroll_delta_x()); EXPECT_EQ(-31.f, overscroll_delegate()->delta_x()); @@ -3931,6 +3949,7 @@ // Send a mouse-move event. This should cancel the overscroll navigation. SimulateMouseMove(5, 10, 0); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); EXPECT_EQ(1U, sink_->message_count()); } @@ -3973,6 +3992,7 @@ WebMouseWheelEvent::kPhaseChanged); // enqueued, different modifiers EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); // Receive ACK the first wheel event as processed. @@ -3981,6 +4001,7 @@ ExpectGestureScrollEventsAfterMouseWheelACK(true, 2); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); if (wheel_scrolling_mode_ != kAsyncWheelEvents) { @@ -3996,6 +4017,7 @@ ExpectGestureScrollEventsAfterMouseWheelACK(false, 1); } EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); if (wheel_scrolling_mode_ == kAsyncWheelEvents) { // The first and second GSU events are coalesced. This is the ack for the @@ -4027,6 +4049,7 @@ ExpectGestureScrollEndForWheelScrolling(true); } EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); } TEST_F(RenderWidgetHostViewAuraOverscrollTest, WheelScrollConsumedDoNotHorizOverscroll) { @@ -4060,6 +4083,7 @@ ExpectGestureScrollEndForWheelScrolling(false); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); // Scroll some more so as to not overscroll. @@ -4080,6 +4104,7 @@ ExpectGestureScrollEndForWheelScrolling(false); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); // Scroll some more to initiate an overscroll. @@ -4100,6 +4125,7 @@ ExpectGestureScrollEndForWheelScrolling(false); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHPAD, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); EXPECT_EQ(60.f, overscroll_delta_x()); EXPECT_EQ(10.f, overscroll_delegate()->delta_x()); @@ -4119,6 +4145,7 @@ EXPECT_EQ(2U, GetSentMessageCountAndResetSink()); } EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); // Continue to scroll in the reverse direction. @@ -4140,6 +4167,7 @@ ExpectGestureScrollEndForWheelScrolling(false); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); // Continue to scroll in the reverse direction enough to initiate overscroll @@ -4172,6 +4200,7 @@ } EXPECT_EQ(OVERSCROLL_WEST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHPAD, overscroll_source()); EXPECT_EQ(OVERSCROLL_WEST, overscroll_delegate()->current_mode()); EXPECT_EQ(-75.f, overscroll_delta_x()); EXPECT_EQ(-25.f, overscroll_delegate()->delta_x()); @@ -4207,6 +4236,7 @@ ExpectGestureScrollEndForWheelScrolling(false); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); // Scroll some more so as to not overscroll. @@ -4224,6 +4254,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); sink_->ClearMessages(); @@ -4244,6 +4275,7 @@ ExpectGestureScrollEndForWheelScrolling(false); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHPAD, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); EXPECT_EQ(60.f, overscroll_delta_x()); @@ -4258,6 +4290,7 @@ blink::kWebGestureDeviceTouchscreen); SimulateGestureFlingStartEvent(0.f, 0.1f, blink::kWebGestureDeviceTouchpad); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); // ScrollBegin and FlingStart will be queued events. EXPECT_EQ(2U, sink_->message_count()); @@ -4296,6 +4329,7 @@ ExpectGestureScrollEndForWheelScrolling(false); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); // Scroll some more so as to not overscroll. @@ -4316,6 +4350,7 @@ ExpectGestureScrollEndForWheelScrolling(false); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); // Scroll some more to initiate an overscroll. @@ -4336,6 +4371,7 @@ ExpectGestureScrollEndForWheelScrolling(false); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHPAD, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); EXPECT_EQ(60.f, overscroll_delta_x()); @@ -4350,9 +4386,10 @@ blink::kWebGestureDeviceTouchscreen); SimulateGestureFlingStartEvent(10.f, 0.f, blink::kWebGestureDeviceTouchpad); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); - // ScrollBegin and FlingStart will be queued events. - EXPECT_EQ(2U, sink_->message_count()); + // ScrollBegin and FlingStart will be queued events. + EXPECT_EQ(2U, sink_->message_count()); } TEST_F(RenderWidgetHostViewAuraOverscrollTest, ScrollEventsOverscrollWithZeroFling) { @@ -4382,6 +4419,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHSCREEN, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); sink_->ClearMessages(); @@ -4404,6 +4442,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_WEST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHSCREEN, overscroll_source()); EXPECT_EQ(OVERSCROLL_WEST, overscroll_delegate()->current_mode()); sink_->ClearMessages(); @@ -4423,6 +4462,7 @@ SimulateGestureEvent(WebInputEvent::kGestureScrollBegin, blink::kWebGestureDeviceTouchscreen); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); @@ -4432,6 +4472,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHSCREEN, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); EXPECT_EQ(55.f, overscroll_delta_x()); EXPECT_EQ(-5.f, overscroll_delta_y()); @@ -4444,6 +4485,7 @@ // should not also receive this event. SimulateGestureScrollUpdateEvent(10, -5, 0); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHSCREEN, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); EXPECT_EQ(65.f, overscroll_delta_x()); EXPECT_EQ(-10.f, overscroll_delta_y()); @@ -4457,6 +4499,7 @@ SimulateGestureEvent(WebInputEvent::kGestureScrollEnd, blink::kWebGestureDeviceTouchscreen); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); EXPECT_EQ(1U, sink_->message_count()); } @@ -4476,6 +4519,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_CONSUMED); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); sink_->ClearMessages(); @@ -4488,6 +4532,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); } // Tests that the overscroll controller plays nice with touch-scrolls and the @@ -4526,6 +4571,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); @@ -4540,6 +4586,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHSCREEN, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); EXPECT_EQ(65.f, overscroll_delta_x()); EXPECT_EQ(15.f, overscroll_delegate()->delta_x()); @@ -4571,6 +4618,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHSCREEN, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); EXPECT_EQ(55.f, overscroll_delta_x()); EXPECT_EQ(5.f, overscroll_delegate()->delta_x()); @@ -4588,6 +4636,7 @@ base::RunLoop().Run(); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); EXPECT_EQ(1U, sink_->message_count()); } @@ -4613,6 +4662,7 @@ EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); SimulateGestureEvent(WebInputEvent::kGestureScrollBegin, @@ -4623,6 +4673,7 @@ INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(2U, GetSentMessageCountAndResetSink()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); // Another touch move event should reach the renderer since overscroll hasn't @@ -4637,6 +4688,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHSCREEN, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); EXPECT_EQ(65.f, overscroll_delta_x()); EXPECT_EQ(15.f, overscroll_delegate()->delta_x()); @@ -4648,6 +4700,7 @@ MoveTouchPoint(0, 55, 5); SendTouchEvent(); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHSCREEN, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); EXPECT_EQ(65.f, overscroll_delta_x()); EXPECT_EQ(15.f, overscroll_delegate()->delta_x()); @@ -4658,6 +4711,7 @@ SimulateGestureScrollUpdateEvent(-10, 0, 0); EXPECT_EQ(0U, sink_->message_count()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHSCREEN, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); EXPECT_EQ(55.f, overscroll_delta_x()); EXPECT_EQ(5.f, overscroll_delegate()->delta_x()); @@ -4671,6 +4725,7 @@ SimulateGestureScrollUpdateEvent(200, 0, 0); EXPECT_EQ(0U, sink_->message_count()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHSCREEN, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); EXPECT_EQ(255.f, overscroll_delta_x()); EXPECT_EQ(205.f, overscroll_delegate()->delta_x()); @@ -4695,6 +4750,7 @@ base::RunLoop().Run(); EXPECT_EQ(1U, sink_->message_count()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->completed_mode()); } @@ -4714,18 +4770,21 @@ // The scroll begin event will have received a synthetic ack from the input // router. EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); // Send update events. SimulateGestureScrollUpdateEvent(55, -5, 0); EXPECT_EQ(2U, GetSentMessageCountAndResetSink()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(0U, sink_->message_count()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHSCREEN, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); EXPECT_EQ(55.f, overscroll_delta_x()); EXPECT_EQ(5.f, overscroll_delegate()->delta_x()); @@ -4740,6 +4799,7 @@ base::TimeDelta::FromMilliseconds(10)); base::RunLoop().Run(); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->completed_mode()); EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); @@ -4749,18 +4809,21 @@ blink::kWebGestureDeviceTouchscreen); EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); // Send update events. SimulateGestureScrollUpdateEvent(235, -5, 0); EXPECT_EQ(2U, GetSentMessageCountAndResetSink()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(0U, sink_->message_count()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHSCREEN, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); EXPECT_EQ(235.f, overscroll_delta_x()); EXPECT_EQ(185.f, overscroll_delegate()->delta_x()); @@ -4775,6 +4838,7 @@ base::TimeDelta::FromMilliseconds(10)); base::RunLoop().Run(); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->completed_mode()); EXPECT_EQ(1U, sink_->message_count()); @@ -4795,6 +4859,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHSCREEN, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); EXPECT_EQ(0U, sink_->message_count()); @@ -4804,12 +4869,14 @@ SimulateGestureScrollUpdateEvent(-260, 0, 0); EXPECT_EQ(1U, sink_->message_count()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); // Since the overscroll mode has been reset, the next scroll update events // should reach the renderer. SimulateGestureScrollUpdateEvent(-20, 0, 0); EXPECT_EQ(1U, sink_->message_count()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); } void RenderWidgetHostViewAuraOverscrollTest:: @@ -4830,6 +4897,7 @@ ExpectGestureScrollEndForWheelScrolling(false); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHPAD, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); // Send another wheel event, but in the reverse direction. The overscroll @@ -4849,6 +4917,7 @@ } EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); @@ -4856,6 +4925,7 @@ // Since it was unhandled; the overscroll should now be west EXPECT_EQ(OVERSCROLL_WEST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHPAD, overscroll_source()); EXPECT_EQ(OVERSCROLL_WEST, overscroll_delegate()->current_mode()); SimulateWheelEventPossiblyIncludingPhase(!wheel_scroll_latching_enabled_, -20, @@ -4877,6 +4947,7 @@ } EXPECT_EQ(OVERSCROLL_WEST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHPAD, overscroll_source()); EXPECT_EQ(OVERSCROLL_WEST, overscroll_delegate()->current_mode()); } TEST_F(RenderWidgetHostViewAuraOverscrollTest, @@ -4912,6 +4983,7 @@ WebMouseWheelEvent::kPhaseChanged); // coalesced into previous event EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); // Receive ACK the first wheel event as not processed. @@ -4923,6 +4995,7 @@ INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); if (wheel_scrolling_mode_ == kAsyncWheelEvents) { @@ -4941,6 +5014,7 @@ ExpectGestureScrollEndForWheelScrolling(false); EXPECT_EQ(OVERSCROLL_WEST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHPAD, overscroll_source()); EXPECT_EQ(OVERSCROLL_WEST, overscroll_delegate()->current_mode()); // Send a mouse-move event. This should cancel the overscroll navigation @@ -4948,6 +5022,7 @@ // mouse-move should reach the renderer. SimulateMouseMove(5, 10, 0); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->completed_mode()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); @@ -4968,6 +5043,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHSCREEN, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); sink_->ClearMessages(); @@ -4977,6 +5053,7 @@ SimulateMouseMove(5, 10, 0); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->completed_mode()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); SendInputEventACK(WebInputEvent::kMouseMove, @@ -5025,6 +5102,7 @@ !wheel_scroll_latching_enabled_, 0, 10, 0, true, WebMouseWheelEvent::kPhaseChanged); // coalesced into previous event EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); // The first wheel event is consumed. Dispatches the queued wheel event. @@ -5130,6 +5208,7 @@ ExpectGestureScrollEndForWheelScrolling(true); } EXPECT_EQ(OVERSCROLL_WEST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHPAD, overscroll_source()); EXPECT_TRUE(ScrollStateIsOverscrolling()); // The GestureScrollBegin will reset the delegate's mode, so check it here. @@ -5138,6 +5217,7 @@ blink::kWebGestureDeviceTouchscreen); SimulateGestureFlingStartEvent(0.f, 0.f, blink::kWebGestureDeviceTouchpad); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_TRUE(ScrollStateIsUnknown()); // ScrollBegin will be the queued event. EXPECT_EQ(1U, sink_->message_count()); @@ -5167,11 +5247,13 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHSCREEN, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); EXPECT_EQ(3U, GetSentMessageCountAndResetSink()); view_->OnWindowFocused(nullptr, view_->GetNativeView()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->completed_mode()); EXPECT_EQ(0.f, overscroll_delegate()->delta_x()); @@ -5190,6 +5272,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_EAST, overscroll_mode()); + EXPECT_EQ(OverscrollSource::TOUCHSCREEN, overscroll_source()); EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->current_mode()); EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->completed_mode()); @@ -5411,6 +5494,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(-30.f, overscroll_delta_x()); EXPECT_EQ(-10.f, overscroll_delta_y()); SimulateMouseMove(5, 10, 0); @@ -5424,6 +5508,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(-30.f, overscroll_delta_x()); EXPECT_EQ(-5.f, overscroll_delta_y()); SimulateGestureEvent(WebInputEvent::kGestureScrollEnd, @@ -5451,6 +5536,7 @@ SendInputEventACK(WebInputEvent::kGestureScrollUpdate, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); + EXPECT_EQ(OverscrollSource::NONE, overscroll_source()); EXPECT_EQ(15.f, overscroll_delta_x()); EXPECT_EQ(-5.f, overscroll_delta_y()); SimulateGestureEvent(WebInputEvent::kGestureScrollBegin,
diff --git a/content/browser/service_worker/embedded_worker_instance.cc b/content/browser/service_worker/embedded_worker_instance.cc index fdbad66..418d96fbfc 100644 --- a/content/browser/service_worker/embedded_worker_instance.cc +++ b/content/browser/service_worker/embedded_worker_instance.cc
@@ -125,6 +125,7 @@ case EmbeddedWorkerInstance::SCRIPT_DOWNLOADING: case EmbeddedWorkerInstance::SCRIPT_READ_STARTED: case EmbeddedWorkerInstance::SCRIPT_READ_FINISHED: + case EmbeddedWorkerInstance::SCRIPT_STREAMING: case EmbeddedWorkerInstance::SCRIPT_LOADED: case EmbeddedWorkerInstance::SCRIPT_EVALUATED: case EmbeddedWorkerInstance::THREAD_STARTED: @@ -607,12 +608,20 @@ client_->StartWorker(*params, std::move(pending_dispatcher_request_), std::move(host_ptr_info)); registry_->BindWorkerToProcess(process_id(), embedded_worker_id()); - OnStartWorkerMessageSent(); - TRACE_EVENT_NESTABLE_ASYNC_BEGIN0("ServiceWorker", "SENT_START_WORKER", this); + // TODO(shimazu): Check if script streaming is used for the starting worker. + OnStartWorkerMessageSent(false /* is_script_streaming */); + if (starting_phase() == SCRIPT_STREAMING) { + TRACE_EVENT_NESTABLE_ASYNC_BEGIN0("ServiceWorker", + "SENT_START_WITH_SCRIPT_STREAMING", this); + } else { + TRACE_EVENT_NESTABLE_ASYNC_BEGIN0("ServiceWorker", "SENT_START_WORKER", + this); + } return SERVICE_WORKER_OK; } -void EmbeddedWorkerInstance::OnStartWorkerMessageSent() { +void EmbeddedWorkerInstance::OnStartWorkerMessageSent( + bool is_script_streaming) { if (!step_time_.is_null()) { base::TimeDelta duration = UpdateStepTime(); if (inflight_start_task_->is_installed()) { @@ -621,7 +630,7 @@ } } - starting_phase_ = SENT_START_WORKER; + starting_phase_ = is_script_streaming ? SCRIPT_STREAMING : SENT_START_WORKER; for (auto& observer : listener_list_) observer.OnStartWorkerMessageSent(); } @@ -658,16 +667,25 @@ source = LoadSource::HTTP_CACHE; } - // starting_phase_ may be SCRIPT_READ_FINISHED in case of reading from cache. - if (starting_phase_ == SCRIPT_DOWNLOADING) { - TRACE_EVENT_NESTABLE_ASYNC_END0("ServiceWorker", "SCRIPT_DOWNLOADING", - this); + switch (starting_phase_) { + case SCRIPT_DOWNLOADING: + TRACE_EVENT_NESTABLE_ASYNC_END0("ServiceWorker", "SCRIPT_DOWNLOADING", + this); + break; + case SCRIPT_STREAMING: + TRACE_EVENT_NESTABLE_ASYNC_END0("ServiceWorker", + "SENT_START_WITH_SCRIPT_STREAMING", this); + break; + default: + TRACE_EVENT_NESTABLE_ASYNC_END1( + "ServiceWorker", "SCRIPT_LOADING", this, "Source", + ServiceWorkerMetrics::LoadSourceToString(source)); + break; } - TRACE_EVENT_NESTABLE_ASYNC_END1( - "ServiceWorker", "SCRIPT_LOADING", this, "Source", - ServiceWorkerMetrics::LoadSourceToString(source)); - if (!step_time_.is_null()) { + // Don't record the time when script streaming is enabled because + // OnScriptLoaded is called at the different timing. + if (starting_phase_ != SCRIPT_STREAMING && !step_time_.is_null()) { base::TimeDelta duration = UpdateStepTime(); ServiceWorkerMetrics::RecordTimeToLoad(duration, source, start_situation_); } @@ -981,6 +999,8 @@ return "Script read started"; case SCRIPT_READ_FINISHED: return "Script read finished"; + case SCRIPT_STREAMING: + return "Script streaming"; case STARTING_PHASE_MAX_VALUE: NOTREACHED(); }
diff --git a/content/browser/service_worker/embedded_worker_instance.h b/content/browser/service_worker/embedded_worker_instance.h index 2e2e6a2..b2fd4ee 100644 --- a/content/browser/service_worker/embedded_worker_instance.h +++ b/content/browser/service_worker/embedded_worker_instance.h
@@ -67,6 +67,7 @@ // (installed scripts only) SCRIPT_READ_STARTED, SCRIPT_READ_FINISHED, + SCRIPT_STREAMING, // Add new values here. STARTING_PHASE_MAX_VALUE, }; @@ -220,7 +221,7 @@ std::unique_ptr<EmbeddedWorkerStartParams> params); // Called back from StartTask after a start worker message is sent. - void OnStartWorkerMessageSent(); + void OnStartWorkerMessageSent(bool is_script_streaming); // Implements mojom::EmbeddedWorkerInstanceHost. // These functions all run on the IO thread.
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc index fbb00d4fc..eddab03b 100644 --- a/content/browser/service_worker/service_worker_context_wrapper.cc +++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -82,6 +82,41 @@ registration->ActivateWaitingVersionWhenReady(); } +void DidStartWorker( + scoped_refptr<ServiceWorkerVersion> version, + ServiceWorkerContext::StartActiveWorkerCallback info_callback) { + EmbeddedWorkerInstance* instance = version->embedded_worker(); + std::move(info_callback).Run(instance->process_id(), instance->thread_id()); +} + +void DidFailStartWorker(base::OnceClosure error_callback, + ServiceWorkerStatusCode code) { + std::move(error_callback).Run(); +} + +void FoundReadyRegistrationForStartActiveWorker( + ServiceWorkerContext::StartActiveWorkerCallback info_callback, + base::OnceClosure failure_callback, + ServiceWorkerStatusCode service_worker_status, + scoped_refptr<ServiceWorkerRegistration> service_worker_registration) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + if (service_worker_status == SERVICE_WORKER_OK) { + // Note: There might be a remote possibility that + // |service_worker_registration|'s active version might change between here + // and DidStartWorker, so bind |active_version| to RunAfterStartWorker. + scoped_refptr<ServiceWorkerVersion> active_version = + service_worker_registration->active_version(); + DCHECK(active_version.get()); + active_version->RunAfterStartWorker( + ServiceWorkerMetrics::EventType::EXTERNAL_REQUEST, + base::Bind(&DidStartWorker, active_version, + base::Passed(&info_callback)), + base::Bind(&DidFailStartWorker, base::Passed(&failure_callback))); + } else { + std::move(failure_callback).Run(); + } +} + } // namespace void ServiceWorkerContext::AddExcludedHeadersForFetchEvent( @@ -841,6 +876,17 @@ return version->FinishExternalRequest(request_uuid); } +void ServiceWorkerContextWrapper::StartActiveWorkerForPattern( + const GURL& pattern, + StartActiveWorkerCallback info_callback, + base::OnceClosure failure_callback) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + FindReadyRegistrationForPattern( + pattern, base::Bind(&FoundReadyRegistrationForStartActiveWorker, + base::Passed(&info_callback), + base::Passed(&failure_callback))); +} + void ServiceWorkerContextWrapper::DidDeleteAndStartOver( ServiceWorkerStatusCode status) { DCHECK_CURRENTLY_ON(BrowserThread::IO);
diff --git a/content/browser/service_worker/service_worker_context_wrapper.h b/content/browser/service_worker/service_worker_context_wrapper.h index a41d245..aea3fae 100644 --- a/content/browser/service_worker/service_worker_context_wrapper.h +++ b/content/browser/service_worker/service_worker_context_wrapper.h
@@ -121,6 +121,9 @@ void StartServiceWorkerForNavigationHint( const GURL& document_url, const StartServiceWorkerForNavigationHintCallback& callback) override; + void StartActiveWorkerForPattern(const GURL& pattern, + StartActiveWorkerCallback info_callback, + base::OnceClosure failure_callback) override; // These methods must only be called from the IO thread. ServiceWorkerRegistration* GetLiveRegistration(int64_t registration_id);
diff --git a/content/browser/service_worker/service_worker_registration.cc b/content/browser/service_worker/service_worker_registration.cc index 1a06f25..42a8ae4 100644 --- a/content/browser/service_worker/service_worker_registration.cc +++ b/content/browser/service_worker/service_worker_registration.cc
@@ -21,6 +21,14 @@ namespace { +// If an outgoing active worker has no controllees or the waiting worker called +// skipWaiting(), it is given |kMaxLameDuckTime| time to finish its requests +// before it is removed. If the waiting worker called skipWaiting() more than +// this time ago, or the outgoing worker has had no controllees for a continuous +// period of time exceeding this time, the outgoing worker will be removed even +// if it has ongoing requests. +constexpr base::TimeDelta kMaxLameDuckTime = base::TimeDelta::FromMinutes(5); + ServiceWorkerVersionInfo GetVersionInfo(ServiceWorkerVersion* version) { if (!version) return ServiceWorkerVersionInfo(); @@ -185,8 +193,12 @@ void ServiceWorkerRegistration::ActivateWaitingVersionWhenReady() { DCHECK(waiting_version()); should_activate_when_ready_ = true; - if (IsReadyToActivate()) + if (IsReadyToActivate()) { ActivateWaitingVersion(false /* delay */); + return; + } + + StartLameDuckTimerIfNeeded(); } void ServiceWorkerRegistration::ClaimClients() { @@ -255,6 +267,8 @@ Clear(); else if (IsReadyToActivate()) ActivateWaitingVersion(true /* delay */); + else + StartLameDuckTimerIfNeeded(); } void ServiceWorkerRegistration::OnNoWork(ServiceWorkerVersion* version) { @@ -270,21 +284,60 @@ return false; DCHECK(waiting_version()); + const ServiceWorkerVersion* waiting = waiting_version(); const ServiceWorkerVersion* active = active_version(); - if (!active) - return true; - if (!active->HasWork() && - (!active->HasControllee() || waiting_version()->skip_waiting())) { + if (!active) { return true; } + if (IsLameDuckActiveVersion()) { + return !active->HasWork() || + waiting->TimeSinceSkipWaiting() > kMaxLameDuckTime || + active->TimeSinceNoControllees() > kMaxLameDuckTime; + } return false; } +bool ServiceWorkerRegistration::IsLameDuckActiveVersion() const { + if (!waiting_version() || !active_version()) + return false; + return waiting_version()->skip_waiting() || + !active_version()->HasControllee(); +} + +void ServiceWorkerRegistration::StartLameDuckTimerIfNeeded() { + if (!IsLameDuckActiveVersion() || lame_duck_timer_.IsRunning()) { + return; + } + + lame_duck_timer_.Start( + FROM_HERE, kMaxLameDuckTime, + base::Bind(&ServiceWorkerRegistration::RemoveLameDuckIfNeeded, + Unretained(this) /* OK because |this| owns the timer */)); +} + +void ServiceWorkerRegistration::RemoveLameDuckIfNeeded() { + if (!should_activate_when_ready_) { + lame_duck_timer_.Stop(); + return; + } + + if (IsReadyToActivate()) { + ActivateWaitingVersion(false /* delay */); + return; + } + + if (!IsLameDuckActiveVersion()) { + lame_duck_timer_.Stop(); + } +} + void ServiceWorkerRegistration::ActivateWaitingVersion(bool delay) { DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(context_); DCHECK(IsReadyToActivate()); should_activate_when_ready_ = false; + lame_duck_timer_.Stop(); + scoped_refptr<ServiceWorkerVersion> activating_version = waiting_version(); scoped_refptr<ServiceWorkerVersion> exiting_version = active_version();
diff --git a/content/browser/service_worker/service_worker_registration.h b/content/browser/service_worker/service_worker_registration.h index e0f107a..946a77b3 100644 --- a/content/browser/service_worker/service_worker_registration.h +++ b/content/browser/service_worker/service_worker_registration.h
@@ -121,10 +121,9 @@ // listeners via OnVersionAttributesChanged. void UnsetVersion(ServiceWorkerVersion* version); - // Triggers the [[Activate]] algorithm when the currently active version - // has no controllees. If there are no controllees at the time the method - // is called or when version's skip waiting flag is set, activation is - // initiated immediately. + // Triggers the [[Activate]] algorithm when the currently active version is + // ready to become redundant (see IsReadyToActivate()). The algorithm is + // triggered immediately if it's already ready. void ActivateWaitingVersionWhenReady(); // Takes over control of provider hosts which are currently not controlled or @@ -162,6 +161,7 @@ private: friend class base::RefCounted<ServiceWorkerRegistration>; + friend class ServiceWorkerActivationTest; void UnsetVersionInternal( ServiceWorkerVersion* version, @@ -172,6 +172,9 @@ void OnNoWork(ServiceWorkerVersion* version) override; bool IsReadyToActivate() const; + bool IsLameDuckActiveVersion() const; + void StartLameDuckTimerIfNeeded(); + void RemoveLameDuckIfNeeded(); // Promotes the waiting version to active version. If |delay| is true, waits // a short time before attempting to start and dispatch the activate event @@ -214,6 +217,14 @@ base::WeakPtr<ServiceWorkerContextCore> context_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_; + // |lame_duck_timer_| is started when the active version is considered a lame + // duck: the waiting version called skipWaiting() or the active + // version has no controllees, but activation is waiting for the active + // version to finish its inflight requests. + // It is stopped when activation completes or the active version is no + // longer considered a lame duck. + base::RepeatingTimer lame_duck_timer_; + DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); };
diff --git a/content/browser/service_worker/service_worker_registration_unittest.cc b/content/browser/service_worker/service_worker_registration_unittest.cc index 444135ee..dca426c 100644 --- a/content/browser/service_worker/service_worker_registration_unittest.cc +++ b/content/browser/service_worker/service_worker_registration_unittest.cc
@@ -10,6 +10,7 @@ #include "base/files/scoped_temp_dir.h" #include "base/logging.h" #include "base/run_loop.h" +#include "base/test/simple_test_tick_clock.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" #include "content/browser/service_worker/embedded_worker_status.h" @@ -26,6 +27,9 @@ namespace { +// From service_worker_registration.cc. +constexpr base::TimeDelta kMaxLameDuckTime = base::TimeDelta::FromMinutes(5); + int CreateInflightRequest(ServiceWorkerVersion* version) { version->StartWorker(ServiceWorkerMetrics::EventType::PUSH, base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); @@ -290,6 +294,16 @@ ServiceWorkerProviderHost* controllee() { return host_.get(); } int inflight_request_id() const { return inflight_request_id_; } + bool IsLameDuckTimerRunning() { + return registration_->lame_duck_timer_.IsRunning(); + } + + void RunLameDuckTimer() { registration_->RemoveLameDuckIfNeeded(); } + + void SimulateSkipWaiting(ServiceWorkerVersion* version, int request_id) { + version->OnSkipWaiting(request_id); + } + private: scoped_refptr<ServiceWorkerRegistration> registration_; std::unique_ptr<ServiceWorkerProviderHost> host_; @@ -349,7 +363,7 @@ EXPECT_EQ(version_1.get(), reg->active_version()); // Call skipWaiting. Activation should happen. - version_2->OnSkipWaiting(77 /* dummy request_id */); + SimulateSkipWaiting(version_2.get(), 77 /* dummy request_id */); base::RunLoop().RunUntilIdle(); EXPECT_EQ(version_2.get(), reg->active_version()); } @@ -362,7 +376,7 @@ // Set skip waiting flag. Since there is still an in-flight request, // activation should not happen. - version_2->OnSkipWaiting(77 /* dummy request_id */); + SimulateSkipWaiting(version_2.get(), 77 /* dummy request_id */); base::RunLoop().RunUntilIdle(); EXPECT_EQ(version_1.get(), reg->active_version()); @@ -373,4 +387,120 @@ EXPECT_EQ(version_2.get(), reg->active_version()); } +TEST_F(ServiceWorkerActivationTest, TimeSinceSkipWaiting_Installing) { + scoped_refptr<ServiceWorkerRegistration> reg = registration(); + scoped_refptr<ServiceWorkerVersion> version = reg->waiting_version(); + base::SimpleTestTickClock* clock = new base::SimpleTestTickClock(); + clock->SetNowTicks(base::TimeTicks::Now()); + version->SetTickClockForTesting(base::WrapUnique(clock)); + + // Reset version to the installing phase. + reg->UnsetVersion(version.get()); + version->SetStatus(ServiceWorkerVersion::INSTALLING); + + // Call skipWaiting(). The time ticks since skip waiting shouldn't start + // since the version is not yet installed. + SimulateSkipWaiting(version.get(), 77 /* dummy request_id */); + base::RunLoop().RunUntilIdle(); + clock->Advance(base::TimeDelta::FromSeconds(11)); + EXPECT_EQ(base::TimeDelta(), version->TimeSinceSkipWaiting()); + + // Install the version. Now the skip waiting time starts ticking. + version->SetStatus(ServiceWorkerVersion::INSTALLED); + reg->SetWaitingVersion(version); + base::RunLoop().RunUntilIdle(); + clock->Advance(base::TimeDelta::FromSeconds(33)); + EXPECT_EQ(base::TimeDelta::FromSeconds(33), version->TimeSinceSkipWaiting()); + + // Call skipWaiting() again. It doesn't reset the time. + SimulateSkipWaiting(version.get(), 88 /* dummy request_id */); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(base::TimeDelta::FromSeconds(33), version->TimeSinceSkipWaiting()); +} + +// Test lame duck timer triggered by skip waiting. +TEST_F(ServiceWorkerActivationTest, LameDuckTime_SkipWaiting) { + scoped_refptr<ServiceWorkerRegistration> reg = registration(); + scoped_refptr<ServiceWorkerVersion> version_1 = reg->active_version(); + scoped_refptr<ServiceWorkerVersion> version_2 = reg->waiting_version(); + base::SimpleTestTickClock* clock_1 = new base::SimpleTestTickClock(); + base::SimpleTestTickClock* clock_2 = new base::SimpleTestTickClock(); + clock_1->SetNowTicks(base::TimeTicks::Now()); + clock_2->SetNowTicks(clock_1->NowTicks()); + version_1->SetTickClockForTesting(base::WrapUnique(clock_1)); + version_2->SetTickClockForTesting(base::WrapUnique(clock_2)); + + // Set skip waiting flag. Since there is still an in-flight request, + // activation should not happen. But the lame duck timer should start. + EXPECT_FALSE(IsLameDuckTimerRunning()); + SimulateSkipWaiting(version_2.get(), 77 /* dummy request_id */); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(version_1.get(), reg->active_version()); + EXPECT_TRUE(IsLameDuckTimerRunning()); + + // Move forward by lame duck time. + clock_2->Advance(kMaxLameDuckTime + base::TimeDelta::FromSeconds(1)); + + // Activation should happen by the lame duck timer. + RunLameDuckTimer(); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(version_2.get(), reg->active_version()); + EXPECT_FALSE(IsLameDuckTimerRunning()); +} + +// Test lame duck timer triggered by loss of controllee. +TEST_F(ServiceWorkerActivationTest, LameDuckTime_NoControllee) { + scoped_refptr<ServiceWorkerRegistration> reg = registration(); + scoped_refptr<ServiceWorkerVersion> version_1 = reg->active_version(); + scoped_refptr<ServiceWorkerVersion> version_2 = reg->waiting_version(); + base::SimpleTestTickClock* clock_1 = new base::SimpleTestTickClock(); + base::SimpleTestTickClock* clock_2 = new base::SimpleTestTickClock(); + clock_1->SetNowTicks(base::TimeTicks::Now()); + clock_2->SetNowTicks(clock_1->NowTicks()); + version_1->SetTickClockForTesting(base::WrapUnique(clock_1)); + version_2->SetTickClockForTesting(base::WrapUnique(clock_2)); + + // Remove the controllee. Since there is still an in-flight request, + // activation should not happen. But the lame duck timer should start. + EXPECT_FALSE(IsLameDuckTimerRunning()); + version_1->RemoveControllee(controllee()); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(version_1.get(), reg->active_version()); + EXPECT_TRUE(IsLameDuckTimerRunning()); + + // Move clock forward by a little bit. + constexpr base::TimeDelta kLittleBit = base::TimeDelta::FromMinutes(1); + clock_1->Advance(kLittleBit); + + // Add a controllee again to reset the lame duck period. + version_1->AddControllee(controllee()); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(IsLameDuckTimerRunning()); + + // Remove the controllee. + version_1->RemoveControllee(controllee()); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(IsLameDuckTimerRunning()); + + // Move clock forward to the next lame duck timer tick. + clock_1->Advance(kMaxLameDuckTime - kLittleBit + + base::TimeDelta::FromSeconds(1)); + + // Run the lame duck timer. Activation should not yet happen + // since the lame duck period has not expired. + RunLameDuckTimer(); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(version_1.get(), reg->active_version()); + EXPECT_TRUE(IsLameDuckTimerRunning()); + + // Continue on to the next lame duck timer tick. + clock_1->Advance(kMaxLameDuckTime + base::TimeDelta::FromSeconds(1)); + + // Activation should happen by the lame duck timer. + RunLameDuckTimer(); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(version_2.get(), reg->active_version()); + EXPECT_FALSE(IsLameDuckTimerRunning()); +} + } // namespace content
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc index b47f556..8dd4262c 100644 --- a/content/browser/service_worker/service_worker_version.cc +++ b/content/browser/service_worker/service_worker_version.cc
@@ -342,10 +342,15 @@ !(status == INSTALLED || status == ACTIVATING || status == ACTIVATED)); status_ = status; - if (skip_waiting_ && status_ == ACTIVATED) { - for (int request_id : pending_skip_waiting_requests_) - DidSkipWaiting(request_id); - pending_skip_waiting_requests_.clear(); + if (skip_waiting_) { + if (status == INSTALLED) { + RestartTick(&skip_waiting_time_); + } else if (status == ACTIVATED) { + ClearTick(&skip_waiting_time_); + for (int request_id : pending_skip_waiting_requests_) + DidSkipWaiting(request_id); + pending_skip_waiting_requests_.clear(); + } } // OnVersionStateChanged() invokes updates of the status using state @@ -654,6 +659,7 @@ controllee_map_[uuid] = provider_host; // Keep the worker alive a bit longer right after a new controllee is added. RestartTick(&idle_time_); + ClearTick(&no_controllees_time_); for (auto& observer : listeners_) observer.OnControlleeAdded(this, provider_host); } @@ -666,6 +672,7 @@ for (auto& observer : listeners_) observer.OnControlleeRemoved(this, provider_host); if (!HasControllee()) { + RestartTick(&no_controllees_time_); for (auto& observer : listeners_) observer.OnNoControllees(this); } @@ -1308,6 +1315,8 @@ context_->GetLiveRegistration(registration_id_); if (!registration) return; + if (skip_waiting_time_.is_null()) + RestartTick(&skip_waiting_time_); pending_skip_waiting_requests_.push_back(request_id); if (pending_skip_waiting_requests_.size() == 1) registration->ActivateWaitingVersionWhenReady();
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h index e53d2169..27e52065 100644 --- a/content/browser/service_worker/service_worker_version.h +++ b/content/browser/service_worker/service_worker_version.h
@@ -166,6 +166,14 @@ foreign_fetch_origins_ = origins; } + base::TimeDelta TimeSinceNoControllees() const { + return GetTickDuration(no_controllees_time_); + } + + base::TimeDelta TimeSinceSkipWaiting() const { + return GetTickDuration(skip_waiting_time_); + } + // Meaningful only if this version is active. const NavigationPreloadState& navigation_preload_state() const { DCHECK(status_ == ACTIVATING || status_ == ACTIVATED) << status_; @@ -400,6 +408,7 @@ friend class base::RefCounted<ServiceWorkerVersion>; friend class ServiceWorkerReadFromCacheJobTest; friend class ServiceWorkerVersionBrowserTest; + friend class ServiceWorkerActivationTest; FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, ActivateWaitingVersion); @@ -431,9 +440,6 @@ FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, MixedRequestTimeouts); FRIEND_TEST_ALL_PREFIXES(ServiceWorkerURLRequestJobTest, EarlyResponse); FRIEND_TEST_ALL_PREFIXES(ServiceWorkerURLRequestJobTest, CancelRequest); - FRIEND_TEST_ALL_PREFIXES(ServiceWorkerActivationTest, SkipWaiting); - FRIEND_TEST_ALL_PREFIXES(ServiceWorkerActivationTest, - SkipWaitingWithInflightRequest); class PingController; @@ -752,6 +758,9 @@ bool in_dtor_ = false; std::vector<int> pending_skip_waiting_requests_; + base::TimeTicks skip_waiting_time_; + base::TimeTicks no_controllees_time_; + std::unique_ptr<net::HttpResponseInfo> main_script_http_info_; std::unique_ptr<TrialTokenValidator::FeatureToTokensMap> origin_trial_tokens_;
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc index 8afc081c..7a5ed8e4 100644 --- a/content/browser/site_instance_impl.cc +++ b/content/browser/site_instance_impl.cc
@@ -319,21 +319,36 @@ if (dest_url == blank_page) return true; - // If either URL has an isolated origin, compare origins rather than sites. url::Origin src_origin(src_url); url::Origin dest_origin(dest_url); - auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); - if (policy->IsIsolatedOrigin(src_origin) || - policy->IsIsolatedOrigin(dest_origin)) - return src_origin == dest_origin; // If the schemes differ, they aren't part of the same site. if (src_origin.scheme() != dest_origin.scheme()) return false; - return net::registry_controlled_domains::SameDomainOrHost( - src_origin, dest_origin, - net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); + if (!net::registry_controlled_domains::SameDomainOrHost( + src_origin, dest_origin, + net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)) { + return false; + } + + // If the sites are the same, check isolated origins. If either URL matches + // an isolated origin, compare origins rather than sites. + auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); + url::Origin src_isolated_origin; + url::Origin dest_isolated_origin; + bool src_origin_is_isolated = + policy->GetMatchingIsolatedOrigin(src_origin, &src_isolated_origin); + bool dest_origin_is_isolated = + policy->GetMatchingIsolatedOrigin(dest_origin, &dest_isolated_origin); + if (src_origin_is_isolated || dest_origin_is_isolated) { + // Compare most specific matching origins to ensure that a subdomain of an + // isolated origin (e.g., https://subdomain.isolated.foo.com) also matches + // the isolated origin's site URL (e.g., https://isolated.foo.com). + return src_isolated_origin == dest_isolated_origin; + } + + return true; } // static @@ -346,10 +361,14 @@ GURL url = SiteInstanceImpl::GetEffectiveURL(browser_context, real_url); url::Origin origin(url); - // Isolated origins should use the full origin as their site URL. + // Isolated origins should use the full origin as their site URL. A subdomain + // of an isolated origin should also use that isolated origin's site URL. auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); - if (policy->IsIsolatedOrigin(origin)) - return origin.GetURL(); + url::Origin isolated_origin; + if (policy->GetMatchingIsolatedOrigin(url::Origin(real_url), + &isolated_origin)) { + return isolated_origin.GetURL(); + } // If the url has a host, then determine the site. if (!origin.host().empty()) {
diff --git a/content/browser/site_instance_impl_unittest.cc b/content/browser/site_instance_impl_unittest.cc index 39246c9b..2d1b28d 100644 --- a/content/browser/site_instance_impl_unittest.cc +++ b/content/browser/site_instance_impl_unittest.cc
@@ -19,6 +19,7 @@ #include "content/browser/browsing_instance.h" #include "content/browser/child_process_security_policy_impl.h" #include "content/browser/frame_host/navigation_entry_impl.h" +#include "content/browser/isolated_origin_util.h" #include "content/browser/renderer_host/render_process_host_impl.h" #include "content/browser/renderer_host/render_view_host_impl.h" #include "content/browser/web_contents/web_contents_impl.h" @@ -905,8 +906,6 @@ policy->IsIsolatedOrigin(url::Origin(GURL("https://isolated.foo.com")))); EXPECT_FALSE(policy->IsIsolatedOrigin( url::Origin(GURL("http://isolated.foo.com:12345")))); - EXPECT_FALSE(policy->IsIsolatedOrigin( - url::Origin(GURL("http://bar.isolated.foo.com")))); policy->AddIsolatedOrigin(url::Origin(isolated_bar_url)); EXPECT_TRUE(policy->IsIsolatedOrigin(url::Origin(isolated_bar_url))); @@ -949,6 +948,197 @@ nullptr, isolated_blob_foo_url)); EXPECT_TRUE(SiteInstanceImpl::DoesSiteRequireDedicatedProcess( nullptr, isolated_filesystem_foo_url)); + + // Cleanup. + policy->RemoveIsolatedOriginForTesting(url::Origin(isolated_foo_url)); + policy->RemoveIsolatedOriginForTesting(url::Origin(isolated_bar_url)); +} + +// Check that only valid isolated origins are allowed to be registered. +TEST_F(SiteInstanceTest, IsValidIsolatedOrigin) { + // Unique origins are invalid, as are invalid URLs that resolve to + // unique origins. + EXPECT_FALSE(IsolatedOriginUtil::IsValidIsolatedOrigin(url::Origin())); + EXPECT_FALSE(IsolatedOriginUtil::IsValidIsolatedOrigin( + url::Origin(GURL("invalid.url")))); + + // IP addresses are ok. + EXPECT_TRUE(IsolatedOriginUtil::IsValidIsolatedOrigin( + url::Origin(GURL("http://127.0.0.1")))); + + // Hosts without a valid registry-controlled domain are disallowed. This + // includes hosts that are themselves a registry-controlled domain. + EXPECT_FALSE(IsolatedOriginUtil::IsValidIsolatedOrigin( + url::Origin(GURL("http://.com/")))); + EXPECT_FALSE(IsolatedOriginUtil::IsValidIsolatedOrigin( + url::Origin(GURL("http://.com./")))); + EXPECT_FALSE(IsolatedOriginUtil::IsValidIsolatedOrigin( + url::Origin(GURL("http://foo/")))); + EXPECT_FALSE(IsolatedOriginUtil::IsValidIsolatedOrigin( + url::Origin(GURL("http://co.uk/")))); + EXPECT_TRUE(IsolatedOriginUtil::IsValidIsolatedOrigin( + url::Origin(GURL("http://foo.bar.baz/")))); + + // Scheme must be HTTP or HTTPS. + EXPECT_FALSE(IsolatedOriginUtil::IsValidIsolatedOrigin( + url::Origin(GURL(kChromeUIScheme + std::string("://gpu"))))); + EXPECT_TRUE(IsolatedOriginUtil::IsValidIsolatedOrigin( + url::Origin(GURL("http://a.com")))); + EXPECT_TRUE(IsolatedOriginUtil::IsValidIsolatedOrigin( + url::Origin(GURL("https://b.co.uk")))); + + // Trailing dot is disallowed. + EXPECT_FALSE(IsolatedOriginUtil::IsValidIsolatedOrigin( + url::Origin(GURL("http://a.com.")))); +} + +TEST_F(SiteInstanceTest, SubdomainOnIsolatedSite) { + GURL isolated_url("http://isolated.com"); + GURL foo_isolated_url("http://foo.isolated.com"); + + auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); + policy->AddIsolatedOrigin(url::Origin(isolated_url)); + + EXPECT_TRUE(policy->IsIsolatedOrigin(url::Origin(isolated_url))); + EXPECT_TRUE(policy->IsIsolatedOrigin(url::Origin(foo_isolated_url))); + EXPECT_FALSE( + policy->IsIsolatedOrigin(url::Origin(GURL("http://unisolated.com")))); + EXPECT_FALSE( + policy->IsIsolatedOrigin(url::Origin(GURL("http://isolated.foo.com")))); + // Wrong scheme. + EXPECT_FALSE( + policy->IsIsolatedOrigin(url::Origin(GURL("https://foo.isolated.com")))); + + // Appending a trailing dot to a URL should not bypass process isolation. + EXPECT_TRUE( + policy->IsIsolatedOrigin(url::Origin(GURL("http://isolated.com.")))); + EXPECT_TRUE( + policy->IsIsolatedOrigin(url::Origin(GURL("http://foo.isolated.com.")))); + + // A new SiteInstance created for a subdomain on an isolated origin + // should use the isolated origin's host and not its own host as the site + // URL. + EXPECT_EQ(isolated_url, + SiteInstance::GetSiteForURL(nullptr, foo_isolated_url)); + + EXPECT_TRUE(SiteInstanceImpl::DoesSiteRequireDedicatedProcess( + nullptr, foo_isolated_url)); + + EXPECT_TRUE( + SiteInstance::IsSameWebSite(nullptr, isolated_url, foo_isolated_url)); + EXPECT_TRUE( + SiteInstance::IsSameWebSite(nullptr, foo_isolated_url, isolated_url)); + + // Don't try to match subdomains on IP addresses. + GURL isolated_ip("http://127.0.0.1"); + policy->AddIsolatedOrigin(url::Origin(isolated_ip)); + EXPECT_TRUE(policy->IsIsolatedOrigin(url::Origin(isolated_ip))); + EXPECT_FALSE( + policy->IsIsolatedOrigin(url::Origin(GURL("http://42.127.0.0.1")))); + + // Cleanup. + policy->RemoveIsolatedOriginForTesting(url::Origin(isolated_url)); +} + +TEST_F(SiteInstanceTest, SubdomainOnIsolatedOrigin) { + GURL foo_url("http://foo.com"); + GURL isolated_foo_url("http://isolated.foo.com"); + GURL bar_isolated_foo_url("http://bar.isolated.foo.com"); + GURL baz_isolated_foo_url("http://baz.isolated.foo.com"); + + auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); + policy->AddIsolatedOrigin(url::Origin(isolated_foo_url)); + + EXPECT_FALSE(policy->IsIsolatedOrigin(url::Origin(foo_url))); + EXPECT_TRUE(policy->IsIsolatedOrigin(url::Origin(isolated_foo_url))); + EXPECT_TRUE(policy->IsIsolatedOrigin(url::Origin(bar_isolated_foo_url))); + EXPECT_TRUE(policy->IsIsolatedOrigin(url::Origin(baz_isolated_foo_url))); + + EXPECT_EQ(foo_url, SiteInstance::GetSiteForURL(nullptr, foo_url)); + EXPECT_EQ(isolated_foo_url, + SiteInstance::GetSiteForURL(nullptr, isolated_foo_url)); + EXPECT_EQ(isolated_foo_url, + SiteInstance::GetSiteForURL(nullptr, bar_isolated_foo_url)); + EXPECT_EQ(isolated_foo_url, + SiteInstance::GetSiteForURL(nullptr, baz_isolated_foo_url)); + + if (!AreAllSitesIsolatedForTesting()) { + EXPECT_FALSE( + SiteInstanceImpl::DoesSiteRequireDedicatedProcess(nullptr, foo_url)); + } + EXPECT_TRUE(SiteInstanceImpl::DoesSiteRequireDedicatedProcess( + nullptr, isolated_foo_url)); + EXPECT_TRUE(SiteInstanceImpl::DoesSiteRequireDedicatedProcess( + nullptr, bar_isolated_foo_url)); + EXPECT_TRUE(SiteInstanceImpl::DoesSiteRequireDedicatedProcess( + nullptr, baz_isolated_foo_url)); + + EXPECT_FALSE(SiteInstance::IsSameWebSite(nullptr, foo_url, isolated_foo_url)); + EXPECT_FALSE(SiteInstance::IsSameWebSite(nullptr, isolated_foo_url, foo_url)); + EXPECT_FALSE( + SiteInstance::IsSameWebSite(nullptr, foo_url, bar_isolated_foo_url)); + EXPECT_FALSE( + SiteInstance::IsSameWebSite(nullptr, bar_isolated_foo_url, foo_url)); + EXPECT_TRUE(SiteInstance::IsSameWebSite(nullptr, bar_isolated_foo_url, + isolated_foo_url)); + EXPECT_TRUE(SiteInstance::IsSameWebSite(nullptr, isolated_foo_url, + bar_isolated_foo_url)); + EXPECT_TRUE(SiteInstance::IsSameWebSite(nullptr, bar_isolated_foo_url, + baz_isolated_foo_url)); + EXPECT_TRUE(SiteInstance::IsSameWebSite(nullptr, baz_isolated_foo_url, + bar_isolated_foo_url)); + + // Cleanup. + policy->RemoveIsolatedOriginForTesting(url::Origin(isolated_foo_url)); +} + +TEST_F(SiteInstanceTest, MultipleIsolatedOriginsWithCommonSite) { + GURL foo_url("http://foo.com"); + GURL bar_foo_url("http://bar.foo.com"); + GURL baz_bar_foo_url("http://baz.bar.foo.com"); + GURL qux_baz_bar_foo_url("http://qux.baz.bar.foo.com"); + + auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); + policy->AddIsolatedOrigin(url::Origin(foo_url)); + policy->AddIsolatedOrigin(url::Origin(baz_bar_foo_url)); + + EXPECT_TRUE(policy->IsIsolatedOrigin(url::Origin(foo_url))); + EXPECT_TRUE(policy->IsIsolatedOrigin(url::Origin(bar_foo_url))); + EXPECT_TRUE(policy->IsIsolatedOrigin(url::Origin(baz_bar_foo_url))); + EXPECT_TRUE(policy->IsIsolatedOrigin(url::Origin(qux_baz_bar_foo_url))); + + EXPECT_EQ(foo_url, SiteInstance::GetSiteForURL(nullptr, foo_url)); + EXPECT_EQ(foo_url, SiteInstance::GetSiteForURL(nullptr, bar_foo_url)); + EXPECT_EQ(baz_bar_foo_url, + SiteInstance::GetSiteForURL(nullptr, baz_bar_foo_url)); + EXPECT_EQ(baz_bar_foo_url, + SiteInstance::GetSiteForURL(nullptr, qux_baz_bar_foo_url)); + + EXPECT_TRUE( + SiteInstanceImpl::DoesSiteRequireDedicatedProcess(nullptr, foo_url)); + EXPECT_TRUE( + SiteInstanceImpl::DoesSiteRequireDedicatedProcess(nullptr, bar_foo_url)); + EXPECT_TRUE(SiteInstanceImpl::DoesSiteRequireDedicatedProcess( + nullptr, baz_bar_foo_url)); + EXPECT_TRUE(SiteInstanceImpl::DoesSiteRequireDedicatedProcess( + nullptr, qux_baz_bar_foo_url)); + + EXPECT_TRUE(SiteInstance::IsSameWebSite(nullptr, foo_url, bar_foo_url)); + EXPECT_FALSE(SiteInstance::IsSameWebSite(nullptr, foo_url, baz_bar_foo_url)); + EXPECT_FALSE( + SiteInstance::IsSameWebSite(nullptr, foo_url, qux_baz_bar_foo_url)); + + EXPECT_FALSE( + SiteInstance::IsSameWebSite(nullptr, bar_foo_url, baz_bar_foo_url)); + EXPECT_FALSE( + SiteInstance::IsSameWebSite(nullptr, bar_foo_url, qux_baz_bar_foo_url)); + + EXPECT_TRUE(SiteInstance::IsSameWebSite(nullptr, baz_bar_foo_url, + qux_baz_bar_foo_url)); + + // Cleanup. + policy->RemoveIsolatedOriginForTesting(url::Origin(foo_url)); + policy->RemoveIsolatedOriginForTesting(url::Origin(baz_bar_foo_url)); } } // namespace content
diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc index b670a07c..e6bb439 100644 --- a/content/browser/utility_process_host_impl.cc +++ b/content/browser/utility_process_host_impl.cc
@@ -290,6 +290,7 @@ cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kUtilityProcess); + BrowserChildProcessHostImpl::CopyFeatureAndFieldTrialFlags(cmd_line.get()); std::string locale = GetContentClient()->browser()->GetApplicationLocale(); cmd_line->AppendSwitchASCII(switches::kLang, locale);
diff --git a/content/browser/web_contents/aura/gesture_nav_simple.cc b/content/browser/web_contents/aura/gesture_nav_simple.cc index 9976acc..4c1e1bd4 100644 --- a/content/browser/web_contents/aura/gesture_nav_simple.cc +++ b/content/browser/web_contents/aura/gesture_nav_simple.cc
@@ -17,6 +17,8 @@ #include "ui/compositor/layer.h" #include "ui/compositor/layer_delegate.h" #include "ui/compositor/paint_recorder.h" +#include "ui/display/display.h" +#include "ui/display/screen.h" #include "ui/gfx/animation/animation_delegate.h" #include "ui/gfx/animation/linear_animation.h" #include "ui/gfx/animation/tween.h" @@ -360,8 +362,14 @@ affordance_.reset(); } -gfx::Rect GestureNavSimple::GetVisibleBounds() const { - return web_contents_->GetNativeView()->bounds(); +gfx::Size GestureNavSimple::GetVisibleSize() const { + return web_contents_->GetNativeView()->bounds().size(); +} + +gfx::Size GestureNavSimple::GetDisplaySize() const { + return display::Screen::GetScreen() + ->GetDisplayNearestView(web_contents_->GetNativeView()) + .size(); } bool GestureNavSimple::OnOverscrollUpdate(float delta_x, float delta_y) { @@ -392,19 +400,20 @@ return; } - aura::Window* window = web_contents_->GetNativeView(); - const gfx::Rect& window_bounds = window->bounds(); DCHECK_NE(source, OverscrollSource::NONE); - float start_threshold = GetOverscrollConfig( + const float start_threshold = GetOverscrollConfig( source == OverscrollSource::TOUCHPAD ? OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHPAD : OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHSCREEN); + const int width = source == OverscrollSource::TOUCHPAD + ? GetDisplaySize().width() + : GetVisibleSize().width(); completion_threshold_ = - window_bounds.width() * - GetOverscrollConfig(OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE) - + width * GetOverscrollConfig(OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE) - start_threshold; - affordance_.reset(new Affordance(this, new_mode, window_bounds)); + aura::Window* window = web_contents_->GetNativeView(); + affordance_.reset(new Affordance(this, new_mode, window->bounds())); // Adding the affordance as a child of the content window is not sufficient, // because it is possible for a new layer to be parented on top of the
diff --git a/content/browser/web_contents/aura/gesture_nav_simple.h b/content/browser/web_contents/aura/gesture_nav_simple.h index f55ceb2..0cb9f80 100644 --- a/content/browser/web_contents/aura/gesture_nav_simple.h +++ b/content/browser/web_contents/aura/gesture_nav_simple.h
@@ -31,7 +31,8 @@ void CompleteGestureAnimation(); // OverscrollControllerDelegate: - gfx::Rect GetVisibleBounds() const override; + gfx::Size GetVisibleSize() const override; + gfx::Size GetDisplaySize() const override; bool OnOverscrollUpdate(float delta_x, float delta_y) override; void OnOverscrollComplete(OverscrollMode overscroll_mode) override; void OnOverscrollModeChange(OverscrollMode old_mode,
diff --git a/content/browser/web_contents/aura/overscroll_window_animation.cc b/content/browser/web_contents/aura/overscroll_window_animation.cc index e50a84f..6aaef30 100644 --- a/content/browser/web_contents/aura/overscroll_window_animation.cc +++ b/content/browser/web_contents/aura/overscroll_window_animation.cc
@@ -13,6 +13,8 @@ #include "ui/aura/window.h" #include "ui/compositor/layer_animation_observer.h" #include "ui/compositor/scoped_layer_animation_settings.h" +#include "ui/display/display.h" +#include "ui/display/screen.h" namespace content { @@ -35,8 +37,7 @@ DCHECK(delegate_); } -OverscrollWindowAnimation::~OverscrollWindowAnimation() { -} +OverscrollWindowAnimation::~OverscrollWindowAnimation() {} void OverscrollWindowAnimation::CancelSlide() { overscroll_cancelled_ = true; @@ -48,15 +49,21 @@ float OverscrollWindowAnimation::GetTranslationForOverscroll(float delta_x) { DCHECK(direction_ != SLIDE_NONE); - const float bounds_width = GetVisibleBounds().width(); + const float bounds_width = GetVisibleSize().width(); if (direction_ == SLIDE_FRONT) return std::max(-bounds_width, delta_x); else return std::min(bounds_width, delta_x); } -gfx::Rect OverscrollWindowAnimation::GetVisibleBounds() const { - return delegate_->GetMainWindow()->bounds(); +gfx::Size OverscrollWindowAnimation::GetVisibleSize() const { + return delegate_->GetMainWindow()->bounds().size(); +} + +gfx::Size OverscrollWindowAnimation::GetDisplaySize() const { + return display::Screen::GetScreen() + ->GetDisplayNearestView(delegate_->GetMainWindow()) + .size(); } bool OverscrollWindowAnimation::OnOverscrollUpdate(float delta_x, @@ -101,7 +108,7 @@ slide_window_->layer()->GetAnimator()->StopAnimating(); delegate_->GetMainWindow()->layer()->GetAnimator()->StopAnimating(); } - gfx::Rect slide_window_bounds = gfx::Rect(GetVisibleBounds().size()); + gfx::Rect slide_window_bounds(GetVisibleSize()); if (new_direction == SLIDE_FRONT) { slide_window_bounds.Offset(base::i18n::IsRTL() ? -slide_window_bounds.width() @@ -135,7 +142,7 @@ if (!is_active()) return; delegate_->OnOverscrollCompleting(); - int content_width = GetVisibleBounds().width(); + int content_width = GetVisibleSize().width(); float translate_x; if ((base::i18n::IsRTL() && direction_ == SLIDE_FRONT) || (!base::i18n::IsRTL() && direction_ == SLIDE_BACK)) {
diff --git a/content/browser/web_contents/aura/overscroll_window_animation.h b/content/browser/web_contents/aura/overscroll_window_animation.h index e412755..f11c7db 100644 --- a/content/browser/web_contents/aura/overscroll_window_animation.h +++ b/content/browser/web_contents/aura/overscroll_window_animation.h
@@ -84,7 +84,8 @@ } // OverscrollControllerDelegate: - gfx::Rect GetVisibleBounds() const override; + gfx::Size GetVisibleSize() const override; + gfx::Size GetDisplaySize() const override; bool OnOverscrollUpdate(float delta_x, float delta_y) override; void OnOverscrollComplete(OverscrollMode overscroll_mode) override; void OnOverscrollModeChange(OverscrollMode old_mode,
diff --git a/content/browser/web_contents/aura/overscroll_window_delegate.cc b/content/browser/web_contents/aura/overscroll_window_delegate.cc index 141a6891..ac5753d 100644 --- a/content/browser/web_contents/aura/overscroll_window_delegate.cc +++ b/content/browser/web_contents/aura/overscroll_window_delegate.cc
@@ -40,6 +40,7 @@ overscroll_mode_ = OVERSCROLL_EAST; else overscroll_mode_ = OVERSCROLL_WEST; + overscroll_source_ = source; delegate_->OnOverscrollModeChange(old_mode, overscroll_mode_, source); } @@ -49,13 +50,16 @@ delegate_->OnOverscrollModeChange(overscroll_mode_, OVERSCROLL_NONE, OverscrollSource::NONE); overscroll_mode_ = OVERSCROLL_NONE; + overscroll_source_ = OverscrollSource::NONE; delta_x_ = 0; } void OverscrollWindowDelegate::CompleteOrResetOverscroll() { if (overscroll_mode_ == OVERSCROLL_NONE) return; - int width = delegate_->GetVisibleBounds().width(); + int width = overscroll_source_ == OverscrollSource::TOUCHPAD + ? delegate_->GetDisplaySize().width() + : delegate_->GetVisibleSize().width(); float ratio = (fabs(delta_x_)) / width; if (ratio < complete_threshold_ratio_) { ResetOverscroll();
diff --git a/content/browser/web_contents/aura/overscroll_window_delegate.h b/content/browser/web_contents/aura/overscroll_window_delegate.h index f267b85..251daac8 100644 --- a/content/browser/web_contents/aura/overscroll_window_delegate.h +++ b/content/browser/web_contents/aura/overscroll_window_delegate.h
@@ -52,6 +52,9 @@ // The current overscroll mode. OverscrollMode overscroll_mode_; + // The current overscroll source. + OverscrollSource overscroll_source_; + // The latest delta_x scroll update. float delta_x_;
diff --git a/content/browser/web_contents/aura/overscroll_window_delegate_unittest.cc b/content/browser/web_contents/aura/overscroll_window_delegate_unittest.cc index 828bb4fa..4dafb29 100644 --- a/content/browser/web_contents/aura/overscroll_window_delegate_unittest.cc +++ b/content/browser/web_contents/aura/overscroll_window_delegate_unittest.cc
@@ -16,6 +16,7 @@ namespace content { namespace { +const int kTestDisplayWidth = 800; const int kTestWindowWidth = 600; } @@ -28,11 +29,11 @@ overscroll_started_(false), mode_changed_(false), current_mode_(OVERSCROLL_NONE), + current_source_(OverscrollSource::NONE), touch_start_threshold_(content::GetOverscrollConfig( content::OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHSCREEN)), touch_complete_threshold_(content::GetOverscrollConfig( - content::OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE)) { - } + content::OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE)) {} ~OverscrollWindowDelegateTest() override {} @@ -41,6 +42,7 @@ overscroll_started_ = false; mode_changed_ = false; current_mode_ = OVERSCROLL_NONE; + current_source_ = OverscrollSource::NONE; window_.reset(CreateNormalWindow( 0, root_window(), new OverscrollWindowDelegate(this, gfx::Image()))); window_->SetBounds(gfx::Rect(0, 0, kTestWindowWidth, kTestWindowWidth)); @@ -58,7 +60,10 @@ float touch_start_threshold() { return touch_start_threshold_; } float touch_complete_threshold() { - return kTestWindowWidth * touch_complete_threshold_; + const int width = current_source_ == OverscrollSource::TOUCHPAD + ? kTestDisplayWidth + : kTestWindowWidth; + return width * touch_complete_threshold_; } protected: @@ -77,8 +82,12 @@ private: // OverscrollControllerDelegate: - gfx::Rect GetVisibleBounds() const override { - return gfx::Rect(kTestWindowWidth, kTestWindowWidth); + gfx::Size GetVisibleSize() const override { + return gfx::Size(kTestWindowWidth, kTestWindowWidth); + } + + gfx::Size GetDisplaySize() const override { + return gfx::Size(kTestDisplayWidth, kTestDisplayWidth); } bool OnOverscrollUpdate(float delta_x, float delta_y) override { @@ -94,6 +103,7 @@ OverscrollSource source) override { mode_changed_ = true; current_mode_ = new_mode; + current_source_ = source; if (current_mode_ != OVERSCROLL_NONE) overscroll_started_ = true; } @@ -106,6 +116,7 @@ bool overscroll_started_; bool mode_changed_; OverscrollMode current_mode_; + OverscrollSource current_source_; // Config defined constants. const float touch_start_threshold_;
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 52ddbab..3d1ed20 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3226,9 +3226,8 @@ if (headers.empty()) { params->set_prefer_cache(true); } else { - for (const base::StringPiece& key_value : - base::SplitStringPiece( - headers, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { + for (const base::StringPiece& key_value : base::SplitStringPiece( + headers, "\r\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { std::vector<std::string> pair = base::SplitString( key_value, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); DCHECK_EQ(2ul, pair.size()); @@ -5397,6 +5396,10 @@ return view_->GetAllowOtherViews(); } +bool WebContentsImpl::CompletedFirstVisuallyNonEmptyPaint() const { + return did_first_visually_non_empty_paint_; +} + #endif void WebContentsImpl::OnDidDownloadImage(
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index 8a88279..a2315c3 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h
@@ -469,6 +469,7 @@ #elif defined(OS_MACOSX) void SetAllowOtherViews(bool allow) override; bool GetAllowOtherViews() override; + bool CompletedFirstVisuallyNonEmptyPaint() const override; #endif // Implementation of PageNavigator.
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index 870aa44..c1f01fe0 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -67,6 +67,7 @@ #include "ui/base/dragdrop/os_exchange_data_provider_factory.h" #include "ui/base/hit_test.h" #include "ui/compositor/layer.h" +#include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/events/blink/web_input_event.h" #include "ui/events/event.h" @@ -1028,12 +1029,22 @@ //////////////////////////////////////////////////////////////////////////////// // WebContentsViewAura, OverscrollControllerDelegate implementation: -gfx::Rect WebContentsViewAura::GetVisibleBounds() const { +gfx::Size WebContentsViewAura::GetVisibleSize() const { RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); if (!rwhv || !rwhv->IsShowing()) - return gfx::Rect(); + return gfx::Size(); - return rwhv->GetViewBounds(); + return rwhv->GetViewBounds().size(); +} + +gfx::Size WebContentsViewAura::GetDisplaySize() const { + RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); + if (!rwhv) + return gfx::Size(); + + return display::Screen::GetScreen() + ->GetDisplayNearestView(rwhv->GetNativeView()) + .size(); } bool WebContentsViewAura::OnOverscrollUpdate(float delta_x, float delta_y) {
diff --git a/content/browser/web_contents/web_contents_view_aura.h b/content/browser/web_contents/web_contents_view_aura.h index c52692e..8c27edc 100644 --- a/content/browser/web_contents/web_contents_view_aura.h +++ b/content/browser/web_contents/web_contents_view_aura.h
@@ -153,7 +153,8 @@ #endif // Overridden from OverscrollControllerDelegate: - gfx::Rect GetVisibleBounds() const override; + gfx::Size GetVisibleSize() const override; + gfx::Size GetDisplaySize() const override; bool OnOverscrollUpdate(float delta_x, float delta_y) override; void OnOverscrollComplete(OverscrollMode overscroll_mode) override; void OnOverscrollModeChange(OverscrollMode old_mode,
diff --git a/content/browser/webauth/OWNERS b/content/browser/webauth/OWNERS new file mode 100644 index 0000000..e2c72da --- /dev/null +++ b/content/browser/webauth/OWNERS
@@ -0,0 +1,5 @@ +engedy@chromium.org +mkwst@chromium.org +vasilii@chromium.org + +# Component: Blink>WebAuth \ No newline at end of file
diff --git a/content/browser/webauth/authenticator_impl.cc b/content/browser/webauth/authenticator_impl.cc new file mode 100644 index 0000000..95393e8 --- /dev/null +++ b/content/browser/webauth/authenticator_impl.cc
@@ -0,0 +1,111 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/webauth/authenticator_impl.h" + +#include <memory> + +#include "base/json/json_writer.h" +#include "base/memory/ptr_util.h" +#include "content/public/browser/render_frame_host.h" +#include "content/public/browser/web_contents.h" +#include "crypto/sha2.h" +#include "mojo/public/cpp/bindings/strong_binding.h" + +namespace content { + +namespace { + +const char kGetAssertionType[] = "navigator.id.getAssertion"; + +// JSON key values +const char kTypeKey[] = "type"; +const char kChallengeKey[] = "challenge"; +const char kOriginKey[] = "origin"; +const char kCidPubkeyKey[] = "cid_pubkey"; + +} // namespace + +// Serializes the |value| to a JSON string and returns the result. +std::string SerializeValueToJson(const base::Value& value) { + std::string json; + base::JSONWriter::Write(value, &json); + return json; +} + +// static +void AuthenticatorImpl::Create( + RenderFrameHost* render_frame_host, + const service_manager::BindSourceInfo& source_info, + webauth::mojom::AuthenticatorRequest request) { + auto authenticator_impl = + base::WrapUnique(new AuthenticatorImpl(render_frame_host)); + mojo::MakeStrongBinding(std::move(authenticator_impl), std::move(request)); +} + +AuthenticatorImpl::~AuthenticatorImpl() {} + +AuthenticatorImpl::AuthenticatorImpl(RenderFrameHost* render_frame_host) { + DCHECK(render_frame_host); + caller_origin_ = render_frame_host->GetLastCommittedOrigin(); +} + +// mojom:Authenticator +void AuthenticatorImpl::MakeCredential( + webauth::mojom::RelyingPartyAccountPtr account, + std::vector<webauth::mojom::ScopedCredentialParametersPtr> parameters, + const std::vector<uint8_t>& challenge, + webauth::mojom::ScopedCredentialOptionsPtr options, + MakeCredentialCallback callback) { + std::string effective_domain; + std::string relying_party_id; + std::string client_data_json; + base::DictionaryValue client_data; + + // Steps 6 & 7 of https://w3c.github.io/webauthn/#createCredential + // opaque origin + if (caller_origin_.unique()) { + std::move(callback).Run( + webauth::mojom::AuthenticatorStatus::NOT_ALLOWED_ERROR, NULL); + return; + } + + if (!options->relying_party_id) { + relying_party_id = caller_origin_.Serialize(); + } else { + effective_domain = caller_origin_.host(); + + DCHECK(!effective_domain.empty()); + // TODO(kpaulhamus): Check if relyingPartyId is a registrable domain + // suffix of and equal to effectiveDomain and set relyingPartyId + // appropriately. + relying_party_id = options->relying_party_id.value_or(std::string()); + } + + // TODO(kpaulhamus): Check ScopedCredentialParameter's type and + // algorithmIdentifier after algorithmIdentifier is added to mojom to + // make sure it is U2F_V2. + + client_data.SetString(kTypeKey, kGetAssertionType); + client_data.SetString( + kChallengeKey, + base::StringPiece(reinterpret_cast<const char*>(challenge.data()), + challenge.size())); + client_data.SetString(kOriginKey, relying_party_id); + // Channel ID is optional, and missing if the browser doesn't support it. + // It is present and set to the constant "unused" if the browser + // supports Channel ID but is not using it to talk to the origin. + // TODO(kpaulhamus): Fetch and add the Channel ID public key used to + // communicate with the origin. + client_data.SetString(kCidPubkeyKey, "unused"); + + // SHA-256 hash the JSON data structure + client_data_json = SerializeValueToJson(client_data); + std::string client_data_hash = crypto::SHA256HashString(client_data_json); + + std::move(callback).Run(webauth::mojom::AuthenticatorStatus::NOT_IMPLEMENTED, + nullptr); +} + +} // namespace content
diff --git a/content/browser/webauth/authenticator_impl.h b/content/browser/webauth/authenticator_impl.h new file mode 100644 index 0000000..b2689b7 --- /dev/null +++ b/content/browser/webauth/authenticator_impl.h
@@ -0,0 +1,58 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_WEBAUTH_AUTHENTICATOR_IMPL_H_ +#define CONTENT_BROWSER_WEBAUTH_AUTHENTICATOR_IMPL_H_ + +#include <vector> + +#include "base/cancelable_callback.h" +#include "base/macros.h" +#include "content/common/content_export.h" +#include "mojo/public/cpp/bindings/binding.h" +#include "mojo/public/cpp/bindings/interface_request.h" +#include "third_party/WebKit/public/platform/modules/webauth/authenticator.mojom.h" +#include "url/origin.h" + +namespace service_manager { +struct BindSourceInfo; +} + +namespace content { + +class RenderFrameHost; + +// Implementation of the public Authenticator interface. +class CONTENT_EXPORT AuthenticatorImpl + : public NON_EXPORTED_BASE(webauth::mojom::Authenticator) { + public: + static void Create(RenderFrameHost* render_frame_host, + const service_manager::BindSourceInfo& source_info, + webauth::mojom::AuthenticatorRequest request); + ~AuthenticatorImpl() override; + + void set_connection_error_handler(const base::Closure& error_handler) { + connection_error_handler_ = error_handler; + } + + private: + explicit AuthenticatorImpl(RenderFrameHost* render_frame_host); + + // mojom:Authenticator + void MakeCredential( + webauth::mojom::RelyingPartyAccountPtr account, + std::vector<webauth::mojom::ScopedCredentialParametersPtr> parameters, + const std::vector<uint8_t>& challenge, + webauth::mojom::ScopedCredentialOptionsPtr options, + MakeCredentialCallback callback) override; + + base::Closure connection_error_handler_; + base::CancelableClosure timeout_callback_; + url::Origin caller_origin_; + DISALLOW_COPY_AND_ASSIGN(AuthenticatorImpl); +}; + +} // namespace content + +#endif // CONTENT_BROWSER_WEBAUTH_AUTHENTICATOR_IMPL_H_ \ No newline at end of file
diff --git a/content/browser/webauth/authenticator_impl_unittest.cc b/content/browser/webauth/authenticator_impl_unittest.cc new file mode 100644 index 0000000..168ec03 --- /dev/null +++ b/content/browser/webauth/authenticator_impl_unittest.cc
@@ -0,0 +1,163 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/webauth/authenticator_impl.h" + +#include <stdint.h> +#include <string> +#include <vector> + +#include "base/run_loop.h" +#include "content/public/browser/render_frame_host.h" +#include "content/public/browser/web_contents.h" +#include "content/public/test/navigation_simulator.h" +#include "content/public/test/test_renderer_host.h" +#include "content/test/test_render_frame_host.h" +#include "mojo/public/cpp/bindings/binding.h" +#include "services/service_manager/public/cpp/bind_source_info.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace content { + +using ::testing::_; + +using webauth::mojom::RelyingPartyAccount; +using webauth::mojom::ScopedCredentialOptions; +using webauth::mojom::ScopedCredentialParameters; +using webauth::mojom::AuthenticatorPtr; +using webauth::mojom::AuthenticatorStatus; +using webauth::mojom::RelyingPartyAccountPtr; +using webauth::mojom::ScopedCredentialInfoPtr; +using webauth::mojom::ScopedCredentialOptionsPtr; +using webauth::mojom::ScopedCredentialParametersPtr; + +const char* kOrigin1 = "https://google.com"; + +class AuthenticatorImplTest : public content::RenderViewHostTestHarness { + public: + AuthenticatorImplTest() {} + ~AuthenticatorImplTest() override {} + + protected: + // Simulates navigating to a page and getting the page contents and language + // for that navigation. + void SimulateNavigation(const GURL& url) { + if (main_rfh()->GetLastCommittedURL() != url) + NavigateAndCommit(url); + } + + AuthenticatorPtr ConnectToAuthenticator() { + AuthenticatorPtr authenticator; + AuthenticatorImpl::Create(main_rfh(), service_manager::BindSourceInfo(), + mojo::MakeRequest(&authenticator)); + return authenticator; + } +}; + +class TestMakeCredentialCallback { + public: + TestMakeCredentialCallback() + : callback_(base::Bind(&TestMakeCredentialCallback::ReceivedCallback, + base::Unretained(this))) {} + ~TestMakeCredentialCallback() {} + + void ReceivedCallback(AuthenticatorStatus status, + ScopedCredentialInfoPtr credential) { + response_ = std::make_pair(status, std::move(credential)); + closure_.Run(); + } + + std::pair<AuthenticatorStatus, ScopedCredentialInfoPtr>& WaitForCallback() { + closure_ = run_loop_.QuitClosure(); + run_loop_.Run(); + return response_; + } + + const base::Callback<void(AuthenticatorStatus status, + ScopedCredentialInfoPtr credential)>& + callback() { + return callback_; + } + + private: + std::pair<AuthenticatorStatus, ScopedCredentialInfoPtr> response_; + base::Closure closure_; + base::Callback<void(AuthenticatorStatus status, + ScopedCredentialInfoPtr credential)> + callback_; + base::RunLoop run_loop_; +}; + +RelyingPartyAccountPtr GetTestRelyingPartyAccount() { + RelyingPartyAccountPtr account = RelyingPartyAccount::New(); + account->relying_party_display_name = std::string("TestRP"); + account->display_name = std::string("Test A. Name"); + account->id = std::string("1098237235409872"); + account->name = std::string("Testname@example.com"); + account->image_url = std::string("fakeurl.png"); + return account; +} + +std::vector<ScopedCredentialParametersPtr> GetTestScopedCredentialParameters() { + std::vector<ScopedCredentialParametersPtr> parameters; + auto fake_parameter = ScopedCredentialParameters::New(); + fake_parameter->type = webauth::mojom::ScopedCredentialType::SCOPEDCRED; + parameters.push_back(std::move(fake_parameter)); + return parameters; +} + +ScopedCredentialOptionsPtr GetTestScopedCredentialOptions() { + ScopedCredentialOptionsPtr opts = ScopedCredentialOptions::New(); + opts->adjusted_timeout = 60; + opts->relying_party_id = std::string("localhost"); + return opts; +} + +// Test that service returns NOT_IMPLEMENTED on a call to MakeCredential. +TEST_F(AuthenticatorImplTest, MakeCredentialNotImplemented) { + SimulateNavigation(GURL(kOrigin1)); + AuthenticatorPtr authenticator = ConnectToAuthenticator(); + + RelyingPartyAccountPtr account = GetTestRelyingPartyAccount(); + + std::vector<ScopedCredentialParametersPtr> parameters = + GetTestScopedCredentialParameters(); + + std::vector<uint8_t> buffer(32, 0x0A); + ScopedCredentialOptionsPtr opts = GetTestScopedCredentialOptions(); + + TestMakeCredentialCallback cb; + authenticator->MakeCredential(std::move(account), std::move(parameters), + buffer, std::move(opts), cb.callback()); + std::pair<webauth::mojom::AuthenticatorStatus, + webauth::mojom::ScopedCredentialInfoPtr>& response = + cb.WaitForCallback(); + EXPECT_EQ(webauth::mojom::AuthenticatorStatus::NOT_IMPLEMENTED, + response.first); +} + +// Test that service returns NOT_ALLOWED_ERROR on a call to MakeCredential with +// an opaque origin. +TEST_F(AuthenticatorImplTest, MakeCredentialOpaqueOrigin) { + NavigateAndCommit(GURL("data:text/html,opaque")); + AuthenticatorPtr authenticator = ConnectToAuthenticator(); + RelyingPartyAccountPtr account = GetTestRelyingPartyAccount(); + + std::vector<ScopedCredentialParametersPtr> parameters = + GetTestScopedCredentialParameters(); + + std::vector<uint8_t> buffer(32, 0x0A); + ScopedCredentialOptionsPtr opts = GetTestScopedCredentialOptions(); + + TestMakeCredentialCallback cb; + authenticator->MakeCredential(std::move(account), std::move(parameters), + buffer, std::move(opts), cb.callback()); + std::pair<webauth::mojom::AuthenticatorStatus, + webauth::mojom::ScopedCredentialInfoPtr>& response = + cb.WaitForCallback(); + EXPECT_EQ(webauth::mojom::AuthenticatorStatus::NOT_ALLOWED_ERROR, + response.first); +} +} // namespace content
diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc index 753fd63f4..6bd8c2a 100644 --- a/content/child/resource_dispatcher.cc +++ b/content/child/resource_dispatcher.cc
@@ -671,8 +671,7 @@ ThrottlingURLLoader::CreateLoaderAndStart( url_loader_factory, std::move(throttles), routing_id, request_id, mojom::kURLLoadOptionNone, *request, client.get(), - net::MutableNetworkTrafficAnnotationTag(NO_TRAFFIC_ANNOTATION_YET), - std::move(task_runner)); + NO_TRAFFIC_ANNOTATION_YET, std::move(task_runner)); pending_requests_[request_id]->url_loader = std::move(url_loader); pending_requests_[request_id]->url_loader_client = std::move(client); } else {
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index bd7a586..fbbb633 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc
@@ -388,8 +388,12 @@ WebRuntimeFeatures::EnableAutoplayMutedVideos(true); } - WebRuntimeFeatures::EnableLocationHardReload( - base::FeatureList::IsEnabled(features::kLocationHardReload)); + if (!base::FeatureList::IsEnabled(features::kWebAuth) && + !enableExperimentalWebPlatformFeatures) + WebRuntimeFeatures::EnableWebAuth(false); + + WebRuntimeFeatures::EnableModuleScripts( + base::FeatureList::IsEnabled(features::kModuleScripts)); // Enable explicitly enabled features, and then disable explicitly disabled // ones.
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn index 4e113f56..73b8435e 100644 --- a/content/common/BUILD.gn +++ b/content/common/BUILD.gn
@@ -422,7 +422,7 @@ "//storage/common", "//third_party/boringssl", "//third_party/icu", - "//third_party/webrtc/base:rtc_base", + "//third_party/webrtc/rtc_base:rtc_base", "//third_party/webrtc_overrides", "//ui/accessibility", "//ui/base",
diff --git a/content/common/feature_policy/feature_policy.cc b/content/common/feature_policy/feature_policy.cc index 8335649..6d82e7b 100644 --- a/content/common/feature_policy/feature_policy.cc +++ b/content/common/feature_policy/feature_policy.cc
@@ -230,16 +230,10 @@ FeaturePolicy::FeatureDefault::EnableForAll}, {blink::WebFeaturePolicyFeature::kDocumentWrite, FeaturePolicy::FeatureDefault::EnableForAll}, - {blink::WebFeaturePolicyFeature::kNotifications, - FeaturePolicy::FeatureDefault::EnableForAll}, - {blink::WebFeaturePolicyFeature::kPush, - FeaturePolicy::FeatureDefault::EnableForAll}, {blink::WebFeaturePolicyFeature::kSyncScript, FeaturePolicy::FeatureDefault::EnableForAll}, {blink::WebFeaturePolicyFeature::kSyncXHR, FeaturePolicy::FeatureDefault::EnableForAll}, - {blink::WebFeaturePolicyFeature::kWebRTC, - FeaturePolicy::FeatureDefault::EnableForAll}, {blink::WebFeaturePolicyFeature::kUsb, FeaturePolicy::FeatureDefault::EnableForSelf}})); return default_feature_list;
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h index 03413d0..7367ff14 100644 --- a/content/common/frame_messages.h +++ b/content/common/frame_messages.h
@@ -993,6 +993,12 @@ blink::WebFocusType /* type */, int32_t /* source_routing_id */) +// Tells the RenderFrame to advance the focus to next input node in the form by +// moving in specified direction if the currently focused node is a Text node +// (textfield, text area or content editable nodes). +IPC_MESSAGE_ROUTED1(FrameMsg_AdvanceFocusInForm, + blink::WebFocusType /* direction for advancing focus */) + // Sent when the user wants to search for a word on the page (find-in-page). IPC_MESSAGE_ROUTED3(FrameMsg_Find, int /* request_id */,
diff --git a/content/common/origin_util.cc b/content/common/origin_util.cc index 2fdc553b..4de5ccb 100644 --- a/content/common/origin_util.cc +++ b/content/common/origin_util.cc
@@ -36,8 +36,7 @@ return true; } - std::string hostname = url.HostNoBrackets(); - if (net::IsLocalhost(hostname)) + if (net::IsLocalhost(url.HostNoBracketsPiece())) return true; if (base::ContainsValue(url::GetSecureSchemes(), url.scheme())) @@ -79,7 +78,7 @@ if (base::ContainsValue(url::GetSecureSchemes(), origin.scheme()) || base::ContainsValue(url::GetLocalSchemes(), origin.scheme()) || - net::IsLocalhost(origin.GetURL().HostNoBrackets())) { + net::IsLocalhost(origin.GetURL().HostNoBracketsPiece())) { return true; }
diff --git a/content/common/p2p_messages.h b/content/common/p2p_messages.h index 51b0144..15716d0 100644 --- a/content/common/p2p_messages.h +++ b/content/common/p2p_messages.h
@@ -13,7 +13,7 @@ #include "ipc/ipc_message_macros.h" #include "net/base/ip_address.h" #include "net/base/network_interfaces.h" -#include "third_party/webrtc/base/asyncpacketsocket.h" +#include "third_party/webrtc/rtc_base/asyncpacketsocket.h" #undef IPC_MESSAGE_EXPORT #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
diff --git a/content/common/throttling_url_loader.cc b/content/common/throttling_url_loader.cc index 8fed870..8843606c 100644 --- a/content/common/throttling_url_loader.cc +++ b/content/common/throttling_url_loader.cc
@@ -59,7 +59,7 @@ uint32_t options, const ResourceRequest& url_request, mojom::URLLoaderClient* client, - const net::MutableNetworkTrafficAnnotationTag& traffic_annotation, + const net::NetworkTrafficAnnotationTag& traffic_annotation, scoped_refptr<base::SingleThreadTaskRunner> task_runner) { std::unique_ptr<ThrottlingURLLoader> loader(new ThrottlingURLLoader( std::move(throttles), client, traffic_annotation)); @@ -74,9 +74,10 @@ std::vector<std::unique_ptr<URLLoaderThrottle>> throttles, const ResourceRequest& url_request, mojom::URLLoaderClient* client, + const net::NetworkTrafficAnnotationTag& traffic_annotation, scoped_refptr<base::SingleThreadTaskRunner> task_runner) { std::unique_ptr<ThrottlingURLLoader> loader(new ThrottlingURLLoader( - std::move(throttles), client, net::MutableNetworkTrafficAnnotationTag())); + std::move(throttles), client, traffic_annotation)); loader->Start(nullptr, 0, 0, mojom::kURLLoadOptionNone, std::move(start_loader_callback), url_request, std::move(task_runner)); @@ -105,7 +106,7 @@ ThrottlingURLLoader::ThrottlingURLLoader( std::vector<std::unique_ptr<URLLoaderThrottle>> throttles, mojom::URLLoaderClient* client, - const net::MutableNetworkTrafficAnnotationTag& traffic_annotation) + const net::NetworkTrafficAnnotationTag& traffic_annotation) : forwarding_client_(client), client_binding_(this), traffic_annotation_(traffic_annotation) { @@ -168,9 +169,10 @@ mojom::URLLoaderAssociatedPtr url_loader; auto url_loader_request = mojo::MakeRequest(&url_loader); url_loader_ = std::move(url_loader); - factory->CreateLoaderAndStart(std::move(url_loader_request), routing_id, - request_id, options, url_request, - std::move(client), traffic_annotation_); + factory->CreateLoaderAndStart( + std::move(url_loader_request), routing_id, request_id, options, + url_request, std::move(client), + net::MutableNetworkTrafficAnnotationTag(traffic_annotation_)); } else { mojom::URLLoaderPtr url_loader; auto url_loader_request = mojo::MakeRequest(&url_loader);
diff --git a/content/common/throttling_url_loader.h b/content/common/throttling_url_loader.h index 11e34a2..e9f85dc 100644 --- a/content/common/throttling_url_loader.h +++ b/content/common/throttling_url_loader.h
@@ -45,7 +45,7 @@ uint32_t options, const ResourceRequest& url_request, mojom::URLLoaderClient* client, - const net::MutableNetworkTrafficAnnotationTag& traffic_annotation, + const net::NetworkTrafficAnnotationTag& traffic_annotation, scoped_refptr<base::SingleThreadTaskRunner> task_runner = base::ThreadTaskRunnerHandle::Get()); @@ -61,6 +61,7 @@ std::vector<std::unique_ptr<URLLoaderThrottle>> throttles, const ResourceRequest& url_request, mojom::URLLoaderClient* client, + const net::NetworkTrafficAnnotationTag& traffic_annotation, scoped_refptr<base::SingleThreadTaskRunner> task_runner = base::ThreadTaskRunnerHandle::Get()); @@ -73,7 +74,7 @@ ThrottlingURLLoader( std::vector<std::unique_ptr<URLLoaderThrottle>> throttles, mojom::URLLoaderClient* client, - const net::MutableNetworkTrafficAnnotationTag& traffic_annotation); + const net::NetworkTrafficAnnotationTag& traffic_annotation); // Either of the two sets of arguments below is valid but not both: // - |factory|, |routing_id|, |request_id| and |options|; @@ -189,7 +190,7 @@ // Set if request is deferred and SetPriority() is called. std::unique_ptr<PriorityInfo> priority_info_; - const net::MutableNetworkTrafficAnnotationTag traffic_annotation_; + const net::NetworkTrafficAnnotationTag traffic_annotation_; DISALLOW_COPY_AND_ASSIGN(ThrottlingURLLoader); };
diff --git a/content/common/throttling_url_loader_unittest.cc b/content/common/throttling_url_loader_unittest.cc index cf9913c..3068e9ae 100644 --- a/content/common/throttling_url_loader_unittest.cc +++ b/content/common/throttling_url_loader_unittest.cc
@@ -212,8 +212,7 @@ request.url = GURL("http://example.org"); loader_ = ThrottlingURLLoader::CreateLoaderAndStart( factory_.factory_ptr().get(), std::move(throttles_), 0, 0, 0, request, - &client_, - net::MutableNetworkTrafficAnnotationTag(TRAFFIC_ANNOTATION_FOR_TESTS)); + &client_, TRAFFIC_ANNOTATION_FOR_TESTS); factory_.factory_ptr().FlushForTesting(); }
diff --git a/content/public/android/java/src/org/chromium/content/browser/accessibility/LollipopWebContentsAccessibility.java b/content/public/android/java/src/org/chromium/content/browser/accessibility/LollipopWebContentsAccessibility.java index 75cb232..79d285f 100644 --- a/content/public/android/java/src/org/chromium/content/browser/accessibility/LollipopWebContentsAccessibility.java +++ b/content/public/android/java/src/org/chromium/content/browser/accessibility/LollipopWebContentsAccessibility.java
@@ -41,9 +41,6 @@ super(context, containerView, webContents, renderCoordinates, shouldFocusOnPageLoad); // Cache the system language and set up a listener for when it changes. - // TODO(dmazzoni): the try/catch is because this fails in AndroidWebView - // sometimes. Is there a different context we can use or is this just not - // always possible depending on the app permissions? http://crbug.com/732933 try { IntentFilter filter = new IntentFilter(Intent.ACTION_LOCALE_CHANGED); context.registerReceiver(new BroadcastReceiver() { @@ -53,6 +50,8 @@ } }, filter); } catch (ReceiverCallNotAllowedException e) { + // WebView may be running inside a BroadcastReceiver, in which case registerReceiver is + // not allowed. } mSystemLanguageTag = Locale.getDefault().toLanguageTag(); }
diff --git a/content/public/android/java/src/org/chromium/content/browser/framehost/RenderFrameHostDelegate.java b/content/public/android/java/src/org/chromium/content/browser/framehost/RenderFrameHostDelegate.java index 215527e..236fd87b 100644 --- a/content/public/android/java/src/org/chromium/content/browser/framehost/RenderFrameHostDelegate.java +++ b/content/public/android/java/src/org/chromium/content/browser/framehost/RenderFrameHostDelegate.java
@@ -8,4 +8,8 @@ * The RenderFrameHost Java wrapper to allow communicating with the native RenderFrameHost object. * */ -public interface RenderFrameHostDelegate {} +public interface RenderFrameHostDelegate { + // Mirrors callbacks for native RenderFrameHostDelegate. + void renderFrameCreated(RenderFrameHostImpl host); + void renderFrameDeleted(RenderFrameHostImpl host); +}
diff --git a/content/public/android/java/src/org/chromium/content/browser/framehost/RenderFrameHostImpl.java b/content/public/android/java/src/org/chromium/content/browser/framehost/RenderFrameHostImpl.java index f477ad0..4fc61b9 100644 --- a/content/public/android/java/src/org/chromium/content/browser/framehost/RenderFrameHostImpl.java +++ b/content/public/android/java/src/org/chromium/content/browser/framehost/RenderFrameHostImpl.java
@@ -32,6 +32,8 @@ new InterfaceProvider(CoreImpl.getInstance() .acquireNativeHandle(nativeInterfaceProviderHandle) .toMessagePipeHandle()); + + mDelegate.renderFrameCreated(this); } @CalledByNative @@ -45,6 +47,7 @@ @CalledByNative private void clearNativePtr() { mNativeRenderFrameHostAndroid = 0; + mDelegate.renderFrameDeleted(this); } /**
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java b/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java index 0dc13ed..de5b64a0a 100644 --- a/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java +++ b/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
@@ -31,6 +31,7 @@ import org.chromium.base.VisibleForTesting; import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; +import org.chromium.blink_public.web.WebFocusType; import org.chromium.blink_public.web.WebInputEventModifier; import org.chromium.blink_public.web.WebInputEventType; import org.chromium.blink_public.web.WebTextInputMode; @@ -633,18 +634,32 @@ boolean performEditorAction(int actionCode) { if (!isValid()) return false; - if (actionCode == EditorInfo.IME_ACTION_NEXT) { - sendSyntheticKeyPress(KeyEvent.KEYCODE_TAB, - KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE - | KeyEvent.FLAG_EDITOR_ACTION); - } else { - sendSyntheticKeyPress(KeyEvent.KEYCODE_ENTER, - KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE - | KeyEvent.FLAG_EDITOR_ACTION); + switch (actionCode) { + case EditorInfo.IME_ACTION_NEXT: + advanceFocusInForm(WebFocusType.FORWARD); + break; + case EditorInfo.IME_ACTION_PREVIOUS: + advanceFocusInForm(WebFocusType.BACKWARD); + break; + default: + sendSyntheticKeyPress(KeyEvent.KEYCODE_ENTER, + KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE + | KeyEvent.FLAG_EDITOR_ACTION); + break; } return true; } + /** + * Advances the focus to next input field in the current form. + * + * @param focusType indicates whether to advance forward or backward direction. + */ + private void advanceFocusInForm(int focusType) { + if (mNativeImeAdapterAndroid == 0) return; + nativeAdvanceFocusInForm(mNativeImeAdapterAndroid, focusType); + } + void notifyUserAction() { mInputMethodManagerWrapper.notifyUserAction(); } @@ -920,4 +935,5 @@ private native boolean nativeRequestTextInputStateUpdate(long nativeImeAdapterAndroid); private native void nativeRequestCursorUpdate(long nativeImeAdapterAndroid, boolean immediateRequest, boolean monitorRequest); + private native void nativeAdvanceFocusInForm(long nativeImeAdapterAndroid, int focusType); }
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java b/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java index dc171af0..8ef905d6 100644 --- a/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java +++ b/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java
@@ -48,7 +48,6 @@ if (inputMode == WebTextInputMode.DEFAULT) { if (inputType == TextInputType.TEXT) { // Normal text field - imeAction = EditorInfo.IME_ACTION_GO; if ((inputFlags & WebTextInputFlags.AUTOCORRECT_OFF) == 0) { outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT; } @@ -58,33 +57,25 @@ if ((inputFlags & WebTextInputFlags.AUTOCORRECT_OFF) == 0) { outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT; } - imeAction = EditorInfo.IME_ACTION_NONE; } else if (inputType == TextInputType.PASSWORD) { outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD; - imeAction = EditorInfo.IME_ACTION_GO; - } else if (inputType == TextInputType.SEARCH) { - imeAction = EditorInfo.IME_ACTION_SEARCH; } else if (inputType == TextInputType.URL) { outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI; - imeAction = EditorInfo.IME_ACTION_GO; } else if (inputType == TextInputType.EMAIL) { // Email outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS; - imeAction = EditorInfo.IME_ACTION_GO; } else if (inputType == TextInputType.TELEPHONE) { // Telephone // Number and telephone do not have both a Tab key and an // action in default OSK, so set the action to NEXT outAttrs.inputType = InputType.TYPE_CLASS_PHONE; - imeAction = EditorInfo.IME_ACTION_NEXT; } else if (inputType == TextInputType.NUMBER) { // Number outAttrs.inputType = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_NORMAL | InputType.TYPE_NUMBER_FLAG_DECIMAL; - imeAction = EditorInfo.IME_ACTION_NEXT; } } else { switch (inputMode) { @@ -102,31 +93,41 @@ if ((inputFlags & WebTextInputFlags.AUTOCORRECT_OFF) == 0) { outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT; } - imeAction = EditorInfo.IME_ACTION_NONE; break; case WebTextInputMode.NUMERIC: outAttrs.inputType = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_NORMAL; - imeAction = EditorInfo.IME_ACTION_NEXT; break; case WebTextInputMode.TEL: outAttrs.inputType = InputType.TYPE_CLASS_PHONE; - imeAction = EditorInfo.IME_ACTION_NEXT; break; case WebTextInputMode.EMAIL: outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS; - imeAction = EditorInfo.IME_ACTION_GO; break; case WebTextInputMode.URL: outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI; - imeAction = EditorInfo.IME_ACTION_NEXT; break; } } + if (inputMode == WebTextInputMode.DEFAULT && inputType == TextInputType.SEARCH) { + imeAction |= EditorInfo.IME_ACTION_SEARCH; + } else if ((outAttrs.inputType & EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE) != 0) { + // For textarea that sends you to another webpage on enter key press using + // JavaScript, we will only show ENTER. + imeAction |= EditorInfo.IME_ACTION_NONE; + } else if ((inputFlags & WebTextInputFlags.HAVE_NEXT_FOCUSABLE_ELEMENT) != 0) { + imeAction |= EditorInfo.IME_ACTION_NEXT; + } else { + // For last element inside form, we should give preference to GO key as PREVIOUS + // has less importance in those cases. + imeAction |= EditorInfo.IME_ACTION_GO; + } + outAttrs.imeOptions |= imeAction; + // Handling of autocapitalize. Blink will send the flag taking into account the element's // type. This is not using AutocapitalizeNone because Android does not autocapitalize by // default and there is no way to express no capitalization.
diff --git a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java index 57b60f42..f7b899e9 100644 --- a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java +++ b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
@@ -22,6 +22,7 @@ import org.chromium.content.browser.MediaSessionImpl; import org.chromium.content.browser.RenderCoordinates; import org.chromium.content.browser.framehost.RenderFrameHostDelegate; +import org.chromium.content.browser.framehost.RenderFrameHostImpl; import org.chromium.content_public.browser.AccessibilitySnapshotCallback; import org.chromium.content_public.browser.AccessibilitySnapshotNode; import org.chromium.content_public.browser.ContentBitmapCallback; @@ -95,9 +96,13 @@ } }; + // Note this list may be incomplete. Frames that never had to initialize java side would + // not have an entry here. This is here mainly to keep the java RenderFrameHosts alive, since + // native side generally cannot safely hold strong references to them. + private final List<RenderFrameHostImpl> mFrames = new ArrayList<>(); + private long mNativeWebContentsAndroid; private NavigationController mNavigationController; - private RenderFrameHost mMainFrame; // Lazily created proxy observer for handling all Java-based WebContentsObservers. private WebContentsObserverProxy mObserverProxy; @@ -157,6 +162,20 @@ } } + // =================== RenderFrameHostDelegate overrides =================== + @Override + public void renderFrameCreated(RenderFrameHostImpl host) { + assert !mFrames.contains(host); + mFrames.add(host); + } + + @Override + public void renderFrameDeleted(RenderFrameHostImpl host) { + assert mFrames.contains(host); + mFrames.remove(host); + } + // ================= end RenderFrameHostDelegate overrides ================= + @Override public int describeContents() { return 0; @@ -204,10 +223,7 @@ @Override public RenderFrameHost getMainFrame() { - if (mMainFrame == null) { - mMainFrame = nativeGetMainFrame(mNativeWebContentsAndroid); - } - return mMainFrame; + return nativeGetMainFrame(mNativeWebContentsAndroid); } @Override
diff --git a/content/public/app/mojo/content_browser_manifest.json b/content/public/app/mojo/content_browser_manifest.json index a69ac433..989f45a 100644 --- a/content/public/app/mojo/content_browser_manifest.json +++ b/content/public/app/mojo/content_browser_manifest.json
@@ -43,6 +43,7 @@ "payments::mojom::PaymentManager", "shape_detection::mojom::BarcodeDetection", "shape_detection::mojom::FaceDetectionProvider", + "resource_coordinator::mojom::CoordinationUnit", "shape_detection::mojom::TextDetection", "ui::mojom::Gpu" ], @@ -116,12 +117,14 @@ "media::mojom::RemoterFactory", "media::mojom::Renderer", "mojom::MediaDevicesDispatcherHost", + "payments::mojom::PaymentManager", "payments::mojom::PaymentRequest", "resource_coordinator::mojom::CoordinationUnit", "shape_detection::mojom::BarcodeDetection", "shape_detection::mojom::FaceDetectionProvider", "shape_detection::mojom::TextDetection", - "ui::mojom::Gpu" + "ui::mojom::Gpu", + "webauth::mojom::Authenticator" ] }, "requires": {
diff --git a/content/public/browser/overscroll_configuration.h b/content/public/browser/overscroll_configuration.h index 171385f..369ae7d 100644 --- a/content/public/browser/overscroll_configuration.h +++ b/content/public/browser/overscroll_configuration.h
@@ -12,14 +12,25 @@ // Sets and retrieves various overscroll related configuration values. enum OverscrollConfig { OVERSCROLL_CONFIG_NONE, + + // Threshold to complete horizontal overscroll. For touchpad, it represents + // the percentage of the display width. For touchscreen, it represents the + // percentage of the window width. OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE, + + // Threshold to complete vertical overscroll. For touchpad, it represents the + // percentage of the display width. For touchscreen, it represents the + // percentage of the window width. OVERSCROLL_CONFIG_VERT_THRESHOLD_COMPLETE, + + // Threshold to start horizontal touchpad overscroll, in DIPs. OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHPAD, + + // Threshold to start horizontal touchscreen overscroll, in DIPs. OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHSCREEN, + + // Threshold to start vertical overscroll, in DIPs. OVERSCROLL_CONFIG_VERT_THRESHOLD_START, - OVERSCROLL_CONFIG_HORIZ_RESIST_AFTER, - OVERSCROLL_CONFIG_VERT_RESIST_AFTER, - OVERSCROLL_CONFIG_COUNT }; CONTENT_EXPORT float GetOverscrollConfig(OverscrollConfig config);
diff --git a/content/public/browser/push_messaging_service.h b/content/public/browser/push_messaging_service.h index 42cb5d2..3ca8ec5e 100644 --- a/content/public/browser/push_messaging_service.h +++ b/content/public/browser/push_messaging_service.h
@@ -104,6 +104,10 @@ const GURL& origin, int64_t service_worker_registration_id) = 0; + // Unsubscribes all existing push subscriptions because the Service Worker + // database has been deleted. + virtual void DidDeleteServiceWorkerDatabase() = 0; + protected: static void GetSenderId(BrowserContext* browser_context, const GURL& origin,
diff --git a/content/public/browser/service_worker_context.h b/content/public/browser/service_worker_context.h index 9a9aa0a..5a105ad 100644 --- a/content/public/browser/service_worker_context.h +++ b/content/public/browser/service_worker_context.h
@@ -58,6 +58,9 @@ using StartServiceWorkerForNavigationHintCallback = base::Callback<void(StartServiceWorkerForNavigationHintResult result)>; + using StartActiveWorkerCallback = + base::OnceCallback<void(int process_id, int thread_id)>; + // Registers the header name which should not be passed to the ServiceWorker. // Must be called from the IO thread. CONTENT_EXPORT static void AddExcludedHeadersForFetchEvent( @@ -107,6 +110,15 @@ virtual bool FinishedExternalRequest(int64_t service_worker_version_id, const std::string& request_uuid) = 0; + // Starts the active worker of the registration whose scope is |pattern|. + // |info_callback| is passed the worker's render process id and thread id. + // + // Must be called on IO thread. + virtual void StartActiveWorkerForPattern( + const GURL& pattern, + StartActiveWorkerCallback info_callback, + base::OnceClosure failure_callback) = 0; + // Equivalent to calling navigator.serviceWorker.unregister(pattern) from a // renderer, except that |pattern| is an absolute URL instead of relative to // some current origin. |callback| is passed true when the JS promise is
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h index 78cd763..5881c95 100644 --- a/content/public/browser/web_contents.h +++ b/content/public/browser/web_contents.h
@@ -593,7 +593,7 @@ // Saves the given frame's URL to the local filesystem. The headers, if // provided, is used to make a request to the URL rather than using cache. // Format of |headers| is a new line separated list of key value pairs: - // "<key1>: <value1>\n<key2>: <value2>". + // "<key1>: <value1>\r\n<key2>: <value2>". virtual void SaveFrameWithHeaders(const GURL& url, const Referrer& referrer, const std::string& headers) = 0; @@ -831,6 +831,9 @@ // Returns true if other views are allowed, false otherwise. virtual bool GetAllowOtherViews() = 0; + + // Returns true if the WebContents has completed its first meaningful paint. + virtual bool CompletedFirstVisuallyNonEmptyPaint() const = 0; #endif // OS_ANDROID private:
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index 5baebb3..f26cb21 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -135,11 +135,6 @@ const base::Feature kLoadingWithMojo{"LoadingWithMojo", base::FEATURE_DISABLED_BY_DEFAULT}; -// Experimental feature to trigger hard-reload on Location.reload(). -// crbug.com/716339 -const base::Feature kLocationHardReload{"LocationHardReload", - base::FEATURE_DISABLED_BY_DEFAULT}; - // FeatureList definition for trials to enable the download button on // MediaDocument. const base::Feature kMediaDocumentDownloadButton{ @@ -178,6 +173,10 @@ const base::Feature kMojoInputMessages{"MojoInputMessages", base::FEATURE_DISABLED_BY_DEFAULT}; +// ES6 Modules. +const base::Feature kModuleScripts{"ModuleScripts", + base::FEATURE_ENABLED_BY_DEFAULT}; + // Experimental resource fetch optimizations for workers. See crbug.com/443374 const base::Feature kOffMainThreadFetch{"OffMainThreadFetch", base::FEATURE_DISABLED_BY_DEFAULT}; @@ -318,6 +317,11 @@ const base::Feature kWebAssemblyTrapHandler{"WebAssemblyTrapHandler", base::FEATURE_DISABLED_BY_DEFAULT}; +// Controls whether the WebAuthentication API is enabled: +// https://w3c.github.io/webauthn +const base::Feature kWebAuth{"WebAuthentication", + base::FEATURE_DISABLED_BY_DEFAULT}; + // If WebGL Image Chromium is allowed, this feature controls whether it is // enabled. const base::Feature kWebGLImageChromium{"WebGLImageChromium",
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index 0417803..a198457 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h
@@ -43,7 +43,6 @@ CONTENT_EXPORT extern const base::Feature kIdleTimeSpellChecking; CONTENT_EXPORT extern const base::Feature kLazyParseCSS; CONTENT_EXPORT extern const base::Feature kLoadingWithMojo; -CONTENT_EXPORT extern const base::Feature kLocationHardReload; CONTENT_EXPORT extern const base::Feature kMediaDocumentDownloadButton; CONTENT_EXPORT extern const base::Feature kMediaStreamOldAudioConstraints; CONTENT_EXPORT extern const base::Feature kMediaStreamOldVideoConstraints; @@ -52,6 +51,7 @@ CONTENT_EXPORT extern const base::Feature kMainThreadBusyScrollIntervention; CONTENT_EXPORT extern const base::Feature kMojoBlobs; CONTENT_EXPORT extern const base::Feature kMojoInputMessages; +CONTENT_EXPORT extern const base::Feature kModuleScripts; CONTENT_EXPORT extern const base::Feature kOffMainThreadFetch; CONTENT_EXPORT extern const base::Feature kOriginTrials; CONTENT_EXPORT extern const base::Feature kParallelDownloading; @@ -81,6 +81,7 @@ CONTENT_EXPORT extern const base::Feature kWebAssembly; CONTENT_EXPORT extern const base::Feature kWebAssemblyStreaming; CONTENT_EXPORT extern const base::Feature kWebAssemblyTrapHandler; +CONTENT_EXPORT extern const base::Feature kWebAuth; CONTENT_EXPORT extern const base::Feature kWebGLImageChromium; CONTENT_EXPORT extern const base::Feature kWebPayments; CONTENT_EXPORT extern const base::Feature kWebRtcEcdsaDefault;
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index 937e555d..d54c4c1 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h
@@ -274,7 +274,6 @@ CONTENT_EXPORT extern const char kDisableScreenOrientationLock[]; CONTENT_EXPORT extern const char kEnableAdaptiveSelectionHandleOrientation[]; CONTENT_EXPORT extern const char kEnableLongpressDragSelection[]; -CONTENT_EXPORT extern const char kHideScrollbars[]; extern const char kNetworkCountryIso[]; CONTENT_EXPORT extern const char kProgressBarCompletion[]; CONTENT_EXPORT extern const char kRemoteDebuggingSocketName[];
diff --git a/content/public/common/push_messaging_status.h b/content/public/common/push_messaging_status.h index b160951f..64d0418 100644 --- a/content/public/common/push_messaging_status.h +++ b/content/public/common/push_messaging_status.h
@@ -110,13 +110,16 @@ // Website called getSubscription API and the stored subscription was corrupt. PUSH_UNREGISTRATION_REASON_GET_SUBSCRIPTION_STORAGE_CORRUPT = 9, + // The Service Worker database got wiped, most likely due to corruption. + PUSH_UNREGISTRATION_REASON_SERVICE_WORKER_DATABASE_WIPED = 10, + // NOTE: Do not renumber these as that would confuse interpretation of // previously logged data. When making changes, also update the enum list // in tools/metrics/histograms/histograms.xml to keep it in sync, and // update PUSH_UNREGISTRATION_REASON_LAST below. PUSH_UNREGISTRATION_REASON_LAST = - PUSH_UNREGISTRATION_REASON_GET_SUBSCRIPTION_STORAGE_CORRUPT + PUSH_UNREGISTRATION_REASON_SERVICE_WORKER_DATABASE_WIPED }; // Push unregistration success/error codes for internal use & reporting in UMA.
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h index 1b09c28..9246fd8 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h
@@ -346,14 +346,16 @@ virtual void DidInitializeServiceWorkerContextOnWorkerThread( v8::Local<v8::Context> context, int64_t service_worker_version_id, - const GURL& url) {} + const GURL& service_worker_scope, + const GURL& script_url) {} // Notifies that a service worker context will be destroyed. This function // is called from the worker thread. virtual void WillDestroyServiceWorkerContextOnWorkerThread( v8::Local<v8::Context> context, int64_t service_worker_version_id, - const GURL& url) {} + const GURL& service_worker_scope, + const GURL& script_url) {} // Whether this renderer should enforce preferences related to the WebRTC // routing logic, i.e. allowing multiple routes and non-proxied UDP.
diff --git a/content/public/test/navigation_simulator.cc b/content/public/test/navigation_simulator.cc index 06dc98a..6867290 100644 --- a/content/public/test/navigation_simulator.cc +++ b/content/public/test/navigation_simulator.cc
@@ -207,7 +207,7 @@ handle_->WillRedirectRequest( new_url, "GET", referrer_.url, false /* is_external_protocol */, scoped_refptr<net::HttpResponseHeaders>(), - net::HttpResponseInfo::ConnectionInfo(), + net::HttpResponseInfo::ConnectionInfo(), nullptr, base::Callback<void(NavigationThrottle::ThrottleCheckResult)>()); }
diff --git a/content/public/test/service_worker_test_helpers.cc b/content/public/test/service_worker_test_helpers.cc new file mode 100644 index 0000000..9bba338 --- /dev/null +++ b/content/public/test/service_worker_test_helpers.cc
@@ -0,0 +1,107 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/public/test/service_worker_test_helpers.h" + +#include "base/bind.h" +#include "base/run_loop.h" +#include "content/browser/service_worker/service_worker_context_core_observer.h" +#include "content/browser/service_worker/service_worker_context_wrapper.h" +#include "content/public/browser/browser_thread.h" +#include "url/gurl.h" + +namespace content { + +namespace { + +class StoppedObserver : public base::RefCountedThreadSafe<StoppedObserver> { + public: + StoppedObserver(ServiceWorkerContextWrapper* context, + int64_t service_worker_version_id, + base::OnceClosure completion_callback_ui) + : inner_observer_(context, + service_worker_version_id, + // Adds a ref to StoppedObserver to keep |this| around + // until the worker is stopped. + base::BindOnce(&StoppedObserver::OnStopped, this)), + completion_callback_ui_(std::move(completion_callback_ui)) {} + + private: + friend class base::RefCountedThreadSafe<StoppedObserver>; + ~StoppedObserver() {} + class Observer : public ServiceWorkerContextCoreObserver { + public: + Observer(ServiceWorkerContextWrapper* context, + int64_t service_worker_version_id, + base::OnceClosure stopped_callback) + : context_(context), + version_id_(service_worker_version_id), + stopped_callback_(std::move(stopped_callback)) { + context_->AddObserver(this); + } + + // ServiceWorkerContextCoreObserver: + void OnRunningStateChanged(int64_t version_id, + EmbeddedWorkerStatus status) override { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + if (version_id != version_id_ || status != EmbeddedWorkerStatus::STOPPED) + return; + std::move(stopped_callback_).Run(); + } + ~Observer() override { context_->RemoveObserver(this); } + + private: + ServiceWorkerContextWrapper* const context_; + int64_t version_id_; + base::OnceClosure stopped_callback_; + }; + + void OnStopped() { + if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + base::Bind(&StoppedObserver::OnStopped, this)); + return; + } + std::move(completion_callback_ui_).Run(); + } + + Observer inner_observer_; + base::OnceClosure completion_callback_ui_; + + DISALLOW_COPY_AND_ASSIGN(StoppedObserver); +}; + +void FoundReadyRegistration( + ServiceWorkerContextWrapper* context_wrapper, + base::OnceClosure completion_callback, + ServiceWorkerStatusCode service_worker_status, + scoped_refptr<ServiceWorkerRegistration> service_worker_registration) { + DCHECK_EQ(SERVICE_WORKER_OK, service_worker_status); + int64_t version_id = + service_worker_registration->active_version()->version_id(); + scoped_refptr<StoppedObserver> observer(new StoppedObserver( + context_wrapper, version_id, std::move(completion_callback))); + service_worker_registration->active_version()->embedded_worker()->Stop(); +} + +} // namespace + +void StopServiceWorkerForPattern(ServiceWorkerContext* context, + const GURL& pattern, + base::OnceClosure completion_callback_ui) { + if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, + base::Bind(&StopServiceWorkerForPattern, context, pattern, + base::Passed(&completion_callback_ui))); + return; + } + auto* context_wrapper = static_cast<ServiceWorkerContextWrapper*>(context); + context_wrapper->FindReadyRegistrationForPattern( + pattern, + base::Bind(&FoundReadyRegistration, base::RetainedRef(context_wrapper), + base::Passed(&completion_callback_ui))); +} + +} // namespace content
diff --git a/content/public/test/service_worker_test_helpers.h b/content/public/test/service_worker_test_helpers.h new file mode 100644 index 0000000..754d8b1 --- /dev/null +++ b/content/public/test/service_worker_test_helpers.h
@@ -0,0 +1,25 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_PUBLIC_TEST_SERVICE_WORKER_TEST_OBSERVER_H_ +#define CONTENT_PUBLIC_TEST_SERVICE_WORKER_TEST_OBSERVER_H_ + +#include "base/callback_forward.h" + +class GURL; +namespace content { + +class ServiceWorkerContext; + +// Stops the active service worker of the registration whose scope is |pattern|, +// and calls |complete_callback_ui| callback on UI thread when done. +// +// Can be called from UI/IO thread. +void StopServiceWorkerForPattern(ServiceWorkerContext* context, + const GURL& pattern, + base::OnceClosure complete_callback_ui); + +} // namespace content + +#endif // CONTENT_PUBLIC_TEST_SERVICE_WORKER_TEST_OBSERVER_H_
diff --git a/content/public/test/test_launcher.cc b/content/public/test/test_launcher.cc index 0242819..5dd549a 100644 --- a/content/public/test/test_launcher.cc +++ b/content/public/test/test_launcher.cc
@@ -481,7 +481,7 @@ } int LaunchTests(TestLauncherDelegate* launcher_delegate, - int default_jobs, + size_t parallel_jobs, int argc, char** argv) { DCHECK(!g_launcher_delegate); @@ -546,11 +546,8 @@ launcher_delegate->PreSharding(); - // Allow the |launcher_delegate| to modify |default_jobs|. - launcher_delegate->AdjustDefaultParallelJobs(&default_jobs); - WrapperTestLauncherDelegate delegate(launcher_delegate); - base::TestLauncher launcher(&delegate, default_jobs); + base::TestLauncher launcher(&delegate, parallel_jobs); const int result = launcher.Run() ? 0 : 1; launcher_delegate->OnDoneRunningTests(); return result;
diff --git a/content/public/test/test_launcher.h b/content/public/test/test_launcher.h index 7acd1149..7a0adc4 100644 --- a/content/public/test/test_launcher.h +++ b/content/public/test/test_launcher.h
@@ -62,10 +62,6 @@ // jobs. virtual void PreSharding() {} - // Allows a TestLauncherDelegate to adjust the number of |default_jobs| used - // when --test-launcher-jobs isn't specified on the command-line. - virtual void AdjustDefaultParallelJobs(int* default_jobs) {} - // Called prior to returning from LaunchTests(). Gives the delegate a chance // to do cleanup before state created by TestLauncher has been destroyed (such // as the AtExitManager). @@ -75,11 +71,10 @@ virtual ~TestLauncherDelegate(); }; -// Launches tests using |launcher_delegate|. |default_jobs| is number -// of test jobs to be run in parallel, unless overridden from the command line. -// Returns exit code. +// Launches tests using |launcher_delegate|. |parallel_jobs| is the number +// of test jobs to be run in parallel. int LaunchTests(TestLauncherDelegate* launcher_delegate, - int default_jobs, + size_t parallel_jobs, int argc, char** argv) WARN_UNUSED_RESULT;
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn index adcf1fcb..a5add9a 100644 --- a/content/renderer/BUILD.gn +++ b/content/renderer/BUILD.gn
@@ -362,6 +362,8 @@ "service_worker/service_worker_type_converters.h", "service_worker/service_worker_type_util.cc", "service_worker/service_worker_type_util.h", + "service_worker/web_service_worker_installed_scripts_manager_impl.cc", + "service_worker/web_service_worker_installed_scripts_manager_impl.h", "service_worker/worker_fetch_context_impl.cc", "service_worker/worker_fetch_context_impl.h", "shared_memory_seqlock_reader.cc", @@ -768,7 +770,6 @@ "//third_party/webrtc/api:video_frame_api", "//third_party/webrtc/api/audio_codecs:builtin_audio_decoder_factory", "//third_party/webrtc/api/audio_codecs:builtin_audio_encoder_factory", - "//third_party/webrtc/base:rtc_base", "//third_party/webrtc/media:rtc_media", "//third_party/webrtc/media:rtc_media_base", "//third_party/webrtc/modules/audio_device", @@ -777,6 +778,7 @@ "//third_party/webrtc/p2p:libstunprober", "//third_party/webrtc/p2p:rtc_p2p", "//third_party/webrtc/pc:rtc_pc", + "//third_party/webrtc/rtc_base:rtc_base", "//third_party/webrtc/stats", "//third_party/webrtc/system_wrappers", "//third_party/webrtc_overrides:init_webrtc",
diff --git a/content/renderer/input/render_widget_input_handler.cc b/content/renderer/input/render_widget_input_handler.cc index 36e63db..fc226d9 100644 --- a/content/renderer/input/render_widget_input_handler.cc +++ b/content/renderer/input/render_widget_input_handler.cc
@@ -11,7 +11,6 @@ #include "base/auto_reset.h" #include "base/command_line.h" #include "base/metrics/histogram_macros.h" -#include "base/trace_event/trace_event_synthetic_delay.h" #include "build/build_config.h" #include "cc/trees/swap_promise_monitor.h" #include "content/common/input/input_event_ack.h" @@ -234,7 +233,6 @@ TRACE_EVENT1("renderer,benchmark,rail", "RenderWidgetInputHandler::OnHandleInputEvent", "event", WebInputEvent::GetName(input_event.GetType())); - TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("blink.HandleInputEvent"); TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow", TRACE_ID_DONT_MANGLE(latency_info.trace_id()), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, @@ -389,7 +387,6 @@ } } - TRACE_EVENT_SYNTHETIC_DELAY_END("blink.HandleInputEvent"); if (callback) { std::move(callback).Run(ack_result, swap_latency_info, std::move(event_overscroll));
diff --git a/content/renderer/media/gpu/rtc_video_decoder.cc b/content/renderer/media/gpu/rtc_video_decoder.cc index 6df6c23..2ef157ba 100644 --- a/content/renderer/media/gpu/rtc_video_decoder.cc +++ b/content/renderer/media/gpu/rtc_video_decoder.cc
@@ -19,9 +19,9 @@ #include "media/renderers/gpu_video_accelerator_factories.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/webrtc/api/video/video_frame.h" -#include "third_party/webrtc/base/bind.h" -#include "third_party/webrtc/base/refcount.h" #include "third_party/webrtc/modules/video_coding/codecs/h264/include/h264.h" +#include "third_party/webrtc/rtc_base/bind.h" +#include "third_party/webrtc/rtc_base/refcount.h" #if defined(OS_WIN) #include "base/command_line.h"
diff --git a/content/renderer/media/gpu/rtc_video_encoder.cc b/content/renderer/media/gpu/rtc_video_encoder.cc index f3b1bdd..2185d7e 100644 --- a/content/renderer/media/gpu/rtc_video_encoder.cc +++ b/content/renderer/media/gpu/rtc_video_encoder.cc
@@ -31,7 +31,7 @@ #include "media/renderers/gpu_video_accelerator_factories.h" #include "media/video/video_encode_accelerator.h" #include "third_party/libyuv/include/libyuv.h" -#include "third_party/webrtc/base/timeutils.h" +#include "third_party/webrtc/rtc_base/timeutils.h" namespace content {
diff --git a/content/renderer/media/media_stream_constraints_util.h b/content/renderer/media/media_stream_constraints_util.h index 4c238a5..33d5071 100644 --- a/content/renderer/media/media_stream_constraints_util.h +++ b/content/renderer/media/media_stream_constraints_util.h
@@ -14,7 +14,7 @@ #include "content/renderer/media/video_track_adapter.h" #include "media/capture/video_capture_types.h" #include "third_party/WebKit/public/platform/WebMediaConstraints.h" -#include "third_party/webrtc/base/optional.h" +#include "third_party/webrtc/rtc_base/optional.h" namespace content {
diff --git a/content/renderer/media/media_stream_constraints_util_audio_unittest.cc b/content/renderer/media/media_stream_constraints_util_audio_unittest.cc index 73fa230..0b3ad17 100644 --- a/content/renderer/media/media_stream_constraints_util_audio_unittest.cc +++ b/content/renderer/media/media_stream_constraints_util_audio_unittest.cc
@@ -773,7 +773,10 @@ auto result = SelectSettings(); EXPECT_TRUE(result.HasValue()); CheckDeviceDefaults(result); - CheckBoolDefaults({&AudioCaptureSettings::render_to_associated_sink}, + // TODO(crbug.com/736309): Fold this local when clang is fixed. + auto render_to_associated_sink = + &AudioCaptureSettings::render_to_associated_sink; + CheckBoolDefaults({render_to_associated_sink}, {&AudioProcessingProperties::goog_audio_mirroring}, result); CheckGeometryDefaults(result); EXPECT_TRUE(result.render_to_associated_sink()); @@ -794,7 +797,9 @@ EXPECT_TRUE(result.HasValue()); CheckDeviceDefaults(result); EXPECT_FALSE(result.hotword_enabled()); - CheckBoolDefaults({&AudioCaptureSettings::hotword_enabled}, + // TODO(crbug.com/736309): Fold this local when clang is fixed. + auto hotword_enabled = &AudioCaptureSettings::hotword_enabled; + CheckBoolDefaults({hotword_enabled}, {&AudioProcessingProperties::goog_audio_mirroring, &AudioProcessingProperties::goog_highpass_filter}, result); @@ -814,7 +819,9 @@ auto result = SelectSettings(); EXPECT_TRUE(result.HasValue()); CheckDeviceDefaults(result); - CheckBoolDefaults({&AudioCaptureSettings::hotword_enabled}, + // TODO(crbug.com/736309): Fold this local when clang is fixed. + auto hotword_enabled = &AudioCaptureSettings::hotword_enabled; + CheckBoolDefaults({hotword_enabled}, {&AudioProcessingProperties::goog_audio_mirroring, &AudioProcessingProperties::goog_highpass_filter}, result);
diff --git a/content/renderer/media/media_stream_constraints_util_video_content.h b/content/renderer/media/media_stream_constraints_util_video_content.h index 8ef6ccf..b0c0509 100644 --- a/content/renderer/media/media_stream_constraints_util_video_content.h +++ b/content/renderer/media/media_stream_constraints_util_video_content.h
@@ -9,7 +9,7 @@ #include "content/common/content_export.h" #include "content/renderer/media/media_stream_constraints_util.h" -#include "third_party/webrtc/base/optional.h" +#include "third_party/webrtc/rtc_base/optional.h" namespace blink { class WebMediaConstraints;
diff --git a/content/renderer/media/mock_peer_connection_impl.cc b/content/renderer/media/mock_peer_connection_impl.cc index 12c4ff4..a962a4a 100644 --- a/content/renderer/media/mock_peer_connection_impl.cc +++ b/content/renderer/media/mock_peer_connection_impl.cc
@@ -12,7 +12,7 @@ #include "content/renderer/media/mock_data_channel_impl.h" #include "content/renderer/media/webrtc/mock_peer_connection_dependency_factory.h" #include "third_party/webrtc/api/rtpreceiverinterface.h" -#include "third_party/webrtc/base/refcountedobject.h" +#include "third_party/webrtc/rtc_base/refcountedobject.h" using testing::_; using webrtc::AudioTrackInterface;
diff --git a/content/renderer/media/rtc_certificate.cc b/content/renderer/media/rtc_certificate.cc index de998bf..afddd0f 100644 --- a/content/renderer/media/rtc_certificate.cc +++ b/content/renderer/media/rtc_certificate.cc
@@ -8,7 +8,7 @@ #include "base/memory/ptr_util.h" #include "base/strings/string_util.h" -#include "third_party/webrtc/base/sslidentity.h" +#include "third_party/webrtc/rtc_base/sslidentity.h" #include "url/gurl.h" namespace content {
diff --git a/content/renderer/media/rtc_certificate.h b/content/renderer/media/rtc_certificate.h index c62ed95..2da1ff0 100644 --- a/content/renderer/media/rtc_certificate.h +++ b/content/renderer/media/rtc_certificate.h
@@ -11,8 +11,8 @@ #include "base/macros.h" #include "content/common/content_export.h" #include "third_party/WebKit/public/platform/WebRTCCertificate.h" -#include "third_party/webrtc/base/rtccertificate.h" -#include "third_party/webrtc/base/scoped_ref_ptr.h" +#include "third_party/webrtc/rtc_base/rtccertificate.h" +#include "third_party/webrtc/rtc_base/scoped_ref_ptr.h" namespace content {
diff --git a/content/renderer/media/rtc_certificate_generator.cc b/content/renderer/media/rtc_certificate_generator.cc index ad1d7e5..7e52342c 100644 --- a/content/renderer/media/rtc_certificate_generator.cc +++ b/content/renderer/media/rtc_certificate_generator.cc
@@ -16,9 +16,9 @@ #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" #include "content/renderer/render_thread_impl.h" #include "media/media_features.h" -#include "third_party/webrtc/base/rtccertificate.h" -#include "third_party/webrtc/base/rtccertificategenerator.h" -#include "third_party/webrtc/base/scoped_ref_ptr.h" +#include "third_party/webrtc/rtc_base/rtccertificate.h" +#include "third_party/webrtc/rtc_base/rtccertificategenerator.h" +#include "third_party/webrtc/rtc_base/scoped_ref_ptr.h" #include "url/gurl.h" namespace content {
diff --git a/content/renderer/media/rtc_certificate_generator.h b/content/renderer/media/rtc_certificate_generator.h index 442e7ccf..f90344c 100644 --- a/content/renderer/media/rtc_certificate_generator.h +++ b/content/renderer/media/rtc_certificate_generator.h
@@ -9,7 +9,7 @@ #include "third_party/WebKit/public/platform/WebRTCCertificate.h" #include "third_party/WebKit/public/platform/WebRTCCertificateGenerator.h" #include "third_party/WebKit/public/platform/WebRTCKeyParams.h" -#include "third_party/webrtc/base/optional.h" +#include "third_party/webrtc/rtc_base/optional.h" namespace content {
diff --git a/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc b/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc index 6d395f14..0a0e5e2 100644 --- a/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc +++ b/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc
@@ -12,8 +12,8 @@ #include "content/renderer/media/webrtc/webrtc_video_capturer_adapter.h" #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" #include "third_party/webrtc/api/mediastreaminterface.h" -#include "third_party/webrtc/base/scoped_ref_ptr.h" #include "third_party/webrtc/media/base/videocapturer.h" +#include "third_party/webrtc/rtc_base/scoped_ref_ptr.h" using webrtc::AudioSourceInterface; using webrtc::AudioTrackInterface;
diff --git a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc index 8305daaa..38fa749 100644 --- a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc +++ b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
@@ -67,8 +67,8 @@ #include "third_party/webrtc/api/audio_codecs/builtin_audio_encoder_factory.h" #include "third_party/webrtc/api/mediaconstraintsinterface.h" #include "third_party/webrtc/api/videosourceproxy.h" -#include "third_party/webrtc/base/ssladapter.h" #include "third_party/webrtc/modules/video_coding/codecs/h264/include/h264.h" +#include "third_party/webrtc/rtc_base/ssladapter.h" #if defined(OS_ANDROID) #include "media/base/android/media_codec_util.h"
diff --git a/content/renderer/media/webrtc/rtc_rtp_contributing_source.cc b/content/renderer/media/webrtc/rtc_rtp_contributing_source.cc index b259b9c..1ed84f1 100644 --- a/content/renderer/media/webrtc/rtc_rtp_contributing_source.cc +++ b/content/renderer/media/webrtc/rtc_rtp_contributing_source.cc
@@ -6,7 +6,7 @@ #include "base/logging.h" #include "base/time/time.h" -#include "third_party/webrtc/base/scoped_ref_ptr.h" +#include "third_party/webrtc/rtc_base/scoped_ref_ptr.h" namespace content {
diff --git a/content/renderer/media/webrtc/rtc_rtp_receiver.cc b/content/renderer/media/webrtc/rtc_rtp_receiver.cc index 71fc802a..264bd35 100644 --- a/content/renderer/media/webrtc/rtc_rtp_receiver.cc +++ b/content/renderer/media/webrtc/rtc_rtp_receiver.cc
@@ -7,7 +7,7 @@ #include "base/logging.h" #include "base/memory/ptr_util.h" #include "content/renderer/media/webrtc/rtc_rtp_contributing_source.h" -#include "third_party/webrtc/base/scoped_ref_ptr.h" +#include "third_party/webrtc/rtc_base/scoped_ref_ptr.h" namespace content {
diff --git a/content/renderer/media/webrtc/rtc_rtp_sender.cc b/content/renderer/media/webrtc/rtc_rtp_sender.cc index e312e7f..26b15b8 100644 --- a/content/renderer/media/webrtc/rtc_rtp_sender.cc +++ b/content/renderer/media/webrtc/rtc_rtp_sender.cc
@@ -5,7 +5,7 @@ #include "content/renderer/media/webrtc/rtc_rtp_sender.h" #include "base/logging.h" -#include "third_party/webrtc/base/scoped_ref_ptr.h" +#include "third_party/webrtc/rtc_base/scoped_ref_ptr.h" namespace content {
diff --git a/content/renderer/media/webrtc/stun_field_trial.cc b/content/renderer/media/webrtc/stun_field_trial.cc index 89a2a1b9..b7d064c6 100644 --- a/content/renderer/media/webrtc/stun_field_trial.cc +++ b/content/renderer/media/webrtc/stun_field_trial.cc
@@ -16,13 +16,13 @@ #include "base/strings/string_split.h" #include "base/strings/stringprintf.h" #include "base/time/time.h" -#include "third_party/webrtc/base/asyncpacketsocket.h" -#include "third_party/webrtc/base/asyncresolverinterface.h" -#include "third_party/webrtc/base/ipaddress.h" -#include "third_party/webrtc/base/network.h" -#include "third_party/webrtc/base/socketaddress.h" -#include "third_party/webrtc/base/thread.h" #include "third_party/webrtc/p2p/base/packetsocketfactory.h" +#include "third_party/webrtc/rtc_base/asyncpacketsocket.h" +#include "third_party/webrtc/rtc_base/asyncresolverinterface.h" +#include "third_party/webrtc/rtc_base/ipaddress.h" +#include "third_party/webrtc/rtc_base/network.h" +#include "third_party/webrtc/rtc_base/socketaddress.h" +#include "third_party/webrtc/rtc_base/thread.h" using stunprober::StunProber;
diff --git a/content/renderer/media/webrtc/stun_field_trial.h b/content/renderer/media/webrtc/stun_field_trial.h index 79c9ec40..24c6dfc 100644 --- a/content/renderer/media/webrtc/stun_field_trial.h +++ b/content/renderer/media/webrtc/stun_field_trial.h
@@ -16,9 +16,9 @@ #include "content/common/content_export.h" #include "content/renderer/p2p/network_list_manager.h" #include "content/renderer/p2p/network_list_observer.h" -#include "third_party/webrtc/base/network.h" -#include "third_party/webrtc/base/sigslot.h" #include "third_party/webrtc/p2p/stunprober/stunprober.h" +#include "third_party/webrtc/rtc_base/network.h" +#include "third_party/webrtc/rtc_base/sigslot.h" namespace rtc { class PacketSocketFactory;
diff --git a/content/renderer/media/webrtc/stun_field_trial_unittest.cc b/content/renderer/media/webrtc/stun_field_trial_unittest.cc index 0478c408..3495981 100644 --- a/content/renderer/media/webrtc/stun_field_trial_unittest.cc +++ b/content/renderer/media/webrtc/stun_field_trial_unittest.cc
@@ -5,7 +5,7 @@ #include "content/renderer/media/webrtc/stun_field_trial.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/webrtc/base/socketaddress.h" +#include "third_party/webrtc/rtc_base/socketaddress.h" namespace content {
diff --git a/content/renderer/media/webrtc_logging.cc b/content/renderer/media/webrtc_logging.cc index b3d13b9..0b90f01 100644 --- a/content/renderer/media/webrtc_logging.cc +++ b/content/renderer/media/webrtc_logging.cc
@@ -6,7 +6,7 @@ #include "base/time/time.h" #include "content/public/renderer/webrtc_log_message_delegate.h" -#include "third_party/webrtc_overrides/webrtc/base/logging.h" +#include "third_party/webrtc_overrides/webrtc/rtc_base/logging.h" namespace content {
diff --git a/content/renderer/p2p/empty_network_manager.h b/content/renderer/p2p/empty_network_manager.h index 185c2cea..1ecb6a8 100644 --- a/content/renderer/p2p/empty_network_manager.h +++ b/content/renderer/p2p/empty_network_manager.h
@@ -9,8 +9,8 @@ #include "base/memory/weak_ptr.h" #include "base/threading/thread_checker.h" #include "content/common/content_export.h" -#include "third_party/webrtc/base/network.h" -#include "third_party/webrtc/base/sigslot.h" +#include "third_party/webrtc/rtc_base/network.h" +#include "third_party/webrtc/rtc_base/sigslot.h" namespace rtc { class IPAddress;
diff --git a/content/renderer/p2p/filtering_network_manager.h b/content/renderer/p2p/filtering_network_manager.h index fe94418..99d5ef5 100644 --- a/content/renderer/p2p/filtering_network_manager.h +++ b/content/renderer/p2p/filtering_network_manager.h
@@ -11,8 +11,8 @@ #include "base/time/time.h" #include "content/common/content_export.h" #include "content/renderer/p2p/network_manager_uma.h" -#include "third_party/webrtc/base/network.h" -#include "third_party/webrtc/base/sigslot.h" +#include "third_party/webrtc/rtc_base/network.h" +#include "third_party/webrtc/rtc_base/sigslot.h" #include "url/gurl.h" namespace media {
diff --git a/content/renderer/p2p/filtering_network_manager_unittest.cc b/content/renderer/p2p/filtering_network_manager_unittest.cc index 1ed8767..b52506b 100644 --- a/content/renderer/p2p/filtering_network_manager_unittest.cc +++ b/content/renderer/p2p/filtering_network_manager_unittest.cc
@@ -17,7 +17,7 @@ #include "content/renderer/p2p/empty_network_manager.h" #include "media/base/media_permission.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/webrtc/base/ipaddress.h" +#include "third_party/webrtc/rtc_base/ipaddress.h" using NetworkList = rtc::NetworkManager::NetworkList;
diff --git a/content/renderer/p2p/host_address_request.h b/content/renderer/p2p/host_address_request.h index 9394689..2f2ecac 100644 --- a/content/renderer/p2p/host_address_request.h +++ b/content/renderer/p2p/host_address_request.h
@@ -14,7 +14,7 @@ #include "base/memory/ref_counted.h" #include "content/common/content_export.h" #include "net/base/ip_address.h" -#include "third_party/webrtc/base/asyncresolverinterface.h" +#include "third_party/webrtc/rtc_base/asyncresolverinterface.h" namespace base { class SingleThreadTaskRunner;
diff --git a/content/renderer/p2p/ipc_network_manager.cc b/content/renderer/p2p/ipc_network_manager.cc index fbf3a40..2b46f0c 100644 --- a/content/renderer/p2p/ipc_network_manager.cc +++ b/content/renderer/p2p/ipc_network_manager.cc
@@ -17,7 +17,7 @@ #include "net/base/ip_address.h" #include "net/base/network_change_notifier.h" #include "net/base/network_interfaces.h" -#include "third_party/webrtc/base/socketaddress.h" +#include "third_party/webrtc/rtc_base/socketaddress.h" namespace content {
diff --git a/content/renderer/p2p/ipc_network_manager.h b/content/renderer/p2p/ipc_network_manager.h index c2ee02b7..1d511ff0 100644 --- a/content/renderer/p2p/ipc_network_manager.h +++ b/content/renderer/p2p/ipc_network_manager.h
@@ -12,7 +12,7 @@ #include "content/common/content_export.h" #include "content/renderer/p2p/network_list_manager.h" #include "content/renderer/p2p/network_list_observer.h" -#include "third_party/webrtc/base/network.h" +#include "third_party/webrtc/rtc_base/network.h" namespace net { class IPAddress;
diff --git a/content/renderer/p2p/ipc_socket_factory.cc b/content/renderer/p2p/ipc_socket_factory.cc index f1d94c7..4ab9bd3 100644 --- a/content/renderer/p2p/ipc_socket_factory.cc +++ b/content/renderer/p2p/ipc_socket_factory.cc
@@ -26,7 +26,7 @@ #include "content/renderer/p2p/socket_dispatcher.h" #include "jingle/glue/utils.h" #include "net/base/ip_address.h" -#include "third_party/webrtc/base/asyncpacketsocket.h" +#include "third_party/webrtc/rtc_base/asyncpacketsocket.h" namespace content {
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 8e48441..de3f7951 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -176,6 +176,7 @@ #include "third_party/WebKit/public/platform/URLConversion.h" #include "third_party/WebKit/public/platform/WebCachePolicy.h" #include "third_party/WebKit/public/platform/WebData.h" +#include "third_party/WebKit/public/platform/WebFocusType.h" #include "third_party/WebKit/public/platform/WebKeyboardEvent.h" #include "third_party/WebKit/public/platform/WebMediaPlayer.h" #include "third_party/WebKit/public/platform/WebMediaPlayerSource.h" @@ -1645,6 +1646,7 @@ IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, OnSetFrameOwnerProperties) IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus) + IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocusInForm, OnAdvanceFocusInForm) IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame) IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings, OnTextTrackSettingsChanged) @@ -2275,6 +2277,12 @@ type, source_frame->web_frame(), frame_); } +void RenderFrameImpl::OnAdvanceFocusInForm(blink::WebFocusType focus_type) { + if (render_view_->webview()->FocusedFrame() != frame_) + return; + frame_->AdvanceFocusInForm(focus_type); +} + void RenderFrameImpl::OnSetFocusedFrame() { // This uses focusDocumentView rather than setFocusedFrame so that focus/blur // events are properly dispatched on any currently focused elements.
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h index 2b33676a..71fd95c 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h
@@ -909,6 +909,7 @@ void OnSetFrameOwnerProperties( const FrameOwnerProperties& frame_owner_properties); void OnAdvanceFocus(blink::WebFocusType type, int32_t source_routing_id); + void OnAdvanceFocusInForm(blink::WebFocusType focus_type); void OnSetFocusedFrame(); void OnTextTrackSettingsChanged( const FrameMsg_TextTrackSettings_Params& params);
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 0519a5a0..13bf677 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc
@@ -22,7 +22,6 @@ #include "base/sys_info.h" #include "base/threading/thread_task_runner_handle.h" #include "base/trace_event/trace_event.h" -#include "base/trace_event/trace_event_synthetic_delay.h" #include "build/build_config.h" #include "cc/animation/animation_host.h" #include "cc/input/touch_action.h"
diff --git a/content/renderer/service_worker/embedded_worker_instance_client_impl.cc b/content/renderer/service_worker/embedded_worker_instance_client_impl.cc index f41f8f1..c2b8dcd 100644 --- a/content/renderer/service_worker/embedded_worker_instance_client_impl.cc +++ b/content/renderer/service_worker/embedded_worker_instance_client_impl.cc
@@ -13,17 +13,20 @@ #include "content/public/common/content_client.h" #include "content/renderer/service_worker/embedded_worker_devtools_agent.h" #include "content/renderer/service_worker/service_worker_context_client.h" +#include "content/renderer/service_worker/web_service_worker_installed_scripts_manager_impl.h" +#include "third_party/WebKit/public/platform/WebContentSettingsClient.h" +#include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerInstalledScriptsManager.h" #include "third_party/WebKit/public/web/WebEmbeddedWorker.h" #include "third_party/WebKit/public/web/WebEmbeddedWorkerStartData.h" namespace content { EmbeddedWorkerInstanceClientImpl::WorkerWrapper::WorkerWrapper( - blink::WebEmbeddedWorker* worker, + std::unique_ptr<blink::WebEmbeddedWorker> worker, int devtools_agent_route_id) - : worker_(worker), + : worker_(std::move(worker)), devtools_agent_(base::MakeUnique<EmbeddedWorkerDevToolsAgent>( - worker, + worker_.get(), devtools_agent_route_id)) {} EmbeddedWorkerInstanceClientImpl::WorkerWrapper::~WorkerWrapper() = default; @@ -107,8 +110,12 @@ EmbeddedWorkerInstanceClientImpl::StartWorkerContext( const EmbeddedWorkerStartParams& params, std::unique_ptr<ServiceWorkerContextClient> context_client) { + std::unique_ptr<blink::WebServiceWorkerInstalledScriptsManager> manager = + WebServiceWorkerInstalledScriptsManagerImpl::Create(); + auto wrapper = base::MakeUnique<WorkerWrapper>( - blink::WebEmbeddedWorker::Create(context_client.release(), nullptr), + blink::WebEmbeddedWorker::Create(std::move(context_client), + std::move(manager), nullptr), params.worker_devtools_agent_route_id); blink::WebEmbeddedWorkerStartData start_data;
diff --git a/content/renderer/service_worker/embedded_worker_instance_client_impl.h b/content/renderer/service_worker/embedded_worker_instance_client_impl.h index 2bef6ee8..2b09cdbd 100644 --- a/content/renderer/service_worker/embedded_worker_instance_client_impl.h +++ b/content/renderer/service_worker/embedded_worker_instance_client_impl.h
@@ -50,7 +50,7 @@ // references automatically. class WorkerWrapper { public: - WorkerWrapper(blink::WebEmbeddedWorker* worker, + WorkerWrapper(std::unique_ptr<blink::WebEmbeddedWorker> worker, int devtools_agent_route_id); ~WorkerWrapper();
diff --git a/content/renderer/service_worker/service_worker_context_client.cc b/content/renderer/service_worker/service_worker_context_client.cc index f9ea547..c939a50 100644 --- a/content/renderer/service_worker/service_worker_context_client.cc +++ b/content/renderer/service_worker/service_worker_context_client.cc
@@ -744,7 +744,8 @@ GetContentClient() ->renderer() ->DidInitializeServiceWorkerContextOnWorkerThread( - context, service_worker_version_id_, script_url_); + context, service_worker_version_id_, service_worker_scope_, + script_url_); } void ServiceWorkerContextClient::WillDestroyWorkerContext( @@ -778,7 +779,7 @@ g_worker_client_tls.Pointer()->Set(NULL); GetContentClient()->renderer()->WillDestroyServiceWorkerContextOnWorkerThread( - context, service_worker_version_id_, script_url_); + context, service_worker_version_id_, service_worker_scope_, script_url_); } void ServiceWorkerContextClient::WorkerContextDestroyed() {
diff --git a/content/renderer/service_worker/web_service_worker_installed_scripts_manager_impl.cc b/content/renderer/service_worker/web_service_worker_installed_scripts_manager_impl.cc new file mode 100644 index 0000000..d69666d --- /dev/null +++ b/content/renderer/service_worker/web_service_worker_installed_scripts_manager_impl.cc
@@ -0,0 +1,44 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/renderer/service_worker/web_service_worker_installed_scripts_manager_impl.h" + +#include "base/memory/ptr_util.h" +#include "base/stl_util.h" + +namespace content { + +// static +std::unique_ptr<blink::WebServiceWorkerInstalledScriptsManager> +WebServiceWorkerInstalledScriptsManagerImpl::Create() { + // TODO(shimazu): Pass |installed_urls| from the browser. + std::vector<GURL> installed_urls; + // TODO(shimazu): Create and bind a mojom interface on the io thread. + return base::WrapUnique<WebServiceWorkerInstalledScriptsManagerImpl>( + new WebServiceWorkerInstalledScriptsManagerImpl( + std::move(installed_urls))); +} + +WebServiceWorkerInstalledScriptsManagerImpl:: + WebServiceWorkerInstalledScriptsManagerImpl( + std::vector<GURL>&& installed_urls) + : installed_urls_(installed_urls.begin(), installed_urls.end()) {} + +WebServiceWorkerInstalledScriptsManagerImpl:: + ~WebServiceWorkerInstalledScriptsManagerImpl() = default; + +bool WebServiceWorkerInstalledScriptsManagerImpl::IsScriptInstalled( + const blink::WebURL& web_script_url) const { + return base::ContainsKey(installed_urls_, web_script_url); +} + +std::unique_ptr<blink::WebServiceWorkerInstalledScriptsManager::RawScriptData> +WebServiceWorkerInstalledScriptsManagerImpl::GetRawScriptData( + const blink::WebURL& web_script_url) { + // TODO(shimazu): Implement here. + NOTIMPLEMENTED(); + return nullptr; +} + +} // namespace content
diff --git a/content/renderer/service_worker/web_service_worker_installed_scripts_manager_impl.h b/content/renderer/service_worker/web_service_worker_installed_scripts_manager_impl.h new file mode 100644 index 0000000..339a8ff --- /dev/null +++ b/content/renderer/service_worker/web_service_worker_installed_scripts_manager_impl.h
@@ -0,0 +1,36 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_RENDERER_SERVICE_WORKER_WEB_SERVICE_WORKER_INSTALLED_SCRIPTS_MANAGER_IMPL_H_ +#define CONTENT_RENDERER_SERVICE_WORKER_WEB_SERVICE_WORKER_INSTALLED_SCRIPTS_MANAGER_IMPL_H_ + +#include <set> + +#include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerInstalledScriptsManager.h" + +namespace content { + +class WebServiceWorkerInstalledScriptsManagerImpl final + : NON_EXPORTED_BASE(public blink::WebServiceWorkerInstalledScriptsManager) { + public: + static std::unique_ptr<blink::WebServiceWorkerInstalledScriptsManager> + Create(); + + ~WebServiceWorkerInstalledScriptsManagerImpl() override; + + // WebServiceWorkerInstalledScriptsManager implementation. + bool IsScriptInstalled(const blink::WebURL& script_url) const override; + std::unique_ptr<RawScriptData> GetRawScriptData( + const blink::WebURL& script_url) override; + + private: + explicit WebServiceWorkerInstalledScriptsManagerImpl( + std::vector<GURL>&& installed_urls); + + const std::set<GURL> installed_urls_; +}; + +} // namespace content + +#endif // CONTENT_RENDERER_SERVICE_WORKER_WEB_SERVICE_WORKER_INSTALLED_SCRIPTS_MANAGER_IMPL_H_
diff --git a/content/shell/android/BUILD.gn b/content/shell/android/BUILD.gn index 2a0443ee..2c140859 100644 --- a/content/shell/android/BUILD.gn +++ b/content/shell/android/BUILD.gn
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//base/android/jni_generator/jni_exception_list.gni") import("//build/config/android/config.gni") import("//build/config/android/rules.gni") import("//third_party/icu/config.gni") @@ -15,10 +16,18 @@ ] } +generate_jni_registration("content_shell_jni_registration") { + testonly = true + target = ":content_shell_apk" + output = "$root_gen_dir/content/shell/android/${target_name}.h" + exception_files = jni_exception_files +} + shared_library("libcontent_shell_content_view") { testonly = true deps = [ ":content_shell_jni_headers", + ":content_shell_jni_registration", "//build/config:exe_and_shlib_deps", "//components/crash/content/browser", "//content/shell:content_shell_lib", @@ -26,6 +35,17 @@ "//media", "//skia", ] + + # Explicit dependency required for JNI registration to be able to + # find the native side functions. + if (is_component_build) { + deps += [ + "//device/gamepad", + "//device/generic_sensor", + "//device/sensors", + "//media/midi", + ] + } sources = [ "shell_library_loader.cc", ] @@ -242,6 +262,7 @@ deps = [ ":linker_test_jni_headers", + ":linker_test_jni_registration", "//build/config:exe_and_shlib_deps", "//content/shell:content_shell_lib", @@ -250,6 +271,17 @@ "//skia", "//third_party/re2", ] + + # Explicit dependency required for JNI registration to be able to + # find the native side functions. + if (is_component_build) { + deps += [ + "//device/gamepad", + "//device/generic_sensor", + "//device/sensors", + "//media/midi", + ] + } } generate_jni("linker_test_jni_headers") { @@ -259,6 +291,14 @@ "linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java", ] } + + generate_jni_registration("linker_test_jni_registration") { + testonly = true + target = ":chromium_linker_test_apk__apk" + output = + "$root_gen_dir/content/shell/android/linker_test_apk/${target_name}.h" + exception_files = jni_exception_files + } } android_library("content_shell_browsertests_java") {
diff --git a/content/shell/android/linker_test_apk/chromium_linker_test_android.cc b/content/shell/android/linker_test_apk/chromium_linker_test_android.cc index 19f9c47..310bb2a 100644 --- a/content/shell/android/linker_test_apk/chromium_linker_test_android.cc +++ b/content/shell/android/linker_test_apk/chromium_linker_test_android.cc
@@ -9,6 +9,7 @@ #include "content/public/app/content_main.h" #include "content/public/browser/android/compositor.h" #include "content/shell/android/linker_test_apk/chromium_linker_test_linker_tests.h" +#include "content/shell/android/linker_test_apk/linker_test_jni_registration.h" #include "content/shell/android/shell_jni_registrar.h" #include "content/shell/app/shell_main_delegate.h" @@ -40,6 +41,11 @@ JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { base::android::InitVM(vm); JNIEnv* env = base::android::AttachCurrentThread(); + if (!RegisterMainDexNatives(env) || !RegisterNonMainDexNatives(env)) { + return -1; + } + // TODO(agrieve): Delete this block, this is a no-op now. + // https://crbug.com/683256. if (!content::android::OnJNIOnLoadRegisterJNI(env) || !RegisterJNI(env) || !NativeInit()) { return -1;
diff --git a/content/shell/android/shell_library_loader.cc b/content/shell/android/shell_library_loader.cc index dc88bd67..aaf1b55a 100644 --- a/content/shell/android/shell_library_loader.cc +++ b/content/shell/android/shell_library_loader.cc
@@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,6 +8,7 @@ #include "content/public/app/content_jni_onload.h" #include "content/public/app/content_main.h" #include "content/public/browser/android/compositor.h" +#include "content/shell/android/content_shell_jni_registration.h" #include "content/shell/android/shell_jni_registrar.h" #include "content/shell/app/shell_main_delegate.h" @@ -33,6 +34,12 @@ JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { base::android::InitVM(vm); JNIEnv* env = base::android::AttachCurrentThread(); + if (!RegisterMainDexNatives(env) || !RegisterNonMainDexNatives(env)) { + return -1; + } + + // TODO(agrieve): Delete this block, this is a no-op now. + // https://crbug.com/683256. if (!content::android::OnJNIOnLoadRegisterJNI(env) || !RegisterJNI(env) || !NativeInit()) { return -1;
diff --git a/content/shell/app/shell_main_delegate.cc b/content/shell/app/shell_main_delegate.cc index 6cfffb6..5f25656 100644 --- a/content/shell/app/shell_main_delegate.cc +++ b/content/shell/app/shell_main_delegate.cc
@@ -166,7 +166,6 @@ } #endif command_line.AppendSwitch(cc::switches::kEnableGpuBenchmarking); - command_line.AppendSwitch(switches::kProcessPerTab); command_line.AppendSwitch(switches::kEnableLogging); command_line.AppendSwitch(switches::kAllowFileAccessFromFiles); // only default to a software GL if the flag isn't already specified.
diff --git a/content/shell/browser/layout_test/layout_test_push_messaging_service.cc b/content/shell/browser/layout_test/layout_test_push_messaging_service.cc index 6679236..ec9e296 100644 --- a/content/shell/browser/layout_test/layout_test_push_messaging_service.cc +++ b/content/shell/browser/layout_test/layout_test_push_messaging_service.cc
@@ -161,4 +161,8 @@ } } +void LayoutTestPushMessagingService::DidDeleteServiceWorkerDatabase() { + subscribed_service_worker_registration_ = kInvalidServiceWorkerRegistrationId; +} + } // namespace content
diff --git a/content/shell/browser/layout_test/layout_test_push_messaging_service.h b/content/shell/browser/layout_test/layout_test_push_messaging_service.h index ef6cfb3d..547cb418 100644 --- a/content/shell/browser/layout_test/layout_test_push_messaging_service.h +++ b/content/shell/browser/layout_test/layout_test_push_messaging_service.h
@@ -54,6 +54,7 @@ void DidDeleteServiceWorkerRegistration( const GURL& origin, int64_t service_worker_registration_id) override; + void DidDeleteServiceWorkerDatabase() override; private: int64_t subscribed_service_worker_registration_;
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index 3098a8e..c44a09e 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -100,6 +100,8 @@ "../public/test/render_view_test.h", "../public/test/repeated_notification_observer.cc", "../public/test/repeated_notification_observer.h", + "../public/test/service_worker_test_helpers.cc", + "../public/test/service_worker_test_helpers.h", "../public/test/test_browser_context.cc", "../public/test/test_browser_context.h", "../public/test/test_browser_thread.cc", @@ -348,7 +350,7 @@ deps += [ "//third_party/webrtc/api:libjingle_peerconnection", "//third_party/webrtc/api:rtc_stats_api", - "//third_party/webrtc/base:rtc_base_approved", + "//third_party/webrtc/rtc_base:rtc_base_approved", "//third_party/webrtc/media:rtc_media_base", "//third_party/webrtc/modules/video_capture", "//third_party/webrtc/stats:rtc_stats", @@ -1346,6 +1348,7 @@ "../browser/web_contents/web_contents_view_mac_unittest.mm", "../browser/web_contents/web_drag_dest_mac_unittest.mm", "../browser/web_contents/web_drag_source_mac_unittest.mm", + "../browser/webauth/authenticator_impl_unittest.cc", "../browser/websockets/websocket_manager_unittest.cc", "../browser/webui/i18n_source_stream_unittest.cc", "../browser/webui/url_data_manager_backend_unittest.cc", @@ -1696,7 +1699,7 @@ "//third_party/webrtc/api:rtc_stats_api", "//third_party/webrtc/api:video_frame_api", "//third_party/webrtc/api/video_codecs:video_codecs_api", - "//third_party/webrtc/base:rtc_base", + "//third_party/webrtc/rtc_base:rtc_base", "//third_party/webrtc/media:rtc_media", "//third_party/webrtc/modules/desktop_capture:primitives", "//third_party/webrtc/modules/video_capture",
diff --git a/content/test/content_test_launcher.cc b/content/test/content_test_launcher.cc index 00e121d..de5ba9ed 100644 --- a/content/test/content_test_launcher.cc +++ b/content/test/content_test_launcher.cc
@@ -12,6 +12,7 @@ #include "base/macros.h" #include "base/process/memory.h" #include "base/sys_info.h" +#include "base/test/launcher/test_launcher.h" #include "base/test/test_suite.h" #include "base/test/test_timeouts.h" #include "build/build_config.h" @@ -126,7 +127,11 @@ } // namespace content int main(int argc, char** argv) { - int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); + base::CommandLine::Init(argc, argv); + size_t parallel_jobs = base::NumParallelJobs(); + if (parallel_jobs > 1U) { + parallel_jobs /= 2U; + } content::ContentTestLauncherDelegate launcher_delegate; - return LaunchTests(&launcher_delegate, default_jobs, argc, argv); + return LaunchTests(&launcher_delegate, parallel_jobs, argc, argv); }
diff --git a/content/test/data/accessibility/css/inline-position-relative-expected-blink.txt b/content/test/data/accessibility/css/inline-position-relative-expected-blink.txt new file mode 100644 index 0000000..30e1405c2 --- /dev/null +++ b/content/test/data/accessibility/css/inline-position-relative-expected-blink.txt
@@ -0,0 +1,7 @@ +rootWebArea pageLocation=(0, 0) +++genericContainer pageLocation=(0, 0) +++++staticText pageLocation=(0, 0) name='Before' +++++++inlineTextBox pageLocation=(0, 0) name='Before' +++++genericContainer pageLocation=(100, 0) +++++++staticText pageLocation=(100, 0) name='After' +++++++++inlineTextBox pageLocation=(100, 0) name='After'
diff --git a/content/test/data/accessibility/css/inline-position-relative.html b/content/test/data/accessibility/css/inline-position-relative.html new file mode 100644 index 0000000..c056364d --- /dev/null +++ b/content/test/data/accessibility/css/inline-position-relative.html
@@ -0,0 +1,26 @@ +<!-- +@BLINK-ALLOW:pageLocation* +--> +<!DOCTYPE html> +<html> +<head> + <style> + body { + padding: 0; + margin: 0; + } + .before { + display: inline-block; + width: 100px; + } + .after { + position: relative; + } + </style> +</head> +<body> + <div> + <span class="before">Before</span><span class="after">After</span> + </div> +</body> +</html>
diff --git a/content/test/data/generic_sensor/ambient_light_sensor_test.html b/content/test/data/generic_sensor/ambient_light_sensor_test.html index 25d46a6..bae19d6a 100644 --- a/content/test/data/generic_sensor/ambient_light_sensor_test.html +++ b/content/test/data/generic_sensor/ambient_light_sensor_test.html
@@ -4,7 +4,7 @@ <script type="text/javascript"> var timeOrigin; var sensor; - function onAmbientLightReadingChange() { + function onAmbientLightReading() { if (sensor.illuminance == 50 && sensor.timestamp > timeOrigin && sensor.timestamp < window.performance.now()) { @@ -17,8 +17,8 @@ function start() { sensor = new AmbientLightSensor(); timeOrigin = window.performance.now(); - sensor.onchange = - onAmbientLightReadingChange; + sensor.onreading = + onAmbientLightReading; sensor.start(); }
diff --git a/content/test/gpu/generate_buildbot_json.py b/content/test/gpu/generate_buildbot_json.py index 7b43f2ed9..4cfc06a 100755 --- a/content/test/gpu/generate_buildbot_json.py +++ b/content/test/gpu/generate_buildbot_json.py
@@ -1306,7 +1306,8 @@ # ANGLE test retries deliberately disabled to prevent flakiness. # http://crbug.com/669196 '--test-launcher-retry-limit=0' - ] + ], + 'linux_args': [ '--no-xvfb' ] }, # Until the media-only tests are extracted from content_unittests, # and audio_unittests and content_unittests can be run on the commit @@ -1358,7 +1359,8 @@ ], }, ], - 'desktop_args': ['--use-gpu-in-tests'] + 'desktop_args': ['--use-gpu-in-tests'], + 'linux_args': [ '--no-xvfb' ] }, # The gles2_conform_tests are closed-source and deliberately only run # on the FYI waterfall and the optional tryservers.
diff --git a/content/test/test_blink_web_unit_test_support.cc b/content/test/test_blink_web_unit_test_support.cc index c3daaa47..d549c3e2 100644 --- a/content/test/test_blink_web_unit_test_support.cc +++ b/content/test/test_blink_web_unit_test_support.cc
@@ -52,7 +52,7 @@ #if BUILDFLAG(ENABLE_WEBRTC) #include "content/renderer/media/rtc_certificate.h" -#include "third_party/webrtc/base/rtccertificate.h" // nogncheck +#include "third_party/webrtc/rtc_base/rtccertificate.h" // nogncheck #endif using blink::WebString;
diff --git a/docs/fuchsia_build_instructions.md b/docs/fuchsia_build_instructions.md index 75fb527a7..16197d4 100644 --- a/docs/fuchsia_build_instructions.md +++ b/docs/fuchsia_build_instructions.md
@@ -59,12 +59,7 @@ will automatically execute `gclient runhooks` at the end. When `fetch` completes, it will have created a hidden `.gclient` file and a -directory called `src` in the working directory. The remaining instructions -assume you have switched to the `src` directory: - -```shell -$ cd src -``` +directory called `src` in the working directory. ### Configure for building on Fuchsia @@ -75,9 +70,17 @@ target_os = ['fuchsia'] ``` +Note that this should be added as a top-level statement in the `.gclient` file, +not an entry inside the `solutions` dict. + You will then need to re-run `gclient runhooks`. This makes sure the Fuchsia SDK is available in third\_party and keeps it up to date. +The remaining instructions assume you have switched to the `src` directory: + +```shell +$ cd src +``` ## Setting up the build
diff --git a/docs/speed/apk_size_regressions.md b/docs/speed/apk_size_regressions.md index 544b34ea..fbf05e0d 100644 --- a/docs/speed/apk_size_regressions.md +++ b/docs/speed/apk_size_regressions.md
@@ -62,26 +62,38 @@ > > Debugging size regressions is documented at: > https://chromium.googlesource.com/chromium/src/+/master/docs/speed/apk_size_regressions.md#Debugging-Apk-Size-Increase +> +> Based on the graph: **20kb of native code, 8kb of pngs.** +> +> _**Option 1:**_ +> +> It looks to me that the size increase is expected.<br> +> Feel free to close as "Won't Fix" unless you can see some way to reduce size. +> +> _**Option 2:**_ +> +> It looks like this increase was probably unexpected or might be avoidable.<br> +> Please have a look and either: +> +> 1. Close as "Won't Fix" with a short justification, or +> 2. Land a revert / fix-up. +> +> _**Option 3:**_ +> +> It's not clear to me whether or not this increase was expected.<br> +> Please have a look and either: +> +> 1. Close as "Won't Fix" with a short justification, or +> 2. Land a revert / fix-up. -Optional, but encouraged: In a follow-up comment, provide some analysis: +*If you went with **Option 2**, and the regression is > 50kb, add +ReleaseBlock-Stable **M-6-** (next branch cut).* -> Based on the graph: 20kb of native code, 8kb of pngs. -> -> **Optional:** -> -> It looks to me that the size increase is expected. Feel free to close as -> "Won't Fix", unless you can see some way to reduce size. -> -> **Optional:** -> -> It looks like there is something that could be done to reduce the size -> here. Adding ReleaseBlock-Stable. +Once the initial bug is filed, add a follow-up comment with the output of: -And if you really feel like it, run: ``` sh tools/binary_size/diagnose_bloat.py GIT_REV --cloud ``` - * Paste relevant output into the bug. # Debugging Apk Size Increase
diff --git a/extensions/browser/BUILD.gn b/extensions/browser/BUILD.gn index 61e91c65..1b45fa4 100644 --- a/extensions/browser/BUILD.gn +++ b/extensions/browser/BUILD.gn
@@ -253,6 +253,7 @@ "lazy_background_task_queue_factory.h", "lazy_context_id.cc", "lazy_context_id.h", + "lazy_context_task_queue.h", "load_monitoring_extension_host_queue.cc", "load_monitoring_extension_host_queue.h", "management_policy.cc", @@ -302,6 +303,10 @@ "serial_extension_host_queue.h", "service_worker_manager.cc", "service_worker_manager.h", + "service_worker_task_queue.cc", + "service_worker_task_queue.h", + "service_worker_task_queue_factory.cc", + "service_worker_task_queue_factory.h", "state_store.cc", "state_store.h", "suggest_permission_util.cc",
diff --git a/extensions/browser/api/cast_channel/cast_channel_apitest.cc b/extensions/browser/api/cast_channel/cast_channel_apitest.cc index 1639bf6..b3d76cb 100644 --- a/extensions/browser/api/cast_channel/cast_channel_apitest.cc +++ b/extensions/browser/api/cast_channel/cast_channel_apitest.cc
@@ -224,7 +224,7 @@ content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, base::Bind(&CastChannelAPITest::DoCallOnError, base::Unretained(api_test), - cast_socket_service)); + base::RetainedRef(cast_socket_service))); } // TODO(kmarshall): Win Dbg has a workaround that makes RunExtensionSubtest
diff --git a/extensions/browser/api/virtual_keyboard/virtual_keyboard_api.cc b/extensions/browser/api/virtual_keyboard/virtual_keyboard_api.cc index db16660..de8d87f1 100644 --- a/extensions/browser/api/virtual_keyboard/virtual_keyboard_api.cc +++ b/extensions/browser/api/virtual_keyboard/virtual_keyboard_api.cc
@@ -10,6 +10,11 @@ #include "extensions/browser/api/virtual_keyboard_private/virtual_keyboard_private_api.h" #include "extensions/common/api/virtual_keyboard.h" +#if defined(OS_CHROMEOS) +#include "ui/base/ime/chromeos/input_method_manager.h" +using chromeos::input_method::InputMethodManager; +#endif + namespace extensions { VirtualKeyboardRestrictFeaturesFunction:: @@ -32,6 +37,18 @@ VirtualKeyboardAPI* api = BrowserContextKeyedAPIFactory<VirtualKeyboardAPI>::Get(browser_context()); api->delegate()->SetKeyboardRestricted(!features_enabled); + +#if defined(OS_CHROMEOS) + InputMethodManager* input_method_manager = InputMethodManager::Get(); + if (input_method_manager) { + input_method_manager->SetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_VOICE, + params->restrictions.voice_input_enabled); + input_method_manager->SetImeMenuFeatureEnabled( + InputMethodManager::FEATURE_HANDWRITING, + params->restrictions.handwriting_enabled); + } +#endif return RespondNow(NoArguments()); }
diff --git a/extensions/browser/event_listener_map.cc b/extensions/browser/event_listener_map.cc index b60e5bf..f666659 100644 --- a/extensions/browser/event_listener_map.cc +++ b/extensions/browser/event_listener_map.cc
@@ -30,7 +30,7 @@ content::RenderProcessHost* process, std::unique_ptr<base::DictionaryValue> filter) { return base::WrapUnique(new EventListener(event_name, extension_id, GURL(), - process, kNonWorkerThreadId, + process, false, kNonWorkerThreadId, std::move(filter))); } @@ -46,18 +46,19 @@ // we dispatched events to processes more intelligently this could be avoided. return base::WrapUnique(new EventListener( event_name, ExtensionId(), url::Origin(listener_url).GetURL(), process, - kNonWorkerThreadId, std::move(filter))); + false, kNonWorkerThreadId, std::move(filter))); } std::unique_ptr<EventListener> EventListener::ForExtensionServiceWorker( const std::string& event_name, const std::string& extension_id, content::RenderProcessHost* process, + const GURL& service_worker_scope, int worker_thread_id, std::unique_ptr<base::DictionaryValue> filter) { - return base::WrapUnique(new EventListener(event_name, extension_id, GURL(), - process, worker_thread_id, - std::move(filter))); + return base::WrapUnique( + new EventListener(event_name, extension_id, service_worker_scope, process, + true, worker_thread_id, std::move(filter))); } EventListener::~EventListener() {} @@ -69,6 +70,7 @@ return event_name_ == other->event_name_ && extension_id_ == other->extension_id_ && listener_url_ == other->listener_url_ && process_ == other->process_ && + is_for_service_worker_ == other->is_for_service_worker_ && worker_thread_id_ == other->worker_thread_id_ && ((!!filter_.get()) == (!!other->filter_.get())) && (!filter_.get() || filter_->Equals(other->filter_.get())); @@ -78,19 +80,15 @@ std::unique_ptr<DictionaryValue> filter_copy; if (filter_) filter_copy = filter_->CreateDeepCopy(); - return base::WrapUnique( - new EventListener(event_name_, extension_id_, listener_url_, process_, - worker_thread_id_, std::move(filter_copy))); + return base::WrapUnique(new EventListener( + event_name_, extension_id_, listener_url_, process_, + is_for_service_worker_, worker_thread_id_, std::move(filter_copy))); } bool EventListener::IsLazy() const { return !process_; } -bool EventListener::IsForServiceWorker() const { - return worker_thread_id_ != kNonWorkerThreadId; -} - void EventListener::MakeLazy() { DCHECK_EQ(worker_thread_id_, kNonWorkerThreadId); process_ = nullptr; @@ -104,12 +102,14 @@ const std::string& extension_id, const GURL& listener_url, content::RenderProcessHost* process, + bool is_for_service_worker, int worker_thread_id, std::unique_ptr<DictionaryValue> filter) : event_name_(event_name), extension_id_(extension_id), listener_url_(listener_url), process_(process), + is_for_service_worker_(is_for_service_worker), worker_thread_id_(worker_thread_id), filter_(std::move(filter)), matcher_id_(-1) {}
diff --git a/extensions/browser/event_listener_map.h b/extensions/browser/event_listener_map.h index ea25ea6..5bebe7c 100644 --- a/extensions/browser/event_listener_map.h +++ b/extensions/browser/event_listener_map.h
@@ -67,6 +67,7 @@ const std::string& event_name, const std::string& extension_id, content::RenderProcessHost* process, + const GURL& service_worker_scope, int worker_thread_id, std::unique_ptr<base::DictionaryValue> filter); @@ -80,9 +81,9 @@ // or an extension service worker. This listener does not have |process_|. bool IsLazy() const; - // Returns true if this listener was registered for an extension service - // worker. - bool IsForServiceWorker() const; + // Returns true if this listener (lazy or not) was registered for an extension + // service worker. + bool is_for_service_worker() const { return is_for_service_worker_; } // Modifies this listener to be a lazy listener, clearing process references. void MakeLazy(); @@ -105,6 +106,7 @@ const std::string& extension_id, const GURL& listener_url, content::RenderProcessHost* process, + bool is_for_service_worker, int worker_thread_id, std::unique_ptr<base::DictionaryValue> filter); @@ -112,7 +114,15 @@ const std::string extension_id_; const GURL listener_url_; content::RenderProcessHost* process_; + + const bool is_for_service_worker_ = false; + + // If this listener is for a service worker (i.e. + // is_for_service_worker_ = true) and the worker is in running state, then + // this is the worker's thread id in the worker |process_|. For lazy service + // worker events, this will be kNonWorkerThreadId. const int worker_thread_id_; + std::unique_ptr<base::DictionaryValue> filter_; EventFilter::MatcherID matcher_id_; // -1 if unset.
diff --git a/extensions/browser/event_router.cc b/extensions/browser/event_router.cc index 04d38f0..210930d 100644 --- a/extensions/browser/event_router.cc +++ b/extensions/browser/event_router.cc
@@ -181,9 +181,11 @@ const std::string& event_name, content::RenderProcessHost* process, const ExtensionId& extension_id, + const GURL& service_worker_scope, int worker_thread_id) { listeners_.AddListener(EventListener::ForExtensionServiceWorker( - event_name, extension_id, process, worker_thread_id, nullptr)); + event_name, extension_id, process, service_worker_scope, worker_thread_id, + nullptr)); } void EventRouter::RemoveEventListener(const std::string& event_name, @@ -198,10 +200,12 @@ const std::string& event_name, content::RenderProcessHost* process, const ExtensionId& extension_id, + const GURL& service_worker_scope, int worker_thread_id) { std::unique_ptr<EventListener> listener = - EventListener::ForExtensionServiceWorker( - event_name, extension_id, process, worker_thread_id, nullptr); + EventListener::ForExtensionServiceWorker(event_name, extension_id, + process, service_worker_scope, + worker_thread_id, nullptr); listeners_.RemoveListener(listener.get()); } @@ -281,26 +285,42 @@ void EventRouter::AddLazyEventListener(const std::string& event_name, const ExtensionId& extension_id) { - AddLazyEventListenerImpl(event_name, extension_id, kNonWorkerThreadId); + AddLazyEventListenerImpl( + EventListener::ForExtension(event_name, extension_id, nullptr, nullptr), + RegisteredEventType::kLazy); } void EventRouter::RemoveLazyEventListener(const std::string& event_name, const ExtensionId& extension_id) { - RemoveLazyEventListenerImpl(event_name, extension_id, kNonWorkerThreadId); + RemoveLazyEventListenerImpl( + EventListener::ForExtension(event_name, extension_id, nullptr, nullptr), + RegisteredEventType::kLazy); } void EventRouter::AddLazyServiceWorkerEventListener( const std::string& event_name, const ExtensionId& extension_id, - int worker_thread_id) { - AddLazyEventListenerImpl(event_name, extension_id, worker_thread_id); + const GURL& service_worker_scope) { + std::unique_ptr<EventListener> listener = + EventListener::ForExtensionServiceWorker( + event_name, extension_id, nullptr, service_worker_scope, + kNonWorkerThreadId, // Lazy, without worker thread id. + nullptr); + AddLazyEventListenerImpl(std::move(listener), + RegisteredEventType::kServiceWorker); } void EventRouter::RemoveLazyServiceWorkerEventListener( const std::string& event_name, const ExtensionId& extension_id, - int worker_thread_id) { - RemoveLazyEventListenerImpl(event_name, extension_id, worker_thread_id); + const GURL& service_worker_scope) { + std::unique_ptr<EventListener> listener = + EventListener::ForExtensionServiceWorker( + event_name, extension_id, nullptr, service_worker_scope, + kNonWorkerThreadId, // Lazy, without worker thread id. + nullptr); + RemoveLazyEventListenerImpl(std::move(listener), + RegisteredEventType::kServiceWorker); } // TODO(lazyboy): Support filters for extension SW events. @@ -462,10 +482,14 @@ restrict_to_extension_id != listener->extension_id()) { continue; } - // TODO(lazyboy): Support lazy listeners for extension SW events. - if (listener->IsLazy() && !listener->IsForServiceWorker()) { - lazy_event_dispatcher.DispatchToEventPage(listener->extension_id(), - listener->filter()); + if (listener->IsLazy()) { + if (listener->is_for_service_worker()) { + lazy_event_dispatcher.DispatchToServiceWorker( + listener->extension_id(), listener->listener_url(), nullptr); + } else { + lazy_event_dispatcher.DispatchToEventPage(listener->extension_id(), + listener->filter()); + } } } @@ -564,6 +588,9 @@ event->event_args.get(), event->user_gesture, event->filter_info); + // TODO(lazyboy): This is wrong for extensions SW events. We need to: + // 1. Increment worker ref count + // 2. Add EventAck IPC to decrement that ref count. if (extension) { ReportEvent(event->histogram_value, extension, did_enqueue); IncrementInFlightEvents(listener_context, extension, event_id, @@ -679,17 +706,18 @@ } } -void EventRouter::DispatchPendingEvent(const linked_ptr<Event>& event, - ExtensionHost* host) { - if (!host) +void EventRouter::DispatchPendingEvent( + const linked_ptr<Event>& event, + std::unique_ptr<LazyContextTaskQueue::ContextInfo> params) { + if (!params) return; - if (listeners_.HasProcessListener(host->render_process_host(), - kNonWorkerThreadId, - host->extension()->id())) { - DispatchEventToProcess(host->extension()->id(), host->GetURL(), - host->render_process_host(), kNonWorkerThreadId, - event, nullptr, true /* did_enqueue */); + if (listeners_.HasProcessListener(params->render_process_host, + params->worker_thread_id, + params->extension_id)) { + DispatchEventToProcess( + params->extension_id, params->url, params->render_process_host, + params->worker_thread_id, event, nullptr, true /* did_enqueue */); } } @@ -745,21 +773,13 @@ listeners_.RemoveListenersForExtension(extension->id()); } -void EventRouter::AddLazyEventListenerImpl(const std::string& event_name, - const ExtensionId& extension_id, - int worker_thread_id) { - bool is_for_service_worker = worker_thread_id != kNonWorkerThreadId; - bool is_new = listeners_.AddListener( - is_for_service_worker - ? EventListener::ForExtensionServiceWorker( - event_name, extension_id, nullptr, worker_thread_id, nullptr) - : EventListener::ForExtension(event_name, extension_id, nullptr, - nullptr)); - +void EventRouter::AddLazyEventListenerImpl( + std::unique_ptr<EventListener> listener, + RegisteredEventType type) { + const ExtensionId extension_id = listener->extension_id(); + const std::string event_name = listener->event_name(); + bool is_new = listeners_.AddListener(std::move(listener)); if (is_new) { - RegisteredEventType type = is_for_service_worker - ? RegisteredEventType::kServiceWorker - : RegisteredEventType::kLazy; std::set<std::string> events = GetRegisteredEvents(extension_id, type); bool prefs_is_new = events.insert(event_name).second; if (prefs_is_new) @@ -767,22 +787,13 @@ } } -void EventRouter::RemoveLazyEventListenerImpl(const std::string& event_name, - const ExtensionId& extension_id, - int worker_thread_id) { - bool is_for_service_worker = worker_thread_id != kNonWorkerThreadId; - std::unique_ptr<EventListener> listener = - is_for_service_worker - ? EventListener::ForExtensionServiceWorker( - event_name, extension_id, nullptr, worker_thread_id, nullptr) - : EventListener::ForExtension(event_name, extension_id, nullptr, - nullptr); +void EventRouter::RemoveLazyEventListenerImpl( + std::unique_ptr<EventListener> listener, + RegisteredEventType type) { + const ExtensionId extension_id = listener->extension_id(); + const std::string event_name = listener->event_name(); bool did_exist = listeners_.RemoveListener(listener.get()); - if (did_exist) { - RegisteredEventType type = is_for_service_worker - ? RegisteredEventType::kServiceWorker - : RegisteredEventType::kLazy; std::set<std::string> events = GetRegisteredEvents(extension_id, type); bool prefs_did_exist = events.erase(event_name) > 0; DCHECK(prefs_did_exist);
diff --git a/extensions/browser/event_router.h b/extensions/browser/event_router.h index f0c5d0fc..d63152d 100644 --- a/extensions/browser/event_router.h +++ b/extensions/browser/event_router.h
@@ -23,6 +23,7 @@ #include "extensions/browser/events/lazy_event_dispatch_util.h" #include "extensions/browser/extension_event_histogram_value.h" #include "extensions/browser/extension_registry_observer.h" +#include "extensions/browser/lazy_context_task_queue.h" #include "extensions/common/constants.h" #include "extensions/common/event_filtering_info.h" #include "ipc/ipc_sender.h" @@ -37,7 +38,6 @@ namespace extensions { class Extension; -class ExtensionHost; class ExtensionPrefs; class ExtensionRegistry; @@ -125,6 +125,7 @@ void AddServiceWorkerEventListener(const std::string& event_name, content::RenderProcessHost* process, const ExtensionId& extension_id, + const GURL& service_worker_scope, int worker_thread_id); void RemoveEventListener(const std::string& event_name, content::RenderProcessHost* process, @@ -132,6 +133,7 @@ void RemoveServiceWorkerEventListener(const std::string& event_name, content::RenderProcessHost* process, const ExtensionId& extension_id, + const GURL& service_worker_scope, int worker_thread_id); // Add or remove a URL as an event listener for |event_name|. @@ -164,10 +166,10 @@ // workers. void AddLazyServiceWorkerEventListener(const std::string& event_name, const ExtensionId& extension_id, - int worker_thread_id); + const GURL& service_worker_scope); void RemoveLazyServiceWorkerEventListener(const std::string& event_name, const ExtensionId& extension_id, - int worker_thread_id); + const GURL& service_worker_scope); // If |add_lazy_listener| is true also add the lazy version of this listener. void AddFilteredEventListener(const std::string& event_name, @@ -268,12 +270,10 @@ const Extension* extension, UnloadedExtensionReason reason) override; - void AddLazyEventListenerImpl(const std::string& event_name, - const ExtensionId& extension_id, - int worker_thread_id); - void RemoveLazyEventListenerImpl(const std::string& event_name, - const ExtensionId& extension_id, - int worker_thread_id); + void AddLazyEventListenerImpl(std::unique_ptr<EventListener> listener, + RegisteredEventType type); + void RemoveLazyEventListenerImpl(std::unique_ptr<EventListener> listener, + RegisteredEventType type); // Shared by all event dispatch methods. If |restrict_to_extension_id| is // empty, the event is broadcast. An event that just came off the pending @@ -321,8 +321,9 @@ events::HistogramValue histogram_value, const std::string& event_name); - void DispatchPendingEvent(const linked_ptr<Event>& event, - ExtensionHost* host); + void DispatchPendingEvent( + const linked_ptr<Event>& event, + std::unique_ptr<LazyContextTaskQueue::ContextInfo> params); // Implementation of EventListenerMap::Delegate. void OnListenerAdded(const EventListener* listener) override;
diff --git a/extensions/browser/events/lazy_event_dispatcher.cc b/extensions/browser/events/lazy_event_dispatcher.cc index 60dbbe4..7f4da36 100644 --- a/extensions/browser/events/lazy_event_dispatcher.cc +++ b/extensions/browser/events/lazy_event_dispatcher.cc
@@ -11,6 +11,7 @@ #include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/lazy_background_task_queue.h" #include "extensions/browser/lazy_context_id.h" +#include "extensions/browser/service_worker_task_queue.h" #include "extensions/common/manifest_handlers/incognito_info.h" using content::BrowserContext; @@ -34,11 +35,27 @@ DispatchToLazyContext(&dispatch_context, listener_filter); } +void LazyEventDispatcher::DispatchToServiceWorker( + const ExtensionId& extension_id, + const GURL& service_worker_scope, + const base::DictionaryValue* listener_filter) { + LazyContextId dispatch_context(browser_context_, extension_id, + service_worker_scope); + DispatchToLazyContext(&dispatch_context, listener_filter); +} + bool LazyEventDispatcher::HasAlreadyDispatched( BrowserContext* context, const EventListener* listener) const { - auto dispatch_context = - base::MakeUnique<LazyContextId>(context, listener->extension_id()); + std::unique_ptr<LazyContextId> dispatch_context; + if (listener->is_for_service_worker()) { + dispatch_context = base::MakeUnique<LazyContextId>( + context, listener->extension_id(), listener->listener_url()); + } else { + dispatch_context = + base::MakeUnique<LazyContextId>(context, listener->extension_id()); + } + return HasAlreadyDispatchedImpl(dispatch_context.get()); } @@ -79,7 +96,7 @@ if (HasAlreadyDispatchedImpl(dispatch_context)) return false; - LazyBackgroundTaskQueue* queue = dispatch_context->GetTaskQueue(); + LazyContextTaskQueue* queue = dispatch_context->GetTaskQueue(); if (!queue->ShouldEnqueueTask(dispatch_context->browser_context(), extension)) { return false; @@ -102,15 +119,20 @@ dispatched_event->will_dispatch_callback.Reset(); } - queue->AddPendingTask(dispatch_context->browser_context(), - dispatch_context->extension_id(), - base::Bind(dispatch_function_, dispatched_event)); + queue->AddPendingTaskToDispatchEvent( + dispatch_context, base::Bind(dispatch_function_, dispatched_event)); return true; } bool LazyEventDispatcher::HasAlreadyDispatchedImpl( const LazyContextId* dispatch_context) const { + if (dispatch_context->is_for_service_worker()) { + ServiceWorkerDispatchIdentifier dispatch_id( + dispatch_context->browser_context(), + dispatch_context->service_worker_scope()); + return base::ContainsKey(dispatched_ids_for_service_worker_, dispatch_id); + } DCHECK(dispatch_context->is_for_event_page()); EventPageDispatchIdentifier dispatch_id(dispatch_context->browser_context(), dispatch_context->extension_id()); @@ -119,6 +141,12 @@ void LazyEventDispatcher::RecordAlreadyDispatched( LazyContextId* dispatch_context) { + if (dispatch_context->is_for_service_worker()) { + dispatched_ids_for_service_worker_.insert( + std::make_pair(dispatch_context->browser_context(), + dispatch_context->service_worker_scope())); + return; + } DCHECK(dispatch_context->is_for_event_page()); dispatched_ids_for_event_page_.insert(std::make_pair( dispatch_context->browser_context(), dispatch_context->extension_id()));
diff --git a/extensions/browser/events/lazy_event_dispatcher.h b/extensions/browser/events/lazy_event_dispatcher.h index 0ad46d36..b844657 100644 --- a/extensions/browser/events/lazy_event_dispatcher.h +++ b/extensions/browser/events/lazy_event_dispatcher.h
@@ -10,6 +10,7 @@ #include "base/callback.h" #include "base/memory/linked_ptr.h" +#include "extensions/browser/lazy_context_task_queue.h" #include "extensions/common/extension_id.h" namespace base { @@ -23,7 +24,6 @@ namespace extensions { class EventListener; class Extension; -class ExtensionHost; class LazyContextId; struct Event; @@ -32,22 +32,28 @@ // Manages waking up lazy contexts if they are stopped. class LazyEventDispatcher { public: - // TODO(lazyboy): ExtensionHost is specific to events pages, provide a generic - // context info that works for both event pages and service workers. using DispatchFunction = - base::Callback<void(const linked_ptr<Event>&, ExtensionHost*)>; + base::Callback<void(const linked_ptr<Event>&, + std::unique_ptr<LazyContextTaskQueue::ContextInfo>)>; LazyEventDispatcher(content::BrowserContext* browser_context, const linked_ptr<Event>& event, const DispatchFunction& dispatch_function); ~LazyEventDispatcher(); - // Dispatches a lazy event to |extension_id|. + // Dispatches the lazy |event_| to |extension_id|. // // Ensures that all lazy background pages that are interested in the given // event are loaded, and queues the event if the page is not ready yet. void DispatchToEventPage(const ExtensionId& extension_id, const base::DictionaryValue* listener_filter); + // Dispatches the lazy |event_| to |extension_id|'s service worker. + // + // Service workers are started if they were stopped, before dispatching the + // event. + void DispatchToServiceWorker(const ExtensionId& extension_id, + const GURL& service_worker_scope, + const base::DictionaryValue* listener_filter); // Returns whether or not an event listener identical to |listener| is queued // for dispatch already. @@ -57,6 +63,8 @@ private: using EventPageDispatchIdentifier = std::pair<const content::BrowserContext*, std::string>; + using ServiceWorkerDispatchIdentifier = + std::pair<const content::BrowserContext*, GURL>; void DispatchToLazyContext(LazyContextId* dispatch_context, const base::DictionaryValue* listener_filter); @@ -78,7 +86,10 @@ linked_ptr<Event> event_; DispatchFunction dispatch_function_; + // TODO(lazyboy): Instead of keeping these two std::sets, compbine them using + // LazyContextId key when service worker event listeners are more common. std::set<EventPageDispatchIdentifier> dispatched_ids_for_event_page_; + std::set<ServiceWorkerDispatchIdentifier> dispatched_ids_for_service_worker_; DISALLOW_COPY_AND_ASSIGN(LazyEventDispatcher); };
diff --git a/extensions/browser/extension_message_filter.cc b/extensions/browser/extension_message_filter.cc index 91c46ac..42ccc92 100644 --- a/extensions/browser/extension_message_filter.cc +++ b/extensions/browser/extension_message_filter.cc
@@ -90,6 +90,8 @@ case ExtensionHostMsg_RemoveListener::ID: case ExtensionHostMsg_AddLazyListener::ID: case ExtensionHostMsg_RemoveLazyListener::ID: + case ExtensionHostMsg_AddLazyServiceWorkerListener::ID: + case ExtensionHostMsg_RemoveLazyServiceWorkerListener::ID: case ExtensionHostMsg_AddFilteredListener::ID: case ExtensionHostMsg_RemoveFilteredListener::ID: case ExtensionHostMsg_ShouldSuspendAck::ID: @@ -122,6 +124,10 @@ OnExtensionAddLazyListener) IPC_MESSAGE_HANDLER(ExtensionHostMsg_RemoveLazyListener, OnExtensionRemoveLazyListener) + IPC_MESSAGE_HANDLER(ExtensionHostMsg_AddLazyServiceWorkerListener, + OnExtensionAddLazyServiceWorkerListener); + IPC_MESSAGE_HANDLER(ExtensionHostMsg_RemoveLazyServiceWorkerListener, + OnExtensionRemoveLazyServiceWorkerListener); IPC_MESSAGE_HANDLER(ExtensionHostMsg_AddFilteredListener, OnExtensionAddFilteredListener) IPC_MESSAGE_HANDLER(ExtensionHostMsg_RemoveFilteredListener, @@ -141,7 +147,7 @@ void ExtensionMessageFilter::OnExtensionAddListener( const std::string& extension_id, - const GURL& listener_url, + const GURL& listener_or_worker_scope_url, const std::string& event_name, int worker_thread_id) { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -154,14 +160,19 @@ EventRouter* event_router = GetEventRouter(); if (crx_file::id_util::IdIsValid(extension_id)) { - if (worker_thread_id != kNonWorkerThreadId) { + const bool is_service_worker_context = + worker_thread_id != kNonWorkerThreadId; + if (is_service_worker_context) { + DCHECK(listener_or_worker_scope_url.is_valid()); event_router->AddServiceWorkerEventListener( - event_name, process, extension_id, worker_thread_id); + event_name, process, extension_id, listener_or_worker_scope_url, + worker_thread_id); } else { event_router->AddEventListener(event_name, process, extension_id); } - } else if (listener_url.is_valid()) { - event_router->AddEventListenerForURL(event_name, process, listener_url); + } else if (listener_or_worker_scope_url.is_valid()) { + event_router->AddEventListenerForURL(event_name, process, + listener_or_worker_scope_url); } else { NOTREACHED() << "Tried to add an event listener without a valid " << "extension ID nor listener URL"; @@ -170,7 +181,7 @@ void ExtensionMessageFilter::OnExtensionRemoveListener( const std::string& extension_id, - const GURL& listener_url, + const GURL& listener_or_worker_scope_url, const std::string& event_name, int worker_thread_id) { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -182,15 +193,19 @@ return; if (crx_file::id_util::IdIsValid(extension_id)) { - if (worker_thread_id != kNonWorkerThreadId) { + const bool is_service_worker_context = + worker_thread_id != kNonWorkerThreadId; + if (is_service_worker_context) { + DCHECK(listener_or_worker_scope_url.is_valid()); GetEventRouter()->RemoveServiceWorkerEventListener( - event_name, process, extension_id, worker_thread_id); + event_name, process, extension_id, listener_or_worker_scope_url, + worker_thread_id); } else { GetEventRouter()->RemoveEventListener(event_name, process, extension_id); } - } else if (listener_url.is_valid()) { + } else if (listener_or_worker_scope_url.is_valid()) { GetEventRouter()->RemoveEventListenerForURL(event_name, process, - listener_url); + listener_or_worker_scope_url); } else { NOTREACHED() << "Tried to remove an event listener without a valid " << "extension ID nor listener URL"; @@ -199,34 +214,45 @@ void ExtensionMessageFilter::OnExtensionAddLazyListener( const std::string& extension_id, + const std::string& event_name) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + if (!browser_context_) + return; + GetEventRouter()->AddLazyEventListener(event_name, extension_id); +} + +void ExtensionMessageFilter::OnExtensionAddLazyServiceWorkerListener( + const std::string& extension_id, const std::string& event_name, - int worker_thread_id) { + const GURL& service_worker_scope) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!browser_context_) return; - if (worker_thread_id == kNonWorkerThreadId) { - GetEventRouter()->AddLazyEventListener(event_name, extension_id); - } else { - GetEventRouter()->AddLazyServiceWorkerEventListener( - event_name, extension_id, worker_thread_id); - } + GetEventRouter()->AddLazyServiceWorkerEventListener(event_name, extension_id, + service_worker_scope); } void ExtensionMessageFilter::OnExtensionRemoveLazyListener( const std::string& extension_id, - const std::string& event_name, - int worker_thread_id) { + const std::string& event_name) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!browser_context_) return; - if (worker_thread_id == kNonWorkerThreadId) { - GetEventRouter()->RemoveLazyEventListener(event_name, extension_id); - } else { - GetEventRouter()->RemoveLazyServiceWorkerEventListener( - event_name, extension_id, worker_thread_id); - } + GetEventRouter()->RemoveLazyEventListener(event_name, extension_id); +} + +void ExtensionMessageFilter::OnExtensionRemoveLazyServiceWorkerListener( + const std::string& extension_id, + const std::string& event_name, + const GURL& worker_scope_url) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + if (!browser_context_) + return; + + GetEventRouter()->RemoveLazyServiceWorkerEventListener( + event_name, extension_id, worker_scope_url); } void ExtensionMessageFilter::OnExtensionAddFilteredListener(
diff --git a/extensions/browser/extension_message_filter.h b/extensions/browser/extension_message_filter.h index 5859a97..8e3b6f7 100644 --- a/extensions/browser/extension_message_filter.h +++ b/extensions/browser/extension_message_filter.h
@@ -61,11 +61,17 @@ const std::string& event_name, int worker_thread_id); void OnExtensionAddLazyListener(const std::string& extension_id, - const std::string& event_name, - int worker_thread_id); + const std::string& event_name); + void OnExtensionAddLazyServiceWorkerListener( + const std::string& extension_id, + const std::string& event_name, + const GURL& service_worker_scope); void OnExtensionRemoveLazyListener(const std::string& extension_id, - const std::string& event_name, - int worker_thread_id); + const std::string& event_name); + void OnExtensionRemoveLazyServiceWorkerListener( + const std::string& extension_id, + const std::string& event_name, + const GURL& worker_scope_url); void OnExtensionAddFilteredListener(const std::string& extension_id, const std::string& event_name, const base::DictionaryValue& filter,
diff --git a/extensions/browser/lazy_background_task_queue.cc b/extensions/browser/lazy_background_task_queue.cc index 2403154..2e07737 100644 --- a/extensions/browser/lazy_background_task_queue.cc +++ b/extensions/browser/lazy_background_task_queue.cc
@@ -16,6 +16,7 @@ #include "extensions/browser/extension_registry.h" #include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/lazy_background_task_queue_factory.h" +#include "extensions/browser/lazy_context_id.h" #include "extensions/browser/notification_types.h" #include "extensions/browser/process_manager.h" #include "extensions/browser/process_map.h" @@ -25,6 +26,23 @@ namespace extensions { +namespace { + +// Adapts a LazyBackgroundTaskQueue pending task callback to +// LazyContextTaskQueue's callback. +void PendingTaskAdapter(const LazyContextTaskQueue::PendingTask& original_task, + ExtensionHost* host) { + if (!host) { + original_task.Run(nullptr); + } else { + original_task.Run(base::MakeUnique<LazyContextTaskQueue::ContextInfo>( + host->extension()->id(), host->render_process_host(), + kNonWorkerThreadId, host->GetURL())); + } +} + +} // namespace + LazyBackgroundTaskQueue::LazyBackgroundTaskQueue( content::BrowserContext* browser_context) : browser_context_(browser_context), extension_registry_observer_(this) { @@ -66,6 +84,13 @@ return false; } +void LazyBackgroundTaskQueue::AddPendingTaskToDispatchEvent( + LazyContextId* context_id, + const LazyContextTaskQueue::PendingTask& task) { + AddPendingTask(context_id->browser_context(), context_id->extension_id(), + base::Bind(&PendingTaskAdapter, task)); +} + void LazyBackgroundTaskQueue::AddPendingTask( content::BrowserContext* browser_context, const std::string& extension_id,
diff --git a/extensions/browser/lazy_background_task_queue.h b/extensions/browser/lazy_background_task_queue.h index 2f24e27a..8d0bcd25 100644 --- a/extensions/browser/lazy_background_task_queue.h +++ b/extensions/browser/lazy_background_task_queue.h
@@ -18,6 +18,7 @@ #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "extensions/browser/extension_registry_observer.h" +#include "extensions/browser/lazy_context_task_queue.h" #include "extensions/common/extension_id.h" namespace content { @@ -28,6 +29,7 @@ class Extension; class ExtensionHost; class ExtensionRegistry; +class LazyContextId; // This class maintains a queue of tasks that should execute when an // extension's lazy background page is loaded. It is also in charge of loading @@ -36,6 +38,7 @@ // It is the consumer's responsibility to use this class when appropriate, i.e. // only with extensions that have not-yet-loaded lazy background pages. class LazyBackgroundTaskQueue : public KeyedService, + public LazyContextTaskQueue, public content::NotificationObserver, public ExtensionRegistryObserver { public: @@ -53,7 +56,13 @@ // extension has a lazy background page that is being suspended this method // cancels that suspension. bool ShouldEnqueueTask(content::BrowserContext* context, - const Extension* extension); + const Extension* extension) override; + // TODO(lazyboy): Find a better way to use AddPendingTask instead of this. + // Currently AddPendingTask has lots of consumers that depend on + // ExtensionHost. + void AddPendingTaskToDispatchEvent( + LazyContextId* context_id, + const LazyContextTaskQueue::PendingTask& task) override; // Adds a task to the queue for a given extension. If this is the first // task added for the extension, its lazy background page will be loaded.
diff --git a/extensions/browser/lazy_context_id.cc b/extensions/browser/lazy_context_id.cc index 80a4dcf..d8c9fe16 100644 --- a/extensions/browser/lazy_context_id.cc +++ b/extensions/browser/lazy_context_id.cc
@@ -5,6 +5,7 @@ #include "extensions/browser/lazy_context_id.h" #include "extensions/browser/lazy_background_task_queue.h" +#include "extensions/browser/service_worker_task_queue.h" namespace extensions { @@ -12,9 +13,19 @@ const ExtensionId& extension_id) : type_(Type::kEventPage), context_(context), extension_id_(extension_id) {} -LazyBackgroundTaskQueue* LazyContextId::GetTaskQueue() { - DCHECK(is_for_event_page()); - return LazyBackgroundTaskQueue::Get(context_); +LazyContextId::LazyContextId(content::BrowserContext* context, + const ExtensionId& extension_id, + const GURL& service_worker_scope) + : type_(Type::kServiceWorker), + context_(context), + extension_id_(extension_id), + service_worker_scope_(service_worker_scope) {} + +LazyContextTaskQueue* LazyContextId::GetTaskQueue() { + if (is_for_event_page()) + return LazyBackgroundTaskQueue::Get(context_); + DCHECK(is_for_service_worker()); + return ServiceWorkerTaskQueue::Get(context_); } } // namespace extensions
diff --git a/extensions/browser/lazy_context_id.h b/extensions/browser/lazy_context_id.h index aef418d..13a90614 100644 --- a/extensions/browser/lazy_context_id.h +++ b/extensions/browser/lazy_context_id.h
@@ -13,20 +13,26 @@ } namespace extensions { -class LazyBackgroundTaskQueue; +class LazyContextTaskQueue; class LazyContextId { public: enum class Type { kEventPage, + kServiceWorker, }; // An event page (lazy background) context. LazyContextId(content::BrowserContext* context, const ExtensionId& extension_id); - // TODO(lazyboy): Service worker context. + + // An extension service worker context. + LazyContextId(content::BrowserContext* context, + const ExtensionId& extension_id, + const GURL& service_worker_scope); bool is_for_event_page() const { return type_ == Type::kEventPage; } + bool is_for_service_worker() const { return type_ == Type::kServiceWorker; } content::BrowserContext* browser_context() const { return context_; } void set_browser_context(content::BrowserContext* context) { @@ -35,13 +41,18 @@ const ExtensionId& extension_id() const { return extension_id_; } - // TODO(lazyboy): Use a generic interface to support service workers. - LazyBackgroundTaskQueue* GetTaskQueue(); + const GURL& service_worker_scope() const { + DCHECK(is_for_service_worker()); + return service_worker_scope_; + } + + LazyContextTaskQueue* GetTaskQueue(); private: const Type type_; content::BrowserContext* context_; const ExtensionId extension_id_; + const GURL service_worker_scope_; DISALLOW_COPY_AND_ASSIGN(LazyContextId); };
diff --git a/extensions/browser/lazy_context_task_queue.h b/extensions/browser/lazy_context_task_queue.h new file mode 100644 index 0000000..f27033d --- /dev/null +++ b/extensions/browser/lazy_context_task_queue.h
@@ -0,0 +1,71 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef EXTENSIONS_BROWSER_LAZY_CONTEXT_TASK_QUEUE_H_ +#define EXTENSIONS_BROWSER_LAZY_CONTEXT_TASK_QUEUE_H_ + +#include "base/callback.h" +#include "extensions/common/extension_id.h" +#include "url/gurl.h" + +namespace content { +class BrowserContext; +class RenderProcessHost; +} // namespace content + +namespace extensions { +class Extension; +class LazyContextId; + +// Interface for performing tasks after loading lazy contexts of an extension. +// +// Lazy contexts are non-persistent, so they can unload any time and this +// interface exposes an async mechanism to perform tasks after loading the +// context. +class LazyContextTaskQueue { + public: + // Represents information about an extension lazy context, which is passed to + // consumers that add tasks to LazyContextTaskQueue. + struct ContextInfo { + const ExtensionId extension_id; + content::RenderProcessHost* const render_process_host; + const int worker_thread_id; + const GURL url; + ContextInfo(const ExtensionId& extension_id, + content::RenderProcessHost* render_process_host, + int worker_thread_id, + const GURL& url) + : extension_id(extension_id), + render_process_host(render_process_host), + worker_thread_id(worker_thread_id), + url(url) {} + }; + using PendingTask = base::Callback<void(std::unique_ptr<ContextInfo> params)>; + + // Returns true if the task should be added to the queue (that is, if the + // extension has a lazy background page or service worker that isn't ready + // yet). + virtual bool ShouldEnqueueTask(content::BrowserContext* context, + const Extension* extension) = 0; + + // Adds a task to the queue for a given extension. If this is the first + // task added for the extension, its "lazy context" (i.e. lazy background + // page for event pages, service worker for extension service workers) will + // be loaded. The task will be called either when the page is loaded, + // or when the page fails to load for some reason (e.g. a crash or browser + // shutdown). In the latter case, the ContextInfo will be nullptr. + // + // TODO(lazyboy): Remove "ToDispatchEvent" suffix and simply call this + // AddPendingTask. Issues: + // 1. We already have LazyBackgroundTaskQueue::AddPendingTask. Moreover, that + // is heavily used thoughout the codebase. + // 2. LazyBackgroundTaskQueue::AddPendingTask is tied to ExtensionHost. This + // class should be ExtensionHost agnostic. + virtual void AddPendingTaskToDispatchEvent(LazyContextId* context_id, + const PendingTask& task) = 0; +}; + +} // namespace extensions + +#endif // EXTENSIONS_BROWSER_LAZY_CONTEXT_TASK_QUEUE_H_
diff --git a/extensions/browser/mojo/service_registration.cc b/extensions/browser/mojo/service_registration.cc index 3cee21e0..5367702 100644 --- a/extensions/browser/mojo/service_registration.cc +++ b/extensions/browser/mojo/service_registration.cc
@@ -51,9 +51,10 @@ service_manager::BinderRegistry* registry = render_frame_host->GetInterfaceRegistry(); - registry->AddInterface(base::Bind( - KeepAliveImpl::Create, - render_frame_host->GetProcess()->GetBrowserContext(), extension)); + registry->AddInterface( + base::Bind(KeepAliveImpl::Create, + render_frame_host->GetProcess()->GetBrowserContext(), + base::RetainedRef(extension))); #if BUILDFLAG(ENABLE_WIFI_DISPLAY) if (ExtensionHasPermission(extension, render_frame_host->GetProcess(),
diff --git a/extensions/browser/service_worker_task_queue.cc b/extensions/browser/service_worker_task_queue.cc new file mode 100644 index 0000000..35eea0f --- /dev/null +++ b/extensions/browser/service_worker_task_queue.cc
@@ -0,0 +1,98 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "extensions/browser/service_worker_task_queue.h" + +#include "content/public/browser/browser_context.h" +#include "content/public/browser/browser_thread.h" +#include "content/public/browser/render_process_host.h" +#include "content/public/browser/service_worker_context.h" +#include "content/public/browser/storage_partition.h" +#include "extensions/browser/event_router.h" +#include "extensions/browser/lazy_context_id.h" +#include "extensions/browser/service_worker_task_queue_factory.h" +#include "extensions/common/constants.h" + +using content::BrowserContext; +using content::BrowserThread; + +namespace extensions { + +namespace { + +void FinishTask(const LazyContextTaskQueue::PendingTask& task, + const ExtensionId& extension_id, + int process_id, + int thread_id) { + auto params = base::MakeUnique<LazyContextTaskQueue::ContextInfo>( + extension_id, content::RenderProcessHost::FromID(process_id), thread_id, + GURL()); + task.Run(std::move(params)); +} + +void DidStartActiveWorkerForPattern( + const LazyContextTaskQueue::PendingTask& task, + const ExtensionId& extension_id, + int process_id, + int thread_id) { + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + content::BrowserThread::PostTask( + content::BrowserThread::UI, FROM_HERE, + base::Bind(FinishTask, task, extension_id, process_id, thread_id)); +} + +void DidStartActiveWorkerFail() { + DCHECK(false) << "DidStartActiveWorkerFail"; + // TODO(lazyboy): Handle failure case. +} + +void GetServiceWorkerInfoOnIO( + const GURL& pattern, + const ExtensionId& extension_id, + content::ServiceWorkerContext* service_worker_context, + const LazyContextTaskQueue::PendingTask& task) { + service_worker_context->StartActiveWorkerForPattern( + pattern, + base::BindOnce(&DidStartActiveWorkerForPattern, task, extension_id), + base::BindOnce(&DidStartActiveWorkerFail)); +} + +} // namespace + +ServiceWorkerTaskQueue::ServiceWorkerTaskQueue( + content::BrowserContext* browser_context) {} + +ServiceWorkerTaskQueue::~ServiceWorkerTaskQueue() {} + +// static +ServiceWorkerTaskQueue* ServiceWorkerTaskQueue::Get( + content::BrowserContext* context) { + return ServiceWorkerTaskQueueFactory::GetForBrowserContext(context); +} + +bool ServiceWorkerTaskQueue::ShouldEnqueueTask(content::BrowserContext* context, + const Extension* extension) { + // We call StartWorker every time we want to dispatch an event to an extension + // Service worker. + // TODO(lazyboy): Is that a problem? + return true; +} + +void ServiceWorkerTaskQueue::AddPendingTaskToDispatchEvent( + LazyContextId* context_id, + const LazyContextTaskQueue::PendingTask& task) { + DCHECK(context_id->is_for_service_worker()); + content::StoragePartition* partition = + BrowserContext::GetStoragePartitionForSite( + context_id->browser_context(), context_id->service_worker_scope()); + content::ServiceWorkerContext* service_worker_context = + partition->GetServiceWorkerContext(); + + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, + base::Bind(&GetServiceWorkerInfoOnIO, context_id->service_worker_scope(), + context_id->extension_id(), service_worker_context, task)); +} + +} // namespace extensions
diff --git a/extensions/browser/service_worker_task_queue.h b/extensions/browser/service_worker_task_queue.h new file mode 100644 index 0000000..07ffe181 --- /dev/null +++ b/extensions/browser/service_worker_task_queue.h
@@ -0,0 +1,46 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef EXTENSIONS_BROWSER_SERVICE_WORKER_TASK_QUEUE_H_ +#define EXTENSIONS_BROWSER_SERVICE_WORKER_TASK_QUEUE_H_ + +#include "components/keyed_service/core/keyed_service.h" +#include "extensions/browser/lazy_context_task_queue.h" +#include "extensions/common/extension_id.h" +#include "url/gurl.h" + +namespace content { +class BrowserContext; +} + +namespace extensions { +class Extension; +class LazyContextId; + +// TODO(lazyboy): This class doesn't queue up any tasks, implement. See +// LazyBackgroundTaskQueue. +// TODO(lazyboy): Clean up queue when extension is unloaded/uninstalled. +class ServiceWorkerTaskQueue : public KeyedService, + public LazyContextTaskQueue { + public: + explicit ServiceWorkerTaskQueue(content::BrowserContext* browser_context); + ~ServiceWorkerTaskQueue() override; + + // Convenience method to return the ServiceWorkerTaskQueue for a given + // |context|. + static ServiceWorkerTaskQueue* Get(content::BrowserContext* context); + + bool ShouldEnqueueTask(content::BrowserContext* context, + const Extension* extension) override; + void AddPendingTaskToDispatchEvent( + LazyContextId* context_id, + const LazyContextTaskQueue::PendingTask& task) override; + + private: + DISALLOW_COPY_AND_ASSIGN(ServiceWorkerTaskQueue); +}; + +} // namespace extensions + +#endif // EXTENSIONS_BROWSER_SERVICE_WORKER_TASK_QUEUE_H_
diff --git a/extensions/browser/service_worker_task_queue_factory.cc b/extensions/browser/service_worker_task_queue_factory.cc new file mode 100644 index 0000000..aa3755a3 --- /dev/null +++ b/extensions/browser/service_worker_task_queue_factory.cc
@@ -0,0 +1,44 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "extensions/browser/service_worker_task_queue_factory.h" + +#include "components/keyed_service/content/browser_context_dependency_manager.h" +#include "extensions/browser/extensions_browser_client.h" +#include "extensions/browser/service_worker_task_queue.h" + +using content::BrowserContext; +namespace extensions { + +// static +ServiceWorkerTaskQueue* ServiceWorkerTaskQueueFactory::GetForBrowserContext( + BrowserContext* context) { + return static_cast<ServiceWorkerTaskQueue*>( + GetInstance()->GetServiceForBrowserContext(context, true)); +} + +// static +ServiceWorkerTaskQueueFactory* ServiceWorkerTaskQueueFactory::GetInstance() { + return base::Singleton<ServiceWorkerTaskQueueFactory>::get(); +} + +ServiceWorkerTaskQueueFactory::ServiceWorkerTaskQueueFactory() + : BrowserContextKeyedServiceFactory( + "ServiceWorkerTaskQueue", + BrowserContextDependencyManager::GetInstance()) {} + +ServiceWorkerTaskQueueFactory::~ServiceWorkerTaskQueueFactory() {} + +KeyedService* ServiceWorkerTaskQueueFactory::BuildServiceInstanceFor( + BrowserContext* context) const { + return new ServiceWorkerTaskQueue(context); +} + +BrowserContext* ServiceWorkerTaskQueueFactory::GetBrowserContextToUse( + BrowserContext* context) const { + // Redirected in incognito. + return ExtensionsBrowserClient::Get()->GetOriginalContext(context); +} + +} // namespace extensions
diff --git a/extensions/browser/service_worker_task_queue_factory.h b/extensions/browser/service_worker_task_queue_factory.h new file mode 100644 index 0000000..0a78b5f --- /dev/null +++ b/extensions/browser/service_worker_task_queue_factory.h
@@ -0,0 +1,39 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef EXTENSIONS_BROWSER_SERVICE_WORKER_TASK_QUEUE_FACTORY_H_ +#define EXTENSIONS_BROWSER_SERVICE_WORKER_TASK_QUEUE_FACTORY_H_ + +#include "base/macros.h" +#include "base/memory/singleton.h" +#include "components/keyed_service/content/browser_context_keyed_service_factory.h" + +namespace extensions { + +class ServiceWorkerTaskQueue; + +class ServiceWorkerTaskQueueFactory : public BrowserContextKeyedServiceFactory { + public: + static ServiceWorkerTaskQueue* GetForBrowserContext( + content::BrowserContext* context); + static ServiceWorkerTaskQueueFactory* GetInstance(); + + private: + friend struct base::DefaultSingletonTraits<ServiceWorkerTaskQueueFactory>; + + ServiceWorkerTaskQueueFactory(); + ~ServiceWorkerTaskQueueFactory() override; + + // BrowserContextKeyedServiceFactory: + KeyedService* BuildServiceInstanceFor( + content::BrowserContext* context) const override; + content::BrowserContext* GetBrowserContextToUse( + content::BrowserContext* context) const override; + + DISALLOW_COPY_AND_ASSIGN(ServiceWorkerTaskQueueFactory); +}; + +} // namespace extensions + +#endif // EXTENSIONS_BROWSER_SERVICE_WORKER_TASK_QUEUE_FACTORY_H_
diff --git a/extensions/common/extension_messages.cc b/extensions/common/extension_messages.cc index 7e2266e..87bdc45 100644 --- a/extensions/common/extension_messages.cc +++ b/extensions/common/extension_messages.cc
@@ -139,7 +139,10 @@ // schemes after parsing the pattern. Update these method calls once we can // ignore scheme validation with URLPattern parse options. crbug.com/90544 p->SetValidSchemes(URLPattern::SCHEME_ALL); - URLPattern::ParseResult result = p->Parse(spec); + // Allow effective TLD wildcarding since this check is only needed on initial + // creation of URLPattern and not as part of deserialization. + URLPattern::ParseResult result = + p->Parse(spec, URLPattern::ALLOW_WILDCARD_FOR_EFFECTIVE_TLD); p->SetValidSchemes(valid_schemes); return URLPattern::PARSE_SUCCESS == result; }
diff --git a/extensions/common/extension_messages.h b/extensions/common/extension_messages.h index c95da70..bcbd18ac 100644 --- a/extensions/common/extension_messages.h +++ b/extensions/common/extension_messages.h
@@ -691,7 +691,7 @@ // Notify the browser that the given extension added a listener to an event. IPC_MESSAGE_CONTROL4(ExtensionHostMsg_AddListener, std::string /* extension_id */, - GURL /* listener_url */, + GURL /* listener_or_worker_scope_url */, std::string /* name */, int /* worker_thread_id */) @@ -699,23 +699,35 @@ // event. IPC_MESSAGE_CONTROL4(ExtensionHostMsg_RemoveListener, std::string /* extension_id */, - GURL /* listener_url */, + GURL /* listener_or_worker_scope_url */, std::string /* name */, int /* worker_thread_id */) // Notify the browser that the given extension added a listener to an event from // a lazy background page. -IPC_MESSAGE_CONTROL3(ExtensionHostMsg_AddLazyListener, +IPC_MESSAGE_CONTROL2(ExtensionHostMsg_AddLazyListener, std::string /* extension_id */, - std::string /* name */, - int /* worker_thread_id */) + std::string /* name */) // Notify the browser that the given extension is no longer interested in // receiving the given event from a lazy background page. -IPC_MESSAGE_CONTROL3(ExtensionHostMsg_RemoveLazyListener, +IPC_MESSAGE_CONTROL2(ExtensionHostMsg_RemoveLazyListener, + std::string /* extension_id */, + std::string /* event_name */) + +// Notify the browser that the given extension added a listener to an event from +// an extension service worker. +IPC_MESSAGE_CONTROL3(ExtensionHostMsg_AddLazyServiceWorkerListener, std::string /* extension_id */, std::string /* name */, - int /* worker_thread_id */) + GURL /* service_worker_scope */) + +// Notify the browser that the given extension is no longer interested in +// receiving the given event from an extension service worker. +IPC_MESSAGE_CONTROL3(ExtensionHostMsg_RemoveLazyServiceWorkerListener, + std::string /* extension_id */, + std::string /* name */, + GURL /* service_worker_scope */) // Notify the browser that the given extension added a listener to instances of // the named event that satisfy the filter.
diff --git a/extensions/common/extension_messages_unittest.cc b/extensions/common/extension_messages_unittest.cc index ea5dd033..bfd0a138 100644 --- a/extensions/common/extension_messages_unittest.cc +++ b/extensions/common/extension_messages_unittest.cc
@@ -34,6 +34,16 @@ *(second_tab_permissions.at(tab_permissions.first))) << tab_permissions.first; } + EXPECT_EQ(extension1.permissions_data()->policy_blocked_hosts(), + extension2.permissions_data()->policy_blocked_hosts()); + EXPECT_EQ(extension1.permissions_data()->policy_allowed_hosts(), + extension2.permissions_data()->policy_allowed_hosts()); +} + +void AddPattern(const std::string& pattern, URLPatternSet* extent) { + URLPattern parsed(URLPattern::SCHEME_ALL); + parsed.Parse(pattern, URLPattern::ALLOW_WILDCARD_FOR_EFFECTIVE_TLD); + extent->AddPattern(parsed); } } // namespace @@ -62,6 +72,12 @@ extension->permissions_data()->UpdateTabSpecificPermissions( 1, PermissionSet(tab_permissions, ManifestPermissionSet(), URLPatternSet(), URLPatternSet())); + URLPatternSet runtime_blocked_hosts; + AddPattern("*://*.example.*/*", &runtime_blocked_hosts); + URLPatternSet runtime_allowed_hosts; + AddPattern("*://good.example.com/*", &runtime_allowed_hosts); + extension->permissions_data()->SetPolicyHostRestrictions( + runtime_blocked_hosts, runtime_allowed_hosts); ExtensionMsg_Loaded_Params params_in(extension.get(), true); EXPECT_EQ(extension->id(), params_in.id);
diff --git a/extensions/common/features/simple_feature.cc b/extensions/common/features/simple_feature.cc index 3626e83b..5a10672 100644 --- a/extensions/common/features/simple_feature.cc +++ b/extensions/common/features/simple_feature.cc
@@ -260,8 +260,9 @@ // TODO(kalman): Assert that if the context was a webpage or WebUI context // then at some point a "matches" restriction was checked. - return CheckDependencies(base::Bind(&IsAvailableToContextForBind, extension, - context, url, platform)); + return CheckDependencies(base::Bind(&IsAvailableToContextForBind, + base::RetainedRef(extension), context, + url, platform)); } std::string SimpleFeature::GetAvailabilityMessage(
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc index 0659214c..7dfb51c 100644 --- a/extensions/renderer/dispatcher.cc +++ b/extensions/renderer/dispatcher.cc
@@ -237,16 +237,16 @@ render_thread->Send(new ExtensionHostMsg_AddListener( extension_id, context->url(), event_name, worker_thread_id)); if (lazy) { - render_thread->Send(new ExtensionHostMsg_AddLazyListener( - extension_id, event_name, worker_thread_id)); + render_thread->Send( + new ExtensionHostMsg_AddLazyListener(extension_id, event_name)); } } else { DCHECK_EQ(binding::EventListenersChanged::NO_LISTENERS, changed); render_thread->Send(new ExtensionHostMsg_RemoveListener( extension_id, context->url(), event_name, worker_thread_id)); if (lazy && was_manual) { - render_thread->Send(new ExtensionHostMsg_RemoveLazyListener( - extension_id, event_name, worker_thread_id)); + render_thread->Send( + new ExtensionHostMsg_RemoveLazyListener(extension_id, event_name)); } } } @@ -434,10 +434,11 @@ void Dispatcher::DidInitializeServiceWorkerContextOnWorkerThread( v8::Local<v8::Context> v8_context, int64_t service_worker_version_id, - const GURL& url) { + const GURL& service_worker_scope, + const GURL& script_url) { const base::TimeTicks start_time = base::TimeTicks::Now(); - if (!url.SchemeIs(kExtensionScheme)) { + if (!script_url.SchemeIs(kExtensionScheme)) { // Early-out if this isn't a chrome-extension:// scheme, because looking up // the extension registry is unnecessary if it's not. Checking this will // also skip over hosted apps, which is the desired behavior - hosted app @@ -446,14 +447,14 @@ } const Extension* extension = - RendererExtensionRegistry::Get()->GetExtensionOrAppByURL(url); + RendererExtensionRegistry::Get()->GetExtensionOrAppByURL(script_url); if (!extension) { // TODO(kalman): This is no good. Instead we need to either: // // - Hold onto the v8::Context and create the ScriptContext and install // our bindings when this extension is loaded. - // - Deal with there being an extension ID (url.host()) but no + // - Deal with there being an extension ID (script_url.host()) but no // extension associated with it, then document that getBackgroundClient // may fail if the extension hasn't loaded yet. // @@ -475,7 +476,8 @@ ScriptContext* context = new ScriptContext( v8_context, nullptr, extension, Feature::SERVICE_WORKER_CONTEXT, extension, Feature::SERVICE_WORKER_CONTEXT); - context->set_url(url); + context->set_url(script_url); + context->set_service_worker_scope(service_worker_scope); if (ExtensionsClient::Get()->ExtensionAPIEnabledInExtensionServiceWorkers()) { WorkerThreadDispatcher::Get()->AddWorkerData(service_worker_version_id, @@ -565,10 +567,11 @@ void Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread( v8::Local<v8::Context> v8_context, int64_t service_worker_version_id, - const GURL& url) { - if (url.SchemeIs(kExtensionScheme)) { + const GURL& service_worker_scope, + const GURL& script_url) { + if (script_url.SchemeIs(kExtensionScheme)) { // See comment in DidInitializeServiceWorkerContextOnWorkerThread. - g_worker_script_context_set.Get().Remove(v8_context, url); + g_worker_script_context_set.Get().Remove(v8_context, script_url); // TODO(devlin): We're not calling // ExtensionBindingsSystem::WillReleaseScriptContext() here. This should be // fine, since the entire bindings system is being destroyed when we
diff --git a/extensions/renderer/dispatcher.h b/extensions/renderer/dispatcher.h index e69de3c1..25800fb 100644 --- a/extensions/renderer/dispatcher.h +++ b/extensions/renderer/dispatcher.h
@@ -95,7 +95,8 @@ void DidInitializeServiceWorkerContextOnWorkerThread( v8::Local<v8::Context> v8_context, int64_t service_worker_version_id, - const GURL& url); + const GURL& service_worker_scope, + const GURL& script_url); void WillReleaseScriptContext(blink::WebLocalFrame* frame, const v8::Local<v8::Context>& context, @@ -105,7 +106,8 @@ static void WillDestroyServiceWorkerContextOnWorkerThread( v8::Local<v8::Context> v8_context, int64_t service_worker_version_id, - const GURL& url); + const GURL& service_worker_scope, + const GURL& script_url); // This method is not allowed to run JavaScript code in the frame. void DidCreateDocumentElement(blink::WebLocalFrame* frame);
diff --git a/extensions/renderer/event_bindings.cc b/extensions/renderer/event_bindings.cc index 59cc404..7a5dee4d 100644 --- a/extensions/renderer/event_bindings.cc +++ b/extensions/renderer/event_bindings.cc
@@ -249,10 +249,15 @@ const int worker_thread_id = content::WorkerThread::GetCurrentId(); const std::string& extension_id = context()->GetExtensionID(); + const bool is_service_worker_context = + context()->context_type() == Feature::SERVICE_WORKER_CONTEXT; IPC::Sender* sender = GetIPCSender(); if (IncrementEventListenerCount(context(), event_name) == 1) { sender->Send(new ExtensionHostMsg_AddListener( - extension_id, context()->url(), event_name, worker_thread_id)); + extension_id, + is_service_worker_context ? context()->service_worker_scope() + : context()->url(), + event_name, worker_thread_id)); } // This is called the first time the page has added a listener. Since @@ -262,8 +267,13 @@ ExtensionFrameHelper::IsContextForEventPage(context()) || context()->context_type() == Feature::SERVICE_WORKER_CONTEXT; if (is_lazy_context) { - sender->Send(new ExtensionHostMsg_AddLazyListener(extension_id, event_name, - worker_thread_id)); + if (is_service_worker_context) { + sender->Send(new ExtensionHostMsg_AddLazyServiceWorkerListener( + extension_id, event_name, context()->service_worker_scope())); + } else { + sender->Send( + new ExtensionHostMsg_AddLazyListener(extension_id, event_name)); + } } } @@ -280,12 +290,16 @@ attached_event_names_.erase(event_name); int worker_thread_id = content::WorkerThread::GetCurrentId(); + const bool is_service_worker_context = worker_thread_id != kNonWorkerThreadId; IPC::Sender* sender = GetIPCSender(); const std::string& extension_id = context()->GetExtensionID(); if (DecrementEventListenerCount(context(), event_name) == 0) { sender->Send(new ExtensionHostMsg_RemoveListener( - extension_id, context()->url(), event_name, worker_thread_id)); + extension_id, + is_service_worker_context ? context()->service_worker_scope() + : context()->url(), + event_name, worker_thread_id)); } // DetachEvent is called when the last listener for the context is @@ -297,8 +311,13 @@ ExtensionFrameHelper::IsContextForEventPage(context()) || context()->context_type() == Feature::SERVICE_WORKER_CONTEXT; if (is_lazy_context) { - sender->Send(new ExtensionHostMsg_RemoveLazyListener( - extension_id, event_name, worker_thread_id)); + if (is_service_worker_context) { + sender->Send(new ExtensionHostMsg_RemoveLazyServiceWorkerListener( + extension_id, event_name, context()->service_worker_scope())); + } else { + sender->Send( + new ExtensionHostMsg_RemoveLazyListener(extension_id, event_name)); + } } } }
diff --git a/extensions/renderer/resources/messaging.js b/extensions/renderer/resources/messaging.js index cdce1cf6..f44d753d 100644 --- a/extensions/renderer/resources/messaging.js +++ b/extensions/renderer/resources/messaging.js
@@ -88,7 +88,7 @@ // // TODO(kalman/mpcomplete): it would be better to do the same validation // here that we do for runtime.sendMessage (and variants), i.e. throw an - // schema validation Error, but just maintain the old behaviour until + // schema validation Error, but just maintain the old behavior until // there's a good reason not to (http://crbug.com/263077). console.error('Illegal argument to Port.postMessage'); return; @@ -410,8 +410,9 @@ sendResponseAndClearCallback(); } else { lastError.set( - port.name, 'The message port closed before a reponse was received.', - null, chrome); + port.name, + 'The message port closed before a response was received.', null, + chrome); try { sendResponseAndClearCallback(); } finally {
diff --git a/extensions/renderer/script_context.cc b/extensions/renderer/script_context.cc index 9a60177a..531e416 100644 --- a/extensions/renderer/script_context.cc +++ b/extensions/renderer/script_context.cc
@@ -254,6 +254,11 @@ return GetContextTypeDescriptionString(effective_context_type_); } +const GURL& ScriptContext::service_worker_scope() const { + DCHECK_EQ(Feature::SERVICE_WORKER_CONTEXT, context_type()); + return service_worker_scope_; +} + bool ScriptContext::IsAnyFeatureAvailableToContext( const Feature& api, CheckAliasStatus check_alias) {
diff --git a/extensions/renderer/script_context.h b/extensions/renderer/script_context.h index 63a17d0..17b82e50 100644 --- a/extensions/renderer/script_context.h +++ b/extensions/renderer/script_context.h
@@ -149,11 +149,16 @@ // - It might let us remove the about:blank resolving? const GURL& url() const { return url_; } + const GURL& service_worker_scope() const; + // Sets the URL of this ScriptContext. Usually this will automatically be set // on construction, unless this isn't constructed with enough information to // determine the URL (e.g. frame was null). // TODO(kalman): Make this a constructor parameter (as an origin). void set_url(const GURL& url) { url_ = url; } + void set_service_worker_scope(const GURL& scope) { + service_worker_scope_ = scope; + } // Returns whether the API |api| or any part of the API could be available in // this context without taking into account the context's extension. @@ -269,6 +274,8 @@ GURL url_; + GURL service_worker_scope_; + std::unique_ptr<Runner> runner_; base::ThreadChecker thread_checker_;
diff --git a/extensions/shell/test/shell_tests_main.cc b/extensions/shell/test/shell_tests_main.cc index eb16469..8429e91 100644 --- a/extensions/shell/test/shell_tests_main.cc +++ b/extensions/shell/test/shell_tests_main.cc
@@ -2,14 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <algorithm> - -#include "base/sys_info.h" +#include "base/command_line.h" +#include "base/test/launcher/test_launcher.h" #include "extensions/shell/test/shell_test_launcher_delegate.h" #include "testing/gtest/include/gtest/gtest.h" int main(int argc, char** argv) { - int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); + base::CommandLine::Init(argc, argv); + size_t parallel_jobs = base::NumParallelJobs(); + if (parallel_jobs > 1U) { + parallel_jobs /= 2U; + } extensions::AppShellTestLauncherDelegate launcher_delegate; - return content::LaunchTests(&launcher_delegate, default_jobs, argc, argv); + return content::LaunchTests(&launcher_delegate, parallel_jobs, argc, argv); }
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 0c02a1dc..83fb3dc 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -25,7 +25,6 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" #include "base/trace_event/trace_event.h" -#include "base/trace_event/trace_event_synthetic_delay.h" #include "build/build_config.h" #include "gpu/command_buffer/common/debug_marker_manager.h" #include "gpu/command_buffer/common/gles2_cmd_format.h" @@ -11917,7 +11916,6 @@ GLsizei count, const volatile GLint* rects) { TRACE_EVENT0("gpu", "GLES2DecoderImpl::SwapBuffersWithBoundsCHROMIUM"); - { TRACE_EVENT_SYNTHETIC_DELAY("gpu.PresentingFrame"); } if (!supports_swap_buffers_with_bounds_) { LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glSwapBuffersWithBoundsCHROMIUM", "command not supported by surface"); @@ -11951,9 +11949,6 @@ *static_cast<const volatile gles2::cmds::PostSubBufferCHROMIUM*>( cmd_data); TRACE_EVENT0("gpu", "GLES2DecoderImpl::HandlePostSubBufferCHROMIUM"); - { - TRACE_EVENT_SYNTHETIC_DELAY("gpu.PresentingFrame"); - } if (!supports_post_sub_buffer_) { LOCAL_SET_GL_ERROR( GL_INVALID_OPERATION, @@ -15548,9 +15543,6 @@ TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoSwapBuffers", "offscreen", is_offscreen, "frame", this_frame_number); - { - TRACE_EVENT_SYNTHETIC_DELAY("gpu.PresentingFrame"); - } ScopedGPUTrace scoped_gpu_trace(gpu_tracer_.get(), kTraceDecoder, "GLES2Decoder", "SwapBuffer");
diff --git a/gpu/config/software_rendering_list.json b/gpu/config/software_rendering_list.json index 006cc6d..3d3938b 100644 --- a/gpu/config/software_rendering_list.json +++ b/gpu/config/software_rendering_list.json
@@ -1,6 +1,6 @@ { "name": "software rendering list", - "version": "13.8", + "version": "13.9", "entries": [ { "id": 1, @@ -1503,6 +1503,23 @@ "features": [ "webgl2" ] + }, + { + "id": 147, + "description": "GPU raster broken on Mali-T760 on KitKat", + "cr_bugs": [737048], + "os": { + "type": "android", + "version": { + "op": "<=", + "value": "4.4.4" + } + }, + "gl_renderer": "Mali-T760.*", + "features": [ + "accelerated_2d_canvas", + "gpu_rasterization" + ] } ], "comment": [
diff --git a/headless/BUILD.gn b/headless/BUILD.gn index 57026c97..384124f2 100644 --- a/headless/BUILD.gn +++ b/headless/BUILD.gn
@@ -598,6 +598,8 @@ ] data = [ + "lib/dom_tree_extraction_expected_nodes.txt", + "lib/dom_tree_extraction_expected_styles.txt", "$root_out_dir/headless_lib.pak", "//net/tools/testserver/", "//third_party/pyftpdlib/",
diff --git a/headless/lib/dom_tree_extraction_expected_nodes.txt b/headless/lib/dom_tree_extraction_expected_nodes.txt new file mode 100644 index 0000000..1c3b2ee --- /dev/null +++ b/headless/lib/dom_tree_extraction_expected_nodes.txt
@@ -0,0 +1,679 @@ +{ + "backendNodeId": 3, + "baseURL": "http://127.0.0.1/dom_tree_test.html", + "boundingBox": { + "height": 600.0, + "width": 800.0, + "x": 0.0, + "y": 0.0 + }, + "childNodeIndexes": [ 1 ], + "documentURL": "http://127.0.0.1/dom_tree_test.html", + "layoutNodeIndex": 0, + "nodeName": "#document", + "nodeType": 9, + "nodeValue": "" +} +{ + "backendNodeId": 4, + "boundingBox": { + "height": 600.0, + "width": 800.0, + "x": 0.0, + "y": 0.0 + }, + "childNodeIndexes": [ 2, 9, 10 ], + "frameId": "?", + "layoutNodeIndex": 1, + "nodeName": "HTML", + "nodeType": 1, + "nodeValue": "", + "styleIndex": 0 +} +{ + "backendNodeId": 5, + "childNodeIndexes": [ 3, 4, 6, 7, 8 ], + "nodeName": "HEAD", + "nodeType": 1, + "nodeValue": "" +} +{ + "backendNodeId": 6, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n" +} +{ + "backendNodeId": 7, + "childNodeIndexes": [ 5 ], + "nodeName": "TITLE", + "nodeType": 1, + "nodeValue": "" +} +{ + "backendNodeId": 8, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "Hello world!" +} +{ + "backendNodeId": 9, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n" +} +{ + "attributes": [ { + "name": "href", + "value": "dom_tree_test.css" + }, { + "name": "rel", + "value": "stylesheet" + }, { + "name": "type", + "value": "text/css" + } ], + "backendNodeId": 10, + "nodeName": "LINK", + "nodeType": 1, + "nodeValue": "" +} +{ + "backendNodeId": 11, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n" +} +{ + "backendNodeId": 12, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n" +} +{ + "backendNodeId": 13, + "boundingBox": { + "height": 584.0, + "width": 784.0, + "x": 8.0, + "y": 8.0 + }, + "childNodeIndexes": [ 11, 12 ], + "layoutNodeIndex": 2, + "nodeName": "BODY", + "nodeType": 1, + "nodeValue": "", + "styleIndex": 1 +} +{ + "backendNodeId": 14, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n" +} +{ + "attributes": [ { + "name": "id", + "value": "id1" + } ], + "backendNodeId": 15, + "boundingBox": { + "height": 354.0, + "width": 784.0, + "x": 8.0, + "y": 8.0 + }, + "childNodeIndexes": [ 13, 14, 16, 17, 26, 27, 49 ], + "layoutNodeIndex": 3, + "nodeName": "DIV", + "nodeType": 1, + "nodeValue": "", + "styleIndex": 0 +} +{ + "backendNodeId": 16, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n" +} +{ + "attributes": [ { + "name": "class", + "value": "red" + } ], + "backendNodeId": 17, + "boundingBox": { + "height": 32.0, + "width": 784.0, + "x": 8.0, + "y": 8.0 + }, + "childNodeIndexes": [ 15 ], + "layoutNodeIndex": 4, + "nodeName": "H1", + "nodeType": 1, + "nodeValue": "", + "styleIndex": 2 +} +{ + "backendNodeId": 18, + "boundingBox": { + "height": 32.0, + "width": 320.0, + "x": 8.0, + "y": 8.0 + }, + "inlineTextNodes": [ { + "boundingBox": { + "height": 32.0, + "width": 320.0, + "x": 8.0, + "y": 8.0 + }, + "numCharacters": 10, + "startCharacterIndex": 0 + } ], + "layoutNodeIndex": 5, + "layoutText": "Some text.", + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "Some text.", + "styleIndex": 2 +} +{ + "backendNodeId": 19, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n" +} +{ + "attributes": [ { + "name": "src", + "value": "/iframe.html" + }, { + "name": "width", + "value": "400" + }, { + "name": "height", + "value": "200" + } ], + "backendNodeId": 20, + "boundingBox": { + "height": 205.0, + "width": 404.0, + "x": 8.0, + "y": 61.0 + }, + "contentDocumentIndex": 18, + "frameId": "?", + "layoutNodeIndex": 6, + "nodeName": "IFRAME", + "nodeType": 1, + "nodeValue": "", + "styleIndex": 3 +} +{ + "backendNodeId": 21, + "baseURL": "http://127.0.0.1/iframe.html", + "boundingBox": { + "height": 200.0, + "width": 400.0, + "x": 0.0, + "y": 0.0 + }, + "childNodeIndexes": [ 19 ], + "documentURL": "http://127.0.0.1/iframe.html", + "layoutNodeIndex": 7, + "nodeName": "#document", + "nodeType": 9, + "nodeValue": "" +} +{ + "backendNodeId": 22, + "boundingBox": { + "height": 200.0, + "width": 400.0, + "x": 10.0, + "y": 63.0 + }, + "childNodeIndexes": [ 20, 21 ], + "frameId": "?", + "layoutNodeIndex": 8, + "nodeName": "HTML", + "nodeType": 1, + "nodeValue": "", + "styleIndex": 4 +} +{ + "backendNodeId": 23, + "nodeName": "HEAD", + "nodeType": 1, + "nodeValue": "" +} +{ + "backendNodeId": 24, + "boundingBox": { + "height": 171.0, + "width": 384.0, + "x": 18.0, + "y": 71.0 + }, + "childNodeIndexes": [ 22, 23, 25 ], + "layoutNodeIndex": 9, + "nodeName": "BODY", + "nodeType": 1, + "nodeValue": "", + "styleIndex": 5 +} +{ + "backendNodeId": 25, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n" +} +{ + "backendNodeId": 26, + "boundingBox": { + "height": 37.0, + "width": 384.0, + "x": 18.0, + "y": 71.0 + }, + "childNodeIndexes": [ 24 ], + "layoutNodeIndex": 10, + "nodeName": "H1", + "nodeType": 1, + "nodeValue": "", + "styleIndex": 6 +} +{ + "backendNodeId": 27, + "boundingBox": { + "height": 36.0, + "width": 308.0, + "x": 8.0, + "y": 8.0 + }, + "inlineTextNodes": [ { + "boundingBox": { + "height": 36.0, + "width": 307.734375, + "x": 8.0, + "y": 8.0 + }, + "numCharacters": 22, + "startCharacterIndex": 0 + } ], + "layoutNodeIndex": 11, + "layoutText": "Hello from the iframe!", + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "Hello from the iframe!", + "styleIndex": 6 +} +{ + "backendNodeId": 28, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n\n\n" +} +{ + "backendNodeId": 29, + "boundingBox": { + "height": 0.0, + "width": 0.0, + "x": 0.0, + "y": 0.0 + }, + "layoutNodeIndex": 12, + "layoutText": "\n", + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n", + "styleIndex": 0 +} +{ + "attributes": [ { + "name": "id", + "value": "id2" + } ], + "backendNodeId": 30, + "boundingBox": { + "height": 97.0, + "width": 784.0, + "x": 8.0, + "y": 265.0 + }, + "childNodeIndexes": [ 28, 29, 48 ], + "layoutNodeIndex": 13, + "nodeName": "DIV", + "nodeType": 1, + "nodeValue": "", + "styleIndex": 0 +} +{ + "backendNodeId": 31, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n " +} +{ + "attributes": [ { + "name": "id", + "value": "id3" + } ], + "backendNodeId": 32, + "boundingBox": { + "height": 97.0, + "width": 784.0, + "x": 8.0, + "y": 265.0 + }, + "childNodeIndexes": [ 30, 31, 47 ], + "layoutNodeIndex": 14, + "nodeName": "DIV", + "nodeType": 1, + "nodeValue": "", + "styleIndex": 0 +} +{ + "backendNodeId": 33, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n " +} +{ + "attributes": [ { + "name": "id", + "value": "id4" + } ], + "backendNodeId": 34, + "boundingBox": { + "height": 97.0, + "width": 784.0, + "x": 8.0, + "y": 265.0 + }, + "childNodeIndexes": [ 32, 33, 35, 36, 38, 39, 40, 41, 46 ], + "layoutNodeIndex": 15, + "nodeName": "DIV", + "nodeType": 1, + "nodeValue": "", + "styleIndex": 0 +} +{ + "backendNodeId": 35, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n " +} +{ + "attributes": [ { + "name": "href", + "value": "https://www.google.com" + } ], + "backendNodeId": 36, + "boundingBox": { + "height": 17.0, + "width": 112.0, + "x": 8.0, + "y": 265.0 + }, + "childNodeIndexes": [ 34 ], + "isClickable": true, + "layoutNodeIndex": 16, + "nodeName": "A", + "nodeType": 1, + "nodeValue": "", + "styleIndex": 7 +} +{ + "backendNodeId": 37, + "boundingBox": { + "height": 17.0, + "width": 112.0, + "x": 8.0, + "y": 265.0 + }, + "inlineTextNodes": [ { + "boundingBox": { + "height": 16.0, + "width": 112.0, + "x": 8.0, + "y": 265.4375 + }, + "numCharacters": 7, + "startCharacterIndex": 0 + } ], + "layoutNodeIndex": 17, + "layoutText": "Google!", + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "Google!", + "styleIndex": 7 +} +{ + "backendNodeId": 38, + "boundingBox": { + "height": 0.0, + "width": 0.0, + "x": 0.0, + "y": 0.0 + }, + "layoutNodeIndex": 18, + "layoutText": "\n ", + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n ", + "styleIndex": 0 +} +{ + "backendNodeId": 39, + "boundingBox": { + "height": 17.0, + "width": 784.0, + "x": 8.0, + "y": 297.0 + }, + "childNodeIndexes": [ 37 ], + "layoutNodeIndex": 19, + "nodeName": "P", + "nodeType": 1, + "nodeValue": "", + "styleIndex": 8 +} +{ + "backendNodeId": 40, + "boundingBox": { + "height": 17.0, + "width": 192.0, + "x": 8.0, + "y": 297.0 + }, + "inlineTextNodes": [ { + "boundingBox": { + "height": 16.0, + "width": 192.0, + "x": 8.0, + "y": 297.4375 + }, + "numCharacters": 12, + "startCharacterIndex": 0 + } ], + "layoutNodeIndex": 20, + "layoutText": "A paragraph!", + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "A paragraph!", + "styleIndex": 8 +} +{ + "backendNodeId": 41, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n " +} +{ + "backendNodeId": 42, + "boundingBox": { + "height": 0.0, + "width": 0.0, + "x": 0.0, + "y": 0.0 + }, + "inlineTextNodes": [ { + "boundingBox": { + "height": 16.0, + "width": 0.0, + "x": 8.0, + "y": 329.4375 + }, + "numCharacters": 1, + "startCharacterIndex": 0 + } ], + "layoutNodeIndex": 21, + "layoutText": "\n", + "nodeName": "BR", + "nodeType": 1, + "nodeValue": "", + "styleIndex": 3 +} +{ + "backendNodeId": 43, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n " +} +{ + "attributes": [ { + "name": "class", + "value": "green" + } ], + "backendNodeId": 44, + "boundingBox": { + "height": 17.0, + "width": 784.0, + "x": 8.0, + "y": 345.0 + }, + "childNodeIndexes": [ 42, 43, 45 ], + "layoutNodeIndex": 22, + "nodeName": "DIV", + "nodeType": 1, + "nodeValue": "", + "styleIndex": 9 +} +{ + "backendNodeId": 45, + "boundingBox": { + "height": 17.0, + "width": 80.0, + "x": 8.0, + "y": 345.0 + }, + "inlineTextNodes": [ { + "boundingBox": { + "height": 16.0, + "width": 80.0, + "x": 8.0, + "y": 345.4375 + }, + "numCharacters": 5, + "startCharacterIndex": 0 + } ], + "layoutNodeIndex": 23, + "layoutText": "Some ", + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "Some ", + "styleIndex": 9 +} +{ + "backendNodeId": 46, + "boundingBox": { + "height": 17.0, + "width": 80.0, + "x": 88.0, + "y": 345.0 + }, + "childNodeIndexes": [ 44 ], + "layoutNodeIndex": 24, + "nodeName": "EM", + "nodeType": 1, + "nodeValue": "", + "styleIndex": 10 +} +{ + "backendNodeId": 47, + "boundingBox": { + "height": 17.0, + "width": 80.0, + "x": 88.0, + "y": 345.0 + }, + "inlineTextNodes": [ { + "boundingBox": { + "height": 16.0, + "width": 80.0, + "x": 88.0, + "y": 345.4375 + }, + "numCharacters": 5, + "startCharacterIndex": 0 + } ], + "layoutNodeIndex": 25, + "layoutText": "green", + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "green", + "styleIndex": 10 +} +{ + "backendNodeId": 48, + "boundingBox": { + "height": 17.0, + "width": 128.0, + "x": 168.0, + "y": 345.0 + }, + "inlineTextNodes": [ { + "boundingBox": { + "height": 16.0, + "width": 128.0, + "x": 168.0, + "y": 345.4375 + }, + "numCharacters": 8, + "startCharacterIndex": 0 + } ], + "layoutNodeIndex": 26, + "layoutText": " text...", + "nodeName": "#text", + "nodeType": 3, + "nodeValue": " text...", + "styleIndex": 9 +} +{ + "backendNodeId": 49, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n " +} +{ + "backendNodeId": 50, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n " +} +{ + "backendNodeId": 51, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n" +} +{ + "backendNodeId": 52, + "nodeName": "#text", + "nodeType": 3, + "nodeValue": "\n\n\n" +}
diff --git a/headless/lib/dom_tree_extraction_expected_styles.txt b/headless/lib/dom_tree_extraction_expected_styles.txt new file mode 100644 index 0000000..1d2a58023 --- /dev/null +++ b/headless/lib/dom_tree_extraction_expected_styles.txt
@@ -0,0 +1,110 @@ +{ + "color": "rgb(0, 0, 0)", + "display": "block", + "font-family": "ahem", + "font-style": "normal", + "margin-bottom": "0px", + "margin-left": "0px", + "margin-right": "0px", + "margin-top": "0px" +} +{ + "color": "rgb(0, 0, 0)", + "display": "block", + "font-family": "ahem", + "font-style": "normal", + "margin-bottom": "8px", + "margin-left": "8px", + "margin-right": "8px", + "margin-top": "8px" +} +{ + "color": "rgb(255, 0, 0)", + "display": "block", + "font-family": "ahem", + "font-style": "normal", + "margin-bottom": "21.44px", + "margin-left": "0px", + "margin-right": "0px", + "margin-top": "21.44px" +} +{ + "color": "rgb(0, 0, 0)", + "display": "inline", + "font-family": "ahem", + "font-style": "normal", + "margin-bottom": "0px", + "margin-left": "0px", + "margin-right": "0px", + "margin-top": "0px" +} +{ + "color": "rgb(0, 0, 0)", + "display": "block", + "font-family": "\"Times New Roman\"", + "font-style": "normal", + "margin-bottom": "0px", + "margin-left": "0px", + "margin-right": "0px", + "margin-top": "0px" +} +{ + "color": "rgb(0, 0, 0)", + "display": "block", + "font-family": "\"Times New Roman\"", + "font-style": "normal", + "margin-bottom": "8px", + "margin-left": "8px", + "margin-right": "8px", + "margin-top": "8px" +} +{ + "color": "rgb(0, 0, 0)", + "display": "block", + "font-family": "\"Times New Roman\"", + "font-style": "normal", + "margin-bottom": "21.44px", + "margin-left": "0px", + "margin-right": "0px", + "margin-top": "21.44px" +} +{ + "color": "rgb(0, 0, 238)", + "display": "inline", + "font-family": "ahem", + "font-style": "normal", + "margin-bottom": "0px", + "margin-left": "0px", + "margin-right": "0px", + "margin-top": "0px" +} +{ + "color": "rgb(0, 0, 0)", + "display": "block", + "font-family": "ahem", + "font-style": "normal", + "margin-bottom": "16px", + "margin-left": "0px", + "margin-right": "0px", + "margin-top": "16px" +} +{ + "color": "rgb(0, 128, 0)", + "display": "block", + "font-family": "ahem", + "font-style": "normal", + "margin-bottom": "0px", + "margin-left": "0px", + "margin-right": "0px", + "margin-top": "0px" +} +{ + "color": "rgb(0, 128, 0)", + "display": "inline", + "font-family": "ahem", + "font-style": "italic", + "margin-bottom": "0px", + "margin-left": "0px", + "margin-right": "0px", + "margin-top": "0px" +}
diff --git a/headless/lib/headless_devtools_client_browsertest.cc b/headless/lib/headless_devtools_client_browsertest.cc index 8a236c1..635aeea 100644 --- a/headless/lib/headless_devtools_client_browsertest.cc +++ b/headless/lib/headless_devtools_client_browsertest.cc
@@ -4,11 +4,15 @@ #include <memory> +#include "base/base_paths.h" +#include "base/files/file_util.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/message_loop/message_loop.h" +#include "base/path_service.h" #include "base/run_loop.h" #include "base/strings/string_util.h" +#include "base/threading/thread_restrictions.h" #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" #include "content/public/common/url_constants.h" @@ -1208,19 +1212,6 @@ HEADLESS_ASYNC_DEVTOOLED_TEST_F(DevToolsAttachAndDetachNotifications); -namespace { - -std::string NormaliseJSON(const std::string& json) { - std::unique_ptr<base::Value> parsed_json = base::JSONReader::Read(json); - DCHECK(parsed_json); - std::string normalized_json; - base::JSONWriter::WriteWithOptions( - *parsed_json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &normalized_json); - return normalized_json; -} - -} // namespace - class DomTreeExtractionBrowserTest : public HeadlessAsyncDevTooledBrowserTest, public page::Observer { public: @@ -1322,935 +1313,54 @@ computed_styles[i] = std::move(style); } - // TODO(eseckler): Extract expectation strings into external files to make - // them easier to maintain. - const std::vector<std::string> expected_dom_nodes = { - R"raw_string({ - "backendNodeId": 3, - "baseURL": "http://127.0.0.1/dom_tree_test.html", - "boundingBox": { - "height": 600.0, - "width": 800.0, - "x": 0.0, - "y": 0.0 - }, - "childNodeIndexes": [ 1 ], - "documentURL": "http://127.0.0.1/dom_tree_test.html", - "layoutNodeIndex": 0, - "nodeName": "#document", - "nodeType": 9, - "nodeValue": "" - } - )raw_string", + base::ThreadRestrictions::SetIOAllowed(true); + base::FilePath source_root_dir; + base::PathService::Get(base::DIR_SOURCE_ROOT, &source_root_dir); + base::FilePath expected_dom_nodes_path = + source_root_dir.Append(FILE_PATH_LITERAL( + "headless/lib/dom_tree_extraction_expected_nodes.txt")); + std::string expected_dom_nodes; + ASSERT_TRUE( + base::ReadFileToString(expected_dom_nodes_path, &expected_dom_nodes)); - R"raw_string({ - "backendNodeId": 4, - "boundingBox": { - "height": 600.0, - "width": 800.0, - "x": 0.0, - "y": 0.0 - }, - "childNodeIndexes": [ 2, 9, 10 ], - "frameId": "?", - "layoutNodeIndex": 1, - "nodeName": "HTML", - "nodeType": 1, - "nodeValue": "", - "styleIndex": 0 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 5, - "childNodeIndexes": [ 3, 4, 6, 7, 8 ], - "nodeName": "HEAD", - "nodeType": 1, - "nodeValue": "" - } - )raw_string", - - R"raw_string({ - "backendNodeId": 6, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n" - } - )raw_string", - - R"raw_string({ - "backendNodeId": 7, - "childNodeIndexes": [ 5 ], - "nodeName": "TITLE", - "nodeType": 1, - "nodeValue": "" - } - )raw_string", - - R"raw_string({ - "backendNodeId": 8, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "Hello world!" - } - )raw_string", - - R"raw_string({ - "backendNodeId": 9, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n" - } - )raw_string", - - R"raw_string({ - "attributes": [ { - "name": "href", - "value": "dom_tree_test.css" - }, { - "name": "rel", - "value": "stylesheet" - }, { - "name": "type", - "value": "text/css" - } ], - "backendNodeId": 10, - "nodeName": "LINK", - "nodeType": 1, - "nodeValue": "" - } - )raw_string", - - R"raw_string({ - "backendNodeId": 11, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n" - } - )raw_string", - - R"raw_string({ - "backendNodeId": 12, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n" - } - )raw_string", - - R"raw_string({ - "backendNodeId": 13, - "boundingBox": { - "height": 584.0, - "width": 784.0, - "x": 8.0, - "y": 8.0 - }, - "childNodeIndexes": [ 11, 12 ], - "layoutNodeIndex": 2, - "nodeName": "BODY", - "nodeType": 1, - "nodeValue": "", - "styleIndex": 1 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 14, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n" - } - )raw_string", - - R"raw_string({ - "attributes": [ { - "name": "id", - "value": "id1" - } ], - "backendNodeId": 15, - "boundingBox": { - "height": 354.0, - "width": 784.0, - "x": 8.0, - "y": 8.0 - }, - "childNodeIndexes": [ 13, 14, 16, 17, 26, 27, 49 ], - "layoutNodeIndex": 3, - "nodeName": "DIV", - "nodeType": 1, - "nodeValue": "", - "styleIndex": 0 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 16, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n" - } - )raw_string", - - R"raw_string({ - "attributes": [ { - "name": "class", - "value": "red" - } ], - "backendNodeId": 17, - "boundingBox": { - "height": 32.0, - "width": 784.0, - "x": 8.0, - "y": 8.0 - }, - "childNodeIndexes": [ 15 ], - "layoutNodeIndex": 4, - "nodeName": "H1", - "nodeType": 1, - "nodeValue": "", - "styleIndex": 2 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 18, - "boundingBox": { - "height": 32.0, - "width": 320.0, - "x": 8.0, - "y": 8.0 - }, - "inlineTextNodes": [ { - "boundingBox": { - "height": 32.0, - "width": 320.0, - "x": 8.0, - "y": 8.0 - }, - "numCharacters": 10, - "startCharacterIndex": 0 - } ], - "layoutNodeIndex": 5, - "layoutText": "Some text.", - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "Some text.", - "styleIndex": 2 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 19, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n" - } - )raw_string", - - R"raw_string({ - "attributes": [ { - "name": "src", - "value": "/iframe.html" - }, { - "name": "width", - "value": "400" - }, { - "name": "height", - "value": "200" - } ], - "backendNodeId": 20, - "boundingBox": { - "height": 205.0, - "width": 404.0, - "x": 8.0, - "y": 61.0 - }, - "contentDocumentIndex": 18, - "frameId": "?", - "layoutNodeIndex": 6, - "nodeName": "IFRAME", - "nodeType": 1, - "nodeValue": "", - "styleIndex": 3 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 21, - "baseURL": "http://127.0.0.1/iframe.html", - "boundingBox": { - "height": 200.0, - "width": 400.0, - "x": 0.0, - "y": 0.0 - }, - "childNodeIndexes": [ 19 ], - "documentURL": "http://127.0.0.1/iframe.html", - "layoutNodeIndex": 7, - "nodeName": "#document", - "nodeType": 9, - "nodeValue": "" - } - )raw_string", - - R"raw_string({ - "backendNodeId": 22, - "boundingBox": { - "height": 200.0, - "width": 400.0, - "x": 10.0, - "y": 63.0 - }, - "childNodeIndexes": [ 20, 21 ], - "frameId": "?", - "layoutNodeIndex": 8, - "nodeName": "HTML", - "nodeType": 1, - "nodeValue": "", - "styleIndex": 4 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 23, - "nodeName": "HEAD", - "nodeType": 1, - "nodeValue": "" - } - )raw_string", - - R"raw_string({ - "backendNodeId": 24, - "boundingBox": { - "height": 171.0, - "width": 384.0, - "x": 18.0, - "y": 71.0 - }, - "childNodeIndexes": [ 22, 23, 25 ], - "layoutNodeIndex": 9, - "nodeName": "BODY", - "nodeType": 1, - "nodeValue": "", - "styleIndex": 5 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 25, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n" - } - )raw_string", - - R"raw_string({ - "backendNodeId": 26, - "boundingBox": { - "height": 37.0, - "width": 384.0, - "x": 18.0, - "y": 71.0 - }, - "childNodeIndexes": [ 24 ], - "layoutNodeIndex": 10, - "nodeName": "H1", - "nodeType": 1, - "nodeValue": "", - "styleIndex": 6 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 27, - "boundingBox": { - "height": 36.0, - "width": 308.0, - "x": 8.0, - "y": 8.0 - }, - "inlineTextNodes": [ { - "boundingBox": { - "height": 36.0, - "width": 307.734375, - "x": 8.0, - "y": 8.0 - }, - "numCharacters": 22, - "startCharacterIndex": 0 - } ], - "layoutNodeIndex": 11, - "layoutText": "Hello from the iframe!", - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "Hello from the iframe!", - "styleIndex": 6 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 28, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n\n\n" - } - )raw_string", - - R"raw_string({ - "backendNodeId": 29, - "boundingBox": { - "height": 0.0, - "width": 0.0, - "x": 0.0, - "y": 0.0 - }, - "layoutNodeIndex": 12, - "layoutText": "\n", - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n", - "styleIndex": 0 - } - )raw_string", - - R"raw_string({ - "attributes": [ { - "name": "id", - "value": "id2" - } ], - "backendNodeId": 30, - "boundingBox": { - "height": 97.0, - "width": 784.0, - "x": 8.0, - "y": 265.0 - }, - "childNodeIndexes": [ 28, 29, 48 ], - "layoutNodeIndex": 13, - "nodeName": "DIV", - "nodeType": 1, - "nodeValue": "", - "styleIndex": 0 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 31, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n " - } - )raw_string", - - R"raw_string({ - "attributes": [ { - "name": "id", - "value": "id3" - } ], - "backendNodeId": 32, - "boundingBox": { - "height": 97.0, - "width": 784.0, - "x": 8.0, - "y": 265.0 - }, - "childNodeIndexes": [ 30, 31, 47 ], - "layoutNodeIndex": 14, - "nodeName": "DIV", - "nodeType": 1, - "nodeValue": "", - "styleIndex": 0 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 33, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n " - } - )raw_string", - - R"raw_string({ - "attributes": [ { - "name": "id", - "value": "id4" - } ], - "backendNodeId": 34, - "boundingBox": { - "height": 97.0, - "width": 784.0, - "x": 8.0, - "y": 265.0 - }, - "childNodeIndexes": [ 32, 33, 35, 36, 38, 39, 40, 41, 46 ], - "layoutNodeIndex": 15, - "nodeName": "DIV", - "nodeType": 1, - "nodeValue": "", - "styleIndex": 0 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 35, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n " - } - )raw_string", - - R"raw_string({ - "attributes": [ { - "name": "href", - "value": "https://www.google.com" - } ], - "backendNodeId": 36, - "boundingBox": { - "height": 17.0, - "width": 112.0, - "x": 8.0, - "y": 265.0 - }, - "childNodeIndexes": [ 34 ], - "layoutNodeIndex": 16, - "nodeName": "A", - "nodeType": 1, - "nodeValue": "", - "styleIndex": 7 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 37, - "boundingBox": { - "height": 17.0, - "width": 112.0, - "x": 8.0, - "y": 265.0 - }, - "inlineTextNodes": [ { - "boundingBox": { - "height": 16.0, - "width": 112.0, - "x": 8.0, - "y": 265.4375 - }, - "numCharacters": 7, - "startCharacterIndex": 0 - } ], - "layoutNodeIndex": 17, - "layoutText": "Google!", - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "Google!", - "styleIndex": 7 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 38, - "boundingBox": { - "height": 0.0, - "width": 0.0, - "x": 0.0, - "y": 0.0 - }, - "layoutNodeIndex": 18, - "layoutText": "\n ", - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n ", - "styleIndex": 0 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 39, - "boundingBox": { - "height": 17.0, - "width": 784.0, - "x": 8.0, - "y": 297.0 - }, - "childNodeIndexes": [ 37 ], - "layoutNodeIndex": 19, - "nodeName": "P", - "nodeType": 1, - "nodeValue": "", - "styleIndex": 8 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 40, - "boundingBox": { - "height": 17.0, - "width": 192.0, - "x": 8.0, - "y": 297.0 - }, - "inlineTextNodes": [ { - "boundingBox": { - "height": 16.0, - "width": 192.0, - "x": 8.0, - "y": 297.4375 - }, - "numCharacters": 12, - "startCharacterIndex": 0 - } ], - "layoutNodeIndex": 20, - "layoutText": "A paragraph!", - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "A paragraph!", - "styleIndex": 8 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 41, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n " - } - )raw_string", - - R"raw_string({ - "backendNodeId": 42, - "boundingBox": { - "height": 0.0, - "width": 0.0, - "x": 0.0, - "y": 0.0 - }, - "inlineTextNodes": [ { - "boundingBox": { - "height": 16.0, - "width": 0.0, - "x": 8.0, - "y": 329.4375 - }, - "numCharacters": 1, - "startCharacterIndex": 0 - } ], - "layoutNodeIndex": 21, - "layoutText": "\n", - "nodeName": "BR", - "nodeType": 1, - "nodeValue": "", - "styleIndex": 3 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 43, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n " - } - )raw_string", - - R"raw_string({ - "attributes": [ { - "name": "class", - "value": "green" - } ], - "backendNodeId": 44, - "boundingBox": { - "height": 17.0, - "width": 784.0, - "x": 8.0, - "y": 345.0 - }, - "childNodeIndexes": [ 42, 43, 45 ], - "layoutNodeIndex": 22, - "nodeName": "DIV", - "nodeType": 1, - "nodeValue": "", - "styleIndex": 9 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 45, - "boundingBox": { - "height": 17.0, - "width": 80.0, - "x": 8.0, - "y": 345.0 - }, - "inlineTextNodes": [ { - "boundingBox": { - "height": 16.0, - "width": 80.0, - "x": 8.0, - "y": 345.4375 - }, - "numCharacters": 5, - "startCharacterIndex": 0 - } ], - "layoutNodeIndex": 23, - "layoutText": "Some ", - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "Some ", - "styleIndex": 9 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 46, - "boundingBox": { - "height": 17.0, - "width": 80.0, - "x": 88.0, - "y": 345.0 - }, - "childNodeIndexes": [ 44 ], - "layoutNodeIndex": 24, - "nodeName": "EM", - "nodeType": 1, - "nodeValue": "", - "styleIndex": 10 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 47, - "boundingBox": { - "height": 17.0, - "width": 80.0, - "x": 88.0, - "y": 345.0 - }, - "inlineTextNodes": [ { - "boundingBox": { - "height": 16.0, - "width": 80.0, - "x": 88.0, - "y": 345.4375 - }, - "numCharacters": 5, - "startCharacterIndex": 0 - } ], - "layoutNodeIndex": 25, - "layoutText": "green", - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "green", - "styleIndex": 10 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 48, - "boundingBox": { - "height": 17.0, - "width": 128.0, - "x": 168.0, - "y": 345.0 - }, - "inlineTextNodes": [ { - "boundingBox": { - "height": 16.0, - "width": 128.0, - "x": 168.0, - "y": 345.4375 - }, - "numCharacters": 8, - "startCharacterIndex": 0 - } ], - "layoutNodeIndex": 26, - "layoutText": " text...", - "nodeName": "#text", - "nodeType": 3, - "nodeValue": " text...", - "styleIndex": 9 - } - )raw_string", - - R"raw_string({ - "backendNodeId": 49, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n " - } - )raw_string", - - R"raw_string({ - "backendNodeId": 50, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n " - } - )raw_string", - - R"raw_string({ - "backendNodeId": 51, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n" - } - )raw_string", - - R"raw_string({ - "backendNodeId": 52, - "nodeName": "#text", - "nodeType": 3, - "nodeValue": "\n\n\n" - } - )raw_string"}; - - EXPECT_EQ(expected_dom_nodes.size(), dom_nodes.size()); - + std::string dom_nodes_result; for (size_t i = 0; i < dom_nodes.size(); i++) { std::string result_json; base::JSONWriter::WriteWithOptions( *dom_nodes[i], base::JSONWriter::OPTIONS_PRETTY_PRINT, &result_json); - ASSERT_LT(i, expected_dom_nodes.size()); - EXPECT_EQ(NormaliseJSON(expected_dom_nodes[i]), result_json) - << " Node # " << i; + dom_nodes_result += result_json; } - const std::vector<std::string> expected_styles = { - R"raw_string({ - "color": "rgb(0, 0, 0)", - "display": "block", - "font-family": "ahem", - "font-style": "normal", - "margin-bottom": "0px", - "margin-left": "0px", - "margin-right": "0px", - "margin-top": "0px" - })raw_string", +#if defined(OS_WIN) + ASSERT_TRUE(base::RemoveChars(dom_nodes_result, "\r", &dom_nodes_result)); +#endif - R"raw_string({ - "color": "rgb(0, 0, 0)", - "display": "block", - "font-family": "ahem", - "font-style": "normal", - "margin-bottom": "8px", - "margin-left": "8px", - "margin-right": "8px", - "margin-top": "8px" - })raw_string", + EXPECT_EQ(expected_dom_nodes, dom_nodes_result); - R"raw_string({ - "color": "rgb(255, 0, 0)", - "display": "block", - "font-family": "ahem", - "font-style": "normal", - "margin-bottom": "21.44px", - "margin-left": "0px", - "margin-right": "0px", - "margin-top": "21.44px" - })raw_string", + base::FilePath expected_styles_path = + source_root_dir.Append(FILE_PATH_LITERAL( + "headless/lib/dom_tree_extraction_expected_styles.txt")); + std::string expected_computed_styles; + ASSERT_TRUE(base::ReadFileToString(expected_styles_path, + &expected_computed_styles)); - R"raw_string({ - "color": "rgb(0, 0, 0)", - "display": "inline", - "font-family": "ahem", - "font-style": "normal", - "margin-bottom": "0px", - "margin-left": "0px", - "margin-right": "0px", - "margin-top": "0px" - })raw_string", - - R"raw_string({ - "color": "rgb(0, 0, 0)", - "display": "block", - "font-family": "\"Times New Roman\"", - "font-style": "normal", - "margin-bottom": "0px", - "margin-left": "0px", - "margin-right": "0px", - "margin-top": "0px" - })raw_string", - - R"raw_string({ - "color": "rgb(0, 0, 0)", - "display": "block", - "font-family": "\"Times New Roman\"", - "font-style": "normal", - "margin-bottom": "8px", - "margin-left": "8px", - "margin-right": "8px", - "margin-top": "8px" - })raw_string", - - R"raw_string({ - "color": "rgb(0, 0, 0)", - "display": "block", - "font-family": "\"Times New Roman\"", - "font-style": "normal", - "margin-bottom": "21.44px", - "margin-left": "0px", - "margin-right": "0px", - "margin-top": "21.44px" - })raw_string", - - R"raw_string({ - "color": "rgb(0, 0, 238)", - "display": "inline", - "font-family": "ahem", - "font-style": "normal", - "margin-bottom": "0px", - "margin-left": "0px", - "margin-right": "0px", - "margin-top": "0px" - })raw_string", - - R"raw_string({ - "color": "rgb(0, 0, 0)", - "display": "block", - "font-family": "ahem", - "font-style": "normal", - "margin-bottom": "16px", - "margin-left": "0px", - "margin-right": "0px", - "margin-top": "16px" - })raw_string", - - R"raw_string({ - "color": "rgb(0, 128, 0)", - "display": "block", - "font-family": "ahem", - "font-style": "normal", - "margin-bottom": "0px", - "margin-left": "0px", - "margin-right": "0px", - "margin-top": "0px" - })raw_string", - - R"raw_string({ - "color": "rgb(0, 128, 0)", - "display": "inline", - "font-family": "ahem", - "font-style": "italic", - "margin-bottom": "0px", - "margin-left": "0px", - "margin-right": "0px", - "margin-top": "0px" - } - )raw_string"}; - - EXPECT_EQ(expected_styles.size(), computed_styles.size()); - + std::string computed_styles_result; for (size_t i = 0; i < computed_styles.size(); i++) { std::string result_json; base::JSONWriter::WriteWithOptions(*computed_styles[i], base::JSONWriter::OPTIONS_PRETTY_PRINT, &result_json); - ASSERT_LT(i, expected_styles.size()); - EXPECT_EQ(NormaliseJSON(expected_styles[i]), result_json) - << " Style # " << i; + computed_styles_result += result_json; } +#if defined(OS_WIN) + ASSERT_TRUE(base::RemoveChars(computed_styles_result, "\r", + &computed_styles_result)); +#endif + + EXPECT_EQ(expected_computed_styles, computed_styles_result); FinishAsynchronousTest(); } };
diff --git a/headless/test/headless_test_launcher.cc b/headless/test/headless_test_launcher.cc index 57015f4..17b229a 100644 --- a/headless/test/headless_test_launcher.cc +++ b/headless/test/headless_test_launcher.cc
@@ -5,8 +5,9 @@ #include <memory> #include "base/bind.h" +#include "base/command_line.h" #include "base/macros.h" -#include "base/sys_info.h" +#include "base/test/launcher/test_launcher.h" #include "content/public/test/content_test_suite_base.h" #include "content/public/test/test_launcher.h" #include "headless/lib/browser/headless_browser_impl.h" @@ -63,7 +64,11 @@ } // namespace headless int main(int argc, char** argv) { - int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); + base::CommandLine::Init(argc, argv); + size_t parallel_jobs = base::NumParallelJobs(); + if (parallel_jobs > 1U) { + parallel_jobs /= 2U; + } headless::HeadlessTestLauncherDelegate launcher_delegate; - return LaunchTests(&launcher_delegate, default_jobs, argc, argv); + return LaunchTests(&launcher_delegate, parallel_jobs, argc, argv); }
diff --git a/ios/chrome/app/main_controller.mm b/ios/chrome/app/main_controller.mm index 0686c956..11fe858b 100644 --- a/ios/chrome/app/main_controller.mm +++ b/ios/chrome/app/main_controller.mm
@@ -722,8 +722,6 @@ appState:self.appState]; _launchOptions = nil; - mojo::edk::Init(); - if (!_startupParameters) { // The startup parameters may create new tabs or navigations. If the restore // infobar is displayed now, it may be dismissed immediately and the user
diff --git a/ios/chrome/app/resources/BUILD.gn b/ios/chrome/app/resources/BUILD.gn index 1a2f4d5..5a1f813 100644 --- a/ios/chrome/app/resources/BUILD.gn +++ b/ios/chrome/app/resources/BUILD.gn
@@ -3,6 +3,7 @@ # found in the LICENSE file. import("//build/config/chrome_build.gni") +import("//build/config/ios/imageset.gni") import("//build/config/ios/rules.gni") import("//build/config/locales.gni") import("//ios/chrome/app/resources/ios_chrome_repack.gni") @@ -106,16 +107,28 @@ ] } -bundle_data("launchscreen_assets") { +imageset("launchscreen_app_logo") { sources = [ - "launchscreen_images.xcassets/Contents.json", "launchscreen_images.xcassets/launchscreen_app_logo.imageset/Contents.json", "launchscreen_images.xcassets/launchscreen_app_logo.imageset/launchscreen_app_logo.png", + "launchscreen_images.xcassets/launchscreen_app_logo.imageset/launchscreen_app_logo@2x.png", + "launchscreen_images.xcassets/launchscreen_app_logo.imageset/launchscreen_app_logo@3x.png", + ] +} + +imageset("launchscreen_brand_name") { + sources = [ "launchscreen_images.xcassets/launchscreen_brand_name.imageset/Contents.json", "launchscreen_images.xcassets/launchscreen_brand_name.imageset/launchscreen_brand_name.png", + "launchscreen_images.xcassets/launchscreen_brand_name.imageset/launchscreen_brand_name@2x.png", + "launchscreen_images.xcassets/launchscreen_brand_name.imageset/launchscreen_brand_name@3x.png", ] - outputs = [ - "{{bundle_resources_dir}}/{{source_file_part}}", +} + +group("launchscreen_assets") { + public_deps = [ + ":launchscreen_app_logo", + ":launchscreen_brand_name", ] }
diff --git a/ios/chrome/browser/BUILD.gn b/ios/chrome/browser/BUILD.gn index a09e007..7c5d2fb 100644 --- a/ios/chrome/browser/BUILD.gn +++ b/ios/chrome/browser/BUILD.gn
@@ -91,6 +91,7 @@ "//components/metrics_services_manager", "//components/net_log", "//components/ntp_tiles", + "//components/password_manager/core/common:common", "//components/pref_registry", "//components/prefs", "//components/proxy_config",
diff --git a/ios/chrome/browser/autocomplete/shortcuts_backend_factory.mm b/ios/chrome/browser/autocomplete/shortcuts_backend_factory.mm index a525e3e..5c3a8a7 100644 --- a/ios/chrome/browser/autocomplete/shortcuts_backend_factory.mm +++ b/ios/chrome/browser/autocomplete/shortcuts_backend_factory.mm
@@ -17,7 +17,6 @@ #include "ios/chrome/browser/search_engines/template_url_service_factory.h" #include "ios/chrome/browser/search_engines/ui_thread_search_terms_data.h" #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" -#include "ios/web/public/web_thread.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -34,7 +33,6 @@ base::MakeUnique<ios::UIThreadSearchTermsData>(browser_state), ios::HistoryServiceFactory::GetForBrowserState( browser_state, ServiceAccessType::EXPLICIT_ACCESS), - web::WebThread::GetTaskRunnerForThread(web::WebThread::DB), browser_state->GetStatePath().Append(kShortcutsDatabaseName), suppress_db)); return shortcuts_backend->Init() ? shortcuts_backend : nullptr;
diff --git a/ios/chrome/browser/autofill/BUILD.gn b/ios/chrome/browser/autofill/BUILD.gn index 6bed8fb6..a253eec 100644 --- a/ios/chrome/browser/autofill/BUILD.gn +++ b/ios/chrome/browser/autofill/BUILD.gn
@@ -24,6 +24,30 @@ "validation_rules_storage_factory.h", ] deps = [ + "resources:autofill_card_american_express", + "resources:autofill_card_diners", + "resources:autofill_card_discover", + "resources:autofill_card_generic", + "resources:autofill_card_jcb", + "resources:autofill_card_mastercard", + "resources:autofill_card_unionpay", + "resources:autofill_card_visa", + "resources:autofill_close", + "resources:autofill_close_pressed", + "resources:autofill_keyboard_background", + "resources:autofill_keyboard_background_left", + "resources:autofill_keyboard_background_right", + "resources:autofill_left_sep", + "resources:autofill_left_sep_RTL", + "resources:autofill_middle_sep", + "resources:autofill_next", + "resources:autofill_next_inactive", + "resources:autofill_next_pressed", + "resources:autofill_prev", + "resources:autofill_prev_inactive", + "resources:autofill_prev_pressed", + "resources:autofill_right_sep", + "resources:autofill_right_sep_RTL", "//base", "//base:i18n", "//components/autofill/core/browser",
diff --git a/ios/chrome/browser/autofill/resources/BUILD.gn b/ios/chrome/browser/autofill/resources/BUILD.gn new file mode 100644 index 0000000..ace0eff --- /dev/null +++ b/ios/chrome/browser/autofill/resources/BUILD.gn
@@ -0,0 +1,235 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ios/imageset.gni") + +imageset("autofill_card_american_express") { + sources = [ + "autofill_card_american_express.imageset/Contents.json", + "autofill_card_american_express.imageset/autofill_card_american_express.png", + "autofill_card_american_express.imageset/autofill_card_american_express@2x.png", + "autofill_card_american_express.imageset/autofill_card_american_express@2x~ipad.png", + "autofill_card_american_express.imageset/autofill_card_american_express@3x.png", + "autofill_card_american_express.imageset/autofill_card_american_express~ipad.png", + ] +} + +imageset("autofill_card_diners") { + sources = [ + "autofill_card_diners.imageset/Contents.json", + "autofill_card_diners.imageset/autofill_card_diners.png", + "autofill_card_diners.imageset/autofill_card_diners@2x.png", + "autofill_card_diners.imageset/autofill_card_diners@2x~ipad.png", + "autofill_card_diners.imageset/autofill_card_diners@3x.png", + "autofill_card_diners.imageset/autofill_card_diners~ipad.png", + ] +} + +imageset("autofill_card_discover") { + sources = [ + "autofill_card_discover.imageset/Contents.json", + "autofill_card_discover.imageset/autofill_card_discover.png", + "autofill_card_discover.imageset/autofill_card_discover@2x.png", + "autofill_card_discover.imageset/autofill_card_discover@2x~ipad.png", + "autofill_card_discover.imageset/autofill_card_discover@3x.png", + "autofill_card_discover.imageset/autofill_card_discover~ipad.png", + ] +} + +imageset("autofill_card_generic") { + sources = [ + "autofill_card_generic.imageset/Contents.json", + "autofill_card_generic.imageset/autofill_card_generic.png", + "autofill_card_generic.imageset/autofill_card_generic@2x.png", + "autofill_card_generic.imageset/autofill_card_generic@2x~ipad.png", + "autofill_card_generic.imageset/autofill_card_generic@3x.png", + "autofill_card_generic.imageset/autofill_card_generic~ipad.png", + ] +} + +imageset("autofill_card_jcb") { + sources = [ + "autofill_card_jcb.imageset/Contents.json", + "autofill_card_jcb.imageset/autofill_card_jcb.png", + "autofill_card_jcb.imageset/autofill_card_jcb@2x.png", + "autofill_card_jcb.imageset/autofill_card_jcb@2x~ipad.png", + "autofill_card_jcb.imageset/autofill_card_jcb@3x.png", + "autofill_card_jcb.imageset/autofill_card_jcb~ipad.png", + ] +} + +imageset("autofill_card_mastercard") { + sources = [ + "autofill_card_mastercard.imageset/Contents.json", + "autofill_card_mastercard.imageset/autofill_card_mastercard.png", + "autofill_card_mastercard.imageset/autofill_card_mastercard@2x.png", + "autofill_card_mastercard.imageset/autofill_card_mastercard@2x~ipad.png", + "autofill_card_mastercard.imageset/autofill_card_mastercard@3x.png", + "autofill_card_mastercard.imageset/autofill_card_mastercard~ipad.png", + ] +} + +imageset("autofill_card_unionpay") { + sources = [ + "autofill_card_unionpay.imageset/Contents.json", + "autofill_card_unionpay.imageset/autofill_card_unionpay.png", + "autofill_card_unionpay.imageset/autofill_card_unionpay@2x.png", + "autofill_card_unionpay.imageset/autofill_card_unionpay@2x~ipad.png", + "autofill_card_unionpay.imageset/autofill_card_unionpay@3x.png", + "autofill_card_unionpay.imageset/autofill_card_unionpay~ipad.png", + ] +} + +imageset("autofill_card_visa") { + sources = [ + "autofill_card_visa.imageset/Contents.json", + "autofill_card_visa.imageset/autofill_card_visa.png", + "autofill_card_visa.imageset/autofill_card_visa@2x.png", + "autofill_card_visa.imageset/autofill_card_visa@2x~ipad.png", + "autofill_card_visa.imageset/autofill_card_visa@3x.png", + "autofill_card_visa.imageset/autofill_card_visa~ipad.png", + ] +} + +imageset("autofill_close") { + sources = [ + "autofill_close.imageset/Contents.json", + "autofill_close.imageset/autofill_close.png", + "autofill_close.imageset/autofill_close@2x.png", + "autofill_close.imageset/autofill_close@3x.png", + ] +} + +imageset("autofill_close_pressed") { + sources = [ + "autofill_close_pressed.imageset/Contents.json", + "autofill_close_pressed.imageset/autofill_close_pressed.png", + "autofill_close_pressed.imageset/autofill_close_pressed@2x.png", + "autofill_close_pressed.imageset/autofill_close_pressed@3x.png", + ] +} + +imageset("autofill_keyboard_background") { + sources = [ + "autofill_keyboard_background.imageset/Contents.json", + "autofill_keyboard_background.imageset/autofill_keyboard_background.png", + "autofill_keyboard_background.imageset/autofill_keyboard_background@2x.png", + "autofill_keyboard_background.imageset/autofill_keyboard_background@3x.png", + ] +} + +imageset("autofill_keyboard_background_left") { + sources = [ + "autofill_keyboard_background_left.imageset/Contents.json", + "autofill_keyboard_background_left.imageset/autofill_keyboard_background_left.png", + "autofill_keyboard_background_left.imageset/autofill_keyboard_background_left@2x.png", + ] +} + +imageset("autofill_keyboard_background_right") { + sources = [ + "autofill_keyboard_background_right.imageset/Contents.json", + "autofill_keyboard_background_right.imageset/autofill_keyboard_background_right.png", + "autofill_keyboard_background_right.imageset/autofill_keyboard_background_right@2x.png", + ] +} + +imageset("autofill_left_sep") { + sources = [ + "autofill_left_sep.imageset/Contents.json", + "autofill_left_sep.imageset/autofill_left_sep.png", + "autofill_left_sep.imageset/autofill_left_sep@2x.png", + "autofill_left_sep.imageset/autofill_left_sep@3x.png", + ] +} + +imageset("autofill_left_sep_RTL") { + sources = [ + "autofill_left_sep_RTL.imageset/Contents.json", + "autofill_left_sep_RTL.imageset/autofill_left_sep_RTL.png", + "autofill_left_sep_RTL.imageset/autofill_left_sep_RTL@2x.png", + "autofill_left_sep_RTL.imageset/autofill_left_sep_RTL@3x.png", + ] +} + +imageset("autofill_middle_sep") { + sources = [ + "autofill_middle_sep.imageset/Contents.json", + "autofill_middle_sep.imageset/autofill_middle_sep.png", + "autofill_middle_sep.imageset/autofill_middle_sep@2x.png", + "autofill_middle_sep.imageset/autofill_middle_sep@3x.png", + ] +} + +imageset("autofill_next") { + sources = [ + "autofill_next.imageset/Contents.json", + "autofill_next.imageset/autofill_next.png", + "autofill_next.imageset/autofill_next@2x.png", + "autofill_next.imageset/autofill_next@3x.png", + ] +} + +imageset("autofill_next_inactive") { + sources = [ + "autofill_next_inactive.imageset/Contents.json", + "autofill_next_inactive.imageset/autofill_next_inactive.png", + "autofill_next_inactive.imageset/autofill_next_inactive@2x.png", + "autofill_next_inactive.imageset/autofill_next_inactive@3x.png", + ] +} + +imageset("autofill_next_pressed") { + sources = [ + "autofill_next_pressed.imageset/Contents.json", + "autofill_next_pressed.imageset/autofill_next_pressed.png", + "autofill_next_pressed.imageset/autofill_next_pressed@2x.png", + "autofill_next_pressed.imageset/autofill_next_pressed@3x.png", + ] +} + +imageset("autofill_prev") { + sources = [ + "autofill_prev.imageset/Contents.json", + "autofill_prev.imageset/autofill_prev.png", + "autofill_prev.imageset/autofill_prev@2x.png", + "autofill_prev.imageset/autofill_prev@3x.png", + ] +} + +imageset("autofill_prev_inactive") { + sources = [ + "autofill_prev_inactive.imageset/Contents.json", + "autofill_prev_inactive.imageset/autofill_prev_inactive.png", + "autofill_prev_inactive.imageset/autofill_prev_inactive@2x.png", + "autofill_prev_inactive.imageset/autofill_prev_inactive@3x.png", + ] +} + +imageset("autofill_prev_pressed") { + sources = [ + "autofill_prev_pressed.imageset/Contents.json", + "autofill_prev_pressed.imageset/autofill_prev_pressed.png", + "autofill_prev_pressed.imageset/autofill_prev_pressed@2x.png", + "autofill_prev_pressed.imageset/autofill_prev_pressed@3x.png", + ] +} + +imageset("autofill_right_sep") { + sources = [ + "autofill_right_sep.imageset/Contents.json", + "autofill_right_sep.imageset/autofill_right_sep.png", + "autofill_right_sep.imageset/autofill_right_sep@2x.png", + "autofill_right_sep.imageset/autofill_right_sep@3x.png", + ] +} + +imageset("autofill_right_sep_RTL") { + sources = [ + "autofill_right_sep_RTL.imageset/Contents.json", + "autofill_right_sep_RTL.imageset/autofill_right_sep_RTL.png", + "autofill_right_sep_RTL.imageset/autofill_right_sep_RTL@2x.png", + "autofill_right_sep_RTL.imageset/autofill_right_sep_RTL@3x.png", + ] +}
diff --git a/ios/chrome/browser/autofill/resources/autofill_card_american_express.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_card_american_express.imageset/Contents.json new file mode 100644 index 0000000..0c5a0cd0 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_card_american_express.imageset/Contents.json
@@ -0,0 +1,33 @@ +{ + "images": [ + { + "idiom": "iphone", + "scale": "1x", + "filename": "autofill_card_american_express.png" + }, + { + "idiom": "iphone", + "scale": "2x", + "filename": "autofill_card_american_express@2x.png" + }, + { + "idiom": "ipad", + "scale": "2x", + "filename": "autofill_card_american_express@2x~ipad.png" + }, + { + "idiom": "iphone", + "scale": "3x", + "filename": "autofill_card_american_express@3x.png" + }, + { + "idiom": "ipad", + "scale": "1x", + "filename": "autofill_card_american_express~ipad.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_card_american_express.png b/ios/chrome/browser/autofill/resources/autofill_card_american_express.imageset/autofill_card_american_express.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_american_express.png rename to ios/chrome/browser/autofill/resources/autofill_card_american_express.imageset/autofill_card_american_express.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_american_express@2x.png b/ios/chrome/browser/autofill/resources/autofill_card_american_express.imageset/autofill_card_american_express@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_american_express@2x.png rename to ios/chrome/browser/autofill/resources/autofill_card_american_express.imageset/autofill_card_american_express@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_american_express@2x~ipad.png b/ios/chrome/browser/autofill/resources/autofill_card_american_express.imageset/autofill_card_american_express@2x~ipad.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_american_express@2x~ipad.png rename to ios/chrome/browser/autofill/resources/autofill_card_american_express.imageset/autofill_card_american_express@2x~ipad.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_american_express@3x.png b/ios/chrome/browser/autofill/resources/autofill_card_american_express.imageset/autofill_card_american_express@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_american_express@3x.png rename to ios/chrome/browser/autofill/resources/autofill_card_american_express.imageset/autofill_card_american_express@3x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_american_express~ipad.png b/ios/chrome/browser/autofill/resources/autofill_card_american_express.imageset/autofill_card_american_express~ipad.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_american_express~ipad.png rename to ios/chrome/browser/autofill/resources/autofill_card_american_express.imageset/autofill_card_american_express~ipad.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_card_diners.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_card_diners.imageset/Contents.json new file mode 100644 index 0000000..9bc9b67 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_card_diners.imageset/Contents.json
@@ -0,0 +1,33 @@ +{ + "images": [ + { + "idiom": "iphone", + "scale": "1x", + "filename": "autofill_card_diners.png" + }, + { + "idiom": "iphone", + "scale": "2x", + "filename": "autofill_card_diners@2x.png" + }, + { + "idiom": "ipad", + "scale": "2x", + "filename": "autofill_card_diners@2x~ipad.png" + }, + { + "idiom": "iphone", + "scale": "3x", + "filename": "autofill_card_diners@3x.png" + }, + { + "idiom": "ipad", + "scale": "1x", + "filename": "autofill_card_diners~ipad.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_card_diners.png b/ios/chrome/browser/autofill/resources/autofill_card_diners.imageset/autofill_card_diners.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_diners.png rename to ios/chrome/browser/autofill/resources/autofill_card_diners.imageset/autofill_card_diners.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_diners@2x.png b/ios/chrome/browser/autofill/resources/autofill_card_diners.imageset/autofill_card_diners@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_diners@2x.png rename to ios/chrome/browser/autofill/resources/autofill_card_diners.imageset/autofill_card_diners@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_diners@2x~ipad.png b/ios/chrome/browser/autofill/resources/autofill_card_diners.imageset/autofill_card_diners@2x~ipad.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_diners@2x~ipad.png rename to ios/chrome/browser/autofill/resources/autofill_card_diners.imageset/autofill_card_diners@2x~ipad.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_diners@3x.png b/ios/chrome/browser/autofill/resources/autofill_card_diners.imageset/autofill_card_diners@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_diners@3x.png rename to ios/chrome/browser/autofill/resources/autofill_card_diners.imageset/autofill_card_diners@3x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_diners~ipad.png b/ios/chrome/browser/autofill/resources/autofill_card_diners.imageset/autofill_card_diners~ipad.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_diners~ipad.png rename to ios/chrome/browser/autofill/resources/autofill_card_diners.imageset/autofill_card_diners~ipad.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_card_discover.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_card_discover.imageset/Contents.json new file mode 100644 index 0000000..76a0e979 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_card_discover.imageset/Contents.json
@@ -0,0 +1,33 @@ +{ + "images": [ + { + "idiom": "iphone", + "scale": "1x", + "filename": "autofill_card_discover.png" + }, + { + "idiom": "iphone", + "scale": "2x", + "filename": "autofill_card_discover@2x.png" + }, + { + "idiom": "ipad", + "scale": "2x", + "filename": "autofill_card_discover@2x~ipad.png" + }, + { + "idiom": "iphone", + "scale": "3x", + "filename": "autofill_card_discover@3x.png" + }, + { + "idiom": "ipad", + "scale": "1x", + "filename": "autofill_card_discover~ipad.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_card_discover.png b/ios/chrome/browser/autofill/resources/autofill_card_discover.imageset/autofill_card_discover.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_discover.png rename to ios/chrome/browser/autofill/resources/autofill_card_discover.imageset/autofill_card_discover.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_discover@2x.png b/ios/chrome/browser/autofill/resources/autofill_card_discover.imageset/autofill_card_discover@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_discover@2x.png rename to ios/chrome/browser/autofill/resources/autofill_card_discover.imageset/autofill_card_discover@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_discover@2x~ipad.png b/ios/chrome/browser/autofill/resources/autofill_card_discover.imageset/autofill_card_discover@2x~ipad.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_discover@2x~ipad.png rename to ios/chrome/browser/autofill/resources/autofill_card_discover.imageset/autofill_card_discover@2x~ipad.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_discover@3x.png b/ios/chrome/browser/autofill/resources/autofill_card_discover.imageset/autofill_card_discover@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_discover@3x.png rename to ios/chrome/browser/autofill/resources/autofill_card_discover.imageset/autofill_card_discover@3x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_discover~ipad.png b/ios/chrome/browser/autofill/resources/autofill_card_discover.imageset/autofill_card_discover~ipad.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_discover~ipad.png rename to ios/chrome/browser/autofill/resources/autofill_card_discover.imageset/autofill_card_discover~ipad.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_card_generic.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_card_generic.imageset/Contents.json new file mode 100644 index 0000000..496f7ce --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_card_generic.imageset/Contents.json
@@ -0,0 +1,33 @@ +{ + "images": [ + { + "idiom": "iphone", + "scale": "1x", + "filename": "autofill_card_generic.png" + }, + { + "idiom": "iphone", + "scale": "2x", + "filename": "autofill_card_generic@2x.png" + }, + { + "idiom": "ipad", + "scale": "2x", + "filename": "autofill_card_generic@2x~ipad.png" + }, + { + "idiom": "iphone", + "scale": "3x", + "filename": "autofill_card_generic@3x.png" + }, + { + "idiom": "ipad", + "scale": "1x", + "filename": "autofill_card_generic~ipad.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_card_generic.png b/ios/chrome/browser/autofill/resources/autofill_card_generic.imageset/autofill_card_generic.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_generic.png rename to ios/chrome/browser/autofill/resources/autofill_card_generic.imageset/autofill_card_generic.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_generic@2x.png b/ios/chrome/browser/autofill/resources/autofill_card_generic.imageset/autofill_card_generic@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_generic@2x.png rename to ios/chrome/browser/autofill/resources/autofill_card_generic.imageset/autofill_card_generic@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_generic@2x~ipad.png b/ios/chrome/browser/autofill/resources/autofill_card_generic.imageset/autofill_card_generic@2x~ipad.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_generic@2x~ipad.png rename to ios/chrome/browser/autofill/resources/autofill_card_generic.imageset/autofill_card_generic@2x~ipad.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_generic@3x.png b/ios/chrome/browser/autofill/resources/autofill_card_generic.imageset/autofill_card_generic@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_generic@3x.png rename to ios/chrome/browser/autofill/resources/autofill_card_generic.imageset/autofill_card_generic@3x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_generic~ipad.png b/ios/chrome/browser/autofill/resources/autofill_card_generic.imageset/autofill_card_generic~ipad.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_generic~ipad.png rename to ios/chrome/browser/autofill/resources/autofill_card_generic.imageset/autofill_card_generic~ipad.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_card_jcb.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_card_jcb.imageset/Contents.json new file mode 100644 index 0000000..545eb0e --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_card_jcb.imageset/Contents.json
@@ -0,0 +1,33 @@ +{ + "images": [ + { + "idiom": "iphone", + "scale": "1x", + "filename": "autofill_card_jcb.png" + }, + { + "idiom": "iphone", + "scale": "2x", + "filename": "autofill_card_jcb@2x.png" + }, + { + "idiom": "ipad", + "scale": "2x", + "filename": "autofill_card_jcb@2x~ipad.png" + }, + { + "idiom": "iphone", + "scale": "3x", + "filename": "autofill_card_jcb@3x.png" + }, + { + "idiom": "ipad", + "scale": "1x", + "filename": "autofill_card_jcb~ipad.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_card_jcb.png b/ios/chrome/browser/autofill/resources/autofill_card_jcb.imageset/autofill_card_jcb.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_jcb.png rename to ios/chrome/browser/autofill/resources/autofill_card_jcb.imageset/autofill_card_jcb.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_jcb@2x.png b/ios/chrome/browser/autofill/resources/autofill_card_jcb.imageset/autofill_card_jcb@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_jcb@2x.png rename to ios/chrome/browser/autofill/resources/autofill_card_jcb.imageset/autofill_card_jcb@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_jcb@2x~ipad.png b/ios/chrome/browser/autofill/resources/autofill_card_jcb.imageset/autofill_card_jcb@2x~ipad.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_jcb@2x~ipad.png rename to ios/chrome/browser/autofill/resources/autofill_card_jcb.imageset/autofill_card_jcb@2x~ipad.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_jcb@3x.png b/ios/chrome/browser/autofill/resources/autofill_card_jcb.imageset/autofill_card_jcb@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_jcb@3x.png rename to ios/chrome/browser/autofill/resources/autofill_card_jcb.imageset/autofill_card_jcb@3x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_jcb~ipad.png b/ios/chrome/browser/autofill/resources/autofill_card_jcb.imageset/autofill_card_jcb~ipad.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_jcb~ipad.png rename to ios/chrome/browser/autofill/resources/autofill_card_jcb.imageset/autofill_card_jcb~ipad.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_card_mastercard.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_card_mastercard.imageset/Contents.json new file mode 100644 index 0000000..4003df3 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_card_mastercard.imageset/Contents.json
@@ -0,0 +1,33 @@ +{ + "images": [ + { + "idiom": "iphone", + "scale": "1x", + "filename": "autofill_card_mastercard.png" + }, + { + "idiom": "iphone", + "scale": "2x", + "filename": "autofill_card_mastercard@2x.png" + }, + { + "idiom": "ipad", + "scale": "2x", + "filename": "autofill_card_mastercard@2x~ipad.png" + }, + { + "idiom": "iphone", + "scale": "3x", + "filename": "autofill_card_mastercard@3x.png" + }, + { + "idiom": "ipad", + "scale": "1x", + "filename": "autofill_card_mastercard~ipad.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_card_mastercard.png b/ios/chrome/browser/autofill/resources/autofill_card_mastercard.imageset/autofill_card_mastercard.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_mastercard.png rename to ios/chrome/browser/autofill/resources/autofill_card_mastercard.imageset/autofill_card_mastercard.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_mastercard@2x.png b/ios/chrome/browser/autofill/resources/autofill_card_mastercard.imageset/autofill_card_mastercard@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_mastercard@2x.png rename to ios/chrome/browser/autofill/resources/autofill_card_mastercard.imageset/autofill_card_mastercard@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_mastercard@2x~ipad.png b/ios/chrome/browser/autofill/resources/autofill_card_mastercard.imageset/autofill_card_mastercard@2x~ipad.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_mastercard@2x~ipad.png rename to ios/chrome/browser/autofill/resources/autofill_card_mastercard.imageset/autofill_card_mastercard@2x~ipad.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_mastercard@3x.png b/ios/chrome/browser/autofill/resources/autofill_card_mastercard.imageset/autofill_card_mastercard@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_mastercard@3x.png rename to ios/chrome/browser/autofill/resources/autofill_card_mastercard.imageset/autofill_card_mastercard@3x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_mastercard~ipad.png b/ios/chrome/browser/autofill/resources/autofill_card_mastercard.imageset/autofill_card_mastercard~ipad.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_mastercard~ipad.png rename to ios/chrome/browser/autofill/resources/autofill_card_mastercard.imageset/autofill_card_mastercard~ipad.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_card_unionpay.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_card_unionpay.imageset/Contents.json new file mode 100644 index 0000000..488111b5 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_card_unionpay.imageset/Contents.json
@@ -0,0 +1,33 @@ +{ + "images": [ + { + "idiom": "iphone", + "scale": "1x", + "filename": "autofill_card_unionpay.png" + }, + { + "idiom": "iphone", + "scale": "2x", + "filename": "autofill_card_unionpay@2x.png" + }, + { + "idiom": "ipad", + "scale": "2x", + "filename": "autofill_card_unionpay@2x~ipad.png" + }, + { + "idiom": "iphone", + "scale": "3x", + "filename": "autofill_card_unionpay@3x.png" + }, + { + "idiom": "ipad", + "scale": "1x", + "filename": "autofill_card_unionpay~ipad.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_card_unionpay.png b/ios/chrome/browser/autofill/resources/autofill_card_unionpay.imageset/autofill_card_unionpay.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_unionpay.png rename to ios/chrome/browser/autofill/resources/autofill_card_unionpay.imageset/autofill_card_unionpay.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_unionpay@2x.png b/ios/chrome/browser/autofill/resources/autofill_card_unionpay.imageset/autofill_card_unionpay@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_unionpay@2x.png rename to ios/chrome/browser/autofill/resources/autofill_card_unionpay.imageset/autofill_card_unionpay@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_unionpay@2x~ipad.png b/ios/chrome/browser/autofill/resources/autofill_card_unionpay.imageset/autofill_card_unionpay@2x~ipad.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_unionpay@2x~ipad.png rename to ios/chrome/browser/autofill/resources/autofill_card_unionpay.imageset/autofill_card_unionpay@2x~ipad.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_unionpay@3x.png b/ios/chrome/browser/autofill/resources/autofill_card_unionpay.imageset/autofill_card_unionpay@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_unionpay@3x.png rename to ios/chrome/browser/autofill/resources/autofill_card_unionpay.imageset/autofill_card_unionpay@3x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_unionpay~ipad.png b/ios/chrome/browser/autofill/resources/autofill_card_unionpay.imageset/autofill_card_unionpay~ipad.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_unionpay~ipad.png rename to ios/chrome/browser/autofill/resources/autofill_card_unionpay.imageset/autofill_card_unionpay~ipad.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_card_visa.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_card_visa.imageset/Contents.json new file mode 100644 index 0000000..1cfc085 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_card_visa.imageset/Contents.json
@@ -0,0 +1,33 @@ +{ + "images": [ + { + "idiom": "iphone", + "scale": "1x", + "filename": "autofill_card_visa.png" + }, + { + "idiom": "iphone", + "scale": "2x", + "filename": "autofill_card_visa@2x.png" + }, + { + "idiom": "ipad", + "scale": "2x", + "filename": "autofill_card_visa@2x~ipad.png" + }, + { + "idiom": "iphone", + "scale": "3x", + "filename": "autofill_card_visa@3x.png" + }, + { + "idiom": "ipad", + "scale": "1x", + "filename": "autofill_card_visa~ipad.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_card_visa.png b/ios/chrome/browser/autofill/resources/autofill_card_visa.imageset/autofill_card_visa.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_visa.png rename to ios/chrome/browser/autofill/resources/autofill_card_visa.imageset/autofill_card_visa.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_visa@2x.png b/ios/chrome/browser/autofill/resources/autofill_card_visa.imageset/autofill_card_visa@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_visa@2x.png rename to ios/chrome/browser/autofill/resources/autofill_card_visa.imageset/autofill_card_visa@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_visa@2x~ipad.png b/ios/chrome/browser/autofill/resources/autofill_card_visa.imageset/autofill_card_visa@2x~ipad.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_visa@2x~ipad.png rename to ios/chrome/browser/autofill/resources/autofill_card_visa.imageset/autofill_card_visa@2x~ipad.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_visa@3x.png b/ios/chrome/browser/autofill/resources/autofill_card_visa.imageset/autofill_card_visa@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_visa@3x.png rename to ios/chrome/browser/autofill/resources/autofill_card_visa.imageset/autofill_card_visa@3x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_card_visa~ipad.png b/ios/chrome/browser/autofill/resources/autofill_card_visa.imageset/autofill_card_visa~ipad.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_card_visa~ipad.png rename to ios/chrome/browser/autofill/resources/autofill_card_visa.imageset/autofill_card_visa~ipad.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_close.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_close.imageset/Contents.json new file mode 100644 index 0000000..a800a74 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_close.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "autofill_close.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "autofill_close@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "autofill_close@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_close.png b/ios/chrome/browser/autofill/resources/autofill_close.imageset/autofill_close.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_close.png rename to ios/chrome/browser/autofill/resources/autofill_close.imageset/autofill_close.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_close@2x.png b/ios/chrome/browser/autofill/resources/autofill_close.imageset/autofill_close@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_close@2x.png rename to ios/chrome/browser/autofill/resources/autofill_close.imageset/autofill_close@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_close@3x.png b/ios/chrome/browser/autofill/resources/autofill_close.imageset/autofill_close@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_close@3x.png rename to ios/chrome/browser/autofill/resources/autofill_close.imageset/autofill_close@3x.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_close_pressed.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_close_pressed.imageset/Contents.json new file mode 100644 index 0000000..9afcf8c --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_close_pressed.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "autofill_close_pressed.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "autofill_close_pressed@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "autofill_close_pressed@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_close_pressed.png b/ios/chrome/browser/autofill/resources/autofill_close_pressed.imageset/autofill_close_pressed.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_close_pressed.png rename to ios/chrome/browser/autofill/resources/autofill_close_pressed.imageset/autofill_close_pressed.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_close_pressed@2x.png b/ios/chrome/browser/autofill/resources/autofill_close_pressed.imageset/autofill_close_pressed@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_close_pressed@2x.png rename to ios/chrome/browser/autofill/resources/autofill_close_pressed.imageset/autofill_close_pressed@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_close_pressed@3x.png b/ios/chrome/browser/autofill/resources/autofill_close_pressed.imageset/autofill_close_pressed@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_close_pressed@3x.png rename to ios/chrome/browser/autofill/resources/autofill_close_pressed.imageset/autofill_close_pressed@3x.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_keyboard_background.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_keyboard_background.imageset/Contents.json new file mode 100644 index 0000000..62d0739 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_keyboard_background.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "autofill_keyboard_background.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "autofill_keyboard_background@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "autofill_keyboard_background@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_keyboard_background.png b/ios/chrome/browser/autofill/resources/autofill_keyboard_background.imageset/autofill_keyboard_background.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_keyboard_background.png rename to ios/chrome/browser/autofill/resources/autofill_keyboard_background.imageset/autofill_keyboard_background.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_keyboard_background@2x.png b/ios/chrome/browser/autofill/resources/autofill_keyboard_background.imageset/autofill_keyboard_background@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_keyboard_background@2x.png rename to ios/chrome/browser/autofill/resources/autofill_keyboard_background.imageset/autofill_keyboard_background@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_keyboard_background@3x.png b/ios/chrome/browser/autofill/resources/autofill_keyboard_background.imageset/autofill_keyboard_background@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_keyboard_background@3x.png rename to ios/chrome/browser/autofill/resources/autofill_keyboard_background.imageset/autofill_keyboard_background@3x.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_keyboard_background_left.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_keyboard_background_left.imageset/Contents.json new file mode 100644 index 0000000..2c4f6e8 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_keyboard_background_left.imageset/Contents.json
@@ -0,0 +1,18 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "autofill_keyboard_background_left.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "autofill_keyboard_background_left@2x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_keyboard_background_left.png b/ios/chrome/browser/autofill/resources/autofill_keyboard_background_left.imageset/autofill_keyboard_background_left.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_keyboard_background_left.png rename to ios/chrome/browser/autofill/resources/autofill_keyboard_background_left.imageset/autofill_keyboard_background_left.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_keyboard_background_left@2x.png b/ios/chrome/browser/autofill/resources/autofill_keyboard_background_left.imageset/autofill_keyboard_background_left@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_keyboard_background_left@2x.png rename to ios/chrome/browser/autofill/resources/autofill_keyboard_background_left.imageset/autofill_keyboard_background_left@2x.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_keyboard_background_right.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_keyboard_background_right.imageset/Contents.json new file mode 100644 index 0000000..d2ac3e3 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_keyboard_background_right.imageset/Contents.json
@@ -0,0 +1,18 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "autofill_keyboard_background_right.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "autofill_keyboard_background_right@2x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_keyboard_background_right.png b/ios/chrome/browser/autofill/resources/autofill_keyboard_background_right.imageset/autofill_keyboard_background_right.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_keyboard_background_right.png rename to ios/chrome/browser/autofill/resources/autofill_keyboard_background_right.imageset/autofill_keyboard_background_right.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_keyboard_background_right@2x.png b/ios/chrome/browser/autofill/resources/autofill_keyboard_background_right.imageset/autofill_keyboard_background_right@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_keyboard_background_right@2x.png rename to ios/chrome/browser/autofill/resources/autofill_keyboard_background_right.imageset/autofill_keyboard_background_right@2x.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_left_sep.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_left_sep.imageset/Contents.json new file mode 100644 index 0000000..0cce754 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_left_sep.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "autofill_left_sep.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "autofill_left_sep@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "autofill_left_sep@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_left_sep.png b/ios/chrome/browser/autofill/resources/autofill_left_sep.imageset/autofill_left_sep.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_left_sep.png rename to ios/chrome/browser/autofill/resources/autofill_left_sep.imageset/autofill_left_sep.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_left_sep@2x.png b/ios/chrome/browser/autofill/resources/autofill_left_sep.imageset/autofill_left_sep@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_left_sep@2x.png rename to ios/chrome/browser/autofill/resources/autofill_left_sep.imageset/autofill_left_sep@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_left_sep@3x.png b/ios/chrome/browser/autofill/resources/autofill_left_sep.imageset/autofill_left_sep@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_left_sep@3x.png rename to ios/chrome/browser/autofill/resources/autofill_left_sep.imageset/autofill_left_sep@3x.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_left_sep_RTL.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_left_sep_RTL.imageset/Contents.json new file mode 100644 index 0000000..fc3e70e2 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_left_sep_RTL.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "autofill_left_sep_RTL.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "autofill_left_sep_RTL@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "autofill_left_sep_RTL@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_left_sep_RTL.png b/ios/chrome/browser/autofill/resources/autofill_left_sep_RTL.imageset/autofill_left_sep_RTL.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_left_sep_RTL.png rename to ios/chrome/browser/autofill/resources/autofill_left_sep_RTL.imageset/autofill_left_sep_RTL.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_left_sep_RTL@2x.png b/ios/chrome/browser/autofill/resources/autofill_left_sep_RTL.imageset/autofill_left_sep_RTL@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_left_sep_RTL@2x.png rename to ios/chrome/browser/autofill/resources/autofill_left_sep_RTL.imageset/autofill_left_sep_RTL@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_left_sep_RTL@3x.png b/ios/chrome/browser/autofill/resources/autofill_left_sep_RTL.imageset/autofill_left_sep_RTL@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_left_sep_RTL@3x.png rename to ios/chrome/browser/autofill/resources/autofill_left_sep_RTL.imageset/autofill_left_sep_RTL@3x.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_middle_sep.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_middle_sep.imageset/Contents.json new file mode 100644 index 0000000..290c2e7 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_middle_sep.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "autofill_middle_sep.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "autofill_middle_sep@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "autofill_middle_sep@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_middle_sep.png b/ios/chrome/browser/autofill/resources/autofill_middle_sep.imageset/autofill_middle_sep.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_middle_sep.png rename to ios/chrome/browser/autofill/resources/autofill_middle_sep.imageset/autofill_middle_sep.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_middle_sep@2x.png b/ios/chrome/browser/autofill/resources/autofill_middle_sep.imageset/autofill_middle_sep@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_middle_sep@2x.png rename to ios/chrome/browser/autofill/resources/autofill_middle_sep.imageset/autofill_middle_sep@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_middle_sep@3x.png b/ios/chrome/browser/autofill/resources/autofill_middle_sep.imageset/autofill_middle_sep@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_middle_sep@3x.png rename to ios/chrome/browser/autofill/resources/autofill_middle_sep.imageset/autofill_middle_sep@3x.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_next.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_next.imageset/Contents.json new file mode 100644 index 0000000..08b4c177 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_next.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "autofill_next.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "autofill_next@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "autofill_next@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_next.png b/ios/chrome/browser/autofill/resources/autofill_next.imageset/autofill_next.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_next.png rename to ios/chrome/browser/autofill/resources/autofill_next.imageset/autofill_next.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_next@2x.png b/ios/chrome/browser/autofill/resources/autofill_next.imageset/autofill_next@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_next@2x.png rename to ios/chrome/browser/autofill/resources/autofill_next.imageset/autofill_next@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_next@3x.png b/ios/chrome/browser/autofill/resources/autofill_next.imageset/autofill_next@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_next@3x.png rename to ios/chrome/browser/autofill/resources/autofill_next.imageset/autofill_next@3x.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_next_inactive.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_next_inactive.imageset/Contents.json new file mode 100644 index 0000000..3c63b13 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_next_inactive.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "autofill_next_inactive.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "autofill_next_inactive@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "autofill_next_inactive@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_next_inactive.png b/ios/chrome/browser/autofill/resources/autofill_next_inactive.imageset/autofill_next_inactive.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_next_inactive.png rename to ios/chrome/browser/autofill/resources/autofill_next_inactive.imageset/autofill_next_inactive.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_next_inactive@2x.png b/ios/chrome/browser/autofill/resources/autofill_next_inactive.imageset/autofill_next_inactive@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_next_inactive@2x.png rename to ios/chrome/browser/autofill/resources/autofill_next_inactive.imageset/autofill_next_inactive@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_next_inactive@3x.png b/ios/chrome/browser/autofill/resources/autofill_next_inactive.imageset/autofill_next_inactive@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_next_inactive@3x.png rename to ios/chrome/browser/autofill/resources/autofill_next_inactive.imageset/autofill_next_inactive@3x.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_next_pressed.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_next_pressed.imageset/Contents.json new file mode 100644 index 0000000..3a35272 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_next_pressed.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "autofill_next_pressed.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "autofill_next_pressed@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "autofill_next_pressed@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_next_pressed.png b/ios/chrome/browser/autofill/resources/autofill_next_pressed.imageset/autofill_next_pressed.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_next_pressed.png rename to ios/chrome/browser/autofill/resources/autofill_next_pressed.imageset/autofill_next_pressed.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_next_pressed@2x.png b/ios/chrome/browser/autofill/resources/autofill_next_pressed.imageset/autofill_next_pressed@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_next_pressed@2x.png rename to ios/chrome/browser/autofill/resources/autofill_next_pressed.imageset/autofill_next_pressed@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_next_pressed@3x.png b/ios/chrome/browser/autofill/resources/autofill_next_pressed.imageset/autofill_next_pressed@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_next_pressed@3x.png rename to ios/chrome/browser/autofill/resources/autofill_next_pressed.imageset/autofill_next_pressed@3x.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_prev.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_prev.imageset/Contents.json new file mode 100644 index 0000000..c051d1260 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_prev.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "autofill_prev.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "autofill_prev@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "autofill_prev@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_prev.png b/ios/chrome/browser/autofill/resources/autofill_prev.imageset/autofill_prev.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_prev.png rename to ios/chrome/browser/autofill/resources/autofill_prev.imageset/autofill_prev.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_prev@2x.png b/ios/chrome/browser/autofill/resources/autofill_prev.imageset/autofill_prev@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_prev@2x.png rename to ios/chrome/browser/autofill/resources/autofill_prev.imageset/autofill_prev@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_prev@3x.png b/ios/chrome/browser/autofill/resources/autofill_prev.imageset/autofill_prev@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_prev@3x.png rename to ios/chrome/browser/autofill/resources/autofill_prev.imageset/autofill_prev@3x.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_prev_inactive.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_prev_inactive.imageset/Contents.json new file mode 100644 index 0000000..84f7064 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_prev_inactive.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "autofill_prev_inactive.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "autofill_prev_inactive@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "autofill_prev_inactive@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_prev_inactive.png b/ios/chrome/browser/autofill/resources/autofill_prev_inactive.imageset/autofill_prev_inactive.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_prev_inactive.png rename to ios/chrome/browser/autofill/resources/autofill_prev_inactive.imageset/autofill_prev_inactive.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_prev_inactive@2x.png b/ios/chrome/browser/autofill/resources/autofill_prev_inactive.imageset/autofill_prev_inactive@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_prev_inactive@2x.png rename to ios/chrome/browser/autofill/resources/autofill_prev_inactive.imageset/autofill_prev_inactive@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_prev_inactive@3x.png b/ios/chrome/browser/autofill/resources/autofill_prev_inactive.imageset/autofill_prev_inactive@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_prev_inactive@3x.png rename to ios/chrome/browser/autofill/resources/autofill_prev_inactive.imageset/autofill_prev_inactive@3x.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_prev_pressed.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_prev_pressed.imageset/Contents.json new file mode 100644 index 0000000..11083b8 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_prev_pressed.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "autofill_prev_pressed.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "autofill_prev_pressed@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "autofill_prev_pressed@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_prev_pressed.png b/ios/chrome/browser/autofill/resources/autofill_prev_pressed.imageset/autofill_prev_pressed.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_prev_pressed.png rename to ios/chrome/browser/autofill/resources/autofill_prev_pressed.imageset/autofill_prev_pressed.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_prev_pressed@2x.png b/ios/chrome/browser/autofill/resources/autofill_prev_pressed.imageset/autofill_prev_pressed@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_prev_pressed@2x.png rename to ios/chrome/browser/autofill/resources/autofill_prev_pressed.imageset/autofill_prev_pressed@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_prev_pressed@3x.png b/ios/chrome/browser/autofill/resources/autofill_prev_pressed.imageset/autofill_prev_pressed@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_prev_pressed@3x.png rename to ios/chrome/browser/autofill/resources/autofill_prev_pressed.imageset/autofill_prev_pressed@3x.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_right_sep.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_right_sep.imageset/Contents.json new file mode 100644 index 0000000..c1de985 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_right_sep.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "autofill_right_sep.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "autofill_right_sep@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "autofill_right_sep@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_right_sep.png b/ios/chrome/browser/autofill/resources/autofill_right_sep.imageset/autofill_right_sep.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_right_sep.png rename to ios/chrome/browser/autofill/resources/autofill_right_sep.imageset/autofill_right_sep.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_right_sep@2x.png b/ios/chrome/browser/autofill/resources/autofill_right_sep.imageset/autofill_right_sep@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_right_sep@2x.png rename to ios/chrome/browser/autofill/resources/autofill_right_sep.imageset/autofill_right_sep@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_right_sep@3x.png b/ios/chrome/browser/autofill/resources/autofill_right_sep.imageset/autofill_right_sep@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_right_sep@3x.png rename to ios/chrome/browser/autofill/resources/autofill_right_sep.imageset/autofill_right_sep@3x.png Binary files differ
diff --git a/ios/chrome/browser/autofill/resources/autofill_right_sep_RTL.imageset/Contents.json b/ios/chrome/browser/autofill/resources/autofill_right_sep_RTL.imageset/Contents.json new file mode 100644 index 0000000..36ba16f1 --- /dev/null +++ b/ios/chrome/browser/autofill/resources/autofill_right_sep_RTL.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "autofill_right_sep_RTL.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "autofill_right_sep_RTL@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "autofill_right_sep_RTL@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/web/resources/autofill_right_sep_RTL.png b/ios/chrome/browser/autofill/resources/autofill_right_sep_RTL.imageset/autofill_right_sep_RTL.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_right_sep_RTL.png rename to ios/chrome/browser/autofill/resources/autofill_right_sep_RTL.imageset/autofill_right_sep_RTL.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_right_sep_RTL@2x.png b/ios/chrome/browser/autofill/resources/autofill_right_sep_RTL.imageset/autofill_right_sep_RTL@2x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_right_sep_RTL@2x.png rename to ios/chrome/browser/autofill/resources/autofill_right_sep_RTL.imageset/autofill_right_sep_RTL@2x.png Binary files differ
diff --git a/ios/chrome/browser/web/resources/autofill_right_sep_RTL@3x.png b/ios/chrome/browser/autofill/resources/autofill_right_sep_RTL.imageset/autofill_right_sep_RTL@3x.png similarity index 100% rename from ios/chrome/browser/web/resources/autofill_right_sep_RTL@3x.png rename to ios/chrome/browser/autofill/resources/autofill_right_sep_RTL.imageset/autofill_right_sep_RTL@3x.png Binary files differ
diff --git a/ios/chrome/browser/content_suggestions/BUILD.gn b/ios/chrome/browser/content_suggestions/BUILD.gn index 06a438a..30b6ff15c 100644 --- a/ios/chrome/browser/content_suggestions/BUILD.gn +++ b/ios/chrome/browser/content_suggestions/BUILD.gn
@@ -5,6 +5,9 @@ source_set("content_suggestions") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ + "content_suggestions_alert_commands.h", + "content_suggestions_alert_factory.h", + "content_suggestions_alert_factory.mm", "content_suggestions_category_wrapper.h", "content_suggestions_category_wrapper.mm", "content_suggestions_coordinator.h", @@ -73,3 +76,28 @@ ] configs += [ "//build/config/compiler:enable_arc" ] } + +source_set("eg_tests") { + configs += [ "//build/config/compiler:enable_arc" ] + testonly = true + sources = [ + "content_suggestions_alert_egtest.mm", + ] + deps = [ + ":content_suggestions", + "//base", + "//base/test:test_support", + "//ios/chrome/app/strings", + "//ios/chrome/browser/ui", + "//ios/chrome/browser/ui/alert_coordinator", + "//ios/chrome/browser/ui/alert_coordinator", + "//ios/chrome/browser/ui/collection_view/cells", + "//ios/chrome/browser/ui/util", + "//ios/chrome/test/earl_grey:test_support", + "//ui/strings", + ] + libs = [ + "UIKit.framework", + "XCTest.framework", + ] +}
diff --git a/ios/chrome/browser/content_suggestions/content_suggestions_alert_commands.h b/ios/chrome/browser/content_suggestions/content_suggestions_alert_commands.h new file mode 100644 index 0000000..d734e65 --- /dev/null +++ b/ios/chrome/browser/content_suggestions/content_suggestions_alert_commands.h
@@ -0,0 +1,39 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_ALERT_COMMANDS_H_ +#define IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_ALERT_COMMANDS_H_ + +#import <UIKit/UIKit.h> + +@class CollectionViewItem; + +// Command protocol for the ContentSuggestionsAlertFactory, handling the +// callbacks from the alerts. +@protocol ContentSuggestionsAlertCommands + +// Opens the URL corresponding to the |item| in a new tab, |incognito| or not. +// The item has to be a suggestion item. +- (void)openNewTabWithSuggestionsItem:(nonnull CollectionViewItem*)item + incognito:(BOOL)incognito; + +// Adds the |item| to the reading list. The item has to be a suggestion item. +- (void)addItemToReadingList:(nonnull CollectionViewItem*)item; + +// Dismiss the |item| at |indexPath|. The item has to be a suggestion item. +- (void)dismissSuggestion:(nonnull CollectionViewItem*)item + atIndexPath:(nonnull NSIndexPath*)indexPath; + +// Open the URL corresponding to the |item| in a new tab, |incognito| or not. +// The item has to be a Most Visited item. +- (void)openNewTabWithMostVisitedItem:(nonnull CollectionViewItem*)item + incognito:(BOOL)incognito + atIndex:(NSInteger)mostVisitedIndex; + +// Removes the most visited |item|. +- (void)removeMostVisited:(nonnull CollectionViewItem*)item; + +@end + +#endif // IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_ALERT_COMMANDS_H_
diff --git a/ios/chrome/browser/content_suggestions/content_suggestions_alert_egtest.mm b/ios/chrome/browser/content_suggestions/content_suggestions_alert_egtest.mm new file mode 100644 index 0000000..6283b14 --- /dev/null +++ b/ios/chrome/browser/content_suggestions/content_suggestions_alert_egtest.mm
@@ -0,0 +1,98 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/content_suggestions/content_suggestions_alert_factory.h" + +#import <EarlGrey/EarlGrey.h> +#import <XCTest/XCTest.h> + +#import "ios/chrome/browser/content_suggestions/content_suggestions_alert_commands.h" +#import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h" +#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" +#include "ios/chrome/browser/ui/ui_util.h" +#import "ios/chrome/browser/ui/util/top_view_controller.h" +#include "ios/chrome/grit/ios_strings.h" +#import "ios/chrome/test/earl_grey/chrome_matchers.h" +#import "ios/chrome/test/earl_grey/chrome_test_case.h" +#include "ui/strings/grit/ui_strings.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@interface ContentSuggestionsAlertFactoryTestCase : XCTestCase + +@end + +@implementation ContentSuggestionsAlertFactoryTestCase + +- (void)testSuggestionsAlert { + UIViewController* viewController = + top_view_controller::TopPresentedViewController(); + AlertCoordinator* coordinator = [ContentSuggestionsAlertFactory + alertCoordinatorForSuggestionItem:nil + onViewController:viewController + atPoint:CGPointMake(50, 50) + atIndexPath:nil + commandHandler:nil]; + [coordinator start]; + + [[EarlGrey + selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId( + IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWTAB)] + assertWithMatcher:grey_interactable()]; + [[EarlGrey selectElementWithMatcher: + chrome_test_util::ButtonWithAccessibilityLabelId( + IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWINCOGNITOTAB)] + assertWithMatcher:grey_interactable()]; + [[EarlGrey + selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId( + IDS_IOS_CONTENT_SUGGESTIONS_REMOVE)] + assertWithMatcher:grey_interactable()]; + [[EarlGrey + selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId( + IDS_IOS_CONTENT_CONTEXT_ADDTOREADINGLIST)] + assertWithMatcher:grey_interactable()]; + if (!IsIPadIdiom()) { + [[EarlGrey selectElementWithMatcher: + chrome_test_util::ButtonWithAccessibilityLabelId( + IDS_APP_CANCEL)] assertWithMatcher:grey_interactable()]; + } + + [coordinator stop]; +} + +- (void)testMostVisitedAlert { + UIViewController* viewController = + top_view_controller::TopPresentedViewController(); + AlertCoordinator* coordinator = [ContentSuggestionsAlertFactory + alertCoordinatorForSuggestionItem:nil + onViewController:viewController + atPoint:CGPointMake(50, 50) + atIndexPath:nil + commandHandler:nil]; + [coordinator start]; + + [[EarlGrey + selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId( + IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWTAB)] + assertWithMatcher:grey_interactable()]; + [[EarlGrey selectElementWithMatcher: + chrome_test_util::ButtonWithAccessibilityLabelId( + IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWINCOGNITOTAB)] + assertWithMatcher:grey_interactable()]; + [[EarlGrey + selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId( + IDS_IOS_CONTENT_SUGGESTIONS_REMOVE)] + assertWithMatcher:grey_interactable()]; + if (!IsIPadIdiom()) { + [[EarlGrey selectElementWithMatcher: + chrome_test_util::ButtonWithAccessibilityLabelId( + IDS_APP_CANCEL)] assertWithMatcher:grey_interactable()]; + } + + [coordinator stop]; +} + +@end
diff --git a/ios/chrome/browser/content_suggestions/content_suggestions_alert_factory.h b/ios/chrome/browser/content_suggestions/content_suggestions_alert_factory.h new file mode 100644 index 0000000..accca13 --- /dev/null +++ b/ios/chrome/browser/content_suggestions/content_suggestions_alert_factory.h
@@ -0,0 +1,41 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_ALERT_FACTORY_H_ +#define IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_ALERT_FACTORY_H_ + +#import <UIKit/UIKit.h> + +@class AlertCoordinator; +@class CollectionViewItem; +@protocol ContentSuggestionsAlertCommands; + +// Factory for AlertCoordinators for ContentSuggestions. +@interface ContentSuggestionsAlertFactory : NSObject + +// Returns an AlertCoordinator for a suggestions |item| with the indexPath +// |indexPath|. The alert will be presented on the |viewController| at the +// |touchLocation|, in the coordinates of the |viewController|'s view. The +// |commandHandler| will receive callbacks when the user chooses one of the +// options displayed by the alert. ++ (AlertCoordinator*) +alertCoordinatorForSuggestionItem:(CollectionViewItem*)item + onViewController:(UIViewController*)viewController + atPoint:(CGPoint)touchLocation + atIndexPath:(NSIndexPath*)indexPath + commandHandler: + (id<ContentSuggestionsAlertCommands>)commandHandler; + +// Same as above but for a MostVisited item. ++ (AlertCoordinator*) +alertCoordinatorForMostVisitedItem:(CollectionViewItem*)item + onViewController:(UIViewController*)viewController + atPoint:(CGPoint)touchLocation + atIndexPath:(NSIndexPath*)indexPath + commandHandler: + (id<ContentSuggestionsAlertCommands>)commandHandler; + +@end + +#endif // IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_ALERT_FACTORY_H_
diff --git a/ios/chrome/browser/content_suggestions/content_suggestions_alert_factory.mm b/ios/chrome/browser/content_suggestions/content_suggestions_alert_factory.mm new file mode 100644 index 0000000..1deedfb5 --- /dev/null +++ b/ios/chrome/browser/content_suggestions/content_suggestions_alert_factory.mm
@@ -0,0 +1,167 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/content_suggestions/content_suggestions_alert_factory.h" + +#import "ios/chrome/browser/content_suggestions/content_suggestions_alert_commands.h" +#import "ios/chrome/browser/ui/alert_coordinator/action_sheet_coordinator.h" +#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" +#include "ios/chrome/grit/ios_strings.h" +#include "ui/base/l10n/l10n_util.h" +#include "ui/strings/grit/ui_strings.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@implementation ContentSuggestionsAlertFactory + ++ (AlertCoordinator*) +alertCoordinatorForSuggestionItem:(CollectionViewItem*)item + onViewController:(UIViewController*)viewController + atPoint:(CGPoint)touchLocation + atIndexPath:(NSIndexPath*)indexPath + commandHandler: + (id<ContentSuggestionsAlertCommands>)commandHandler { + AlertCoordinator* alertCoordinator = [[ActionSheetCoordinator alloc] + initWithBaseViewController:viewController + title:nil + message:nil + rect:CGRectMake(touchLocation.x, touchLocation.y, 0, + 0) + view:[viewController view]]; + + __weak CollectionViewItem* weakItem = item; + __weak id<ContentSuggestionsAlertCommands> weakCommandHandler = + commandHandler; + + NSString* openInNewTabTitle = + l10n_util::GetNSString(IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWTAB); + [alertCoordinator addItemWithTitle:openInNewTabTitle + action:^{ + CollectionViewItem* strongItem = weakItem; + if (strongItem) { + // TODO(crbug.com/691979): Add metrics. + [weakCommandHandler + openNewTabWithSuggestionsItem:strongItem + incognito:NO]; + } + } + style:UIAlertActionStyleDefault]; + + NSString* openInNewTabIncognitoTitle = + l10n_util::GetNSString(IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWINCOGNITOTAB); + [alertCoordinator addItemWithTitle:openInNewTabIncognitoTitle + action:^{ + CollectionViewItem* strongItem = weakItem; + if (strongItem) { + // TODO(crbug.com/691979): Add metrics. + [weakCommandHandler + openNewTabWithSuggestionsItem:strongItem + incognito:YES]; + } + } + style:UIAlertActionStyleDefault]; + + NSString* readLaterTitle = + l10n_util::GetNSString(IDS_IOS_CONTENT_CONTEXT_ADDTOREADINGLIST); + [alertCoordinator + addItemWithTitle:readLaterTitle + action:^{ + CollectionViewItem* strongItem = weakItem; + if (strongItem) { + // TODO(crbug.com/691979): Add metrics. + [weakCommandHandler addItemToReadingList:strongItem]; + } + } + style:UIAlertActionStyleDefault]; + + NSString* deleteTitle = + l10n_util::GetNSString(IDS_IOS_CONTENT_SUGGESTIONS_REMOVE); + [alertCoordinator addItemWithTitle:deleteTitle + action:^{ + CollectionViewItem* strongItem = weakItem; + if (strongItem) { + // TODO(crbug.com/691979): Add metrics. + [weakCommandHandler + dismissSuggestion:strongItem + atIndexPath:indexPath]; + } + } + style:UIAlertActionStyleDestructive]; + + [alertCoordinator addItemWithTitle:l10n_util::GetNSString(IDS_APP_CANCEL) + action:^{ + // TODO(crbug.com/691979): Add metrics. + } + style:UIAlertActionStyleCancel]; + return alertCoordinator; +} + ++ (AlertCoordinator*) +alertCoordinatorForMostVisitedItem:(CollectionViewItem*)item + onViewController:(UIViewController*)viewController + atPoint:(CGPoint)touchLocation + atIndexPath:(NSIndexPath*)indexPath + commandHandler: + (id<ContentSuggestionsAlertCommands>)commandHandler { + AlertCoordinator* alertCoordinator = [[ActionSheetCoordinator alloc] + initWithBaseViewController:viewController + title:nil + message:nil + rect:CGRectMake(touchLocation.x, touchLocation.y, 0, + 0) + view:[viewController view]]; + + __weak CollectionViewItem* weakItem = item; + __weak id<ContentSuggestionsAlertCommands> weakCommandHandler = + commandHandler; + + [alertCoordinator + addItemWithTitle:l10n_util::GetNSStringWithFixup( + IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWTAB) + action:^{ + CollectionViewItem* strongItem = weakItem; + if (strongItem) { + [weakCommandHandler + openNewTabWithMostVisitedItem:strongItem + incognito:NO + atIndex:indexPath.item]; + } + } + style:UIAlertActionStyleDefault]; + + [alertCoordinator + addItemWithTitle:l10n_util::GetNSStringWithFixup( + IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWINCOGNITOTAB) + action:^{ + CollectionViewItem* strongItem = weakItem; + if (strongItem) { + [weakCommandHandler + openNewTabWithMostVisitedItem:strongItem + incognito:YES + atIndex:indexPath.item]; + } + } + style:UIAlertActionStyleDefault]; + + [alertCoordinator + addItemWithTitle:l10n_util::GetNSStringWithFixup( + IDS_IOS_CONTENT_SUGGESTIONS_REMOVE) + action:^{ + CollectionViewItem* strongItem = weakItem; + if (strongItem) { + [weakCommandHandler removeMostVisited:strongItem]; + } + } + style:UIAlertActionStyleDestructive]; + + [alertCoordinator addItemWithTitle:l10n_util::GetNSString(IDS_APP_CANCEL) + action:nil + style:UIAlertActionStyleCancel]; + + return alertCoordinator; +} + +@end
diff --git a/ios/chrome/browser/content_suggestions/content_suggestions_coordinator.mm b/ios/chrome/browser/content_suggestions/content_suggestions_coordinator.mm index 2d3ee36..88a35144 100644 --- a/ios/chrome/browser/content_suggestions/content_suggestions_coordinator.mm +++ b/ios/chrome/browser/content_suggestions/content_suggestions_coordinator.mm
@@ -16,14 +16,17 @@ #include "components/reading_list/core/reading_list_model.h" #include "components/strings/grit/components_strings.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" +#import "ios/chrome/browser/content_suggestions/content_suggestions_alert_commands.h" +#import "ios/chrome/browser/content_suggestions/content_suggestions_alert_factory.h" #import "ios/chrome/browser/content_suggestions/content_suggestions_header_controller.h" +#import "ios/chrome/browser/content_suggestions/content_suggestions_header_controller_delegate.h" #import "ios/chrome/browser/content_suggestions/content_suggestions_mediator.h" #include "ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h" #import "ios/chrome/browser/metrics/new_tab_page_uma.h" #include "ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.h" #include "ios/chrome/browser/ntp_tiles/ios_most_visited_sites_factory.h" #include "ios/chrome/browser/reading_list/reading_list_model_factory.h" -#import "ios/chrome/browser/ui/alert_coordinator/action_sheet_coordinator.h" +#import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h" #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h" #import "ios/chrome/browser/ui/commands/generic_chrome_command.h" #include "ios/chrome/browser/ui/commands/ios_command_ids.h" @@ -31,8 +34,9 @@ #import "ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_most_visited_item.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_commands.h" -#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_header_commands.h" +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h" +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_audience.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_delegate.h" #import "ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion_identifier.h" #import "ios/chrome/browser/ui/ntp/google_landing_mediator.h" @@ -52,8 +56,10 @@ #endif @interface ContentSuggestionsCoordinator ()< + ContentSuggestionsAlertCommands, ContentSuggestionsCommands, - ContentSuggestionsHeaderCommands, + ContentSuggestionsHeaderControllerCommandHandler, + ContentSuggestionsViewControllerAudience, ContentSuggestionsViewControllerDelegate, OverscrollActionsControllerDelegate> @@ -63,21 +69,13 @@ @property(nonatomic, strong) ContentSuggestionsMediator* contentSuggestionsMediator; @property(nonatomic, strong) GoogleLandingMediator* googleLandingMediator; +@property(nonatomic, strong) + ContentSuggestionsHeaderSynchronizer* headerCollectionInteractionHandler; // Redefined as readwrite. @property(nonatomic, strong, readwrite) ContentSuggestionsHeaderController* headerController; -// |YES| if the fakebox header should be animated on scroll. -@property(nonatomic, assign) BOOL animateHeader; - -// Opens the |URL| in a new tab |incognito| or not. -- (void)openNewTabWithURL:(const GURL&)URL incognito:(BOOL)incognito; -// Dismisses the |article|, removing it from the content service, and dismisses -// the item at |indexPath| in the view controller. -- (void)dismissArticle:(ContentSuggestionsItem*)article - atIndexPath:(NSIndexPath*)indexPath; - @end @implementation ContentSuggestionsCoordinator @@ -88,12 +86,13 @@ @synthesize URLLoader = _URLLoader; @synthesize visible = _visible; @synthesize contentSuggestionsMediator = _contentSuggestionsMediator; +@synthesize headerCollectionInteractionHandler = + _headerCollectionInteractionHandler; @synthesize headerController = _headerController; @synthesize googleLandingMediator = _googleLandingMediator; @synthesize webStateList = _webStateList; @synthesize dispatcher = _dispatcher; @synthesize delegate = _delegate; -@synthesize animateHeader = _animateHeader; - (void)start { if (self.visible || !self.browserState) { @@ -103,7 +102,6 @@ } _visible = YES; - self.animateHeader = YES; ntp_snippets::ContentSuggestionsService* contentSuggestionsService = IOSChromeContentSuggestionsServiceFactory::GetForBrowserState( @@ -132,10 +130,20 @@ self.suggestionsViewController = [[ContentSuggestionsViewController alloc] initWithStyle:CollectionViewControllerStyleDefault dataSource:self.contentSuggestionsMediator]; - self.suggestionsViewController.headerCommandHandler = self; self.suggestionsViewController.suggestionCommandHandler = self; self.suggestionsViewController.suggestionsDelegate = self; + self.suggestionsViewController.audience = self; self.suggestionsViewController.overscrollDelegate = self; + + self.headerCollectionInteractionHandler = + [[ContentSuggestionsHeaderSynchronizer alloc] + initWithCollectionController:self.suggestionsViewController + headerController:self.headerController]; + + self.suggestionsViewController.headerCommandHandler = + self.headerCollectionInteractionHandler; + self.headerController.collectionSynchronizer = + self.headerCollectionInteractionHandler; } - (void)stop { @@ -169,8 +177,6 @@ referrer:web::Referrer() transition:ui::PAGE_TRANSITION_AUTO_BOOKMARK rendererInitiated:NO]; - - [self stop]; } - (void)openMostVisitedItem:(CollectionViewItem*)item @@ -184,85 +190,17 @@ referrer:web::Referrer() transition:ui::PAGE_TRANSITION_AUTO_BOOKMARK rendererInitiated:NO]; - - [self stop]; } - (void)displayContextMenuForArticle:(CollectionViewItem*)item atPoint:(CGPoint)touchLocation atIndexPath:(NSIndexPath*)indexPath { - ContentSuggestionsItem* articleItem = - base::mac::ObjCCastStrict<ContentSuggestionsItem>(item); - self.alertCoordinator = [[ActionSheetCoordinator alloc] - initWithBaseViewController:self.suggestionsViewController - title:nil - message:nil - rect:CGRectMake(touchLocation.x, touchLocation.y, 0, - 0) - view:self.suggestionsViewController.collectionView]; - - __weak ContentSuggestionsCoordinator* weakSelf = self; - GURL articleURL = articleItem.URL; - NSString* articleTitle = articleItem.title; - __weak ContentSuggestionsItem* weakArticle = articleItem; - - NSString* openInNewTabTitle = - l10n_util::GetNSString(IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWTAB); - [self.alertCoordinator - addItemWithTitle:openInNewTabTitle - action:^{ - // TODO(crbug.com/691979): Add metrics. - [weakSelf openNewTabWithURL:articleURL incognito:NO]; - } - style:UIAlertActionStyleDefault]; - - NSString* openInNewTabIncognitoTitle = - l10n_util::GetNSString(IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWINCOGNITOTAB); - [self.alertCoordinator - addItemWithTitle:openInNewTabIncognitoTitle - action:^{ - // TODO(crbug.com/691979): Add metrics. - [weakSelf openNewTabWithURL:articleURL incognito:YES]; - } - style:UIAlertActionStyleDefault]; - - NSString* readLaterTitle = - l10n_util::GetNSString(IDS_IOS_CONTENT_CONTEXT_ADDTOREADINGLIST); - [self.alertCoordinator - addItemWithTitle:readLaterTitle - action:^{ - ContentSuggestionsCoordinator* strongSelf = weakSelf; - if (!strongSelf) - return; - - base::RecordAction( - base::UserMetricsAction("MobileReadingListAdd")); - // TODO(crbug.com/691979): Add metrics. - - ReadingListModel* readingModel = - ReadingListModelFactory::GetForBrowserState( - strongSelf.browserState); - readingModel->AddEntry(articleURL, - base::SysNSStringToUTF8(articleTitle), - reading_list::ADDED_VIA_CURRENT_APP); - } - style:UIAlertActionStyleDefault]; - - NSString* deleteTitle = - l10n_util::GetNSString(IDS_IOS_CONTENT_SUGGESTIONS_REMOVE); - [self.alertCoordinator addItemWithTitle:deleteTitle - action:^{ - // TODO(crbug.com/691979): Add metrics. - [weakSelf dismissArticle:weakArticle - atIndexPath:indexPath]; - } - style:UIAlertActionStyleDestructive]; - - [self.alertCoordinator addItemWithTitle:l10n_util::GetNSString(IDS_APP_CANCEL) - action:^{ - // TODO(crbug.com/691979): Add metrics. - } - style:UIAlertActionStyleCancel]; + self.alertCoordinator = [ContentSuggestionsAlertFactory + alertCoordinatorForSuggestionItem:item + onViewController:self.suggestionsViewController + atPoint:touchLocation + atIndexPath:indexPath + commandHandler:self]; [self.alertCoordinator start]; } @@ -270,77 +208,16 @@ - (void)displayContextMenuForMostVisitedItem:(CollectionViewItem*)item atPoint:(CGPoint)touchLocation atIndexPath:(NSIndexPath*)indexPath { - ContentSuggestionsMostVisitedItem* mostVisitedItem = - base::mac::ObjCCastStrict<ContentSuggestionsMostVisitedItem>(item); - self.alertCoordinator = [[ActionSheetCoordinator alloc] - initWithBaseViewController:self.suggestionsViewController - title:nil - message:nil - rect:CGRectMake(touchLocation.x, touchLocation.y, 0, - 0) - view:self.suggestionsViewController.collectionView]; - - __weak ContentSuggestionsCoordinator* weakSelf = self; - __weak ContentSuggestionsMostVisitedItem* weakItem = mostVisitedItem; - - [self.alertCoordinator - addItemWithTitle:l10n_util::GetNSStringWithFixup( - IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWTAB) - action:^{ - ContentSuggestionsCoordinator* strongSelf = weakSelf; - ContentSuggestionsMostVisitedItem* strongItem = weakItem; - if (!strongSelf || !strongItem) - return; - [strongSelf logMostVisitedOpening:strongItem - atIndex:indexPath.item]; - [strongSelf openNewTabWithURL:strongItem.URL incognito:NO]; - } - style:UIAlertActionStyleDefault]; - - if (!self.browserState->IsOffTheRecord()) { - [self.alertCoordinator - addItemWithTitle:l10n_util::GetNSStringWithFixup( - IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWINCOGNITOTAB) - action:^{ - ContentSuggestionsCoordinator* strongSelf = weakSelf; - ContentSuggestionsMostVisitedItem* strongItem = weakItem; - if (!strongSelf || !strongItem) - return; - [strongSelf logMostVisitedOpening:strongItem - atIndex:indexPath.item]; - [strongSelf openNewTabWithURL:strongItem.URL incognito:YES]; - } - style:UIAlertActionStyleDefault]; - } - - [self.alertCoordinator - addItemWithTitle:l10n_util::GetNSStringWithFixup( - IDS_IOS_CONTENT_SUGGESTIONS_REMOVE) - action:^{ - ContentSuggestionsCoordinator* strongSelf = weakSelf; - ContentSuggestionsMostVisitedItem* strongItem = weakItem; - if (!strongSelf || !strongItem) - return; - base::RecordAction( - base::UserMetricsAction("MostVisited_UrlBlacklisted")); - [strongSelf.contentSuggestionsMediator - blacklistMostVisitedURL:strongItem.URL]; - [strongSelf showMostVisitedUndoForURL:strongItem.URL]; - } - style:UIAlertActionStyleDestructive]; - - [self.alertCoordinator addItemWithTitle:l10n_util::GetNSString(IDS_APP_CANCEL) - action:nil - style:UIAlertActionStyleCancel]; + self.alertCoordinator = [ContentSuggestionsAlertFactory + alertCoordinatorForMostVisitedItem:item + onViewController:self.suggestionsViewController + atPoint:touchLocation + atIndexPath:indexPath + commandHandler:self]; [self.alertCoordinator start]; } -- (void)dismissContextMenu { - [self.alertCoordinator stop]; - self.alertCoordinator = nil; -} - - (void)handlePromoTapped { NotificationPromoWhatsNew* notificationPromo = [self.contentSuggestionsMediator notificationPromo]; @@ -364,28 +241,52 @@ NOTREACHED(); } -#pragma mark - ContentSuggestionsHeaderCommands +#pragma mark - ContentSuggestionsAlertCommands -- (void)updateFakeOmniboxForScrollView:(UIScrollView*)scrollView { - [self.delegate updateNtpBarShadowForPanelController:self]; +- (void)openNewTabWithSuggestionsItem:(CollectionViewItem*)item + incognito:(BOOL)incognito { + ContentSuggestionsItem* suggestionsItem = + base::mac::ObjCCastStrict<ContentSuggestionsItem>(item); + [self openNewTabWithURL:suggestionsItem.URL incognito:incognito]; +} - // Unfocus the omnibox when the scroll view is scrolled below the pinned - // offset. - CGFloat pinnedOffsetY = [self pinnedOffsetY]; - if (self.headerController.omniboxFocused && scrollView.dragging && - scrollView.contentOffset.y < pinnedOffsetY) { - [self.dispatcher cancelOmniboxEdit]; - } +- (void)addItemToReadingList:(CollectionViewItem*)item { + ContentSuggestionsItem* suggestionsItem = + base::mac::ObjCCastStrict<ContentSuggestionsItem>(item); + base::RecordAction(base::UserMetricsAction("MobileReadingListAdd")); + ReadingListModel* readingModel = + ReadingListModelFactory::GetForBrowserState(self.browserState); + readingModel->AddEntry(suggestionsItem.URL, + base::SysNSStringToUTF8(suggestionsItem.title), + reading_list::ADDED_VIA_CURRENT_APP); +} - if (IsIPadIdiom()) { - return; - } +- (void)dismissSuggestion:(CollectionViewItem*)item + atIndexPath:(NSIndexPath*)indexPath { + ContentSuggestionsItem* suggestionsItem = + base::mac::ObjCCastStrict<ContentSuggestionsItem>(item); - if (self.animateHeader) { - [self.headerController - updateSearchFieldForOffset:self.suggestionsViewController.collectionView - .contentOffset.y]; - } + // TODO(crbug.com/691979): Add metrics. + [self.contentSuggestionsMediator + dismissSuggestion:suggestionsItem.suggestionIdentifier]; + [self.suggestionsViewController dismissEntryAtIndexPath:indexPath]; +} + +- (void)openNewTabWithMostVisitedItem:(CollectionViewItem*)item + incognito:(BOOL)incognito + atIndex:(NSInteger)index { + ContentSuggestionsMostVisitedItem* mostVisitedItem = + base::mac::ObjCCastStrict<ContentSuggestionsMostVisitedItem>(item); + [self logMostVisitedOpening:mostVisitedItem atIndex:index]; + [self openNewTabWithURL:mostVisitedItem.URL incognito:incognito]; +} + +- (void)removeMostVisited:(CollectionViewItem*)item { + ContentSuggestionsMostVisitedItem* mostVisitedItem = + base::mac::ObjCCastStrict<ContentSuggestionsMostVisitedItem>(item); + base::RecordAction(base::UserMetricsAction("MostVisited_UrlBlacklisted")); + [self.contentSuggestionsMediator blacklistMostVisitedURL:mostVisitedItem.URL]; + [self showMostVisitedUndoForURL:mostVisitedItem.URL]; } #pragma mark - ContentSuggestionsViewControllerDelegate @@ -403,7 +304,13 @@ } - (BOOL)isOmniboxFocused { - return self.headerController.omniboxFocused; + return [self.headerController isOmniboxFocused]; +} + +#pragma mark - ContentSuggestionsViewControllerAudience + +- (void)contentSuggestionsDidScroll { + [self.delegate updateNtpBarShadowForPanelController:self]; } #pragma mark - OverscrollActionsControllerDelegate @@ -455,8 +362,12 @@ #pragma mark - NewTabPagePanelProtocol - (CGFloat)alphaForBottomShadow { - // TODO(crbug.com/700375): implement this. - return 0; + UICollectionView* collection = self.suggestionsViewController.collectionView; + + CGFloat pixelsBelowFrame = + collection.contentSize.height - CGRectGetMaxY(collection.bounds); + CGFloat alpha = pixelsBelowFrame / kNewTabPageDistanceToFadeShadow; + return MIN(MAX(alpha, 0), 1); } - (UIView*)view { @@ -468,15 +379,16 @@ } - (void)wasShown { - // TODO(crbug.com/700375): implement this. + self.headerController.isShowing = YES; } - (void)wasHidden { - // TODO(crbug.com/700375): implement this. + self.headerController.isShowing = NO; } - (void)dismissModals { - // TODO(crbug.com/700375): implement this. + [self.alertCoordinator stop]; + self.alertCoordinator = nil; } - (void)dismissKeyboard { @@ -487,6 +399,7 @@ #pragma mark - Private +// Opens the |URL| in a new tab |incognito| or not. - (void)openNewTabWithURL:(const GURL&)URL incognito:(BOOL)incognito { // TODO(crbug.com/691979): Add metrics. @@ -495,19 +408,6 @@ inIncognito:incognito inBackground:NO appendTo:kCurrentTab]; - - [self stop]; -} - -- (void)dismissArticle:(ContentSuggestionsItem*)article - atIndexPath:(NSIndexPath*)indexPath { - if (!article) - return; - - // TODO(crbug.com/691979): Add metrics. - [self.contentSuggestionsMediator - dismissSuggestion:article.suggestionIdentifier]; - [self.suggestionsViewController dismissEntryAtIndexPath:indexPath]; } // Logs a histogram due to a Most Visited item being opened.
diff --git a/ios/chrome/browser/content_suggestions/content_suggestions_header_controller.h b/ios/chrome/browser/content_suggestions/content_suggestions_header_controller.h index 06fcdf5..5a9b881 100644 --- a/ios/chrome/browser/content_suggestions/content_suggestions_header_controller.h +++ b/ios/chrome/browser/content_suggestions/content_suggestions_header_controller.h
@@ -8,10 +8,12 @@ #import <UIKit/UIKit.h> #import "ios/chrome/browser/content_suggestions/content_suggestions_header_provider.h" +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_header_controlling.h" #import "ios/chrome/browser/ui/ntp/google_landing_consumer.h" #import "ios/chrome/browser/ui/toolbar/toolbar_owner.h" #import "ios/public/provider/chrome/browser/voice/logo_animation_controller.h" +@protocol ContentSuggestionsCollectionSynchronizing; @protocol ContentSuggestionsHeaderControllerDelegate; @protocol ContentSuggestionsHeaderControllerCommandHandler; @protocol OmniboxFocuser; @@ -22,7 +24,8 @@ // the interactions between the header and the collection, and the rest of the // application. @interface ContentSuggestionsHeaderController - : NSObject<ContentSuggestionsHeaderProvider, + : NSObject<ContentSuggestionsHeaderControlling, + ContentSuggestionsHeaderProvider, GoogleLandingConsumer, ToolbarOwner, LogoAnimationControllerOwnerOwner> @@ -32,16 +35,16 @@ delegate; @property(nonatomic, weak) id<ContentSuggestionsHeaderControllerCommandHandler> commandHandler; +@property(nonatomic, weak) id<ContentSuggestionsCollectionSynchronizing> + collectionSynchronizer; @property(nonatomic, assign) ReadingListModel* readingListModel; -// |YES| when notifications indicate the omnibox is focused. -@property(nonatomic, assign) BOOL omniboxFocused; - // Whether the Google logo or doodle is being shown. @property(nonatomic, assign) BOOL logoIsShowing; -// Update the iPhone fakebox's frame based on the current scroll view |offset|. -- (void)updateSearchFieldForOffset:(CGFloat)offset; +// |YES| if its view is visible. When set to |NO| various UI updates are +// ignored. +@property(nonatomic, assign) BOOL isShowing; // Return the toolbar view; - (UIView*)toolBarView;
diff --git a/ios/chrome/browser/content_suggestions/content_suggestions_header_controller.mm b/ios/chrome/browser/content_suggestions/content_suggestions_header_controller.mm index 408fcaf..750344e3f 100644 --- a/ios/chrome/browser/content_suggestions/content_suggestions_header_controller.mm +++ b/ios/chrome/browser/content_suggestions/content_suggestions_header_controller.mm
@@ -11,6 +11,7 @@ #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h" #import "ios/chrome/browser/ui/commands/generic_chrome_command.h" #include "ios/chrome/browser/ui/commands/ios_command_ids.h" +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_synchronizing.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_header_view.h" #import "ios/chrome/browser/ui/toolbar/web_toolbar_controller.h" @@ -31,6 +32,10 @@ @interface ContentSuggestionsHeaderController () +// |YES| when notifications indicate the omnibox is focused. +@property(nonatomic, assign, getter=isOmniboxFocused, readwrite) + BOOL omniboxFocused; + // |YES| if this consumer is has voice search enabled. @property(nonatomic, assign) BOOL voiceSearchIsEnabled; @@ -55,10 +60,6 @@ // Gets the text of a what's new promo. @property(nonatomic, copy) NSString* promoText; -// |YES| if this NTP panel is visible. When set to |NO| various UI updates are -// ignored. -@property(nonatomic, assign) BOOL isShowing; - // The number of tabs to show in the google landing fake toolbar. @property(nonatomic, assign) int tabCount; @@ -80,6 +81,7 @@ @synthesize dispatcher = _dispatcher; @synthesize delegate = _delegate; @synthesize commandHandler = _commandHandler; +@synthesize collectionSynchronizer = _collectionSynchronizer; @synthesize readingListModel = _readingListModel; @synthesize logoVendor = _logoVendor; @@ -107,6 +109,20 @@ #pragma mark - Public +- (UIView*)toolBarView { + return self.headerView.toolBarView; +} + +#pragma mark - Property + +- (void)setIsShowing:(BOOL)isShowing { + _isShowing = isShowing; + if (isShowing) + [self.headerView hideToolbarViewsForNewTabPage]; +} + +#pragma mark - ContentSuggestionsHeaderControlling + - (void)updateSearchFieldForOffset:(CGFloat)offset { NSArray* constraints = @[ self.hintLabelLeadingConstraint, self.voiceTapTrailingConstraint ]; @@ -119,8 +135,12 @@ forOffset:offset]; } -- (UIView*)toolBarView { - return self.headerView.toolBarView; +- (void)unfocusOmnibox { + if (self.omniboxFocused) { + [self.dispatcher cancelOmniboxEdit]; + } else { + [self locationBarResignsFirstResponder]; + } } #pragma mark - ContentSuggestionsHeaderProvider @@ -270,6 +290,28 @@ ]]; } +- (void)shiftTilesDown { + if (!IsIPadIdiom()) { + self.fakeOmnibox.hidden = NO; + [self.dispatcher onFakeboxBlur]; + } + + [self.collectionSynchronizer shiftTilesDown]; + + [self.commandHandler dismissModals]; +} + +- (void)shiftTilesUp { + void (^completionBlock)() = ^{ + if (!IsIPadIdiom()) { + [self.dispatcher onFakeboxAnimationComplete]; + [self.headerView fadeOutShadow]; + [self.fakeOmnibox setHidden:YES]; + } + }; + [self.collectionSynchronizer shiftTilesUpWithCompletionBlock:completionBlock]; +} + #pragma mark - ToolbarOwner - (ToolbarController*)relinquishedToolbarController { @@ -325,7 +367,7 @@ return; self.omniboxFocused = YES; - [self.commandHandler shiftTilesUp]; + [self shiftTilesUp]; } - (void)locationBarResignsFirstResponder { @@ -337,7 +379,7 @@ return; } - [self.commandHandler shiftTilesDown]; + [self shiftTilesDown]; } @end
diff --git a/ios/chrome/browser/content_suggestions/content_suggestions_header_controller_delegate.h b/ios/chrome/browser/content_suggestions/content_suggestions_header_controller_delegate.h index f1f16481..ea70373 100644 --- a/ios/chrome/browser/content_suggestions/content_suggestions_header_controller_delegate.h +++ b/ios/chrome/browser/content_suggestions/content_suggestions_header_controller_delegate.h
@@ -7,6 +7,7 @@ #import <UIKit/UIKit.h> +// TODO(crbug.com/700375): Implement this protocol somewhere. @protocol ContentSuggestionsHeaderControllerDelegate - (BOOL)isContextMenuVisible; @@ -14,10 +15,11 @@ @end +// Commands protocol for the header controller. @protocol ContentSuggestionsHeaderControllerCommandHandler -- (void)shiftTilesDown; -- (void)shiftTilesUp; +// Dismisses all presented modals. +- (void)dismissModals; @end
diff --git a/ios/chrome/browser/experimental_flags.mm b/ios/chrome/browser/experimental_flags.mm index c7760afd..3e55aff 100644 --- a/ios/chrome/browser/experimental_flags.mm +++ b/ios/chrome/browser/experimental_flags.mm
@@ -13,10 +13,12 @@ #include <string> #include "base/command_line.h" +#include "base/feature_list.h" #include "base/metrics/field_trial.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" #include "components/autofill/core/common/autofill_switches.h" +#include "components/password_manager/core/common/password_manager_features.h" #include "components/signin/core/common/signin_switches.h" #include "components/variations/variations_associated_data.h" #include "ios/chrome/browser/chrome_switches.h" @@ -233,7 +235,8 @@ objectForKey:kEnableViewCopyPasswords]; if ([viewCopyPasswordFlag isEqualToString:@"Enabled"]) return true; - return false; + return base::FeatureList::IsEnabled( + password_manager::features::kViewPasswords); } bool UseOnlyLocalHeuristicsForPasswordGeneration() {
diff --git a/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm b/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm index 708a235..bb9a830 100644 --- a/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm +++ b/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm
@@ -223,9 +223,7 @@ { auto drive_metrics_provider = - base::MakeUnique<metrics::DriveMetricsProvider>( - web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE), - ios::FILE_LOCAL_STATE); + base::MakeUnique<metrics::DriveMetricsProvider>(ios::FILE_LOCAL_STATE); drive_metrics_provider_ = drive_metrics_provider.get(); metrics_service_->RegisterMetricsProvider( std::move(drive_metrics_provider));
diff --git a/ios/chrome/browser/passwords/ios_chrome_password_manager_client.h b/ios/chrome/browser/passwords/ios_chrome_password_manager_client.h index 8dc1ebbd..aba2f96 100644 --- a/ios/chrome/browser/passwords/ios_chrome_password_manager_client.h +++ b/ios/chrome/browser/passwords/ios_chrome_password_manager_client.h
@@ -7,6 +7,7 @@ #include "base/macros.h" #import "components/password_manager/core/browser/password_manager_client.h" +#include "components/password_manager/core/browser/password_manager_metrics_recorder.h" #include "components/password_manager/sync/browser/sync_credentials_filter.h" #include "components/prefs/pref_member.h" @@ -73,6 +74,8 @@ const override; ukm::UkmRecorder* GetUkmRecorder() override; ukm::SourceId GetUkmSourceId() override; + password_manager::PasswordManagerMetricsRecorder& GetMetricsRecorder() + override; private: id<PasswordManagerClientDelegate> delegate_; // (weak) @@ -91,6 +94,12 @@ // owning this ChromePasswordManagerClient. ukm::SourceId ukm_source_id_; + // Recorder of metrics that is associated with the last committed navigation + // of the tab owning this ChromePasswordManagerClient. May be unset at + // times. Sends statistics on destruction. + base::Optional<password_manager::PasswordManagerMetricsRecorder> + metrics_recorder_; + DISALLOW_COPY_AND_ASSIGN(IOSChromePasswordManagerClient); };
diff --git a/ios/chrome/browser/passwords/ios_chrome_password_manager_client.mm b/ios/chrome/browser/passwords/ios_chrome_password_manager_client.mm index d8e7d4b..5ae210d4 100644 --- a/ios/chrome/browser/passwords/ios_chrome_password_manager_client.mm +++ b/ios/chrome/browser/passwords/ios_chrome_password_manager_client.mm
@@ -28,6 +28,7 @@ #endif using password_manager::PasswordFormManager; +using password_manager::PasswordManagerMetricsRecorder; using password_manager::PasswordStore; using password_manager::PasswordSyncState; @@ -149,6 +150,7 @@ // TODO(crbug.com/732846): The UKM Source should be recycled (e.g. from the // web contents), once the UKM framework provides a mechanism for that. if (ukm_source_url_ != delegate_.lastCommittedURL) { + metrics_recorder_.reset(); ukm_source_url_ = delegate_.lastCommittedURL; ukm_source_id_ = ukm::UkmRecorder::GetNewSourceID(); ukm::UkmRecorder* ukm_recorder = GetUkmRecorder(); @@ -157,3 +159,13 @@ } return ukm_source_id_; } + +PasswordManagerMetricsRecorder& +IOSChromePasswordManagerClient::GetMetricsRecorder() { + if (!metrics_recorder_) { + metrics_recorder_.emplace(PasswordManagerMetricsRecorder( + PasswordManagerMetricsRecorder::CreateUkmEntryBuilder( + GetUkmRecorder(), GetUkmSourceId()))); + } + return metrics_recorder_.value(); +}
diff --git a/ios/chrome/browser/passwords/resources/password_controller.js b/ios/chrome/browser/passwords/resources/password_controller.js index 506896d..994e0172 100644 --- a/ios/chrome/browser/passwords/resources/password_controller.js +++ b/ios/chrome/browser/passwords/resources/password_controller.js
@@ -51,7 +51,7 @@ return true; } - var frames = win.frames; + var frames = getSameOriginFrames_(win); for (var i = 0; i < frames.length; i++) { if (hasPasswordField_(frames[i])) { return true; @@ -62,6 +62,24 @@ }; /** + * Returns the contentWindow of all iframes that are from the the same origin + * as the containing window. + * @param {Window} win The window in which to look for frames. + * @return {Array.<Window>} Array of the same-origin frames found. + */ + var getSameOriginFrames_ = function(win) { + var frames = win.document.getElementsByTagName("iframe"); + var result = []; + for (var i = 0; i < frames.length; i++) { + if (!frames[i].src || + __gCrWeb.common.isSameOrigin(win.location.href, frames[i].src)) { + result.push(frames[i].contentWindow); + } + } + return result; + }; + + /** * Returns the password form with the given |name| as a JSON string. * @param {string} name The name of the form to extract. * @return {string} The password form. @@ -196,7 +214,7 @@ */ __gCrWeb['fillPasswordForm'] = function(formData, username, password, opt_normalizedOrigin) { - return __gCrWeb.fillPasswordFormWithData( + return fillPasswordFormWithData_( formData, username, password, window, opt_normalizedOrigin); }; @@ -239,21 +257,9 @@ * @param {string=} opt_normalizedOrigin The origin URL to compare to. * @return {boolean} Whether a form field has been filled. */ - __gCrWeb.fillPasswordFormWithData = - function(formData, username, password, win, opt_normalizedOrigin) { - var doc = null; - - try { - doc = win.document; - } catch(e) { - } - - // If unable to read the 'document' property from a frame in a different - // origin, do nothing. - if (!doc) { - return false; - } - + var fillPasswordFormWithData_ = function( + formData, username, password, win, opt_normalizedOrigin) { + var doc = win.document; var origin = formData['origin']; var normalizedOrigin = opt_normalizedOrigin || __gCrWeb.common.removeQueryAndReferenceFromURL(win.location.href); @@ -289,11 +295,11 @@ } }); - // Recursively invoke for all frames/iframes. - var frames = win.frames; + // Recursively invoke for all iframes. + var frames = getSameOriginFrames_(win); for (var i = 0; i < frames.length; i++) { - if (__gCrWeb.fillPasswordFormWithData( - formData, username, password, frames[i], opt_normalizedOrigin)) { + if (fillPasswordFormWithData_( + formData, username, password, frames[i], opt_normalizedOrigin)) { filled = true; } } @@ -390,8 +396,8 @@ } } - // Recursively invoke for all frames/iframes. - var frames = win.frames; + // Recursively invoke for all iframes. + var frames = getSameOriginFrames_(win); for (var i = 0; i < frames.length; i++) { __gCrWeb.getPasswordFormDataList(formDataList, frames[i]); }
diff --git a/ios/chrome/browser/payments/payment_request.h b/ios/chrome/browser/payments/payment_request.h index b91b47a..31cb1d76 100644 --- a/ios/chrome/browser/payments/payment_request.h +++ b/ios/chrome/browser/payments/payment_request.h
@@ -12,6 +12,7 @@ #include <vector> #include "base/macros.h" +#include "components/autofill/core/browser/credit_card.h" #include "components/payments/core/payment_options_provider.h" #include "components/payments/core/payment_request_base_delegate.h" #include "components/payments/core/payments_profile_comparator.h" @@ -19,7 +20,6 @@ namespace autofill { class AutofillProfile; -class CreditCard; class PersonalDataManager; class RegionDataLoader; } // namespace autofill @@ -160,6 +160,11 @@ return stringified_method_data_; } + const std::set<autofill::CreditCard::CardType>& supported_card_types_set() + const { + return supported_card_types_set_; + } + // Adds |credit_card| to the list of cached credit cards, updates the list of // available credit cards, and returns a reference to the cached copy of // |credit_card|. @@ -277,6 +282,9 @@ // payment method specific data. std::map<std::string, std::set<std::string>> stringified_method_data_; + // The set of supported card types (e.g., credit, debit, prepaid). + std::set<autofill::CreditCard::CardType> supported_card_types_set_; + // A vector of pointers to the shipping options in |web_payment_request_|. std::vector<web::PaymentShippingOption*> shipping_options_; web::PaymentShippingOption* selected_shipping_option_;
diff --git a/ios/chrome/browser/payments/payment_request.mm b/ios/chrome/browser/payments/payment_request.mm index 27463c6..406ba1e 100644 --- a/ios/chrome/browser/payments/payment_request.mm +++ b/ios/chrome/browser/payments/payment_request.mm
@@ -12,7 +12,6 @@ #include "base/strings/utf_string_conversions.h" #include "components/autofill/core/browser/autofill_data_util.h" #include "components/autofill/core/browser/autofill_profile.h" -#include "components/autofill/core/browser/credit_card.h" #include "components/autofill/core/browser/personal_data_manager.h" #include "components/autofill/core/browser/region_data_loader_impl.h" #include "components/autofill/core/browser/validation.h" @@ -287,6 +286,9 @@ web_payment_request_.method_data, &supported_card_networks_, &basic_card_specified_networks_); + payments::data_util::ParseSupportedCardTypes(web_payment_request_.method_data, + &supported_card_types_set_); + const std::vector<autofill::CreditCard*>& credit_cards_to_suggest = personal_data_manager_->GetCreditCardsToSuggest(); // Return early if the user has no stored credit cards.
diff --git a/ios/chrome/browser/sync/sessions/ios_chrome_local_session_event_router.mm b/ios/chrome/browser/sync/sessions/ios_chrome_local_session_event_router.mm index d020ced..d0aab08d 100644 --- a/ios/chrome/browser/sync/sessions/ios_chrome_local_session_event_router.mm +++ b/ios/chrome/browser/sync/sessions/ios_chrome_local_session_event_router.mm
@@ -111,7 +111,7 @@ void IOSChromeLocalSessionEventRouter::OnFaviconsChanged( const std::set<GURL>& page_urls, const GURL& icon_url) { - if (handler_) + if (handler_ && !page_urls.empty()) handler_->OnFaviconsChanged(page_urls, icon_url); }
diff --git a/ios/chrome/browser/ui/BUILD.gn b/ios/chrome/browser/ui/BUILD.gn index 9c1a36a..3e92360 100644 --- a/ios/chrome/browser/ui/BUILD.gn +++ b/ios/chrome/browser/ui/BUILD.gn
@@ -133,29 +133,6 @@ bundle_data("resources") { sources = [ - "resources/custom_row_voice.png", - "resources/custom_row_voice@2x.png", - "resources/custom_row_voice@2x~ipad.png", - "resources/custom_row_voice@3x.png", - "resources/custom_row_voice_pressed.png", - "resources/custom_row_voice_pressed@2x.png", - "resources/custom_row_voice_pressed@2x~ipad.png", - "resources/custom_row_voice_pressed@3x.png", - "resources/custom_row_voice_pressed~ipad.png", - "resources/custom_row_voice~ipad.png", - "resources/default_favicon.png", - "resources/default_favicon@2x.png", - "resources/default_favicon@3x.png", - "resources/default_favicon_incognito.png", - "resources/default_favicon_incognito@2x.png", - "resources/default_favicon_incognito@3x.png", - "resources/keyboard_bg_portrait_tablet.png", - "resources/keyboard_button.png", - "resources/keyboard_button@2x.png", - "resources/keyboard_button@2x~ipad.png", - "resources/keyboard_button@3x.png", - "resources/keyboard_button~ipad.png", - # On iOS, the terms of service file need to be loaded from the application # bundle, not from a datapack. As GetTermsOfServicePath() returns path to # those files, they are added to //ios/chrome/browser/ui:resources. @@ -234,6 +211,12 @@ deps = [ ":resources", ":ui", + "resources:custom_row_voice", + "resources:custom_row_voice_pressed", + "resources:default_favicon", + "resources:default_favicon_incognito", + "resources:keyboard_bg_portrait_tablet", + "resources:keyboard_button", "//base", "//base:i18n", "//components/bookmarks/browser",
diff --git a/ios/chrome/browser/ui/activity_services/BUILD.gn b/ios/chrome/browser/ui/activity_services/BUILD.gn index 6c78775b..0786057 100644 --- a/ios/chrome/browser/ui/activity_services/BUILD.gn +++ b/ios/chrome/browser/ui/activity_services/BUILD.gn
@@ -2,31 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -bundle_data("assets") { - sources = [ - "resources/activity_services_print.xcassets/Contents.json", - "resources/activity_services_print.xcassets/activity_services_print.imageset/Contents.json", - "resources/activity_services_print.xcassets/activity_services_print.imageset/activity_services_print-60@2x.png", - "resources/activity_services_print.xcassets/activity_services_print.imageset/activity_services_print-60@3x.png", - "resources/activity_services_print.xcassets/activity_services_print.imageset/activity_services_print-76.png", - "resources/activity_services_print.xcassets/activity_services_print.imageset/activity_services_print-76@2x.png", - ] - outputs = [ - "{{bundle_resources_dir}}/{{source_file_part}}", - ] -} - -bundle_data("resources") { - sources = [ - "resources/activity_services_reading_list.png", - "resources/activity_services_reading_list@2x.png", - "resources/activity_services_reading_list@3x.png", - ] - outputs = [ - "{{bundle_resources_dir}}/{{source_file_part}}", - ] -} - source_set("activity_services") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ @@ -51,8 +26,8 @@ "share_to_data_builder.mm", ] deps = [ - ":assets", - ":resources", + "resources:activity_services_print", + "resources:activity_services_reading_list", "//base", "//ios/chrome/app/strings", "//ios/chrome/browser",
diff --git a/ios/chrome/browser/ui/activity_services/resources/BUILD.gn b/ios/chrome/browser/ui/activity_services/resources/BUILD.gn new file mode 100644 index 0000000..171820f --- /dev/null +++ b/ios/chrome/browser/ui/activity_services/resources/BUILD.gn
@@ -0,0 +1,24 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ios/imageset.gni") + +imageset("activity_services_print") { + sources = [ + "activity_services_print.imageset/Contents.json", + "activity_services_print.imageset/activity_services_print-60@2x.png", + "activity_services_print.imageset/activity_services_print-60@3x.png", + "activity_services_print.imageset/activity_services_print-76.png", + "activity_services_print.imageset/activity_services_print-76@2x.png", + ] +} + +imageset("activity_services_reading_list") { + sources = [ + "activity_services_reading_list.imageset/Contents.json", + "activity_services_reading_list.imageset/activity_services_reading_list.png", + "activity_services_reading_list.imageset/activity_services_reading_list@2x.png", + "activity_services_reading_list.imageset/activity_services_reading_list@3x.png", + ] +}
diff --git a/ios/chrome/browser/ui/activity_services/resources/activity_services_print.imageset/Contents.json b/ios/chrome/browser/ui/activity_services/resources/activity_services_print.imageset/Contents.json new file mode 100644 index 0000000..c679fbe --- /dev/null +++ b/ios/chrome/browser/ui/activity_services/resources/activity_services_print.imageset/Contents.json
@@ -0,0 +1,32 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "1x" + }, + { + "idiom" : "iphone", + "filename" : "activity_services_print-60@2x.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "filename" : "activity_services_print-60@3x.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "filename" : "activity_services_print-76.png", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "filename" : "activity_services_print-76@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +}
diff --git a/ios/chrome/browser/ui/activity_services/resources/activity_services_print.xcassets/activity_services_print.imageset/activity_services_print-60@2x.png b/ios/chrome/browser/ui/activity_services/resources/activity_services_print.imageset/activity_services_print-60@2x.png similarity index 100% rename from ios/chrome/browser/ui/activity_services/resources/activity_services_print.xcassets/activity_services_print.imageset/activity_services_print-60@2x.png rename to ios/chrome/browser/ui/activity_services/resources/activity_services_print.imageset/activity_services_print-60@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/activity_services/resources/activity_services_print.xcassets/activity_services_print.imageset/activity_services_print-60@3x.png b/ios/chrome/browser/ui/activity_services/resources/activity_services_print.imageset/activity_services_print-60@3x.png similarity index 100% rename from ios/chrome/browser/ui/activity_services/resources/activity_services_print.xcassets/activity_services_print.imageset/activity_services_print-60@3x.png rename to ios/chrome/browser/ui/activity_services/resources/activity_services_print.imageset/activity_services_print-60@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/activity_services/resources/activity_services_print.xcassets/activity_services_print.imageset/activity_services_print-76.png b/ios/chrome/browser/ui/activity_services/resources/activity_services_print.imageset/activity_services_print-76.png similarity index 100% rename from ios/chrome/browser/ui/activity_services/resources/activity_services_print.xcassets/activity_services_print.imageset/activity_services_print-76.png rename to ios/chrome/browser/ui/activity_services/resources/activity_services_print.imageset/activity_services_print-76.png Binary files differ
diff --git a/ios/chrome/browser/ui/activity_services/resources/activity_services_print.xcassets/activity_services_print.imageset/activity_services_print-76@2x.png b/ios/chrome/browser/ui/activity_services/resources/activity_services_print.imageset/activity_services_print-76@2x.png similarity index 100% rename from ios/chrome/browser/ui/activity_services/resources/activity_services_print.xcassets/activity_services_print.imageset/activity_services_print-76@2x.png rename to ios/chrome/browser/ui/activity_services/resources/activity_services_print.imageset/activity_services_print-76@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/activity_services/resources/activity_services_print.xcassets/Contents.json b/ios/chrome/browser/ui/activity_services/resources/activity_services_print.xcassets/Contents.json deleted file mode 100644 index da4a164c..0000000 --- a/ios/chrome/browser/ui/activity_services/resources/activity_services_print.xcassets/Contents.json +++ /dev/null
@@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file
diff --git a/ios/chrome/browser/ui/activity_services/resources/activity_services_print.xcassets/activity_services_print.imageset/Contents.json b/ios/chrome/browser/ui/activity_services/resources/activity_services_print.xcassets/activity_services_print.imageset/Contents.json deleted file mode 100644 index 5ca6bac..0000000 --- a/ios/chrome/browser/ui/activity_services/resources/activity_services_print.xcassets/activity_services_print.imageset/Contents.json +++ /dev/null
@@ -1,32 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "filename" : "activity_services_print-60@2x.png", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "filename" : "activity_services_print-60@3x.png", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "filename" : "activity_services_print-76.png", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "filename" : "activity_services_print-76@2x.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file
diff --git a/ios/chrome/browser/ui/activity_services/resources/activity_services_reading_list.imageset/Contents.json b/ios/chrome/browser/ui/activity_services/resources/activity_services_reading_list.imageset/Contents.json new file mode 100644 index 0000000..7baa6596 --- /dev/null +++ b/ios/chrome/browser/ui/activity_services/resources/activity_services_reading_list.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "activity_services_reading_list.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "activity_services_reading_list@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "activity_services_reading_list@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/activity_services/resources/activity_services_reading_list.png b/ios/chrome/browser/ui/activity_services/resources/activity_services_reading_list.imageset/activity_services_reading_list.png similarity index 100% rename from ios/chrome/browser/ui/activity_services/resources/activity_services_reading_list.png rename to ios/chrome/browser/ui/activity_services/resources/activity_services_reading_list.imageset/activity_services_reading_list.png Binary files differ
diff --git a/ios/chrome/browser/ui/activity_services/resources/activity_services_reading_list@2x.png b/ios/chrome/browser/ui/activity_services/resources/activity_services_reading_list.imageset/activity_services_reading_list@2x.png similarity index 100% rename from ios/chrome/browser/ui/activity_services/resources/activity_services_reading_list@2x.png rename to ios/chrome/browser/ui/activity_services/resources/activity_services_reading_list.imageset/activity_services_reading_list@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/activity_services/resources/activity_services_reading_list@3x.png b/ios/chrome/browser/ui/activity_services/resources/activity_services_reading_list.imageset/activity_services_reading_list@3x.png similarity index 100% rename from ios/chrome/browser/ui/activity_services/resources/activity_services_reading_list@3x.png rename to ios/chrome/browser/ui/activity_services/resources/activity_services_reading_list.imageset/activity_services_reading_list@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/BUILD.gn b/ios/chrome/browser/ui/bookmarks/BUILD.gn index 92cae913..8319da47 100644 --- a/ios/chrome/browser/ui/bookmarks/BUILD.gn +++ b/ios/chrome/browser/ui/bookmarks/BUILD.gn
@@ -62,7 +62,27 @@ "undo_manager_wrapper.mm", ] deps = [ - ":resources", + "resources:bookmark_bar_innershadow", + "resources:bookmark_bar_shadow", + "resources:bookmark_black_delete", + "resources:bookmark_black_edit", + "resources:bookmark_black_move", + "resources:bookmark_black_select", + "resources:bookmark_blue_check", + "resources:bookmark_blue_folder", + "resources:bookmark_gray_back", + "resources:bookmark_gray_check", + "resources:bookmark_gray_close", + "resources:bookmark_gray_edit", + "resources:bookmark_gray_folder", + "resources:bookmark_gray_menu", + "resources:bookmark_gray_new_folder", + "resources:bookmark_gray_star_large", + "resources:bookmark_more", + "resources:bookmark_white_close", + "resources:bookmark_white_delete", + "resources:bookmark_white_edit", + "resources:bookmark_white_move", "//base", "//base:i18n", "//components/bookmarks/browser", @@ -179,74 +199,3 @@ "XCTest.framework", ] } - -bundle_data("resources") { - sources = [ - "resources/bookmark_bar_innershadow.png", - "resources/bookmark_bar_innershadow@2x.png", - "resources/bookmark_bar_innershadow@3x.png", - "resources/bookmark_bar_shadow.png", - "resources/bookmark_bar_shadow@2x.png", - "resources/bookmark_bar_shadow@3x.png", - "resources/bookmark_black_delete.png", - "resources/bookmark_black_delete@2x.png", - "resources/bookmark_black_delete@3x.png", - "resources/bookmark_black_edit.png", - "resources/bookmark_black_edit@2x.png", - "resources/bookmark_black_edit@3x.png", - "resources/bookmark_black_move.png", - "resources/bookmark_black_move@2x.png", - "resources/bookmark_black_move@3x.png", - "resources/bookmark_black_select.png", - "resources/bookmark_black_select@2x.png", - "resources/bookmark_black_select@3x.png", - "resources/bookmark_blue_check.png", - "resources/bookmark_blue_check@2x.png", - "resources/bookmark_blue_check@3x.png", - "resources/bookmark_blue_folder.png", - "resources/bookmark_blue_folder@2x.png", - "resources/bookmark_blue_folder@3x.png", - "resources/bookmark_gray_back.png", - "resources/bookmark_gray_back@2x.png", - "resources/bookmark_gray_back@3x.png", - "resources/bookmark_gray_check.png", - "resources/bookmark_gray_check@2x.png", - "resources/bookmark_gray_check@3x.png", - "resources/bookmark_gray_close.png", - "resources/bookmark_gray_close@2x.png", - "resources/bookmark_gray_close@3x.png", - "resources/bookmark_gray_edit.png", - "resources/bookmark_gray_edit@2x.png", - "resources/bookmark_gray_edit@3x.png", - "resources/bookmark_gray_folder.png", - "resources/bookmark_gray_folder@2x.png", - "resources/bookmark_gray_folder@3x.png", - "resources/bookmark_gray_menu.png", - "resources/bookmark_gray_menu@2x.png", - "resources/bookmark_gray_menu@3x.png", - "resources/bookmark_gray_new_folder.png", - "resources/bookmark_gray_new_folder@2x.png", - "resources/bookmark_gray_new_folder@3x.png", - "resources/bookmark_gray_star_large.png", - "resources/bookmark_gray_star_large@2x.png", - "resources/bookmark_gray_star_large@3x.png", - "resources/bookmark_more.png", - "resources/bookmark_more@2x.png", - "resources/bookmark_more@3x.png", - "resources/bookmark_white_close.png", - "resources/bookmark_white_close@2x.png", - "resources/bookmark_white_close@3x.png", - "resources/bookmark_white_delete.png", - "resources/bookmark_white_delete@2x.png", - "resources/bookmark_white_delete@3x.png", - "resources/bookmark_white_edit.png", - "resources/bookmark_white_edit@2x.png", - "resources/bookmark_white_edit@3x.png", - "resources/bookmark_white_move.png", - "resources/bookmark_white_move@2x.png", - "resources/bookmark_white_move@3x.png", - ] - outputs = [ - "{{bundle_resources_dir}}/{{source_file_part}}", - ] -}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/BUILD.gn b/ios/chrome/browser/ui/bookmarks/resources/BUILD.gn new file mode 100644 index 0000000..8b0fc50 --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/BUILD.gn
@@ -0,0 +1,194 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ios/imageset.gni") + +imageset("bookmark_bar_innershadow") { + sources = [ + "bookmark_bar_innershadow.imageset/Contents.json", + "bookmark_bar_innershadow.imageset/bookmark_bar_innershadow.png", + "bookmark_bar_innershadow.imageset/bookmark_bar_innershadow@2x.png", + "bookmark_bar_innershadow.imageset/bookmark_bar_innershadow@3x.png", + ] +} + +imageset("bookmark_bar_shadow") { + sources = [ + "bookmark_bar_shadow.imageset/Contents.json", + "bookmark_bar_shadow.imageset/bookmark_bar_shadow.png", + "bookmark_bar_shadow.imageset/bookmark_bar_shadow@2x.png", + "bookmark_bar_shadow.imageset/bookmark_bar_shadow@3x.png", + ] +} + +imageset("bookmark_black_delete") { + sources = [ + "bookmark_black_delete.imageset/Contents.json", + "bookmark_black_delete.imageset/bookmark_black_delete.png", + "bookmark_black_delete.imageset/bookmark_black_delete@2x.png", + "bookmark_black_delete.imageset/bookmark_black_delete@3x.png", + ] +} + +imageset("bookmark_black_edit") { + sources = [ + "bookmark_black_edit.imageset/Contents.json", + "bookmark_black_edit.imageset/bookmark_black_edit.png", + "bookmark_black_edit.imageset/bookmark_black_edit@2x.png", + "bookmark_black_edit.imageset/bookmark_black_edit@3x.png", + ] +} + +imageset("bookmark_black_move") { + sources = [ + "bookmark_black_move.imageset/Contents.json", + "bookmark_black_move.imageset/bookmark_black_move.png", + "bookmark_black_move.imageset/bookmark_black_move@2x.png", + "bookmark_black_move.imageset/bookmark_black_move@3x.png", + ] +} + +imageset("bookmark_black_select") { + sources = [ + "bookmark_black_select.imageset/Contents.json", + "bookmark_black_select.imageset/bookmark_black_select.png", + "bookmark_black_select.imageset/bookmark_black_select@2x.png", + "bookmark_black_select.imageset/bookmark_black_select@3x.png", + ] +} + +imageset("bookmark_blue_check") { + sources = [ + "bookmark_blue_check.imageset/Contents.json", + "bookmark_blue_check.imageset/bookmark_blue_check.png", + "bookmark_blue_check.imageset/bookmark_blue_check@2x.png", + "bookmark_blue_check.imageset/bookmark_blue_check@3x.png", + ] +} + +imageset("bookmark_blue_folder") { + sources = [ + "bookmark_blue_folder.imageset/Contents.json", + "bookmark_blue_folder.imageset/bookmark_blue_folder.png", + "bookmark_blue_folder.imageset/bookmark_blue_folder@2x.png", + "bookmark_blue_folder.imageset/bookmark_blue_folder@3x.png", + ] +} + +imageset("bookmark_gray_back") { + sources = [ + "bookmark_gray_back.imageset/Contents.json", + "bookmark_gray_back.imageset/bookmark_gray_back.png", + "bookmark_gray_back.imageset/bookmark_gray_back@2x.png", + "bookmark_gray_back.imageset/bookmark_gray_back@3x.png", + ] +} + +imageset("bookmark_gray_check") { + sources = [ + "bookmark_gray_check.imageset/Contents.json", + "bookmark_gray_check.imageset/bookmark_gray_check.png", + "bookmark_gray_check.imageset/bookmark_gray_check@2x.png", + "bookmark_gray_check.imageset/bookmark_gray_check@3x.png", + ] +} + +imageset("bookmark_gray_close") { + sources = [ + "bookmark_gray_close.imageset/Contents.json", + "bookmark_gray_close.imageset/bookmark_gray_close.png", + "bookmark_gray_close.imageset/bookmark_gray_close@2x.png", + "bookmark_gray_close.imageset/bookmark_gray_close@3x.png", + ] +} + +imageset("bookmark_gray_edit") { + sources = [ + "bookmark_gray_edit.imageset/Contents.json", + "bookmark_gray_edit.imageset/bookmark_gray_edit.png", + "bookmark_gray_edit.imageset/bookmark_gray_edit@2x.png", + "bookmark_gray_edit.imageset/bookmark_gray_edit@3x.png", + ] +} + +imageset("bookmark_gray_folder") { + sources = [ + "bookmark_gray_folder.imageset/Contents.json", + "bookmark_gray_folder.imageset/bookmark_gray_folder.png", + "bookmark_gray_folder.imageset/bookmark_gray_folder@2x.png", + "bookmark_gray_folder.imageset/bookmark_gray_folder@3x.png", + ] +} + +imageset("bookmark_gray_menu") { + sources = [ + "bookmark_gray_menu.imageset/Contents.json", + "bookmark_gray_menu.imageset/bookmark_gray_menu.png", + "bookmark_gray_menu.imageset/bookmark_gray_menu@2x.png", + "bookmark_gray_menu.imageset/bookmark_gray_menu@3x.png", + ] +} + +imageset("bookmark_gray_new_folder") { + sources = [ + "bookmark_gray_new_folder.imageset/Contents.json", + "bookmark_gray_new_folder.imageset/bookmark_gray_new_folder.png", + "bookmark_gray_new_folder.imageset/bookmark_gray_new_folder@2x.png", + "bookmark_gray_new_folder.imageset/bookmark_gray_new_folder@3x.png", + ] +} + +imageset("bookmark_gray_star_large") { + sources = [ + "bookmark_gray_star_large.imageset/Contents.json", + "bookmark_gray_star_large.imageset/bookmark_gray_star_large.png", + "bookmark_gray_star_large.imageset/bookmark_gray_star_large@2x.png", + "bookmark_gray_star_large.imageset/bookmark_gray_star_large@3x.png", + ] +} + +imageset("bookmark_more") { + sources = [ + "bookmark_more.imageset/Contents.json", + "bookmark_more.imageset/bookmark_more.png", + "bookmark_more.imageset/bookmark_more@2x.png", + "bookmark_more.imageset/bookmark_more@3x.png", + ] +} + +imageset("bookmark_white_close") { + sources = [ + "bookmark_white_close.imageset/Contents.json", + "bookmark_white_close.imageset/bookmark_white_close.png", + "bookmark_white_close.imageset/bookmark_white_close@2x.png", + "bookmark_white_close.imageset/bookmark_white_close@3x.png", + ] +} + +imageset("bookmark_white_delete") { + sources = [ + "bookmark_white_delete.imageset/Contents.json", + "bookmark_white_delete.imageset/bookmark_white_delete.png", + "bookmark_white_delete.imageset/bookmark_white_delete@2x.png", + "bookmark_white_delete.imageset/bookmark_white_delete@3x.png", + ] +} + +imageset("bookmark_white_edit") { + sources = [ + "bookmark_white_edit.imageset/Contents.json", + "bookmark_white_edit.imageset/bookmark_white_edit.png", + "bookmark_white_edit.imageset/bookmark_white_edit@2x.png", + "bookmark_white_edit.imageset/bookmark_white_edit@3x.png", + ] +} + +imageset("bookmark_white_move") { + sources = [ + "bookmark_white_move.imageset/Contents.json", + "bookmark_white_move.imageset/bookmark_white_move.png", + "bookmark_white_move.imageset/bookmark_white_move@2x.png", + "bookmark_white_move.imageset/bookmark_white_move@3x.png", + ] +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_innershadow.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_innershadow.imageset/Contents.json new file mode 100644 index 0000000..9f213be --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_innershadow.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_bar_innershadow.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_bar_innershadow@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_bar_innershadow@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_innershadow.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_innershadow.imageset/bookmark_bar_innershadow.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_innershadow.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_innershadow.imageset/bookmark_bar_innershadow.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_innershadow@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_innershadow.imageset/bookmark_bar_innershadow@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_innershadow@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_innershadow.imageset/bookmark_bar_innershadow@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_innershadow@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_innershadow.imageset/bookmark_bar_innershadow@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_innershadow@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_innershadow.imageset/bookmark_bar_innershadow@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_shadow.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_shadow.imageset/Contents.json new file mode 100644 index 0000000..b99f4db6 --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_shadow.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_bar_shadow.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_bar_shadow@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_bar_shadow@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_shadow.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_shadow.imageset/bookmark_bar_shadow.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_shadow.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_shadow.imageset/bookmark_bar_shadow.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_shadow@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_shadow.imageset/bookmark_bar_shadow@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_shadow@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_shadow.imageset/bookmark_bar_shadow@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_shadow@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_shadow.imageset/bookmark_bar_shadow@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_shadow@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_bar_shadow.imageset/bookmark_bar_shadow@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_delete.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_delete.imageset/Contents.json new file mode 100644 index 0000000..a3aa666 --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_delete.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_black_delete.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_black_delete@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_black_delete@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_delete.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_delete.imageset/bookmark_black_delete.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_black_delete.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_black_delete.imageset/bookmark_black_delete.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_delete@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_delete.imageset/bookmark_black_delete@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_black_delete@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_black_delete.imageset/bookmark_black_delete@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_delete@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_delete.imageset/bookmark_black_delete@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_black_delete@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_black_delete.imageset/bookmark_black_delete@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_edit.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_edit.imageset/Contents.json new file mode 100644 index 0000000..56ca0e64 --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_edit.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_black_edit.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_black_edit@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_black_edit@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_edit.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_edit.imageset/bookmark_black_edit.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_black_edit.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_black_edit.imageset/bookmark_black_edit.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_edit@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_edit.imageset/bookmark_black_edit@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_black_edit@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_black_edit.imageset/bookmark_black_edit@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_edit@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_edit.imageset/bookmark_black_edit@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_black_edit@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_black_edit.imageset/bookmark_black_edit@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_move.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_move.imageset/Contents.json new file mode 100644 index 0000000..93df647 --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_move.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_black_move.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_black_move@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_black_move@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_move.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_move.imageset/bookmark_black_move.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_black_move.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_black_move.imageset/bookmark_black_move.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_move@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_move.imageset/bookmark_black_move@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_black_move@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_black_move.imageset/bookmark_black_move@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_move@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_move.imageset/bookmark_black_move@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_black_move@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_black_move.imageset/bookmark_black_move@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_select.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_select.imageset/Contents.json new file mode 100644 index 0000000..7543e35 --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_select.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_black_select.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_black_select@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_black_select@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_select.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_select.imageset/bookmark_black_select.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_black_select.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_black_select.imageset/bookmark_black_select.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_select@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_select.imageset/bookmark_black_select@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_black_select@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_black_select.imageset/bookmark_black_select@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_select@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_black_select.imageset/bookmark_black_select@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_black_select@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_black_select.imageset/bookmark_black_select@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_check.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_check.imageset/Contents.json new file mode 100644 index 0000000..b1d6305 --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_check.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_blue_check.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_blue_check@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_blue_check@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_check.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_check.imageset/bookmark_blue_check.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_check.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_check.imageset/bookmark_blue_check.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_check@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_check.imageset/bookmark_blue_check@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_check@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_check.imageset/bookmark_blue_check@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_check@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_check.imageset/bookmark_blue_check@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_check@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_check.imageset/bookmark_blue_check@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_folder.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_folder.imageset/Contents.json new file mode 100644 index 0000000..fb9f144 --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_folder.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_blue_folder.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_blue_folder@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_blue_folder@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_folder.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_folder.imageset/bookmark_blue_folder.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_folder.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_folder.imageset/bookmark_blue_folder.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_folder@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_folder.imageset/bookmark_blue_folder@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_folder@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_folder.imageset/bookmark_blue_folder@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_folder@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_folder.imageset/bookmark_blue_folder@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_folder@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_blue_folder.imageset/bookmark_blue_folder@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_back.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_back.imageset/Contents.json new file mode 100644 index 0000000..eebfa310 --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_back.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_gray_back.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_gray_back@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_gray_back@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_back.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_back.imageset/bookmark_gray_back.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_back.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_back.imageset/bookmark_gray_back.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_back@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_back.imageset/bookmark_gray_back@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_back@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_back.imageset/bookmark_gray_back@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_back@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_back.imageset/bookmark_gray_back@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_back@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_back.imageset/bookmark_gray_back@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_check.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_check.imageset/Contents.json new file mode 100644 index 0000000..036ada9f --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_check.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_gray_check.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_gray_check@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_gray_check@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_check.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_check.imageset/bookmark_gray_check.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_check.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_check.imageset/bookmark_gray_check.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_check@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_check.imageset/bookmark_gray_check@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_check@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_check.imageset/bookmark_gray_check@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_check@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_check.imageset/bookmark_gray_check@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_check@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_check.imageset/bookmark_gray_check@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_close.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_close.imageset/Contents.json new file mode 100644 index 0000000..80c2e50 --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_close.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_gray_close.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_gray_close@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_gray_close@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_close.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_close.imageset/bookmark_gray_close.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_close.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_close.imageset/bookmark_gray_close.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_close@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_close.imageset/bookmark_gray_close@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_close@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_close.imageset/bookmark_gray_close@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_close@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_close.imageset/bookmark_gray_close@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_close@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_close.imageset/bookmark_gray_close@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_edit.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_edit.imageset/Contents.json new file mode 100644 index 0000000..f96796f --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_edit.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_gray_edit.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_gray_edit@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_gray_edit@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_edit.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_edit.imageset/bookmark_gray_edit.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_edit.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_edit.imageset/bookmark_gray_edit.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_edit@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_edit.imageset/bookmark_gray_edit@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_edit@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_edit.imageset/bookmark_gray_edit@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_edit@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_edit.imageset/bookmark_gray_edit@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_edit@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_edit.imageset/bookmark_gray_edit@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_folder.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_folder.imageset/Contents.json new file mode 100644 index 0000000..8b51991 --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_folder.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_gray_folder.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_gray_folder@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_gray_folder@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_folder.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_folder.imageset/bookmark_gray_folder.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_folder.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_folder.imageset/bookmark_gray_folder.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_folder@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_folder.imageset/bookmark_gray_folder@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_folder@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_folder.imageset/bookmark_gray_folder@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_folder@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_folder.imageset/bookmark_gray_folder@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_folder@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_folder.imageset/bookmark_gray_folder@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_menu.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_menu.imageset/Contents.json new file mode 100644 index 0000000..700b5a0 --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_menu.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_gray_menu.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_gray_menu@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_gray_menu@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_menu.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_menu.imageset/bookmark_gray_menu.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_menu.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_menu.imageset/bookmark_gray_menu.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_menu@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_menu.imageset/bookmark_gray_menu@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_menu@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_menu.imageset/bookmark_gray_menu@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_menu@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_menu.imageset/bookmark_gray_menu@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_menu@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_menu.imageset/bookmark_gray_menu@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_new_folder.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_new_folder.imageset/Contents.json new file mode 100644 index 0000000..d9ed64b6 --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_new_folder.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_gray_new_folder.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_gray_new_folder@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_gray_new_folder@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_new_folder.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_new_folder.imageset/bookmark_gray_new_folder.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_new_folder.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_new_folder.imageset/bookmark_gray_new_folder.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_new_folder@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_new_folder.imageset/bookmark_gray_new_folder@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_new_folder@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_new_folder.imageset/bookmark_gray_new_folder@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_new_folder@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_new_folder.imageset/bookmark_gray_new_folder@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_new_folder@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_new_folder.imageset/bookmark_gray_new_folder@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_star_large.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_star_large.imageset/Contents.json new file mode 100644 index 0000000..a720adc --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_star_large.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_gray_star_large.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_gray_star_large@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_gray_star_large@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_star_large.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_star_large.imageset/bookmark_gray_star_large.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_star_large.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_star_large.imageset/bookmark_gray_star_large.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_star_large@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_star_large.imageset/bookmark_gray_star_large@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_star_large@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_star_large.imageset/bookmark_gray_star_large@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_star_large@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_star_large.imageset/bookmark_gray_star_large@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_star_large@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_gray_star_large.imageset/bookmark_gray_star_large@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_more.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_more.imageset/Contents.json new file mode 100644 index 0000000..14ca574 --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_more.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_more.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_more@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_more@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_more.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_more.imageset/bookmark_more.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_more.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_more.imageset/bookmark_more.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_more@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_more.imageset/bookmark_more@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_more@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_more.imageset/bookmark_more@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_more@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_more.imageset/bookmark_more@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_more@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_more.imageset/bookmark_more@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_close.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_close.imageset/Contents.json new file mode 100644 index 0000000..6c2600bc --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_close.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_white_close.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_white_close@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_white_close@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_close.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_close.imageset/bookmark_white_close.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_white_close.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_white_close.imageset/bookmark_white_close.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_close@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_close.imageset/bookmark_white_close@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_white_close@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_white_close.imageset/bookmark_white_close@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_close@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_close.imageset/bookmark_white_close@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_white_close@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_white_close.imageset/bookmark_white_close@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_delete.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_delete.imageset/Contents.json new file mode 100644 index 0000000..4fab163 --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_delete.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_white_delete.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_white_delete@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_white_delete@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_delete.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_delete.imageset/bookmark_white_delete.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_white_delete.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_white_delete.imageset/bookmark_white_delete.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_delete@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_delete.imageset/bookmark_white_delete@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_white_delete@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_white_delete.imageset/bookmark_white_delete@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_delete@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_delete.imageset/bookmark_white_delete@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_white_delete@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_white_delete.imageset/bookmark_white_delete@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_edit.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_edit.imageset/Contents.json new file mode 100644 index 0000000..d87726c --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_edit.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_white_edit.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_white_edit@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_white_edit@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_edit.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_edit.imageset/bookmark_white_edit.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_white_edit.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_white_edit.imageset/bookmark_white_edit.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_edit@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_edit.imageset/bookmark_white_edit@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_white_edit@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_white_edit.imageset/bookmark_white_edit@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_edit@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_edit.imageset/bookmark_white_edit@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_white_edit@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_white_edit.imageset/bookmark_white_edit@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_move.imageset/Contents.json b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_move.imageset/Contents.json new file mode 100644 index 0000000..2c970e3 --- /dev/null +++ b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_move.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "bookmark_white_move.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "bookmark_white_move@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "bookmark_white_move@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_move.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_move.imageset/bookmark_white_move.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_white_move.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_white_move.imageset/bookmark_white_move.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_move@2x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_move.imageset/bookmark_white_move@2x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_white_move@2x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_white_move.imageset/bookmark_white_move@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_move@3x.png b/ios/chrome/browser/ui/bookmarks/resources/bookmark_white_move.imageset/bookmark_white_move@3x.png similarity index 100% rename from ios/chrome/browser/ui/bookmarks/resources/bookmark_white_move@3x.png rename to ios/chrome/browser/ui/bookmarks/resources/bookmark_white_move.imageset/bookmark_white_move@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/content_suggestions/BUILD.gn b/ios/chrome/browser/ui/content_suggestions/BUILD.gn index 4253b8c..a9dc03df 100644 --- a/ios/chrome/browser/ui/content_suggestions/BUILD.gn +++ b/ios/chrome/browser/ui/content_suggestions/BUILD.gn
@@ -4,24 +4,29 @@ source_set("content_suggestions") { sources = [ + "content_suggestions_collection_controlling.h", + "content_suggestions_collection_synchronizing.h", "content_suggestions_collection_updater.h", "content_suggestions_collection_updater.mm", "content_suggestions_commands.h", "content_suggestions_data_sink.h", "content_suggestions_data_source.h", - "content_suggestions_header_commands.h", + "content_suggestions_header_controlling.h", + "content_suggestions_header_synchronizer.h", + "content_suggestions_header_synchronizer.mm", + "content_suggestions_header_synchronizing.h", "content_suggestions_image_fetcher.h", "content_suggestions_layout.h", "content_suggestions_layout.mm", "content_suggestions_view_controller.h", "content_suggestions_view_controller.mm", + "content_suggestions_view_controller_audience.h", "content_suggestions_view_controller_delegate.h", - "content_suggestions_view_controller_utils.h", - "content_suggestions_view_controller_utils.mm", ] deps = [ ":content_suggestions_util", - ":resources", + "resources:content_suggestions_no_image", + "resources:content_suggestions_offline", "//base", "//components/strings", "//ios/chrome/browser/ui", @@ -64,7 +69,7 @@ sources = [ "content_suggestions_collection_updater_unittest.mm", "content_suggestions_collection_utils_unittest.mm", - "content_suggestions_view_controller_utils_unittest.mm", + "content_suggestions_header_synchronizer_unittest.mm", ] deps = [ ":content_suggestions", @@ -80,17 +85,3 @@ ] configs += [ "//build/config/compiler:enable_arc" ] } - -bundle_data("resources") { - sources = [ - "resources/content_suggestions_no_image.png", - "resources/content_suggestions_no_image@2x.png", - "resources/content_suggestions_no_image@3x.png", - "resources/content_suggestions_offline.png", - "resources/content_suggestions_offline@2x.png", - "resources/content_suggestions_offline@3x.png", - ] - outputs = [ - "{{bundle_resources_dir}}/{{source_file_part}}", - ] -}
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_controlling.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_controlling.h new file mode 100644 index 0000000..1e7cbaf --- /dev/null +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_controlling.h
@@ -0,0 +1,25 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_COLLECTION_CONTROLLING_H_ +#define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_COLLECTION_CONTROLLING_H_ + +#import <UIKit/UIKit.h> + +@protocol ContentSuggestionsViewControllerDelegate; + +@protocol ContentSuggestionsCollectionControlling + +@property(nonatomic, weak) id<ContentSuggestionsViewControllerDelegate> + suggestionsDelegate; + +// |YES| if the collection scrollView is scrolled all the way to the top. Used +// to lock this position in place on various frame changes. +@property(nonatomic, assign, getter=isScrolledToTop) BOOL scrolledToTop; + +- (UICollectionView*)collectionView; + +@end + +#endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_COLLECTION_CONTROLLING_H_
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_synchronizing.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_synchronizing.h new file mode 100644 index 0000000..f2e6b4e --- /dev/null +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_synchronizing.h
@@ -0,0 +1,22 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_COLLECTION_SYNCHRONIZING_H_ +#define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_COLLECTION_SYNCHRONIZING_H_ + +#import "base/ios/block_types.h" + +// Synchronization protocol used by the ContentSuggestions header controller to +// synchronize with the ContentSuggestions collection. +@protocol ContentSuggestionsCollectionSynchronizing + +// Moves the tiles down, by setting the content offset of the collection to 0. +- (void)shiftTilesDown; +// Moves the tiles up by pinning the omnibox to the top. Completion called only +// if scrolled to top. +- (void)shiftTilesUpWithCompletionBlock:(ProceduralBlock)completionBlock; + +@end + +#endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_COLLECTION_SYNCHRONIZING_H_
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.h index 45649a4..258ce4da 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.h +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.h
@@ -43,6 +43,9 @@ void configureVoiceSearchButton(UIButton* voiceSearchButton, UIButton* searchTapTarget); +// Returns the nearest ancestor of |view| that is kind of |aClass|. +UIView* nearestAncestor(UIView* view, Class aClass); + } // namespace content_suggestions #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_COLLECTION_UTILS_H_
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm index 46174f3..ba8d52c 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm
@@ -26,6 +26,8 @@ const CGFloat kMinSearchFieldWidth = 50; const CGFloat kSearchHintMargin = 3; +// Offset to align the hint of the fake omnibox with the one in the toolbar. +const CGFloat kSearchHintVerticalOffset = 0.5; const CGFloat kMaxSearchFieldFrameMargin = 200; const CGFloat kDoodleTopMarginIPad = 82; @@ -138,7 +140,8 @@ [searchHintLabel.heightAnchor constraintEqualToConstant:kSearchFieldHeight - 2 * kSearchHintMargin], [searchHintLabel.centerYAnchor - constraintEqualToAnchor:searchTapTarget.centerYAnchor] + constraintEqualToAnchor:searchTapTarget.centerYAnchor + constant:kSearchHintVerticalOffset] ]]; [searchHintLabel setText:l10n_util::GetNSString(IDS_OMNIBOX_EMPTY_HINT)]; @@ -175,4 +178,14 @@ [voiceSearchButton setAccessibilityIdentifier:@"Voice Search"]; } +UIView* nearestAncestor(UIView* view, Class aClass) { + if (!view) { + return nil; + } + if ([view isKindOfClass:aClass]) { + return view; + } + return nearestAncestor([view superview], aClass); +} + } // namespace content_suggestions
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils_unittest.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils_unittest.mm index a46a48d..89c23546 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils_unittest.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils_unittest.mm
@@ -216,4 +216,20 @@ EXPECT_EQ(3U, numberOfTilesForWidth(360)); } +TEST_F(ContentSuggestionsCollectionUtilsTest, NearestAncestor) { + // Setup. + // The types of the view has no meaning. + UILabel* rootView = [[UILabel alloc] init]; + UIView* intermediaryView = [[UIView alloc] init]; + UIScrollView* leafView = [[UIScrollView alloc] init]; + [rootView addSubview:intermediaryView]; + [intermediaryView addSubview:leafView]; + + // Tests. + EXPECT_EQ(leafView, nearestAncestor(leafView, [UIScrollView class])); + EXPECT_EQ(leafView, nearestAncestor(leafView, [UIView class])); + EXPECT_EQ(rootView, nearestAncestor(leafView, [UILabel class])); + EXPECT_EQ(nil, nearestAncestor(leafView, [UITextView class])); +} + } // namespace content_suggestions
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_commands.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_commands.h index 73a45824..788bfce5 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_commands.h +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_commands.h
@@ -7,7 +7,8 @@ @class CollectionViewItem; -// Commands protocol for the ContentSuggestionsViewController. +// Commands protocol allowing the ContentSuggestions ViewControllers to interact +// with the coordinator layer, and from there to the rest of the application. @protocol ContentSuggestionsCommands // Opens the Reading List. @@ -27,7 +28,7 @@ atPoint:(CGPoint)touchLocation atIndexPath:(nonnull NSIndexPath*)indexPath; // Dismisses the context menu if it is displayed. -- (void)dismissContextMenu; +- (void)dismissModals; // Handles the actions following a tap on the promo. - (void)handlePromoTapped;
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_commands.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_commands.h deleted file mode 100644 index 1bc22752..0000000 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_commands.h +++ /dev/null
@@ -1,17 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_HEADER_COMMANDS_H_ -#define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_HEADER_COMMANDS_H_ - -// Commands protocol allowing the ContentSuggestionsViewController to send -// commands related to the header, containing the fake omnibox and the logo. -@protocol ContentSuggestionsHeaderCommands - -// Updates the fake omnibox to adapt to the current scrolling. -- (void)updateFakeOmniboxForScrollView:(nonnull UIScrollView*)scrollView; - -@end - -#endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_HEADER_COMMANDS_H_
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_controlling.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_controlling.h new file mode 100644 index 0000000..be0f9e83 --- /dev/null +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_controlling.h
@@ -0,0 +1,25 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_HEADER_CONTROLLING_H_ +#define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_HEADER_CONTROLLING_H_ + +#import <UIKit/UIKit.h> + +// Controller for the ContentSuggestions header. +@protocol ContentSuggestionsHeaderControlling + +// Whether the omnibox is currently focused. +@property(nonatomic, assign, getter=isOmniboxFocused, readonly) + BOOL omniboxFocused; + +// Updates the iPhone fakebox's frame based on the current scroll view |offset|. +- (void)updateSearchFieldForOffset:(CGFloat)offset; + +// Unfocuses the omnibox. +- (void)unfocusOmnibox; + +@end + +#endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_HEADER_CONTROLLING_H_
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer.h new file mode 100644 index 0000000..6cc5bf9 --- /dev/null +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer.h
@@ -0,0 +1,37 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_HEADER_SYNCHRONIZER_H_ +#define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_HEADER_SYNCHRONIZER_H_ + +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_synchronizing.h" +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizing.h" + +#import <UIKit/UIKit.h> + +#import "base/ios/block_types.h" + +@protocol ContentSuggestionsCollectionControlling; +@protocol ContentSuggestionsHeaderControlling; +@class ContentSuggestionsViewController; + +// Synchronizer for all the interactions between the HeaderController and the +// CollectionView. It handles the interactions both ways. +@interface ContentSuggestionsHeaderSynchronizer + : NSObject<ContentSuggestionsCollectionSynchronizing, + ContentSuggestionsHeaderSynchronizing> + +// Initializes the CommandHandler with the |suggestionsViewController| and the +// |headerController|. +- (nullable instancetype) +initWithCollectionController: + (nullable id<ContentSuggestionsCollectionControlling>)collectionController + headerController:(nullable id<ContentSuggestionsHeaderControlling>) + headerController NS_DESIGNATED_INITIALIZER; + +- (nullable instancetype)init NS_UNAVAILABLE; + +@end + +#endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_HEADER_SYNCHRONIZER_H_
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer.mm new file mode 100644 index 0000000..53c9f7c --- /dev/null +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer.mm
@@ -0,0 +1,229 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer.h" + +#import "ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_cell.h" +#import "ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_most_visited_cell.h" +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_controlling.h" +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.h" +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_header_controlling.h" +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h" +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_delegate.h" +#import "ios/chrome/browser/ui/uikit_ui_util.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace { +const CGFloat kShiftTilesDownAnimationDuration = 0.2; +const CGFloat kShiftTilesUpAnimationDuration = 0.25; +} // namespace + +@interface ContentSuggestionsHeaderSynchronizer ()<UIGestureRecognizerDelegate> + +@property(nonatomic, weak, readonly) UICollectionView* collectionView; +// |YES| if the fakebox header should be animated on scroll. +@property(nonatomic, assign) BOOL shouldAnimateHeader; +@property(nonatomic, weak) id<ContentSuggestionsCollectionControlling> + collectionController; +@property(nonatomic, weak) id<ContentSuggestionsHeaderControlling> + headerController; +@property(nonatomic, assign) CFTimeInterval shiftTilesDownStartTime; + +// Tap gesture recognizer when the omnibox is focused. +@property(nonatomic, strong) UITapGestureRecognizer* tapGestureRecognizer; + +// When the omnibox is focused, this value represents the shift distance of the +// collection needed to pin the omnibox to the top. It is 0 if the omnibox has +// not been moved when focused (i.e. the collection was already scrolled to +// top). +@property(nonatomic, assign) CGFloat collectionShiftingOffset; + +@end + +@implementation ContentSuggestionsHeaderSynchronizer + +@synthesize collectionController = _collectionController; +@synthesize headerController = _headerController; +@synthesize shouldAnimateHeader = _shouldAnimateHeader; +@synthesize shiftTilesDownStartTime = _shiftTilesDownStartTime; +@synthesize tapGestureRecognizer = _tapGestureRecognizer; +@synthesize collectionShiftingOffset = _collectionShiftingOffset; + +- (instancetype) +initWithCollectionController: + (id<ContentSuggestionsCollectionControlling>)collectionController + headerController: + (id<ContentSuggestionsHeaderControlling>)headerController { + self = [super init]; + if (self) { + _shiftTilesDownStartTime = -1; + _shouldAnimateHeader = YES; + + _tapGestureRecognizer = [[UITapGestureRecognizer alloc] + initWithTarget:self + action:@selector(unfocusOmnibox)]; + [_tapGestureRecognizer setDelegate:self]; + + _headerController = headerController; + _collectionController = collectionController; + + _collectionShiftingOffset = 0; + } + return self; +} + +#pragma mark - ContentSuggestionsCollectionSynchronizing + +- (void)shiftTilesDown { + [self.collectionView removeGestureRecognizer:self.tapGestureRecognizer]; + + self.shouldAnimateHeader = YES; + + if (self.collectionShiftingOffset == 0 || self.collectionView.dragging) { + [self updateFakeOmniboxForScrollView:self.collectionView]; + return; + } + + self.collectionController.scrolledToTop = NO; + + // CADisplayLink is used for this animation instead of the standard UIView + // animation because the standard animation did not properly convert the + // fakebox from its scrolled up mode to its scrolled down mode. Specifically, + // calling |UICollectionView reloadData| adjacent to the standard animation + // caused the fakebox's views to jump incorrectly. CADisplayLink avoids this + // problem because it allows |shiftTilesDownAnimationDidFire| to directly + // control each frame. + CADisplayLink* link = [CADisplayLink + displayLinkWithTarget:self + selector:@selector(shiftTilesDownAnimationDidFire:)]; + [link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; +} + +- (void)shiftTilesUpWithCompletionBlock:(ProceduralBlock)completion { + // Add gesture recognizer to collection view when the omnibox is focused. + [self.collectionView addGestureRecognizer:self.tapGestureRecognizer]; + + CGFloat pinnedOffsetY = + [self.collectionController.suggestionsDelegate pinnedOffsetY]; + self.collectionShiftingOffset = + MAX(0, pinnedOffsetY - self.collectionView.contentOffset.y); + + if (self.collectionController.scrolledToTop) { + self.shouldAnimateHeader = NO; + if (completion) + completion(); + return; + } + + self.collectionController.scrolledToTop = YES; + self.shouldAnimateHeader = !IsIPadIdiom(); + + [UIView animateWithDuration:kShiftTilesUpAnimationDuration + animations:^{ + if (self.collectionView.contentOffset.y < pinnedOffsetY) { + self.collectionView.contentOffset = CGPointMake(0, pinnedOffsetY); + [self.collectionView.collectionViewLayout invalidateLayout]; + } + } + completion:^(BOOL finished) { + // Check to see if the collection are still scrolled to the top -- it's + // possible (and difficult) to unfocus the omnibox and initiate a + // -shiftTilesDown before the animation here completes. + if (self.collectionController.scrolledToTop) { + self.shouldAnimateHeader = NO; + if (completion) + completion(); + } + }]; +} + +#pragma mark - ContentSuggestionsHeaderSynchronizing + +- (void)updateFakeOmniboxForScrollView:(UIScrollView*)scrollView { + // Unfocus the omnibox when the scroll view is scrolled below the pinned + // offset. + if ([self.headerController isOmniboxFocused] && !self.shouldAnimateHeader) { + [self.headerController unfocusOmnibox]; + } + + if (IsIPadIdiom()) { + return; + } + + if (self.shouldAnimateHeader) { + [self.headerController + updateSearchFieldForOffset:self.collectionView.contentOffset.y]; + } +} + +- (void)unfocusOmnibox { + [self.headerController unfocusOmnibox]; +} + +#pragma mark - Private + +// Convenience method to get the collection view of the suggestions. +- (UICollectionView*)collectionView { + return [self.collectionController collectionView]; +} + +// Updates the collection view's scroll view offset for the next frame of the +// shiftTilesDown animation. +- (void)shiftTilesDownAnimationDidFire:(CADisplayLink*)link { + // If this is the first frame of the animation, store the starting timestamp + // and do nothing. + if (self.shiftTilesDownStartTime == -1) { + self.shiftTilesDownStartTime = link.timestamp; + return; + } + + CFTimeInterval timeElapsed = link.timestamp - self.shiftTilesDownStartTime; + double percentComplete = timeElapsed / kShiftTilesDownAnimationDuration; + // Ensure that the percentage cannot be above 1.0. + if (percentComplete > 1.0) + percentComplete = 1.0; + + // Find how much the collection view should be scrolled up in the next frame. + CGFloat yOffset = + (1.0 - percentComplete) * + [self.collectionController.suggestionsDelegate pinnedOffsetY] + + percentComplete * + ([self.collectionController.suggestionsDelegate pinnedOffsetY] - + self.collectionShiftingOffset); + self.collectionView.contentOffset = CGPointMake(0, yOffset); + + if (percentComplete == 1.0) { + [link invalidate]; + // Reset |shiftTilesDownStartTime to its sentinel value. + self.shiftTilesDownStartTime = -1; + } +} + +#pragma mark - UIGestureRecognizerDelegate + +- (BOOL)gestureRecognizer:(UIGestureRecognizer*)gestureRecognizer + shouldReceiveTouch:(UITouch*)touch { + BOOL isMostVisitedCell = + content_suggestions::nearestAncestor( + touch.view, [ContentSuggestionsMostVisitedCell class]) != nil; + BOOL isSuggestionCell = + content_suggestions::nearestAncestor( + touch.view, [ContentSuggestionsCell class]) != nil; + return !isMostVisitedCell && !isSuggestionCell; +} + +- (UIView*)nearestAncestorOfView:(UIView*)view withClass:(Class)aClass { + if (!view) { + return nil; + } + if ([view isKindOfClass:aClass]) { + return view; + } + return [self nearestAncestorOfView:[view superview] withClass:aClass]; +} + +@end
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer_unittest.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer_unittest.mm new file mode 100644 index 0000000..3a5d27b --- /dev/null +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer_unittest.mm
@@ -0,0 +1,80 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer.h" + +#include "base/memory/ptr_util.h" +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_controlling.h" +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_header_controlling.h" +#import "ios/chrome/test/base/scoped_block_swizzler.h" +#include "testing/platform_test.h" +#import "third_party/ocmock/OCMock/OCMock.h" +#import "third_party/ocmock/gtest_support.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace { + +class ContentSuggestionsHeaderSynchronizerTest : public PlatformTest { + public: + ContentSuggestionsHeaderSynchronizerTest() { + header_controller_ = + OCMProtocolMock(@protocol(ContentSuggestionsHeaderControlling)); + collection_controller_ = + OCMProtocolMock(@protocol(ContentSuggestionsCollectionControlling)); + synchronizer_ = [[ContentSuggestionsHeaderSynchronizer alloc] + initWithCollectionController:collection_controller_ + headerController:header_controller_]; + } + + ContentSuggestionsHeaderSynchronizer* Synchronizer() { return synchronizer_; } + + id HeaderController() { return header_controller_; } + + id CollectionController() { return collection_controller_; } + void SetAsIPhone() { + device_type_swizzler_ = base::MakeUnique<ScopedBlockSwizzler>( + [UIDevice class], @selector(userInterfaceIdiom), + ^UIUserInterfaceIdiom(id self) { + return UIUserInterfaceIdiomPhone; + }); + } + + private: + ContentSuggestionsHeaderSynchronizer* synchronizer_; + id header_controller_; + id collection_controller_; + std::unique_ptr<ScopedBlockSwizzler> device_type_swizzler_; + std::unique_ptr<ScopedBlockSwizzler> orientation_swizzler_; +}; + +TEST_F(ContentSuggestionsHeaderSynchronizerTest, shiftUp) { + // Setup. + id collectionController = CollectionController(); + OCMExpect([collectionController setScrolledToTop:YES]); + + // Action. + [Synchronizer() shiftTilesUpWithCompletionBlock:nil]; + + // Tests. + EXPECT_OCMOCK_VERIFY(collectionController); +} + +TEST_F(ContentSuggestionsHeaderSynchronizerTest, updateFakeOmnibox) { + // Setup. + id headerController = HeaderController(); + OCMExpect([[[headerController stub] ignoringNonObjectArgs] + updateSearchFieldForOffset:10]); + SetAsIPhone(); + id scrollView = OCMClassMock([UIScrollView class]); + + // Action. + [Synchronizer() updateFakeOmniboxForScrollView:scrollView]; + + // Tests. + EXPECT_OCMOCK_VERIFY(headerController); +} +} // namespace
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizing.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizing.h new file mode 100644 index 0000000..e2ab334 --- /dev/null +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizing.h
@@ -0,0 +1,22 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_HEADER_SYNCHRONIZING_H_ +#define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_HEADER_SYNCHRONIZING_H_ + +#import <UIKit/UIKit.h> + +// Synchronizing protocol allowing the ContentSuggestionsViewController to +// synchronize with the header, containing the fake omnibox and the logo. +@protocol ContentSuggestionsHeaderSynchronizing + +// Updates the fake omnibox to adapt to the current scrolling. +- (void)updateFakeOmniboxForScrollView:(nonnull UIScrollView*)scrollView; + +// Unfocuses the omnibox. +- (void)unfocusOmnibox; + +@end + +#endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_HEADER_SYNCHRONIZING_H_
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h index 3f2de43..ff73d9d9 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h
@@ -8,17 +8,20 @@ #import <UIKit/UIKit.h> #import "ios/chrome/browser/ui/collection_view/collection_view_controller.h" +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_controlling.h" @class ContentSuggestionsSectionInformation; @protocol ContentSuggestionsCommands; @protocol ContentSuggestionsDataSource; -@protocol ContentSuggestionsHeaderCommands; +@protocol ContentSuggestionsHeaderSynchronizing; +@protocol ContentSuggestionsViewControllerAudience; @protocol ContentSuggestionsViewControllerDelegate; @protocol OverscrollActionsControllerDelegate; @protocol SuggestedContent; // CollectionViewController to display the suggestions items. -@interface ContentSuggestionsViewController : CollectionViewController +@interface ContentSuggestionsViewController + : CollectionViewController<ContentSuggestionsCollectionControlling> - (instancetype)initWithStyle:(CollectionViewControllerStyle)style dataSource:(id<ContentSuggestionsDataSource>)dataSource @@ -31,10 +34,10 @@ // Handler for the commands sent by the ContentSuggestionsViewController. @property(nonatomic, weak) id<ContentSuggestionsCommands> suggestionCommandHandler; -@property(nonatomic, weak) id<ContentSuggestionsHeaderCommands> +@property(nonatomic, weak) id<ContentSuggestionsHeaderSynchronizing> headerCommandHandler; -@property(nonatomic, weak) id<ContentSuggestionsViewControllerDelegate> - suggestionsDelegate; +@property(nonatomic, weak) id<ContentSuggestionsViewControllerAudience> + audience; // Override from superclass to have a more specific type. @property(nonatomic, readonly) CollectionViewModel<CollectionViewItem<SuggestedContent>*>* @@ -42,9 +45,6 @@ // Delegate for the overscroll actions. @property(nonatomic, weak) id<OverscrollActionsControllerDelegate> overscrollDelegate; -// |YES| if the collection scrollView is scrolled all the way to the top. Used -// to lock this position in place on various frame changes. -@property(nonatomic, assign, getter=isScrolledToTop) BOOL scrolledToTop; // Removes the entry at |indexPath|, from the collection and its model. - (void)dismissEntryAtIndexPath:(NSIndexPath*)indexPath;
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm index 0426b5eb..ef2c902 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
@@ -12,10 +12,10 @@ #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_commands.h" -#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_header_commands.h" +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizing.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_layout.h" +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_audience.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_delegate.h" -#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_utils.h" #import "ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.h" #import "ios/chrome/browser/ui/uikit_ui_util.h" @@ -49,6 +49,7 @@ @implementation ContentSuggestionsViewController +@synthesize audience = _audience; @synthesize suggestionCommandHandler = _suggestionCommandHandler; @synthesize headerCommandHandler = _headerCommandHandler; @synthesize suggestionsDelegate = _suggestionsDelegate; @@ -93,8 +94,9 @@ [self addEmptySectionPlaceholderIfNeeded:indexPath.section]; } completion:^(BOOL) { + [self.audience contentSuggestionsDidScroll]; // The context menu could be displayed for the deleted entry. - [self.suggestionCommandHandler dismissContextMenu]; + [self.suggestionCommandHandler dismissModals]; }]; } @@ -111,8 +113,9 @@ [self.collectionView deleteSections:[NSIndexSet indexSetWithIndex:section]]; } completion:^(BOOL) { + [self.audience contentSuggestionsDidScroll]; // The context menu could be displayed for the deleted entries. - [self.suggestionCommandHandler dismissContextMenu]; + [self.suggestionCommandHandler dismissModals]; }]; } @@ -127,7 +130,9 @@ addSectionsForSectionInfoToModel:@[ sectionInfo ]]; [self.collectionView insertSections:addedSections]; } - completion:nil]; + completion:^(BOOL) { + [self.audience contentSuggestionsDidScroll]; + }]; [self.collectionView performBatchUpdates:^{ NSIndexPath* removedItem = [self.collectionUpdater @@ -141,7 +146,9 @@ withSectionInfo:sectionInfo]; [self.collectionView insertItemsAtIndexPaths:addedItems]; } - completion:nil]; + completion:^(BOOL) { + [self.audience contentSuggestionsDidScroll]; + }]; } #pragma mark - UIViewController @@ -219,21 +226,20 @@ didSelectItemAtIndexPath:(NSIndexPath*)indexPath { [super collectionView:collectionView didSelectItemAtIndexPath:indexPath]; + [self.headerCommandHandler unfocusOmnibox]; + CollectionViewItem* item = [self.collectionViewModel itemAtIndexPath:indexPath]; switch ([self.collectionUpdater contentSuggestionTypeForItem:item]) { case ContentSuggestionTypeReadingList: case ContentSuggestionTypeArticle: - [self unfocusOmnibox]; [self.suggestionCommandHandler openPageForItem:item]; break; case ContentSuggestionTypeMostVisited: - [self unfocusOmnibox]; [self.suggestionCommandHandler openMostVisitedItem:item atIndex:indexPath.item]; break; case ContentSuggestionTypePromo: - [self unfocusOmnibox]; [self dismissEntryAtIndexPath:indexPath]; [self.suggestionCommandHandler handlePromoTapped]; [self.collectionViewLayout invalidateLayout]; @@ -330,7 +336,7 @@ // TODO(crbug.com/635604): Once the headers support dynamic sizing, use it // instead of this. if ([self.collectionUpdater isHeaderSection:section]) - return CGSizeMake(0, 270); + return CGSizeMake(0, 258); return [super collectionView:collectionView layout:collectionViewLayout referenceSizeForHeaderInSection:section]; @@ -392,7 +398,10 @@ - (void)scrollViewDidScroll:(UIScrollView*)scrollView { [super scrollViewDidScroll:scrollView]; [self.overscrollActionsController scrollViewDidScroll:scrollView]; + [self.audience contentSuggestionsDidScroll]; [self.headerCommandHandler updateFakeOmniboxForScrollView:scrollView]; + self.scrolledToTop = + scrollView.contentOffset.y >= [self.suggestionsDelegate pinnedOffsetY]; } - (void)scrollViewWillBeginDragging:(UIScrollView*)scrollView { @@ -416,16 +425,6 @@ scrollViewWillEndDragging:scrollView withVelocity:velocity targetContentOffset:targetContentOffset]; - - if (IsIPadIdiom() || [self.suggestionsDelegate isOmniboxFocused]) - return; - - [ContentSuggestionsViewControllerUtils - viewControllerWillEndDragging:self - withYOffset:scrollView.contentOffset.y - pinnedYOffset:[self.suggestionsDelegate pinnedOffsetY] - draggingUpward:velocity.y > 0 - targetContentOffset:targetContentOffset]; } #pragma mark - Private @@ -481,10 +480,4 @@ [self.collectionView insertItemsAtIndexPaths:@[ emptyItem ]]; } -// Tells WebToolbarController to resign focus to the omnibox. -- (void)unfocusOmnibox { - // TODO(crbug.com/700375): once the omnibox is part of Content Suggestions, - // remove the fake omnibox focus here. -} - @end
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_audience.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_audience.h new file mode 100644 index 0000000..9b13e41 --- /dev/null +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_audience.h
@@ -0,0 +1,17 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_VIEW_CONTROLLER_AUDIENCE_H_ +#define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_VIEW_CONTROLLER_AUDIENCE_H_ + +// Audience for the ContentSuggestions, getting informations from it. +@protocol ContentSuggestionsViewControllerAudience + +// Notifies the audience that the content suggestions collection has been +// scrolled. +- (void)contentSuggestionsDidScroll; + +@end + +#endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_VIEW_CONTROLLER_AUDIENCE_H_
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_utils.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_utils.h deleted file mode 100644 index e835b9b..0000000 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_utils.h +++ /dev/null
@@ -1,27 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_VIEW_CONTROLLER_UTILS_H_ -#define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_VIEW_CONTROLLER_UTILS_H_ - -#import <UIKit/UIKit.h> - -@class ContentSuggestionsViewController; - -// Utils for the ContentSuggestionsViewController -@interface ContentSuggestionsViewControllerUtils : NSObject - -// Updates the |suggestionsViewController| when a dragging of its scroll view -// ends. It also updates the |targetContentOffset| to reflect where the scroll -// should end. -+ (void)viewControllerWillEndDragging: - (ContentSuggestionsViewController*)suggestionsViewController - withYOffset:(CGFloat)yOffset - pinnedYOffset:(CGFloat)pinnedYOffset - draggingUpward:(BOOL)draggingUpward - targetContentOffset:(inout CGPoint*)targetContentOffset; - -@end - -#endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_VIEW_CONTROLLER_UTILS_H_
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_utils.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_utils.mm deleted file mode 100644 index 83992007..0000000 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_utils.mm +++ /dev/null
@@ -1,62 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_utils.h" - -#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h" -#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_delegate.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -@implementation ContentSuggestionsViewControllerUtils - -+ (void)viewControllerWillEndDragging: - (ContentSuggestionsViewController*)suggestionsViewController - withYOffset:(CGFloat)yOffset - pinnedYOffset:(CGFloat)pinnedYOffset - draggingUpward:(BOOL)draggingUpward - targetContentOffset:(inout CGPoint*)targetContentOffset { - CGFloat targetY = targetContentOffset->y; - if (yOffset > 0 && yOffset < pinnedYOffset) { - // Omnibox is currently between middle and top of screen. - if (draggingUpward) { // scrolling upwards - if (targetY < pinnedYOffset) { - // Scroll the omnibox up to |pinnedYOffset| if velocity is upwards but - // scrolling will stop before reaching |pinnedYOffset|. - targetContentOffset->y = yOffset; - [suggestionsViewController.collectionView - setContentOffset:CGPointMake(0, pinnedYOffset) - animated:YES]; - } - suggestionsViewController.scrolledToTop = YES; - } else { // scrolling downwards - if (targetY > 0) { - // Scroll the omnibox down to zero if velocity is downwards or 0 but - // scrolling will stop before reaching 0. - targetContentOffset->y = yOffset; - [suggestionsViewController.collectionView setContentOffset:CGPointZero - animated:YES]; - } - suggestionsViewController.scrolledToTop = NO; - } - } else if (yOffset > pinnedYOffset && - targetContentOffset->y < pinnedYOffset) { - // Most visited cells are currently scrolled up past the omnibox but will - // end the scroll below the omnibox. Stop the scroll at just below the - // omnibox. - targetContentOffset->y = yOffset; - [suggestionsViewController.collectionView - setContentOffset:CGPointMake(0, pinnedYOffset) - animated:YES]; - suggestionsViewController.scrolledToTop = YES; - } else if (yOffset >= pinnedYOffset) { - suggestionsViewController.scrolledToTop = YES; - } else if (yOffset <= 0) { - suggestionsViewController.scrolledToTop = NO; - } -} - -@end
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_utils_unittest.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_utils_unittest.mm deleted file mode 100644 index ca0c7130..0000000 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_utils_unittest.mm +++ /dev/null
@@ -1,132 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_utils.h" - -#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h" -#include "testing/platform_test.h" -#import "third_party/ocmock/OCMock/OCMock.h" -#import "third_party/ocmock/gtest_support.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace { - -class ContentSuggestionsViewControllerUtilsTest : public PlatformTest { - public: - ContentSuggestionsViewControllerUtilsTest() { - collection_ = OCMClassMock([UICollectionView class]); - suggestions_view_controller_ = - OCMClassMock([ContentSuggestionsViewController class]); - OCMStub([suggestions_view_controller_ collectionView]) - .andReturn(collection_); - } - - id MockSuggestionsViewController() { return suggestions_view_controller_; } - - private: - id suggestions_view_controller_; - id collection_; -}; - -TEST_F(ContentSuggestionsViewControllerUtilsTest, - UpwardFromMiddleScreenToMiddleScreen) { - // Setup. - id suggestionsViewController = MockSuggestionsViewController(); - OCMExpect([suggestionsViewController setScrolledToTop:YES]); - CGPoint targetOffset = CGPointMake(0, 80); - - // Action. - [ContentSuggestionsViewControllerUtils - viewControllerWillEndDragging:suggestionsViewController - withYOffset:10 - pinnedYOffset:100 - draggingUpward:YES - targetContentOffset:&targetOffset]; - - // Test. - EXPECT_OCMOCK_VERIFY(suggestionsViewController); - EXPECT_EQ(10, targetOffset.y); -} - -TEST_F(ContentSuggestionsViewControllerUtilsTest, - DownwardFromMiddleScreenToMiddleScreen) { - // Setup. - id suggestionsViewController = MockSuggestionsViewController(); - OCMExpect([suggestionsViewController setScrolledToTop:NO]); - CGPoint targetOffset = CGPointMake(0, 20); - - // Action. - [ContentSuggestionsViewControllerUtils - viewControllerWillEndDragging:suggestionsViewController - withYOffset:10 - pinnedYOffset:100 - draggingUpward:NO - targetContentOffset:&targetOffset]; - - // Test. - EXPECT_OCMOCK_VERIFY(suggestionsViewController); - EXPECT_EQ(10, targetOffset.y); -} - -TEST_F(ContentSuggestionsViewControllerUtilsTest, - FromAboveTheOmniboxToOmnibox) { - // Setup. - id suggestionsViewController = MockSuggestionsViewController(); - OCMExpect([suggestionsViewController setScrolledToTop:YES]); - CGPoint targetOffset = CGPointMake(0, 20); - - // Action. - [ContentSuggestionsViewControllerUtils - viewControllerWillEndDragging:suggestionsViewController - withYOffset:100 - pinnedYOffset:50 - draggingUpward:NO - targetContentOffset:&targetOffset]; - - // Test. - EXPECT_OCMOCK_VERIFY(suggestionsViewController); - EXPECT_EQ(100, targetOffset.y); -} - -TEST_F(ContentSuggestionsViewControllerUtilsTest, EndAboveOmnibox) { - // Setup. - id suggestionsViewController = MockSuggestionsViewController(); - OCMExpect([suggestionsViewController setScrolledToTop:YES]); - CGPoint targetOffset = CGPointMake(0, 50); - - // Action. - [ContentSuggestionsViewControllerUtils - viewControllerWillEndDragging:suggestionsViewController - withYOffset:100 - pinnedYOffset:20 - draggingUpward:NO - targetContentOffset:&targetOffset]; - - // Test. - EXPECT_OCMOCK_VERIFY(suggestionsViewController); - EXPECT_EQ(50, targetOffset.y); -} - -TEST_F(ContentSuggestionsViewControllerUtilsTest, Overscroll) { - // Setup. - id suggestionsViewController = MockSuggestionsViewController(); - OCMExpect([suggestionsViewController setScrolledToTop:NO]); - CGPoint targetOffset = CGPointMake(0, 50); - - // Action. - [ContentSuggestionsViewControllerUtils - viewControllerWillEndDragging:suggestionsViewController - withYOffset:-100 - pinnedYOffset:20 - draggingUpward:NO - targetContentOffset:&targetOffset]; - - // Test. - EXPECT_OCMOCK_VERIFY(suggestionsViewController); - EXPECT_EQ(50, targetOffset.y); -} -}
diff --git a/ios/chrome/browser/ui/content_suggestions/resources/BUILD.gn b/ios/chrome/browser/ui/content_suggestions/resources/BUILD.gn new file mode 100644 index 0000000..efddf80 --- /dev/null +++ b/ios/chrome/browser/ui/content_suggestions/resources/BUILD.gn
@@ -0,0 +1,23 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ios/imageset.gni") + +imageset("content_suggestions_no_image") { + sources = [ + "content_suggestions_no_image.imageset/Contents.json", + "content_suggestions_no_image.imageset/content_suggestions_no_image.png", + "content_suggestions_no_image.imageset/content_suggestions_no_image@2x.png", + "content_suggestions_no_image.imageset/content_suggestions_no_image@3x.png", + ] +} + +imageset("content_suggestions_offline") { + sources = [ + "content_suggestions_offline.imageset/Contents.json", + "content_suggestions_offline.imageset/content_suggestions_offline.png", + "content_suggestions_offline.imageset/content_suggestions_offline@2x.png", + "content_suggestions_offline.imageset/content_suggestions_offline@3x.png", + ] +}
diff --git a/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_no_image.imageset/Contents.json b/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_no_image.imageset/Contents.json new file mode 100644 index 0000000..3b7eb806 --- /dev/null +++ b/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_no_image.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "content_suggestions_no_image.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "content_suggestions_no_image@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "content_suggestions_no_image@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_no_image.png b/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_no_image.imageset/content_suggestions_no_image.png similarity index 100% rename from ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_no_image.png rename to ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_no_image.imageset/content_suggestions_no_image.png Binary files differ
diff --git a/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_no_image@2x.png b/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_no_image.imageset/content_suggestions_no_image@2x.png similarity index 100% rename from ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_no_image@2x.png rename to ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_no_image.imageset/content_suggestions_no_image@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_no_image@3x.png b/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_no_image.imageset/content_suggestions_no_image@3x.png similarity index 100% rename from ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_no_image@3x.png rename to ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_no_image.imageset/content_suggestions_no_image@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_offline.imageset/Contents.json b/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_offline.imageset/Contents.json new file mode 100644 index 0000000..d6becfc2 --- /dev/null +++ b/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_offline.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "content_suggestions_offline.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "content_suggestions_offline@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "content_suggestions_offline@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_offline.png b/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_offline.imageset/content_suggestions_offline.png similarity index 100% rename from ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_offline.png rename to ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_offline.imageset/content_suggestions_offline.png Binary files differ
diff --git a/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_offline@2x.png b/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_offline.imageset/content_suggestions_offline@2x.png similarity index 100% rename from ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_offline@2x.png rename to ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_offline.imageset/content_suggestions_offline@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_offline@3x.png b/ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_offline.imageset/content_suggestions_offline@3x.png similarity index 100% rename from ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_offline@3x.png rename to ios/chrome/browser/ui/content_suggestions/resources/content_suggestions_offline.imageset/content_suggestions_offline@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/downloads/BUILD.gn b/ios/chrome/browser/ui/downloads/BUILD.gn index 380116b..06f6580 100644 --- a/ios/chrome/browser/ui/downloads/BUILD.gn +++ b/ios/chrome/browser/ui/downloads/BUILD.gn
@@ -2,37 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/ios/imageset.gni") import("//build/config/ios/rules.gni") -bundle_data("assets") { - sources = [ - "resources/download_manager_assets.xcassets/Contents.json", - "resources/download_manager_assets.xcassets/error_icon.imageset/Contents.json", - "resources/download_manager_assets.xcassets/error_icon.imageset/error_icon.png", - "resources/download_manager_assets.xcassets/error_icon.imageset/error_icon@2x.png", - "resources/download_manager_assets.xcassets/error_icon.imageset/error_icon@3x.png", - "resources/download_manager_assets.xcassets/file_icon_body.imageset/Contents.json", - "resources/download_manager_assets.xcassets/file_icon_body.imageset/file_icon_body.png", - "resources/download_manager_assets.xcassets/file_icon_body.imageset/file_icon_body@2x.png", - "resources/download_manager_assets.xcassets/file_icon_body.imageset/file_icon_body@3x.png", - "resources/download_manager_assets.xcassets/file_icon_fold.imageset/Contents.json", - "resources/download_manager_assets.xcassets/file_icon_fold.imageset/file_icon_fold.png", - "resources/download_manager_assets.xcassets/file_icon_fold.imageset/file_icon_fold@2x.png", - "resources/download_manager_assets.xcassets/file_icon_fold.imageset/file_icon_fold@3x.png", - "resources/download_manager_assets.xcassets/file_icon_fold_complete.imageset/Contents.json", - "resources/download_manager_assets.xcassets/file_icon_fold_complete.imageset/file_icon_fold_complete.png", - "resources/download_manager_assets.xcassets/file_icon_fold_complete.imageset/file_icon_fold_complete@2x.png", - "resources/download_manager_assets.xcassets/file_icon_fold_complete.imageset/file_icon_fold_complete@3x.png", - ] - outputs = [ - "{{bundle_resources_dir}}/{{source_file_part}}", - ] -} - -bundle_data_ib_file("download_manager_controller_xib") { - source = "resources/DownloadManagerController.xib" -} - source_set("downloads") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ @@ -40,8 +12,11 @@ "download_manager_controller.mm", ] deps = [ - ":assets", ":download_manager_controller_xib", + ":error_icon", + ":file_icon_body", + ":file_icon_fold", + ":file_icon_fold_complete", "//base", "//components/strings", "//ios/chrome/app/strings", @@ -83,3 +58,43 @@ "//third_party/ocmock:ocmock", ] } + +bundle_data_ib_file("download_manager_controller_xib") { + source = "resources/DownloadManagerController.xib" +} + +imageset("error_icon") { + sources = [ + "resources/download_manager_assets.xcassets/error_icon.imageset/Contents.json", + "resources/download_manager_assets.xcassets/error_icon.imageset/error_icon.png", + "resources/download_manager_assets.xcassets/error_icon.imageset/error_icon@2x.png", + "resources/download_manager_assets.xcassets/error_icon.imageset/error_icon@3x.png", + ] +} + +imageset("file_icon_body") { + sources = [ + "resources/download_manager_assets.xcassets/file_icon_body.imageset/Contents.json", + "resources/download_manager_assets.xcassets/file_icon_body.imageset/file_icon_body.png", + "resources/download_manager_assets.xcassets/file_icon_body.imageset/file_icon_body@2x.png", + "resources/download_manager_assets.xcassets/file_icon_body.imageset/file_icon_body@3x.png", + ] +} + +imageset("file_icon_fold") { + sources = [ + "resources/download_manager_assets.xcassets/file_icon_fold.imageset/Contents.json", + "resources/download_manager_assets.xcassets/file_icon_fold.imageset/file_icon_fold.png", + "resources/download_manager_assets.xcassets/file_icon_fold.imageset/file_icon_fold@2x.png", + "resources/download_manager_assets.xcassets/file_icon_fold.imageset/file_icon_fold@3x.png", + ] +} + +imageset("file_icon_fold_complete") { + sources = [ + "resources/download_manager_assets.xcassets/file_icon_fold_complete.imageset/Contents.json", + "resources/download_manager_assets.xcassets/file_icon_fold_complete.imageset/file_icon_fold_complete.png", + "resources/download_manager_assets.xcassets/file_icon_fold_complete.imageset/file_icon_fold_complete@2x.png", + "resources/download_manager_assets.xcassets/file_icon_fold_complete.imageset/file_icon_fold_complete@3x.png", + ] +}
diff --git a/ios/chrome/browser/ui/first_run/BUILD.gn b/ios/chrome/browser/ui/first_run/BUILD.gn index 357aefe2..e80e816 100644 --- a/ios/chrome/browser/ui/first_run/BUILD.gn +++ b/ios/chrome/browser/ui/first_run/BUILD.gn
@@ -2,25 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -bundle_data("assets") { - sources = [ - "resources/FirstRun.xcassets/checkbox.imageset/Contents.json", - "resources/FirstRun.xcassets/checkbox.imageset/checkbox.png", - "resources/FirstRun.xcassets/checkbox.imageset/checkbox@2x.png", - "resources/FirstRun.xcassets/checkbox.imageset/checkbox@2x~ipad.png", - "resources/FirstRun.xcassets/checkbox.imageset/checkbox@3x.png", - "resources/FirstRun.xcassets/checkbox.imageset/checkbox~ipad.png", - "resources/FirstRun.xcassets/checkbox_checked.imageset/Contents.json", - "resources/FirstRun.xcassets/checkbox_checked.imageset/checkbox_checked.png", - "resources/FirstRun.xcassets/checkbox_checked.imageset/checkbox_checked@2x.png", - "resources/FirstRun.xcassets/checkbox_checked.imageset/checkbox_checked@2x~ipad.png", - "resources/FirstRun.xcassets/checkbox_checked.imageset/checkbox_checked@3x.png", - "resources/FirstRun.xcassets/checkbox_checked.imageset/checkbox_checked~ipad.png", - ] - outputs = [ - "{{bundle_resources_dir}}/{{source_file_part}}", - ] -} +import("//build/config/ios/imageset.gni") source_set("first_run") { configs += [ "//build/config/compiler:enable_arc" ] @@ -38,7 +20,8 @@ "welcome_to_chrome_view_controller.mm", ] deps = [ - ":assets", + ":checkbox", + ":checkbox_checked", "//base", "//base:i18n", "//components/metrics", @@ -127,3 +110,25 @@ ] libs = [ "XCTest.framework" ] } + +imageset("checkbox") { + sources = [ + "resources/FirstRun.xcassets/checkbox.imageset/Contents.json", + "resources/FirstRun.xcassets/checkbox.imageset/checkbox.png", + "resources/FirstRun.xcassets/checkbox.imageset/checkbox@2x.png", + "resources/FirstRun.xcassets/checkbox.imageset/checkbox@2x~ipad.png", + "resources/FirstRun.xcassets/checkbox.imageset/checkbox@3x.png", + "resources/FirstRun.xcassets/checkbox.imageset/checkbox~ipad.png", + ] +} + +imageset("checkbox_checked") { + sources = [ + "resources/FirstRun.xcassets/checkbox_checked.imageset/Contents.json", + "resources/FirstRun.xcassets/checkbox_checked.imageset/checkbox_checked.png", + "resources/FirstRun.xcassets/checkbox_checked.imageset/checkbox_checked@2x.png", + "resources/FirstRun.xcassets/checkbox_checked.imageset/checkbox_checked@2x~ipad.png", + "resources/FirstRun.xcassets/checkbox_checked.imageset/checkbox_checked@3x.png", + "resources/FirstRun.xcassets/checkbox_checked.imageset/checkbox_checked~ipad.png", + ] +}
diff --git a/ios/chrome/browser/ui/icons/BUILD.gn b/ios/chrome/browser/ui/icons/BUILD.gn index 59e0dcf1..af58f4c 100644 --- a/ios/chrome/browser/ui/icons/BUILD.gn +++ b/ios/chrome/browser/ui/icons/BUILD.gn
@@ -9,9 +9,13 @@ "chrome_icon.mm", ] deps = [ - ":assets", "//base", "//ios/chrome/app/strings", + "//third_party/material_design_icons:ic_arrow_back", + "//third_party/material_design_icons:ic_chevron_right", + "//third_party/material_design_icons:ic_close", + "//third_party/material_design_icons:ic_info", + "//third_party/material_design_icons:ic_search", "//ui/base", ] libs = [ @@ -35,30 +39,14 @@ configs += [ "//build/config/compiler:enable_arc" ] } -bundle_data("assets") { - sources = [ - "resources/Icons.xcassets/ic_arrow_back.imageset/Contents.json", - "resources/Icons.xcassets/ic_arrow_back.imageset/ic_arrow_back.png", - "resources/Icons.xcassets/ic_arrow_back.imageset/ic_arrow_back_2x.png", - "resources/Icons.xcassets/ic_arrow_back.imageset/ic_arrow_back_3x.png", - "resources/Icons.xcassets/ic_chevron_right.imageset/Contents.json", - "resources/Icons.xcassets/ic_chevron_right.imageset/ic_chevron_right.png", - "resources/Icons.xcassets/ic_chevron_right.imageset/ic_chevron_right_2x.png", - "resources/Icons.xcassets/ic_chevron_right.imageset/ic_chevron_right_3x.png", - "resources/Icons.xcassets/ic_close.imageset/Contents.json", - "resources/Icons.xcassets/ic_close.imageset/ic_close.png", - "resources/Icons.xcassets/ic_close.imageset/ic_close_2x.png", - "resources/Icons.xcassets/ic_close.imageset/ic_close_3x.png", - "resources/Icons.xcassets/ic_info.imageset/Contents.json", - "resources/Icons.xcassets/ic_info.imageset/ic_info.png", - "resources/Icons.xcassets/ic_info.imageset/ic_info_2x.png", - "resources/Icons.xcassets/ic_info.imageset/ic_info_3x.png", - "resources/Icons.xcassets/ic_search.imageset/Contents.json", - "resources/Icons.xcassets/ic_search.imageset/ic_search.png", - "resources/Icons.xcassets/ic_search.imageset/ic_search_2x.png", - "resources/Icons.xcassets/ic_search.imageset/ic_search_3x.png", - ] - outputs = [ - "{{bundle_resources_dir}}/{{source_file_part}}", +# TODO(crbug.com/734054): remove this target when the downstream repository +# has been fixed to directly depends on the individual targets. +group("assets") { + deps = [ + "//third_party/material_design_icons:ic_arrow_back", + "//third_party/material_design_icons:ic_chevron_right", + "//third_party/material_design_icons:ic_close", + "//third_party/material_design_icons:ic_info", + "//third_party/material_design_icons:ic_search", ] }
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_arrow_back.imageset/Contents.json b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_arrow_back.imageset/Contents.json deleted file mode 100644 index b718fd6c..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_arrow_back.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "filename": "ic_arrow_back.png", - "idiom": "universal", - "scale": "1x" - }, - { - "filename": "ic_arrow_back_2x.png", - "idiom": "universal", - "scale": "2x" - }, - { - "filename": "ic_arrow_back_3x.png", - "idiom": "universal", - "scale": "3x" - } - ], - "info": { - "author": "xcode", - "version": 1 - } -}
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_arrow_back.imageset/ic_arrow_back.png b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_arrow_back.imageset/ic_arrow_back.png deleted file mode 100644 index ad38830..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_arrow_back.imageset/ic_arrow_back.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_arrow_back.imageset/ic_arrow_back_2x.png b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_arrow_back.imageset/ic_arrow_back_2x.png deleted file mode 100644 index 68427253..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_arrow_back.imageset/ic_arrow_back_2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_arrow_back.imageset/ic_arrow_back_3x.png b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_arrow_back.imageset/ic_arrow_back_3x.png deleted file mode 100644 index 2cebb5b..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_arrow_back.imageset/ic_arrow_back_3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_chevron_right.imageset/Contents.json b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_chevron_right.imageset/Contents.json deleted file mode 100644 index 963ae5d..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_chevron_right.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "filename": "ic_chevron_right.png", - "idiom": "universal", - "scale": "1x" - }, - { - "filename": "ic_chevron_right_2x.png", - "idiom": "universal", - "scale": "2x" - }, - { - "filename": "ic_chevron_right_3x.png", - "idiom": "universal", - "scale": "3x" - } - ], - "info": { - "author": "xcode", - "version": 1 - } -}
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_chevron_right.imageset/ic_chevron_right.png b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_chevron_right.imageset/ic_chevron_right.png deleted file mode 100644 index c11a2a5..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_chevron_right.imageset/ic_chevron_right.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_chevron_right.imageset/ic_chevron_right_2x.png b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_chevron_right.imageset/ic_chevron_right_2x.png deleted file mode 100644 index 23338b8b..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_chevron_right.imageset/ic_chevron_right_2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_chevron_right.imageset/ic_chevron_right_3x.png b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_chevron_right.imageset/ic_chevron_right_3x.png deleted file mode 100644 index f97c51b..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_chevron_right.imageset/ic_chevron_right_3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_close.imageset/Contents.json b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_close.imageset/Contents.json deleted file mode 100644 index 20b18c4..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_close.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "filename": "ic_close.png", - "idiom": "universal", - "scale": "1x" - }, - { - "filename": "ic_close_2x.png", - "idiom": "universal", - "scale": "2x" - }, - { - "filename": "ic_close_3x.png", - "idiom": "universal", - "scale": "3x" - } - ], - "info": { - "author": "xcode", - "version": 1 - } -}
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_close.imageset/ic_close.png b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_close.imageset/ic_close.png deleted file mode 100644 index 40a1a84..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_close.imageset/ic_close.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_close.imageset/ic_close_2x.png b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_close.imageset/ic_close_2x.png deleted file mode 100644 index 6bc4372..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_close.imageset/ic_close_2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_close.imageset/ic_close_3x.png b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_close.imageset/ic_close_3x.png deleted file mode 100644 index 51b4401..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_close.imageset/ic_close_3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_info.imageset/Contents.json b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_info.imageset/Contents.json deleted file mode 100644 index 0f78309d..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_info.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "filename": "ic_info.png", - "idiom": "universal", - "scale": "1x" - }, - { - "filename": "ic_info_2x.png", - "idiom": "universal", - "scale": "2x" - }, - { - "filename": "ic_info_3x.png", - "idiom": "universal", - "scale": "3x" - } - ], - "info": { - "author": "xcode", - "version": 1 - } -}
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_info.imageset/ic_info.png b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_info.imageset/ic_info.png deleted file mode 100644 index 5ef3dc0..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_info.imageset/ic_info.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_info.imageset/ic_info_2x.png b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_info.imageset/ic_info_2x.png deleted file mode 100644 index 46ed12a..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_info.imageset/ic_info_2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_info.imageset/ic_info_3x.png b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_info.imageset/ic_info_3x.png deleted file mode 100644 index a81eeb9..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_info.imageset/ic_info_3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_search.imageset/Contents.json b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_search.imageset/Contents.json deleted file mode 100644 index beaffd3..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_search.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "filename": "ic_search.png", - "idiom": "universal", - "scale": "1x" - }, - { - "filename": "ic_search_2x.png", - "idiom": "universal", - "scale": "2x" - }, - { - "filename": "ic_search_3x.png", - "idiom": "universal", - "scale": "3x" - } - ], - "info": { - "author": "xcode", - "version": 1 - } -}
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_search.imageset/ic_search.png b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_search.imageset/ic_search.png deleted file mode 100644 index 6b16343..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_search.imageset/ic_search.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_search.imageset/ic_search_2x.png b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_search.imageset/ic_search_2x.png deleted file mode 100644 index 6381902..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_search.imageset/ic_search_2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_search.imageset/ic_search_3x.png b/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_search.imageset/ic_search_3x.png deleted file mode 100644 index 3ae490e..0000000 --- a/ios/chrome/browser/ui/icons/resources/Icons.xcassets/ic_search.imageset/ic_search_3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/ntp/BUILD.gn b/ios/chrome/browser/ui/ntp/BUILD.gn index 6629b0b..c093a5b 100644 --- a/ios/chrome/browser/ui/ntp/BUILD.gn +++ b/ios/chrome/browser/ui/ntp/BUILD.gn
@@ -169,6 +169,7 @@ } source_set("ntp_internal") { + configs += [ "//build/config/compiler:enable_arc" ] sources = [ "centering_scrollview.h", "centering_scrollview.mm",
diff --git a/ios/chrome/browser/ui/ntp/centering_scrollview.mm b/ios/chrome/browser/ui/ntp/centering_scrollview.mm index e6dbf0e..399b4e3 100644 --- a/ios/chrome/browser/ui/ntp/centering_scrollview.mm +++ b/ios/chrome/browser/ui/ntp/centering_scrollview.mm
@@ -7,6 +7,10 @@ #include "base/logging.h" #include "ios/chrome/browser/ui/ui_util.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace { // Thickness of scrollbar images inserted by UIScrollView (circa iOS 5.0). const CGFloat kScrollBarThickness = 7.0;
diff --git a/ios/chrome/browser/ui/ntp/google_landing_mediator.mm b/ios/chrome/browser/ui/ntp/google_landing_mediator.mm index 693d450..487c223 100644 --- a/ios/chrome/browser/ui/ntp/google_landing_mediator.mm +++ b/ios/chrome/browser/ui/ntp/google_landing_mediator.mm
@@ -4,9 +4,7 @@ #import "ios/chrome/browser/ui/ntp/google_landing_mediator.h" -#import "base/ios/weak_nsobject.h" #include "base/mac/bind_objc_block.h" -#include "base/mac/scoped_nsobject.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" #include "base/strings/sys_string_conversions.h" @@ -44,6 +42,10 @@ #include "ios/web/public/web_state/web_state.h" #include "skia/ext/skia_utils_ios.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + using base::UserMetricsAction; namespace { @@ -70,7 +72,7 @@ void OnTemplateURLServiceChanged() override; private: - base::WeakNSObject<GoogleLandingMediator> _owner; + __weak GoogleLandingMediator* _owner; TemplateURLService* _templateURLService; // weak }; @@ -100,7 +102,7 @@ BOOL _recordedPageImpression; // Controller to fetch and show doodles or a default Google logo. - base::scoped_nsprotocol<id<LogoVendor>> _doodleController; + id<LogoVendor> _doodleController; // Listen for default search engine changes. std::unique_ptr<google_landing::SearchEngineObserver> _observer; @@ -135,23 +137,16 @@ // Used to cancel tasks for the LargeIconService. base::CancelableTaskTracker _cancelable_task_tracker; - - // Consumer to handle google landing update notifications. - base::WeakNSProtocol<id<GoogleLandingConsumer>> _consumer; - - // Dispatcher for this mediator. - base::WeakNSProtocol<id<ChromeExecuteCommand, UrlLoader>> _dispatcher; } // Consumer to handle google landing update notifications. -@property(nonatomic, assign, readonly) id<GoogleLandingConsumer> consumer; +@property(nonatomic, weak) id<GoogleLandingConsumer> consumer; // The WebStateList that is being observed by this mediator. @property(nonatomic, assign, readonly) WebStateList* webStateList; // The dispatcher for this mediator. -@property(nonatomic, assign, readonly) id<ChromeExecuteCommand, UrlLoader> - dispatcher; +@property(nonatomic, weak) id<ChromeExecuteCommand, UrlLoader> dispatcher; // Perform initial setup. - (void)setUp; @@ -161,6 +156,8 @@ @implementation GoogleLandingMediator @synthesize webStateList = _webStateList; +@synthesize consumer = _consumer; +@synthesize dispatcher = _dispatcher; - (instancetype)initWithConsumer:(id<GoogleLandingConsumer>)consumer browserState:(ios::ChromeBrowserState*)browserState @@ -168,9 +165,9 @@ webStateList:(WebStateList*)webStateList { self = [super init]; if (self) { - _consumer.reset(consumer); + _consumer = consumer; _browserState = browserState; - _dispatcher.reset(dispatcher); + _dispatcher = dispatcher; _webStateList = webStateList; _webStateListObserver = base::MakeUnique<WebStateListObserverBridge>(self); @@ -207,9 +204,9 @@ _observer.reset( new google_landing::SearchEngineObserver(self, _templateURLService)); _templateURLService->Load(); - _doodleController.reset(ios::GetChromeBrowserProvider()->CreateLogoVendor( - _browserState, self.dispatcher)); - [self.consumer setLogoVendor:_doodleController]; + _doodleController = ios::GetChromeBrowserProvider()->CreateLogoVendor( + _browserState, self.dispatcher); + [_consumer setLogoVendor:_doodleController]; [self updateShowLogo]; // Set up most visited sites. This call may have the side effect of @@ -298,7 +295,7 @@ fallbackCallback:(void (^)(UIColor* textColor, UIColor* backgroundColor, BOOL isDefaultColor))fallbackCallback { - base::WeakNSObject<GoogleLandingMediator> weakSelf(self); + __weak GoogleLandingMediator* weakSelf = self; void (^faviconBlock)(const favicon_base::LargeIconResult&) = ^( const favicon_base::LargeIconResult& result) { @@ -325,11 +322,10 @@ : ntp_tiles::TileVisualType::ICON_COLOR; } - base::scoped_nsobject<GoogleLandingMediator> strongSelf([weakSelf retain]); - if (strongSelf) { - if ((result.bitmap.is_valid() || result.fallback_icon_style)) - [strongSelf largeIconCache]->SetCachedResult(URL, result); - [strongSelf faviconOfType:tileType fetchedForURL:URL]; + GoogleLandingMediator* strongSelf = weakSelf; + if (strongSelf && + (result.bitmap.is_valid() || result.fallback_icon_style)) { + [strongSelf largeIconCache]->SetCachedResult(URL, result); } }; @@ -344,7 +340,7 @@ CGFloat faviconSize = [UIScreen mainScreen].scale * size; CGFloat faviconMinSize = [UIScreen mainScreen].scale * kFaviconMinSize; [self largeIconService]->GetLargeIconOrFallbackStyle( - URL, faviconMinSize, faviconSize, base::BindBlock(faviconBlock), + URL, faviconMinSize, faviconSize, base::BindBlockArc(faviconBlock), &_cancelable_task_tracker); } @@ -439,9 +435,8 @@ } if (_notificationPromo->IsChromeCommand()) { - base::scoped_nsobject<GenericChromeCommand> command( - [[GenericChromeCommand alloc] - initWithTag:_notificationPromo->command_id()]); + GenericChromeCommand* command = [[GenericChromeCommand alloc] + initWithTag:_notificationPromo->command_id()]; [self.dispatcher chromeExecuteCommand:command]; return; } @@ -474,14 +469,4 @@ } } -#pragma mark - Properties - -- (id<GoogleLandingConsumer>)consumer { - return _consumer.get(); -} - -- (id<ChromeExecuteCommand, UrlLoader>)dispatcher { - return _dispatcher.get(); -} - @end
diff --git a/ios/chrome/browser/ui/ntp/google_landing_view_controller.h b/ios/chrome/browser/ui/ntp/google_landing_view_controller.h index 01859bf..a40c9877 100644 --- a/ios/chrome/browser/ui/ntp/google_landing_view_controller.h +++ b/ios/chrome/browser/ui/ntp/google_landing_view_controller.h
@@ -25,9 +25,9 @@ NewTabPagePanelProtocol, ToolbarOwner> -@property(nonatomic, assign) id<GoogleLandingDataSource> dataSource; +@property(nonatomic, weak) id<GoogleLandingDataSource> dataSource; -@property(nonatomic, assign) id<UrlLoader, OmniboxFocuser> dispatcher; +@property(nonatomic, weak) id<UrlLoader, OmniboxFocuser> dispatcher; @end
diff --git a/ios/chrome/browser/ui/ntp/google_landing_view_controller.mm b/ios/chrome/browser/ui/ntp/google_landing_view_controller.mm index 6748805..69f1073 100644 --- a/ios/chrome/browser/ui/ntp/google_landing_view_controller.mm +++ b/ios/chrome/browser/ui/ntp/google_landing_view_controller.mm
@@ -35,6 +35,10 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/page_transition_types.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + using base::UserMetricsAction; namespace { @@ -61,28 +65,27 @@ UIGestureRecognizerDelegate, WhatsNewHeaderViewDelegate> { // Fake omnibox. - base::scoped_nsobject<UIButton> _searchTapTarget; + UIButton* _searchTapTarget; // A collection view for the most visited sites. - base::scoped_nsobject<UICollectionView> _mostVisitedView; + UICollectionView* _mostVisitedView; // The overscroll actions controller managing accelerators over the toolbar. - base::scoped_nsobject<OverscrollActionsController> - _overscrollActionsController; + OverscrollActionsController* _overscrollActionsController; // |YES| when notifications indicate the omnibox is focused. BOOL _omniboxFocused; // Tap and swipe gesture recognizers when the omnibox is focused. - base::scoped_nsobject<UITapGestureRecognizer> _tapGestureRecognizer; - base::scoped_nsobject<UISwipeGestureRecognizer> _swipeGestureRecognizer; + UITapGestureRecognizer* _tapGestureRecognizer; + UISwipeGestureRecognizer* _swipeGestureRecognizer; // Handles displaying the context menu for all form factors. - base::scoped_nsobject<ContextMenuCoordinator> _contextMenuCoordinator; + ContextMenuCoordinator* _contextMenuCoordinator; // URL of the last deleted most viewed entry. If present the UI to restore it // is shown. - base::scoped_nsobject<NSURL> _deletedUrl; + NSURL* _deletedUrl; // |YES| if the view has finished its first layout. This is useful when // determining if the view has sized itself for tablet. @@ -101,24 +104,24 @@ CFTimeInterval _shiftTilesDownStartTime; CGSize _mostVisitedCellSize; - base::scoped_nsobject<NSLayoutConstraint> _hintLabelLeadingConstraint; - base::scoped_nsobject<NSLayoutConstraint> _voiceTapTrailingConstraint; - base::scoped_nsobject<NSLayoutConstraint> _doodleHeightConstraint; - base::scoped_nsobject<NSLayoutConstraint> _doodleTopMarginConstraint; - base::scoped_nsobject<NSLayoutConstraint> _searchFieldWidthConstraint; - base::scoped_nsobject<NSLayoutConstraint> _searchFieldHeightConstraint; - base::scoped_nsobject<NSLayoutConstraint> _searchFieldTopMarginConstraint; - base::scoped_nsobject<NewTabPageHeaderView> _headerView; - base::scoped_nsobject<WhatsNewHeaderView> _promoHeaderView; - base::WeakNSProtocol<id<GoogleLandingDataSource>> _dataSource; - base::WeakNSProtocol<id<UrlLoader, OmniboxFocuser>> _dispatcher; + NSLayoutConstraint* _hintLabelLeadingConstraint; + NSLayoutConstraint* _voiceTapTrailingConstraint; + NSLayoutConstraint* _doodleHeightConstraint; + NSLayoutConstraint* _doodleTopMarginConstraint; + NSLayoutConstraint* _searchFieldWidthConstraint; + NSLayoutConstraint* _searchFieldHeightConstraint; + NSLayoutConstraint* _searchFieldTopMarginConstraint; + NewTabPageHeaderView* _headerView; + WhatsNewHeaderView* _promoHeaderView; + __weak id<GoogleLandingDataSource> _dataSource; + __weak id<UrlLoader, OmniboxFocuser> _dispatcher; } // Whether the Google logo or doodle is being shown. @property(nonatomic, assign) BOOL logoIsShowing; // Exposes view and methods to drive the doodle. -@property(nonatomic, assign) id<LogoVendor> logoVendor; +@property(nonatomic, weak) id<LogoVendor> logoVendor; // |YES| if this consumer is has voice search enabled. @property(nonatomic, assign) BOOL voiceSearchIsEnabled; @@ -127,7 +130,7 @@ @property(nonatomic, assign) NSUInteger maximumMostVisitedSitesShown; // Gets the text of a what's new promo. -@property(nonatomic, retain) NSString* promoText; +@property(nonatomic, strong) NSString* promoText; // Gets the icon of a what's new promo. // TODO(crbug.com/694750): This should not be WhatsNewIcon. @@ -228,13 +231,13 @@ _scrolledToTop = NO; _animateHeader = YES; - _tapGestureRecognizer.reset([[UITapGestureRecognizer alloc] - initWithTarget:self - action:@selector(blurOmnibox)]); + _tapGestureRecognizer = + [[UITapGestureRecognizer alloc] initWithTarget:self + action:@selector(blurOmnibox)]; [_tapGestureRecognizer setDelegate:self]; - _swipeGestureRecognizer.reset([[UISwipeGestureRecognizer alloc] - initWithTarget:self - action:@selector(blurOmnibox)]); + _swipeGestureRecognizer = + [[UISwipeGestureRecognizer alloc] initWithTarget:self + action:@selector(blurOmnibox)]; [_swipeGestureRecognizer setDirection:UISwipeGestureRecognizerDirectionDown]; self.leftMargin = @@ -303,7 +306,6 @@ [_mostVisitedView setDelegate:nil]; [_mostVisitedView setDataSource:nil]; [_overscrollActionsController invalidate]; - [super dealloc]; } #pragma mark - Properties @@ -313,7 +315,7 @@ } - (void)setDataSource:(id<GoogleLandingDataSource>)dataSource { - _dataSource.reset(dataSource); + _dataSource = dataSource; } - (id<UrlLoader, OmniboxFocuser>)dispatcher { @@ -321,7 +323,7 @@ } - (void)setDispatcher:(id<UrlLoader, OmniboxFocuser>)dispatcher { - _dispatcher.reset(dispatcher); + _dispatcher = dispatcher; } #pragma mark - Private @@ -382,7 +384,7 @@ // Initialize and add a search field tap target and a voice search button. - (void)addSearchField { - _searchTapTarget.reset([[UIButton alloc] init]); + _searchTapTarget = [[UIButton alloc] init]; if (IsIPadIdiom()) { UIImage* searchBoxImage = [[UIImage imageNamed:@"ntp_google_search_box"] resizableImageWithCapInsets:kSearchBoxStretchInsets]; @@ -399,22 +401,22 @@ [_searchTapTarget setIsAccessibilityElement:NO]; // Set up fakebox hint label. - UILabel* searchHintLabel = [[[UILabel alloc] init] autorelease]; + UILabel* searchHintLabel = [[UILabel alloc] init]; content_suggestions::configureSearchHintLabel(searchHintLabel, - _searchTapTarget.get()); + _searchTapTarget); - _hintLabelLeadingConstraint.reset([[searchHintLabel.leadingAnchor + _hintLabelLeadingConstraint = [searchHintLabel.leadingAnchor constraintEqualToAnchor:[_searchTapTarget leadingAnchor] - constant:kHintLabelSidePadding] retain]); + constant:kHintLabelSidePadding]; [_hintLabelLeadingConstraint setActive:YES]; // Add a voice search button. - UIButton* voiceTapTarget = [[[UIButton alloc] init] autorelease]; + UIButton* voiceTapTarget = [[UIButton alloc] init]; content_suggestions::configureVoiceSearchButton(voiceTapTarget, - _searchTapTarget.get()); + _searchTapTarget); - _voiceTapTrailingConstraint.reset([[voiceTapTarget.trailingAnchor - constraintEqualToAnchor:[_searchTapTarget trailingAnchor]] retain]); + _voiceTapTrailingConstraint = [voiceTapTarget.trailingAnchor + constraintEqualToAnchor:[_searchTapTarget trailingAnchor]]; [NSLayoutConstraint activateConstraints:@[ [searchHintLabel.trailingAnchor constraintEqualToAnchor:voiceTapTarget.leadingAnchor], @@ -447,28 +449,27 @@ // Use a GenericChromeCommand because |sender| already has a tag set for a // different command. - base::scoped_nsobject<GenericChromeCommand> command( - [[GenericChromeCommand alloc] initWithTag:IDC_PRELOAD_VOICE_SEARCH]); + GenericChromeCommand* command = + [[GenericChromeCommand alloc] initWithTag:IDC_PRELOAD_VOICE_SEARCH]; [sender chromeExecuteCommand:command]; } // Initialize and add a panel with most visited sites. - (void)addMostVisited { CGRect mostVisitedFrame = [self.view bounds]; - base::scoped_nsobject<UICollectionViewFlowLayout> flowLayout; + UICollectionViewFlowLayout* flowLayout; if (IsIPadIdiom()) - flowLayout.reset([[UICollectionViewFlowLayout alloc] init]); + flowLayout = [[UICollectionViewFlowLayout alloc] init]; else - flowLayout.reset([[MostVisitedLayout alloc] init]); + flowLayout = [[MostVisitedLayout alloc] init]; [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical]; [flowLayout setItemSize:_mostVisitedCellSize]; [flowLayout setMinimumInteritemSpacing:8]; [flowLayout setMinimumLineSpacing:content_suggestions::spacingBetweenTiles()]; DCHECK(!_mostVisitedView); - _mostVisitedView.reset([[UICollectionView alloc] - initWithFrame:mostVisitedFrame - collectionViewLayout:flowLayout]); + _mostVisitedView = [[UICollectionView alloc] initWithFrame:mostVisitedFrame + collectionViewLayout:flowLayout]; [_mostVisitedView setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth]; [_mostVisitedView setDelegate:self]; @@ -501,8 +502,8 @@ - (void)addOverscrollActions { if (!IsIPadIdiom()) { - _overscrollActionsController.reset([[OverscrollActionsController alloc] - initWithScrollView:_mostVisitedView]); + _overscrollActionsController = [[OverscrollActionsController alloc] + initWithScrollView:_mostVisitedView]; [_overscrollActionsController setStyle:OverscrollStyle::NTP_NON_INCOGNITO]; [_overscrollActionsController setDelegate:self]; } @@ -655,28 +656,26 @@ - (void)addConstraintsForLogoView:(UIView*)logoView searchField:(UIView*)searchField andHeaderView:(UIView*)headerView { - _doodleTopMarginConstraint.reset([[logoView.topAnchor + _doodleTopMarginConstraint = [logoView.topAnchor constraintEqualToAnchor:headerView.topAnchor - constant:content_suggestions::doodleTopMargin()] retain]); - _doodleHeightConstraint.reset([[logoView.heightAnchor + constant:content_suggestions::doodleTopMargin()]; + _doodleHeightConstraint = [logoView.heightAnchor constraintEqualToConstant:content_suggestions::doodleHeight( - self.logoIsShowing)] retain]); - _searchFieldWidthConstraint.reset([[searchField.widthAnchor + self.logoIsShowing)]; + _searchFieldWidthConstraint = [searchField.widthAnchor constraintEqualToConstant:content_suggestions::searchFieldWidth( - [self viewWidth])] retain]); - _searchFieldHeightConstraint.reset([[searchField.heightAnchor - constraintEqualToConstant:content_suggestions::kSearchFieldHeight] - retain]); - _searchFieldTopMarginConstraint.reset([[searchField.topAnchor + [self viewWidth])]; + _searchFieldHeightConstraint = [searchField.heightAnchor + constraintEqualToConstant:content_suggestions::kSearchFieldHeight]; + _searchFieldTopMarginConstraint = [searchField.topAnchor constraintEqualToAnchor:logoView.bottomAnchor - constant:content_suggestions::searchFieldTopMargin()] - retain]); + constant:content_suggestions::searchFieldTopMargin()]; [NSLayoutConstraint activateConstraints:@[ _doodleTopMarginConstraint, - _doodleHeightConstraint.get(), - _searchFieldWidthConstraint.get(), - _searchFieldHeightConstraint.get(), - _searchFieldTopMarginConstraint.get(), + _doodleHeightConstraint, + _searchFieldWidthConstraint, + _searchFieldHeightConstraint, + _searchFieldTopMarginConstraint, [logoView.widthAnchor constraintEqualToAnchor:headerView.widthAnchor], [logoView.leadingAnchor constraintEqualToAnchor:headerView.leadingAnchor], [searchField.centerXAnchor @@ -751,11 +750,11 @@ // TODO(jif): This needs a radar, since it is almost certainly a // UIKit accessibility bug. crbug.com/529271 if (UIAccessibilityIsVoiceOverRunning()) { - UICollectionView* blockView = [_mostVisitedView retain]; + __block UICollectionView* blockView = _mostVisitedView; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, static_cast<int64_t>(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [blockView release]; + blockView = nil; }); } @@ -783,7 +782,7 @@ withReuseIdentifier:@"header" forIndexPath:indexPath]; if (!_headerView) { - _headerView.reset([[NewTabPageHeaderView alloc] init]); + _headerView = [[NewTabPageHeaderView alloc] init]; [_headerView addSubview:[self.logoVendor view]]; [_headerView addSubview:_searchTapTarget]; self.logoVendor.view.translatesAutoresizingMaskIntoConstraints = NO; @@ -820,7 +819,7 @@ withReuseIdentifier:@"header" forIndexPath:indexPath]; if (!_promoHeaderView) { - _promoHeaderView.reset([[WhatsNewHeaderView alloc] init]); + _promoHeaderView = [[WhatsNewHeaderView alloc] init]; [_promoHeaderView setSideMargin:content_suggestions::centeredTilesMarginForWidth( [self viewWidth]) @@ -887,10 +886,10 @@ [cell setupWithURL:ntpTile.url title:title dataSource:self.dataSource]; - base::scoped_nsobject<UILongPressGestureRecognizer> longPress( + UILongPressGestureRecognizer* longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self - action:@selector(handleMostVisitedLongPress:)]); + action:@selector(handleMostVisitedLongPress:)]; [cell addGestureRecognizer:longPress]; return cell; @@ -917,25 +916,24 @@ web::ContextMenuParams params; // Get view coordinates in local space. params.location = [sender locationInView:self.view]; - params.view.reset([self.view retain]); + params.view.reset(self.view); // Present sheet/popover using controller that is added to view hierarchy. UIViewController* topController = [params.view window].rootViewController; while (topController.presentedViewController) topController = topController.presentedViewController; - _contextMenuCoordinator.reset([[ContextMenuCoordinator alloc] - initWithBaseViewController:topController - params:params]); + _contextMenuCoordinator = + [[ContextMenuCoordinator alloc] initWithBaseViewController:topController + params:params]; ProceduralBlock action; // Open In New Tab. GURL url = [self urlForIndex:index]; - base::WeakNSObject<GoogleLandingViewController> weakSelf(self); + __weak GoogleLandingViewController* weakSelf = self; action = ^{ - base::scoped_nsobject<GoogleLandingViewController> strongSelf( - [weakSelf retain]); + GoogleLandingViewController* strongSelf = weakSelf; if (!strongSelf) return; MostVisitedCell* cell = (MostVisitedCell*)sender.view; @@ -953,8 +951,7 @@ // Open in Incognito Tab. action = ^{ - base::scoped_nsobject<GoogleLandingViewController> strongSelf( - [weakSelf retain]); + GoogleLandingViewController* strongSelf = weakSelf; if (!strongSelf) return; MostVisitedCell* cell = (MostVisitedCell*)sender.view; @@ -975,8 +972,7 @@ NSString* title = l10n_util::GetNSStringWithFixup(IDS_BOOKMARK_BUBBLE_REMOVE_BOOKMARK); action = ^{ - base::scoped_nsobject<GoogleLandingViewController> strongSelf( - [weakSelf retain]); + GoogleLandingViewController* strongSelf = weakSelf; // Early return if the controller has been deallocated. if (!strongSelf) return; @@ -994,14 +990,12 @@ } - (void)showMostVisitedUndoForURL:(NSURL*)url { - _deletedUrl.reset([url retain]); + _deletedUrl = url; - MDCSnackbarMessageAction* action = - [[[MDCSnackbarMessageAction alloc] init] autorelease]; - base::WeakNSObject<GoogleLandingViewController> weakSelf(self); + MDCSnackbarMessageAction* action = [[MDCSnackbarMessageAction alloc] init]; + __weak GoogleLandingViewController* weakSelf = self; action.handler = ^{ - base::scoped_nsobject<GoogleLandingViewController> strongSelf( - [weakSelf retain]); + GoogleLandingViewController* strongSelf = weakSelf; if (!strongSelf) return; [[strongSelf dataSource] @@ -1226,13 +1220,13 @@ didTriggerAction:(OverscrollAction)action { switch (action) { case OverscrollAction::NEW_TAB: { - base::scoped_nsobject<GenericChromeCommand> command( - [[GenericChromeCommand alloc] initWithTag:IDC_NEW_TAB]); + GenericChromeCommand* command = + [[GenericChromeCommand alloc] initWithTag:IDC_NEW_TAB]; [[self view] chromeExecuteCommand:command]; } break; case OverscrollAction::CLOSE_TAB: { - base::scoped_nsobject<GenericChromeCommand> command( - [[GenericChromeCommand alloc] initWithTag:IDC_CLOSE_TAB]); + GenericChromeCommand* command = + [[GenericChromeCommand alloc] initWithTag:IDC_CLOSE_TAB]; [[self view] chromeExecuteCommand:command]; } break; case OverscrollAction::REFRESH:
diff --git a/ios/chrome/browser/ui/ntp/incognito_panel_controller.mm b/ios/chrome/browser/ui/ntp/incognito_panel_controller.mm index 855f90c..6c481d86 100644 --- a/ios/chrome/browser/ui/ntp/incognito_panel_controller.mm +++ b/ios/chrome/browser/ui/ntp/incognito_panel_controller.mm
@@ -6,7 +6,6 @@ #include <string> -#import "base/mac/scoped_nsobject.h" #include "components/google/core/browser/google_util.h" #include "components/strings/grit/components_strings.h" #include "ios/chrome/browser/application_context.h" @@ -23,6 +22,10 @@ #include "ui/base/l10n/l10n_util.h" #include "url/gurl.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace { // The URL for the the Learn More page shown on incognito new tab. // Taken from ntp_resource_cache.cc. @@ -53,63 +56,63 @@ @end @implementation IncognitoNTPView { - base::WeakNSProtocol<id<UrlLoader>> _loader; - base::scoped_nsobject<UIView> _containerView; + __weak id<UrlLoader> _loader; + UIView* _containerView; // Constraint ensuring that |containerView| is at least as high as the // superview of the IncognitoNTPView, i.e. the Incognito panel. // This ensures that if the Incognito panel is higher than a compact // |containerView|, the |containerView|'s |topGuide| and |bottomGuide| are // forced to expand, centering the views in between them. - base::scoped_nsobject<NSLayoutConstraint> _containerVerticalConstraint; + NSLayoutConstraint* _containerVerticalConstraint; // Constraint ensuring that |containerView| is as wide as the superview of the // the IncognitoNTPView, i.e. the Incognito panel. - base::scoped_nsobject<NSLayoutConstraint> _containerHorizontalConstraint; + NSLayoutConstraint* _containerHorizontalConstraint; } - (instancetype)initWithFrame:(CGRect)frame urlLoader:(id<UrlLoader>)loader { self = [super initWithFrame:frame]; if (self) { - _loader.reset(loader); + _loader = loader; self.alwaysBounceVertical = YES; // Container in which all the subviews (image, labels, button) are added. - _containerView.reset([[UIView alloc] initWithFrame:frame]); + _containerView = [[UIView alloc] initWithFrame:frame]; [_containerView setTranslatesAutoresizingMaskIntoConstraints:NO]; // Incognito image. - base::scoped_nsobject<UIImageView> incognitoImage([[UIImageView alloc] - initWithImage:[UIImage imageNamed:@"incognito_icon"]]); + UIImageView* incognitoImage = [[UIImageView alloc] + initWithImage:[UIImage imageNamed:@"incognito_icon"]]; [incognitoImage setTranslatesAutoresizingMaskIntoConstraints:NO]; [_containerView addSubview:incognitoImage]; // Title. UIFont* titleFont = [[MDCTypography fontLoader] lightFontOfSize:24]; - base::scoped_nsobject<UILabel> incognitoTabHeading( - [[self labelWithString:l10n_util::GetNSString(IDS_NEW_TAB_OTR_HEADING) - font:titleFont - alpha:0.8] retain]); + UILabel* incognitoTabHeading = + [self labelWithString:l10n_util::GetNSString(IDS_NEW_TAB_OTR_HEADING) + font:titleFont + alpha:0.8]; [_containerView addSubview:incognitoTabHeading]; // Description paragraph. UIFont* regularFont = [[MDCTypography fontLoader] regularFontOfSize:14]; - base::scoped_nsobject<UILabel> incognitoTabDescription([[self + UILabel* incognitoTabDescription = [self labelWithString:l10n_util::GetNSString(IDS_NEW_TAB_OTR_DESCRIPTION) font:regularFont - alpha:0.7] retain]); + alpha:0.7]; [_containerView addSubview:incognitoTabDescription]; // Warning paragraph. - base::scoped_nsobject<UILabel> incognitoTabWarning([[self + UILabel* incognitoTabWarning = [self labelWithString:l10n_util::GetNSString(IDS_NEW_TAB_OTR_MESSAGE_WARNING) font:regularFont - alpha:0.7] retain]); + alpha:0.7]; [_containerView addSubview:incognitoTabWarning]; // Learn more button. - base::scoped_nsobject<MDCButton> learnMore([[MDCFlatButton alloc] init]); + MDCButton* learnMore = [[MDCFlatButton alloc] init]; UIColor* inkColor = [[[MDCPalette greyPalette] tint300] colorWithAlphaComponent:0.25]; [learnMore setInkColor:inkColor]; @@ -126,20 +129,19 @@ // |topGuide| and |bottomGuide| exist to vertically center the sibling views // located in between them. - base::scoped_nsobject<UILayoutGuide> topGuide([[UILayoutGuide alloc] init]); - base::scoped_nsobject<UILayoutGuide> bottomGuide( - [[UILayoutGuide alloc] init]); + UILayoutGuide* topGuide = [[UILayoutGuide alloc] init]; + UILayoutGuide* bottomGuide = [[UILayoutGuide alloc] init]; [_containerView addLayoutGuide:topGuide]; [_containerView addLayoutGuide:bottomGuide]; NSDictionary* viewsDictionary = @{ - @"topGuide" : topGuide.get(), - @"image" : incognitoImage.get(), - @"heading" : incognitoTabHeading.get(), - @"description" : incognitoTabDescription.get(), - @"warning" : incognitoTabWarning.get(), - @"learnMoreButton" : learnMore.get(), - @"bottomGuide" : bottomGuide.get(), + @"topGuide" : topGuide, + @"image" : incognitoImage, + @"heading" : incognitoTabHeading, + @"description" : incognitoTabDescription, + @"warning" : incognitoTabWarning, + @"learnMoreButton" : learnMore, + @"bottomGuide" : bottomGuide, }; NSArray* constraints = @[ @"V:|-0-[topGuide(>=12)]-[image]-24-[heading]-32-[description]", @@ -174,7 +176,7 @@ // Constraints comunicating the size of the contentView to the scrollview. // See UIScrollView autolayout information at // https://developer.apple.com/library/ios/releasenotes/General/RN-iOSSDK-6_0/index.html - viewsDictionary = @{ @"containerView" : _containerView.get() }; + viewsDictionary = @{@"containerView" : _containerView}; constraints = @[ @"V:|-0-[containerView]-0-|", @"H:|-0-[containerView]-0-|", @@ -188,23 +190,22 @@ - (UILabel*)labelWithString:(NSString*)string font:(UIFont*)font alpha:(float)alpha { - base::scoped_nsobject<NSMutableAttributedString> attributedString( - [[NSMutableAttributedString alloc] initWithString:string]); - base::scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( - [[NSMutableParagraphStyle alloc] init]); + NSMutableAttributedString* attributedString = + [[NSMutableAttributedString alloc] initWithString:string]; + NSMutableParagraphStyle* paragraphStyle = + [[NSMutableParagraphStyle alloc] init]; [paragraphStyle setLineSpacing:4]; [paragraphStyle setAlignment:NSTextAlignmentJustified]; [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, string.length)]; - base::scoped_nsobject<UILabel> label( - [[UILabel alloc] initWithFrame:CGRectZero]); + UILabel* label = [[UILabel alloc] initWithFrame:CGRectZero]; [label setTranslatesAutoresizingMaskIntoConstraints:NO]; [label setNumberOfLines:0]; [label setFont:font]; [label setAttributedText:attributedString]; [label setTextColor:[UIColor colorWithWhite:1.0 alpha:alpha]]; - return label.autorelease(); + return label; } - (void)learnMoreButtonPressed { @@ -219,31 +220,31 @@ - (void)didMoveToSuperview { [super didMoveToSuperview]; - _containerHorizontalConstraint.reset( - [[NSLayoutConstraint constraintWithItem:_containerView.get() - attribute:NSLayoutAttributeWidth - relatedBy:NSLayoutRelationEqual - toItem:[self superview] - attribute:NSLayoutAttributeWidth - multiplier:1 - constant:0] retain]); - _containerVerticalConstraint.reset( - [[NSLayoutConstraint constraintWithItem:_containerView.get() - attribute:NSLayoutAttributeHeight - relatedBy:NSLayoutRelationGreaterThanOrEqual - toItem:[self superview] - attribute:NSLayoutAttributeHeight - multiplier:1 - constant:0] retain]); - [[self superview] addConstraint:_containerHorizontalConstraint.get()]; - [[self superview] addConstraint:_containerVerticalConstraint.get()]; + _containerHorizontalConstraint = + [NSLayoutConstraint constraintWithItem:_containerView + attribute:NSLayoutAttributeWidth + relatedBy:NSLayoutRelationEqual + toItem:[self superview] + attribute:NSLayoutAttributeWidth + multiplier:1 + constant:0]; + _containerVerticalConstraint = + [NSLayoutConstraint constraintWithItem:_containerView + attribute:NSLayoutAttributeHeight + relatedBy:NSLayoutRelationGreaterThanOrEqual + toItem:[self superview] + attribute:NSLayoutAttributeHeight + multiplier:1 + constant:0]; + [[self superview] addConstraint:_containerHorizontalConstraint]; + [[self superview] addConstraint:_containerVerticalConstraint]; } - (void)willMoveToSuperview:(UIView*)newSuperview { - [[self superview] removeConstraint:_containerHorizontalConstraint.get()]; - [[self superview] removeConstraint:_containerVerticalConstraint.get()]; - _containerHorizontalConstraint.reset(); - _containerVerticalConstraint.reset(); + [[self superview] removeConstraint:_containerHorizontalConstraint]; + [[self superview] removeConstraint:_containerVerticalConstraint]; + _containerHorizontalConstraint = nil; + _containerVerticalConstraint = nil; [super willMoveToSuperview:newSuperview]; } @@ -257,33 +258,29 @@ @implementation IncognitoPanelController { // Delegate for updating the toolbar's background alpha. - base::WeakNSProtocol<id<WebToolbarDelegate>> _webToolbarDelegate; - - // The view containing the scrollview. - // The purpose of this view is to be used to set the size - // of the contentView of the scrollview with constraints. - base::scoped_nsobject<UIView> _view; + __weak id<WebToolbarDelegate> _webToolbarDelegate; // The scrollview containing the actual views. - base::scoped_nsobject<IncognitoNTPView> _incognitoView; + IncognitoNTPView* _incognitoView; } // Property declared in NewTabPagePanelProtocol. @synthesize delegate = _delegate; +@synthesize view = _view; - (id)initWithLoader:(id<UrlLoader>)loader browserState:(ios::ChromeBrowserState*)browserState webToolbarDelegate:(id<WebToolbarDelegate>)webToolbarDelegate { self = [super init]; if (self) { - _view.reset([[UIView alloc] - initWithFrame:[UIApplication sharedApplication].keyWindow.bounds]); + _view = [[UIView alloc] + initWithFrame:[UIApplication sharedApplication].keyWindow.bounds]; [_view setAccessibilityIdentifier:@"NTP Incognito Panel"]; [_view setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth]; - _incognitoView.reset([[IncognitoNTPView alloc] + _incognitoView = [[IncognitoNTPView alloc] initWithFrame:[UIApplication sharedApplication].keyWindow.bounds - urlLoader:loader]); + urlLoader:loader]; [_incognitoView setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth]; @@ -295,7 +292,7 @@ } if (!IsIPadIdiom()) { [_incognitoView setDelegate:self]; - _webToolbarDelegate.reset(webToolbarDelegate); + _webToolbarDelegate = webToolbarDelegate; [_webToolbarDelegate updateToolbarBackgroundAlpha:0]; } [_view addSubview:_incognitoView]; @@ -311,7 +308,7 @@ - (void)dealloc { [_webToolbarDelegate updateToolbarBackgroundAlpha:1]; [_incognitoView setDelegate:nil]; - [super dealloc]; + ; } #pragma mark - @@ -342,10 +339,6 @@ return 0; } -- (UIView*)view { - return _view.get(); -} - #pragma mark - #pragma mark UIScrollViewDelegate methods
diff --git a/ios/chrome/browser/ui/ntp/most_visited_cell.mm b/ios/chrome/browser/ui/ntp/most_visited_cell.mm index 3f2dabd4..7cb0f9b 100644 --- a/ios/chrome/browser/ui/ntp/most_visited_cell.mm +++ b/ios/chrome/browser/ui/ntp/most_visited_cell.mm
@@ -6,9 +6,7 @@ #include <memory> -#import "base/ios/weak_nsobject.h" #include "base/mac/bind_objc_block.h" -#import "base/mac/scoped_nsobject.h" #include "base/memory/ref_counted_memory.h" #include "base/strings/sys_string_conversions.h" #include "components/favicon/core/fallback_url_util.h" @@ -17,6 +15,10 @@ #import "ios/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + const CGFloat kFaviconSize = 48; const CGFloat kImageViewBackgroundColor = 0.941; const CGFloat kImageViewCornerRadius = 3; @@ -29,13 +31,13 @@ // Backs property with the same name. GURL _URL; // Weak reference to the relevant GoogleLandingDataSource. - base::WeakNSProtocol<id<GoogleLandingDataSource>> _dataSource; + __weak id<GoogleLandingDataSource> _dataSource; // Backs property with the same name. ntp_tiles::TileVisualType _tileType; - base::scoped_nsobject<UILabel> _label; - base::scoped_nsobject<UILabel> _noIconLabel; - base::scoped_nsobject<UIImageView> _imageView; + UILabel* _label; + UILabel* _noIconLabel; + UIImageView* _imageView; } // Set the background color and center the first letter of the site title (or // domain if the title is a url). @@ -56,7 +58,7 @@ if (!self) { return nil; } - _label.reset([[UILabel alloc] initWithFrame:CGRectZero]); + _label = [[UILabel alloc] initWithFrame:CGRectZero]; [_label setTextColor:[UIColor colorWithWhite:kLabelTextColor alpha:1.0]]; [_label setBackgroundColor:[UIColor clearColor]]; [_label setFont:[MDCTypography captionFont]]; @@ -65,12 +67,12 @@ [_label setPreferredMaxLayoutWidth:maxSize.width]; [_label setNumberOfLines:kLabelNumLines]; - _noIconLabel.reset([[UILabel alloc] initWithFrame:CGRectZero]); + _noIconLabel = [[UILabel alloc] initWithFrame:CGRectZero]; [_noIconLabel setBackgroundColor:[UIColor clearColor]]; [_noIconLabel setFont:[MDCTypography headlineFont]]; [_noIconLabel setTextAlignment:NSTextAlignmentCenter]; - _imageView.reset([[UIImageView alloc] initWithFrame:CGRectZero]); + _imageView = [[UIImageView alloc] initWithFrame:CGRectZero]; [_imageView layer].cornerRadius = kImageViewCornerRadius; [_imageView setClipsToBounds:YES]; [self addSubview:_imageView]; @@ -131,11 +133,11 @@ - (void)setupWithURL:(GURL)URL title:(NSString*)title dataSource:(id<GoogleLandingDataSource>)dataSource { - _dataSource.reset(dataSource); + _dataSource = dataSource; _tileType = ntp_tiles::TileVisualType::NONE; [self setText:title]; [self setURL:URL]; - base::WeakNSObject<MostVisitedCell> weakSelf(self); + __weak MostVisitedCell* weakSelf = self; void (^faviconImageBlock)(UIImage*) = ^(UIImage* favicon) {
diff --git a/ios/chrome/browser/ui/ntp/most_visited_layout.mm b/ios/chrome/browser/ui/ntp/most_visited_layout.mm index bd0cdfcf..e77de3c 100644 --- a/ios/chrome/browser/ui/ntp/most_visited_layout.mm +++ b/ios/chrome/browser/ui/ntp/most_visited_layout.mm
@@ -7,11 +7,15 @@ #import "ios/chrome/browser/ui/ntp/new_tab_page_header_constants.h" #include "ios/chrome/browser/ui/ui_util.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + @implementation MostVisitedLayout - (NSArray*)layoutAttributesForElementsInRect:(CGRect)rect { - NSMutableArray* layoutAttributes = [ - [[super layoutAttributesForElementsInRect:rect] mutableCopy] autorelease]; + NSMutableArray* layoutAttributes = + [[super layoutAttributesForElementsInRect:rect] mutableCopy]; UICollectionViewLayoutAttributes* fixedHeaderAttributes = nil; NSIndexPath* fixedHeaderIndexPath = [NSIndexPath indexPathForItem:0 inSection:0];
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_bar.h b/ios/chrome/browser/ui/ntp/new_tab_page_bar.h index e0e4fd4..1326231 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_bar.h +++ b/ios/chrome/browser/ui/ntp/new_tab_page_bar.h
@@ -23,11 +23,11 @@ // create a "speech bubble" effect. @interface NewTabPageBar : UIView<UIGestureRecognizerDelegate> -@property(nonatomic, retain) NSArray* items; +@property(nonatomic, strong) NSArray* items; @property(nonatomic, assign) NSUInteger selectedIndex; @property(nonatomic, assign) CGFloat overlayPercentage; -@property(nonatomic, readonly, retain) NSArray* buttons; -@property(nonatomic, assign) id<NewTabPageBarDelegate> delegate; +@property(nonatomic, readonly, strong) NSArray* buttons; +@property(nonatomic, weak) id<NewTabPageBarDelegate> delegate; // Changes the colors of the buttons and overlay depending on the content offset // of the scroll view. Tablet Incognito only.
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_bar.mm b/ios/chrome/browser/ui/ntp/new_tab_page_bar.mm index 760902a..e64cc7e4 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_bar.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_bar.mm
@@ -8,8 +8,7 @@ #include <cmath> #include "base/logging.h" -#include "base/mac/objc_property_releaser.h" -#include "base/mac/scoped_nsobject.h" + #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_bar_button.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_bar_item.h" @@ -19,6 +18,10 @@ #import "ui/gfx/ios/NSString+CrStringDrawing.h" #include "ui/gfx/scoped_ui_graphics_push_context_ios.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace { const CGFloat kBarHeight = 48.0f; @@ -32,11 +35,11 @@ } // anonymous namespace @interface NewTabPageBar () { - base::scoped_nsobject<UIImageView> shadow_; + UIImageView* shadow_; } -@property(nonatomic, readwrite, retain) NSArray* buttons; -@property(nonatomic, readwrite, retain) UIButton* popupButton; +@property(nonatomic, readwrite, strong) NSArray* buttons; +@property(nonatomic, readwrite, strong) UIButton* popupButton; - (void)setup; - (void)calculateButtonWidth; @@ -46,28 +49,21 @@ @end @implementation NewTabPageBar { - // Tabbar buttons. - NSArray* buttons_; // UIButton - NSArray* items_; // NewTabPageBarItem // Which button is currently selected. NSUInteger selectedIndex_; - // Popup button helper, for iPhone labels. - UIButton* popupButton_; // Don't allow tabbar animations on startup, only after first tap. BOOL canAnimate_; - id<NewTabPageBarDelegate> delegate_; // weak + __weak id<NewTabPageBarDelegate> delegate_; // Logo view, used to center the tab buttons. - base::scoped_nsobject<UIImageView> logoView_; + UIImageView* logoView_; // Overlay view, used to highlight the selected button. - base::scoped_nsobject<UIImageView> overlayView_; + UIImageView* overlayView_; // Overlay view, used to highlight the selected button. - base::scoped_nsobject<UIView> overlayColorView_; + UIView* overlayColorView_; // Width of a button. CGFloat buttonWidth_; // Percentage overlay sits over tab bar buttons. CGFloat overlayPercentage_; - - base::mac::ObjCPropertyReleaser propertyReleaser_NewTabPageBar_; } @synthesize items = items_; @@ -94,7 +90,6 @@ } - (void)setup { - propertyReleaser_NewTabPageBar_.Init(self, [NewTabPageBar class]); self.selectedIndex = NSNotFound; canAnimate_ = NO; self.autoresizingMask = @@ -103,13 +98,13 @@ self.backgroundColor = [UIColor clearColor]; if ([self showOverlay]) { - overlayView_.reset( - [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, buttonWidth_, 2)]); + overlayView_ = + [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, buttonWidth_, 2)]; // Center |overlayColorView_| inside |overlayView_|. CGFloat colorX = AlignValueToPixel((buttonWidth_ - kOverlayColorWidth) / 2); - overlayColorView_.reset([[UIView alloc] - initWithFrame:CGRectMake(colorX, 0, kOverlayColorWidth, 2)]); + overlayColorView_ = [[UIView alloc] + initWithFrame:CGRectMake(colorX, 0, kOverlayColorWidth, 2)]; [overlayColorView_ setBackgroundColor:UIColorFromRGB(kOverlayViewColor, 1.0)]; [overlayColorView_ layer].cornerRadius = 1.0; @@ -122,7 +117,7 @@ // Make the drop shadow. UIImage* shadowImage = [UIImage imageNamed:@"ntp_bottom_bar_shadow"]; - shadow_.reset([[UIImageView alloc] initWithImage:shadowImage]); + shadow_ = [[UIImageView alloc] initWithImage:shadowImage]; // Shadow is positioned directly above the new tab page bar. [shadow_ setFrame:CGRectMake(0, -shadowImage.size.height, self.bounds.size.width, @@ -140,7 +135,7 @@ // is enabled. [self calculateButtonWidth]; - CGFloat logoWidth = logoView_.get().image.size.width; + CGFloat logoWidth = logoView_.image.size.width; CGFloat padding = [self useIconsInButtons] ? logoWidth : 0; CGFloat buttonPadding = floor((CGRectGetWidth(self.bounds) - padding - buttonWidth_ * self.buttons.count) / @@ -193,8 +188,7 @@ if (newItems == items_) return; - [items_ autorelease]; - items_ = [newItems retain]; + items_ = newItems; // Remove all the existing buttons from the view. for (UIButton* button in self.buttons) { [button removeFromSuperview];
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_bar_button.mm b/ios/chrome/browser/ui/ntp/new_tab_page_bar_button.mm index 91580eee..73104bf 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_bar_button.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_bar_button.mm
@@ -5,11 +5,15 @@ #import "ios/chrome/browser/ui/ntp/new_tab_page_bar_button.h" #include "base/logging.h" -#include "base/mac/objc_property_releaser.h" + #import "ios/chrome/browser/ui/ntp/new_tab_page_bar_item.h" #import "ios/chrome/browser/ui/uikit_ui_util.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace { const int kButtonColor = 0x333333; @@ -17,26 +21,15 @@ } // anonymous namespace -@interface NewTabPageBarButton () { - UIColor* _color; - UIColor* _selectedColor; - UIColor* _incognitoColor; - UIColor* _incognitoSelectedColor; - UIColor* _interpolatedColor; - UIColor* _interpolatedSelectedColor; +@interface NewTabPageBarButton () - UIImage* _image; - NSString* _title; - base::mac::ObjCPropertyReleaser _propertyReleaser_NewTabPageBarButton; -} - -@property(nonatomic, retain) UIColor* color; -@property(nonatomic, retain) UIColor* selectedColor; -@property(nonatomic, retain) UIColor* incognitoColor; -@property(nonatomic, retain) UIColor* incognitoSelectedColor; -@property(nonatomic, retain) UIColor* interpolatedColor; -@property(nonatomic, retain) UIColor* interpolatedSelectedColor; -@property(nonatomic, retain) UIImage* image; +@property(nonatomic, strong) UIColor* color; +@property(nonatomic, strong) UIColor* selectedColor; +@property(nonatomic, strong) UIColor* incognitoColor; +@property(nonatomic, strong) UIColor* incognitoSelectedColor; +@property(nonatomic, strong) UIColor* interpolatedColor; +@property(nonatomic, strong) UIColor* interpolatedSelectedColor; +@property(nonatomic, strong) UIImage* image; @property(nonatomic, copy) NSString* title; // Sets the tint color of the button to |interpolatedColor| or @@ -62,8 +55,6 @@ DCHECK(item.image); NewTabPageBarButton* button = [[self class] buttonWithType:UIButtonTypeCustom]; - button->_propertyReleaser_NewTabPageBarButton.Init( - button, [NewTabPageBarButton class]); button.title = item.title; button.image =
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_bar_item.h b/ios/chrome/browser/ui/ntp/new_tab_page_bar_item.h index dd34914..0802e97 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_bar_item.h +++ b/ios/chrome/browser/ui/ntp/new_tab_page_bar_item.h
@@ -19,8 +19,8 @@ @property(nonatomic, copy) NSString* title; @property(nonatomic, assign) NSUInteger identifier; -@property(nonatomic, retain) UIImage* image; -@property(nonatomic, assign) UIView* view; +@property(nonatomic, strong) UIImage* image; +@property(nonatomic, weak) UIView* view; @end #endif // IOS_CHROME_BROWSER_UI_NTP_NEW_TAB_PAGE_BAR_ITEM_H_
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_bar_item.mm b/ios/chrome/browser/ui/ntp/new_tab_page_bar_item.mm index 915497f3..d61956e 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_bar_item.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_bar_item.mm
@@ -4,20 +4,11 @@ #import "ios/chrome/browser/ui/ntp/new_tab_page_bar_item.h" -#include "base/mac/objc_property_releaser.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif -@implementation NewTabPageBarItem { - // Title of the button. - NSString* title_; - // A numeric identifier. - NSUInteger identifier_; - // Tabbar image. - UIImage* image_; - // New tab page view. - __unsafe_unretained UIView* view_; // weak - base::mac::ObjCPropertyReleaser propertyReleaser_NewTabPageBarItem_; -} - +@implementation NewTabPageBarItem @synthesize title = title_; @synthesize identifier = identifier_; @synthesize image = image_; @@ -26,7 +17,7 @@ + (NewTabPageBarItem*)newTabPageBarItemWithTitle:(NSString*)title identifier:(NSUInteger)identifier image:(UIImage*)image { - NewTabPageBarItem* item = [[[NewTabPageBarItem alloc] init] autorelease]; + NewTabPageBarItem* item = [[NewTabPageBarItem alloc] init]; if (item) { item.title = title; item.identifier = identifier; @@ -35,12 +26,4 @@ return item; } -- (id)init { - self = [super init]; - if (self) { - propertyReleaser_NewTabPageBarItem_.Init(self, [NewTabPageBarItem class]); - } - return self; -} - @end
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_panel_protocol.mm b/ios/chrome/browser/ui/ntp/new_tab_page_panel_protocol.mm index 63d2a1b..006dcae 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_panel_protocol.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_panel_protocol.mm
@@ -4,5 +4,9 @@ #import "ios/chrome/browser/ui/ntp/new_tab_page_panel_protocol.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + const int kNewTabPageShadowHeight = 2; const int kNewTabPageDistanceToFadeShadow = 20;
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_view.mm b/ios/chrome/browser/ui/ntp/new_tab_page_view.mm index 5245ee5..7efc36a1 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_view.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_view.mm
@@ -5,21 +5,16 @@ #import "ios/chrome/browser/ui/ntp/new_tab_page_view.h" #include "base/logging.h" -#include "base/mac/objc_property_releaser.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_bar.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_bar_item.h" #import "ios/chrome/browser/ui/rtl_geometry.h" #include "ios/chrome/browser/ui/ui_util.h" -@implementation NewTabPageView { - @private - // The objects pointed to by |tabBar_| and |scrollView_| are owned as - // subviews already. - __unsafe_unretained NewTabPageBar* tabBar_; // weak - __unsafe_unretained UIScrollView* scrollView_; // weak +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif - base::mac::ObjCPropertyReleaser propertyReleaser_NewTabPageView_; -} +@implementation NewTabPageView @synthesize scrollView = scrollView_; @synthesize tabBar = tabBar_; @@ -29,7 +24,6 @@ andTabBar:(NewTabPageBar*)tabBar { self = [super initWithFrame:frame]; if (self) { - propertyReleaser_NewTabPageView_.Init(self, [NewTabPageView class]); [self addSubview:scrollView]; [self addSubview:tabBar]; scrollView_ = scrollView;
diff --git a/ios/chrome/browser/ui/ntp/notification_promo_whats_new.mm b/ios/chrome/browser/ui/ntp/notification_promo_whats_new.mm index 9e15d27..48f8a789 100644 --- a/ios/chrome/browser/ui/ntp/notification_promo_whats_new.mm +++ b/ios/chrome/browser/ui/ntp/notification_promo_whats_new.mm
@@ -26,6 +26,10 @@ #include "ios/chrome/grit/ios_strings.h" #include "ui/base/l10n/l10n_util.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace { struct PromoStringToIdsMapEntry {
diff --git a/ios/chrome/browser/ui/ntp/whats_new_header_view.h b/ios/chrome/browser/ui/ntp/whats_new_header_view.h index b87a138..715a928b 100644 --- a/ios/chrome/browser/ui/ntp/whats_new_header_view.h +++ b/ios/chrome/browser/ui/ntp/whats_new_header_view.h
@@ -18,7 +18,7 @@ @interface WhatsNewHeaderView : UICollectionReusableView -@property(nonatomic, assign) id<WhatsNewHeaderViewDelegate> delegate; +@property(nonatomic, weak) id<WhatsNewHeaderViewDelegate> delegate; // Sets the text for the attributed label. - (void)setText:(NSString*)text;
diff --git a/ios/chrome/browser/ui/ntp/whats_new_header_view.mm b/ios/chrome/browser/ui/ntp/whats_new_header_view.mm index 43c43f9..0314b32 100644 --- a/ios/chrome/browser/ui/ntp/whats_new_header_view.mm +++ b/ios/chrome/browser/ui/ntp/whats_new_header_view.mm
@@ -5,13 +5,16 @@ #import "ios/chrome/browser/ui/ntp/whats_new_header_view.h" #include "base/logging.h" -#include "base/mac/scoped_nsobject.h" #import "ios/chrome/browser/ui/uikit_ui_util.h" #include "ios/chrome/common/string_util.h" #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" #include "ios/public/provider/chrome/browser/images/branded_image_provider.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace { const CGFloat kLabelTopMargin = 16; @@ -28,11 +31,11 @@ } // namespace @interface WhatsNewHeaderView () { - base::scoped_nsobject<UIImageView> _infoIconImageView; - base::scoped_nsobject<UILabel> _promoLabel; - base::scoped_nsobject<NSLayoutConstraint> _edgeConstraint; - base::scoped_nsobject<UIView> _leftSpacer; - base::scoped_nsobject<UIView> _rightSpacer; + UIImageView* _infoIconImageView; + UILabel* _promoLabel; + NSLayoutConstraint* _edgeConstraint; + UIView* _leftSpacer; + UIView* _rightSpacer; CGFloat _sideMargin; } @@ -49,16 +52,15 @@ UIImage* infoIconImage = ios::GetChromeBrowserProvider() ->GetBrandedImageProvider() ->GetWhatsNewIconImage(WHATS_NEW_INFO); - _infoIconImageView.reset([[UIImageView alloc] initWithImage:infoIconImage]); - _promoLabel.reset([[[self class] promoLabel] retain]); + _infoIconImageView = [[UIImageView alloc] initWithImage:infoIconImage]; + _promoLabel = [[self class] promoLabel]; [_promoLabel setUserInteractionEnabled:YES]; - base::scoped_nsobject<UITapGestureRecognizer> promoTapRecognizer( - [[UITapGestureRecognizer alloc] - initWithTarget:self - action:@selector(promoButtonPressed)]); + UITapGestureRecognizer* promoTapRecognizer = [[UITapGestureRecognizer alloc] + initWithTarget:self + action:@selector(promoButtonPressed)]; [_promoLabel addGestureRecognizer:promoTapRecognizer]; - _leftSpacer.reset([[UIView alloc] initWithFrame:CGRectZero]); - _rightSpacer.reset([[UIView alloc] initWithFrame:CGRectZero]); + _leftSpacer = [[UIView alloc] initWithFrame:CGRectZero]; + _rightSpacer = [[UIView alloc] initWithFrame:CGRectZero]; [_leftSpacer setHidden:YES]; [_rightSpacer setHidden:YES]; @@ -105,14 +107,14 @@ ], views, metrics, self); - _edgeConstraint.reset([[NSLayoutConstraint + _edgeConstraint = [NSLayoutConstraint constraintWithItem:_leftSpacer attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationGreaterThanOrEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1 - constant:_sideMargin] retain]); + constant:_sideMargin]; [self addConstraint:_edgeConstraint]; } [_edgeConstraint setConstant:_sideMargin]; @@ -136,13 +138,13 @@ [self setNeedsUpdateConstraints]; CGFloat maxLabelWidth = width - 2 * sideMargin - kInfoIconSize - kLabelLeftMargin; - [_promoLabel.get() setPreferredMaxLayoutWidth:maxLabelWidth]; + [_promoLabel setPreferredMaxLayoutWidth:maxLabelWidth]; } - (void)promoButtonPressed { [_delegate onPromoLabelTapped]; [self removeConstraints:self.constraints]; - _edgeConstraint.reset(); + _edgeConstraint = nil; } + (void)setText:(NSString*)promoLabelText inPromoLabel:(UILabel*)promoLabel { @@ -153,8 +155,7 @@ DCHECK_NE(0u, linkRange.length); NSMutableAttributedString* attributedText = - [[[NSMutableAttributedString alloc] initWithString:strippedText] - autorelease]; + [[NSMutableAttributedString alloc] initWithString:strippedText]; // Sets the styling to mimic a link. UIColor* linkColor = UIColorFromRGB(kLinkColorRgb, 1.0); @@ -170,8 +171,7 @@ // Sets the line spacing on the attributed string. NSInteger strLength = [strippedText length]; - base::scoped_nsobject<NSMutableParagraphStyle> style( - [[NSMutableParagraphStyle alloc] init]); + NSMutableParagraphStyle* style = [[NSMutableParagraphStyle alloc] init]; [style setLineSpacing:kLabelLineSpacing]; [attributedText addAttribute:NSParagraphStyleAttributeName value:style @@ -181,21 +181,20 @@ } + (UILabel*)promoLabel { - base::scoped_nsobject<UILabel> promoLabel( - [[UILabel alloc] initWithFrame:CGRectZero]); + UILabel* promoLabel = [[UILabel alloc] initWithFrame:CGRectZero]; [promoLabel setFont:[[MDCTypography fontLoader] regularFontOfSize:kLabelFontSize]]; [promoLabel setTextColor:UIColorFromRGB(kTextColorRgb, 1.0)]; [promoLabel setNumberOfLines:0]; [promoLabel setTextAlignment:NSTextAlignmentNatural]; [promoLabel setLineBreakMode:NSLineBreakByWordWrapping]; - return promoLabel.autorelease(); + return promoLabel; } + (int)heightToFitText:(NSString*)text inWidth:(CGFloat)width { CGFloat maxWidthForLabel = width - kInfoIconSize - kLabelLeftMargin; - base::scoped_nsobject<UILabel> promoLabel([[self promoLabel] retain]); - [[self class] setText:text inPromoLabel:promoLabel.get()]; + UILabel* promoLabel = [self promoLabel]; + [[self class] setText:text inPromoLabel:promoLabel]; CGFloat promoLabelHeight = [promoLabel sizeThatFits:CGSizeMake(maxWidthForLabel, CGFLOAT_MAX)] .height;
diff --git a/ios/chrome/browser/ui/omnibox/BUILD.gn b/ios/chrome/browser/ui/omnibox/BUILD.gn index a12dd7a8..93c9dae 100644 --- a/ios/chrome/browser/ui/omnibox/BUILD.gn +++ b/ios/chrome/browser/ui/omnibox/BUILD.gn
@@ -43,6 +43,7 @@ "omnibox_popup_positioner.h", "omnibox_popup_view_ios.h", "omnibox_popup_view_ios.mm", + "omnibox_text_field_delegate.h", "omnibox_text_field_ios.h", "omnibox_text_field_ios.mm", "omnibox_view_ios.h",
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_text_field_delegate.h b/ios/chrome/browser/ui/omnibox/omnibox_text_field_delegate.h new file mode 100644 index 0000000..ba7d4c6 --- /dev/null +++ b/ios/chrome/browser/ui/omnibox/omnibox_text_field_delegate.h
@@ -0,0 +1,26 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_TEXT_FIELD_DELEGATE_H_ +#define IOS_CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_TEXT_FIELD_DELEGATE_H_ + +#import <UIKit/UIKit.h> + +@protocol OmniboxTextFieldDelegate<UITextFieldDelegate> + +@optional +// Called when the OmniboxTextField performs a copy operation. Returns YES if +// the delegate handled the copy operation itself. If the delegate returns NO, +// the field must perform the copy. Some platforms (iOS 4) do not expose an API +// that allows the delegate to handle the copy. +- (BOOL)onCopy; + +// Called before the OmniboxTextField performs a paste operation. +- (void)willPaste; + +// Called when the backspace button is tapped in the OmniboxTextField. +- (void)onDeleteBackward; +@end + +#endif // IOS_CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_TEXT_FIELD_DELEGATE_H_
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.h b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.h index 564c329e..11bd2c0 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.h +++ b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.h
@@ -9,22 +9,7 @@ #include "base/mac/scoped_nsobject.h" #include "base/strings/string16.h" - -@protocol OmniboxTextFieldDelegate<UITextFieldDelegate> - -@optional -// Called when the OmniboxTextField performs a copy operation. Returns YES if -// the delegate handled the copy operation itself. If the delegate returns NO, -// the field must perform the copy. Some platforms (iOS 4) do not expose an API -// that allows the delegate to handle the copy. -- (BOOL)onCopy; - -// Called before the OmniboxTextField performs a paste operation. -- (void)willPaste; - -// Called when the backspace button is tapped in the OmniboxTextField. -- (void)onDeleteBackward; -@end +#import "ios/chrome/browser/ui/omnibox/omnibox_text_field_delegate.h" // Enum type specifying the direction of fade animations. typedef enum {
diff --git a/ios/chrome/browser/ui/payments/credit_card_edit_mediator.mm b/ios/chrome/browser/ui/payments/credit_card_edit_mediator.mm index 65b5496..b03947d 100644 --- a/ios/chrome/browser/ui/payments/credit_card_edit_mediator.mm +++ b/ios/chrome/browser/ui/payments/credit_card_edit_mediator.mm
@@ -11,6 +11,7 @@ #include "components/autofill/core/browser/personal_data_manager.h" #import "components/autofill/ios/browser/credit_card_util.h" #include "components/payments/core/payment_request_data_util.h" +#include "components/payments/core/strings_util.h" #include "components/strings/grit/components_strings.h" #include "ios/chrome/browser/application_context.h" #include "ios/chrome/browser/payments/payment_request.h" @@ -136,7 +137,8 @@ AcceptedPaymentMethodsItem* acceptedMethodsItem = [[AcceptedPaymentMethodsItem alloc] init]; acceptedMethodsItem.message = - l10n_util::GetNSString(IDS_PAYMENTS_ACCEPTED_CARDS_LABEL); + base::SysUTF16ToNSString(payments::GetAcceptedCardTypesText( + _paymentRequest->supported_card_types_set())); acceptedMethodsItem.methodTypeIcons = issuerNetworkIcons; return acceptedMethodsItem; }
diff --git a/ios/chrome/browser/ui/payments/payment_method_selection_mediator.mm b/ios/chrome/browser/ui/payments/payment_method_selection_mediator.mm index 064fc62..4513447e 100644 --- a/ios/chrome/browser/ui/payments/payment_method_selection_mediator.mm +++ b/ios/chrome/browser/ui/payments/payment_method_selection_mediator.mm
@@ -6,11 +6,13 @@ #import "ios/chrome/browser/ui/payments/payment_method_selection_mediator.h" +#include "base/strings/string16.h" #include "base/strings/sys_string_conversions.h" #include "components/autofill/core/browser/autofill_data_util.h" #include "components/autofill/core/browser/autofill_profile.h" #include "components/autofill/core/browser/credit_card.h" #include "components/autofill/core/browser/personal_data_manager.h" +#include "components/payments/core/strings_util.h" #include "components/strings/grit/components_strings.h" #include "ios/chrome/browser/payments/payment_request.h" #include "ios/chrome/browser/payments/payment_request_util.h" @@ -64,7 +66,14 @@ } - (CollectionViewItem*)headerItem { - return nil; + base::string16 headerText = payments::GetCardTypesAreAcceptedText( + _paymentRequest->supported_card_types_set()); + if (headerText.empty()) + return nil; + + PaymentsTextItem* headerItem = [[PaymentsTextItem alloc] init]; + headerItem.text = base::SysUTF16ToNSString(headerText); + return headerItem; } - (NSArray<CollectionViewItem*>*)selectableItems {
diff --git a/ios/chrome/browser/ui/qr_scanner/BUILD.gn b/ios/chrome/browser/ui/qr_scanner/BUILD.gn index 1578dec..eac9145 100644 --- a/ios/chrome/browser/ui/qr_scanner/BUILD.gn +++ b/ios/chrome/browser/ui/qr_scanner/BUILD.gn
@@ -2,22 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -bundle_data("assets") { - sources = [ - "resources/QRScanner.xcassets/Contents.json", - "resources/QRScanner.xcassets/qr_scanner_torch_off.imageset/Contents.json", - "resources/QRScanner.xcassets/qr_scanner_torch_off.imageset/torch_off.png", - "resources/QRScanner.xcassets/qr_scanner_torch_off.imageset/torch_off@2x.png", - "resources/QRScanner.xcassets/qr_scanner_torch_off.imageset/torch_off@3x.png", - "resources/QRScanner.xcassets/qr_scanner_torch_on.imageset/Contents.json", - "resources/QRScanner.xcassets/qr_scanner_torch_on.imageset/torch_on.png", - "resources/QRScanner.xcassets/qr_scanner_torch_on.imageset/torch_on@2x.png", - "resources/QRScanner.xcassets/qr_scanner_torch_on.imageset/torch_on@3x.png", - ] - outputs = [ - "{{bundle_resources_dir}}/{{source_file_part}}", - ] -} +import("//build/config/ios/imageset.gni") source_set("qr_scanner") { configs += [ "//build/config/compiler:enable_arc" ] @@ -34,7 +19,8 @@ "qr_scanner_view_controller.mm", ] deps = [ - ":assets", + ":qr_scanner_torch_off", + ":qr_scanner_torch_on", "//base", "//components/version_info", "//ios/chrome/app/strings", @@ -85,3 +71,21 @@ "UIKit.framework", ] } + +imageset("qr_scanner_torch_off") { + sources = [ + "resources/QRScanner.xcassets/qr_scanner_torch_off.imageset/Contents.json", + "resources/QRScanner.xcassets/qr_scanner_torch_off.imageset/torch_off.png", + "resources/QRScanner.xcassets/qr_scanner_torch_off.imageset/torch_off@2x.png", + "resources/QRScanner.xcassets/qr_scanner_torch_off.imageset/torch_off@3x.png", + ] +} + +imageset("qr_scanner_torch_on") { + sources = [ + "resources/QRScanner.xcassets/qr_scanner_torch_on.imageset/Contents.json", + "resources/QRScanner.xcassets/qr_scanner_torch_on.imageset/torch_on.png", + "resources/QRScanner.xcassets/qr_scanner_torch_on.imageset/torch_on@2x.png", + "resources/QRScanner.xcassets/qr_scanner_torch_on.imageset/torch_on@3x.png", + ] +}
diff --git a/ios/chrome/browser/ui/reading_list/BUILD.gn b/ios/chrome/browser/ui/reading_list/BUILD.gn index 7961440..102db83 100644 --- a/ios/chrome/browser/ui/reading_list/BUILD.gn +++ b/ios/chrome/browser/ui/reading_list/BUILD.gn
@@ -72,7 +72,12 @@ "text_badge_view.mm", ] deps = [ - ":resources", + "resources:distillation_fail", + "resources:distillation_success", + "resources:reading_list_empty_state", + "resources:reading_list_share_icon", + "resources:reading_list_side_swipe", + "resources:reading_list_toolbar_icon", "//base", "//components/strings", "//components/url_formatter", @@ -164,29 +169,3 @@ "XCTest.framework", ] } - -bundle_data("resources") { - sources = [ - "resources/distillation_fail.png", - "resources/distillation_fail@2x.png", - "resources/distillation_fail@3x.png", - "resources/distillation_success.png", - "resources/distillation_success@2x.png", - "resources/distillation_success@3x.png", - "resources/reading_list_empty_state.png", - "resources/reading_list_empty_state@2x.png", - "resources/reading_list_empty_state@3x.png", - "resources/reading_list_share_icon.png", - "resources/reading_list_share_icon@2x.png", - "resources/reading_list_share_icon@3x.png", - "resources/reading_list_side_swipe.png", - "resources/reading_list_side_swipe@2x.png", - "resources/reading_list_side_swipe@3x.png", - "resources/reading_list_toolbar_icon.png", - "resources/reading_list_toolbar_icon@2x.png", - "resources/reading_list_toolbar_icon@3x.png", - ] - outputs = [ - "{{bundle_resources_dir}}/{{source_file_part}}", - ] -}
diff --git a/ios/chrome/browser/ui/reading_list/resources/BUILD.gn b/ios/chrome/browser/ui/reading_list/resources/BUILD.gn new file mode 100644 index 0000000..b7b6243 --- /dev/null +++ b/ios/chrome/browser/ui/reading_list/resources/BUILD.gn
@@ -0,0 +1,59 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ios/imageset.gni") + +imageset("reading_list_share_icon") { + sources = [ + "reading_list_share_icon.imageset/Contents.json", + "reading_list_share_icon.imageset/reading_list_share_icon.png", + "reading_list_share_icon.imageset/reading_list_share_icon@2x.png", + "reading_list_share_icon.imageset/reading_list_share_icon@3x.png", + ] +} + +imageset("reading_list_toolbar_icon") { + sources = [ + "reading_list_toolbar_icon.imageset/Contents.json", + "reading_list_toolbar_icon.imageset/reading_list_toolbar_icon.png", + "reading_list_toolbar_icon.imageset/reading_list_toolbar_icon@2x.png", + "reading_list_toolbar_icon.imageset/reading_list_toolbar_icon@3x.png", + ] +} + +imageset("distillation_fail") { + sources = [ + "distillation_fail.imageset/Contents.json", + "distillation_fail.imageset/distillation_fail.png", + "distillation_fail.imageset/distillation_fail@2x.png", + "distillation_fail.imageset/distillation_fail@3x.png", + ] +} + +imageset("reading_list_side_swipe") { + sources = [ + "reading_list_side_swipe.imageset/Contents.json", + "reading_list_side_swipe.imageset/reading_list_side_swipe.png", + "reading_list_side_swipe.imageset/reading_list_side_swipe@2x.png", + "reading_list_side_swipe.imageset/reading_list_side_swipe@3x.png", + ] +} + +imageset("reading_list_empty_state") { + sources = [ + "reading_list_empty_state.imageset/Contents.json", + "reading_list_empty_state.imageset/reading_list_empty_state.png", + "reading_list_empty_state.imageset/reading_list_empty_state@2x.png", + "reading_list_empty_state.imageset/reading_list_empty_state@3x.png", + ] +} + +imageset("distillation_success") { + sources = [ + "distillation_success.imageset/Contents.json", + "distillation_success.imageset/distillation_success.png", + "distillation_success.imageset/distillation_success@2x.png", + "distillation_success.imageset/distillation_success@3x.png", + ] +}
diff --git a/ios/chrome/browser/ui/reading_list/resources/distillation_fail.imageset/Contents.json b/ios/chrome/browser/ui/reading_list/resources/distillation_fail.imageset/Contents.json new file mode 100644 index 0000000..03a4054f --- /dev/null +++ b/ios/chrome/browser/ui/reading_list/resources/distillation_fail.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "distillation_fail.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "distillation_fail@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "distillation_fail@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/reading_list/resources/distillation_fail.png b/ios/chrome/browser/ui/reading_list/resources/distillation_fail.imageset/distillation_fail.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/distillation_fail.png rename to ios/chrome/browser/ui/reading_list/resources/distillation_fail.imageset/distillation_fail.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/distillation_fail@2x.png b/ios/chrome/browser/ui/reading_list/resources/distillation_fail.imageset/distillation_fail@2x.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/distillation_fail@2x.png rename to ios/chrome/browser/ui/reading_list/resources/distillation_fail.imageset/distillation_fail@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/distillation_fail@3x.png b/ios/chrome/browser/ui/reading_list/resources/distillation_fail.imageset/distillation_fail@3x.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/distillation_fail@3x.png rename to ios/chrome/browser/ui/reading_list/resources/distillation_fail.imageset/distillation_fail@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/distillation_success.imageset/Contents.json b/ios/chrome/browser/ui/reading_list/resources/distillation_success.imageset/Contents.json new file mode 100644 index 0000000..e608ccb --- /dev/null +++ b/ios/chrome/browser/ui/reading_list/resources/distillation_success.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "distillation_success.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "distillation_success@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "distillation_success@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/reading_list/resources/distillation_success.png b/ios/chrome/browser/ui/reading_list/resources/distillation_success.imageset/distillation_success.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/distillation_success.png rename to ios/chrome/browser/ui/reading_list/resources/distillation_success.imageset/distillation_success.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/distillation_success@2x.png b/ios/chrome/browser/ui/reading_list/resources/distillation_success.imageset/distillation_success@2x.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/distillation_success@2x.png rename to ios/chrome/browser/ui/reading_list/resources/distillation_success.imageset/distillation_success@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/distillation_success@3x.png b/ios/chrome/browser/ui/reading_list/resources/distillation_success.imageset/distillation_success@3x.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/distillation_success@3x.png rename to ios/chrome/browser/ui/reading_list/resources/distillation_success.imageset/distillation_success@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_empty_state.imageset/Contents.json b/ios/chrome/browser/ui/reading_list/resources/reading_list_empty_state.imageset/Contents.json new file mode 100644 index 0000000..1a977ad --- /dev/null +++ b/ios/chrome/browser/ui/reading_list/resources/reading_list_empty_state.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "reading_list_empty_state.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "reading_list_empty_state@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "reading_list_empty_state@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_empty_state.png b/ios/chrome/browser/ui/reading_list/resources/reading_list_empty_state.imageset/reading_list_empty_state.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/reading_list_empty_state.png rename to ios/chrome/browser/ui/reading_list/resources/reading_list_empty_state.imageset/reading_list_empty_state.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_empty_state@2x.png b/ios/chrome/browser/ui/reading_list/resources/reading_list_empty_state.imageset/reading_list_empty_state@2x.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/reading_list_empty_state@2x.png rename to ios/chrome/browser/ui/reading_list/resources/reading_list_empty_state.imageset/reading_list_empty_state@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_empty_state@3x.png b/ios/chrome/browser/ui/reading_list/resources/reading_list_empty_state.imageset/reading_list_empty_state@3x.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/reading_list_empty_state@3x.png rename to ios/chrome/browser/ui/reading_list/resources/reading_list_empty_state.imageset/reading_list_empty_state@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_icon.png b/ios/chrome/browser/ui/reading_list/resources/reading_list_icon.png deleted file mode 100644 index 35a5c31..0000000 --- a/ios/chrome/browser/ui/reading_list/resources/reading_list_icon.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_icon@2x.png b/ios/chrome/browser/ui/reading_list/resources/reading_list_icon@2x.png deleted file mode 100644 index 80c98e3..0000000 --- a/ios/chrome/browser/ui/reading_list/resources/reading_list_icon@2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_icon@3x.png b/ios/chrome/browser/ui/reading_list/resources/reading_list_icon@3x.png deleted file mode 100644 index 9f23218..0000000 --- a/ios/chrome/browser/ui/reading_list/resources/reading_list_icon@3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_share_icon.imageset/Contents.json b/ios/chrome/browser/ui/reading_list/resources/reading_list_share_icon.imageset/Contents.json new file mode 100644 index 0000000..259992d --- /dev/null +++ b/ios/chrome/browser/ui/reading_list/resources/reading_list_share_icon.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "reading_list_share_icon.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "reading_list_share_icon@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "reading_list_share_icon@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_share_icon.png b/ios/chrome/browser/ui/reading_list/resources/reading_list_share_icon.imageset/reading_list_share_icon.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/reading_list_share_icon.png rename to ios/chrome/browser/ui/reading_list/resources/reading_list_share_icon.imageset/reading_list_share_icon.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_share_icon@2x.png b/ios/chrome/browser/ui/reading_list/resources/reading_list_share_icon.imageset/reading_list_share_icon@2x.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/reading_list_share_icon@2x.png rename to ios/chrome/browser/ui/reading_list/resources/reading_list_share_icon.imageset/reading_list_share_icon@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_share_icon@3x.png b/ios/chrome/browser/ui/reading_list/resources/reading_list_share_icon.imageset/reading_list_share_icon@3x.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/reading_list_share_icon@3x.png rename to ios/chrome/browser/ui/reading_list/resources/reading_list_share_icon.imageset/reading_list_share_icon@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_side_swipe.imageset/Contents.json b/ios/chrome/browser/ui/reading_list/resources/reading_list_side_swipe.imageset/Contents.json new file mode 100644 index 0000000..e4d2212 --- /dev/null +++ b/ios/chrome/browser/ui/reading_list/resources/reading_list_side_swipe.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "reading_list_side_swipe.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "reading_list_side_swipe@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "reading_list_side_swipe@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_side_swipe.png b/ios/chrome/browser/ui/reading_list/resources/reading_list_side_swipe.imageset/reading_list_side_swipe.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/reading_list_side_swipe.png rename to ios/chrome/browser/ui/reading_list/resources/reading_list_side_swipe.imageset/reading_list_side_swipe.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_side_swipe@2x.png b/ios/chrome/browser/ui/reading_list/resources/reading_list_side_swipe.imageset/reading_list_side_swipe@2x.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/reading_list_side_swipe@2x.png rename to ios/chrome/browser/ui/reading_list/resources/reading_list_side_swipe.imageset/reading_list_side_swipe@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_side_swipe@3x.png b/ios/chrome/browser/ui/reading_list/resources/reading_list_side_swipe.imageset/reading_list_side_swipe@3x.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/reading_list_side_swipe@3x.png rename to ios/chrome/browser/ui/reading_list/resources/reading_list_side_swipe.imageset/reading_list_side_swipe@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_toolbar_icon.imageset/Contents.json b/ios/chrome/browser/ui/reading_list/resources/reading_list_toolbar_icon.imageset/Contents.json new file mode 100644 index 0000000..f1f5ab81 --- /dev/null +++ b/ios/chrome/browser/ui/reading_list/resources/reading_list_toolbar_icon.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "reading_list_toolbar_icon.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "reading_list_toolbar_icon@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "reading_list_toolbar_icon@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_toolbar_icon.png b/ios/chrome/browser/ui/reading_list/resources/reading_list_toolbar_icon.imageset/reading_list_toolbar_icon.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/reading_list_toolbar_icon.png rename to ios/chrome/browser/ui/reading_list/resources/reading_list_toolbar_icon.imageset/reading_list_toolbar_icon.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_toolbar_icon@2x.png b/ios/chrome/browser/ui/reading_list/resources/reading_list_toolbar_icon.imageset/reading_list_toolbar_icon@2x.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/reading_list_toolbar_icon@2x.png rename to ios/chrome/browser/ui/reading_list/resources/reading_list_toolbar_icon.imageset/reading_list_toolbar_icon@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/reading_list/resources/reading_list_toolbar_icon@3x.png b/ios/chrome/browser/ui/reading_list/resources/reading_list_toolbar_icon.imageset/reading_list_toolbar_icon@3x.png similarity index 100% rename from ios/chrome/browser/ui/reading_list/resources/reading_list_toolbar_icon@3x.png rename to ios/chrome/browser/ui/reading_list/resources/reading_list_toolbar_icon.imageset/reading_list_toolbar_icon@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/BUILD.gn b/ios/chrome/browser/ui/resources/BUILD.gn new file mode 100644 index 0000000..8a05c99d --- /dev/null +++ b/ios/chrome/browser/ui/resources/BUILD.gn
@@ -0,0 +1,63 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ios/imageset.gni") + +imageset("custom_row_voice_pressed") { + sources = [ + "custom_row_voice_pressed.imageset/Contents.json", + "custom_row_voice_pressed.imageset/custom_row_voice_pressed.png", + "custom_row_voice_pressed.imageset/custom_row_voice_pressed@2x.png", + "custom_row_voice_pressed.imageset/custom_row_voice_pressed@2x~ipad.png", + "custom_row_voice_pressed.imageset/custom_row_voice_pressed@3x.png", + "custom_row_voice_pressed.imageset/custom_row_voice_pressed~ipad.png", + ] +} + +imageset("keyboard_bg_portrait_tablet") { + sources = [ + "keyboard_bg_portrait_tablet.imageset/Contents.json", + "keyboard_bg_portrait_tablet.imageset/keyboard_bg_portrait_tablet.png", + ] +} + +imageset("default_favicon") { + sources = [ + "default_favicon.imageset/Contents.json", + "default_favicon.imageset/default_favicon.png", + "default_favicon.imageset/default_favicon@2x.png", + "default_favicon.imageset/default_favicon@3x.png", + ] +} + +imageset("default_favicon_incognito") { + sources = [ + "default_favicon_incognito.imageset/Contents.json", + "default_favicon_incognito.imageset/default_favicon_incognito.png", + "default_favicon_incognito.imageset/default_favicon_incognito@2x.png", + "default_favicon_incognito.imageset/default_favicon_incognito@3x.png", + ] +} + +imageset("custom_row_voice") { + sources = [ + "custom_row_voice.imageset/Contents.json", + "custom_row_voice.imageset/custom_row_voice.png", + "custom_row_voice.imageset/custom_row_voice@2x.png", + "custom_row_voice.imageset/custom_row_voice@2x~ipad.png", + "custom_row_voice.imageset/custom_row_voice@3x.png", + "custom_row_voice.imageset/custom_row_voice~ipad.png", + ] +} + +imageset("keyboard_button") { + sources = [ + "keyboard_button.imageset/Contents.json", + "keyboard_button.imageset/keyboard_button.png", + "keyboard_button.imageset/keyboard_button@2x.png", + "keyboard_button.imageset/keyboard_button@2x~ipad.png", + "keyboard_button.imageset/keyboard_button@3x.png", + "keyboard_button.imageset/keyboard_button~ipad.png", + ] +}
diff --git a/ios/chrome/browser/ui/resources/custom_row_voice.imageset/Contents.json b/ios/chrome/browser/ui/resources/custom_row_voice.imageset/Contents.json new file mode 100644 index 0000000..213b480 --- /dev/null +++ b/ios/chrome/browser/ui/resources/custom_row_voice.imageset/Contents.json
@@ -0,0 +1,33 @@ +{ + "images": [ + { + "idiom": "iphone", + "scale": "1x", + "filename": "custom_row_voice.png" + }, + { + "idiom": "iphone", + "scale": "2x", + "filename": "custom_row_voice@2x.png" + }, + { + "idiom": "ipad", + "scale": "2x", + "filename": "custom_row_voice@2x~ipad.png" + }, + { + "idiom": "iphone", + "scale": "3x", + "filename": "custom_row_voice@3x.png" + }, + { + "idiom": "ipad", + "scale": "1x", + "filename": "custom_row_voice~ipad.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/resources/custom_row_voice.png b/ios/chrome/browser/ui/resources/custom_row_voice.imageset/custom_row_voice.png similarity index 100% rename from ios/chrome/browser/ui/resources/custom_row_voice.png rename to ios/chrome/browser/ui/resources/custom_row_voice.imageset/custom_row_voice.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/custom_row_voice@2x.png b/ios/chrome/browser/ui/resources/custom_row_voice.imageset/custom_row_voice@2x.png similarity index 100% rename from ios/chrome/browser/ui/resources/custom_row_voice@2x.png rename to ios/chrome/browser/ui/resources/custom_row_voice.imageset/custom_row_voice@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/custom_row_voice@2x~ipad.png b/ios/chrome/browser/ui/resources/custom_row_voice.imageset/custom_row_voice@2x~ipad.png similarity index 100% rename from ios/chrome/browser/ui/resources/custom_row_voice@2x~ipad.png rename to ios/chrome/browser/ui/resources/custom_row_voice.imageset/custom_row_voice@2x~ipad.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/custom_row_voice@3x.png b/ios/chrome/browser/ui/resources/custom_row_voice.imageset/custom_row_voice@3x.png similarity index 100% rename from ios/chrome/browser/ui/resources/custom_row_voice@3x.png rename to ios/chrome/browser/ui/resources/custom_row_voice.imageset/custom_row_voice@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/custom_row_voice~ipad.png b/ios/chrome/browser/ui/resources/custom_row_voice.imageset/custom_row_voice~ipad.png similarity index 100% rename from ios/chrome/browser/ui/resources/custom_row_voice~ipad.png rename to ios/chrome/browser/ui/resources/custom_row_voice.imageset/custom_row_voice~ipad.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/custom_row_voice_pressed.imageset/Contents.json b/ios/chrome/browser/ui/resources/custom_row_voice_pressed.imageset/Contents.json new file mode 100644 index 0000000..d468801 --- /dev/null +++ b/ios/chrome/browser/ui/resources/custom_row_voice_pressed.imageset/Contents.json
@@ -0,0 +1,33 @@ +{ + "images": [ + { + "idiom": "iphone", + "scale": "1x", + "filename": "custom_row_voice_pressed.png" + }, + { + "idiom": "iphone", + "scale": "2x", + "filename": "custom_row_voice_pressed@2x.png" + }, + { + "idiom": "ipad", + "scale": "2x", + "filename": "custom_row_voice_pressed@2x~ipad.png" + }, + { + "idiom": "iphone", + "scale": "3x", + "filename": "custom_row_voice_pressed@3x.png" + }, + { + "idiom": "ipad", + "scale": "1x", + "filename": "custom_row_voice_pressed~ipad.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/resources/custom_row_voice_pressed.png b/ios/chrome/browser/ui/resources/custom_row_voice_pressed.imageset/custom_row_voice_pressed.png similarity index 100% rename from ios/chrome/browser/ui/resources/custom_row_voice_pressed.png rename to ios/chrome/browser/ui/resources/custom_row_voice_pressed.imageset/custom_row_voice_pressed.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/custom_row_voice_pressed@2x.png b/ios/chrome/browser/ui/resources/custom_row_voice_pressed.imageset/custom_row_voice_pressed@2x.png similarity index 100% rename from ios/chrome/browser/ui/resources/custom_row_voice_pressed@2x.png rename to ios/chrome/browser/ui/resources/custom_row_voice_pressed.imageset/custom_row_voice_pressed@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/custom_row_voice_pressed@2x~ipad.png b/ios/chrome/browser/ui/resources/custom_row_voice_pressed.imageset/custom_row_voice_pressed@2x~ipad.png similarity index 100% rename from ios/chrome/browser/ui/resources/custom_row_voice_pressed@2x~ipad.png rename to ios/chrome/browser/ui/resources/custom_row_voice_pressed.imageset/custom_row_voice_pressed@2x~ipad.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/custom_row_voice_pressed@3x.png b/ios/chrome/browser/ui/resources/custom_row_voice_pressed.imageset/custom_row_voice_pressed@3x.png similarity index 100% rename from ios/chrome/browser/ui/resources/custom_row_voice_pressed@3x.png rename to ios/chrome/browser/ui/resources/custom_row_voice_pressed.imageset/custom_row_voice_pressed@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/custom_row_voice_pressed~ipad.png b/ios/chrome/browser/ui/resources/custom_row_voice_pressed.imageset/custom_row_voice_pressed~ipad.png similarity index 100% rename from ios/chrome/browser/ui/resources/custom_row_voice_pressed~ipad.png rename to ios/chrome/browser/ui/resources/custom_row_voice_pressed.imageset/custom_row_voice_pressed~ipad.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/default_favicon.imageset/Contents.json b/ios/chrome/browser/ui/resources/default_favicon.imageset/Contents.json new file mode 100644 index 0000000..13ff41e --- /dev/null +++ b/ios/chrome/browser/ui/resources/default_favicon.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "default_favicon.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "default_favicon@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "default_favicon@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/resources/default_favicon.png b/ios/chrome/browser/ui/resources/default_favicon.imageset/default_favicon.png similarity index 100% rename from ios/chrome/browser/ui/resources/default_favicon.png rename to ios/chrome/browser/ui/resources/default_favicon.imageset/default_favicon.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/default_favicon@2x.png b/ios/chrome/browser/ui/resources/default_favicon.imageset/default_favicon@2x.png similarity index 100% rename from ios/chrome/browser/ui/resources/default_favicon@2x.png rename to ios/chrome/browser/ui/resources/default_favicon.imageset/default_favicon@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/default_favicon@3x.png b/ios/chrome/browser/ui/resources/default_favicon.imageset/default_favicon@3x.png similarity index 100% rename from ios/chrome/browser/ui/resources/default_favicon@3x.png rename to ios/chrome/browser/ui/resources/default_favicon.imageset/default_favicon@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/default_favicon_incognito.imageset/Contents.json b/ios/chrome/browser/ui/resources/default_favicon_incognito.imageset/Contents.json new file mode 100644 index 0000000..d76f15b5 --- /dev/null +++ b/ios/chrome/browser/ui/resources/default_favicon_incognito.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "default_favicon_incognito.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "default_favicon_incognito@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "default_favicon_incognito@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/resources/default_favicon_incognito.png b/ios/chrome/browser/ui/resources/default_favicon_incognito.imageset/default_favicon_incognito.png similarity index 100% rename from ios/chrome/browser/ui/resources/default_favicon_incognito.png rename to ios/chrome/browser/ui/resources/default_favicon_incognito.imageset/default_favicon_incognito.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/default_favicon_incognito@2x.png b/ios/chrome/browser/ui/resources/default_favicon_incognito.imageset/default_favicon_incognito@2x.png similarity index 100% rename from ios/chrome/browser/ui/resources/default_favicon_incognito@2x.png rename to ios/chrome/browser/ui/resources/default_favicon_incognito.imageset/default_favicon_incognito@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/default_favicon_incognito@3x.png b/ios/chrome/browser/ui/resources/default_favicon_incognito.imageset/default_favicon_incognito@3x.png similarity index 100% rename from ios/chrome/browser/ui/resources/default_favicon_incognito@3x.png rename to ios/chrome/browser/ui/resources/default_favicon_incognito.imageset/default_favicon_incognito@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/keyboard_bg_portrait_tablet.imageset/Contents.json b/ios/chrome/browser/ui/resources/keyboard_bg_portrait_tablet.imageset/Contents.json new file mode 100644 index 0000000..b8fc34f --- /dev/null +++ b/ios/chrome/browser/ui/resources/keyboard_bg_portrait_tablet.imageset/Contents.json
@@ -0,0 +1,13 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "keyboard_bg_portrait_tablet.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/resources/keyboard_bg_portrait_tablet.png b/ios/chrome/browser/ui/resources/keyboard_bg_portrait_tablet.imageset/keyboard_bg_portrait_tablet.png similarity index 100% rename from ios/chrome/browser/ui/resources/keyboard_bg_portrait_tablet.png rename to ios/chrome/browser/ui/resources/keyboard_bg_portrait_tablet.imageset/keyboard_bg_portrait_tablet.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/keyboard_button.imageset/Contents.json b/ios/chrome/browser/ui/resources/keyboard_button.imageset/Contents.json new file mode 100644 index 0000000..03e1619 --- /dev/null +++ b/ios/chrome/browser/ui/resources/keyboard_button.imageset/Contents.json
@@ -0,0 +1,33 @@ +{ + "images": [ + { + "idiom": "iphone", + "scale": "1x", + "filename": "keyboard_button.png" + }, + { + "idiom": "iphone", + "scale": "2x", + "filename": "keyboard_button@2x.png" + }, + { + "idiom": "ipad", + "scale": "2x", + "filename": "keyboard_button@2x~ipad.png" + }, + { + "idiom": "iphone", + "scale": "3x", + "filename": "keyboard_button@3x.png" + }, + { + "idiom": "ipad", + "scale": "1x", + "filename": "keyboard_button~ipad.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/resources/keyboard_button.png b/ios/chrome/browser/ui/resources/keyboard_button.imageset/keyboard_button.png similarity index 100% rename from ios/chrome/browser/ui/resources/keyboard_button.png rename to ios/chrome/browser/ui/resources/keyboard_button.imageset/keyboard_button.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/keyboard_button@2x.png b/ios/chrome/browser/ui/resources/keyboard_button.imageset/keyboard_button@2x.png similarity index 100% rename from ios/chrome/browser/ui/resources/keyboard_button@2x.png rename to ios/chrome/browser/ui/resources/keyboard_button.imageset/keyboard_button@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/keyboard_button@2x~ipad.png b/ios/chrome/browser/ui/resources/keyboard_button.imageset/keyboard_button@2x~ipad.png similarity index 100% rename from ios/chrome/browser/ui/resources/keyboard_button@2x~ipad.png rename to ios/chrome/browser/ui/resources/keyboard_button.imageset/keyboard_button@2x~ipad.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/keyboard_button@3x.png b/ios/chrome/browser/ui/resources/keyboard_button.imageset/keyboard_button@3x.png similarity index 100% rename from ios/chrome/browser/ui/resources/keyboard_button@3x.png rename to ios/chrome/browser/ui/resources/keyboard_button.imageset/keyboard_button@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/resources/keyboard_button~ipad.png b/ios/chrome/browser/ui/resources/keyboard_button.imageset/keyboard_button~ipad.png similarity index 100% rename from ios/chrome/browser/ui/resources/keyboard_button~ipad.png rename to ios/chrome/browser/ui/resources/keyboard_button.imageset/keyboard_button~ipad.png Binary files differ
diff --git a/ios/chrome/browser/ui/settings/BUILD.gn b/ios/chrome/browser/ui/settings/BUILD.gn index 62bc7a62..fa102a5 100644 --- a/ios/chrome/browser/ui/settings/BUILD.gn +++ b/ios/chrome/browser/ui/settings/BUILD.gn
@@ -2,29 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -bundle_data("resources") { - sources = [ - "resources/app_icon_placeholder.png", - "resources/app_icon_placeholder@2x.png", - "resources/app_icon_placeholder@3x.png", - "resources/encryption_error.png", - "resources/encryption_error@2x.png", - "resources/encryption_error@3x.png", - "resources/settings_accounts_add_account.png", - "resources/settings_accounts_add_account@2x.png", - "resources/settings_accounts_add_account@3x.png", - "resources/settings_error.png", - "resources/settings_error@2x.png", - "resources/settings_error@3x.png", - "resources/settings_sync.png", - "resources/settings_sync@2x.png", - "resources/settings_sync@3x.png", - ] - outputs = [ - "{{bundle_resources_dir}}/{{source_file_part}}", - ] -} - source_set("settings") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ @@ -102,7 +79,11 @@ "voicesearch_collection_view_controller.mm", ] deps = [ - ":resources", + "resources:app_icon_placeholder", + "resources:encryption_error", + "resources:settings_accounts_add_account", + "resources:settings_error", + "resources:settings_sync", "//base", "//base:i18n", "//components/autofill/core/browser",
diff --git a/ios/chrome/browser/ui/settings/block_popups_collection_view_controller.mm b/ios/chrome/browser/ui/settings/block_popups_collection_view_controller.mm index 0967faa..12bacce 100644 --- a/ios/chrome/browser/ui/settings/block_popups_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/block_popups_collection_view_controller.mm
@@ -9,6 +9,7 @@ #include "base/strings/sys_string_conversions.h" #include "base/values.h" #include "components/content_settings/core/browser/host_content_settings_map.h" +#include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings_pattern.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/content_settings/host_content_settings_map_factory.h" @@ -280,7 +281,7 @@ // able to modify content settings with a secondary pattern other than the // wildcard pattern. So only show settings that the user is able to modify. if (entries[i].secondary_pattern == ContentSettingsPattern::Wildcard() && - entries[i].setting == CONTENT_SETTING_ALLOW) { + entries[i].GetContentSetting() == CONTENT_SETTING_ALLOW) { _exceptions.AppendString(entries[i].primary_pattern.ToString()); } else { LOG(ERROR) << "Secondary content settings patterns are not "
diff --git a/ios/chrome/browser/ui/settings/passwords_settings_egtest.mm b/ios/chrome/browser/ui/settings/passwords_settings_egtest.mm index d36f421..fa35b2c 100644 --- a/ios/chrome/browser/ui/settings/passwords_settings_egtest.mm +++ b/ios/chrome/browser/ui/settings/passwords_settings_egtest.mm
@@ -12,6 +12,7 @@ #include "components/password_manager/core/browser/password_store.h" #include "components/password_manager/core/common/password_manager_pref_names.h" #include "components/prefs/pref_service.h" +#include "components/strings/grit/components_strings.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h" #import "ios/chrome/browser/ui/settings/password_details_collection_view_controller_for_testing.h" @@ -165,6 +166,16 @@ grey_layout(@[ Below() ], PasswordHeader()), nullptr); } +// Matcher for the Copy site button in Password Details view. +id<GREYMatcher> DeleteButton() { + return grey_allOf(grey_interactable(), + ButtonWithAccessibilityLabel(l10n_util::GetNSString( + IDS_IOS_SETTINGS_PASSWORD_DELETE_BUTTON)), + grey_layout(@[ Below() ], SiteHeader()), + grey_layout(@[ Below() ], UsernameHeader()), + grey_layout(@[ Below() ], PasswordHeader()), nullptr); +} + } // namespace @interface MockReauthenticationModule : NSObject<ReauthenticationProtocol> @@ -487,4 +498,44 @@ [self clearPasswordStore]; } +// Checks that deleting a password from password details view goes back to the +// list-of-passwords view. +- (void)testDeletion { + [self scopedEnablePasswordManagementAndViewingUI]; + + // Save form to be deleted later. + [self saveExamplePasswordForm]; + + [self openPasswordSettings]; + + [[EarlGrey selectElementWithMatcher:Entry(@"https://example.com, user")] + performAction:grey_tap()]; + + // Tap the Delete... button. + [[[EarlGrey selectElementWithMatcher:DeleteButton()] + usingSearchAction:grey_scrollInDirection(kGREYDirectionDown, + kScrollAmount) + onElementWithMatcher:grey_accessibilityID( + @"PasswordDetailsCollectionViewController")] + performAction:grey_tap()]; + [[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; + + // Check that the current view is now the list view, by locating the header + // of the list of passwords. + [[EarlGrey selectElementWithMatcher: + grey_allOf(grey_accessibilityLabel(l10n_util::GetNSString( + IDS_PASSWORD_MANAGER_SHOW_PASSWORDS_TAB_TITLE)), + grey_accessibilityTrait(UIAccessibilityTraitHeader), + nullptr)] assertWithMatcher:grey_notNil()]; + + // Also verify that the removed password is no longer in the list. + [[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; + [[EarlGrey selectElementWithMatcher:Entry(@"https://example.com, user")] + assertWithMatcher:grey_not(grey_sufficientlyVisible())]; + + [self tapBackArrow]; + [self tapDone]; + [self clearPasswordStore]; +} + @end
diff --git a/ios/chrome/browser/ui/settings/resources/BUILD.gn b/ios/chrome/browser/ui/settings/resources/BUILD.gn new file mode 100644 index 0000000..fd54ec3d --- /dev/null +++ b/ios/chrome/browser/ui/settings/resources/BUILD.gn
@@ -0,0 +1,50 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ios/imageset.gni") + +imageset("app_icon_placeholder") { + sources = [ + "app_icon_placeholder.imageset/Contents.json", + "app_icon_placeholder.imageset/app_icon_placeholder.png", + "app_icon_placeholder.imageset/app_icon_placeholder@2x.png", + "app_icon_placeholder.imageset/app_icon_placeholder@3x.png", + ] +} + +imageset("encryption_error") { + sources = [ + "encryption_error.imageset/Contents.json", + "encryption_error.imageset/encryption_error.png", + "encryption_error.imageset/encryption_error@2x.png", + "encryption_error.imageset/encryption_error@3x.png", + ] +} + +imageset("settings_accounts_add_account") { + sources = [ + "settings_accounts_add_account.imageset/Contents.json", + "settings_accounts_add_account.imageset/settings_accounts_add_account.png", + "settings_accounts_add_account.imageset/settings_accounts_add_account@2x.png", + "settings_accounts_add_account.imageset/settings_accounts_add_account@3x.png", + ] +} + +imageset("settings_error") { + sources = [ + "settings_error.imageset/Contents.json", + "settings_error.imageset/settings_error.png", + "settings_error.imageset/settings_error@2x.png", + "settings_error.imageset/settings_error@3x.png", + ] +} + +imageset("settings_sync") { + sources = [ + "settings_sync.imageset/Contents.json", + "settings_sync.imageset/settings_sync.png", + "settings_sync.imageset/settings_sync@2x.png", + "settings_sync.imageset/settings_sync@3x.png", + ] +}
diff --git a/ios/chrome/browser/ui/settings/resources/app_icon_placeholder.imageset/Contents.json b/ios/chrome/browser/ui/settings/resources/app_icon_placeholder.imageset/Contents.json new file mode 100644 index 0000000..68a36b2 --- /dev/null +++ b/ios/chrome/browser/ui/settings/resources/app_icon_placeholder.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "app_icon_placeholder.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "app_icon_placeholder@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "app_icon_placeholder@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/settings/resources/app_icon_placeholder.png b/ios/chrome/browser/ui/settings/resources/app_icon_placeholder.imageset/app_icon_placeholder.png similarity index 100% rename from ios/chrome/browser/ui/settings/resources/app_icon_placeholder.png rename to ios/chrome/browser/ui/settings/resources/app_icon_placeholder.imageset/app_icon_placeholder.png Binary files differ
diff --git a/ios/chrome/browser/ui/settings/resources/app_icon_placeholder@2x.png b/ios/chrome/browser/ui/settings/resources/app_icon_placeholder.imageset/app_icon_placeholder@2x.png similarity index 100% rename from ios/chrome/browser/ui/settings/resources/app_icon_placeholder@2x.png rename to ios/chrome/browser/ui/settings/resources/app_icon_placeholder.imageset/app_icon_placeholder@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/settings/resources/app_icon_placeholder@3x.png b/ios/chrome/browser/ui/settings/resources/app_icon_placeholder.imageset/app_icon_placeholder@3x.png similarity index 100% rename from ios/chrome/browser/ui/settings/resources/app_icon_placeholder@3x.png rename to ios/chrome/browser/ui/settings/resources/app_icon_placeholder.imageset/app_icon_placeholder@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/settings/resources/encryption_error.imageset/Contents.json b/ios/chrome/browser/ui/settings/resources/encryption_error.imageset/Contents.json new file mode 100644 index 0000000..c8697c22 --- /dev/null +++ b/ios/chrome/browser/ui/settings/resources/encryption_error.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "encryption_error.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "encryption_error@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "encryption_error@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/settings/resources/encryption_error.png b/ios/chrome/browser/ui/settings/resources/encryption_error.imageset/encryption_error.png similarity index 100% rename from ios/chrome/browser/ui/settings/resources/encryption_error.png rename to ios/chrome/browser/ui/settings/resources/encryption_error.imageset/encryption_error.png Binary files differ
diff --git a/ios/chrome/browser/ui/settings/resources/encryption_error@2x.png b/ios/chrome/browser/ui/settings/resources/encryption_error.imageset/encryption_error@2x.png similarity index 100% rename from ios/chrome/browser/ui/settings/resources/encryption_error@2x.png rename to ios/chrome/browser/ui/settings/resources/encryption_error.imageset/encryption_error@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/settings/resources/encryption_error@3x.png b/ios/chrome/browser/ui/settings/resources/encryption_error.imageset/encryption_error@3x.png similarity index 100% rename from ios/chrome/browser/ui/settings/resources/encryption_error@3x.png rename to ios/chrome/browser/ui/settings/resources/encryption_error.imageset/encryption_error@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/settings/resources/settings_accounts_add_account.imageset/Contents.json b/ios/chrome/browser/ui/settings/resources/settings_accounts_add_account.imageset/Contents.json new file mode 100644 index 0000000..7b78654 --- /dev/null +++ b/ios/chrome/browser/ui/settings/resources/settings_accounts_add_account.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "settings_accounts_add_account.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "settings_accounts_add_account@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "settings_accounts_add_account@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/settings/resources/settings_accounts_add_account.png b/ios/chrome/browser/ui/settings/resources/settings_accounts_add_account.imageset/settings_accounts_add_account.png similarity index 100% rename from ios/chrome/browser/ui/settings/resources/settings_accounts_add_account.png rename to ios/chrome/browser/ui/settings/resources/settings_accounts_add_account.imageset/settings_accounts_add_account.png Binary files differ
diff --git a/ios/chrome/browser/ui/settings/resources/settings_accounts_add_account@2x.png b/ios/chrome/browser/ui/settings/resources/settings_accounts_add_account.imageset/settings_accounts_add_account@2x.png similarity index 100% rename from ios/chrome/browser/ui/settings/resources/settings_accounts_add_account@2x.png rename to ios/chrome/browser/ui/settings/resources/settings_accounts_add_account.imageset/settings_accounts_add_account@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/settings/resources/settings_accounts_add_account@3x.png b/ios/chrome/browser/ui/settings/resources/settings_accounts_add_account.imageset/settings_accounts_add_account@3x.png similarity index 100% rename from ios/chrome/browser/ui/settings/resources/settings_accounts_add_account@3x.png rename to ios/chrome/browser/ui/settings/resources/settings_accounts_add_account.imageset/settings_accounts_add_account@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/settings/resources/settings_error.imageset/Contents.json b/ios/chrome/browser/ui/settings/resources/settings_error.imageset/Contents.json new file mode 100644 index 0000000..edfcf4e --- /dev/null +++ b/ios/chrome/browser/ui/settings/resources/settings_error.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "settings_error.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "settings_error@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "settings_error@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/settings/resources/settings_error.png b/ios/chrome/browser/ui/settings/resources/settings_error.imageset/settings_error.png similarity index 100% rename from ios/chrome/browser/ui/settings/resources/settings_error.png rename to ios/chrome/browser/ui/settings/resources/settings_error.imageset/settings_error.png Binary files differ
diff --git a/ios/chrome/browser/ui/settings/resources/settings_error@2x.png b/ios/chrome/browser/ui/settings/resources/settings_error.imageset/settings_error@2x.png similarity index 100% rename from ios/chrome/browser/ui/settings/resources/settings_error@2x.png rename to ios/chrome/browser/ui/settings/resources/settings_error.imageset/settings_error@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/settings/resources/settings_error@3x.png b/ios/chrome/browser/ui/settings/resources/settings_error.imageset/settings_error@3x.png similarity index 100% rename from ios/chrome/browser/ui/settings/resources/settings_error@3x.png rename to ios/chrome/browser/ui/settings/resources/settings_error.imageset/settings_error@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/settings/resources/settings_sync.imageset/Contents.json b/ios/chrome/browser/ui/settings/resources/settings_sync.imageset/Contents.json new file mode 100644 index 0000000..191001f --- /dev/null +++ b/ios/chrome/browser/ui/settings/resources/settings_sync.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "settings_sync.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "settings_sync@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "settings_sync@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/browser/ui/settings/resources/settings_sync.png b/ios/chrome/browser/ui/settings/resources/settings_sync.imageset/settings_sync.png similarity index 100% rename from ios/chrome/browser/ui/settings/resources/settings_sync.png rename to ios/chrome/browser/ui/settings/resources/settings_sync.imageset/settings_sync.png Binary files differ
diff --git a/ios/chrome/browser/ui/settings/resources/settings_sync@2x.png b/ios/chrome/browser/ui/settings/resources/settings_sync.imageset/settings_sync@2x.png similarity index 100% rename from ios/chrome/browser/ui/settings/resources/settings_sync@2x.png rename to ios/chrome/browser/ui/settings/resources/settings_sync.imageset/settings_sync@2x.png Binary files differ
diff --git a/ios/chrome/browser/ui/settings/resources/settings_sync@3x.png b/ios/chrome/browser/ui/settings/resources/settings_sync.imageset/settings_sync@3x.png similarity index 100% rename from ios/chrome/browser/ui/settings/resources/settings_sync@3x.png rename to ios/chrome/browser/ui/settings/resources/settings_sync.imageset/settings_sync@3x.png Binary files differ
diff --git a/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller.mm b/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller.mm index 95dc29e..8d44e2a 100644 --- a/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller.mm
@@ -578,9 +578,10 @@ for (auto it = savedForms_.begin(); it != savedForms_.end(); ++it) { if (**it == form) { savedForms_.erase(it); - return; + break; } } + [self reloadData]; [self.navigationController popViewControllerAnimated:YES]; }
diff --git a/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm b/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm index 98253f2f..bedfe15b 100644 --- a/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm +++ b/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm
@@ -335,6 +335,9 @@ - (void)loadURLForQuery:(NSString*)query; // Lazily instantiate the keyboard accessory view. - (UIView*)keyboardAccessoryView; +// Configures the KeyboardAccessoryView and InputAssistantItem associated with +// the omnibox. +- (void)configureAssistiveKeyboardViews; - (void)preloadVoiceSearch:(id)sender; // Calculates the CGRect to use for the omnibox's frame. Also sets the frames // of some buttons and |_webToolbar|. @@ -612,8 +615,7 @@ [self.view addSubview:_determinateProgressView]; } - // Attach the spacebar view to the omnibox. - [_omniBox setInputAccessoryView:[self keyboardAccessoryView]]; + [self configureAssistiveKeyboardViews]; // Add the handler to preload voice search when the voice search button is // tapped, but only if voice search is enabled. @@ -880,7 +882,7 @@ // Update keyboard accessory views. auto mode = _keyboardAccessoryView.mode; _keyboardAccessoryView = nil; - [_omniBox setInputAccessoryView:[self keyboardAccessoryView]]; + [self configureAssistiveKeyboardViews]; _keyboardAccessoryView.mode = mode; if ([_omniBox isFirstResponder]) { [_omniBox reloadInputViews]; @@ -1875,6 +1877,16 @@ return _keyboardAccessoryView; } +- (void)configureAssistiveKeyboardViews { + if (experimental_flags::IsKeyboardAccessoryViewWithCameraSearchEnabled()) { + // The InputAssistantItems are disabled when the new Keyboard Accessory View + // is enabled. + _omniBox.inputAssistantItem.leadingBarButtonGroups = @[]; + _omniBox.inputAssistantItem.trailingBarButtonGroups = @[]; + } + [_omniBox setInputAccessoryView:[self keyboardAccessoryView]]; +} + - (void)preloadVoiceSearch:(id)sender { DCHECK(ios::GetChromeBrowserProvider() ->GetVoiceSearchProvider()
diff --git a/ios/chrome/browser/ui/webui/net_export/BUILD.gn b/ios/chrome/browser/ui/webui/net_export/BUILD.gn index ab4037a4..969f0a4 100644 --- a/ios/chrome/browser/ui/webui/net_export/BUILD.gn +++ b/ios/chrome/browser/ui/webui/net_export/BUILD.gn
@@ -15,6 +15,7 @@ "//ios/chrome/browser", "//ios/chrome/browser/browser_state", "//ios/chrome/browser/ui", + "//ios/chrome/common:common", "//ios/web", "//net:net", ]
diff --git a/ios/chrome/browser/ui/webui/net_export/net_export_ui.cc b/ios/chrome/browser/ui/webui/net_export/net_export_ui.cc index c13cf55..cf1a6fd 100644 --- a/ios/chrome/browser/ui/webui/net_export/net_export_ui.cc +++ b/ios/chrome/browser/ui/webui/net_export/net_export_ui.cc
@@ -23,6 +23,7 @@ #include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/chrome_url_constants.h" #include "ios/chrome/browser/ui/show_mail_composer_util.h" +#include "ios/chrome/common/channel_info.h" #include "ios/chrome/grit/ios_strings.h" #include "ios/web/public/web_thread.h" #include "ios/web/public/web_ui_ios_data_source.h" @@ -141,6 +142,8 @@ net_log::NetLogFileWriter::CaptureModeFromString(capture_mode_string); file_writer_->StartNetLog( base::FilePath(), capture_mode, + base::CommandLine::ForCurrentProcess()->GetCommandLineString(), + GetChannelString(), {GetApplicationContext()->GetSystemURLRequestContext()}); }
diff --git a/ios/chrome/browser/web/BUILD.gn b/ios/chrome/browser/web/BUILD.gn index 45a3b76..0e07ad4 100644 --- a/ios/chrome/browser/web/BUILD.gn +++ b/ios/chrome/browser/web/BUILD.gn
@@ -86,100 +86,6 @@ ] } -bundle_data("resources") { - sources = [ - "resources/autofill_card_american_express.png", - "resources/autofill_card_american_express@2x.png", - "resources/autofill_card_american_express@2x~ipad.png", - "resources/autofill_card_american_express@3x.png", - "resources/autofill_card_american_express~ipad.png", - "resources/autofill_card_diners.png", - "resources/autofill_card_diners@2x.png", - "resources/autofill_card_diners@2x~ipad.png", - "resources/autofill_card_diners@3x.png", - "resources/autofill_card_diners~ipad.png", - "resources/autofill_card_discover.png", - "resources/autofill_card_discover@2x.png", - "resources/autofill_card_discover@2x~ipad.png", - "resources/autofill_card_discover@3x.png", - "resources/autofill_card_discover~ipad.png", - "resources/autofill_card_generic.png", - "resources/autofill_card_generic@2x.png", - "resources/autofill_card_generic@2x~ipad.png", - "resources/autofill_card_generic@3x.png", - "resources/autofill_card_generic~ipad.png", - "resources/autofill_card_jcb.png", - "resources/autofill_card_jcb@2x.png", - "resources/autofill_card_jcb@2x~ipad.png", - "resources/autofill_card_jcb@3x.png", - "resources/autofill_card_jcb~ipad.png", - "resources/autofill_card_mastercard.png", - "resources/autofill_card_mastercard@2x.png", - "resources/autofill_card_mastercard@2x~ipad.png", - "resources/autofill_card_mastercard@3x.png", - "resources/autofill_card_mastercard~ipad.png", - "resources/autofill_card_unionpay.png", - "resources/autofill_card_unionpay@2x.png", - "resources/autofill_card_unionpay@2x~ipad.png", - "resources/autofill_card_unionpay@3x.png", - "resources/autofill_card_unionpay~ipad.png", - "resources/autofill_card_visa.png", - "resources/autofill_card_visa@2x.png", - "resources/autofill_card_visa@2x~ipad.png", - "resources/autofill_card_visa@3x.png", - "resources/autofill_card_visa~ipad.png", - "resources/autofill_close.png", - "resources/autofill_close@2x.png", - "resources/autofill_close@3x.png", - "resources/autofill_close_pressed.png", - "resources/autofill_close_pressed@2x.png", - "resources/autofill_close_pressed@3x.png", - "resources/autofill_keyboard_background.png", - "resources/autofill_keyboard_background@2x.png", - "resources/autofill_keyboard_background@3x.png", - "resources/autofill_keyboard_background_left.png", - "resources/autofill_keyboard_background_left@2x.png", - "resources/autofill_keyboard_background_right.png", - "resources/autofill_keyboard_background_right@2x.png", - "resources/autofill_left_sep.png", - "resources/autofill_left_sep@2x.png", - "resources/autofill_left_sep@3x.png", - "resources/autofill_left_sep_RTL.png", - "resources/autofill_left_sep_RTL@2x.png", - "resources/autofill_left_sep_RTL@3x.png", - "resources/autofill_middle_sep.png", - "resources/autofill_middle_sep@2x.png", - "resources/autofill_middle_sep@3x.png", - "resources/autofill_next.png", - "resources/autofill_next@2x.png", - "resources/autofill_next@3x.png", - "resources/autofill_next_inactive.png", - "resources/autofill_next_inactive@2x.png", - "resources/autofill_next_inactive@3x.png", - "resources/autofill_next_pressed.png", - "resources/autofill_next_pressed@2x.png", - "resources/autofill_next_pressed@3x.png", - "resources/autofill_prev.png", - "resources/autofill_prev@2x.png", - "resources/autofill_prev@3x.png", - "resources/autofill_prev_inactive.png", - "resources/autofill_prev_inactive@2x.png", - "resources/autofill_prev_inactive@3x.png", - "resources/autofill_prev_pressed.png", - "resources/autofill_prev_pressed@2x.png", - "resources/autofill_prev_pressed@3x.png", - "resources/autofill_right_sep.png", - "resources/autofill_right_sep@2x.png", - "resources/autofill_right_sep@3x.png", - "resources/autofill_right_sep_RTL.png", - "resources/autofill_right_sep_RTL@2x.png", - "resources/autofill_right_sep_RTL@3x.png", - ] - outputs = [ - "{{bundle_resources_dir}}/{{source_file_part}}", - ] -} - js_compile_bundle("chrome_bundle") { closure_entry_point = "__crWeb.chromeBundle" sources = [ @@ -221,7 +127,6 @@ ] deps = [ ":chrome_bundle", - ":resources", "//base", "//components/content_settings/core/browser", "//components/dom_distiller/core",
diff --git a/ios/chrome/search_widget_extension/BUILD.gn b/ios/chrome/search_widget_extension/BUILD.gn index 79bbe056..ee32aebc 100644 --- a/ios/chrome/search_widget_extension/BUILD.gn +++ b/ios/chrome/search_widget_extension/BUILD.gn
@@ -24,9 +24,12 @@ ios_appex_bundle("search_widget_extension") { deps = [ - ":resources", ":search_widget", ":system_strings", + "resources:quick_action_camera_search", + "resources:quick_action_incognito_search", + "resources:quick_action_search", + "resources:quick_action_voice_search", ] extra_substitutions = [ @@ -41,6 +44,10 @@ source_set("search_widget") { sources = [ + "copied_url_view.h", + "copied_url_view.mm", + "search_action_view.h", + "search_action_view.mm", "search_widget_view.h", "search_widget_view.mm", "search_widget_view_controller.h", @@ -76,27 +83,6 @@ configs += [ "//build/config/compiler:enable_arc" ] } -bundle_data("resources") { - visibility = [ ":*" ] - sources = [ - "resources/quick_action_camera_search.png", - "resources/quick_action_camera_search@2x.png", - "resources/quick_action_camera_search@3x.png", - "resources/quick_action_incognito_search.png", - "resources/quick_action_incognito_search@2x.png", - "resources/quick_action_incognito_search@3x.png", - "resources/quick_action_search.png", - "resources/quick_action_search@2x.png", - "resources/quick_action_search@3x.png", - "resources/quick_action_voice_search.png", - "resources/quick_action_voice_search@2x.png", - "resources/quick_action_voice_search@3x.png", - ] - outputs = [ - "{{bundle_resources_dir}}/{{source_file_part}}", - ] -} - repack_locales("packed_resources") { input_locales = ios_packed_locales output_locales = ios_packed_locales_as_mac_outputs
diff --git a/ios/chrome/search_widget_extension/copied_url_view.h b/ios/chrome/search_widget_extension/copied_url_view.h new file mode 100644 index 0000000..58346f6 --- /dev/null +++ b/ios/chrome/search_widget_extension/copied_url_view.h
@@ -0,0 +1,33 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_SEARCH_WIDGET_EXTENSION_COPIED_URL_VIEW_H_ +#define IOS_CHROME_SEARCH_WIDGET_EXTENSION_COPIED_URL_VIEW_H_ + +#import <UIKit/UIKit.h> + +// View to show and allow opening of the copied URL. Shows a button with the +// |copiedURLString| if it has been set. When tapped, |actionSelector| in +// |target| is called. If no |copiedURLString| was set, the button is replaced +// by a hairline separation and placeholder text. +@interface CopiedURLView : UIView + +// The copied URL string to be displayed. nil is a valid value to indicate +// there is no copied URL to display. +@property(nonatomic, copy) NSString* copiedURLString; + +// Designated initializer, creates the copiedURLView with a |target| to open the +// URL. The |primaryVibrancyEffect| and |secondaryVibrancyEffect| are used to +// display view elements. +- (instancetype)initWithActionTarget:(id)target + actionSelector:(SEL)actionSelector + primaryEffect:(UIVisualEffect*)primaryEffect + secondaryEffect:(UIVisualEffect*)secondaryEffect + NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; +- (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; + +@end + +#endif // IOS_CHROME_SEARCH_WIDGET_EXTENSION_COPIED_URL_VIEW_H_
diff --git a/ios/chrome/search_widget_extension/copied_url_view.mm b/ios/chrome/search_widget_extension/copied_url_view.mm new file mode 100644 index 0000000..15062965 --- /dev/null +++ b/ios/chrome/search_widget_extension/copied_url_view.mm
@@ -0,0 +1,185 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/search_widget_extension/copied_url_view.h" + +#include "base/ios/ios_util.h" +#import "ios/chrome/search_widget_extension/ui_util.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace { + +const CGFloat kURLButtonMargin = 10; + +} // namespace + +@interface CopiedURLView () + +// The copied URL label containing the URL or a placeholder text. +@property(nonatomic, strong) UILabel* copiedURLLabel; +// The copied URL title label containing the title of the copied URL button. +@property(nonatomic, strong) UILabel* openCopiedURLTitleLabel; +// The hairline view potentially shown at the top of the copied URL view. +@property(nonatomic, strong) UIView* hairlineView; +// The button shown when there is a copied URL to open. +@property(nonatomic, strong) UIButton* copiedButtonView; + +// Updates the view to show the copied URL in a button. +- (void)updateUICopiedURL; + +// Updates the view to show that there is no copied URL, with no button and a +// hairline at the top of the view. +- (void)updateUINoCopiedURL; + +@end + +@implementation CopiedURLView + +- (void)setCopiedURLString:(NSString*)copiedURL { + _copiedURLString = copiedURL; + if (copiedURL) { + [self updateUICopiedURL]; + } else { + [self updateUINoCopiedURL]; + } +} + +@synthesize copiedURLLabel = _copiedURLLabel; +@synthesize copiedURLString = _copiedURLString; +@synthesize openCopiedURLTitleLabel = _openCopiedURLTitleLabel; +@synthesize hairlineView = _hairlineView; +@synthesize copiedButtonView = _copiedButtonView; + +- (instancetype)initWithActionTarget:(id)target + actionSelector:(SEL)actionSelector + primaryEffect:(UIVisualEffect*)primaryEffect + secondaryEffect:(UIVisualEffect*)secondaryEffect { + DCHECK(target); + self = [super initWithFrame:CGRectZero]; + if (self) { + self.translatesAutoresizingMaskIntoConstraints = NO; + + UIVisualEffectView* primaryEffectView = + [[UIVisualEffectView alloc] initWithEffect:primaryEffect]; + UIVisualEffectView* secondaryEffectView = + [[UIVisualEffectView alloc] initWithEffect:secondaryEffect]; + for (UIVisualEffectView* effectView in + @[ primaryEffectView, secondaryEffectView ]) { + [self addSubview:effectView]; + effectView.translatesAutoresizingMaskIntoConstraints = NO; + [NSLayoutConstraint + activateConstraints:ui_util::CreateSameConstraints(self, effectView)]; + } + + _hairlineView = [[UIView alloc] initWithFrame:CGRectZero]; + _hairlineView.backgroundColor = base::ios::IsRunningOnIOS10OrLater() + ? [UIColor colorWithWhite:0 alpha:0.05] + : [UIColor whiteColor]; + _hairlineView.translatesAutoresizingMaskIntoConstraints = NO; + [secondaryEffectView.contentView addSubview:_hairlineView]; + + _copiedButtonView = [[UIButton alloc] initWithFrame:CGRectZero]; + _copiedButtonView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.05]; + _copiedButtonView.layer.cornerRadius = 5; + _copiedButtonView.translatesAutoresizingMaskIntoConstraints = NO; + _copiedButtonView.accessibilityLabel = + NSLocalizedString(@"IDS_IOS_OPEN_COPIED_LINK", nil); + [secondaryEffectView.contentView addSubview:_copiedButtonView]; + [_copiedButtonView addTarget:target + action:actionSelector + forControlEvents:UIControlEventTouchUpInside]; + + _openCopiedURLTitleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; + _openCopiedURLTitleLabel.textAlignment = NSTextAlignmentCenter; + _openCopiedURLTitleLabel.translatesAutoresizingMaskIntoConstraints = NO; + _openCopiedURLTitleLabel.font = + [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]; + [primaryEffectView.contentView addSubview:_openCopiedURLTitleLabel]; + + _copiedURLLabel = [[UILabel alloc] initWithFrame:CGRectZero]; + _copiedURLLabel.textAlignment = NSTextAlignmentCenter; + _copiedURLLabel.font = + [UIFont preferredFontForTextStyle:UIFontTextStyleFootnote]; + _copiedURLLabel.translatesAutoresizingMaskIntoConstraints = NO; + [secondaryEffectView.contentView addSubview:_copiedURLLabel]; + + [NSLayoutConstraint activateConstraints:@[ + [_hairlineView.topAnchor constraintEqualToAnchor:self.topAnchor], + [_hairlineView.leftAnchor constraintEqualToAnchor:self.leftAnchor], + [_hairlineView.rightAnchor constraintEqualToAnchor:self.rightAnchor], + [_hairlineView.heightAnchor constraintEqualToConstant:0.5], + + [_copiedButtonView.leadingAnchor + constraintEqualToAnchor:self.leadingAnchor + constant:ui_util::kContentMargin], + [_copiedButtonView.trailingAnchor + constraintEqualToAnchor:self.trailingAnchor + constant:-ui_util::kContentMargin], + [_copiedButtonView.topAnchor + constraintEqualToAnchor:_hairlineView.bottomAnchor + constant:ui_util::kContentMargin], + [_copiedButtonView.bottomAnchor + constraintEqualToAnchor:self.bottomAnchor + constant:-ui_util::kContentMargin], + + [_openCopiedURLTitleLabel.topAnchor + constraintEqualToAnchor:_copiedButtonView.topAnchor + constant:kURLButtonMargin], + [_openCopiedURLTitleLabel.leadingAnchor + constraintEqualToAnchor:_copiedButtonView.leadingAnchor + constant:ui_util::kContentMargin], + [_openCopiedURLTitleLabel.trailingAnchor + constraintEqualToAnchor:_copiedButtonView.trailingAnchor + constant:-ui_util::kContentMargin], + + [_copiedURLLabel.topAnchor + constraintEqualToAnchor:_openCopiedURLTitleLabel.bottomAnchor], + [_copiedURLLabel.bottomAnchor + constraintEqualToAnchor:_copiedButtonView.bottomAnchor + constant:-kURLButtonMargin], + [_copiedURLLabel.leadingAnchor + constraintEqualToAnchor:_openCopiedURLTitleLabel.leadingAnchor], + [_copiedURLLabel.trailingAnchor + constraintEqualToAnchor:_openCopiedURLTitleLabel.trailingAnchor], + ]]; + [self updateUINoCopiedURL]; + } + return self; +} + +- (void)updateUICopiedURL { + self.copiedButtonView.hidden = NO; + self.hairlineView.hidden = YES; + self.copiedURLLabel.text = self.copiedURLString; + self.copiedURLLabel.accessibilityLabel = self.copiedURLString; + self.openCopiedURLTitleLabel.alpha = 1; + self.openCopiedURLTitleLabel.text = + NSLocalizedString(@"IDS_IOS_OPEN_COPIED_LINK", nil); + self.openCopiedURLTitleLabel.isAccessibilityElement = NO; + self.copiedURLLabel.alpha = 1; +} + +- (void)updateUINoCopiedURL { + self.copiedButtonView.hidden = YES; + self.hairlineView.hidden = NO; + self.copiedURLLabel.text = + NSLocalizedString(@"IDS_IOS_NO_COPIED_LINK_MESSAGE", nil); + self.copiedURLLabel.accessibilityLabel = + NSLocalizedString(@"IDS_IOS_NO_COPIED_LINK_MESSAGE", nil); + self.openCopiedURLTitleLabel.text = + NSLocalizedString(@"IDS_IOS_NO_COPIED_LINK_TITLE", nil); + self.openCopiedURLTitleLabel.accessibilityLabel = + NSLocalizedString(@"IDS_IOS_NO_COPIED_LINK_TITLE", nil); + self.openCopiedURLTitleLabel.isAccessibilityElement = YES; + + if (base::ios::IsRunningOnIOS10OrLater()) { + self.copiedURLLabel.alpha = 0.5; + self.openCopiedURLTitleLabel.alpha = 0.5; + } +} + +@end
diff --git a/ios/chrome/search_widget_extension/resources/BUILD.gn b/ios/chrome/search_widget_extension/resources/BUILD.gn new file mode 100644 index 0000000..124ab76 --- /dev/null +++ b/ios/chrome/search_widget_extension/resources/BUILD.gn
@@ -0,0 +1,41 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ios/imageset.gni") + +imageset("quick_action_search") { + sources = [ + "quick_action_search.imageset/Contents.json", + "quick_action_search.imageset/quick_action_search.png", + "quick_action_search.imageset/quick_action_search@2x.png", + "quick_action_search.imageset/quick_action_search@3x.png", + ] +} + +imageset("quick_action_incognito_search") { + sources = [ + "quick_action_incognito_search.imageset/Contents.json", + "quick_action_incognito_search.imageset/quick_action_incognito_search.png", + "quick_action_incognito_search.imageset/quick_action_incognito_search@2x.png", + "quick_action_incognito_search.imageset/quick_action_incognito_search@3x.png", + ] +} + +imageset("quick_action_voice_search") { + sources = [ + "quick_action_voice_search.imageset/Contents.json", + "quick_action_voice_search.imageset/quick_action_voice_search.png", + "quick_action_voice_search.imageset/quick_action_voice_search@2x.png", + "quick_action_voice_search.imageset/quick_action_voice_search@3x.png", + ] +} + +imageset("quick_action_camera_search") { + sources = [ + "quick_action_camera_search.imageset/Contents.json", + "quick_action_camera_search.imageset/quick_action_camera_search.png", + "quick_action_camera_search.imageset/quick_action_camera_search@2x.png", + "quick_action_camera_search.imageset/quick_action_camera_search@3x.png", + ] +}
diff --git a/ios/chrome/search_widget_extension/resources/quick_action_camera_search.imageset/Contents.json b/ios/chrome/search_widget_extension/resources/quick_action_camera_search.imageset/Contents.json new file mode 100644 index 0000000..d2b3cc4 --- /dev/null +++ b/ios/chrome/search_widget_extension/resources/quick_action_camera_search.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "quick_action_camera_search.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "quick_action_camera_search@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "quick_action_camera_search@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/search_widget_extension/resources/quick_action_camera_search.png b/ios/chrome/search_widget_extension/resources/quick_action_camera_search.imageset/quick_action_camera_search.png similarity index 100% rename from ios/chrome/search_widget_extension/resources/quick_action_camera_search.png rename to ios/chrome/search_widget_extension/resources/quick_action_camera_search.imageset/quick_action_camera_search.png Binary files differ
diff --git a/ios/chrome/search_widget_extension/resources/quick_action_camera_search@2x.png b/ios/chrome/search_widget_extension/resources/quick_action_camera_search.imageset/quick_action_camera_search@2x.png similarity index 100% rename from ios/chrome/search_widget_extension/resources/quick_action_camera_search@2x.png rename to ios/chrome/search_widget_extension/resources/quick_action_camera_search.imageset/quick_action_camera_search@2x.png Binary files differ
diff --git a/ios/chrome/search_widget_extension/resources/quick_action_camera_search@3x.png b/ios/chrome/search_widget_extension/resources/quick_action_camera_search.imageset/quick_action_camera_search@3x.png similarity index 100% rename from ios/chrome/search_widget_extension/resources/quick_action_camera_search@3x.png rename to ios/chrome/search_widget_extension/resources/quick_action_camera_search.imageset/quick_action_camera_search@3x.png Binary files differ
diff --git a/ios/chrome/search_widget_extension/resources/quick_action_incognito_search.imageset/Contents.json b/ios/chrome/search_widget_extension/resources/quick_action_incognito_search.imageset/Contents.json new file mode 100644 index 0000000..de95f7e --- /dev/null +++ b/ios/chrome/search_widget_extension/resources/quick_action_incognito_search.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "quick_action_incognito_search.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "quick_action_incognito_search@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "quick_action_incognito_search@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/search_widget_extension/resources/quick_action_incognito_search.png b/ios/chrome/search_widget_extension/resources/quick_action_incognito_search.imageset/quick_action_incognito_search.png similarity index 100% rename from ios/chrome/search_widget_extension/resources/quick_action_incognito_search.png rename to ios/chrome/search_widget_extension/resources/quick_action_incognito_search.imageset/quick_action_incognito_search.png Binary files differ
diff --git a/ios/chrome/search_widget_extension/resources/quick_action_incognito_search@2x.png b/ios/chrome/search_widget_extension/resources/quick_action_incognito_search.imageset/quick_action_incognito_search@2x.png similarity index 100% rename from ios/chrome/search_widget_extension/resources/quick_action_incognito_search@2x.png rename to ios/chrome/search_widget_extension/resources/quick_action_incognito_search.imageset/quick_action_incognito_search@2x.png Binary files differ
diff --git a/ios/chrome/search_widget_extension/resources/quick_action_incognito_search@3x.png b/ios/chrome/search_widget_extension/resources/quick_action_incognito_search.imageset/quick_action_incognito_search@3x.png similarity index 100% rename from ios/chrome/search_widget_extension/resources/quick_action_incognito_search@3x.png rename to ios/chrome/search_widget_extension/resources/quick_action_incognito_search.imageset/quick_action_incognito_search@3x.png Binary files differ
diff --git a/ios/chrome/search_widget_extension/resources/quick_action_search.imageset/Contents.json b/ios/chrome/search_widget_extension/resources/quick_action_search.imageset/Contents.json new file mode 100644 index 0000000..51b8e27 --- /dev/null +++ b/ios/chrome/search_widget_extension/resources/quick_action_search.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "quick_action_search.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "quick_action_search@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "quick_action_search@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/search_widget_extension/resources/quick_action_search.png b/ios/chrome/search_widget_extension/resources/quick_action_search.imageset/quick_action_search.png similarity index 100% rename from ios/chrome/search_widget_extension/resources/quick_action_search.png rename to ios/chrome/search_widget_extension/resources/quick_action_search.imageset/quick_action_search.png Binary files differ
diff --git a/ios/chrome/search_widget_extension/resources/quick_action_search@2x.png b/ios/chrome/search_widget_extension/resources/quick_action_search.imageset/quick_action_search@2x.png similarity index 100% rename from ios/chrome/search_widget_extension/resources/quick_action_search@2x.png rename to ios/chrome/search_widget_extension/resources/quick_action_search.imageset/quick_action_search@2x.png Binary files differ
diff --git a/ios/chrome/search_widget_extension/resources/quick_action_search@3x.png b/ios/chrome/search_widget_extension/resources/quick_action_search.imageset/quick_action_search@3x.png similarity index 100% rename from ios/chrome/search_widget_extension/resources/quick_action_search@3x.png rename to ios/chrome/search_widget_extension/resources/quick_action_search.imageset/quick_action_search@3x.png Binary files differ
diff --git a/ios/chrome/search_widget_extension/resources/quick_action_voice_search.imageset/Contents.json b/ios/chrome/search_widget_extension/resources/quick_action_voice_search.imageset/Contents.json new file mode 100644 index 0000000..cce704b --- /dev/null +++ b/ios/chrome/search_widget_extension/resources/quick_action_voice_search.imageset/Contents.json
@@ -0,0 +1,23 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x", + "filename": "quick_action_voice_search.png" + }, + { + "idiom": "universal", + "scale": "2x", + "filename": "quick_action_voice_search@2x.png" + }, + { + "idiom": "universal", + "scale": "3x", + "filename": "quick_action_voice_search@3x.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +}
diff --git a/ios/chrome/search_widget_extension/resources/quick_action_voice_search.png b/ios/chrome/search_widget_extension/resources/quick_action_voice_search.imageset/quick_action_voice_search.png similarity index 100% rename from ios/chrome/search_widget_extension/resources/quick_action_voice_search.png rename to ios/chrome/search_widget_extension/resources/quick_action_voice_search.imageset/quick_action_voice_search.png Binary files differ
diff --git a/ios/chrome/search_widget_extension/resources/quick_action_voice_search@2x.png b/ios/chrome/search_widget_extension/resources/quick_action_voice_search.imageset/quick_action_voice_search@2x.png similarity index 100% rename from ios/chrome/search_widget_extension/resources/quick_action_voice_search@2x.png rename to ios/chrome/search_widget_extension/resources/quick_action_voice_search.imageset/quick_action_voice_search@2x.png Binary files differ
diff --git a/ios/chrome/search_widget_extension/resources/quick_action_voice_search@3x.png b/ios/chrome/search_widget_extension/resources/quick_action_voice_search.imageset/quick_action_voice_search@3x.png similarity index 100% rename from ios/chrome/search_widget_extension/resources/quick_action_voice_search@3x.png rename to ios/chrome/search_widget_extension/resources/quick_action_voice_search.imageset/quick_action_voice_search@3x.png Binary files differ
diff --git a/ios/chrome/search_widget_extension/search_action_view.h b/ios/chrome/search_widget_extension/search_action_view.h new file mode 100644 index 0000000..cb77483 --- /dev/null +++ b/ios/chrome/search_widget_extension/search_action_view.h
@@ -0,0 +1,31 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_SEARCH_WIDGET_EXTENSION_SEARCH_ACTION_VIEW_H_ +#define IOS_CHROME_SEARCH_WIDGET_EXTENSION_SEARCH_ACTION_VIEW_H_ + +#import <UIKit/UIKit.h> + +// View for an action to launch the app from the widget. Represented as a +// circular icon and a label. When tapped it calls |actionSelector| in |target|. +@interface SearchActionView : UIView + +// Designated initializer, creates the action view with a |target| and +// |selector| to act on. The |primaryVibrancyEffect| and +// |secondaryVibrancyEffect| are used to display view elements. The image with +// name |imageName| is shown in the circular icon. The |title| is shown beneath +// the icon. +- (instancetype)initWithActionTarget:(id)target + actionSelector:(SEL)actionSelector + primaryEffect:(UIVisualEffect*)primaryEffect + secondaryEffect:(UIVisualEffect*)secondaryEffect + title:(NSString*)title + imageName:(NSString*)imageName + NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; +- (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; + +@end + +#endif // IOS_CHROME_SEARCH_WIDGET_EXTENSION_SEARCH_ACTION_VIEW_H_
diff --git a/ios/chrome/search_widget_extension/search_action_view.mm b/ios/chrome/search_widget_extension/search_action_view.mm new file mode 100644 index 0000000..09754b11 --- /dev/null +++ b/ios/chrome/search_widget_extension/search_action_view.mm
@@ -0,0 +1,106 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/search_widget_extension/search_action_view.h" + +#include "base/ios/ios_util.h" +#import "ios/chrome/search_widget_extension/ui_util.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace { + +const CGFloat kActionButtonSize = 55; +const CGFloat kIconSize = 35; + +} // namespace + +@implementation SearchActionView + +- (instancetype)initWithActionTarget:(id)target + actionSelector:(SEL)actionSelector + primaryEffect:(UIVisualEffect*)primaryEffect + secondaryEffect:(UIVisualEffect*)secondaryEffect + title:(NSString*)title + imageName:(NSString*)imageName { + DCHECK(target); + self = [super initWithFrame:CGRectZero]; + if (self) { + self.translatesAutoresizingMaskIntoConstraints = NO; + + UIVisualEffectView* primaryEffectView = + [[UIVisualEffectView alloc] initWithEffect:primaryEffect]; + UIVisualEffectView* secondaryEffectView = + [[UIVisualEffectView alloc] initWithEffect:secondaryEffect]; + for (UIVisualEffectView* effectView in + @[ primaryEffectView, secondaryEffectView ]) { + [self addSubview:effectView]; + effectView.translatesAutoresizingMaskIntoConstraints = NO; + [NSLayoutConstraint + activateConstraints:ui_util::CreateSameConstraints(self, effectView)]; + } + + UIView* circleView = [[UIView alloc] initWithFrame:CGRectZero]; + circleView.backgroundColor = base::ios::IsRunningOnIOS10OrLater() + ? [UIColor colorWithWhite:0 alpha:0.05] + : [UIColor whiteColor]; + circleView.layer.cornerRadius = kActionButtonSize / 2; + + UILabel* labelView = [[UILabel alloc] initWithFrame:CGRectZero]; + labelView.text = title; + labelView.numberOfLines = 0; + labelView.textAlignment = NSTextAlignmentCenter; + labelView.font = [UIFont preferredFontForTextStyle:UIFontTextStyleFootnote]; + labelView.isAccessibilityElement = NO; + [labelView + setContentCompressionResistancePriority:UILayoutPriorityRequired + forAxis:UILayoutConstraintAxisVertical]; + + UIStackView* stack = [[UIStackView alloc] + initWithArrangedSubviews:@[ circleView, labelView ]]; + stack.axis = UILayoutConstraintAxisVertical; + stack.spacing = ui_util::kIconSpacing; + stack.alignment = UIStackViewAlignmentCenter; + stack.translatesAutoresizingMaskIntoConstraints = NO; + [secondaryEffectView.contentView addSubview:stack]; + [NSLayoutConstraint activateConstraints:ui_util::CreateSameConstraints( + secondaryEffectView, stack)]; + + // A transparent button constrained to the same size as the stack is added + // to handle taps on the stack view. + UIButton* actionButton = [[UIButton alloc] initWithFrame:CGRectZero]; + actionButton.backgroundColor = [UIColor clearColor]; + [actionButton addTarget:target + action:actionSelector + forControlEvents:UIControlEventTouchUpInside]; + actionButton.translatesAutoresizingMaskIntoConstraints = NO; + actionButton.accessibilityLabel = title; + [self addSubview:actionButton]; + [NSLayoutConstraint activateConstraints:ui_util::CreateSameConstraints( + actionButton, stack)]; + + UIImage* iconImage = [UIImage imageNamed:imageName]; + UIImageView* icon = [[UIImageView alloc] initWithImage:iconImage]; + icon.translatesAutoresizingMaskIntoConstraints = NO; + if (base::ios::IsRunningOnIOS10OrLater()) { + [primaryEffectView.contentView addSubview:icon]; + } else { + [self addSubview:icon]; + } + + [NSLayoutConstraint activateConstraints:@[ + [circleView.widthAnchor constraintEqualToConstant:kActionButtonSize], + [circleView.heightAnchor constraintEqualToConstant:kActionButtonSize], + [icon.widthAnchor constraintEqualToConstant:kIconSize], + [icon.heightAnchor constraintEqualToConstant:kIconSize], + [icon.centerXAnchor constraintEqualToAnchor:circleView.centerXAnchor], + [icon.centerYAnchor constraintEqualToAnchor:circleView.centerYAnchor], + ]]; + } + return self; +} + +@end
diff --git a/ios/chrome/search_widget_extension/search_widget_view.h b/ios/chrome/search_widget_extension/search_widget_view.h index 8bf8d2b..5efce7f 100644 --- a/ios/chrome/search_widget_extension/search_widget_view.h +++ b/ios/chrome/search_widget_extension/search_widget_view.h
@@ -24,25 +24,13 @@ @end -// View for the search widget. Shows two sections. The first section is a row of -// actions to launch the app represented as a circular icon and a label. When -// tapped, they call the callbacks in the SearchWidgetViewActionTarget protocol. -// The second section shows a button with the |copiedURLString| if it has been -// set. When tapped, the openCopiedURL callback in SearchWidgetViewActionTarget -// is called. If no |copiedURLString| was set, the button is replaced by a -// hairline separation and placeholder text. This section can be hidden with the -// |copiedURLVisible| variable. +// View for the search widget, shows two sections. The first section is a row of +// ways to launch the app. The second section displays the current copied URL. @interface SearchWidgetView : UIView -// Set this property to show/hide the copied URL section. -@property(nonatomic, assign) BOOL copiedURLVisible; - -// The copied URL string to be shown in the copied URL section. -@property(nonatomic, copy) NSString* copiedURLString; - // Designated initializer, creates the widget view with a |target| for user -// actions. The |primaryVibrancyEffect| and |secondaryVibrancyEffect| effects -// will be used to display view elements. +// actions. The |primaryVibrancyEffect| and |secondaryVibrancyEffect| are used +// to display view elements. - (instancetype)initWithActionTarget:(id<SearchWidgetViewActionTarget>)target primaryVibrancyEffect:(UIVibrancyEffect*)primaryVibrancyEffect secondaryVibrancyEffect:(UIVibrancyEffect*)secondaryVibrancyEffect @@ -50,6 +38,10 @@ - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; +// Sets the copied URL string to be displayed. nil is a valid value to indicate +// there is no copied URL to display. +- (void)setCopiedURLString:(NSString*)URL; + @end #endif // IOS_CHROME_SEARCH_WIDGET_EXTENSION_SEARCH_WIDGET_VIEW_H_
diff --git a/ios/chrome/search_widget_extension/search_widget_view.mm b/ios/chrome/search_widget_extension/search_widget_view.mm index a878bbd0..a491bb68 100644 --- a/ios/chrome/search_widget_extension/search_widget_view.mm +++ b/ios/chrome/search_widget_extension/search_widget_view.mm
@@ -5,6 +5,8 @@ #import "ios/chrome/search_widget_extension/search_widget_view.h" #include "base/ios/ios_util.h" #include "base/logging.h" +#import "ios/chrome/search_widget_extension/copied_url_view.h" +#import "ios/chrome/search_widget_extension/search_action_view.h" #import "ios/chrome/search_widget_extension/ui_util.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -13,39 +15,20 @@ namespace { -const CGFloat kContentMargin = 16; -const CGFloat kURLButtonMargin = 10; -const CGFloat kActionButtonSize = 55; -const CGFloat kIconSize = 35; const CGFloat kMaxContentSize = 421; -const CGFloat kIconSpacing = 5; } // namespace @interface SearchWidgetView () +// The copied URL section. Fits its contents. +@property(nonatomic, strong) CopiedURLView* copiedURLSection; // The target for actions in the view. @property(nonatomic, weak) id<SearchWidgetViewActionTarget> target; -// The copied URL label containing the URL or a placeholder text. -@property(nonatomic, strong) UILabel* copiedURLLabel; -// The copued URL title label containing the title of the copied URL button. -@property(nonatomic, strong) UILabel* openCopiedURLTitleLabel; -// The hairline view shown between the action and copied URL views. -@property(nonatomic, strong) UIView* hairlineView; -// The button shown when there is a copied URL to open. -@property(nonatomic, strong) UIButton* copiedButtonView; -// The primary effect view of the widget. Add views here for a more opaque -// appearance. -@property(nonatomic, strong) UIVisualEffectView* primaryEffectView; -// The secondary effect view of the widget. Add views here for a more -// transparent appearance. -@property(nonatomic, strong) UIVisualEffectView* secondaryEffectView; -// The constraints to be activated when the copiedURL section is visible. -@property(nonatomic, strong) - NSArray<NSLayoutConstraint*>* visibleCopiedURLConstraints; -// The constraints to be activated when the copiedURL section is hidden. -@property(nonatomic, strong) - NSArray<NSLayoutConstraint*>* hiddenCopiedURLConstraints; +// The primary effect of the widget. Use for a more opaque appearance. +@property(nonatomic, strong) UIVisualEffect* primaryEffect; +// The secondary effect of the widget. Use for a more transparent appearance. +@property(nonatomic, strong) UIVisualEffect* secondaryEffect; // Sets up the widget UI. - (void)createUI; @@ -53,24 +36,14 @@ // Creates the view for the action buttons. - (UIView*)newActionsView; -// Creates the view for the copiedURL section. -- (void)initializeOpenCopiedURLSectionUsingTopAnchor:(NSLayoutAnchor*)topAnchor; - @end @implementation SearchWidgetView @synthesize target = _target; -@synthesize copiedURLVisible = _copiedURLVisible; -@synthesize copiedURLString = _copiedURLString; -@synthesize copiedURLLabel = _copiedURLLabel; -@synthesize openCopiedURLTitleLabel = _openCopiedURLTitleLabel; -@synthesize hairlineView = _hairlineView; -@synthesize copiedButtonView = _copiedButtonView; -@synthesize primaryEffectView = _primaryEffectView; -@synthesize secondaryEffectView = _secondaryEffectView; -@synthesize visibleCopiedURLConstraints = _visibleCopiedURLConstraints; -@synthesize hiddenCopiedURLConstraints = _hiddenCopiedURLConstraints; +@synthesize primaryEffect = _primaryEffect; +@synthesize secondaryEffect = _secondaryEffect; +@synthesize copiedURLSection = _copiedURLSection; - (instancetype)initWithActionTarget:(id<SearchWidgetViewActionTarget>)target primaryVibrancyEffect:(UIVibrancyEffect*)primaryVibrancyEffect @@ -80,320 +53,105 @@ if (self) { DCHECK(target); _target = target; - _primaryEffectView = - [[UIVisualEffectView alloc] initWithEffect:primaryVibrancyEffect]; - _secondaryEffectView = - [[UIVisualEffectView alloc] initWithEffect:secondaryVibrancyEffect]; - _copiedURLVisible = YES; + _primaryEffect = primaryVibrancyEffect; + _secondaryEffect = secondaryVibrancyEffect; [self createUI]; - [self updateCopiedURLUI]; } return self; } -#pragma mark - property overrides - -- (void)setCopiedURLVisible:(BOOL)copiedURLVisible { - _copiedURLVisible = copiedURLVisible; - [self updateCopiedURLUI]; -} - -- (void)setCopiedURLString:(NSString*)copiedURL { - _copiedURLString = copiedURL; - [self updateCopiedURLUI]; -} - #pragma mark - UI creation - (void)createUI { - for (UIVisualEffectView* effectView in - @[ self.primaryEffectView, self.secondaryEffectView ]) { - [self addSubview:effectView]; - effectView.translatesAutoresizingMaskIntoConstraints = NO; - [NSLayoutConstraint - activateConstraints:ui_util::CreateSameConstraints(self, effectView)]; - } - UIView* actionsView = [self newActionsView]; - [self initializeOpenCopiedURLSectionUsingTopAnchor:actionsView.bottomAnchor]; + [self addSubview:actionsView]; + + _copiedURLSection = + [[CopiedURLView alloc] initWithActionTarget:self.target + actionSelector:@selector(openCopiedURL:) + primaryEffect:self.primaryEffect + secondaryEffect:self.secondaryEffect]; + [self addSubview:_copiedURLSection]; + + // These constraints stretch the action row to the full width of the widget. + // Their priority is < UILayoutPriorityRequired so that they can break when + // the view is larger than kMaxContentSize. + NSLayoutConstraint* actionsLeadingConstraint = + [actionsView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor]; + actionsLeadingConstraint.priority = UILayoutPriorityDefaultHigh; + + NSLayoutConstraint* actionsTrailingConstraint = + [actionsView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor]; + actionsTrailingConstraint.priority = UILayoutPriorityDefaultHigh; + + [NSLayoutConstraint activateConstraints:@[ + [actionsView.centerXAnchor constraintEqualToAnchor:self.centerXAnchor], + [actionsView.widthAnchor + constraintLessThanOrEqualToConstant:kMaxContentSize], + actionsLeadingConstraint, + actionsTrailingConstraint, + [actionsView.topAnchor constraintEqualToAnchor:self.topAnchor + constant:ui_util::kContentMargin], + [actionsView.bottomAnchor + constraintEqualToAnchor:_copiedURLSection.topAnchor], + [_copiedURLSection.leadingAnchor + constraintEqualToAnchor:self.leadingAnchor], + [_copiedURLSection.trailingAnchor + constraintEqualToAnchor:self.trailingAnchor], + [_copiedURLSection.bottomAnchor constraintEqualToAnchor:self.bottomAnchor], + ]]; } - (UIView*)newActionsView { - // The use of vibrancy effects requires that the icons and circular buttons be - // added to different parent views. This means that the constraints that - // position them cannot be activated until all of the buttons are added to the - // stack view that contains them, and that stack view itself is added to the - // view hierarchy. In order to manage this, |constraints| is passed into each - // invocation of the button creation method, so the constraints can be - // collected for activation once the view hierarchy is complete. - NSMutableArray<NSLayoutConstraint*>* constraints = [NSMutableArray array]; - UIStackView* actionRow = [[UIStackView alloc] initWithArrangedSubviews:@[ - [self newActionViewWithTitle:NSLocalizedString(@"IDS_IOS_NEW_SEARCH", - @"New Search") - imageName:@"quick_action_search" - actionSelector:@selector(openSearch:) - constraints:constraints], - [self newActionViewWithTitle:NSLocalizedString(@"IDS_IOS_INCOGNITO_SEARCH", - @"Incognito Search") - imageName:@"quick_action_incognito_search" - actionSelector:@selector(openIncognito:) - constraints:constraints], - [self newActionViewWithTitle:NSLocalizedString(@"IDS_IOS_VOICE_SEARCH", - @"Voice Search") - imageName:@"quick_action_voice_search" - actionSelector:@selector(openVoice:) - constraints:constraints], - [self newActionViewWithTitle:NSLocalizedString(@"IDS_IOS_SCAN_QR_CODE", - @"Scan QR Code") - imageName:@"quick_action_camera_search" - actionSelector:@selector(openQRCode:) - constraints:constraints], + [[SearchActionView alloc] + initWithActionTarget:self.target + actionSelector:@selector(openSearch:) + primaryEffect:self.primaryEffect + secondaryEffect:self.secondaryEffect + title:NSLocalizedString(@"IDS_IOS_NEW_SEARCH", + @"New Search") + imageName:@"quick_action_search"], + + [[SearchActionView alloc] + initWithActionTarget:self.target + actionSelector:@selector(openIncognito:) + primaryEffect:self.primaryEffect + secondaryEffect:self.secondaryEffect + title:NSLocalizedString(@"IDS_IOS_INCOGNITO_SEARCH", + @"Incognito Search") + imageName:@"quick_action_incognito_search"], + [[SearchActionView alloc] + initWithActionTarget:self.target + actionSelector:@selector(openVoice:) + primaryEffect:self.primaryEffect + secondaryEffect:self.secondaryEffect + title:NSLocalizedString(@"IDS_IOS_VOICE_SEARCH", + @"Voice Search") + imageName:@"quick_action_voice_search"], + [[SearchActionView alloc] + initWithActionTarget:self.target + actionSelector:@selector(openQRCode:) + primaryEffect:self.primaryEffect + secondaryEffect:self.secondaryEffect + title:NSLocalizedString(@"IDS_IOS_SCAN_QR_CODE", + @"Scan QR Code") + imageName:@"quick_action_camera_search"], ]]; actionRow.axis = UILayoutConstraintAxisHorizontal; actionRow.alignment = UIStackViewAlignmentTop; actionRow.distribution = UIStackViewDistributionFillEqually; - actionRow.spacing = kIconSpacing; + actionRow.spacing = ui_util::kIconSpacing; actionRow.layoutMargins = - UIEdgeInsetsMake(0, kContentMargin, 0, kContentMargin); + UIEdgeInsetsMake(0, ui_util::kContentMargin, 0, ui_util::kContentMargin); actionRow.layoutMarginsRelativeArrangement = YES; actionRow.translatesAutoresizingMaskIntoConstraints = NO; - - [self.secondaryEffectView.contentView addSubview:actionRow]; - - // These constraints stretch the action row to the full width of the widget. - // Their priority is < UILayoutPriorityRequired so that they can break when - // the view is larger than kMaxContentSize. - NSLayoutConstraint* actionsLeftConstraint = [actionRow.leftAnchor - constraintEqualToAnchor:self.secondaryEffectView.leftAnchor]; - actionsLeftConstraint.priority = UILayoutPriorityDefaultHigh; - - NSLayoutConstraint* actionsRightConstraint = [actionRow.rightAnchor - constraintEqualToAnchor:self.secondaryEffectView.rightAnchor]; - actionsRightConstraint.priority = UILayoutPriorityDefaultHigh; - - // This constraint sets the top alignment for the action row. Its priority is - // < UILayoutPriorityRequired so that it can break in favor of the - // centerYAnchor rule (on the next line) when the copiedURL section is hidden. - NSLayoutConstraint* actionsTopConstraint = [actionRow.topAnchor - constraintEqualToAnchor:self.secondaryEffectView.topAnchor - constant:kContentMargin]; - actionsTopConstraint.priority = UILayoutPriorityDefaultHigh; - - self.hiddenCopiedURLConstraints = @[ [actionRow.centerYAnchor - constraintEqualToAnchor:self.secondaryEffectView.centerYAnchor] ]; - - [constraints addObjectsFromArray:@[ - [actionRow.centerXAnchor - constraintEqualToAnchor:self.secondaryEffectView.centerXAnchor], - [actionRow.widthAnchor constraintLessThanOrEqualToConstant:kMaxContentSize], - actionsLeftConstraint, - actionsRightConstraint, - actionsTopConstraint, - ]]; - - [NSLayoutConstraint activateConstraints:constraints]; - return actionRow; } -- (UIView*)newActionViewWithTitle:(NSString*)title - imageName:(NSString*)imageName - actionSelector:(SEL)actionSelector - constraints: - (NSMutableArray<NSLayoutConstraint*>*)constraints { - UIView* circleView = [[UIView alloc] initWithFrame:CGRectZero]; - circleView.backgroundColor = base::ios::IsRunningOnIOS10OrLater() - ? [UIColor colorWithWhite:0 alpha:0.05] - : [UIColor whiteColor]; - circleView.layer.cornerRadius = kActionButtonSize / 2; - - [constraints addObjectsFromArray:@[ - [circleView.widthAnchor constraintEqualToConstant:kActionButtonSize], - [circleView.heightAnchor constraintEqualToConstant:kActionButtonSize] - ]]; - - UILabel* labelView = [[UILabel alloc] initWithFrame:CGRectZero]; - labelView.text = title; - labelView.numberOfLines = 0; - labelView.textAlignment = NSTextAlignmentCenter; - labelView.font = [UIFont preferredFontForTextStyle:UIFontTextStyleFootnote]; - labelView.isAccessibilityElement = NO; - [labelView - setContentCompressionResistancePriority:UILayoutPriorityRequired - forAxis:UILayoutConstraintAxisVertical]; - - UIStackView* stack = - [[UIStackView alloc] initWithArrangedSubviews:@[ circleView, labelView ]]; - stack.axis = UILayoutConstraintAxisVertical; - stack.spacing = kIconSpacing; - stack.alignment = UIStackViewAlignmentCenter; - stack.translatesAutoresizingMaskIntoConstraints = NO; - - // A transparent button constrained to the same size as the stack is added to - // handle taps on the stack view. - UIButton* actionButton = [[UIButton alloc] initWithFrame:CGRectZero]; - actionButton.backgroundColor = [UIColor clearColor]; - [actionButton addTarget:self.target - action:actionSelector - forControlEvents:UIControlEventTouchUpInside]; - actionButton.translatesAutoresizingMaskIntoConstraints = NO; - actionButton.accessibilityLabel = title; - [self addSubview:actionButton]; - [constraints - addObjectsFromArray:ui_util::CreateSameConstraints(actionButton, stack)]; - - UIImage* iconImage = [UIImage imageNamed:imageName]; - UIImageView* icon = [[UIImageView alloc] initWithImage:iconImage]; - icon.translatesAutoresizingMaskIntoConstraints = NO; - - [constraints addObjectsFromArray:@[ - [icon.widthAnchor constraintEqualToConstant:kIconSize], - [icon.heightAnchor constraintEqualToConstant:kIconSize], - [icon.centerXAnchor constraintEqualToAnchor:circleView.centerXAnchor], - [icon.centerYAnchor constraintEqualToAnchor:circleView.centerYAnchor], - ]]; - if (base::ios::IsRunningOnIOS10OrLater()) { - [self.primaryEffectView.contentView addSubview:icon]; - } else { - [self addSubview:icon]; - } - return stack; +- (void)setCopiedURLString:(NSString*)URL { + [self.copiedURLSection setCopiedURLString:URL]; } -- (void)initializeOpenCopiedURLSectionUsingTopAnchor: - (NSLayoutAnchor*)topAnchor { - self.hairlineView = [[UIView alloc] initWithFrame:CGRectZero]; - self.hairlineView.backgroundColor = - base::ios::IsRunningOnIOS10OrLater() - ? [UIColor colorWithWhite:0 alpha:0.05] - : [UIColor whiteColor]; - self.hairlineView.translatesAutoresizingMaskIntoConstraints = NO; - [self.secondaryEffectView.contentView addSubview:self.hairlineView]; - - self.copiedButtonView = [[UIButton alloc] initWithFrame:CGRectZero]; - self.copiedButtonView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.05]; - self.copiedButtonView.layer.cornerRadius = 5; - self.copiedButtonView.translatesAutoresizingMaskIntoConstraints = NO; - self.copiedButtonView.accessibilityLabel = - NSLocalizedString(@"IDS_IOS_OPEN_COPIED_LINK", nil); - [self.secondaryEffectView.contentView addSubview:self.copiedButtonView]; - [self.copiedButtonView addTarget:self.target - action:@selector(openCopiedURL:) - forControlEvents:UIControlEventTouchUpInside]; - - self.openCopiedURLTitleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; - self.openCopiedURLTitleLabel.textAlignment = NSTextAlignmentCenter; - self.openCopiedURLTitleLabel.translatesAutoresizingMaskIntoConstraints = NO; - self.openCopiedURLTitleLabel.font = - [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]; - [self.primaryEffectView.contentView addSubview:self.openCopiedURLTitleLabel]; - - self.copiedURLLabel = [[UILabel alloc] initWithFrame:CGRectZero]; - self.copiedURLLabel.textAlignment = NSTextAlignmentCenter; - self.copiedURLLabel.font = - [UIFont preferredFontForTextStyle:UIFontTextStyleFootnote]; - self.copiedURLLabel.translatesAutoresizingMaskIntoConstraints = NO; - [self.secondaryEffectView.contentView addSubview:self.copiedURLLabel]; - - self.visibleCopiedURLConstraints = @[ - [self.hairlineView.topAnchor constraintEqualToAnchor:topAnchor - constant:kContentMargin], - [self.hairlineView.leftAnchor - constraintEqualToAnchor:self.secondaryEffectView.leftAnchor], - [self.hairlineView.rightAnchor - constraintEqualToAnchor:self.secondaryEffectView.rightAnchor], - [self.hairlineView.heightAnchor constraintEqualToConstant:0.5], - - [self.copiedButtonView.centerXAnchor - constraintEqualToAnchor:self.secondaryEffectView.centerXAnchor], - [self.copiedButtonView.widthAnchor - constraintEqualToAnchor:self.secondaryEffectView.widthAnchor - constant:-2 * kContentMargin], - [self.copiedButtonView.topAnchor - constraintEqualToAnchor:self.hairlineView.bottomAnchor - constant:12], - [self.copiedButtonView.bottomAnchor - constraintEqualToAnchor:self.secondaryEffectView.bottomAnchor - constant:-kContentMargin], - - [self.openCopiedURLTitleLabel.centerXAnchor - constraintEqualToAnchor:self.primaryEffectView.centerXAnchor], - [self.openCopiedURLTitleLabel.topAnchor - constraintEqualToAnchor:self.copiedButtonView.topAnchor - constant:kURLButtonMargin], - [self.openCopiedURLTitleLabel.widthAnchor - constraintEqualToAnchor:self.copiedButtonView.widthAnchor - constant:-kContentMargin * 2], - - [self.copiedURLLabel.centerXAnchor - constraintEqualToAnchor:self.primaryEffectView.centerXAnchor], - [self.copiedURLLabel.topAnchor - constraintEqualToAnchor:self.openCopiedURLTitleLabel.bottomAnchor], - [self.copiedURLLabel.widthAnchor - constraintEqualToAnchor:self.openCopiedURLTitleLabel.widthAnchor], - [self.copiedURLLabel.bottomAnchor - constraintEqualToAnchor:self.copiedButtonView.bottomAnchor - constant:-kURLButtonMargin], - ]; -} - -- (void)addTapAction:(SEL)action toView:(UIView*)view { - UIGestureRecognizer* tapRecognizer = - [[UITapGestureRecognizer alloc] initWithTarget:self.target action:action]; - [view addGestureRecognizer:tapRecognizer]; -} - -- (void)updateCopiedURLUI { - // If the copiedURL section is not visible, hide all the copiedURL section - // views and activate the correct constraint set. If it is visible, show the - // views in function of whether there is or not a copied URL to show. - - if (!self.copiedURLVisible) { - self.copiedURLLabel.hidden = YES; - self.openCopiedURLTitleLabel.hidden = YES; - self.hairlineView.hidden = YES; - self.copiedButtonView.hidden = YES; - [NSLayoutConstraint deactivateConstraints:self.visibleCopiedURLConstraints]; - [NSLayoutConstraint activateConstraints:self.hiddenCopiedURLConstraints]; - return; - } - - self.copiedURLLabel.hidden = NO; - self.openCopiedURLTitleLabel.hidden = NO; - - [NSLayoutConstraint deactivateConstraints:self.hiddenCopiedURLConstraints]; - [NSLayoutConstraint activateConstraints:self.visibleCopiedURLConstraints]; - - if (self.copiedURLString) { - self.copiedButtonView.hidden = NO; - self.hairlineView.hidden = YES; - self.copiedURLLabel.text = self.copiedURLString; - self.copiedURLLabel.accessibilityLabel = self.copiedURLString; - self.openCopiedURLTitleLabel.alpha = 1; - self.openCopiedURLTitleLabel.text = - NSLocalizedString(@"IDS_IOS_OPEN_COPIED_LINK", nil); - self.openCopiedURLTitleLabel.isAccessibilityElement = NO; - self.copiedURLLabel.alpha = 1; - return; - } - - self.copiedButtonView.hidden = YES; - self.hairlineView.hidden = NO; - self.copiedURLLabel.text = - NSLocalizedString(@"IDS_IOS_NO_COPIED_LINK_MESSAGE", nil); - self.copiedURLLabel.accessibilityLabel = - NSLocalizedString(@"IDS_IOS_NO_COPIED_LINK_MESSAGE", nil); - self.openCopiedURLTitleLabel.text = - NSLocalizedString(@"IDS_IOS_NO_COPIED_LINK_TITLE", nil); - self.openCopiedURLTitleLabel.accessibilityLabel = - NSLocalizedString(@"IDS_IOS_NO_COPIED_LINK_TITLE", nil); - self.openCopiedURLTitleLabel.isAccessibilityElement = YES; - - if (base::ios::IsRunningOnIOS10OrLater()) { - self.copiedURLLabel.alpha = 0.5; - self.openCopiedURLTitleLabel.alpha = 0.5; - } -} @end
diff --git a/ios/chrome/search_widget_extension/search_widget_view_controller.mm b/ios/chrome/search_widget_extension/search_widget_view_controller.mm index ec1a50c..7c29b80 100644 --- a/ios/chrome/search_widget_extension/search_widget_view_controller.mm +++ b/ios/chrome/search_widget_extension/search_widget_view_controller.mm
@@ -126,9 +126,6 @@ - (void)widgetActiveDisplayModeDidChange:(NCWidgetDisplayMode)activeDisplayMode withMaximumSize:(CGSize)maxSize { BOOL isVariableHeight = (activeDisplayMode == NCWidgetDisplayModeExpanded); - // Set the copied URL section here so that the fitting size is correctly - // calculated. - [self.widgetView setCopiedURLVisible:isVariableHeight]; // If the widget's height is not variable, the preferredContentSize is the // maxSize. Widgets cannot be shrunk, and this ensures the view will lay
diff --git a/ios/chrome/search_widget_extension/strings/ios_search_widget_extension_strings.grd b/ios/chrome/search_widget_extension/strings/ios_search_widget_extension_strings.grd index 75e171d3..501f9888 100644 --- a/ios/chrome/search_widget_extension/strings/ios_search_widget_extension_strings.grd +++ b/ios/chrome/search_widget_extension/strings/ios_search_widget_extension_strings.grd
@@ -140,7 +140,7 @@ Voice Search </message> <message name="IDS_IOS_SCAN_QR_CODE" desc="Label in the widget extension for the action to launch the app and open the qr code scanner. [Length: 30em]"> - Scan QR/Bar Code + Scan QR Code </message> <message name="IDS_IOS_NO_COPIED_LINK_TITLE" desc="Label in the widget extension for the title of the copied link section when there is no copied link."> No Copied Link
diff --git a/ios/chrome/search_widget_extension/ui_util.h b/ios/chrome/search_widget_extension/ui_util.h index d5ccf4e..9897552 100644 --- a/ios/chrome/search_widget_extension/ui_util.h +++ b/ios/chrome/search_widget_extension/ui_util.h
@@ -7,6 +7,12 @@ namespace ui_util { +// The spacing to use between action icons. +extern CGFloat const kIconSpacing; + +// The spacing between content and edges. +extern CGFloat const kContentMargin; + // Returns constraints to make two views' size and center equal by pinning // leading, trailing, top and bottom anchors. NSArray<NSLayoutConstraint*>* CreateSameConstraints(UIView* view1,
diff --git a/ios/chrome/search_widget_extension/ui_util.mm b/ios/chrome/search_widget_extension/ui_util.mm index 074f195..1b4dae7 100644 --- a/ios/chrome/search_widget_extension/ui_util.mm +++ b/ios/chrome/search_widget_extension/ui_util.mm
@@ -12,6 +12,9 @@ namespace ui_util { +CGFloat const kIconSpacing = 5; +CGFloat const kContentMargin = 12; + NSArray<NSLayoutConstraint*>* CreateSameConstraints(UIView* view1, UIView* view2) { return @[
diff --git a/ios/chrome/test/earl_grey/BUILD.gn b/ios/chrome/test/earl_grey/BUILD.gn index d497f3cd..07a9fd3 100644 --- a/ios/chrome/test/earl_grey/BUILD.gn +++ b/ios/chrome/test/earl_grey/BUILD.gn
@@ -46,6 +46,7 @@ chrome_ios_eg_test("ios_chrome_ui_egtests") { deps = [ "//ios/chrome/app/safe_mode:eg_tests", + "//ios/chrome/browser/content_suggestions:eg_tests", "//ios/chrome/browser/ui:eg_tests", "//ios/chrome/browser/ui/activity_services:eg_tests", "//ios/chrome/browser/ui/alert_coordinator:eg_tests",
diff --git a/ios/net/crn_http_protocol_handler.mm b/ios/net/crn_http_protocol_handler.mm index 372042b5..c1829b1 100644 --- a/ios/net/crn_http_protocol_handler.mm +++ b/ios/net/crn_http_protocol_handler.mm
@@ -13,6 +13,7 @@ #include "base/command_line.h" #include "base/logging.h" #include "base/mac/bind_objc_block.h" +#include "base/mac/foundation_util.h" #include "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/memory/ptr_util.h" @@ -50,12 +51,11 @@ namespace { -// Size of the buffer used to read the net::URLRequest. -const int kIOBufferSize = 64 * 1024; +// Minimum size of the buffer used to read the net::URLRequest. +const int kIOBufferMinSize = 64 * 1024; -// The maximum size of NSData that can be passed to the client 'didReceiveData' -// callback. This value must always be greater or equal to |kIOBufferSize|. -const int kClientMaxBufferSize = 4 * kIOBufferSize; +// Maximum size of the buffer used to read the net::URLRequest. +const int kIOBufferMaxSize = 16 * kIOBufferMinSize; // 1MB // Global instance of the HTTPProtocolHandlerDelegate. net::HTTPProtocolHandlerDelegate* g_protocol_handler_delegate = nullptr; @@ -189,12 +189,15 @@ void SSLErrorCallback(bool carryOn); void HostStateCallback(bool carryOn); void StartReading(); + void AllocateReadBuffer(int last_read_data_size); base::ThreadChecker thread_checker_; // The NSURLProtocol client. id<CRNNetworkClientProtocol> client_; - scoped_refptr<IOBuffer> buffer_; + std::unique_ptr<char, base::FreeDeleter> read_buffer_; + int read_buffer_size_; + scoped_refptr<WrappedIOBuffer> read_buffer_wrapper_; base::scoped_nsobject<NSMutableURLRequest> request_; // Stream delegate to read the HTTPBodyStream. base::scoped_nsobject<CRWHTTPStreamDelegate> stream_delegate_; @@ -212,7 +215,8 @@ HttpProtocolHandlerCore::HttpProtocolHandlerCore(NSURLRequest* request) : client_(nil), - buffer_(new IOBuffer(kIOBufferSize)), + read_buffer_size_(kIOBufferMinSize), + read_buffer_wrapper_(nullptr), net_request_(nullptr) { // The request will be accessed from another thread. It is safer to make a // copy to avoid conflicts. @@ -222,6 +226,8 @@ // shallowly copies the request, and just retains the non-threadsafe NSURL. thread_checker_.DetachFromThread(); request_.reset([request mutableCopy]); + // Will allocate read buffer with size |kIOBufferMinSize|. + AllocateReadBuffer(0); [request_ setURL:[NSURL URLWithString:[[request URL] absoluteString]]]; } @@ -251,14 +257,20 @@ tracker_->StartRequest(net_request_); break; case NSStreamEventHasBytesAvailable: { - NSUInteger length; - DCHECK([stream isKindOfClass:[NSInputStream class]]); - length = [(NSInputStream*)stream read:(unsigned char*)buffer_->data() - maxLength:kIOBufferSize]; - if (length) { - std::vector<char> owned_data(buffer_->data(), buffer_->data() + length); + NSInteger length; + // TODO(crbug.com/738025): Dynamically change the size of the read buffer + // to improve the read (POST) performance, see AllocateReadBuffer(), & + // avoid unnecessary data copy. + length = [base::mac::ObjCCastStrict<NSInputStream>(stream) + read:reinterpret_cast<unsigned char*>(read_buffer_.get()) + maxLength:read_buffer_size_]; + if (length > 0) { + std::vector<char> owned_data(read_buffer_.get(), + read_buffer_.get() + length); post_data_readers_.push_back( base::MakeUnique<UploadOwnedBytesElementReader>(&owned_data)); + } else if (length < 0) { // Error + StopRequestWithError(stream.streamError.code, ERR_FAILED); } break; } @@ -498,7 +510,8 @@ // using it and the object is not re-entrant. [client_ didReceiveResponse:response]; - int bytes_read = net_request_->Read(buffer_.get(), kIOBufferSize); + int bytes_read = + net_request_->Read(read_buffer_wrapper_.get(), read_buffer_size_); if (bytes_read == net::ERR_IO_PENDING) return; @@ -519,33 +532,25 @@ return; DCHECK_EQ(net_request_, request); - DCHECK_GE(kClientMaxBufferSize, kIOBufferSize); - // Read all we can from the socket and put it into data. - // TODO(droger): It may be possible to avoid some of the copies (using - // WrappedIOBuffer for example). + // Read data from the socket until no bytes left to read. uint64_t total_bytes_read = 0; while (bytes_read > 0) { - base::scoped_nsobject<NSMutableData> data( - [[NSMutableData alloc] initWithCapacity:bytes_read]); - // |bytes_read| should always be less or equal to |kClientMaxBufferSize|. - // This is ensured by the fact that the max read buffer size (i.e. - // |kIOBufferSize|) is always smaller or equal to |kClientMaxBufferSize|. - while (bytes_read > 0 && - [data length] + bytes_read <= kClientMaxBufferSize) { - total_bytes_read += bytes_read; - [data appendBytes:buffer_->data() length:bytes_read]; - bytes_read = request->Read(buffer_.get(), kIOBufferSize); - } + total_bytes_read += bytes_read; + // The NSData will take the ownership of |read_buffer_|. + NSData* data = + [NSData dataWithBytesNoCopy:read_buffer_.release() length:bytes_read]; + // If the data is not encoded in UTF8, the NSString is nil. + DVLOG(3) << "To client:" << std::endl + << base::SysNSStringToUTF8([[NSString alloc] + initWithData:data + encoding:NSUTF8StringEncoding]); + // Pass the read data to the client. + [client_ didLoadData:data]; - if ([data length] > 0) { - // If the data is not encoded in UTF8, the NSString is nil. - DVLOG(3) << "To client:" << std::endl - << base::SysNSStringToUTF8([[NSString alloc] - initWithData:data - encoding:NSUTF8StringEncoding]); - [client_ didLoadData:data]; - } + // Allocate a new buffer and continue reading from the socket. + AllocateReadBuffer(bytes_read); + bytes_read = request->Read(read_buffer_wrapper_.get(), read_buffer_size_); } if (tracker_) @@ -562,6 +567,22 @@ } } +void HttpProtocolHandlerCore::AllocateReadBuffer(int last_read_data_size) { + if (last_read_data_size == read_buffer_size_) { + // If the whole buffer was filled with data then increase the buffer size + // for the next read but don't exceed |kIOBufferMaxSize|. + read_buffer_size_ = std::min(read_buffer_size_ * 2, kIOBufferMaxSize); + } else if (read_buffer_size_ / 2 >= last_read_data_size) { + // If only a half or less of the buffer was filled with data then reduce + // the buffer size for the next read but not make it smaller than + // |kIOBufferMinSize|. + read_buffer_size_ = std::max(read_buffer_size_ / 2, kIOBufferMinSize); + } + read_buffer_.reset(static_cast<char*>(malloc(read_buffer_size_))); + read_buffer_wrapper_ = + new WrappedIOBuffer(static_cast<const char*>(read_buffer_.get())); +} + HttpProtocolHandlerCore::~HttpProtocolHandlerCore() { DCHECK(thread_checker_.CalledOnValidThread()); [client_ cancelAuthRequest];
diff --git a/ios/public/provider/chrome/browser/chrome_browser_provider.h b/ios/public/provider/chrome/browser/chrome_browser_provider.h index bd849e2..0407c6d 100644 --- a/ios/public/provider/chrome/browser/chrome_browser_provider.h +++ b/ios/public/provider/chrome/browser/chrome_browser_provider.h
@@ -14,6 +14,7 @@ #include <vector> #include "base/memory/ref_counted.h" +#include "base/observer_list.h" class AppDistributionProvider; class BrandedImageProvider; @@ -64,6 +65,23 @@ // ios_chrome_browser target. class ChromeBrowserProvider { public: + // Observer handling events related to the ChromeBrowserProvider. + class Observer { + public: + Observer() {} + virtual ~Observer() {} + + // Called when a new ChromeIdentityService has been changed. + virtual void OnChromeIdentityServiceDidChange( + ChromeIdentityService* new_service) {} + + // Called when the ChromeBrowserProvider will be destroyed. + virtual void OnChromeBrowserProviderWillBeDestroyed() {} + + private: + DISALLOW_COPY_AND_ASSIGN(Observer); + }; + // The constructor is called before web startup. ChromeBrowserProvider(); virtual ~ChromeBrowserProvider(); @@ -138,6 +156,17 @@ // Returns an instance of the spotlight provider. virtual SpotlightProvider* GetSpotlightProvider() const; + + // Adds and removes observers. + void AddObserver(Observer* observer); + void RemoveObserver(Observer* observer); + + protected: + // Fires |OnChromeIdentityServiceDidChange| on all observers. + void FireChromeIdentityServiceDidChange(ChromeIdentityService* new_service); + + private: + base::ObserverList<Observer, true> observer_list_; }; } // namespace ios
diff --git a/ios/public/provider/chrome/browser/chrome_browser_provider.mm b/ios/public/provider/chrome/browser/chrome_browser_provider.mm index eabcc7c..8f9a57c 100644 --- a/ios/public/provider/chrome/browser/chrome_browser_provider.mm +++ b/ios/public/provider/chrome/browser/chrome_browser_provider.mm
@@ -31,7 +31,10 @@ ChromeBrowserProvider::ChromeBrowserProvider() {} -ChromeBrowserProvider::~ChromeBrowserProvider() {} +ChromeBrowserProvider::~ChromeBrowserProvider() { + for (auto& observer : observer_list_) + observer.OnChromeBrowserProviderWillBeDestroyed(); +} void ChromeBrowserProvider::AppendSwitchesFromExperimentalSettings( NSUserDefaults* experimental_settings, @@ -118,4 +121,18 @@ void ChromeBrowserProvider::LogIfModalViewsArePresented() const {} +void ChromeBrowserProvider::AddObserver(Observer* observer) { + observer_list_.AddObserver(observer); +} + +void ChromeBrowserProvider::RemoveObserver(Observer* observer) { + observer_list_.RemoveObserver(observer); +} + +void ChromeBrowserProvider::FireChromeIdentityServiceDidChange( + ChromeIdentityService* new_service) { + for (auto& observer : observer_list_) + observer.OnChromeIdentityServiceDidChange(new_service); +} + } // namespace ios
diff --git a/ios/public/provider/chrome/browser/signin/chrome_identity_service.h b/ios/public/provider/chrome/browser/signin/chrome_identity_service.h index 17054c7f..7d1d0cd 100644 --- a/ios/public/provider/chrome/browser/signin/chrome_identity_service.h +++ b/ios/public/provider/chrome/browser/signin/chrome_identity_service.h
@@ -157,14 +157,14 @@ // Uses the default client id and client secret. virtual void GetAccessToken(ChromeIdentity* identity, const std::set<std::string>& scopes, - const AccessTokenCallback& callback); + AccessTokenCallback callback); // Asynchronously retrieves access tokens for the given identity and scopes. virtual void GetAccessToken(ChromeIdentity* identity, const std::string& client_id, const std::string& client_secret, const std::set<std::string>& scopes, - const AccessTokenCallback& callback); + AccessTokenCallback callback); // Fetches the profile avatar, from the cache or the network. // For high resolution iPads, returns large images (200 x 200) to avoid
diff --git a/ios/public/provider/chrome/browser/signin/chrome_identity_service.mm b/ios/public/provider/chrome/browser/signin/chrome_identity_service.mm index c2e347e..be02f63 100644 --- a/ios/public/provider/chrome/browser/signin/chrome_identity_service.mm +++ b/ios/public/provider/chrome/browser/signin/chrome_identity_service.mm
@@ -77,17 +77,15 @@ void ChromeIdentityService::ForgetIdentity(ChromeIdentity* identity, ForgetIdentityCallback callback) {} -void ChromeIdentityService::GetAccessToken( - ChromeIdentity* identity, - const std::set<std::string>& scopes, - const AccessTokenCallback& callback) {} +void ChromeIdentityService::GetAccessToken(ChromeIdentity* identity, + const std::set<std::string>& scopes, + AccessTokenCallback callback) {} -void ChromeIdentityService::GetAccessToken( - ChromeIdentity* identity, - const std::string& client_id, - const std::string& client_secret, - const std::set<std::string>& scopes, - const AccessTokenCallback& callback) {} +void ChromeIdentityService::GetAccessToken(ChromeIdentity* identity, + const std::string& client_id, + const std::string& client_secret, + const std::set<std::string>& scopes, + AccessTokenCallback callback) {} void ChromeIdentityService::GetAvatarForIdentity(ChromeIdentity* identity, GetAvatarCallback callback) {}
diff --git a/ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.h b/ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.h index 7f9e7c90..b9971fb 100644 --- a/ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.h +++ b/ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.h
@@ -41,12 +41,11 @@ void ForgetIdentity(ChromeIdentity* identity, ForgetIdentityCallback callback) override; - virtual void GetAccessToken( - ChromeIdentity* identity, - const std::string& client_id, - const std::string& client_secret, - const std::set<std::string>& scopes, - const ios::AccessTokenCallback& callback) override; + virtual void GetAccessToken(ChromeIdentity* identity, + const std::string& client_id, + const std::string& client_secret, + const std::set<std::string>& scopes, + ios::AccessTokenCallback callback) override; virtual void GetAvatarForIdentity(ChromeIdentity* identity, GetAvatarCallback callback) override;
diff --git a/ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.mm b/ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.mm index 52d10a8..6d7a522 100644 --- a/ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.mm +++ b/ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.mm
@@ -23,7 +23,7 @@ const std::string&, const std::string&, const std::set<std::string>&, - const ios::AccessTokenCallback& callback) { + ios::AccessTokenCallback callback) { base::mac::ScopedBlock<ios::AccessTokenCallback> safe_callback( [callback copy]); @@ -215,7 +215,7 @@ const std::string& client_id, const std::string& client_secret, const std::set<std::string>& scopes, - const ios::AccessTokenCallback& callback) { + ios::AccessTokenCallback callback) { FakeGetAccessToken(identity, client_id, client_secret, scopes, callback); }
diff --git a/ios/showcase/BUILD.gn b/ios/showcase/BUILD.gn index 2428b75..71212a2 100644 --- a/ios/showcase/BUILD.gn +++ b/ios/showcase/BUILD.gn
@@ -6,6 +6,7 @@ import("//ios/build/chrome_build.gni") import("//ios/build/config.gni") import("//ios/third_party/earl_grey/ios_eg_test.gni") +import("//tools/grit/repack.gni") ios_app_bundle("showcase") { info_plist = "core/Info.plist" @@ -47,11 +48,23 @@ ] } +repack("packed_resources") { + sources = [ + "$root_gen_dir/ios/web/ios_web_resources.pak", + ] + deps = [ + "//ios/web:resources", + ] + output = "$target_gen_dir/showcase_resources.pak" + copy_data_to_bundle = true +} + ios_eg_test("ios_showcase_egtests") { info_plist = "core/Info.plist" extra_substitutions = [ "IOS_BUNDLE_ID_PREFIX=$ios_app_bundle_id_prefix" ] deps = [ ":features", + ":packed_resources", "//ios/showcase/core:main", # Add all eg_tests targets below.
diff --git a/ios/showcase/DEPS b/ios/showcase/DEPS index e715de0..4bbbe3c 100644 --- a/ios/showcase/DEPS +++ b/ios/showcase/DEPS
@@ -4,5 +4,6 @@ "+ios/clean", "+ios/third_party/material_components_ios", "+ios/third_party/material_roboto_font_loader_ios", + "+ios/web/public", "+ui/base", ]
diff --git a/ios/showcase/content_suggestions/sc_content_suggestions_egtest.mm b/ios/showcase/content_suggestions/sc_content_suggestions_egtest.mm index 08a30c1..3953dba 100644 --- a/ios/showcase/content_suggestions/sc_content_suggestions_egtest.mm +++ b/ios/showcase/content_suggestions/sc_content_suggestions_egtest.mm
@@ -105,7 +105,7 @@ performAction:grey_swipeFastInDirection(kGREYDirectionLeft)]; [[EarlGrey - selectElementWithMatcher:grey_allOf(grey_text(@"dismissContextMenu"), + selectElementWithMatcher:grey_allOf(grey_text(@"dismissModals"), grey_sufficientlyVisible(), nil)] assertWithMatcher:grey_sufficientlyVisible()]; [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(
diff --git a/ios/showcase/core/BUILD.gn b/ios/showcase/core/BUILD.gn index cb5c9ca..8337512 100644 --- a/ios/showcase/core/BUILD.gn +++ b/ios/showcase/core/BUILD.gn
@@ -17,6 +17,11 @@ "//ios/showcase/common", "//ios/third_party/material_components_ios", "//ios/third_party/material_roboto_font_loader_ios", + + # TODO(crbug.com/738880): Showcase ideally shouldn't be an embedder of + # //ios/web. + "//ios/web", + "//ios/web/public/app", "//ui/base", ] libs = [ "UIKit.framework" ]
diff --git a/ios/showcase/core/app_delegate.mm b/ios/showcase/core/app_delegate.mm index 8b7e4ed..6b7b1d0 100644 --- a/ios/showcase/core/app_delegate.mm +++ b/ios/showcase/core/app_delegate.mm
@@ -5,10 +5,13 @@ #import "ios/showcase/core/app_delegate.h" #include "base/memory/ptr_util.h" +#include "base/path_service.h" #include "ios/chrome/app/startup/ios_chrome_main.h" #import "ios/showcase/core/showcase_model.h" #import "ios/showcase/core/showcase_view_controller.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" +#import "ios/web/public/app/web_main_parts.h" +#import "ios/web/public/web_client.h" #include "ui/base/resource/resource_bundle.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -18,6 +21,42 @@ @implementation AppDelegate @synthesize window = _window; +namespace { + +class ShowcaseWebMainParts : public web::WebMainParts { + void PreMainMessageLoopStart() override { + ResourceBundle::InitSharedInstanceWithLocale( + std::string(), nullptr, ResourceBundle::LOAD_COMMON_RESOURCES); + + base::FilePath pak_path; + PathService::Get(base::DIR_MODULE, &pak_path); + ResourceBundle::GetSharedInstance().AddDataPackFromPath( + pak_path.AppendASCII("showcase_resources.pak"), ui::SCALE_FACTOR_100P); + } +}; + +class ShowcaseWebClient : public web::WebClient { + public: + ShowcaseWebClient() {} + ~ShowcaseWebClient() override {} + + // WebClient implementation. + std::unique_ptr<web::WebMainParts> CreateWebMainParts() override { + return base::MakeUnique<ShowcaseWebMainParts>(); + } + base::StringPiece GetDataResource( + int resource_id, + ui::ScaleFactor scale_factor) const override { + return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( + resource_id, scale_factor); + } + base::RefCountedMemory* GetDataResourceBytes(int resource_id) const override { + return ResourceBundle::GetSharedInstance().LoadDataResourceBytes( + resource_id); + } +}; +} + - (void)setupUI { ShowcaseViewController* viewController = [[ShowcaseViewController alloc] initWithRows:[AppDelegate rowsToDisplay]]; @@ -30,9 +69,12 @@ - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { + // TODO(crbug.com/738880): Showcase ideally shouldn't be an embedder of + // //ios/web, in which case it wouldn't have to do this. This almost + // certainly means not creating IOSChromeMain. + web::SetWebClient(new ShowcaseWebClient()); base::MakeUnique<IOSChromeMain>(); - ResourceBundle::InitSharedInstanceWithLocale( - std::string(), nullptr, ResourceBundle::LOAD_COMMON_RESOURCES); + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; [self setupUI]; [self.window makeKeyAndVisible];
diff --git a/ios/web/BUILD.gn b/ios/web/BUILD.gn index aca28f68..70e428c 100644 --- a/ios/web/BUILD.gn +++ b/ios/web/BUILD.gn
@@ -4,6 +4,7 @@ import("//ios/build/config.gni") import("//ios/web/js_compile.gni") +import("//mojo/public/tools/bindings/mojom.gni") import("//testing/test.gni") import("//tools/grit/grit_rule.gni") @@ -17,6 +18,7 @@ source_set("web_arc") { public_deps = [ + ":service_names", "//net", ] @@ -33,7 +35,12 @@ "//ios/third_party/blink:html_tokenizer", "//mojo/public/cpp/system", "//mojo/public/js", + "//services/catalog/public/cpp", + "//services/service_manager", + "//services/service_manager/embedder", "//services/service_manager/public/cpp", + "//services/service_manager/runner/common", + "//services/service_manager/runner/host:lib", "//ui/base", "//ui/gfx", "//ui/gfx/geometry", @@ -67,6 +74,7 @@ "navigation/navigation_item_storage_builder.mm", "navigation/navigation_manager_delegate.h", "navigation/navigation_manager_impl.h", + "navigation/navigation_manager_impl.mm", "navigation/navigation_manager_util.h", "navigation/navigation_manager_util.mm", "navigation/nscoder_util.h", @@ -77,6 +85,8 @@ "navigation/session_storage_builder.mm", "navigation/time_smoother.cc", "navigation/time_smoother.h", + "navigation/wk_based_navigation_manager_impl.h", + "navigation/wk_based_navigation_manager_impl.mm", "net/cert_host_pair.cc", "net/cert_host_pair.h", "net/cert_policy.cc", @@ -132,6 +142,7 @@ "public/referrer_util.h", "public/security_style.h", "public/serializable_user_data_manager.h", + "public/service_manager_connection.h", "public/ssl_status.cc", "public/ssl_status.h", "public/url_data_source_ios.h", @@ -183,6 +194,10 @@ "public/webui/web_ui_ios_controller_factory.h", "public/webui/web_ui_ios_message_handler.cc", "public/webui/web_ui_ios_message_handler.h", + "service_manager_connection_impl.cc", + "service_manager_connection_impl.h", + "service_manager_context.h", + "service_manager_context.mm", "url_scheme_util.mm", "url_util.cc", "web_kit_constants.cc", @@ -220,6 +235,7 @@ "web_state/ui/crw_swipe_recognizer_provider.h", "web_state/ui/crw_touch_tracking_recognizer.h", "web_state/ui/crw_touch_tracking_recognizer.mm", + "web_state/ui/crw_web_view_navigation_proxy.h", "web_state/ui/crw_web_view_proxy_impl.h", "web_state/ui/crw_web_view_proxy_impl.mm", "web_state/ui/crw_web_view_scroll_view_proxy.mm", @@ -258,6 +274,12 @@ configs += [ "//build/config/compiler:enable_arc" ] } +mojom("service_names") { + sources = [ + "public/service_names.mojom", + ] +} + source_set("web") { deps = [ ":core", @@ -463,6 +485,7 @@ "browser_state_unittest.cc", "history_state_util_unittest.mm", "payments/payment_request_unittest.cc", + "service_manager_connection_impl_unittest.cc", "test/web_test_unittest.mm", "url_scheme_util_unittest.mm", "url_util_unittest.cc", @@ -876,6 +899,8 @@ "root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir), ] deps = [ + "//ios/web/public/app:browser_manifest", + "//ios/web/public/app:packaged_services_manifest", "//mojo/public/js:new_bindings", ] }
diff --git a/ios/web/DEPS b/ios/web/DEPS index 0729576..a35a71d1 100644 --- a/ios/web/DEPS +++ b/ios/web/DEPS
@@ -5,7 +5,8 @@ "+ios/web", "+mojo/public", "+net", - "+services/service_manager/public", + "+services/catalog", + "+services/service_manager", "+ui", # For tests.
diff --git a/ios/web/app/BUILD.gn b/ios/web/app/BUILD.gn index 962b7b2e..801f351 100644 --- a/ios/web/app/BUILD.gn +++ b/ios/web/app/BUILD.gn
@@ -19,6 +19,7 @@ "//base:i18n", "//crypto", "//ios/web", + "//mojo/edk/system", "//net", "//ui/base", "//ui/gfx",
diff --git a/ios/web/app/web_main_loop.h b/ios/web/app/web_main_loop.h index 6e0f8ff..739bcd7 100644 --- a/ios/web/app/web_main_loop.h +++ b/ios/web/app/web_main_loop.h
@@ -22,6 +22,7 @@ namespace web { class CookieNotificationBridge; +class ServiceManagerContext; class WebMainParts; class WebThreadImpl; @@ -89,6 +90,7 @@ // Members initialized in |WebThreadsStarted()| -------------------------- std::unique_ptr<CookieNotificationBridge> cookie_notification_bridge_; + std::unique_ptr<ServiceManagerContext> service_manager_context_; DISALLOW_COPY_AND_ASSIGN(WebMainLoop); };
diff --git a/ios/web/app/web_main_loop.mm b/ios/web/app/web_main_loop.mm index 0aca587..eaa0ee0 100644 --- a/ios/web/app/web_main_loop.mm +++ b/ios/web/app/web_main_loop.mm
@@ -26,6 +26,7 @@ #import "ios/web/net/cookie_notification_bridge.h" #include "ios/web/public/app/web_main_parts.h" #import "ios/web/public/web_client.h" +#include "ios/web/service_manager_context.h" #include "ios/web/web_thread_impl.h" #include "ios/web/webui/url_data_manager_ios.h" #include "net/base/network_change_notifier.h" @@ -249,6 +250,8 @@ parts_->PostMainMessageLoopRun(); } + service_manager_context_.reset(); + // Must be size_t so we can subtract from it. for (size_t thread_id = WebThread::ID_COUNT - 1; thread_id >= (WebThread::UI + 1); --thread_id) { @@ -315,6 +318,7 @@ int WebMainLoop::WebThreadsStarted() { cookie_notification_bridge_.reset(new CookieNotificationBridge); + service_manager_context_ = base::MakeUnique<ServiceManagerContext>(); return result_code_; }
diff --git a/ios/web/app/web_main_runner.mm b/ios/web/app/web_main_runner.mm index 9217f78..53849ff 100644 --- a/ios/web/app/web_main_runner.mm +++ b/ios/web/app/web_main_runner.mm
@@ -13,6 +13,7 @@ #include "ios/web/app/web_main_loop.h" #include "ios/web/public/url_schemes.h" #import "ios/web/public/web_client.h" +#include "mojo/edk/embedder/embedder.h" #include "ui/base/ui_base_paths.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -52,6 +53,8 @@ } completed_basic_startup_ = true; + mojo::edk::Init(); + // TODO(rohitrao): Should we instead require that all embedders call // SetWebClient()? if (!GetWebClient())
diff --git a/ios/web/ios_web_resources.grd b/ios/web/ios_web_resources.grd index 56f8ca4..c4e8df1 100644 --- a/ios/web/ios_web_resources.grd +++ b/ios/web/ios_web_resources.grd
@@ -10,6 +10,9 @@ <release seq="1"> <includes> <include name="IDR_IOS_MOJO_BINDINGS_JS" file="${root_gen_dir}/mojo/public/js/mojo_bindings.js" flattenhtml="true" type="BINDATA" use_base_dir="false" /> + <include name="IDR_MOJO_CATALOG_MANIFEST" file="../../services/catalog/manifest.json" type="BINDATA" /> + <include name="IDR_MOJO_WEB_BROWSER_MANIFEST" file="${root_gen_dir}/ios/web/public/app/browser_manifest.json" use_base_dir="false" type="BINDATA" /> + <include name="IDR_MOJO_WEB_PACKAGED_SERVICES_MANIFEST" file="${root_gen_dir}/ios/web/public/app/packaged_services_manifest.json" use_base_dir="false" type="BINDATA" /> </includes> </release> </grit>
diff --git a/ios/web/navigation/legacy_navigation_manager_impl.mm b/ios/web/navigation/legacy_navigation_manager_impl.mm index ad44adc..10dd8005 100644 --- a/ios/web/navigation/legacy_navigation_manager_impl.mm +++ b/ios/web/navigation/legacy_navigation_manager_impl.mm
@@ -25,52 +25,8 @@ #error "This file requires ARC support." #endif -namespace { - -// Checks whether or not two URL are an in-page navigation (differing only -// in the fragment). -bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) { - if (existing_url == new_url || !new_url.has_ref()) - return false; - - return existing_url.EqualsIgnoringRef(new_url); -} - -} // anonymous namespace - namespace web { -NavigationManager::WebLoadParams::WebLoadParams(const GURL& url) - : url(url), - transition_type(ui::PAGE_TRANSITION_LINK), - user_agent_override_option(UserAgentOverrideOption::INHERIT), - is_renderer_initiated(false), - post_data(nil) {} - -NavigationManager::WebLoadParams::~WebLoadParams() {} - -NavigationManager::WebLoadParams::WebLoadParams(const WebLoadParams& other) - : url(other.url), - referrer(other.referrer), - transition_type(other.transition_type), - user_agent_override_option(other.user_agent_override_option), - is_renderer_initiated(other.is_renderer_initiated), - extra_headers([other.extra_headers copy]), - post_data([other.post_data copy]) {} - -NavigationManager::WebLoadParams& NavigationManager::WebLoadParams::operator=( - const WebLoadParams& other) { - url = other.url; - referrer = other.referrer; - is_renderer_initiated = other.is_renderer_initiated; - transition_type = other.transition_type; - user_agent_override_option = other.user_agent_override_option; - extra_headers.reset([other.extra_headers copy]); - post_data.reset([other.post_data copy]); - - return *this; -} - LegacyNavigationManagerImpl::LegacyNavigationManagerImpl() : delegate_(nullptr), browser_state_(nullptr) {} @@ -125,8 +81,8 @@ if (details.previous_item_index >= 0) { DCHECK([session_controller_ previousItem]); details.previous_url = [session_controller_ previousItem]->GetURL(); - details.is_in_page = - AreURLsInPageNavigation(details.previous_url, details.item->GetURL()); + details.is_in_page = AreUrlsFragmentChangeNavigation( + details.previous_url, details.item->GetURL()); } else { details.previous_url = GURL(); details.is_in_page = NO;
diff --git a/ios/web/navigation/navigation_manager_delegate.h b/ios/web/navigation/navigation_manager_delegate.h index 90c7675..df68122 100644 --- a/ios/web/navigation/navigation_manager_delegate.h +++ b/ios/web/navigation/navigation_manager_delegate.h
@@ -9,6 +9,8 @@ #import "ios/web/public/navigation_manager.h" +@protocol CRWWebViewNavigationProxy; + namespace web { struct LoadCommittedDetails; @@ -42,6 +44,10 @@ // Returns the WebState associated with this delegate. virtual WebState* GetWebState() = 0; + + // Returns a CRWWebViewNavigationProxy protocol that can be used to access + // navigation related functions on the main WKWebView. + virtual id<CRWWebViewNavigationProxy> GetWebViewNavigationProxy() const = 0; }; } // namespace web
diff --git a/ios/web/navigation/navigation_manager_impl.h b/ios/web/navigation/navigation_manager_impl.h index 92f7fbb..31a5f3e 100644 --- a/ios/web/navigation/navigation_manager_impl.h +++ b/ios/web/navigation/navigation_manager_impl.h
@@ -132,11 +132,19 @@ // NavigationManagerImpl. friend SessionStorageBuilder; + // TODO(crbug.com/738020): Remove legacy code and merge + // WKBasedNavigationManager into this class after the navigation experiment. + // Identical to GetItemAtIndex() but returns the underlying NavigationItemImpl // instead of the public NavigationItem interface. This is used by // SessionStorageBuilder to persist session state. virtual NavigationItemImpl* GetNavigationItemImplAtIndex( size_t index) const = 0; + + // Checks whether or not two URL are an in-page navigation (differing only + // in the fragment). + static bool AreUrlsFragmentChangeNavigation(const GURL& existing_url, + const GURL& new_url); }; } // namespace web
diff --git a/ios/web/navigation/navigation_manager_impl.mm b/ios/web/navigation/navigation_manager_impl.mm new file mode 100644 index 0000000..612d49c --- /dev/null +++ b/ios/web/navigation/navigation_manager_impl.mm
@@ -0,0 +1,56 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/web/navigation/navigation_manager_impl.h" + +#include "ui/base/page_transition_types.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace web { + +NavigationManager::WebLoadParams::WebLoadParams(const GURL& url) + : url(url), + transition_type(ui::PAGE_TRANSITION_LINK), + user_agent_override_option(UserAgentOverrideOption::INHERIT), + is_renderer_initiated(false), + post_data(nil) {} + +NavigationManager::WebLoadParams::~WebLoadParams() {} + +NavigationManager::WebLoadParams::WebLoadParams(const WebLoadParams& other) + : url(other.url), + referrer(other.referrer), + transition_type(other.transition_type), + user_agent_override_option(other.user_agent_override_option), + is_renderer_initiated(other.is_renderer_initiated), + extra_headers([other.extra_headers copy]), + post_data([other.post_data copy]) {} + +NavigationManager::WebLoadParams& NavigationManager::WebLoadParams::operator=( + const WebLoadParams& other) { + url = other.url; + referrer = other.referrer; + is_renderer_initiated = other.is_renderer_initiated; + transition_type = other.transition_type; + user_agent_override_option = other.user_agent_override_option; + extra_headers.reset([other.extra_headers copy]); + post_data.reset([other.post_data copy]); + + return *this; +} + +/* static */ +bool NavigationManagerImpl::AreUrlsFragmentChangeNavigation( + const GURL& existing_url, + const GURL& new_url) { + if (existing_url == new_url || !new_url.has_ref()) + return false; + + return existing_url.EqualsIgnoringRef(new_url); +} + +} // namespace web
diff --git a/ios/web/navigation/navigation_manager_impl_unittest.mm b/ios/web/navigation/navigation_manager_impl_unittest.mm index 91b4491c..1081fb4 100644 --- a/ios/web/navigation/navigation_manager_impl_unittest.mm +++ b/ios/web/navigation/navigation_manager_impl_unittest.mm
@@ -9,9 +9,11 @@ #import "ios/web/navigation/crw_session_controller+private_constructors.h" #import "ios/web/navigation/legacy_navigation_manager_impl.h" #import "ios/web/navigation/navigation_manager_delegate.h" +#import "ios/web/navigation/wk_based_navigation_manager_impl.h" #include "ios/web/public/navigation_item.h" #include "ios/web/public/test/fakes/test_browser_state.h" #include "ios/web/test/test_url_constants.h" +#import "ios/web/web_state/ui/crw_web_view_navigation_proxy.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" #include "url/scheme_host_port.h" @@ -42,34 +44,53 @@ class TestNavigationManagerDelegate : public NavigationManagerDelegate { public: bool reload_called() { return reload_called_; } + void SetSessionController(CRWSessionController* session_controller) { + session_controller_ = session_controller; + } private: // NavigationManagerDelegate overrides. - void GoToIndex(int index) override {} + void GoToIndex(int index) override { + [session_controller_ goToItemAtIndex:index discardNonCommittedItems:NO]; + } void LoadURLWithParams(const NavigationManager::WebLoadParams&) override {} void Reload() override { reload_called_ = true; } void OnNavigationItemsPruned(size_t pruned_item_count) override {} void OnNavigationItemChanged() override {} void OnNavigationItemCommitted(const LoadCommittedDetails&) override {} WebState* GetWebState() override { return nullptr; } + id<CRWWebViewNavigationProxy> GetWebViewNavigationProxy() const override { + return nil; + } bool reload_called_ = false; + CRWSessionController* session_controller_; }; } // namespace +// NavigationManagerTest is parameterized on this enum to test both the legacy +// implementation of navigation manager and the experimental implementation. +enum NavigationManagerChoice { + TEST_LEGACY_NAVIGATION_MANAGER, + TEST_WK_BASED_NAVIGATION_MANAGER, +}; + // Programmatic test fixture for NavigationManagerImpl testing. // GetParam() chooses whether to run tests on LegacyNavigationManagerImpl or -// (the soon-to-be-implemented) WKBasedNavigationManagerImpl. +// WKBasedNavigationManagerImpl. // TODO(crbug.com/734150): cleanup the LegacyNavigationManagerImpl use case. -class NavigationManagerTest : public PlatformTest, - public ::testing::WithParamInterface<bool> { +class NavigationManagerTest + : public PlatformTest, + public ::testing::WithParamInterface<NavigationManagerChoice> { protected: NavigationManagerTest() { - bool test_legacy_navigation_manager = GetParam(); - if (test_legacy_navigation_manager) { + if (GetParam() == TEST_LEGACY_NAVIGATION_MANAGER) { manager_.reset(new LegacyNavigationManagerImpl); + controller_ = + [[CRWSessionController alloc] initWithBrowserState:&browser_state_]; + delegate_.SetSessionController(session_controller()); } else { - DCHECK(false) << "Not implemented."; + manager_.reset(new WKBasedNavigationManagerImpl); } // Setup rewriter. BrowserURLRewriter::GetInstance()->AddURLRewriter(UrlRewriter); @@ -77,8 +98,6 @@ manager_->SetDelegate(&delegate_); manager_->SetBrowserState(&browser_state_); - controller_ = - [[CRWSessionController alloc] initWithBrowserState:&browser_state_]; manager_->SetSessionController(controller_); } CRWSessionController* session_controller() { return controller_; } @@ -99,7 +118,6 @@ TEST_P(NavigationManagerTest, EmptyManager) { EXPECT_EQ(0, navigation_manager()->GetItemCount()); EXPECT_EQ(-1, navigation_manager()->GetLastCommittedItemIndex()); - EXPECT_EQ(-1, navigation_manager()->GetLastCommittedItemIndex()); EXPECT_FALSE(navigation_manager()->GetPendingItem()); EXPECT_EQ(-1, navigation_manager()->GetPendingItemIndex()); EXPECT_EQ(-1, navigation_manager()->GetIndexForOffset(0)); @@ -112,7 +130,7 @@ GURL("http://www.url.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); EXPECT_EQ(-1, navigation_manager()->GetPendingItemIndex()); } @@ -123,7 +141,7 @@ GURL("http://www.url.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->AddPendingItem( GURL("http://www.url.com/0"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, @@ -138,15 +156,17 @@ GURL("http://www.url.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->AddPendingItem( GURL("http://www.url.com/0"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); EXPECT_EQ(-1, navigation_manager()->GetPendingItemIndex()); - [session_controller() setPendingItemIndex:0]; + if (GetParam() == TEST_LEGACY_NAVIGATION_MANAGER) { + [session_controller() setPendingItemIndex:0]; + } EXPECT_EQ(0, navigation_manager()->GetPendingItemIndex()); } @@ -160,7 +180,11 @@ // Tests that going back or negative offset is not possible if there is a // transient item, but not committed items. TEST_P(NavigationManagerTest, CanGoBackWithTransientItem) { - [session_controller() addTransientItemWithURL:GURL("http://www.url.com")]; + navigation_manager()->AddPendingItem( + GURL("http://www.url.com/0"), Referrer(), ui::PAGE_TRANSITION_TYPED, + web::NavigationInitiationType::USER_INITIATED, + web::NavigationManager::UserAgentOverrideOption::INHERIT); + navigation_manager()->AddTransientItem(GURL("http://www.url.com")); EXPECT_FALSE(navigation_manager()->CanGoBack()); EXPECT_FALSE(navigation_manager()->CanGoToOffset(-1)); @@ -173,8 +197,8 @@ GURL("http://www.url.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; - [session_controller() addTransientItemWithURL:GURL("http://www.url.com/0")]; + navigation_manager()->CommitPendingItem(); + navigation_manager()->AddTransientItem(GURL("http://www.url.com/0")); EXPECT_TRUE(navigation_manager()->CanGoBack()); EXPECT_TRUE(navigation_manager()->CanGoToOffset(-1)); @@ -187,7 +211,7 @@ GURL("http://www.url.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); EXPECT_FALSE(navigation_manager()->CanGoBack()); EXPECT_FALSE(navigation_manager()->CanGoToOffset(-1)); @@ -199,30 +223,30 @@ GURL("http://www.url.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->AddPendingItem( GURL("http://www.url.com/0"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->AddPendingItem( GURL("http://www.url.com/1"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); EXPECT_TRUE(navigation_manager()->CanGoBack()); EXPECT_TRUE(navigation_manager()->CanGoToOffset(-1)); - [session_controller() goToItemAtIndex:1 discardNonCommittedItems:NO]; + navigation_manager()->GoToIndex(1); EXPECT_TRUE(navigation_manager()->CanGoBack()); EXPECT_TRUE(navigation_manager()->CanGoToOffset(-1)); - [session_controller() goToItemAtIndex:0 discardNonCommittedItems:NO]; + navigation_manager()->GoToIndex(0); EXPECT_FALSE(navigation_manager()->CanGoBack()); EXPECT_FALSE(navigation_manager()->CanGoToOffset(-1)); - [session_controller() goToItemAtIndex:1 discardNonCommittedItems:NO]; + navigation_manager()->GoToIndex(1); EXPECT_TRUE(navigation_manager()->CanGoBack()); EXPECT_TRUE(navigation_manager()->CanGoToOffset(-1)); } @@ -241,7 +265,7 @@ GURL("http://www.url.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); EXPECT_FALSE(navigation_manager()->CanGoForward()); EXPECT_FALSE(navigation_manager()->CanGoToOffset(1)); @@ -253,34 +277,34 @@ GURL("http://www.url.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->AddPendingItem( GURL("http://www.url.com/0"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->AddPendingItem( GURL("http://www.url.com/1"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); EXPECT_FALSE(navigation_manager()->CanGoForward()); EXPECT_FALSE(navigation_manager()->CanGoToOffset(1)); - [session_controller() goToItemAtIndex:1 discardNonCommittedItems:NO]; + navigation_manager()->GoToIndex(1); EXPECT_TRUE(navigation_manager()->CanGoForward()); EXPECT_TRUE(navigation_manager()->CanGoToOffset(1)); - [session_controller() goToItemAtIndex:0 discardNonCommittedItems:NO]; + navigation_manager()->GoToIndex(0); EXPECT_TRUE(navigation_manager()->CanGoForward()); EXPECT_TRUE(navigation_manager()->CanGoToOffset(1)); - [session_controller() goToItemAtIndex:1 discardNonCommittedItems:NO]; + navigation_manager()->GoToIndex(1); EXPECT_TRUE(navigation_manager()->CanGoForward()); EXPECT_TRUE(navigation_manager()->CanGoToOffset(1)); - [session_controller() goToItemAtIndex:2 discardNonCommittedItems:NO]; + navigation_manager()->GoToIndex(2); EXPECT_FALSE(navigation_manager()->CanGoForward()); EXPECT_FALSE(navigation_manager()->CanGoToOffset(1)); } @@ -293,34 +317,34 @@ GURL("http://www.url.com/0"), Referrer(), ui::PAGE_TRANSITION_LINK, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->AddPendingItem( GURL("http://www.url.com/redirect"), Referrer(), ui::PAGE_TRANSITION_CLIENT_REDIRECT, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->AddPendingItem( GURL("http://www.url.com/1"), Referrer(), ui::PAGE_TRANSITION_LINK, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->AddPendingItem( GURL("http://www.url.com/2"), Referrer(), ui::PAGE_TRANSITION_LINK, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->AddPendingItem( GURL("http://www.url.com/redirect"), Referrer(), ui::PAGE_TRANSITION_CLIENT_REDIRECT, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); ASSERT_EQ(5, navigation_manager()->GetItemCount()); ASSERT_EQ(4, navigation_manager()->GetLastCommittedItemIndex()); // Go to entry at index 1 and test API from that state. - [session_controller() goToItemAtIndex:1 discardNonCommittedItems:NO]; + navigation_manager()->GoToIndex(1); ASSERT_EQ(1, navigation_manager()->GetLastCommittedItemIndex()); ASSERT_EQ(-1, navigation_manager()->GetPendingItemIndex()); EXPECT_FALSE(navigation_manager()->CanGoToOffset(-1)); @@ -344,7 +368,7 @@ EXPECT_EQ(1000000002, navigation_manager()->GetIndexForOffset(1000000000)); // Go to entry at index 2 and test API from that state. - [session_controller() goToItemAtIndex:2 discardNonCommittedItems:NO]; + navigation_manager()->GoToIndex(2); ASSERT_EQ(2, navigation_manager()->GetLastCommittedItemIndex()); ASSERT_EQ(-1, navigation_manager()->GetPendingItemIndex()); EXPECT_TRUE(navigation_manager()->CanGoToOffset(-1)); @@ -366,7 +390,7 @@ EXPECT_EQ(1000000003, navigation_manager()->GetIndexForOffset(1000000000)); // Go to entry at index 4 and test API from that state. - [session_controller() goToItemAtIndex:4 discardNonCommittedItems:NO]; + navigation_manager()->GoToIndex(4); ASSERT_EQ(4, navigation_manager()->GetLastCommittedItemIndex()); ASSERT_EQ(-1, navigation_manager()->GetPendingItemIndex()); EXPECT_TRUE(navigation_manager()->CanGoToOffset(-1)); @@ -388,7 +412,7 @@ EXPECT_EQ(1000000004, navigation_manager()->GetIndexForOffset(1000000000)); // Test with existing transient entry. - [session_controller() addTransientItemWithURL:GURL("http://www.url.com")]; + navigation_manager()->AddTransientItem(GURL("http://www.url.com")); ASSERT_EQ(5, navigation_manager()->GetItemCount()); ASSERT_EQ(4, navigation_manager()->GetLastCommittedItemIndex()); ASSERT_EQ(-1, navigation_manager()->GetPendingItemIndex()); @@ -413,10 +437,12 @@ EXPECT_EQ(1000000004, navigation_manager()->GetIndexForOffset(1000000000)); // Now test with pending item index. - [session_controller() discardNonCommittedItems]; + navigation_manager()->DiscardNonCommittedItems(); // Set pending index to 1 and test API from that state. - [session_controller() setPendingItemIndex:1]; + if (GetParam() == TEST_LEGACY_NAVIGATION_MANAGER) { + [session_controller() setPendingItemIndex:1]; + } ASSERT_EQ(4, navigation_manager()->GetLastCommittedItemIndex()); ASSERT_EQ(1, navigation_manager()->GetPendingItemIndex()); EXPECT_FALSE(navigation_manager()->CanGoToOffset(-1)); @@ -440,7 +466,9 @@ EXPECT_EQ(1000000002, navigation_manager()->GetIndexForOffset(1000000000)); // Set pending index to 2 and test API from that state. - [session_controller() setPendingItemIndex:2]; + if (GetParam() == TEST_LEGACY_NAVIGATION_MANAGER) { + [session_controller() setPendingItemIndex:2]; + } ASSERT_EQ(4, navigation_manager()->GetLastCommittedItemIndex()); ASSERT_EQ(2, navigation_manager()->GetPendingItemIndex()); EXPECT_TRUE(navigation_manager()->CanGoToOffset(-1)); @@ -462,8 +490,10 @@ EXPECT_EQ(1000000003, navigation_manager()->GetIndexForOffset(1000000000)); // Set pending index to 4 and committed entry to 1 and test. - [session_controller() goToItemAtIndex:1 discardNonCommittedItems:NO]; - [session_controller() setPendingItemIndex:4]; + navigation_manager()->GoToIndex(1); + if (GetParam() == TEST_LEGACY_NAVIGATION_MANAGER) { + [session_controller() setPendingItemIndex:4]; + } ASSERT_EQ(1, navigation_manager()->GetLastCommittedItemIndex()); ASSERT_EQ(4, navigation_manager()->GetPendingItemIndex()); EXPECT_TRUE(navigation_manager()->CanGoToOffset(-1)); @@ -485,9 +515,11 @@ EXPECT_EQ(1000000004, navigation_manager()->GetIndexForOffset(1000000000)); // Test with existing transient entry in the end of the stack. - [session_controller() goToItemAtIndex:4 discardNonCommittedItems:NO]; - [session_controller() setPendingItemIndex:-1]; - [session_controller() addTransientItemWithURL:GURL("http://www.url.com")]; + navigation_manager()->GoToIndex(4); + if (GetParam() == TEST_LEGACY_NAVIGATION_MANAGER) { + [session_controller() setPendingItemIndex:-1]; + } + navigation_manager()->AddTransientItem(GURL("http://www.url.com")); ASSERT_EQ(5, navigation_manager()->GetItemCount()); ASSERT_EQ(4, navigation_manager()->GetLastCommittedItemIndex()); ASSERT_EQ(-1, navigation_manager()->GetPendingItemIndex()); @@ -522,19 +554,21 @@ GURL("http://www.url.com/0"), Referrer(), ui::PAGE_TRANSITION_LINK, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->AddPendingItem( GURL("http://www.url.com/1"), Referrer(), ui::PAGE_TRANSITION_LINK, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->AddPendingItem( GURL("http://www.url.com/2"), Referrer(), ui::PAGE_TRANSITION_LINK, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; - [session_controller() addTransientItemWithURL:GURL("http://www.url.com/1")]; - [session_controller() setPendingItemIndex:1]; + navigation_manager()->CommitPendingItem(); + navigation_manager()->AddTransientItem(GURL("http://www.url.com/1")); + if (GetParam() == TEST_LEGACY_NAVIGATION_MANAGER) { + [session_controller() setPendingItemIndex:1]; + } ASSERT_EQ(3, navigation_manager()->GetItemCount()); ASSERT_EQ(2, navigation_manager()->GetLastCommittedItemIndex()); @@ -544,8 +578,10 @@ // Now go forward to that middle transient item (pending index is 1, // current index is 0). - [session_controller() goToItemAtIndex:0 discardNonCommittedItems:NO]; - [session_controller() setPendingItemIndex:1]; + navigation_manager()->GoToIndex(0); + if (GetParam() == TEST_LEGACY_NAVIGATION_MANAGER) { + [session_controller() setPendingItemIndex:1]; + } ASSERT_EQ(3, navigation_manager()->GetItemCount()); ASSERT_EQ(0, navigation_manager()->GetLastCommittedItemIndex()); ASSERT_EQ(1, navigation_manager()->GetPendingItemIndex()); @@ -718,7 +754,7 @@ existing_url, Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_EQ(existing_url, navigation_manager()->GetLastCommittedItem()->GetURL()); @@ -742,7 +778,7 @@ existing_url, Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_TRUE(ui::PageTransitionCoreTypeIs( navigation_manager()->GetLastCommittedItem()->GetTransitionType(), @@ -767,7 +803,7 @@ existing_url, Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_TRUE(ui::PageTransitionCoreTypeIs( navigation_manager()->GetLastCommittedItem()->GetTransitionType(), @@ -797,7 +833,7 @@ existing_url, Referrer(), ui::PAGE_TRANSITION_FORM_SUBMIT, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_FALSE(navigation_manager()->GetPendingItem()); EXPECT_EQ(1, navigation_manager()->GetItemCount()); @@ -818,7 +854,7 @@ existing_url, Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_TRUE(ui::PageTransitionCoreTypeIs( navigation_manager()->GetLastCommittedItem()->GetTransitionType(), @@ -841,7 +877,7 @@ existing_url, Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::MOBILE); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_TRUE(ui::PageTransitionCoreTypeIs( navigation_manager()->GetLastCommittedItem()->GetTransitionType(), @@ -870,7 +906,7 @@ existing_url, Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::DESKTOP); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_TRUE(ui::PageTransitionCoreTypeIs( navigation_manager()->GetLastCommittedItem()->GetTransitionType(), @@ -897,7 +933,7 @@ GURL("http://www.1.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::MOBILE); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); NavigationItem* last_committed_item = navigation_manager()->GetLastCommittedItem(); EXPECT_EQ(UserAgentType::MOBILE, last_committed_item->GetUserAgentType()); @@ -920,7 +956,7 @@ GURL("http://www.1.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); NavigationItem* last_committed_item = navigation_manager()->GetLastCommittedItem(); last_committed_item->SetUserAgentType(UserAgentType::DESKTOP); @@ -942,7 +978,7 @@ GURL("http://www.1.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_EQ(web::UserAgentType::MOBILE, navigation_manager()->GetLastCommittedItem()->GetUserAgentType()); @@ -951,7 +987,7 @@ GURL("http://www.2.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_EQ(web::UserAgentType::MOBILE, navigation_manager()->GetLastCommittedItem()->GetUserAgentType()); @@ -964,7 +1000,7 @@ GURL("http://www.1.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::MOBILE); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_EQ(web::UserAgentType::MOBILE, navigation_manager()->GetLastCommittedItem()->GetUserAgentType()); @@ -973,7 +1009,7 @@ GURL("http://www.2.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_EQ(web::UserAgentType::MOBILE, navigation_manager()->GetLastCommittedItem()->GetUserAgentType()); @@ -986,7 +1022,7 @@ GURL("http://www.1.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::DESKTOP); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_EQ(web::UserAgentType::DESKTOP, navigation_manager()->GetLastCommittedItem()->GetUserAgentType()); @@ -995,7 +1031,7 @@ GURL("http://www.2.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_EQ(web::UserAgentType::DESKTOP, navigation_manager()->GetLastCommittedItem()->GetUserAgentType()); @@ -1014,14 +1050,14 @@ GURL("http://www.1.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); web::NavigationItem* item1 = navigation_manager()->GetLastCommittedItem(); ASSERT_EQ(web::UserAgentType::MOBILE, item1->GetUserAgentType()); navigation_manager()->AddPendingItem( item1->GetURL().ReplaceComponents(native_scheme_replacement), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); web::NavigationItem* native_item1 = navigation_manager()->GetLastCommittedItem(); ASSERT_EQ(web::UserAgentType::NONE, native_item1->GetUserAgentType()); @@ -1029,7 +1065,7 @@ GURL("http://www.2.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); web::NavigationItem* item2 = navigation_manager()->GetLastCommittedItem(); // Verify that |item1|'s UserAgentType is propagated to |item2|. @@ -1043,7 +1079,7 @@ item2->GetURL().ReplaceComponents(native_scheme_replacement), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); web::NavigationItem* native_item2 = navigation_manager()->GetLastCommittedItem(); ASSERT_EQ(web::UserAgentType::NONE, native_item2->GetUserAgentType()); @@ -1051,7 +1087,7 @@ GURL("http://www.3.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); web::NavigationItem* item3 = navigation_manager()->GetLastCommittedItem(); // Verify that |item2|'s UserAgentType is propagated to |item3|. @@ -1155,14 +1191,14 @@ GURL("http://www.url.com/0"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); GURL url_before_reload = GURL("http://www.url.com/1"); navigation_manager()->AddPendingItem( url_before_reload, Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->Reload(web::ReloadType::NORMAL, false /* check_for_repost */); @@ -1182,22 +1218,22 @@ GURL("http://www.url.com/0"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); GURL url_before_reload = GURL("http://www.url.com/1"); navigation_manager()->AddPendingItem( url_before_reload, Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->AddPendingItem( GURL("http://www.url.com/2"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); - [session_controller() goToItemAtIndex:1 discardNonCommittedItems:NO]; + navigation_manager()->GoToIndex(1); EXPECT_EQ(1, navigation_manager()->GetLastCommittedItemIndex()); navigation_manager()->Reload(web::ReloadType::NORMAL, @@ -1277,7 +1313,7 @@ GURL("http://www.url.com/0"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->AddPendingItem( GURL("http://www.url.com/1"), Referrer(), ui::PAGE_TRANSITION_TYPED, @@ -1287,7 +1323,7 @@ ASSERT_TRUE(navigation_manager()->GetPendingItem()); navigation_manager()->GetPendingItem()->SetOriginalRequestURL( expected_original_url); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->Reload(web::ReloadType::ORIGINAL_REQUEST_URL, false /* check_for_repost */); @@ -1307,7 +1343,7 @@ GURL("http://www.url.com/0"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->AddPendingItem( GURL("http://www.url.com/1"), Referrer(), ui::PAGE_TRANSITION_TYPED, @@ -1317,15 +1353,15 @@ ASSERT_TRUE(navigation_manager()->GetPendingItem()); navigation_manager()->GetPendingItem()->SetOriginalRequestURL( expected_original_url); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); navigation_manager()->AddPendingItem( GURL("http://www.url.com/2"), Referrer(), ui::PAGE_TRANSITION_TYPED, web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); - [session_controller() goToItemAtIndex:1 discardNonCommittedItems:NO]; + navigation_manager()->GoToIndex(1); EXPECT_EQ(1, navigation_manager()->GetLastCommittedItemIndex()); navigation_manager()->Reload(web::ReloadType::ORIGINAL_REQUEST_URL, @@ -1349,7 +1385,7 @@ EXPECT_EQ(url1, navigation_manager()->GetPendingItem()->GetURL()); // URL should not be rewritten because last committed URL is not app-specific. - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); GURL url2(url::SchemeHostPort(kSchemeToRewrite, "test2", 0).Serialize()); navigation_manager()->AddPendingItem( url2, Referrer(), ui::PAGE_TRANSITION_LINK, @@ -1368,7 +1404,7 @@ EXPECT_EQ(rewritten_url3, navigation_manager()->GetPendingItem()->GetURL()); // URL should be rewritten because last committed URL is app-specific. - [session_controller() commitPendingItem]; + navigation_manager()->CommitPendingItem(); GURL url4(url::SchemeHostPort(kSchemeToRewrite, "test4", 0).Serialize()); navigation_manager()->AddPendingItem( url4, Referrer(), ui::PAGE_TRANSITION_LINK, @@ -1406,6 +1442,6 @@ INSTANTIATE_TEST_CASE_P( ProgrammaticNavigationManagerTest, NavigationManagerTest, - ::testing::Values(true /* test_legacy_navigation_manager */)); + ::testing::Values(NavigationManagerChoice::TEST_LEGACY_NAVIGATION_MANAGER)); } // namespace web
diff --git a/ios/web/navigation/session_storage_builder.h b/ios/web/navigation/session_storage_builder.h index df7e6b9..82f2c8f 100644 --- a/ios/web/navigation/session_storage_builder.h +++ b/ios/web/navigation/session_storage_builder.h
@@ -17,6 +17,7 @@ // Creates a serializable session storage from |web_state|. CRWSessionStorage* BuildStorage(WebStateImpl* web_state) const; // Populates |web_state| with |storage|'s session information. + // The provided |web_state| must already have a |NavigationManager|. void ExtractSessionState(WebStateImpl* web_state, CRWSessionStorage* storage) const; };
diff --git a/ios/web/navigation/session_storage_builder.mm b/ios/web/navigation/session_storage_builder.mm index 621b5b8a..a134b8e 100644 --- a/ios/web/navigation/session_storage_builder.mm +++ b/ios/web/navigation/session_storage_builder.mm
@@ -90,9 +90,7 @@ lastCommittedItemIndex:last_committed_item_index]); [session_controller setPreviousItemIndex:storage.previousItemIndex]; - auto navigation_manager = base::MakeUnique<LegacyNavigationManagerImpl>(); - navigation_manager->SetSessionController(session_controller); - web_state->navigation_manager_.reset(navigation_manager.release()); + web_state->navigation_manager_->SetSessionController(session_controller); SessionCertificatePolicyCacheStorageBuilder cert_builder; std::unique_ptr<SessionCertificatePolicyCacheImpl> cert_policy_cache =
diff --git a/ios/web/navigation/wk_based_navigation_manager_impl.h b/ios/web/navigation/wk_based_navigation_manager_impl.h new file mode 100644 index 0000000..4459b11 --- /dev/null +++ b/ios/web/navigation/wk_based_navigation_manager_impl.h
@@ -0,0 +1,119 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_WEB_NAVIGATION_WK_BASED_NAVIGATION_MANAGER_IMPL_H_ +#define IOS_WEB_NAVIGATION_WK_BASED_NAVIGATION_MANAGER_IMPL_H_ + +#include <stddef.h> + +#include <memory> +#include <vector> + +#import "base/mac/scoped_nsobject.h" +#include "base/macros.h" +#import "ios/web/navigation/navigation_item_impl.h" +#import "ios/web/navigation/navigation_manager_impl.h" +#include "ios/web/public/reload_type.h" +#include "ui/base/page_transition_types.h" +#include "url/gurl.h" + +namespace web { +class BrowserState; +class NavigationItem; +struct Referrer; +class NavigationManagerDelegate; +class SessionStorageBuilder; + +// WKBackForwardList based implementation of NavigationManagerImpl. +// This class relies on the following WKWebView APIs, defined by the +// CRWWebViewNavigationProxy protocol: +// @property backForwardList +// @property canGoBack +// @property canGoForward +// - goBack +// - goForward +// - goToBackForwardListItem: +class WKBasedNavigationManagerImpl : public NavigationManagerImpl { + public: + WKBasedNavigationManagerImpl(); + ~WKBasedNavigationManagerImpl() override; + + // NavigationManagerImpl: + void SetDelegate(NavigationManagerDelegate* delegate) override; + void SetBrowserState(BrowserState* browser_state) override; + void SetSessionController(CRWSessionController* session_controller) override; + void InitializeSession() override; + void ReplaceSessionHistory(std::vector<std::unique_ptr<NavigationItem>> items, + int current_index) override; + void OnNavigationItemsPruned(size_t pruned_item_count) override; + void OnNavigationItemChanged() override; + void OnNavigationItemCommitted() override; + CRWSessionController* GetSessionController() const override; + void AddTransientItem(const GURL& url) override; + void AddPendingItem( + const GURL& url, + const web::Referrer& referrer, + ui::PageTransition navigation_type, + NavigationInitiationType initiation_type, + UserAgentOverrideOption user_agent_override_option) override; + void CommitPendingItem() override; + std::unique_ptr<std::vector<BrowserURLRewriter::URLRewriter>> + GetTransientURLRewriters() override; + void RemoveTransientURLRewriters() override; + int GetIndexForOffset(int offset) const override; + int GetPreviousItemIndex() const override; + + // NavigationManager: + BrowserState* GetBrowserState() const override; + WebState* GetWebState() const override; + NavigationItem* GetVisibleItem() const override; + NavigationItem* GetLastCommittedItem() const override; + NavigationItem* GetPendingItem() const override; + NavigationItem* GetTransientItem() const override; + void DiscardNonCommittedItems() override; + void LoadURLWithParams(const NavigationManager::WebLoadParams&) override; + void AddTransientURLRewriter( + BrowserURLRewriter::URLRewriter rewriter) override; + int GetItemCount() const override; + NavigationItem* GetItemAtIndex(size_t index) const override; + int GetIndexOfItem(const NavigationItem* item) const override; + int GetPendingItemIndex() const override; + int GetLastCommittedItemIndex() const override; + bool RemoveItemAtIndex(int index) override; + bool CanGoBack() const override; + bool CanGoForward() const override; + bool CanGoToOffset(int offset) const override; + void GoBack() override; + void GoForward() override; + void GoToIndex(int index) override; + void Reload(ReloadType reload_type, bool check_for_reposts) override; + NavigationItemList GetBackwardItems() const override; + NavigationItemList GetForwardItems() const override; + void CopyStateFromAndPrune(const NavigationManager* source) override; + bool CanPruneAllButLastCommittedItem() const override; + + private: + // The SessionStorageBuilder functions require access to private variables of + // NavigationManagerImpl. + friend SessionStorageBuilder; + + // NavigationManagerImpl methods used by SessionStorageBuilder. + NavigationItemImpl* GetNavigationItemImplAtIndex(size_t index) const override; + + // The primary delegate for this manager. + NavigationManagerDelegate* delegate_; + + // The BrowserState that is associated with this instance. + BrowserState* browser_state_; + + // List of transient url rewriters added by |AddTransientURLRewriter()|. + std::unique_ptr<std::vector<BrowserURLRewriter::URLRewriter>> + transient_url_rewriters_; + + DISALLOW_COPY_AND_ASSIGN(WKBasedNavigationManagerImpl); +}; + +} // namespace web + +#endif // IOS_WEB_NAVIGATION_WK_BASED_NAVIGATION_MANAGER_IMPL_H_
diff --git a/ios/web/navigation/wk_based_navigation_manager_impl.mm b/ios/web/navigation/wk_based_navigation_manager_impl.mm new file mode 100644 index 0000000..d682b15 --- /dev/null +++ b/ios/web/navigation/wk_based_navigation_manager_impl.mm
@@ -0,0 +1,268 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/web/navigation/wk_based_navigation_manager_impl.h" + +#include <memory> + +#include "base/logging.h" +#include "base/memory/ptr_util.h" +#import "ios/web/navigation/navigation_item_impl.h" +#import "ios/web/navigation/navigation_manager_delegate.h" +#include "ios/web/public/load_committed_details.h" +#import "ios/web/public/navigation_item.h" +#import "ios/web/public/web_client.h" +#import "ios/web/web_state/ui/crw_web_view_navigation_proxy.h" +#import "net/base/mac/url_conversions.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@class CRWSessionController; + +namespace web { + +WKBasedNavigationManagerImpl::WKBasedNavigationManagerImpl() + : delegate_(nullptr), browser_state_(nullptr) {} + +WKBasedNavigationManagerImpl::~WKBasedNavigationManagerImpl() = default; + +void WKBasedNavigationManagerImpl::SetDelegate( + NavigationManagerDelegate* delegate) { + delegate_ = delegate; +} + +void WKBasedNavigationManagerImpl::SetBrowserState( + BrowserState* browser_state) { + browser_state_ = browser_state; +} + +void WKBasedNavigationManagerImpl::SetSessionController( + CRWSessionController* session_controller) {} + +void WKBasedNavigationManagerImpl::InitializeSession() {} + +void WKBasedNavigationManagerImpl::ReplaceSessionHistory( + std::vector<std::unique_ptr<NavigationItem>> items, + int current_index) { + DLOG(WARNING) << "Not yet implemented."; +} + +void WKBasedNavigationManagerImpl::OnNavigationItemsPruned( + size_t pruned_item_count) { + delegate_->OnNavigationItemsPruned(pruned_item_count); +} + +void WKBasedNavigationManagerImpl::OnNavigationItemChanged() { + delegate_->OnNavigationItemChanged(); +} + +void WKBasedNavigationManagerImpl::OnNavigationItemCommitted() { + LoadCommittedDetails details; + details.item = GetLastCommittedItem(); + DCHECK(details.item); + details.previous_item_index = GetPreviousItemIndex(); + if (details.previous_item_index >= 0) { + NavigationItem* previous_item = GetItemAtIndex(details.previous_item_index); + DCHECK(previous_item); + details.previous_url = previous_item->GetURL(); + details.is_in_page = AreUrlsFragmentChangeNavigation( + details.previous_url, details.item->GetURL()); + } else { + details.previous_url = GURL(); + details.is_in_page = NO; + } + + delegate_->OnNavigationItemCommitted(details); +} + +CRWSessionController* WKBasedNavigationManagerImpl::GetSessionController() + const { + return nil; +} + +void WKBasedNavigationManagerImpl::AddTransientItem(const GURL& url) { + DLOG(WARNING) << "Not yet implemented."; +} + +void WKBasedNavigationManagerImpl::AddPendingItem( + const GURL& url, + const web::Referrer& referrer, + ui::PageTransition navigation_type, + NavigationInitiationType initiation_type, + UserAgentOverrideOption user_agent_override_option) { + DLOG(WARNING) << "Not yet implemented."; +} + +void WKBasedNavigationManagerImpl::CommitPendingItem() { + DLOG(WARNING) << "Not yet implemented."; +} + +int WKBasedNavigationManagerImpl::GetIndexForOffset(int offset) const { + DLOG(WARNING) << "Not yet implemented."; + return -1; +} + +BrowserState* WKBasedNavigationManagerImpl::GetBrowserState() const { + return browser_state_; +} + +WebState* WKBasedNavigationManagerImpl::GetWebState() const { + return delegate_->GetWebState(); +} + +NavigationItem* WKBasedNavigationManagerImpl::GetVisibleItem() const { + DLOG(WARNING) << "Not yet implemented."; + return nullptr; +} + +NavigationItem* WKBasedNavigationManagerImpl::GetLastCommittedItem() const { + DLOG(WARNING) << "Not yet implemented."; + return nullptr; +} + +NavigationItem* WKBasedNavigationManagerImpl::GetPendingItem() const { + DLOG(WARNING) << "Not yet implemented."; + return nullptr; +} + +NavigationItem* WKBasedNavigationManagerImpl::GetTransientItem() const { + DLOG(WARNING) << "Not yet implemented."; + return nullptr; +} + +void WKBasedNavigationManagerImpl::DiscardNonCommittedItems() { + DLOG(WARNING) << "Not yet implemented."; +} + +void WKBasedNavigationManagerImpl::LoadURLWithParams( + const NavigationManager::WebLoadParams&) { + DLOG(WARNING) << "Not yet implemented."; +} + +void WKBasedNavigationManagerImpl::AddTransientURLRewriter( + BrowserURLRewriter::URLRewriter rewriter) { + DCHECK(rewriter); + if (!transient_url_rewriters_) { + transient_url_rewriters_.reset( + new std::vector<BrowserURLRewriter::URLRewriter>()); + } + transient_url_rewriters_->push_back(rewriter); +} + +int WKBasedNavigationManagerImpl::GetItemCount() const { + id<CRWWebViewNavigationProxy> proxy = delegate_->GetWebViewNavigationProxy(); + if (proxy) { + int count_current_page = proxy.backForwardList.currentItem ? 1 : 0; + return static_cast<int>(proxy.backForwardList.backList.count) + + count_current_page + + static_cast<int>(proxy.backForwardList.forwardList.count); + } + + // If WebView has not been created, it's fair to say navigation has 0 item. + return 0; +} + +NavigationItem* WKBasedNavigationManagerImpl::GetItemAtIndex( + size_t index) const { + DLOG(WARNING) << "Not yet implemented."; + return nullptr; +} + +int WKBasedNavigationManagerImpl::GetIndexOfItem( + const NavigationItem* item) const { + DLOG(WARNING) << "Not yet implemented."; + return -1; +} + +int WKBasedNavigationManagerImpl::GetPendingItemIndex() const { + DLOG(WARNING) << "Not yet implemented."; + return -1; +} + +int WKBasedNavigationManagerImpl::GetLastCommittedItemIndex() const { + id<CRWWebViewNavigationProxy> proxy = delegate_->GetWebViewNavigationProxy(); + if (proxy.backForwardList.currentItem) { + return static_cast<int>(proxy.backForwardList.backList.count); + } + return -1; +} + +bool WKBasedNavigationManagerImpl::RemoveItemAtIndex(int index) { + DLOG(WARNING) << "Not yet implemented."; + return true; +} + +bool WKBasedNavigationManagerImpl::CanGoBack() const { + return [delegate_->GetWebViewNavigationProxy() canGoBack]; +} + +bool WKBasedNavigationManagerImpl::CanGoForward() const { + return [delegate_->GetWebViewNavigationProxy() canGoForward]; +} + +bool WKBasedNavigationManagerImpl::CanGoToOffset(int offset) const { + int index = GetIndexForOffset(offset); + return index >= 0 && index < GetItemCount(); +} + +void WKBasedNavigationManagerImpl::GoBack() { + [delegate_->GetWebViewNavigationProxy() goBack]; +} + +void WKBasedNavigationManagerImpl::GoForward() { + [delegate_->GetWebViewNavigationProxy() goForward]; +} + +void WKBasedNavigationManagerImpl::GoToIndex(int index) { + DLOG(WARNING) << "Not yet implemented."; +} + +void WKBasedNavigationManagerImpl::Reload(ReloadType reload_type, + bool check_for_reposts) { + DLOG(WARNING) << "Not yet implemented."; +} + +NavigationItemList WKBasedNavigationManagerImpl::GetBackwardItems() const { + DLOG(WARNING) << "Not yet implemented."; + return NavigationItemList(); +} + +NavigationItemList WKBasedNavigationManagerImpl::GetForwardItems() const { + DLOG(WARNING) << "Not yet implemented."; + return NavigationItemList(); +} + +void WKBasedNavigationManagerImpl::CopyStateFromAndPrune( + const NavigationManager* source) { + DLOG(WARNING) << "Not yet implemented."; +} + +bool WKBasedNavigationManagerImpl::CanPruneAllButLastCommittedItem() const { + DLOG(WARNING) << "Not yet implemented."; + return true; +} + +void WKBasedNavigationManagerImpl::RemoveTransientURLRewriters() { + transient_url_rewriters_.reset(); +} + +std::unique_ptr<std::vector<BrowserURLRewriter::URLRewriter>> +WKBasedNavigationManagerImpl::GetTransientURLRewriters() { + return std::move(transient_url_rewriters_); +}; + +NavigationItemImpl* WKBasedNavigationManagerImpl::GetNavigationItemImplAtIndex( + size_t index) const { + DLOG(WARNING) << "Not yet implemented."; + return nullptr; +} + +int WKBasedNavigationManagerImpl::GetPreviousItemIndex() const { + DLOG(WARNING) << "Not yet implemented."; + return -1; +} + +} // namespace web
diff --git a/ios/web/public/DEPS b/ios/web/public/DEPS index b68e395..057fdd9 100644 --- a/ios/web/public/DEPS +++ b/ios/web/public/DEPS
@@ -2,6 +2,7 @@ # web interfaces cannot depend on private web code. "-ios/web", "+ios/web/public", + "+services/service_manager/embedder/runner", ] specific_include_rules = {
diff --git a/components/webauth/OWNERS b/ios/web/public/OWNERS similarity index 100% copy from components/webauth/OWNERS copy to ios/web/public/OWNERS
diff --git a/ios/web/public/app/BUILD.gn b/ios/web/public/app/BUILD.gn index b2dfa0af..45aa701 100644 --- a/ios/web/public/app/BUILD.gn +++ b/ios/web/public/app/BUILD.gn
@@ -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("//services/service_manager/public/service_manifest.gni") + source_set("app") { sources = [ "web_main.h", @@ -28,3 +30,13 @@ configs += [ "//build/config/compiler:enable_arc" ] } + +service_manifest("packaged_services_manifest") { + name = "web_packaged_services" + source = "mojo/web_packaged_services_manifest.json" +} + +service_manifest("browser_manifest") { + name = "web_browser" + source = "mojo/web_browser_manifest.json" +}
diff --git a/ios/web/public/app/mojo/OWNERS b/ios/web/public/app/mojo/OWNERS new file mode 100644 index 0000000..1c9493c3 --- /dev/null +++ b/ios/web/public/app/mojo/OWNERS
@@ -0,0 +1,2 @@ +per-file *.json=set noparent +per-file *.json=file://ipc/SECURITY_OWNERS
diff --git a/ios/web/public/app/mojo/web_browser_manifest.json b/ios/web/public/app/mojo/web_browser_manifest.json new file mode 100644 index 0000000..d2022fea --- /dev/null +++ b/ios/web/public/app/mojo/web_browser_manifest.json
@@ -0,0 +1,18 @@ +{ + "name": "web_browser", + "display_name": "Web", + "interface_provider_specs": { + "service_manager:connector": { + "provides": { + }, + "requires": { + "*": [ "app" ], + "service_manager": [ + "service_manager:instance_name", + "service_manager:service_manager", + "service_manager:user_id" + ] + } + } + } +}
diff --git a/ios/web/public/app/mojo/web_packaged_services_manifest.json b/ios/web/public/app/mojo/web_packaged_services_manifest.json new file mode 100644 index 0000000..f825185 --- /dev/null +++ b/ios/web/public/app/mojo/web_packaged_services_manifest.json
@@ -0,0 +1,27 @@ +// Primordial service for the browser process. This is a singleton service which +// acts as a runtime ServiceFactory for other packaged global services exposed +// at or below the web layer. +// +// Note that this is only for packaging services which do not require user +// profile context. Services which require user profile context must instead be +// packaged within the web_browser service. +{ + "name": "web_packaged_services", + "display_name": "Web Packaged Services", + "interface_provider_specs": { + "service_manager:connector": { + "provides": { + "service_manager:service_factory": [ + "service_manager::mojom::ServiceFactory" + ] + }, + "requires": { + "web_browser": [], + "service_manager": [ + "service_manager:all_users", + "service_manager:user_id" + ] + } + } + } +}
diff --git a/ios/web/public/origin_util.mm b/ios/web/public/origin_util.mm index a0d8e14..55670528 100644 --- a/ios/web/public/origin_util.mm +++ b/ios/web/public/origin_util.mm
@@ -27,8 +27,7 @@ return true; } - std::string hostname = url.HostNoBrackets(); - if (net::IsLocalhost(hostname)) + if (net::IsLocalhost(url.HostNoBracketsPiece())) return true; return false;
diff --git a/ios/web/public/service_manager_connection.h b/ios/web/public/service_manager_connection.h new file mode 100644 index 0000000..f630d85b --- /dev/null +++ b/ios/web/public/service_manager_connection.h
@@ -0,0 +1,77 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_WEB_PUBLIC_SERVICE_MANAGER_CONNECTION_H_ +#define IOS_WEB_PUBLIC_SERVICE_MANAGER_CONNECTION_H_ + +#include <memory> + +#include "base/callback_forward.h" +#include "base/sequenced_task_runner.h" +#include "services/service_manager/embedder/embedded_service_info.h" +#include "services/service_manager/public/cpp/identity.h" +#include "services/service_manager/public/interfaces/service.mojom.h" + +namespace service_manager { +class Connector; +} + +namespace web { + +// Encapsulates a connection to a //services/service_manager. +// Access a global instance on the thread the ServiceContext was bound by +// calling Holder::Get(). +// Clients can add service_manager::Service implementations whose exposed +// interfaces +// will be exposed to inbound connections to this object's Service. +// Alternatively clients can define named services that will be constructed when +// requests for those service names are received. +// Clients must call any of the registration methods when receiving +// WebClient::RegisterInProcessServices(). +class ServiceManagerConnection { + public: + using ServiceRequestHandler = + base::Callback<void(service_manager::mojom::ServiceRequest)>; + using Factory = + base::Callback<std::unique_ptr<ServiceManagerConnection>(void)>; + + // Sets |connection| as the connection that is globally accessible from the + // UI thread. Should be called on the UI thread. + static void Set(std::unique_ptr<ServiceManagerConnection> connection); + + // Returns the global instance, or nullptr if the Service Manager + // connection has not yet been bound. Should be called on the UI thread. + static ServiceManagerConnection* Get(); + + // Destroys the global instance. Should be called on the UI thread. + static void Destroy(); + + virtual ~ServiceManagerConnection(); + + // Creates a ServiceManagerConnection from |request|. The connection binds + // its interfaces and accept new connections on |io_task_runner| only. Note + // that no incoming connections are accepted until Start() is called. + static std::unique_ptr<ServiceManagerConnection> Create( + service_manager::mojom::ServiceRequest request, + scoped_refptr<base::SequencedTaskRunner> io_task_runner); + + // Begins accepting incoming connections. + virtual void Start() = 0; + + // Returns the service_manager::Connector received via this connection's + // Service implementation. Use this to initiate connections as this object's + // Identity. + virtual service_manager::Connector* GetConnector() = 0; + + // Adds an embedded service to this connection's ServiceFactory. + // |info| provides details on how to construct new instances of the + // service when an incoming connection is made to |name|. + virtual void AddEmbeddedService( + const std::string& name, + const service_manager::EmbeddedServiceInfo& info) = 0; +}; + +} // namespace web + +#endif // IOS_WEB_PUBLIC_SERVICE_MANAGER_CONNECTION_H_
diff --git a/ios/web/public/service_names.mojom b/ios/web/public/service_names.mojom new file mode 100644 index 0000000..c24e128 --- /dev/null +++ b/ios/web/public/service_names.mojom
@@ -0,0 +1,15 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module web.mojom; + +// The default service name the browser identifies as when connecting to +// the Service Manager. This must match the name in +// src/ios/web/public/app/mojo/web_browser_manifest.json. +const string kBrowserServiceName = "web_browser"; + +// The service name used to identify the browser process's singleton service +// instance which packages other browser-wide services. This must match the name +// in src/ios/web/public/app/mojo/web_packaged_services_manifest.json. +const string kPackagedServicesServiceName = "web_packaged_services";
diff --git a/ios/web/public/web_client.h b/ios/web/public/web_client.h index b12d667..400efa1 100644 --- a/ios/web/public/web_client.h +++ b/ios/web/public/web_client.h
@@ -5,6 +5,7 @@ #ifndef IOS_WEB_PUBLIC_WEB_CLIENT_H_ #define IOS_WEB_PUBLIC_WEB_CLIENT_H_ +#include <map> #include <memory> #include <string> #include <vector> @@ -13,7 +14,9 @@ #include "base/strings/string16.h" #include "base/strings/string_piece.h" #include "base/task_scheduler/task_scheduler.h" +#include "base/values.h" #include "ios/web/public/user_agent.h" +#include "services/service_manager/embedder/embedded_service_info.h" #include "ui/base/layout.h" #include "url/url_util.h" @@ -113,6 +116,19 @@ // improve performance. virtual NSString* GetEarlyPageScript(BrowserState* browser_state) const; + using StaticServiceMap = + std::map<std::string, service_manager::EmbeddedServiceInfo>; + + // Registers services to be loaded by the Service Manager. + virtual void RegisterServices(StaticServiceMap* services) {} + + // Allows the embedder to provide a dictionary loaded from a JSON file + // resembling a service manifest whose capabilities section will be merged + // with web's own for |name|. Additional entries will be appended to their + // respective sections. + virtual std::unique_ptr<base::Value> GetServiceManifestOverlay( + base::StringPiece name); + // Informs the embedder that a certificate error has occurred. If // |overridable| is true, the user can ignore the error and continue. The // embedder can call the |callback| asynchronously (an argument of true means
diff --git a/ios/web/public/web_client.mm b/ios/web/public/web_client.mm index 7a687ad..81bd02b2 100644 --- a/ios/web/public/web_client.mm +++ b/ios/web/public/web_client.mm
@@ -76,6 +76,11 @@ return @""; } +std::unique_ptr<base::Value> WebClient::GetServiceManifestOverlay( + base::StringPiece name) { + return nullptr; +} + void WebClient::AllowCertificateError( WebState* web_state, int cert_error,
diff --git a/ios/web/service_manager_connection_impl.cc b/ios/web/service_manager_connection_impl.cc new file mode 100644 index 0000000..1ff842a --- /dev/null +++ b/ios/web/service_manager_connection_impl.cc
@@ -0,0 +1,341 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ios/web/service_manager_connection_impl.h" + +#include <queue> +#include <utility> +#include <vector> + +#include "base/bind.h" +#include "base/callback_helpers.h" +#include "base/lazy_instance.h" +#include "base/macros.h" +#include "base/memory/ptr_util.h" +#include "base/message_loop/message_loop.h" +#include "base/threading/thread_checker.h" +#include "base/threading/thread_task_runner_handle.h" +#include "ios/web/public/web_thread.h" +#include "mojo/public/cpp/bindings/binding_set.h" +#include "mojo/public/cpp/system/message_pipe.h" +#include "services/service_manager/embedder/embedded_service_runner.h" +#include "services/service_manager/public/cpp/service.h" +#include "services/service_manager/public/cpp/service_context.h" +#include "services/service_manager/public/interfaces/constants.mojom.h" +#include "services/service_manager/public/interfaces/service_factory.mojom.h" +#include "services/service_manager/runner/common/client_util.h" + +namespace web { +namespace { + +base::LazyInstance<std::unique_ptr<ServiceManagerConnection>>::Leaky + g_connection_for_process = LAZY_INSTANCE_INITIALIZER; + +} // namespace + +// A ref-counted object which owns the IO thread state of a +// ServiceManagerConnectionImpl. This includes Service and ServiceFactory +// bindings. +class ServiceManagerConnectionImpl::IOThreadContext + : public base::RefCountedThreadSafe<IOThreadContext>, + public service_manager::Service, + public service_manager::mojom::ServiceFactory { + public: + IOThreadContext( + service_manager::mojom::ServiceRequest service_request, + scoped_refptr<base::SequencedTaskRunner> io_task_runner, + std::unique_ptr<service_manager::Connector> io_thread_connector, + service_manager::mojom::ConnectorRequest connector_request) + : pending_service_request_(std::move(service_request)), + io_task_runner_(io_task_runner), + io_thread_connector_(std::move(io_thread_connector)), + pending_connector_request_(std::move(connector_request)), + weak_factory_(this) { + // This will be reattached by any of the IO thread functions on first call. + io_thread_checker_.DetachFromThread(); + } + + // Safe to call from any thread. + void Start(const base::Closure& stop_callback) { + DCHECK(!started_); + + started_ = true; + callback_task_runner_ = base::ThreadTaskRunnerHandle::Get(); + stop_callback_ = stop_callback; + io_task_runner_->PostTask( + FROM_HERE, base::Bind(&IOThreadContext::StartOnIOThread, this)); + } + + // Safe to call from whichever thread called Start() (or may have called + // Start()). Must be called before IO thread shutdown. + void ShutDown() { + if (!started_) + return; + + bool posted = io_task_runner_->PostTask( + FROM_HERE, base::Bind(&IOThreadContext::ShutDownOnIOThread, this)); + DCHECK(posted); + } + + void AddEmbeddedService(const std::string& name, + const service_manager::EmbeddedServiceInfo& info) { + io_task_runner_->PostTask( + FROM_HERE, base::Bind(&ServiceManagerConnectionImpl::IOThreadContext:: + AddEmbeddedServiceRequestHandlerOnIoThread, + this, name, info)); + } + + private: + friend class base::RefCountedThreadSafe<IOThreadContext>; + + class MessageLoopObserver : public base::MessageLoop::DestructionObserver { + public: + explicit MessageLoopObserver(base::WeakPtr<IOThreadContext> context) + : context_(context) { + base::MessageLoop::current()->AddDestructionObserver(this); + } + + ~MessageLoopObserver() override { + base::MessageLoop::current()->RemoveDestructionObserver(this); + } + + void ShutDown() { + if (!is_active_) + return; + + // The call into |context_| below may reenter ShutDown(), hence we set + // |is_active_| to false here. + is_active_ = false; + if (context_) + context_->ShutDownOnIOThread(); + + delete this; + } + + private: + void WillDestroyCurrentMessageLoop() override { + DCHECK(is_active_); + ShutDown(); + } + + bool is_active_ = true; + base::WeakPtr<IOThreadContext> context_; + + DISALLOW_COPY_AND_ASSIGN(MessageLoopObserver); + }; + + ~IOThreadContext() override {} + + void StartOnIOThread() { + // Should bind |io_thread_checker_| to the context's thread. + DCHECK(io_thread_checker_.CalledOnValidThread()); + DCHECK(!service_context_); + service_context_.reset(new service_manager::ServiceContext( + base::MakeUnique<service_manager::ForwardingService>(this), + std::move(pending_service_request_), std::move(io_thread_connector_), + std::move(pending_connector_request_))); + + // MessageLoopObserver owns itself. + message_loop_observer_ = + new MessageLoopObserver(weak_factory_.GetWeakPtr()); + } + + void ShutDownOnIOThread() { + DCHECK(io_thread_checker_.CalledOnValidThread()); + + weak_factory_.InvalidateWeakPtrs(); + + // Note that this method may be invoked by MessageLoopObserver observing + // MessageLoop destruction. In that case, this call to ShutDown is + // effectively a no-op. In any case it's safe. + if (message_loop_observer_) { + message_loop_observer_->ShutDown(); + message_loop_observer_ = nullptr; + } + + // Resetting the ServiceContext below may otherwise release the last + // reference to this IOThreadContext. We keep it alive until the stack + // unwinds. + scoped_refptr<IOThreadContext> keepalive(this); + + factory_bindings_.CloseAllBindings(); + service_context_.reset(); + + request_handlers_.clear(); + embedded_services_.clear(); + } + + void AddEmbeddedServiceRequestHandlerOnIoThread( + const std::string& name, + const service_manager::EmbeddedServiceInfo& info) { + DCHECK(io_thread_checker_.CalledOnValidThread()); + auto service = + base::MakeUnique<service_manager::EmbeddedServiceRunner>(name, info); + AddServiceRequestHandlerOnIoThread( + name, + base::Bind(&service_manager::EmbeddedServiceRunner::BindServiceRequest, + base::Unretained(service.get()))); + auto insertion_result = + embedded_services_.insert(std::make_pair(name, std::move(service))); + DCHECK(insertion_result.second); + } + + void AddServiceRequestHandlerOnIoThread( + const std::string& name, + const ServiceRequestHandler& handler) { + DCHECK(io_thread_checker_.CalledOnValidThread()); + auto result = request_handlers_.insert(std::make_pair(name, handler)); + DCHECK(result.second); + } + + ///////////////////////////////////////////////////////////////////////////// + // service_manager::Service implementation + + void OnBindInterface(const service_manager::BindSourceInfo& source_info, + const std::string& interface_name, + mojo::ScopedMessagePipeHandle interface_pipe) override { + DCHECK(io_thread_checker_.CalledOnValidThread()); + if (source_info.identity.name() == service_manager::mojom::kServiceName && + interface_name == service_manager::mojom::ServiceFactory::Name_) { + factory_bindings_.AddBinding( + this, service_manager::mojom::ServiceFactoryRequest( + std::move(interface_pipe))); + } + } + + bool OnServiceManagerConnectionLost() override { + callback_task_runner_->PostTask(FROM_HERE, stop_callback_); + return true; + } + + ///////////////////////////////////////////////////////////////////////////// + // service_manager::mojom::ServiceFactory: + + void CreateService(service_manager::mojom::ServiceRequest request, + const std::string& name) override { + DCHECK(io_thread_checker_.CalledOnValidThread()); + auto it = request_handlers_.find(name); + if (it == request_handlers_.end()) { + LOG(ERROR) << "Can't create service " << name << ". No handler found."; + return; + } + it->second.Run(std::move(request)); + } + + base::ThreadChecker io_thread_checker_; + bool started_ = false; + + // Temporary state established on construction and consumed on the IO thread + // once the connection is started. + service_manager::mojom::ServiceRequest pending_service_request_; + scoped_refptr<base::SequencedTaskRunner> io_task_runner_; + std::unique_ptr<service_manager::Connector> io_thread_connector_; + service_manager::mojom::ConnectorRequest pending_connector_request_; + + // TaskRunner on which to run our owner's callbacks, i.e. the ones passed to + // Start(). + scoped_refptr<base::SequencedTaskRunner> callback_task_runner_; + + // Callback to run if the service is stopped by the service manager. + base::Closure stop_callback_; + + std::unique_ptr<service_manager::ServiceContext> service_context_; + mojo::BindingSet<service_manager::mojom::ServiceFactory> factory_bindings_; + + // Not owned. + MessageLoopObserver* message_loop_observer_ = nullptr; + + std::map<std::string, std::unique_ptr<service_manager::EmbeddedServiceRunner>> + embedded_services_; + std::map<std::string, ServiceRequestHandler> request_handlers_; + + base::WeakPtrFactory<IOThreadContext> weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(IOThreadContext); +}; + +//////////////////////////////////////////////////////////////////////////////// +// ServiceManagerConnection, public: + +// static +void ServiceManagerConnection::Set( + std::unique_ptr<ServiceManagerConnection> connection) { + DCHECK_CURRENTLY_ON(WebThread::UI); + DCHECK(!g_connection_for_process.Get()); + g_connection_for_process.Get() = std::move(connection); +} + +// static +ServiceManagerConnection* ServiceManagerConnection::Get() { + DCHECK_CURRENTLY_ON(WebThread::UI); + return g_connection_for_process.Get().get(); +} + +// static +void ServiceManagerConnection::Destroy() { + DCHECK_CURRENTLY_ON(WebThread::UI); + + // This joins the service manager controller thread. + g_connection_for_process.Get().reset(); +} + +// static +std::unique_ptr<ServiceManagerConnection> ServiceManagerConnection::Create( + service_manager::mojom::ServiceRequest request, + scoped_refptr<base::SequencedTaskRunner> io_task_runner) { + return base::MakeUnique<ServiceManagerConnectionImpl>(std::move(request), + io_task_runner); +} + +ServiceManagerConnection::~ServiceManagerConnection() {} + +//////////////////////////////////////////////////////////////////////////////// +// ServiceManagerConnectionImpl, public: + +ServiceManagerConnectionImpl::ServiceManagerConnectionImpl( + service_manager::mojom::ServiceRequest request, + scoped_refptr<base::SequencedTaskRunner> io_task_runner) + : weak_factory_(this) { + service_manager::mojom::ConnectorRequest connector_request; + connector_ = service_manager::Connector::Create(&connector_request); + + std::unique_ptr<service_manager::Connector> io_thread_connector = + connector_->Clone(); + context_ = new IOThreadContext(std::move(request), io_task_runner, + std::move(io_thread_connector), + std::move(connector_request)); +} + +ServiceManagerConnectionImpl::~ServiceManagerConnectionImpl() { + context_->ShutDown(); +} + +//////////////////////////////////////////////////////////////////////////////// +// ServiceManagerConnectionImpl, ServiceManagerConnection implementation: + +void ServiceManagerConnectionImpl::Start() { + context_->Start(base::Bind(&ServiceManagerConnectionImpl::OnConnectionLost, + weak_factory_.GetWeakPtr())); +} + +service_manager::Connector* ServiceManagerConnectionImpl::GetConnector() { + return connector_.get(); +} + +void ServiceManagerConnectionImpl::AddEmbeddedService( + const std::string& name, + const service_manager::EmbeddedServiceInfo& info) { + context_->AddEmbeddedService(name, info); +} + +void ServiceManagerConnectionImpl::OnConnectionLost() {} + +void ServiceManagerConnectionImpl::GetInterface( + service_manager::mojom::InterfaceProvider* provider, + const std::string& interface_name, + mojo::ScopedMessagePipeHandle request_handle) { + provider->GetInterface(interface_name, std::move(request_handle)); +} + +} // namespace web
diff --git a/ios/web/service_manager_connection_impl.h b/ios/web/service_manager_connection_impl.h new file mode 100644 index 0000000..b947026 --- /dev/null +++ b/ios/web/service_manager_connection_impl.h
@@ -0,0 +1,62 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_WEB_SERVICE_MANAGER_SERVICE_MANAGER_CONNECTION_IMPL_H_ +#define IOS_WEB_SERVICE_MANAGER_SERVICE_MANAGER_CONNECTION_IMPL_H_ + +#include <memory> + +#include "base/macros.h" +#include "base/memory/ref_counted.h" +#include "base/memory/weak_ptr.h" +#include "base/sequenced_task_runner.h" +#include "ios/web/public/service_manager_connection.h" +#include "mojo/public/cpp/system/message_pipe.h" +#include "services/service_manager/public/cpp/identity.h" +#include "services/service_manager/public/interfaces/service.mojom.h" + +namespace service_manager { +class Connector; +} + +namespace web { + +class ServiceManagerConnectionImpl : public ServiceManagerConnection { + public: + ServiceManagerConnectionImpl( + service_manager::mojom::ServiceRequest request, + scoped_refptr<base::SequencedTaskRunner> io_task_runner); + ~ServiceManagerConnectionImpl() override; + + private: + class IOThreadContext; + + // ServiceManagerConnection: + void Start() override; + service_manager::Connector* GetConnector() override; + void AddEmbeddedService( + const std::string& name, + const service_manager::EmbeddedServiceInfo& info) override; + + // Invoked when the connection to the Service Manager is lost. + void OnConnectionLost(); + + // Binds |request_handle| to an instance of |interface_name| provided by + // |interface_provider|. + void GetInterface(service_manager::mojom::InterfaceProvider* provider, + const std::string& interface_name, + mojo::ScopedMessagePipeHandle request_handle); + + std::unique_ptr<service_manager::Connector> connector_; + + scoped_refptr<IOThreadContext> context_; + + base::WeakPtrFactory<ServiceManagerConnectionImpl> weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(ServiceManagerConnectionImpl); +}; + +} // namespace web + +#endif // IOS_WEB_SERVICE_MANAGER_SERVICE_MANAGER_CONNECTION_IMPL_H_
diff --git a/ios/web/service_manager_connection_impl_unittest.cc b/ios/web/service_manager_connection_impl_unittest.cc new file mode 100644 index 0000000..f0a605e --- /dev/null +++ b/ios/web/service_manager_connection_impl_unittest.cc
@@ -0,0 +1,61 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ios/web/service_manager_connection_impl.h" + +#include "base/synchronization/waitable_event.h" +#include "ios/web/public/test/test_web_thread_bundle.h" +#include "ios/web/public/web_thread.h" +#include "services/service_manager/public/cpp/identity.h" +#include "services/service_manager/public/cpp/service.h" +#include "services/service_manager/public/interfaces/constants.mojom.h" +#include "services/service_manager/public/interfaces/service_factory.mojom.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace web { +namespace { + +constexpr char kTestServiceName[] = "test service"; + +std::unique_ptr<service_manager::Service> LaunchService( + base::WaitableEvent* event) { + event->Signal(); + return base::MakeUnique<service_manager::Service>(); +} + +} // namespace + +TEST(ServiceManagerConnectionImplTest, ServiceLaunchThreading) { + TestWebThreadBundle thread_bundle( + TestWebThreadBundle::Options::REAL_IO_THREAD); + // base::MessageLoop message_loop; + // base::Thread io_thread("ServiceManagerConnectionImplTest IO Thread"); + // io_thread.Start(); + service_manager::mojom::ServicePtr service; + ServiceManagerConnectionImpl connection_impl( + mojo::MakeRequest(&service), + WebThread::GetTaskRunnerForThread(WebThread::IO)); + ServiceManagerConnection& connection = connection_impl; + service_manager::EmbeddedServiceInfo info; + base::WaitableEvent event(base::WaitableEvent::ResetPolicy::MANUAL, + base::WaitableEvent::InitialState::NOT_SIGNALED); + info.factory = base::Bind(&LaunchService, &event); + info.task_runner = WebThread::GetTaskRunnerForThread(WebThread::IO); + connection.AddEmbeddedService(kTestServiceName, info); + connection.Start(); + service_manager::BindSourceInfo source_info( + {service_manager::mojom::kServiceName, + service_manager::mojom::kRootUserID}, + service_manager::CapabilitySet()); + service_manager::mojom::ServiceFactoryPtr factory; + service->OnBindInterface(source_info, + service_manager::mojom::ServiceFactory::Name_, + mojo::MakeRequest(&factory).PassMessagePipe(), + base::Bind(&base::DoNothing)); + service_manager::mojom::ServicePtr created_service; + factory->CreateService(mojo::MakeRequest(&created_service), kTestServiceName); + event.Wait(); +} + +} // namespace web
diff --git a/ios/web/service_manager_context.h b/ios/web/service_manager_context.h new file mode 100644 index 0000000..b99da53 --- /dev/null +++ b/ios/web/service_manager_context.h
@@ -0,0 +1,33 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_WEB_SERVICE_MANAGER_CONTEXT_H_ +#define IOS_WEB_SERVICE_MANAGER_CONTEXT_H_ + +#include "base/macros.h" +#include "base/memory/ref_counted.h" + +namespace web { + +class ServiceManagerConnection; + +// ServiceManagerContext manages the browser's connection to the ServiceManager, +// hosting an in-process ServiceManagerContext. +class ServiceManagerContext { + public: + ServiceManagerContext(); + ~ServiceManagerContext(); + + private: + class InProcessServiceManagerContext; + + scoped_refptr<InProcessServiceManagerContext> in_process_context_; + std::unique_ptr<ServiceManagerConnection> packaged_services_connection_; + + DISALLOW_COPY_AND_ASSIGN(ServiceManagerContext); +}; + +} // namespace web + +#endif // IOS_WEB_SERVICE_MANAGER_CONTEXT_H_
diff --git a/ios/web/service_manager_context.mm b/ios/web/service_manager_context.mm new file mode 100644 index 0000000..540baf1 --- /dev/null +++ b/ios/web/service_manager_context.mm
@@ -0,0 +1,212 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ios/web/service_manager_context.h" + +#include <memory> +#include <string> +#include <utility> + +#include "base/bind.h" +#include "base/command_line.h" +#include "base/feature_list.h" +#include "base/json/json_reader.h" +#include "base/lazy_instance.h" +#include "base/macros.h" +#include "base/memory/ptr_util.h" +#include "base/process/process_handle.h" +#include "base/single_thread_task_runner.h" +#include "base/strings/utf_string_conversions.h" +#include "ios/web/grit/ios_web_resources.h" +#include "ios/web/public/service_manager_connection.h" +#include "ios/web/public/service_names.mojom.h" +#include "ios/web/public/web_client.h" +#include "ios/web/public/web_thread.h" +#include "ios/web/service_manager_connection_impl.h" +#include "services/catalog/manifest_provider.h" +#include "services/catalog/public/cpp/manifest_parsing_util.h" +#include "services/catalog/public/interfaces/constants.mojom.h" +#include "services/service_manager/connect_params.h" +#include "services/service_manager/embedder/manifest_utils.h" +#include "services/service_manager/public/cpp/connector.h" +#include "services/service_manager/public/cpp/service.h" +#include "services/service_manager/public/interfaces/service.mojom.h" +#include "services/service_manager/runner/common/client_util.h" +#include "services/service_manager/service_manager.h" + +namespace web { + +namespace { + +struct ManifestInfo { + const char* name; + int resource_id; +}; + +// A ManifestProvider which resolves application names to builtin manifest +// resources for the catalog service to consume. +class BuiltinManifestProvider : public catalog::ManifestProvider { + public: + BuiltinManifestProvider() {} + ~BuiltinManifestProvider() override {} + + void AddServiceManifest(base::StringPiece name, int resource_id) { + std::string contents = + GetWebClient() + ->GetDataResource(resource_id, ui::ScaleFactor::SCALE_FACTOR_NONE) + .as_string(); + DCHECK(!contents.empty()); + + std::unique_ptr<base::Value> manifest_value = + base::JSONReader::Read(contents); + DCHECK(manifest_value); + + std::unique_ptr<base::Value> overlay_value = + GetWebClient()->GetServiceManifestOverlay(name); + + service_manager::MergeManifestWithOverlay(manifest_value.get(), + overlay_value.get()); + auto insertion_result = manifests_.insert( + std::make_pair(name.as_string(), std::move(manifest_value))); + DCHECK(insertion_result.second) << "Duplicate manifest entry: " << name; + } + + private: + // catalog::ManifestProvider: + std::unique_ptr<base::Value> GetManifest(const std::string& name) override { + auto it = manifests_.find(name); + return it != manifests_.end() ? it->second->CreateDeepCopy() : nullptr; + } + + std::map<std::string, std::unique_ptr<base::Value>> manifests_; + + DISALLOW_COPY_AND_ASSIGN(BuiltinManifestProvider); +}; + +} // namespace + +// State which lives on the IO thread and drives the ServiceManager. +class ServiceManagerContext::InProcessServiceManagerContext + : public base::RefCountedThreadSafe<InProcessServiceManagerContext> { + public: + InProcessServiceManagerContext() {} + + void Start( + service_manager::mojom::ServicePtrInfo packaged_services_service_info, + std::unique_ptr<BuiltinManifestProvider> manifest_provider) { + WebThread::GetTaskRunnerForThread(WebThread::IO) + ->PostTask(FROM_HERE, + base::Bind(&InProcessServiceManagerContext::StartOnIOThread, + this, base::Passed(&manifest_provider), + base::Passed(&packaged_services_service_info))); + } + + void ShutDown() { + WebThread::GetTaskRunnerForThread(WebThread::IO) + ->PostTask( + FROM_HERE, + base::Bind(&InProcessServiceManagerContext::ShutDownOnIOThread, + this)); + } + + private: + friend class base::RefCountedThreadSafe<InProcessServiceManagerContext>; + + ~InProcessServiceManagerContext() {} + + // Creates the ServiceManager and registers the packaged services service + // with it, connecting the other end of the packaged services serviceto + // |packaged_services_service_info|. + void StartOnIOThread( + std::unique_ptr<BuiltinManifestProvider> manifest_provider, + service_manager::mojom::ServicePtrInfo packaged_services_service_info) { + manifest_provider_ = std::move(manifest_provider); + service_manager_ = base::MakeUnique<service_manager::ServiceManager>( + nullptr, nullptr, manifest_provider_.get()); + + service_manager::mojom::ServicePtr packaged_services_service; + packaged_services_service.Bind(std::move(packaged_services_service_info)); + service_manager_->RegisterService( + service_manager::Identity(mojom::kPackagedServicesServiceName, + service_manager::mojom::kRootUserID), + std::move(packaged_services_service), nullptr); + } + + void ShutDownOnIOThread() { + service_manager_.reset(); + manifest_provider_.reset(); + } + + std::unique_ptr<BuiltinManifestProvider> manifest_provider_; + std::unique_ptr<service_manager::ServiceManager> service_manager_; + + DISALLOW_COPY_AND_ASSIGN(InProcessServiceManagerContext); +}; + +ServiceManagerContext::ServiceManagerContext() { + service_manager::mojom::ServiceRequest packaged_services_request; + DCHECK(!service_manager::ServiceManagerIsRemote()); + std::unique_ptr<BuiltinManifestProvider> manifest_provider = + base::MakeUnique<BuiltinManifestProvider>(); + + const std::array<ManifestInfo, 3> manifests = {{ + {mojom::kBrowserServiceName, IDR_MOJO_WEB_BROWSER_MANIFEST}, + {mojom::kPackagedServicesServiceName, + IDR_MOJO_WEB_PACKAGED_SERVICES_MANIFEST}, + {catalog::mojom::kServiceName, IDR_MOJO_CATALOG_MANIFEST}, + }}; + for (const ManifestInfo& manifest : manifests) { + manifest_provider->AddServiceManifest(manifest.name, manifest.resource_id); + } + in_process_context_ = base::MakeRefCounted<InProcessServiceManagerContext>(); + + service_manager::mojom::ServicePtr packaged_services_service; + packaged_services_request = mojo::MakeRequest(&packaged_services_service); + in_process_context_->Start(packaged_services_service.PassInterface(), + std::move(manifest_provider)); + + packaged_services_connection_ = ServiceManagerConnection::Create( + std::move(packaged_services_request), + WebThread::GetTaskRunnerForThread(WebThread::IO)); + + service_manager::mojom::ServicePtr root_browser_service; + ServiceManagerConnection::Set(ServiceManagerConnection::Create( + mojo::MakeRequest(&root_browser_service), + WebThread::GetTaskRunnerForThread(WebThread::IO))); + auto* browser_connection = ServiceManagerConnection::Get(); + + service_manager::mojom::PIDReceiverPtr pid_receiver; + packaged_services_connection_->GetConnector()->StartService( + service_manager::Identity(mojom::kBrowserServiceName, + service_manager::mojom::kRootUserID), + std::move(root_browser_service), mojo::MakeRequest(&pid_receiver)); + pid_receiver->SetPID(base::GetCurrentProcId()); + + // Embed any services from //ios/web here. + + // Embed services from the client of //ios/web. + WebClient::StaticServiceMap services; + GetWebClient()->RegisterServices(&services); + for (const auto& entry : services) { + packaged_services_connection_->AddEmbeddedService(entry.first, + entry.second); + } + + packaged_services_connection_->Start(); + + browser_connection->Start(); +} + +ServiceManagerContext::~ServiceManagerContext() { + // NOTE: The in-process ServiceManager MUST be destroyed before the browser + // process-wide ServiceManagerConnection. Otherwise it's possible for the + // ServiceManager to receive connection requests for service:ios_web_browser + // which it may attempt to service by launching a new instance of the browser. + if (in_process_context_) + in_process_context_->ShutDown(); + if (ServiceManagerConnection::Get()) + ServiceManagerConnection::Destroy(); +} + +} // namespace web
diff --git a/ios/web/shell/BUILD.gn b/ios/web/shell/BUILD.gn index a4ddfe3..f8332d92 100644 --- a/ios/web/shell/BUILD.gn +++ b/ios/web/shell/BUILD.gn
@@ -4,6 +4,8 @@ import("//build/config/ios/rules.gni") import("//ios/build/config.gni") +import("//services/service_manager/public/service_manifest.gni") +import("//tools/grit/grit_rule.gni") import("//tools/grit/repack.gni") ios_app_bundle("ios_web_shell") { @@ -35,14 +37,44 @@ ] } +service_manifest("shell_packaged_services_manifest_overlay") { + source = "web_shell_packaged_services_manifest_overlay.json" + packaged_services = [ "//services/test/echo:manifest" ] +} + +service_manifest("shell_browser_manifest_overlay") { + source = "web_shell_browser_manifest_overlay.json" +} + +grit("resources") { + visibility = [ ":*" ] + source = "shell_resources.grd" + grit_flags = [ + "-E", + "root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir), + ] + outputs = [ + "grit/shell_resources.h", + "shell_resources.pak", + ] + deps = [ + ":shell_browser_manifest_overlay", + ":shell_packaged_services_manifest_overlay", + ] +} + repack("packed_resources") { visibility = [ ":shell" ] sources = [ "$root_gen_dir/ios/web/ios_web_resources.pak", + "$root_gen_dir/ios/web/shell/shell_resources.pak", ] deps = [ "//ios/web:resources", ] + public_deps = [ + ":resources", + ] output = "$target_gen_dir/web_shell_resources.pak" copy_data_to_bundle = true } @@ -78,6 +110,8 @@ "//ios/web/public/app", "//net", "//net:extras", + "//services/test/echo:lib", + "//services/test/echo/public/interfaces", "//ui/base", ]
diff --git a/ios/web/shell/DEPS b/ios/web/shell/DEPS index 97be340..2ab608b 100644 --- a/ios/web/shell/DEPS +++ b/ios/web/shell/DEPS
@@ -3,5 +3,6 @@ "-ios/web", "+ios/web/public", "+ios/web/shell", + "+services/test/echo", ]
diff --git a/ios/web/shell/shell_resources.grd b/ios/web/shell/shell_resources.grd new file mode 100644 index 0000000..a3ae7f25 --- /dev/null +++ b/ios/web/shell/shell_resources.grd
@@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<grit latest_public_release="0" current_release="1" output_all_resource_defines="false"> + <outputs> + <output filename="grit/shell_resources.h" type="rc_header"> + <emit emit_type='prepend'></emit> + </output> + <output filename="shell_resources.pak" type="data_package" /> + </outputs> + <translations /> + <release seq="1"> + <includes> + <include name="IDR_WEB_SHELL_BROWSER_MANIFEST_OVERLAY" file="${root_gen_dir}/ios/web/shell/shell_browser_manifest_overlay.json" use_base_dir="false" type="BINDATA" /> + <include name="IDR_WEB_SHELL_PACKAGED_SERVICES_MANIFEST_OVERLAY" file="${root_gen_dir}/ios/web/shell/shell_packaged_services_manifest_overlay.json" use_base_dir="false" type="BINDATA" /> + </includes> + </release> +</grit>
diff --git a/ios/web/shell/shell_web_client.h b/ios/web/shell/shell_web_client.h index 38aaaf4..15d41777 100644 --- a/ios/web/shell/shell_web_client.h +++ b/ios/web/shell/shell_web_client.h
@@ -28,6 +28,9 @@ int resource_id, ui::ScaleFactor scale_factor) const override; base::RefCountedMemory* GetDataResourceBytes(int resource_id) const override; + void RegisterServices(StaticServiceMap* services) override; + std::unique_ptr<base::Value> GetServiceManifestOverlay( + base::StringPiece name) override; void AllowCertificateError( WebState* web_state, int cert_error,
diff --git a/ios/web/shell/shell_web_client.mm b/ios/web/shell/shell_web_client.mm index 17fc65a..a6e2c26d 100644 --- a/ios/web/shell/shell_web_client.mm +++ b/ios/web/shell/shell_web_client.mm
@@ -6,9 +6,13 @@ #import <UIKit/UIKit.h> +#include "base/json/json_reader.h" #include "base/memory/ptr_util.h" +#include "ios/web/public/service_names.mojom.h" #include "ios/web/public/user_agent.h" +#include "ios/web/shell/grit/shell_resources.h" #include "ios/web/shell/shell_web_main_parts.h" +#include "services/test/echo/echo_service.h" #include "ui/base/resource/resource_bundle.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -54,6 +58,30 @@ return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); } +void ShellWebClient::RegisterServices(StaticServiceMap* services) { + service_manager::EmbeddedServiceInfo echo_info; + echo_info.factory = base::Bind(&echo::CreateEchoService); + echo_info.task_runner = base::ThreadTaskRunnerHandle::Get(); + services->insert(std::make_pair("echo", echo_info)); +} + +std::unique_ptr<base::Value> ShellWebClient::GetServiceManifestOverlay( + base::StringPiece name) { + int identifier = -1; + if (name == mojom::kBrowserServiceName) + identifier = IDR_WEB_SHELL_BROWSER_MANIFEST_OVERLAY; + else if (name == mojom::kPackagedServicesServiceName) + identifier = IDR_WEB_SHELL_PACKAGED_SERVICES_MANIFEST_OVERLAY; + + if (identifier == -1) + return nullptr; + + base::StringPiece manifest_contents = + ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( + identifier, ui::ScaleFactor::SCALE_FACTOR_NONE); + return base::JSONReader::Read(manifest_contents); +} + void ShellWebClient::AllowCertificateError( WebState*, int /*cert_error*/,
diff --git a/ios/web/shell/test/BUILD.gn b/ios/web/shell/test/BUILD.gn index d310d7902..4cdbb66 100644 --- a/ios/web/shell/test/BUILD.gn +++ b/ios/web/shell/test/BUILD.gn
@@ -22,6 +22,7 @@ "pdf_egtest.mm", "plugin_placeholder_egtest.mm", "redirect_egtest.mm", + "service_manager_egtest.mm", ] deps = [ @@ -30,12 +31,15 @@ "//base/test:test_support", "//ios/testing:ios_test_support", "//ios/testing/earl_grey:earl_grey_support", + "//ios/web", "//ios/web:earl_grey_test_support", "//ios/web/public/test", "//ios/web/public/test/fakes", "//ios/web/public/test/http_server", "//ios/web/shell", "//net", + "//services/service_manager/public/cpp", + "//services/test/echo/public/interfaces", "//url", # All shared libraries must have the sanitizer deps to properly link in
diff --git a/ios/web/shell/test/service_manager_egtest.mm b/ios/web/shell/test/service_manager_egtest.mm new file mode 100644 index 0000000..4a181e4 --- /dev/null +++ b/ios/web/shell/test/service_manager_egtest.mm
@@ -0,0 +1,77 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import <EarlGrey/EarlGrey.h> + +#include "base/message_loop/message_loop.h" +#include "base/run_loop.h" +#import "ios/testing/wait_util.h" +#include "ios/web/public/service_manager_connection.h" +#import "ios/web/shell/test/earl_grey/shell_earl_grey.h" +#import "ios/web/shell/test/earl_grey/web_shell_test_case.h" +#include "services/service_manager/public/cpp/connector.h" +#include "services/test/echo/public/interfaces/echo.mojom.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace { +const char* kTestInput = "Livingston, I presume"; + +// Callback passed to echo::mojom::Echo::EchoString(). Verifies that the echoed +// string has the expected value and sets |echo_callback_called_flag| to true +// to indicate that the callback was invoked. |echo| is passed simply to ensure +// that our connection to the Echo implementation remains alive long enough for +// the callback to reach us. +void OnEchoString(echo::mojom::EchoPtr echo, + bool* echo_callback_called_flag, + const std::string& echoed_input) { + GREYAssert(kTestInput == echoed_input, + @"Unexpected string passed to echo callback: %s", + echoed_input.c_str()); + *echo_callback_called_flag = true; +} + +// Waits until the callback to echo::mojom::Echo::EchoString() is invoked (as +// signalled by that callback setting |echo_callback_called_flag| to true). +void WaitForEchoStringCallback(bool* echo_callback_called_flag) { + GREYCondition* condition = + [GREYCondition conditionWithName:@"Wait for echo string callback" + block:^BOOL { + return *echo_callback_called_flag; + }]; + GREYAssert([condition waitWithTimeout:testing::kWaitForUIElementTimeout], + @"Failed waiting for echo callback"); +} +} + +// Service Manager test cases for the web shell. +@interface ServiceManagerTestCase : WebShellTestCase +@end + +@implementation ServiceManagerTestCase + +// Tests that it is possible to connect to an embedded service that was +// registered by web_shell. +- (void)testConnectionToEmbeddedService { + // Connect to the echo service and bind an Echo instance. + echo::mojom::EchoPtr echo; + web::ServiceManagerConnection* connection = + web::ServiceManagerConnection::Get(); + DCHECK(connection); + connection->GetConnector()->BindInterface("echo", mojo::MakeRequest(&echo)); + + // Call EchoString, making sure to keep our end of the connection alive + // until the callback is received. + echo::mojom::Echo* raw_echo = echo.get(); + bool echo_callback_called = false; + raw_echo->EchoString(kTestInput, + base::BindOnce(&OnEchoString, base::Passed(&echo), + &echo_callback_called)); + + WaitForEchoStringCallback(&echo_callback_called); +} + +@end
diff --git a/ios/web/shell/web_shell_browser_manifest_overlay.json b/ios/web/shell/web_shell_browser_manifest_overlay.json new file mode 100644 index 0000000..9bb8809 --- /dev/null +++ b/ios/web/shell/web_shell_browser_manifest_overlay.json
@@ -0,0 +1,10 @@ +{ + "name": "web_browser", + "interface_provider_specs": { + "service_manager:connector": { + "requires": { + "echo": [ "echo" ] + } + } + } +}
diff --git a/ios/web/shell/web_shell_packaged_services_manifest_overlay.json b/ios/web/shell/web_shell_packaged_services_manifest_overlay.json new file mode 100644 index 0000000..ba3717be --- /dev/null +++ b/ios/web/shell/web_shell_packaged_services_manifest_overlay.json
@@ -0,0 +1,5 @@ +{ + "name": "web_packaged_services", + "display_name": "Web Shell Packaged Services", + "interface_provider_specs": {} +}
diff --git a/ios/web/test/fakes/test_navigation_manager_delegate.h b/ios/web/test/fakes/test_navigation_manager_delegate.h index 53804fb..4fce6b5 100644 --- a/ios/web/test/fakes/test_navigation_manager_delegate.h +++ b/ios/web/test/fakes/test_navigation_manager_delegate.h
@@ -7,6 +7,8 @@ #import "ios/web/navigation/navigation_manager_delegate.h" +@protocol CRWWebViewNavigationProxy; + namespace web { class TestNavigationManagerDelegate : public NavigationManagerDelegate { @@ -19,6 +21,7 @@ void OnNavigationItemCommitted( const LoadCommittedDetails& load_details) override; WebState* GetWebState() override; + id<CRWWebViewNavigationProxy> GetWebViewNavigationProxy() const override; }; } // namespace web
diff --git a/ios/web/test/fakes/test_navigation_manager_delegate.mm b/ios/web/test/fakes/test_navigation_manager_delegate.mm index 7f480b3b..85a064f 100644 --- a/ios/web/test/fakes/test_navigation_manager_delegate.mm +++ b/ios/web/test/fakes/test_navigation_manager_delegate.mm
@@ -3,6 +3,7 @@ // found in the LICENSE file. #import "ios/web/test/fakes/test_navigation_manager_delegate.h" +#import "ios/web/web_state/ui/crw_web_view_navigation_proxy.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -22,5 +23,9 @@ WebState* TestNavigationManagerDelegate::GetWebState() { return nullptr; } +id<CRWWebViewNavigationProxy> +TestNavigationManagerDelegate::GetWebViewNavigationProxy() const { + return nil; +} } // namespace web
diff --git a/ios/web/web_state/ui/crw_web_controller.h b/ios/web/web_state/ui/crw_web_controller.h index a5d8c4d..19414da 100644 --- a/ios/web/web_state/ui/crw_web_controller.h +++ b/ios/web/web_state/ui/crw_web_controller.h
@@ -13,6 +13,7 @@ #import "ios/web/public/web_state/ui/crw_web_delegate.h" #include "ios/web/public/web_state/url_verification_constants.h" #import "ios/web/web_state/ui/crw_touch_tracking_recognizer.h" +#import "ios/web/web_state/ui/crw_web_view_navigation_proxy.h" namespace web { @@ -74,6 +75,10 @@ // The web view proxy associated with this controller. @property(nonatomic, readonly) id<CRWWebViewProxy> webViewProxy; +// The web view navigation proxy associated with this controller. +@property(nonatomic, readonly) id<CRWWebViewNavigationProxy> + webViewNavigationProxy; + // The view that generates print data when printing. It is nil if printing // is not supported. @property(nonatomic, readonly) UIView* viewForPrinting;
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm index 3e2f9597..87e56e2 100644 --- a/ios/web/web_state/ui/crw_web_controller.mm +++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -88,6 +88,7 @@ #import "ios/web/web_state/ui/crw_swipe_recognizer_provider.h" #import "ios/web/web_state/ui/crw_web_controller.h" #import "ios/web/web_state/ui/crw_web_controller_container_view.h" +#import "ios/web/web_state/ui/crw_web_view_navigation_proxy.h" #import "ios/web/web_state/ui/crw_web_view_proxy_impl.h" #import "ios/web/web_state/ui/crw_wk_navigation_states.h" #import "ios/web/web_state/ui/crw_wk_script_message_router.h" @@ -1425,6 +1426,12 @@ return _webViewProxy.get(); } +- (id<CRWWebViewNavigationProxy>)webViewNavigationProxy { + DCHECK( + [self.webView conformsToProtocol:@protocol(CRWWebViewNavigationProxy)]); + return static_cast<id<CRWWebViewNavigationProxy>>(self.webView); +} + - (UIView*)viewForPrinting { // Printing is not supported for native controllers. return _webView;
diff --git a/ios/web/web_state/ui/crw_web_view_navigation_proxy.h b/ios/web/web_state/ui/crw_web_view_navigation_proxy.h new file mode 100644 index 0000000..0d6fb40 --- /dev/null +++ b/ios/web/web_state/ui/crw_web_view_navigation_proxy.h
@@ -0,0 +1,26 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_WEB_WEB_STATE_UI_WEB_VIEW_NAVIGATION_PROXY_H_ +#define IOS_WEB_WEB_STATE_UI_WEB_VIEW_NAVIGATION_PROXY_H_ + +#import <WebKit/WebKit.h> + +NS_ASSUME_NONNULL_BEGIN + +// A protocol to expose a subset of the WKWebView API to NavigationManager. +@protocol CRWWebViewNavigationProxy + +@property(nonatomic, readonly, strong) WKBackForwardList* backForwardList; +@property(nonatomic, readonly) BOOL canGoBack; +@property(nonatomic, readonly) BOOL canGoForward; + +- (nullable WKNavigation*)goBack; +- (nullable WKNavigation*)goForward; +- (nullable WKNavigation*)goToBackForwardListItem:(WKBackForwardListItem*)item; + +@end +NS_ASSUME_NONNULL_END + +#endif // IOS_WEB_WEB_STATE_UI_WEB_VIEW_NAVIGATION_PROXY_H_
diff --git a/ios/web/web_state/web_state_impl.h b/ios/web/web_state/web_state_impl.h index fbdb248b..fcf3f012 100644 --- a/ios/web/web_state/web_state_impl.h +++ b/ios/web/web_state/web_state_impl.h
@@ -30,6 +30,7 @@ @protocol CRWWebViewProxy; @class NSURLRequest; @class NSURLResponse; +@protocol CRWWebViewNavigationProxy; namespace net { class HttpResponseHeaders; @@ -269,6 +270,7 @@ void UpdateHttpResponseHeaders(const GURL& url); WebState* GetWebState() override; + id<CRWWebViewNavigationProxy> GetWebViewNavigationProxy() const override; protected: void AddObserver(WebStateObserver* observer) override;
diff --git a/ios/web/web_state/web_state_impl.mm b/ios/web/web_state/web_state_impl.mm index d918d55..676b8af 100644 --- a/ios/web/web_state/web_state_impl.mm +++ b/ios/web/web_state/web_state_impl.mm
@@ -18,6 +18,7 @@ #import "ios/web/navigation/legacy_navigation_manager_impl.h" #import "ios/web/navigation/navigation_item_impl.h" #import "ios/web/navigation/session_storage_builder.h" +#import "ios/web/navigation/wk_based_navigation_manager_impl.h" #include "ios/web/public/browser_state.h" #import "ios/web/public/crw_session_storage.h" #import "ios/web/public/java_script_dialog_presenter.h" @@ -37,6 +38,7 @@ #import "ios/web/web_state/session_certificate_policy_cache_impl.h" #import "ios/web/web_state/ui/crw_web_controller.h" #import "ios/web/web_state/ui/crw_web_controller_container_view.h" +#import "ios/web/web_state/ui/crw_web_view_navigation_proxy.h" #include "ios/web/webui/web_ui_ios_controller_factory_registry.h" #include "ios/web/webui/web_ui_ios_impl.h" #include "net/http/http_response_headers.h" @@ -80,12 +82,16 @@ created_with_opener_(params.created_with_opener), weak_factory_(this) { // Create or deserialize the NavigationManager. + if (web::GetWebClient()->IsSlimNavigationManagerEnabled()) { + navigation_manager_ = base::MakeUnique<WKBasedNavigationManagerImpl>(); + } else { + navigation_manager_ = base::MakeUnique<LegacyNavigationManagerImpl>(); + } + if (session_storage) { SessionStorageBuilder session_storage_builder; session_storage_builder.ExtractSessionState(this, session_storage); } else { - navigation_manager_ = base::WrapUnique<NavigationManagerImpl>( - new LegacyNavigationManagerImpl); certificate_policy_cache_ = base::MakeUnique<SessionCertificatePolicyCacheImpl>(); } @@ -737,4 +743,8 @@ return this; } +id<CRWWebViewNavigationProxy> WebStateImpl::GetWebViewNavigationProxy() const { + return [web_controller_ webViewNavigationProxy]; +} + } // namespace web
diff --git a/ios/web_view/BUILD.gn b/ios/web_view/BUILD.gn index 5923dc4e..a17386d 100644 --- a/ios/web_view/BUILD.gn +++ b/ios/web_view/BUILD.gn
@@ -25,7 +25,6 @@ "public/ChromeWebView.h", "public/cwv_export.h", "public/cwv_html_element.h", - "public/cwv_language_detection_result.h", "public/cwv_navigation_action.h", "public/cwv_navigation_delegate.h", "public/cwv_scroll_view.h", @@ -60,8 +59,6 @@ "internal/cwv_web_view_configuration_internal.h", "internal/pref_names.cc", "internal/pref_names.h", - "internal/translate/cwv_language_detection_result_internal.h", - "internal/translate/cwv_language_detection_result.mm", "internal/translate/cwv_translation_controller.mm", "internal/translate/cwv_translation_controller_internal.h", "internal/translate/cwv_translation_language_internal.h",
diff --git a/ios/web_view/internal/translate/cwv_language_detection_result.mm b/ios/web_view/internal/translate/cwv_language_detection_result.mm deleted file mode 100644 index 7cd0546..0000000 --- a/ios/web_view/internal/translate/cwv_language_detection_result.mm +++ /dev/null
@@ -1,32 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "ios/web_view/internal/translate/cwv_language_detection_result_internal.h" - -#import "ios/web_view/public/cwv_translation_language.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -@implementation CWVLanguageDetectionResult - -@synthesize pageLanguage = _pageLanguage; -@synthesize suggestedTargetLanguage = _suggestedTargetLanguage; -@synthesize supportedLanguages = _supportedLanguages; - -- (instancetype) - initWithPageLanguage:(CWVTranslationLanguage*)pageLanguage -suggestedTargetLanguage:(CWVTranslationLanguage*)suggestedTargetLanguage - supportedLanguages:(NSArray<CWVTranslationLanguage*>*)supportedLanguages { - self = [super init]; - if (self) { - _pageLanguage = pageLanguage; - _suggestedTargetLanguage = suggestedTargetLanguage; - _supportedLanguages = supportedLanguages; - } - return self; -} - -@end
diff --git a/ios/web_view/internal/translate/cwv_language_detection_result_internal.h b/ios/web_view/internal/translate/cwv_language_detection_result_internal.h deleted file mode 100644 index 39668841..0000000 --- a/ios/web_view/internal/translate/cwv_language_detection_result_internal.h +++ /dev/null
@@ -1,29 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_WEB_VIEW_INTERNAL_CWV_LANGUAGE_DETECTION_RESULT_INTERNAL_H -#define IOS_WEB_VIEW_INTERNAL_CWV_LANGUAGE_DETECTION_RESULT_INTERNAL_H - -#import <Foundation/Foundation.h> - -#import "ios/web_view/public/cwv_language_detection_result.h" - -NS_ASSUME_NONNULL_BEGIN - -@class CWVTranslationLanguage; - -// Internal methods for CWVLanguageDetectionResult. -@interface CWVLanguageDetectionResult () - -- (instancetype) - initWithPageLanguage:(CWVTranslationLanguage*)pageLanguage -suggestedTargetLanguage:(CWVTranslationLanguage*)suggestedTargetLanguage - supportedLanguages:(NSArray<CWVTranslationLanguage*>*)supportedLanguages - NS_DESIGNATED_INITIALIZER; - -@end - -NS_ASSUME_NONNULL_END - -#endif // IOS_WEB_VIEW_INTERNAL_CWV_LANGUAGE_DETECTION_RESULT_INTERNAL_H
diff --git a/ios/web_view/internal/translate/cwv_translation_controller.mm b/ios/web_view/internal/translate/cwv_translation_controller.mm index b82ee17..ac61509 100644 --- a/ios/web_view/internal/translate/cwv_translation_controller.mm +++ b/ios/web_view/internal/translate/cwv_translation_controller.mm
@@ -11,7 +11,6 @@ #include "base/strings/sys_string_conversions.h" #include "components/translate/core/browser/translate_download_manager.h" #include "components/translate/core/browser/translate_manager.h" -#import "ios/web_view/internal/translate/cwv_language_detection_result_internal.h" #import "ios/web_view/internal/translate/cwv_translation_language_internal.h" #import "ios/web_view/internal/translate/web_view_translate_client.h" #import "ios/web_view/public/cwv_translation_controller_delegate.h" @@ -97,36 +96,27 @@ switch (step) { case translate::TRANSLATE_STEP_BEFORE_TRANSLATE: { - NSArray* supportedLanguages = [self.supportedLanguagesByCode.allValues - sortedArrayUsingComparator:^NSComparisonResult( - CWVTranslationLanguage* languageA, - CWVTranslationLanguage* languageB) { - return [languageA.languageName compare:languageB.languageName]; - }]; - CWVLanguageDetectionResult* languageDetectionResult = - [[CWVLanguageDetectionResult alloc] - initWithPageLanguage:source - suggestedTargetLanguage:target - supportedLanguages:supportedLanguages]; if ([_delegate respondsToSelector:@selector - (translationController:didFinishLanguageDetectionWithResult - :error:)]) { + (translationController:canOfferTranslationFromLanguage + :toLanguage:)]) { [_delegate translationController:self - didFinishLanguageDetectionWithResult:languageDetectionResult - error:error]; + canOfferTranslationFromLanguage:source + toLanguage:target]; } break; } case translate::TRANSLATE_STEP_TRANSLATING: if ([_delegate respondsToSelector:@selector (translationController:didStartTranslationFromLanguage - :toLanguage:)]) { + :toLanguage:userInitiated:)]) { [_delegate translationController:self didStartTranslationFromLanguage:source - toLanguage:target]; + toLanguage:target + userInitiated:triggeredFromMenu]; } break; case translate::TRANSLATE_STEP_AFTER_TRANSLATE: + case translate::TRANSLATE_STEP_TRANSLATE_ERROR: if ([_delegate respondsToSelector:@selector (translationController:didFinishTranslationFromLanguage :toLanguage:error:)]) { @@ -137,8 +127,7 @@ } break; case translate::TRANSLATE_STEP_NEVER_TRANSLATE: - break; - case translate::TRANSLATE_STEP_TRANSLATE_ERROR: + // Not supported. break; } } @@ -146,13 +135,14 @@ #pragma mark - Public Methods - (void)translatePageFromLanguage:(CWVTranslationLanguage*)sourceLanguage - toLanguage:(CWVTranslationLanguage*)targetLanguage { + toLanguage:(CWVTranslationLanguage*)targetLanguage + userInitiated:(BOOL)userInitiated { std::string sourceLanguageCode = base::SysNSStringToUTF8(sourceLanguage.languageCode); std::string targetLanguageCode = base::SysNSStringToUTF8(targetLanguage.languageCode); _translateClient->translate_manager()->TranslatePage( - sourceLanguageCode, targetLanguageCode, false); + sourceLanguageCode, targetLanguageCode, userInitiated); } - (void)revertTranslation { @@ -235,6 +225,15 @@ #pragma mark - Private Methods +- (NSArray*)supportedLanguages { + return [self.supportedLanguagesByCode.allValues + sortedArrayUsingComparator:^NSComparisonResult( + CWVTranslationLanguage* languageA, + CWVTranslationLanguage* languageB) { + return [languageA.languageName compare:languageB.languageName]; + }]; +} + - (NSDictionary<NSString*, CWVTranslationLanguage*>*)supportedLanguagesByCode { if (!_supportedLanguagesByCode) { NSMutableDictionary<NSString*, CWVTranslationLanguage*>*
diff --git a/ios/web_view/internal/web_view_web_client.h b/ios/web_view/internal/web_view_web_client.h index b63bd7b..7e144b4 100644 --- a/ios/web_view/internal/web_view_web_client.h +++ b/ios/web_view/internal/web_view_web_client.h
@@ -22,6 +22,10 @@ std::unique_ptr<web::WebMainParts> CreateWebMainParts() override; std::string GetProduct() const override; std::string GetUserAgent(web::UserAgentType type) const override; + base::StringPiece GetDataResource( + int resource_id, + ui::ScaleFactor scale_factor) const override; + base::RefCountedMemory* GetDataResourceBytes(int resource_id) const override; NSString* GetEarlyPageScript(web::BrowserState* browser_state) const override; private:
diff --git a/ios/web_view/internal/web_view_web_client.mm b/ios/web_view/internal/web_view_web_client.mm index c011a36..85d34d11 100644 --- a/ios/web_view/internal/web_view_web_client.mm +++ b/ios/web_view/internal/web_view_web_client.mm
@@ -11,6 +11,7 @@ #import "ios/web_view/internal/web_view_early_page_script_provider.h" #import "ios/web_view/internal/web_view_web_main_parts.h" #include "ios/web_view/public/cwv_web_view.h" +#include "ui/base/resource/resource_bundle.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -34,6 +35,18 @@ return web::BuildUserAgentFromProduct(GetProduct()); } +base::StringPiece WebViewWebClient::GetDataResource( + int resource_id, + ui::ScaleFactor scale_factor) const { + return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( + resource_id, scale_factor); +} + +base::RefCountedMemory* WebViewWebClient::GetDataResourceBytes( + int resource_id) const { + return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); +} + NSString* WebViewWebClient::GetEarlyPageScript( web::BrowserState* browser_state) const { return WebViewEarlyPageScriptProvider::FromBrowserState(browser_state)
diff --git a/ios/web_view/public/ChromeWebView.h b/ios/web_view/public/ChromeWebView.h index 810bc69..19de1a4 100644 --- a/ios/web_view/public/ChromeWebView.h +++ b/ios/web_view/public/ChromeWebView.h
@@ -11,7 +11,6 @@ #import "cwv_export.h" #import "cwv_html_element.h" -#import "cwv_language_detection_result.h" #import "cwv_navigation_action.h" #import "cwv_navigation_delegate.h" #import "cwv_scroll_view.h"
diff --git a/ios/web_view/public/cwv_language_detection_result.h b/ios/web_view/public/cwv_language_detection_result.h deleted file mode 100644 index a8d0944..0000000 --- a/ios/web_view/public/cwv_language_detection_result.h +++ /dev/null
@@ -1,36 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_WEB_VIEW_PUBLIC_CWV_LANGUAGE_DETECTION_RESULT_H -#define IOS_WEB_VIEW_PUBLIC_CWV_LANGUAGE_DETECTION_RESULT_H - -#import <Foundation/Foundation.h> - -#import "cwv_export.h" - -NS_ASSUME_NONNULL_BEGIN - -@class CWVTranslationLanguage; - -// Encapsulates the results of language detection in one class. -CWV_EXPORT -@interface CWVLanguageDetectionResult : NSObject - -- (instancetype)init NS_UNAVAILABLE; - -// The detected language of the page. -@property(nonatomic, readonly) CWVTranslationLanguage* pageLanguage; - -// The suggested language to translate to. -@property(nonatomic, readonly) CWVTranslationLanguage* suggestedTargetLanguage; - -// The list of supported languages that can be used in translation. -@property(nonatomic, copy, readonly) - NSArray<CWVTranslationLanguage*>* supportedLanguages; - -@end - -NS_ASSUME_NONNULL_END - -#endif // IOS_WEB_VIEW_PUBLIC_CWV_LANGUAGE_DETECTION_RESULT_H
diff --git a/ios/web_view/public/cwv_translation_controller.h b/ios/web_view/public/cwv_translation_controller.h index ef216c53..51e33a2 100644 --- a/ios/web_view/public/cwv_translation_controller.h +++ b/ios/web_view/public/cwv_translation_controller.h
@@ -48,22 +48,24 @@ @property(nullable, nonatomic, weak) id<CWVTranslationControllerDelegate> delegate; +// A sorted list of supported languages for translation. +@property(nonatomic, readonly) + NSArray<CWVTranslationLanguage*>* supportedLanguages; + // Begins translation on the current page from |sourceLanguage| to // |targetLanguage|. These language parameters must be chosen from -// a CWWLanguageDetectionResult's |supportedLanguages|. -// This must not be called before the |delegate| receives -// |translationController:didFinishLanguageDetectionWithResult:error:|. -// TODO(crbug.com/706289): Document what happens if you call this out of order -// or many times. +// |supportedLanguages|. Set |userInitiated| to YES if translation +// is a result of explicit user action. |userInitiated| will be +// passed along to the CWVTranslationControllerDelegate methods. +// Results in a No-op if there is no current page. - (void)translatePageFromLanguage:(CWVTranslationLanguage*)sourceLanguage - toLanguage:(CWVTranslationLanguage*)targetLanguage; + toLanguage:(CWVTranslationLanguage*)targetLanguage + userInitiated:(BOOL)userInitiated; // Reverts any translations done back to the original page language. -// Note that the original page language may be different from |sourceLanguage| -// passed to |translatePageFromLanguage:toLanguage:| above. -// This must not be called before the |delegate| receives -// |translationController:didFinishLanguageDetectionWithResult:error:|. -// TODO(crbug.com/706289): Document what happens if you call this out of order. +// Note that the original page language may be different from |sourceLanguage| +// passed to |translatePageFromLanguage:toLanguage:userInitiated:| above. +// Results in No-op if the page was never translated. - (void)revertTranslation; // Sets or retrieves translation policies associated with a specified language.
diff --git a/ios/web_view/public/cwv_translation_controller_delegate.h b/ios/web_view/public/cwv_translation_controller_delegate.h index eee7c433..01b83c5 100644 --- a/ios/web_view/public/cwv_translation_controller_delegate.h +++ b/ios/web_view/public/cwv_translation_controller_delegate.h
@@ -12,27 +12,31 @@ NS_ASSUME_NONNULL_BEGIN @class CWVTranslationController; -@class CWVLanguageDetectionResult; @class CWVTranslationLanguage; // Updates delegate on translation progress. CWV_EXPORT @protocol CWVTranslationControllerDelegate<NSObject> -@required -// Called when language detection is completed. Contains information on the -// detected language, the assumed target language for translation, as well as -// all languages supported by this translation controller. -// |error| will be nonnull if language detection failed. -- (void)translationController:(CWVTranslationController*)controller - didFinishLanguageDetectionWithResult:(CWVLanguageDetectionResult*)result - error:(nullable NSError*)error; - @optional -// Called when a translation has started. +// Called if the current page is not automatically translated, but may need +// translation according to its language and the user's locale. +// |pageLanguage| is given as the detected language of the page and +// |userLanguage| is given as the best guess for the preferred native language. +- (void)translationController:(CWVTranslationController*)controller + canOfferTranslationFromLanguage:(CWVTranslationLanguage*)pageLanguage + toLanguage:(CWVTranslationLanguage*)userLanguage; + +// Called when a translation has started. |userInitiated| is YES if this +// translation was started explicitly by user action, and NO if it was started +// automatically because of a translation policy with CWVTranslationPolicyAuto. +// If translation was started by a call to CWVTranslationController's +// |translatePageFromLanguage:toLanguage:userInitiated:| method, |userInitiated| +// will be the same as the value passed to that method. - (void)translationController:(CWVTranslationController*)controller didStartTranslationFromLanguage:(CWVTranslationLanguage*)sourceLanguage - toLanguage:(CWVTranslationLanguage*)targetLanguage; + toLanguage:(CWVTranslationLanguage*)targetLanguage + userInitiated:(BOOL)userInitiated; // Called when translation finishes. |error| will be nonnull if it failed. - (void)translationController:(CWVTranslationController*)controller
diff --git a/ios/web_view/shell/shell_translation_delegate.m b/ios/web_view/shell/shell_translation_delegate.m index a16515ce..a5ec860 100644 --- a/ios/web_view/shell/shell_translation_delegate.m +++ b/ios/web_view/shell/shell_translation_delegate.m
@@ -27,8 +27,8 @@ #pragma mark - CWVTranslationDelegate methods - (void)translationController:(CWVTranslationController*)controller - didFinishLanguageDetectionWithResult:(CWVLanguageDetectionResult*)result - error:(NSError*)error { + canOfferTranslationFromLanguage:(CWVTranslationLanguage*)pageLanguage + toLanguage:(CWVTranslationLanguage*)userLanguage { __weak ShellTranslationDelegate* weakSelf = self; self.beforeTranslateActionSheet = [UIAlertController @@ -48,9 +48,11 @@ style:UIAlertActionStyleDefault handler:^(UIAlertAction* action) { weakSelf.beforeTranslateActionSheet = nil; - CWVTranslationLanguage* source = result.pageLanguage; - CWVTranslationLanguage* target = result.suggestedTargetLanguage; - [controller translatePageFromLanguage:source toLanguage:target]; + CWVTranslationLanguage* source = pageLanguage; + CWVTranslationLanguage* target = userLanguage; + [controller translatePageFromLanguage:source + toLanguage:target + userInitiated:YES]; }]; [_beforeTranslateActionSheet addAction:translateAction];
diff --git a/ipc/ipc_mojo_bootstrap.cc b/ipc/ipc_mojo_bootstrap.cc index 6f2b8fa..7219f2e 100644 --- a/ipc/ipc_mojo_bootstrap.cc +++ b/ipc/ipc_mojo_bootstrap.cc
@@ -637,9 +637,9 @@ } else { endpoint->task_runner()->PostTask( FROM_HERE, - base::Bind(&ChannelAssociatedGroupController - ::NotifyEndpointOfErrorOnEndpointThread, this, endpoint->id(), - endpoint)); + base::Bind(&ChannelAssociatedGroupController:: + NotifyEndpointOfErrorOnEndpointThread, + this, endpoint->id(), base::Unretained(endpoint))); } }
diff --git a/jingle/glue/chrome_async_socket.cc b/jingle/glue/chrome_async_socket.cc index cd95cdc..f96041c 100644 --- a/jingle/glue/chrome_async_socket.cc +++ b/jingle/glue/chrome_async_socket.cc
@@ -22,7 +22,7 @@ #include "net/socket/ssl_client_socket.h" #include "net/socket/tcp_client_socket.h" #include "net/ssl/ssl_config_service.h" -#include "third_party/webrtc/base/socketaddress.h" +#include "third_party/webrtc/rtc_base/socketaddress.h" namespace jingle_glue {
diff --git a/jingle/glue/chrome_async_socket_unittest.cc b/jingle/glue/chrome_async_socket_unittest.cc index e2c3d8e1..62a44b9 100644 --- a/jingle/glue/chrome_async_socket_unittest.cc +++ b/jingle/glue/chrome_async_socket_unittest.cc
@@ -28,9 +28,9 @@ #include "net/ssl/ssl_config_service.h" #include "net/url_request/url_request_context_getter.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/webrtc/base/ipaddress.h" -#include "third_party/webrtc/base/sigslot.h" -#include "third_party/webrtc/base/socketaddress.h" +#include "third_party/webrtc/rtc_base/ipaddress.h" +#include "third_party/webrtc/rtc_base/sigslot.h" +#include "third_party/webrtc/rtc_base/socketaddress.h" namespace jingle_glue {
diff --git a/jingle/glue/jingle_glue_mock_objects.h b/jingle/glue/jingle_glue_mock_objects.h index 0e65847f..1cfd139 100644 --- a/jingle/glue/jingle_glue_mock_objects.h +++ b/jingle/glue/jingle_glue_mock_objects.h
@@ -8,7 +8,7 @@ #include <stddef.h> #include "testing/gmock/include/gmock/gmock.h" -#include "third_party/webrtc/base/stream.h" +#include "third_party/webrtc/rtc_base/stream.h" namespace jingle_glue {
diff --git a/jingle/glue/logging_unittest.cc b/jingle/glue/logging_unittest.cc index fc36f526..21d1d96 100644 --- a/jingle/glue/logging_unittest.cc +++ b/jingle/glue/logging_unittest.cc
@@ -18,7 +18,7 @@ #define LOGGING_INSIDE_WEBRTC #include "build/build_config.h" -#include "third_party/webrtc_overrides/webrtc/base/logging.h" +#include "third_party/webrtc_overrides/webrtc/rtc_base/logging.h" #if defined(OS_WIN) static const wchar_t* const log_file_name = L"libjingle_logging.log";
diff --git a/jingle/glue/thread_wrapper.cc b/jingle/glue/thread_wrapper.cc index 9ea45ba..e491fa5 100644 --- a/jingle/glue/thread_wrapper.cc +++ b/jingle/glue/thread_wrapper.cc
@@ -13,7 +13,7 @@ #include "base/macros.h" #include "base/threading/thread_local.h" #include "base/trace_event/trace_event.h" -#include "third_party/webrtc/base/nullsocketserver.h" +#include "third_party/webrtc/rtc_base/nullsocketserver.h" namespace jingle_glue {
diff --git a/jingle/glue/thread_wrapper.h b/jingle/glue/thread_wrapper.h index b900db69..0c6be32 100644 --- a/jingle/glue/thread_wrapper.h +++ b/jingle/glue/thread_wrapper.h
@@ -17,7 +17,7 @@ #include "base/single_thread_task_runner.h" #include "base/synchronization/lock.h" #include "base/synchronization/waitable_event.h" -#include "third_party/webrtc/base/thread.h" +#include "third_party/webrtc/rtc_base/thread.h" namespace jingle_glue {
diff --git a/jingle/glue/utils.cc b/jingle/glue/utils.cc index 4ea1d36..606eb25 100644 --- a/jingle/glue/utils.cc +++ b/jingle/glue/utils.cc
@@ -14,9 +14,9 @@ #include "base/values.h" #include "net/base/ip_address.h" #include "net/base/ip_endpoint.h" -#include "third_party/webrtc/base/byteorder.h" -#include "third_party/webrtc/base/socketaddress.h" #include "third_party/webrtc/p2p/base/candidate.h" +#include "third_party/webrtc/rtc_base/byteorder.h" +#include "third_party/webrtc/rtc_base/socketaddress.h" namespace jingle_glue {
diff --git a/jingle/glue/utils.h b/jingle/glue/utils.h index 1acd749..53272f9 100644 --- a/jingle/glue/utils.h +++ b/jingle/glue/utils.h
@@ -7,7 +7,7 @@ #include <string> -#include "third_party/webrtc/base/ipaddress.h" +#include "third_party/webrtc/rtc_base/ipaddress.h" namespace net { class IPAddress;
diff --git a/jingle/notifier/DEPS b/jingle/notifier/DEPS index 80bd8ce..7fef78a 100644 --- a/jingle/notifier/DEPS +++ b/jingle/notifier/DEPS
@@ -1,5 +1,5 @@ include_rules = [ - "+webrtc/base", + "+webrtc/rtc_base", "+third_party/libjingle_xmpp/xmpp", "+third_party/libjingle_xmpp/xmllite", ]
diff --git a/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc b/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc index dec9aeb..83f9f9b 100644 --- a/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc +++ b/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc
@@ -10,7 +10,7 @@ #include "base/macros.h" #include "third_party/libjingle_xmpp/xmpp/constants.h" #include "third_party/libjingle_xmpp/xmpp/saslcookiemechanism.h" -#include "webrtc/base/socketaddress.h" +#include "webrtc/rtc_base/socketaddress.h" namespace notifier {
diff --git a/jingle/notifier/base/weak_xmpp_client_unittest.cc b/jingle/notifier/base/weak_xmpp_client_unittest.cc index d55df72..88340346 100644 --- a/jingle/notifier/base/weak_xmpp_client_unittest.cc +++ b/jingle/notifier/base/weak_xmpp_client_unittest.cc
@@ -12,7 +12,7 @@ #include "jingle/glue/task_pump.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webrtc/base/sigslot.h" +#include "webrtc/rtc_base/sigslot.h" namespace notifier {
diff --git a/jingle/notifier/base/xmpp_connection.h b/jingle/notifier/base/xmpp_connection.h index 1b6e415..50c7e00 100644 --- a/jingle/notifier/base/xmpp_connection.h +++ b/jingle/notifier/base/xmpp_connection.h
@@ -16,7 +16,7 @@ #include "base/sequence_checker.h" #include "net/url_request/url_request_context_getter.h" #include "third_party/libjingle_xmpp/xmpp/xmppengine.h" -#include "webrtc/base/sigslot.h" +#include "webrtc/rtc_base/sigslot.h" namespace buzz { class PreXmppAuth;
diff --git a/jingle/notifier/communicator/connection_settings.h b/jingle/notifier/communicator/connection_settings.h index e36d9f1f..863d94f 100644 --- a/jingle/notifier/communicator/connection_settings.h +++ b/jingle/notifier/communicator/connection_settings.h
@@ -11,7 +11,7 @@ #include <vector> #include "jingle/notifier/base/server_information.h" -#include "webrtc/base/socketaddress.h" +#include "webrtc/rtc_base/socketaddress.h" namespace buzz { class XmppClientSettings;
diff --git a/jingle/notifier/communicator/login.cc b/jingle/notifier/communicator/login.cc index d235c48..e938b06e 100644 --- a/jingle/notifier/communicator/login.cc +++ b/jingle/notifier/communicator/login.cc
@@ -17,9 +17,9 @@ #include "third_party/libjingle_xmpp/xmpp/xmppclient.h" #include "third_party/libjingle_xmpp/xmpp/xmppclientsettings.h" #include "third_party/libjingle_xmpp/xmpp/xmppengine.h" -#include "webrtc/base/firewallsocketserver.h" -#include "webrtc/base/logging.h" -#include "webrtc/base/physicalsocketserver.h" +#include "webrtc/rtc_base/firewallsocketserver.h" +#include "webrtc/rtc_base/logging.h" +#include "webrtc/rtc_base/physicalsocketserver.h" namespace notifier {
diff --git a/jingle/notifier/communicator/login_settings.cc b/jingle/notifier/communicator/login_settings.cc index 055febb..25b3864 100644 --- a/jingle/notifier/communicator/login_settings.cc +++ b/jingle/notifier/communicator/login_settings.cc
@@ -9,7 +9,7 @@ #include "base/logging.h" #include "jingle/notifier/base/server_information.h" #include "net/cert/cert_verifier.h" -#include "webrtc/base/socketaddress.h" +#include "webrtc/rtc_base/socketaddress.h" namespace notifier {
diff --git a/media/audio/audio_device_description.cc b/media/audio/audio_device_description.cc index 9d822a7..613c9f4d 100644 --- a/media/audio/audio_device_description.cc +++ b/media/audio/audio_device_description.cc
@@ -20,6 +20,12 @@ } // static +bool AudioDeviceDescription::IsLoopbackDevice(const std::string& device_id) { + return device_id.compare(kLoopbackInputDeviceId) == 0 || + device_id.compare(kLoopbackWithMuteDeviceId) == 0; +} + +// static bool AudioDeviceDescription::UseSessionIdToSelectDevice( int session_id, const std::string& device_id) {
diff --git a/media/audio/audio_device_description.h b/media/audio/audio_device_description.h index d58f04c1..b9780ba 100644 --- a/media/audio/audio_device_description.h +++ b/media/audio/audio_device_description.h
@@ -38,6 +38,9 @@ // Returns true if |device_id| represents the default device. static bool IsDefaultDevice(const std::string& device_id); + // Returns true if |device_id| represents a loopback audio capture device. + static bool IsLoopbackDevice(const std::string& device_id); + // If |device_id| is not empty, |session_id| should be ignored and the output // device should be selected basing on |device_id|. // If |device_id| is empty and |session_id| is nonzero, output device
diff --git a/media/audio/audio_system_impl.cc b/media/audio/audio_system_impl.cc index 42d0bb7..707ae2d 100644 --- a/media/audio/audio_system_impl.cc +++ b/media/audio/audio_system_impl.cc
@@ -163,9 +163,17 @@ // TODO(olka): remove this when AudioManager::GetInputStreamParameters() // returns invalid parameters if the device is not found. - if (!audio_manager->HasAudioInputDevices()) - return AudioParameters(); - + if (AudioDeviceDescription::IsLoopbackDevice(device_id)) { + // For system audio capture, we need an output device (namely speaker) + // instead of an input device (namely microphone) to work. + // AudioManager::GetInputStreamParameters will check |device_id| and + // query the correct device for audio parameters by itself. + if (!audio_manager->HasAudioOutputDevices()) + return AudioParameters(); + } else { + if (!audio_manager->HasAudioInputDevices()) + return AudioParameters(); + } return audio_manager->GetInputStreamParameters(device_id); }
diff --git a/media/cdm/cenc_utils.cc b/media/cdm/cenc_utils.cc index 20267c9..f885061 100644 --- a/media/cdm/cenc_utils.cc +++ b/media/cdm/cenc_utils.cc
@@ -32,6 +32,9 @@ std::vector<mp4::FullProtectionSystemSpecificHeader>* pssh_boxes) { DCHECK(!input.empty()); + // TODO(wolenetz): Questionable MediaLog usage, http://crbug.com/712310 + MediaLog media_log; + // Verify that |input| contains only 'pssh' boxes. // ReadAllChildrenAndCheckFourCC() is templated, so it checks that each // box in |input| matches the box type of the parameter (in this case @@ -40,7 +43,8 @@ // so this simply verifies that |input| only contains 'pssh' boxes and // nothing else. std::unique_ptr<mp4::BoxReader> input_reader( - mp4::BoxReader::ReadConcatentatedBoxes(input.data(), input.size())); + mp4::BoxReader::ReadConcatentatedBoxes(input.data(), input.size(), + &media_log)); std::vector<mp4::ProtectionSystemSpecificHeader> raw_pssh_boxes; if (!input_reader->ReadAllChildrenAndCheckFourCC(&raw_pssh_boxes)) return false; @@ -53,7 +57,8 @@ for (const auto& raw_pssh_box : raw_pssh_boxes) { std::unique_ptr<mp4::BoxReader> raw_pssh_reader( mp4::BoxReader::ReadConcatentatedBoxes(raw_pssh_box.raw_box.data(), - raw_pssh_box.raw_box.size())); + raw_pssh_box.raw_box.size(), + &media_log)); // ReadAllChildren() appends any successfully parsed box onto it's // parameter, so |pssh_boxes| will contain the collection of successfully // parsed 'pssh' boxes. If an error occurs, try the next box.
diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc index 8968c2a..b3483c0 100644 --- a/media/filters/vpx_video_decoder.cc +++ b/media/filters/vpx_video_decoder.cc
@@ -65,7 +65,7 @@ ~VpxOffloadThread() {} scoped_refptr<base::SingleThreadTaskRunner> RequestOffloadThread() { - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); ++offload_thread_users_; if (!offload_thread_.IsRunning()) offload_thread_.Start(); @@ -74,7 +74,7 @@ } void WaitForOutstandingTasks() { - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(offload_thread_users_); DCHECK(offload_thread_.IsRunning()); base::WaitableEvent waiter(base::WaitableEvent::ResetPolicy::AUTOMATIC, @@ -85,31 +85,29 @@ waiter.Wait(); } - void WaitForOutstandingTasksAndReleaseOffloadThread() { - DCHECK(thread_checker_.CalledOnValidThread()); - DCHECK(offload_thread_users_); - DCHECK(offload_thread_.IsRunning()); - WaitForOutstandingTasks(); - if (!--offload_thread_users_) { - // Don't shut down the thread immediately in case we're in the middle of - // a configuration change. - base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&VpxOffloadThread::ShutdownOffloadThread, - base::Unretained(this)), - base::TimeDelta::FromSeconds(5)); - } + void ReleaseOffloadThread() { + if (--offload_thread_users_) + return; + + // Don't shut down the thread immediately in case we're in the middle of + // a configuration change. + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( + FROM_HERE, + base::Bind(&VpxOffloadThread::ShutdownOffloadThread, + base::Unretained(this)), + base::TimeDelta::FromSeconds(5)); } private: void ShutdownOffloadThread() { - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (!offload_thread_users_) offload_thread_.Stop(); } int offload_thread_users_ = 0; base::Thread offload_thread_; - base::ThreadChecker thread_checker_; + THREAD_CHECKER(thread_checker_); DISALLOW_COPY_AND_ASSIGN(VpxOffloadThread); }; @@ -216,13 +214,12 @@ void Shutdown(); - // Reference counted frame buffers used for VP9 decoding. Reference counting - // is done manually because both chromium and libvpx has to release this - // before a buffer can be re-used. + // Reference counted frame buffers used for VP9 decoding. struct VP9FrameBuffer { std::vector<uint8_t> data; std::vector<uint8_t> alpha_data; - uint32_t ref_cnt = 0; + bool held_by_libvpx = false; + bool held_by_frame = false; base::TimeTicks last_use_time; }; @@ -236,7 +233,9 @@ friend class base::RefCountedThreadSafe<VpxVideoDecoder::MemoryPool>; ~MemoryPool() override; - // Drop all entries in |frame_buffers_| with a zero |ref_cnt|. + static bool IsUsed(const VP9FrameBuffer* buf); + + // Drop all entries in |frame_buffers_| that report !IsUsed(). void EraseUnusedResources(); // Gets the next available frame buffer for use by libvpx. @@ -251,27 +250,42 @@ bool in_shutdown_ = false; + bool registered_dump_provider_ = false; + // |tick_clock_| is always &|default_tick_clock_| outside of testing. base::DefaultTickClock default_tick_clock_; base::TickClock* tick_clock_; + THREAD_CHECKER(thread_checker_); + DISALLOW_COPY_AND_ASSIGN(MemoryPool); }; -VpxVideoDecoder::MemoryPool::MemoryPool() : tick_clock_(&default_tick_clock_) {} +VpxVideoDecoder::MemoryPool::MemoryPool() : tick_clock_(&default_tick_clock_) { + DETACH_FROM_THREAD(thread_checker_); +} VpxVideoDecoder::MemoryPool::~MemoryPool() { DCHECK(in_shutdown_); + + // May be destructed on any thread. } VpxVideoDecoder::MemoryPool::VP9FrameBuffer* VpxVideoDecoder::MemoryPool::GetFreeFrameBuffer(size_t min_size) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(!in_shutdown_); + if (!registered_dump_provider_) { + base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( + this, "VpxVideoDecoder", base::ThreadTaskRunnerHandle::Get()); + registered_dump_provider_ = true; + } + // Check if a free frame buffer exists. size_t i = 0; for (; i < frame_buffers_.size(); ++i) { - if (frame_buffers_[i]->ref_cnt == 0) + if (!IsUsed(frame_buffers_[i].get())) break; } @@ -302,7 +316,9 @@ fb->data = &fb_to_use->data[0]; fb->size = fb_to_use->data.size(); - ++fb_to_use->ref_cnt; + + DCHECK(!IsUsed(fb_to_use)); + fb_to_use->held_by_libvpx = true; // Set the frame buffer's private data to point at the external frame buffer. fb->priv = static_cast<void*>(fb_to_use); @@ -318,10 +334,12 @@ if (!fb->priv) return -1; + // Note: libvpx may invoke this method multiple times for the same frame, so + // we can't DCHECK that |held_by_libvpx| is true. VP9FrameBuffer* frame_buffer = static_cast<VP9FrameBuffer*>(fb->priv); - --frame_buffer->ref_cnt; + frame_buffer->held_by_libvpx = false; - if (!frame_buffer->ref_cnt) { + if (!IsUsed(frame_buffer)) { // TODO(dalecurtis): This should be |tick_clock_| but we don't have access // to the main class from this static function and its only needed for tests // which all hit the OnVideoFrameDestroyed() path below instead. @@ -333,8 +351,11 @@ base::Closure VpxVideoDecoder::MemoryPool::CreateFrameCallback( void* fb_priv_data) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + VP9FrameBuffer* frame_buffer = static_cast<VP9FrameBuffer*>(fb_priv_data); - ++frame_buffer->ref_cnt; + frame_buffer->held_by_frame = true; + return BindToCurrentLoop( base::Bind(&MemoryPool::OnVideoFrameDestroyed, this, frame_buffer)); } @@ -342,6 +363,8 @@ bool VpxVideoDecoder::MemoryPool::OnMemoryDump( const base::trace_event::MemoryDumpArgs& args, base::trace_event::ProcessMemoryDump* pmd) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + base::trace_event::MemoryAllocatorDump* memory_dump = pmd->CreateAllocatorDump("media/vpx/memory_pool"); base::trace_event::MemoryAllocatorDump* used_memory_dump = @@ -353,7 +376,7 @@ size_t bytes_used = 0; size_t bytes_reserved = 0; for (const auto& frame_buffer : frame_buffers_) { - if (frame_buffer->ref_cnt) + if (IsUsed(frame_buffer.get())) bytes_used += frame_buffer->data.size(); bytes_reserved += frame_buffer->data.size(); } @@ -369,22 +392,39 @@ } void VpxVideoDecoder::MemoryPool::Shutdown() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); in_shutdown_ = true; - // Drop unused resources. We must maintain ownership of buffers marked as - // used since libvpx may not have cleaned up its refs during shutdown; these - // are safe to release since libvpx is destroyed before the pool. + + if (registered_dump_provider_) { + base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( + this); + } + + // Clear any refs held by libvpx which isn't good about cleaning up after + // itself. This is safe since libvpx has already been shutdown by this point. + for (const auto& frame_buffer : frame_buffers_) + frame_buffer->held_by_libvpx = false; + EraseUnusedResources(); } +// static +bool VpxVideoDecoder::MemoryPool::IsUsed(const VP9FrameBuffer* buf) { + return buf->held_by_libvpx || buf->held_by_frame; +} + void VpxVideoDecoder::MemoryPool::EraseUnusedResources() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); base::EraseIf(frame_buffers_, [](const std::unique_ptr<VP9FrameBuffer>& buf) { - return !buf->ref_cnt; + return !IsUsed(buf.get()); }); } void VpxVideoDecoder::MemoryPool::OnVideoFrameDestroyed( VP9FrameBuffer* frame_buffer) { - --frame_buffer->ref_cnt; + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + DCHECK(frame_buffer->held_by_frame); + frame_buffer->held_by_frame = false; if (in_shutdown_) { // If we're in shutdown we can be sure that libvpx has been destroyed. @@ -393,13 +433,14 @@ } const base::TimeTicks now = tick_clock_->NowTicks(); - if (!frame_buffer->ref_cnt) + if (!IsUsed(frame_buffer)) frame_buffer->last_use_time = now; - base::EraseIf( - frame_buffers_, [now](const std::unique_ptr<VP9FrameBuffer>& buf) { - return !buf->ref_cnt && now - buf->last_use_time > kStaleFrameLimit; - }); + base::EraseIf(frame_buffers_, + [now](const std::unique_ptr<VP9FrameBuffer>& buf) { + return !IsUsed(buf.get()) && + now - buf->last_use_time > kStaleFrameLimit; + }); } VpxVideoDecoder::VpxVideoDecoder() @@ -577,10 +618,6 @@ DCHECK(!memory_pool_); memory_pool_ = new MemoryPool(); - base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( - memory_pool_.get(), "VpxVideoDecoder", - base::ThreadTaskRunnerHandle::Get()); - if (vpx_codec_set_frame_buffer_functions(vpx_codec_, &MemoryPool::GetVP9FrameBuffer, &MemoryPool::ReleaseVP9FrameBuffer, @@ -599,27 +636,38 @@ } void VpxVideoDecoder::CloseDecoder() { - if (offload_task_runner_) { - GetOffloadThread()->WaitForOutstandingTasksAndReleaseOffloadThread(); - offload_task_runner_ = nullptr; - } + if (offload_task_runner_) + GetOffloadThread()->WaitForOutstandingTasks(); if (vpx_codec_) { vpx_codec_destroy(vpx_codec_); delete vpx_codec_; vpx_codec_ = nullptr; } + if (vpx_codec_alpha_) { vpx_codec_destroy(vpx_codec_alpha_); delete vpx_codec_alpha_; vpx_codec_alpha_ = nullptr; } + if (memory_pool_) { - base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( - memory_pool_.get()); - memory_pool_->Shutdown(); + if (offload_task_runner_) { + // Shutdown must be called on the same thread as buffers are created. + offload_task_runner_->PostTask( + FROM_HERE, + base::Bind(&VpxVideoDecoder::MemoryPool::Shutdown, memory_pool_)); + } else { + memory_pool_->Shutdown(); + } + memory_pool_ = nullptr; } + + if (offload_task_runner_) { + GetOffloadThread()->ReleaseOffloadThread(); + offload_task_runner_ = nullptr; + } } bool VpxVideoDecoder::VpxDecode(const scoped_refptr<DecoderBuffer>& buffer,
diff --git a/media/formats/mp4/box_reader.cc b/media/formats/mp4/box_reader.cc index a6f94c9..8e22539 100644 --- a/media/formats/mp4/box_reader.cc +++ b/media/formats/mp4/box_reader.cc
@@ -157,10 +157,9 @@ // static BoxReader* BoxReader::ReadConcatentatedBoxes(const uint8_t* buf, - const size_t buf_size) { - // TODO(wolenetz): Questionable MediaLog usage, http://crbug.com/712310 - MediaLog media_log; - BoxReader* reader = new BoxReader(buf, buf_size, &media_log, true); + const size_t buf_size, + MediaLog* media_log) { + BoxReader* reader = new BoxReader(buf, buf_size, media_log, true); // Concatenated boxes are passed in without a wrapping parent box. Set // |box_size_| to the concatenated buffer length to mimic having already
diff --git a/media/formats/mp4/box_reader.h b/media/formats/mp4/box_reader.h index 96e9ae53..320b64f 100644 --- a/media/formats/mp4/box_reader.h +++ b/media/formats/mp4/box_reader.h
@@ -123,7 +123,8 @@ // // |buf| is retained but not owned, and must outlive the BoxReader instance. static BoxReader* ReadConcatentatedBoxes(const uint8_t* buf, - const size_t buf_size); + const size_t buf_size, + MediaLog* media_log); // Returns true if |type| is recognized to be a top-level box, false // otherwise. This returns true for some boxes which we do not parse.
diff --git a/media/gpu/h264_decoder.cc b/media/gpu/h264_decoder.cc index d5b0aee..72c46c2 100644 --- a/media/gpu/h264_decoder.cc +++ b/media/gpu/h264_decoder.cc
@@ -21,14 +21,14 @@ H264Decoder::H264Accelerator::~H264Accelerator() {} H264Decoder::H264Decoder(H264Accelerator* accelerator) - : max_frame_num_(0), + : state_(kNeedStreamMetadata), + max_frame_num_(0), max_pic_num_(0), max_long_term_frame_idx_(0), max_num_reorder_frames_(0), accelerator_(accelerator) { DCHECK(accelerator_); Reset(); - state_ = kNeedStreamMetadata; } H264Decoder::~H264Decoder() {}
diff --git a/media/gpu/ipc/service/gpu_jpeg_decode_accelerator_unittest.cc b/media/gpu/ipc/service/gpu_jpeg_decode_accelerator_unittest.cc index 9a719159..df9c843 100644 --- a/media/gpu/ipc/service/gpu_jpeg_decode_accelerator_unittest.cc +++ b/media/gpu/ipc/service/gpu_jpeg_decode_accelerator_unittest.cc
@@ -95,7 +95,7 @@ auto* decoder_ptr = decoder.get(); ON_CALL(*decoder, Initialize(_)).WillByDefault(Return(true)); - IPC::MessageFilter* message_filter = nullptr; + scoped_refptr<IPC::MessageFilter> message_filter = nullptr; EXPECT_CALL(*this, GetMockJpegDecodeAccelerator(_)) .WillOnce(InvokeWithoutArgs([&decoder]() { return std::move(decoder); })); EXPECT_CALL(gpu_channel_, AddFilter(_)).WillOnce(SaveArg<0>(&message_filter)); @@ -124,7 +124,8 @@ io_task_runner->PostTaskAndReply( FROM_HERE, base::Bind(&GpuJpegDecodeAcceleratorTest::SendStubFrame, - base::Unretained(this), message_filter, kArbitraryRouteId), + base::Unretained(this), base::RetainedRef(message_filter), + kArbitraryRouteId), run_loop2.QuitClosure()); run_loop2.Run(); }
diff --git a/media/gpu/video_decode_accelerator_unittest.cc b/media/gpu/video_decode_accelerator_unittest.cc index 376dd4e7..fdfe898c 100644 --- a/media/gpu/video_decode_accelerator_unittest.cc +++ b/media/gpu/video_decode_accelerator_unittest.cc
@@ -267,13 +267,7 @@ void SetUp() override { base::Thread::Options options; -#if defined(OS_WIN) options.message_loop_type = base::MessageLoop::TYPE_UI; -#elif defined(USE_OZONE) - // Some ozone platforms (e.g. drm) expects to be able to watch a file - // handler from this thread. So use the IO type message loop here. - options.message_loop_type = base::MessageLoop::TYPE_IO; -#endif rendering_thread_.StartWithOptions(options); base::WaitableEvent done(base::WaitableEvent::ResetPolicy::AUTOMATIC, @@ -289,12 +283,15 @@ // // This also needs to be done in the test environment since this shouldn't // be initialized multiple times for the same Ozone platform. - gpu_helper_->Initialize(base::ThreadTaskRunnerHandle::Get(), - GetRenderingTaskRunner()); - // Part of the initialization happens on the rendering thread. Make sure it - // has completed, otherwise we may start using resources that are not yet - // available. - rendering_thread_.FlushForTesting(); + gpu_helper_->Initialize(base::ThreadTaskRunnerHandle::Get()); + // Flush the message loop for the current thread (UI) as the rendering + // thread will make calls to it during initialization. + { + base::MessageLoop::ScopedNestableTaskAllower nest_loop( + base::MessageLoop::current()); + base::RunLoop flush_ui_loop; + flush_ui_loop.RunUntilIdle(); + } #endif }
diff --git a/mojo/android/BUILD.gn b/mojo/android/BUILD.gn index 525e7fc..179eb6f 100644 --- a/mojo/android/BUILD.gn +++ b/mojo/android/BUILD.gn
@@ -140,6 +140,8 @@ "//mojo/public/cpp/test_support:test_utils", ] defines = [ "UNIT_TEST" ] + configs -= [ "//build/config/android:hide_all_but_jni_onload" ] + configs += [ "//build/config/android:hide_all_but_jni" ] } instrumentation_test_apk("mojo_test_apk") {
diff --git a/mojo/edk/embedder/entrypoints.cc b/mojo/edk/embedder/entrypoints.cc index 43c4c22..9412b79a 100644 --- a/mojo/edk/embedder/entrypoints.cc +++ b/mojo/edk/embedder/entrypoints.cc
@@ -84,9 +84,10 @@ handles, num_handles, flags); } -MojoResult MojoReleaseMessageContextImpl(MojoMessageHandle message, - uintptr_t* context) { - return g_core->ReleaseMessageContext(message, context); +MojoResult MojoGetMessageContextImpl(MojoMessageHandle message, + uintptr_t* context, + MojoGetMessageContextFlags flags) { + return g_core->GetMessageContext(message, context, flags); } MojoResult MojoCreateMessagePipeImpl( @@ -262,7 +263,7 @@ MojoDestroyMessageImpl, MojoSerializeMessageImpl, MojoGetSerializedMessageContentsImpl, - MojoReleaseMessageContextImpl, + MojoGetMessageContextImpl, MojoWrapPlatformHandleImpl, MojoUnwrapPlatformHandleImpl, MojoWrapPlatformSharedBufferHandleImpl,
diff --git a/mojo/edk/system/core.cc b/mojo/edk/system/core.cc index c47e4aa..168bbf4 100644 --- a/mojo/edk/system/core.cc +++ b/mojo/edk/system/core.cc
@@ -546,8 +546,9 @@ UserMessageImpl::ExtractBadHandlePolicy::kAbort, handles); } -MojoResult Core::ReleaseMessageContext(MojoMessageHandle message_handle, - uintptr_t* context) { +MojoResult Core::GetMessageContext(MojoMessageHandle message_handle, + uintptr_t* context, + MojoGetMessageContextFlags flags) { if (!message_handle) return MOJO_RESULT_INVALID_ARGUMENT; @@ -556,7 +557,10 @@ if (!message->HasContext()) return MOJO_RESULT_NOT_FOUND; - *context = message->ReleaseContext(); + if (flags & MOJO_GET_MESSAGE_CONTEXT_FLAG_RELEASE) + *context = message->ReleaseContext(); + else + *context = message->context(); return MOJO_RESULT_OK; }
diff --git a/mojo/edk/system/core.h b/mojo/edk/system/core.h index 43b2253b..ba98af5c 100644 --- a/mojo/edk/system/core.h +++ b/mojo/edk/system/core.h
@@ -203,8 +203,9 @@ MojoHandle* handles, uint32_t* num_handles, MojoGetSerializedMessageContentsFlags flags); - MojoResult ReleaseMessageContext(MojoMessageHandle message_handle, - uintptr_t* context); + MojoResult GetMessageContext(MojoMessageHandle message_handle, + uintptr_t* context, + MojoGetMessageContextFlags flags); MojoResult GetProperty(MojoPropertyType type, void* value); // These methods correspond to the API functions defined in
diff --git a/mojo/edk/system/core_unittest.cc b/mojo/edk/system/core_unittest.cc index 7e03e85..fd9731ef 100644 --- a/mojo/edk/system/core_unittest.cc +++ b/mojo/edk/system/core_unittest.cc
@@ -209,7 +209,9 @@ ASSERT_EQ(MOJO_RESULT_OK, core()->ReadMessage(h[0], &message, MOJO_READ_MESSAGE_FLAG_NONE)); uintptr_t context; - ASSERT_EQ(MOJO_RESULT_OK, core()->ReleaseMessageContext(message, &context)); + ASSERT_EQ(MOJO_RESULT_OK, + core()->GetMessageContext(message, &context, + MOJO_GET_MESSAGE_CONTEXT_FLAG_RELEASE)); ASSERT_EQ(kTestMessageContext, context); ASSERT_EQ(MOJO_RESULT_OK, core()->DestroyMessage(message)); @@ -290,7 +292,8 @@ MOJO_READ_MESSAGE_FLAG_NONE)); uintptr_t context; ASSERT_EQ(MOJO_RESULT_OK, - core()->ReleaseMessageContext(message_handle, &context)); + core()->GetMessageContext(message_handle, &context, + MOJO_GET_MESSAGE_CONTEXT_FLAG_RELEASE)); ASSERT_EQ(kTestMessageContext, context); ASSERT_EQ(MOJO_RESULT_OK, MojoDestroyMessage(message_handle));
diff --git a/mojo/edk/system/message_unittest.cc b/mojo/edk/system/message_unittest.cc index 07f402e..c02c1ff 100644 --- a/mojo/edk/system/message_unittest.cc +++ b/mojo/edk/system/message_unittest.cc
@@ -45,7 +45,8 @@ MojoMessageHandle handle = MOJO_HANDLE_INVALID; std::swap(handle, *message_handle); uintptr_t context; - MojoResult rv = MojoReleaseMessageContext(handle, &context); + MojoResult rv = MojoGetMessageContext( + handle, &context, MOJO_GET_MESSAGE_CONTEXT_FLAG_RELEASE); DCHECK_EQ(MOJO_RESULT_OK, rv); MojoDestroyMessage(handle); return base::WrapUnique(reinterpret_cast<T*>(context)); @@ -385,7 +386,8 @@ MojoReadMessage(b, &message_handle, MOJO_READ_MESSAGE_FLAG_NONE)); uintptr_t context; EXPECT_EQ(MOJO_RESULT_NOT_FOUND, - MojoReleaseMessageContext(message_handle, &context)); + MojoGetMessageContext(message_handle, &context, + MOJO_GET_MESSAGE_CONTEXT_FLAG_RELEASE)); MojoClose(a); MojoClose(b); }
diff --git a/mojo/edk/system/node_controller.cc b/mojo/edk/system/node_controller.cc index d4b2b641..7202849 100644 --- a/mojo/edk/system/node_controller.cc +++ b/mojo/edk/system/node_controller.cc
@@ -1240,7 +1240,7 @@ io_task_runner_->PostTask( FROM_HERE, base::Bind(&NodeController::OnChannelError, base::Unretained(this), - from_node, channel)); + from_node, base::RetainedRef(channel))); } }
diff --git a/mojo/public/c/system/message_pipe.h b/mojo/public/c/system/message_pipe.h index 07967bf..d83155a 100644 --- a/mojo/public/c/system/message_pipe.h +++ b/mojo/public/c/system/message_pipe.h
@@ -76,8 +76,24 @@ #define MOJO_READ_MESSAGE_FLAG_NONE ((MojoReadMessageFlags)0) #endif +// |MojoGetMessageContextFlags|: Used to specify different options for +// |MojoGetMessageContext|. +// |MOJO_GET_MESSAGE_CONTEXT_FLAG_NONE| - No flags; default mode. +// |MOJO_GET_MESSAGE_CONTEXT_FLAG_RELEASE| - Causes the message object to +// release its reference to its own context before returning. + +typedef uint32_t MojoGetMessageContextFlags; + +#ifdef __cplusplus +const MojoGetMessageContextFlags MOJO_GET_MESSAGE_CONTEXT_FLAG_NONE = 0; +const MojoGetMessageContextFlags MOJO_GET_MESSAGE_CONTEXT_FLAG_RELEASE = 1; +#else +#define MOJO_GET_MESSAGE_CONTEXT_FLAG_NONE ((MojoGetMessageContextFlags)0) +#define MOJO_GET_MESSAGE_CONTEXT_FLAG_RELEASE ((MojoGetMessageContextFlags)1) +#endif + // |MojoGetSerializedMessageContentsFlags|: Used to specify different options -// |MojoGetSerializedMessageContents()|. +// for |MojoGetSerializedMessageContents()|. // |MOJO_GET_SERIALIZED_MESSAGE_CONTENTS_FLAG_NONE| - No flags; default mode. typedef uint32_t MojoGetSerializedMessageContentsFlags; @@ -327,7 +343,7 @@ // not a valid message handle. // |MOJO_RESULT_FAILED_PRECONDITION| if |message| is not a serialized message. // The caller may either use |MojoSerializeMessage()| and try again, or -// use |MojoReleaseMessageContext()| to extract the message's unserialized +// use |MojoGetMessageContext()| to extract the message's unserialized // context. // |MOJO_RESULT_NOT_FOUND| if the message's serialized contents have already // been extracted (or have failed to be extracted) by a previous call to @@ -349,9 +365,12 @@ uint32_t* num_handles, MojoGetSerializedMessageContentsFlags flags); -// Detaches the user-provided context from a message and returns it to the +// Extracts the user-provided context from a message and returns it to the // caller. This can only succeed if the message is not in a serialized form. // +// |flags|: Flags to alter the behavior of this call. See +// |MojoGetMessageContextFlags| for details. +// // Returns: // |MOJO_RESULT_OK| if |message| was a valid message object which has not yet // been serialized. Upon return, |*context| contains the context value @@ -362,7 +381,9 @@ // and |MojoGetSerializedMessageContents()| should be called instead. // |MOJO_RESULT_INVALID_ARGUMENT| if |message| is not a valid message object. MOJO_SYSTEM_EXPORT MojoResult -MojoReleaseMessageContext(MojoMessageHandle message, uintptr_t* context); +MojoGetMessageContext(MojoMessageHandle message, + uintptr_t* context, + MojoGetMessageContextFlags flags); // Notifies the system that a bad message was received on a message pipe, // according to whatever criteria the caller chooses. This ultimately tries to
diff --git a/mojo/public/c/system/tests/core_unittest.cc b/mojo/public/c/system/tests/core_unittest.cc index 780ea63..7e02a1a 100644 --- a/mojo/public/c/system/tests/core_unittest.cc +++ b/mojo/public/c/system/tests/core_unittest.cc
@@ -119,7 +119,9 @@ EXPECT_EQ(MOJO_RESULT_OK, MojoReadMessage(h0, &message, MOJO_READ_MESSAGE_FLAG_NONE)); uintptr_t context; - EXPECT_EQ(MOJO_RESULT_OK, MojoReleaseMessageContext(message, &context)); + EXPECT_EQ(MOJO_RESULT_OK, + MojoGetMessageContext(message, &context, + MOJO_GET_MESSAGE_CONTEXT_FLAG_RELEASE)); EXPECT_EQ(MOJO_RESULT_OK, MojoDestroyMessage(message)); EXPECT_EQ(kTestMessageContext, context);
diff --git a/mojo/public/c/system/tests/core_unittest_pure_c.c b/mojo/public/c/system/tests/core_unittest_pure_c.c index c5b4c5d..fc6d6a3d 100644 --- a/mojo/public/c/system/tests/core_unittest_pure_c.c +++ b/mojo/public/c/system/tests/core_unittest_pure_c.c
@@ -63,7 +63,9 @@ EXPECT_EQ(MOJO_RESULT_OK, MojoReadMessage(handle1, &message, MOJO_READ_MESSAGE_FLAG_NONE)); uintptr_t context; - EXPECT_EQ(MOJO_RESULT_OK, MojoReleaseMessageContext(message, &context)); + EXPECT_EQ(MOJO_RESULT_OK, + MojoGetMessageContext(message, &context, + MOJO_GET_MESSAGE_CONTEXT_FLAG_RELEASE)); EXPECT_EQ(42, context); EXPECT_EQ(MOJO_RESULT_OK, MojoClose(handle0));
diff --git a/mojo/public/c/system/thunks.cc b/mojo/public/c/system/thunks.cc index 43a5d28..2ce9edb 100644 --- a/mojo/public/c/system/thunks.cc +++ b/mojo/public/c/system/thunks.cc
@@ -202,10 +202,11 @@ handles, num_handles, flags); } -MojoResult MojoReleaseMessageContext(MojoMessageHandle message, - uintptr_t* context) { - assert(g_thunks.ReleaseMessageContext); - return g_thunks.ReleaseMessageContext(message, context); +MojoResult MojoGetMessageContext(MojoMessageHandle message, + uintptr_t* context, + MojoGetMessageContextFlags flags) { + assert(g_thunks.GetMessageContext); + return g_thunks.GetMessageContext(message, context, flags); } MojoResult MojoWrapPlatformHandle(
diff --git a/mojo/public/c/system/thunks.h b/mojo/public/c/system/thunks.h index e329724..c6d8abe82 100644 --- a/mojo/public/c/system/thunks.h +++ b/mojo/public/c/system/thunks.h
@@ -98,8 +98,9 @@ MojoHandle* handles, uint32_t* num_handles, MojoGetSerializedMessageContentsFlags flags); - MojoResult (*ReleaseMessageContext)(MojoMessageHandle message, - uintptr_t* context); + MojoResult (*GetMessageContext)(MojoMessageHandle message, + uintptr_t* context, + MojoGetMessageContextFlags flags); MojoResult (*WrapPlatformHandle)( const struct MojoPlatformHandle* platform_handle, MojoHandle* mojo_handle);
diff --git a/net/android/BUILD.gn b/net/android/BUILD.gn index f855f47..8ef6f7c 100644 --- a/net/android/BUILD.gn +++ b/net/android/BUILD.gn
@@ -109,6 +109,9 @@ ":java_test_native_support", "//net:test_support", ] + + configs -= [ "//build/config/android:hide_all_but_jni_onload" ] + configs += [ "//build/config/android:hide_all_but_jni" ] } android_apk("net_test_support_apk") {
diff --git a/net/disk_cache/simple/simple_net_log_parameters.cc b/net/disk_cache/simple/simple_net_log_parameters.cc index f39a112..de32caee 100644 --- a/net/disk_cache/simple/simple_net_log_parameters.cc +++ b/net/disk_cache/simple/simple_net_log_parameters.cc
@@ -45,14 +45,16 @@ net::NetLogParametersCallback CreateNetLogSimpleEntryConstructionCallback( const SimpleEntryImpl* entry) { DCHECK(entry); - return base::Bind(&NetLogSimpleEntryConstructionCallback, entry); + return base::Bind(&NetLogSimpleEntryConstructionCallback, + base::Unretained(entry)); } net::NetLogParametersCallback CreateNetLogSimpleEntryCreationCallback( const SimpleEntryImpl* entry, int net_error) { DCHECK(entry); - return base::Bind(&NetLogSimpleEntryCreationCallback, entry, net_error); + return base::Bind(&NetLogSimpleEntryCreationCallback, base::Unretained(entry), + net_error); } } // namespace disk_cache
diff --git a/net/http/bidirectional_stream_unittest.cc b/net/http/bidirectional_stream_unittest.cc index 07810b1..2cc6b3d 100644 --- a/net/http/bidirectional_stream_unittest.cc +++ b/net/http/bidirectional_stream_unittest.cc
@@ -418,8 +418,7 @@ session_deps_.socket_factory->AddSocketDataProvider(sequenced_data_.get()); session_deps_.net_log = net_log_.bound().net_log(); http_session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_); - session_ = - CreateSecureSpdySession(http_session_.get(), key_, net_log_.bound()); + session_ = CreateSpdySession(http_session_.get(), key_, net_log_.bound()); } BoundTestNetLog net_log_;
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index b258621..49b5ded6 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc
@@ -4739,7 +4739,7 @@ SpdySessionKey key( HostPortPair("proxy", 70), ProxyServer::Direct(), PRIVACY_MODE_DISABLED); base::WeakPtr<SpdySession> spdy_session = - CreateSecureSpdySession(session.get(), key, log.bound()); + CreateSpdySession(session.get(), key, log.bound()); // Unstall the resolution begun by the transaction. session_deps_.host_resolver->set_ondemand_mode(true); @@ -11418,7 +11418,7 @@ SpdySessionKey key(host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); base::WeakPtr<SpdySession> spdy_session = - CreateSecureSpdySession(session.get(), key, NetLogWithSource()); + CreateSpdySession(session.get(), key, NetLogWithSource()); trans = base::MakeUnique<HttpNetworkTransaction>(DEFAULT_PRIORITY, session.get()); @@ -13069,7 +13069,7 @@ SpdySessionKey key(host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); base::WeakPtr<SpdySession> spdy_session = - CreateSecureSpdySession(session.get(), key, NetLogWithSource()); + CreateSpdySession(session.get(), key, NetLogWithSource()); HttpRequestInfo request; request.method = "GET";
diff --git a/net/http/http_proxy_client_socket_wrapper.cc b/net/http/http_proxy_client_socket_wrapper.cc index fff7ebb5..5bf880e 100644 --- a/net/http/http_proxy_client_socket_wrapper.cc +++ b/net/http/http_proxy_client_socket_wrapper.cc
@@ -558,8 +558,7 @@ } else { // Create a session direct to the proxy itself spdy_session = spdy_session_pool_->CreateAvailableSessionFromSocket( - key, std::move(transport_socket_handle_), net_log_, - /*using_ssl_*/ true); + key, std::move(transport_socket_handle_), net_log_); DCHECK(spdy_session); }
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc index 3e4b7ae..700acdd 100644 --- a/net/http/http_stream_factory_impl_job.cc +++ b/net/http/http_stream_factory_impl_job.cc
@@ -1216,7 +1216,7 @@ base::WeakPtr<SpdySession> spdy_session = session_->spdy_session_pool()->CreateAvailableSessionFromSocket( - spdy_session_key_, std::move(connection_), net_log_, using_ssl_); + spdy_session_key_, std::move(connection_), net_log_); if (!spdy_session->HasAcceptableTransportSecurity()) { spdy_session->CloseSessionOnError(
diff --git a/net/proxy/proxy_bypass_rules.cc b/net/proxy/proxy_bypass_rules.cc index b1ebb0a..3cd509c3 100644 --- a/net/proxy/proxy_bypass_rules.cc +++ b/net/proxy/proxy_bypass_rules.cc
@@ -101,7 +101,7 @@ // Parse the input IP literal to a number. IPAddress ip_address; - if (!ip_address.AssignFromIPLiteral(url.HostNoBrackets())) + if (!ip_address.AssignFromIPLiteral(url.HostNoBracketsPiece())) return false; // Test if it has the expected prefix.
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc index a71b2dd..338fa95 100644 --- a/net/proxy/proxy_service.cc +++ b/net/proxy/proxy_service.cc
@@ -16,8 +16,6 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/memory/weak_ptr.h" -#include "base/metrics/histogram_macros.h" -#include "base/metrics/sparse_histogram.h" #include "base/single_thread_task_runner.h" #include "base/strings/string_util.h" #include "base/threading/thread_task_runner_handle.h" @@ -863,17 +861,13 @@ int QueryDidComplete(int result_code) { DCHECK(!was_cancelled()); - // This state is cleared when resolve_job_ is reset below. - bool script_executed = is_started(); - // Clear |resolve_job_| so is_started() returns false while // DidFinishResolvingProxy() runs. resolve_job_.reset(); // Note that DidFinishResolvingProxy might modify |results_|. int rv = service_->DidFinishResolvingProxy(url_, method_, proxy_delegate_, - results_, result_code, net_log_, - creation_time_, script_executed); + results_, result_code, net_log_); // Make a note in the results which configuration was in use at the // time of the resolve. @@ -1065,9 +1059,8 @@ // using a direct connection for example). int rv = TryToCompleteSynchronously(url, proxy_delegate, result); if (rv != ERR_IO_PENDING) { - rv = DidFinishResolvingProxy( - url, method, proxy_delegate, result, rv, net_log, - callback.is_null() ? TimeTicks() : TimeTicks::Now(), false); + rv = DidFinishResolvingProxy(url, method, proxy_delegate, result, rv, + net_log); return rv; } @@ -1233,12 +1226,6 @@ init_proxy_resolver_.reset(); - // When using the out-of-process resolver, creating the resolver can complete - // with the ERR_PAC_SCRIPT_TERMINATED result code, which indicates the - // resolver process crashed. - UMA_HISTOGRAM_BOOLEAN("Net.ProxyService.ScriptTerminatedOnInit", - result == ERR_PAC_SCRIPT_TERMINATED); - if (result != OK) { if (fetched_config_.pac_mandatory()) { VLOG(1) << "Failed configuring with mandatory PAC script, blocking all " @@ -1371,32 +1358,7 @@ ProxyDelegate* proxy_delegate, ProxyInfo* result, int result_code, - const NetLogWithSource& net_log, - base::TimeTicks start_time, - bool script_executed) { - // Don't track any metrics if start_time is 0, which will happen when the user - // calls |TryResolveProxySynchronously|. - if (!start_time.is_null()) { - TimeDelta diff = TimeTicks::Now() - start_time; - if (script_executed) { - // This function "fixes" the result code, so make sure script terminated - // errors are tracked. Only track result codes that were a result of - // script execution. - UMA_HISTOGRAM_BOOLEAN("Net.ProxyService.ScriptTerminated", - result_code == ERR_PAC_SCRIPT_TERMINATED); - UMA_HISTOGRAM_CUSTOM_TIMES("Net.ProxyService.GetProxyUsingScriptTime", - diff, base::TimeDelta::FromMicroseconds(100), - base::TimeDelta::FromSeconds(20), 50); - UMA_HISTOGRAM_SPARSE_SLOWLY("Net.ProxyService.GetProxyUsingScriptResult", - std::abs(result_code)); - } - UMA_HISTOGRAM_BOOLEAN("Net.ProxyService.ResolvedUsingScript", - script_executed); - UMA_HISTOGRAM_CUSTOM_TIMES("Net.ProxyService.ResolveProxyTime", diff, - base::TimeDelta::FromMicroseconds(100), - base::TimeDelta::FromSeconds(20), 50); - } - + const NetLogWithSource& net_log) { // Log the result of the proxy resolution. if (result_code == OK) { // Allow the proxy delegate to interpose on the resolution decision,
diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h index 9c11fab..a8972e2 100644 --- a/net/proxy/proxy_service.h +++ b/net/proxy/proxy_service.h
@@ -388,9 +388,7 @@ ProxyDelegate* proxy_delegate, ProxyInfo* result, int result_code, - const NetLogWithSource& net_log, - base::TimeTicks start_time, - bool script_executed); + const NetLogWithSource& net_log); // Start initialization using |fetched_config_|. void InitializeUsingLastFetchedConfig();
diff --git a/net/quic/chromium/quic_chromium_client_stream_test.cc b/net/quic/chromium/quic_chromium_client_stream_test.cc index 9ac3ee4..dab3390 100644 --- a/net/quic/chromium/quic_chromium_client_stream_test.cc +++ b/net/quic/chromium/quic_chromium_client_stream_test.cc
@@ -145,7 +145,7 @@ : QuicClientSessionBase(connection, push_promise_index, DefaultQuicConfig()) { - crypto_stream_.reset(new QuicCryptoStream(this)); + crypto_stream_.reset(new MockQuicCryptoStream(this)); Initialize(); ON_CALL(*this, WritevData(_, _, _, _, _, _)) .WillByDefault(testing::Return(QuicConsumedData(0, false)));
diff --git a/net/quic/core/congestion_control/bbr_sender.cc b/net/quic/core/congestion_control/bbr_sender.cc index fb02690..3fd27fd 100644 --- a/net/quic/core/congestion_control/bbr_sender.cc +++ b/net/quic/core/congestion_control/bbr_sender.cc
@@ -89,6 +89,7 @@ max_ack_height_(kBandwidthWindowSize, 0, 0), aggregation_epoch_start_time_(QuicTime::Zero()), aggregation_epoch_bytes_(0), + bytes_acked_since_queue_drained_(0), min_rtt_(QuicTime::Delta::Zero()), min_rtt_timestamp_(QuicTime::Zero()), congestion_window_(initial_tcp_congestion_window * kDefaultTCPMSS), @@ -119,7 +120,8 @@ recovery_state_(NOT_IN_RECOVERY), end_recovery_at_(0), recovery_window_(max_congestion_window_), - bytes_recently_acked_(0) { + bytes_recently_acked_(0), + rate_based_recovery_(false) { EnterStartupMode(); } @@ -204,7 +206,7 @@ return kMinimumCongestionWindow; } - if (InRecovery()) { + if (InRecovery() && !rate_based_recovery_) { return std::min(congestion_window_, recovery_window_); } @@ -227,6 +229,10 @@ if (config.HasClientRequestedIndependentOption(k2RTT, perspective)) { num_startup_rtts_ = 2; } + if (FLAGS_quic_reloadable_flag_quic_bbr_rate_recovery && + config.HasClientRequestedIndependentOption(kBBRR, perspective)) { + rate_based_recovery_ = true; + } } void BbrSender::ResumeConnectionState( @@ -271,18 +277,29 @@ UpdateRecoveryState(last_acked_packet, !lost_packets.empty(), is_round_start); + const QuicByteCount bytes_acked = + sampler_.total_bytes_acked() - total_bytes_acked_before; if (FLAGS_quic_reloadable_flag_quic_bbr_slow_recent_delivery) { QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_bbr_slow_recent_delivery, 1, 2); - UpdateRecentlyAcked( - event_time, sampler_.total_bytes_acked() - total_bytes_acked_before); + UpdateRecentlyAcked(event_time, bytes_acked); } if (FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes) { QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_bbr_ack_aggregation_bytes, 1, 2); - UpdateAckAggregationBytes( - event_time, sampler_.total_bytes_acked() - total_bytes_acked_before); + UpdateAckAggregationBytes(event_time, bytes_acked); + } + if (FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes2) { + QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_bbr_ack_aggregation_bytes2, 1, + 2); + UpdateAckAggregationBytes(event_time, bytes_acked); + if (unacked_packets_->bytes_in_flight() <= + 1.25 * GetTargetCongestionWindow(pacing_gain_)) { + bytes_acked_since_queue_drained_ = 0; + } else { + bytes_acked_since_queue_drained_ += bytes_acked; + } } } @@ -610,6 +627,10 @@ } QuicBandwidth target_rate = pacing_gain_ * BandwidthEstimate(); + if (rate_based_recovery_ && InRecovery()) { + QUIC_FLAG_COUNT(quic_reloadable_flag_quic_bbr_rate_recovery); + pacing_rate_ = pacing_gain_ * max_bandwidth_.GetThirdBest(); + } if (is_at_full_bandwidth_) { pacing_rate_ = target_rate; return; @@ -643,6 +664,14 @@ QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_bbr_ack_aggregation_bytes, 2, 2); target_window += max_ack_height_.GetBest(); + } else if (FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes2 && + is_at_full_bandwidth_) { + QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_bbr_ack_aggregation_bytes2, 2, + 2); + if (2 * max_ack_height_.GetBest() > bytes_acked_since_queue_drained_) { + target_window += + 2 * max_ack_height_.GetBest() - bytes_acked_since_queue_drained_; + } } if (FLAGS_quic_reloadable_flag_quic_bbr_add_tso_cwnd) { // QUIC doesn't have TSO, but it does have similarly quantized pacing, so @@ -680,6 +709,9 @@ void BbrSender::CalculateRecoveryWindow(QuicByteCount bytes_acked, QuicByteCount bytes_lost) { + if (rate_based_recovery_) { + return; + } if (FLAGS_quic_reloadable_flag_quic_bbr_fix_conservation2) { if (recovery_state_ == NOT_IN_RECOVERY) { return;
diff --git a/net/quic/core/congestion_control/bbr_sender.h b/net/quic/core/congestion_control/bbr_sender.h index 31102b7..767f061 100644 --- a/net/quic/core/congestion_control/bbr_sender.h +++ b/net/quic/core/congestion_control/bbr_sender.h
@@ -249,6 +249,10 @@ QuicTime aggregation_epoch_start_time_; QuicByteCount aggregation_epoch_bytes_; + // The number of bytes acknowledged since the last time bytes in flight + // dropped below the target window. + QuicByteCount bytes_acked_since_queue_drained_; + // Minimum RTT estimate. Automatically expires within 10 seconds (and // triggers PROBE_RTT mode) if no new value is sampled during that period. QuicTime::Delta min_rtt_; @@ -334,6 +338,9 @@ std::deque<DataDelivered> recently_acked_; QuicByteCount bytes_recently_acked_; + // When true, recovery is rate based rather than congestion window based. + bool rate_based_recovery_; + DISALLOW_COPY_AND_ASSIGN(BbrSender); };
diff --git a/net/quic/core/congestion_control/bbr_sender_test.cc b/net/quic/core/congestion_control/bbr_sender_test.cc index 770169f..68b37d9 100644 --- a/net/quic/core/congestion_control/bbr_sender_test.cc +++ b/net/quic/core/congestion_control/bbr_sender_test.cc
@@ -296,6 +296,7 @@ // Test a simple long data transfer with 2 rtts of aggregation. TEST_F(BbrSenderTest, SimpleTransfer2RTTAggregationBytes) { FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes = true; + FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes2 = false; FLAGS_quic_reloadable_flag_quic_bbr_add_tso_cwnd = false; CreateDefaultSetup(); // 2 RTTs of aggregation, with a max of 10kb. @@ -323,6 +324,70 @@ // Test a simple long data transfer with 2 rtts of aggregation. TEST_F(BbrSenderTest, SimpleTransferAckDecimation) { FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes = true; + FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes2 = false; + // Decrease the CWND gain so extra CWND is required with stretch acks. + FLAGS_quic_bbr_cwnd_gain = 1.0; + sender_ = new BbrSender( + rtt_stats_, + QuicSentPacketManagerPeer::GetUnackedPacketMap( + QuicConnectionPeer::GetSentPacketManager(bbr_sender_.connection())), + kInitialCongestionWindowPackets, kDefaultMaxCongestionWindowPackets, + &random_); + QuicConnectionPeer::SetSendAlgorithm(bbr_sender_.connection(), sender_); + // Enable Ack Decimation on the receiver. + QuicConnectionPeer::SetAckMode(receiver_.connection(), + QuicConnection::AckMode::ACK_DECIMATION); + CreateDefaultSetup(); + + // Transfer 12MB. + DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(35)); + EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); + // It's possible to read a bandwidth as much as 50% too high with aggregation. + EXPECT_LE(kTestLinkBandwidth * 0.99f, + sender_->ExportDebugState().max_bandwidth); + // TODO(ianswett): Tighten this bound once we understand why BBR is + // overestimating bandwidth with aggregation. b/36022633 + EXPECT_GE(kTestLinkBandwidth * 1.5f, + sender_->ExportDebugState().max_bandwidth); + // TODO(ianswett): Expect 0 packets are lost once BBR no longer measures + // bandwidth higher than the link rate. + EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); + // The margin here is high, because the aggregation greatly increases + // smoothed rtt. + EXPECT_GE(kTestRtt * 2, rtt_stats_->smoothed_rtt()); + ExpectApproxEq(kTestRtt, rtt_stats_->min_rtt(), 0.1f); +} + +// Test a simple long data transfer with 2 rtts of aggregation. +TEST_F(BbrSenderTest, SimpleTransfer2RTTAggregationBytes2) { + FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes2 = true; + FLAGS_quic_reloadable_flag_quic_bbr_add_tso_cwnd = false; + CreateDefaultSetup(); + // 2 RTTs of aggregation, with a max of 10kb. + EnableAggregation(10 * 1024, 2 * kTestRtt); + + // Transfer 12MB. + DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(35)); + EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); + // It's possible to read a bandwidth as much as 50% too high with aggregation. + EXPECT_LE(kTestLinkBandwidth * 0.99f, + sender_->ExportDebugState().max_bandwidth); + // TODO(ianswett): Tighten this bound once we understand why BBR is + // overestimating bandwidth with aggregation. b/36022633 + EXPECT_GE(kTestLinkBandwidth * 1.5f, + sender_->ExportDebugState().max_bandwidth); + // TODO(ianswett): Expect 0 packets are lost once BBR no longer measures + // bandwidth higher than the link rate. + EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); + // The margin here is high, because the aggregation greatly increases + // smoothed rtt. + EXPECT_GE(kTestRtt * 4, rtt_stats_->smoothed_rtt()); + ExpectApproxEq(kTestRtt, rtt_stats_->min_rtt(), 0.12f); +} + +// Test a simple long data transfer with 2 rtts of aggregation. +TEST_F(BbrSenderTest, SimpleTransferAckDecimation2) { + FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes2 = true; // Decrease the CWND gain so extra CWND is required with stretch acks. FLAGS_quic_bbr_cwnd_gain = 1.0; sender_ = new BbrSender(
diff --git a/net/quic/core/congestion_control/cubic_bytes_test.cc b/net/quic/core/congestion_control/cubic_bytes_test.cc index a0641ee..b009b1d2 100644 --- a/net/quic/core/congestion_control/cubic_bytes_test.cc +++ b/net/quic/core/congestion_control/cubic_bytes_test.cc
@@ -64,22 +64,6 @@ for (bool fix_cubic_quantization : {true, false}) { for (bool fix_beta_last_max : {true, false}) { for (bool allow_per_ack_updates : {true, false}) { - if (!FLAGS_quic_reloadable_flag_quic_fix_cubic_convex_mode && - fix_convex_mode) { - continue; - } - if (!FLAGS_quic_reloadable_flag_quic_fix_cubic_bytes_quantization && - fix_cubic_quantization) { - continue; - } - if (!FLAGS_quic_reloadable_flag_quic_fix_beta_last_max && - fix_beta_last_max) { - continue; - } - if (!FLAGS_quic_reloadable_flag_quic_enable_cubic_per_ack_updates && - allow_per_ack_updates) { - continue; - } TestParams param(fix_convex_mode, fix_cubic_quantization, fix_beta_last_max, allow_per_ack_updates); params.push_back(param);
diff --git a/net/quic/core/congestion_control/cubic_test.cc b/net/quic/core/congestion_control/cubic_test.cc index c7e3126..47733b7d 100644 --- a/net/quic/core/congestion_control/cubic_test.cc +++ b/net/quic/core/congestion_control/cubic_test.cc
@@ -58,18 +58,6 @@ for (bool fix_convex_mode : {true, false}) { for (bool fix_beta_last_max : {true, false}) { for (bool allow_per_ack_updates : {true, false}) { - if (!FLAGS_quic_reloadable_flag_quic_fix_cubic_convex_mode && - fix_convex_mode) { - continue; - } - if (!FLAGS_quic_reloadable_flag_quic_fix_beta_last_max && - fix_beta_last_max) { - continue; - } - if (!FLAGS_quic_reloadable_flag_quic_enable_cubic_per_ack_updates && - allow_per_ack_updates) { - continue; - } TestParams param(fix_convex_mode, fix_beta_last_max, allow_per_ack_updates); params.push_back(param);
diff --git a/net/quic/core/congestion_control/send_algorithm_test.cc b/net/quic/core/congestion_control/send_algorithm_test.cc index 4eff9d9ff..5eaad4b 100644 --- a/net/quic/core/congestion_control/send_algorithm_test.cc +++ b/net/quic/core/congestion_control/send_algorithm_test.cc
@@ -194,10 +194,6 @@ "QUIC sender", Perspective::IS_SERVER, 42) { - FLAGS_quic_reloadable_flag_quic_fix_cubic_convex_mode = true; - FLAGS_quic_reloadable_flag_quic_fix_cubic_bytes_quantization = true; - FLAGS_quic_reloadable_flag_quic_fix_beta_last_max = true; - FLAGS_quic_reloadable_flag_quic_enable_cubic_per_ack_updates = true; rtt_stats_ = quic_sender_.connection()->sent_packet_manager().GetRttStats(); sender_ = SendAlgorithmInterface::Create( simulator_.GetClock(), rtt_stats_,
diff --git a/net/quic/core/congestion_control/tcp_cubic_sender_bytes.cc b/net/quic/core/congestion_control/tcp_cubic_sender_bytes.cc index f22bdd02..60063a4 100644 --- a/net/quic/core/congestion_control/tcp_cubic_sender_bytes.cc +++ b/net/quic/core/congestion_control/tcp_cubic_sender_bytes.cc
@@ -48,23 +48,19 @@ void TcpCubicSenderBytes::SetFromConfig(const QuicConfig& config, Perspective perspective) { TcpCubicSenderBase::SetFromConfig(config, perspective); - if (FLAGS_quic_reloadable_flag_quic_fix_cubic_convex_mode && - config.HasReceivedConnectionOptions() && + if (config.HasReceivedConnectionOptions() && ContainsQuicTag(config.ReceivedConnectionOptions(), kCCVX)) { cubic_.SetFixConvexMode(true); } - if (FLAGS_quic_reloadable_flag_quic_fix_cubic_bytes_quantization && - config.HasReceivedConnectionOptions() && + if (config.HasReceivedConnectionOptions() && ContainsQuicTag(config.ReceivedConnectionOptions(), kCBQT)) { cubic_.SetFixCubicQuantization(true); } - if (FLAGS_quic_reloadable_flag_quic_fix_beta_last_max && - config.HasReceivedConnectionOptions() && + if (config.HasReceivedConnectionOptions() && ContainsQuicTag(config.ReceivedConnectionOptions(), kBLMX)) { cubic_.SetFixBetaLastMax(true); } - if (FLAGS_quic_reloadable_flag_quic_enable_cubic_per_ack_updates && - config.HasReceivedConnectionOptions() && + if (config.HasReceivedConnectionOptions() && ContainsQuicTag(config.ReceivedConnectionOptions(), kCPAU)) { cubic_.SetAllowPerAckUpdates(true); }
diff --git a/net/quic/core/congestion_control/tcp_cubic_sender_packets.cc b/net/quic/core/congestion_control/tcp_cubic_sender_packets.cc index 74ebb2fc..7e23060 100644 --- a/net/quic/core/congestion_control/tcp_cubic_sender_packets.cc +++ b/net/quic/core/congestion_control/tcp_cubic_sender_packets.cc
@@ -45,18 +45,15 @@ void TcpCubicSenderPackets::SetFromConfig(const QuicConfig& config, Perspective perspective) { TcpCubicSenderBase::SetFromConfig(config, perspective); - if (FLAGS_quic_reloadable_flag_quic_fix_cubic_convex_mode && - config.HasReceivedConnectionOptions() && + if (config.HasReceivedConnectionOptions() && ContainsQuicTag(config.ReceivedConnectionOptions(), kCCVX)) { cubic_.SetFixConvexMode(true); } - if (FLAGS_quic_reloadable_flag_quic_fix_beta_last_max && - config.HasReceivedConnectionOptions() && + if (config.HasReceivedConnectionOptions() && ContainsQuicTag(config.ReceivedConnectionOptions(), kBLMX)) { cubic_.SetFixBetaLastMax(true); } - if (FLAGS_quic_reloadable_flag_quic_enable_cubic_per_ack_updates && - config.HasReceivedConnectionOptions() && + if (config.HasReceivedConnectionOptions() && ContainsQuicTag(config.ReceivedConnectionOptions(), kCPAU)) { cubic_.SetAllowPerAckUpdates(true); }
diff --git a/net/quic/core/crypto/crypto_protocol.h b/net/quic/core/crypto/crypto_protocol.h index d31ef0f1..56d8e63 100644 --- a/net/quic/core/crypto/crypto_protocol.h +++ b/net/quic/core/crypto/crypto_protocol.h
@@ -82,6 +82,7 @@ const QuicTag kTBBR = TAG('T', 'B', 'B', 'R'); // Reduced Buffer Bloat TCP const QuicTag k1RTT = TAG('1', 'R', 'T', 'T'); // STARTUP in BBR for 1 RTT const QuicTag k2RTT = TAG('2', 'R', 'T', 'T'); // STARTUP in BBR for 2 RTTs +const QuicTag kBBRR = TAG('B', 'B', 'R', 'R'); // Rate-based recovery in BBR const QuicTag kRENO = TAG('R', 'E', 'N', 'O'); // Reno Congestion Control const QuicTag kTPCC = TAG('P', 'C', 'C', '\0'); // Performance-Oriented // Congestion Control
diff --git a/net/quic/core/frames/quic_ack_frame.cc b/net/quic/core/frames/quic_ack_frame.cc index fdb6e9b..6c75614 100644 --- a/net/quic/core/frames/quic_ack_frame.cc +++ b/net/quic/core/frames/quic_ack_frame.cc
@@ -54,14 +54,6 @@ packet_number_intervals_.Add(lower, higher); } -void PacketNumberQueue::Remove(QuicPacketNumber packet_number) { - packet_number_intervals_.Difference(packet_number, packet_number + 1); -} - -void PacketNumberQueue::Remove(QuicPacketNumber lower, - QuicPacketNumber higher) { - packet_number_intervals_.Difference(lower, higher); -} bool PacketNumberQueue::RemoveUpTo(QuicPacketNumber higher) { if (Empty()) {
diff --git a/net/quic/core/frames/quic_ack_frame.h b/net/quic/core/frames/quic_ack_frame.h index db33248..a4dc93d 100644 --- a/net/quic/core/frames/quic_ack_frame.h +++ b/net/quic/core/frames/quic_ack_frame.h
@@ -38,13 +38,6 @@ // is undefined behavior to call this with |higher| < |lower|. void Add(QuicPacketNumber lower, QuicPacketNumber higher); - // Removes |packet_number| from the set of packets in the queue. - void Remove(QuicPacketNumber packet_number); - - // Removes packets numbers between [lower, higher) to the set of packets in - // the queue. It is undefined behavior to call this with |higher| < |lower|. - void Remove(QuicPacketNumber lower, QuicPacketNumber higher); - // Removes packets with values less than |higher| from the set of packets in // the queue. Returns true if packets were removed. bool RemoveUpTo(QuicPacketNumber higher);
diff --git a/net/quic/core/frames/quic_frames_test.cc b/net/quic/core/frames/quic_frames_test.cc index f591cd7..6402cf0 100644 --- a/net/quic/core/frames/quic_frames_test.cc +++ b/net/quic/core/frames/quic_frames_test.cc
@@ -123,8 +123,8 @@ EXPECT_TRUE(IsAwaitingPacket(ack_frame1, 11u, 0u)); EXPECT_FALSE(IsAwaitingPacket(ack_frame1, 1u, 0u)); - ack_frame1.packets.Remove(10); - EXPECT_TRUE(IsAwaitingPacket(ack_frame1, 10u, 0u)); + ack_frame1.packets.Add(12); + EXPECT_TRUE(IsAwaitingPacket(ack_frame1, 11u, 0u)); QuicAckFrame ack_frame2; ack_frame2.largest_observed = 100u; @@ -133,8 +133,8 @@ EXPECT_FALSE(IsAwaitingPacket(ack_frame2, 80u, 20u)); EXPECT_TRUE(IsAwaitingPacket(ack_frame2, 101u, 20u)); - ack_frame2.packets.Remove(50); - EXPECT_TRUE(IsAwaitingPacket(ack_frame2, 50u, 20u)); + ack_frame2.packets.Add(102, 200); + EXPECT_TRUE(IsAwaitingPacket(ack_frame2, 101u, 20u)); } TEST_F(QuicFramesTest, RemoveSmallestInterval) { @@ -178,31 +178,24 @@ EXPECT_EQ(70u, queue.Max()); } -// Tests that a queue contains the expected data after calls to Remove(). +// Tests that a queue contains the expected data after calls to RemoveUpTo(). TEST_F(PacketNumberQueueTest, Removal) { PacketNumberQueue queue; queue.Add(0, 100); EXPECT_TRUE(queue.RemoveUpTo(51)); EXPECT_FALSE(queue.RemoveUpTo(51)); - queue.Remove(53); EXPECT_FALSE(queue.Contains(0)); for (int i = 1; i < 51; ++i) { EXPECT_FALSE(queue.Contains(i)); } - EXPECT_TRUE(queue.Contains(51)); - EXPECT_TRUE(queue.Contains(52)); - EXPECT_FALSE(queue.Contains(53)); - EXPECT_TRUE(queue.Contains(54)); - EXPECT_EQ(48u, queue.NumPacketsSlow()); + for (int i = 51; i < 100; ++i) { + EXPECT_TRUE(queue.Contains(i)); + } + EXPECT_EQ(49u, queue.NumPacketsSlow()); EXPECT_EQ(51u, queue.Min()); EXPECT_EQ(99u, queue.Max()); - - queue.Remove(51); - EXPECT_EQ(52u, queue.Min()); - queue.Remove(99); - EXPECT_EQ(98u, queue.Max()); } // Tests that a queue is empty when all of its elements are removed. @@ -249,10 +242,12 @@ queue.Add(40, 50); EXPECT_EQ(3u, queue.NumIntervals()); EXPECT_EQ(10u, queue.LastIntervalLength()); - queue.Remove(9, 21); - EXPECT_EQ(3u, queue.NumIntervals()); - EXPECT_FALSE(queue.Contains(9)); - EXPECT_FALSE(queue.Contains(20)); + + EXPECT_TRUE(queue.RemoveUpTo(25)); + EXPECT_EQ(2u, queue.NumIntervals()); + EXPECT_EQ(10u, queue.LastIntervalLength()); + EXPECT_EQ(25u, queue.Min()); + EXPECT_EQ(49u, queue.Max()); } } // namespace
diff --git a/net/quic/core/quic_connection_test.cc b/net/quic/core/quic_connection_test.cc index cf14b3e..c2eb3023 100644 --- a/net/quic/core/quic_connection_test.cc +++ b/net/quic/core/quic_connection_test.cc
@@ -46,7 +46,6 @@ using testing::InSequence; using testing::Invoke; using testing::InvokeWithoutArgs; -using testing::NiceMock; using testing::Ref; using testing::Return; using testing::SaveArg; @@ -1009,9 +1008,21 @@ return frame; } - // Explicitly nack a packet. - void NackPacket(QuicPacketNumber missing, QuicAckFrame* frame) { - frame->packets.Remove(missing); + // Construct ack_frame containing up to two ranges + // [1, missing) and (missing, end_range] + QuicAckFrame ConstructAckFrame(QuicPacketNumber largest_acked, + QuicPacketNumber missing) { + QuicAckFrame ack_frame; + if (largest_acked > missing) { + ack_frame.packets.Add(1, missing); + ack_frame.packets.Add(missing + 1, largest_acked + 1); + ack_frame.largest_observed = largest_acked; + } + if (largest_acked == missing) { + ack_frame.packets.Add(1, missing); + ack_frame.largest_observed = largest_acked; + } + return ack_frame; } // Undo nacking a packet within the frame. @@ -1447,8 +1458,7 @@ .WillOnce( DoAll(SaveArg<2>(&original), SaveArg<3>(&packet_size), Return(true))); connection_.SendStreamDataWithString(3, "foo", 0, NO_FIN, nullptr); - QuicAckFrame frame = InitAckFrame(original); - NackPacket(original, &frame); + QuicAckFrame frame = ConstructAckFrame(original, original); // First nack triggers early retransmit. SendAlgorithmInterface::CongestionVector lost_packets; lost_packets.push_back(std::make_pair(1, kMaxPacketSize)); @@ -1462,8 +1472,7 @@ ProcessAckPacket(&frame); - QuicAckFrame frame2 = InitAckFrame(retransmission); - NackPacket(original, &frame2); + QuicAckFrame frame2 = ConstructAckFrame(retransmission, original); EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _)); EXPECT_CALL(*loss_algorithm_, DetectLosses(_, _, _, _, _)); ProcessAckPacket(&frame2); @@ -1616,8 +1625,7 @@ EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _)); // Nack the first packet and ack the rest, leaving a huge gap. - QuicAckFrame frame1 = InitAckFrame(num_packets); - NackPacket(1, &frame1); + QuicAckFrame frame1 = ConstructAckFrame(num_packets, 1); ProcessAckPacket(&frame1); } @@ -1759,7 +1767,7 @@ } } -// QuicConnection should record the the packet sent-time prior to sending the +// QuicConnection should record the packet sent-time prior to sending the // packet. TEST_P(QuicConnectionTest, RecordSentTimeBeforePacketSent) { // We're using a MockClock for the tests, so we have complete control over the @@ -2044,8 +2052,7 @@ ProcessAckPacket(&ack_one); // Lose a packet and ensure it triggers retransmission. - QuicAckFrame nack_two = InitAckFrame(3); - NackPacket(2, &nack_two); + QuicAckFrame nack_two = ConstructAckFrame(3, 2); SendAlgorithmInterface::CongestionVector lost_packets; lost_packets.push_back(std::make_pair(2, kMaxPacketSize)); EXPECT_CALL(*loss_algorithm_, DetectLosses(_, _, _, _, _)) @@ -2105,8 +2112,7 @@ connection_.SendRstStream(stream_id, QUIC_ERROR_PROCESSING_STREAM, 14); // Lose a packet and ensure it does not trigger retransmission. - QuicAckFrame nack_two = InitAckFrame(last_packet); - NackPacket(last_packet - 1, &nack_two); + QuicAckFrame nack_two = ConstructAckFrame(last_packet, last_packet - 1); EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); EXPECT_CALL(*loss_algorithm_, DetectLosses(_, _, _, _, _)); EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _)); @@ -2125,8 +2131,7 @@ connection_.SendRstStream(stream_id, QUIC_STREAM_NO_ERROR, 14); // Lose a packet, ensure it triggers retransmission. - QuicAckFrame nack_two = InitAckFrame(last_packet); - NackPacket(last_packet - 1, &nack_two); + QuicAckFrame nack_two = ConstructAckFrame(last_packet, last_packet - 1); EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); SendAlgorithmInterface::CongestionVector lost_packets; lost_packets.push_back(std::make_pair(last_packet - 1, kMaxPacketSize)); @@ -2168,8 +2173,8 @@ // Ack the RST_STREAM frame (since it's retransmittable), but not the data // packet, which is no longer retransmittable since the stream was cancelled. - QuicAckFrame nack_stream_data = InitAckFrame(rst_packet); - NackPacket(last_data_packet, &nack_stream_data); + QuicAckFrame nack_stream_data = + ConstructAckFrame(rst_packet, last_data_packet); EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _)); EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(0); @@ -2210,8 +2215,7 @@ connection_.SendStreamDataWithString(stream_id, "fooos", 7, NO_FIN, nullptr); // Lose a packet which will trigger a pending retransmission. - QuicAckFrame ack = InitAckFrame(last_packet); - NackPacket(last_packet - 1, &ack); + QuicAckFrame ack = ConstructAckFrame(last_packet, last_packet - 1); EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); EXPECT_CALL(*loss_algorithm_, DetectLosses(_, _, _, _, _)); EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _)); @@ -2239,8 +2243,7 @@ connection_.SendStreamDataWithString(stream_id, "fooos", 7, NO_FIN, nullptr); // Lose a packet which will trigger a pending retransmission. - QuicAckFrame ack = InitAckFrame(last_packet); - NackPacket(last_packet - 1, &ack); + QuicAckFrame ack = ConstructAckFrame(last_packet, last_packet - 1); EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); SendAlgorithmInterface::CongestionVector lost_packets; lost_packets.push_back(std::make_pair(last_packet - 1, kMaxPacketSize)); @@ -2270,8 +2273,7 @@ EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); // Instigate a loss with an ack. - QuicAckFrame nack_two = InitAckFrame(3); - NackPacket(2, &nack_two); + QuicAckFrame nack_two = ConstructAckFrame(3, 2); // The first nack should trigger a fast retransmission, but we'll be // write blocked, so the packet will be queued. BlockOnNextWrite(); @@ -2310,8 +2312,7 @@ Return(true))); connection_.SendStreamDataWithString(3, "foo", 0, NO_FIN, nullptr); - QuicAckFrame frame = InitAckFrame(1); - NackPacket(largest_observed, &frame); + QuicAckFrame frame = ConstructAckFrame(1, largest_observed); // The first nack should retransmit the largest observed packet. SendAlgorithmInterface::CongestionVector lost_packets; lost_packets.push_back(std::make_pair(1, kMaxPacketSize)); @@ -2432,10 +2433,9 @@ // Ack 15, nack 1-14. - QuicAckFrame nack = InitAckFrame(15); - for (int i = 1; i < 15; ++i) { - NackPacket(i, &nack); - } + QuicAckFrame nack; + nack.packets.Add(15); + nack.largest_observed = 15; // 14 packets have been NACK'd and lost. SendAlgorithmInterface::CongestionVector lost_packets; @@ -2466,8 +2466,7 @@ // Client will ack packets 1, 2, [!3], 4, 5. EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _)); - QuicAckFrame frame1 = InitAckFrame(5); - NackPacket(3, &frame1); + QuicAckFrame frame1 = ConstructAckFrame(5, 3); EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); ProcessAckPacket(&frame1); @@ -2540,9 +2539,9 @@ SendStreamDataToPeer(1, "bar", 9, NO_FIN, nullptr); // Packet 7 EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _)); - frame = InitAckFrame(7); - NackPacket(5, &frame); - NackPacket(6, &frame); + frame = InitAckFrame(4); + frame.packets.Add(7); + frame.largest_observed = 7; ProcessAckPacket(&frame); EXPECT_EQ(6u, stop_waiting()->least_unacked); @@ -3143,10 +3142,23 @@ // Receive an ACK, which marks all data packets as received, and all MTU // discovery packets as missing. - QuicAckFrame ack = InitAckFrame(creator_->packet_number()); - for (QuicPacketNumber& packet : mtu_discovery_packets) { - NackPacket(packet, &ack); + + QuicAckFrame ack; + + if (!mtu_discovery_packets.empty()) { + QuicPacketNumber min_packet = *min_element(mtu_discovery_packets.begin(), + mtu_discovery_packets.end()); + QuicPacketNumber max_packet = *max_element(mtu_discovery_packets.begin(), + mtu_discovery_packets.end()); + ack.packets.Add(1, min_packet); + ack.packets.Add(max_packet + 1, creator_->packet_number() + 1); + ack.largest_observed = creator_->packet_number(); + + } else { + ack.packets.Add(1, creator_->packet_number() + 1); + ack.largest_observed = creator_->packet_number(); } + ProcessAckPacket(&ack); // Trigger MTU probe if it would be scheduled now. @@ -3256,8 +3268,8 @@ } // Acknowledge all packets sent so far, except for the lost probe. - QuicAckFrame probe_ack = InitAckFrame(creator_->packet_number()); - NackPacket(probe_number, &probe_ack); + QuicAckFrame probe_ack = + ConstructAckFrame(creator_->packet_number(), probe_number); EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _)); ProcessAckPacket(&probe_ack); @@ -4367,8 +4379,7 @@ connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 3, NO_FIN, nullptr); // Ack the second packet, which will retransmit the first packet. - QuicAckFrame ack = InitAckFrame(2); - NackPacket(1, &ack); + QuicAckFrame ack = ConstructAckFrame(2, 1); SendAlgorithmInterface::CongestionVector lost_packets; lost_packets.push_back(std::make_pair(1, kMaxPacketSize)); EXPECT_CALL(*loss_algorithm_, DetectLosses(_, _, _, _, _)) @@ -4381,8 +4392,7 @@ // Now ack the retransmission, which will both raise the high water mark // and see if there is more data to send. - ack = InitAckFrame(3); - NackPacket(1, &ack); + ack = ConstructAckFrame(3, 1); EXPECT_CALL(*loss_algorithm_, DetectLosses(_, _, _, _, _)); EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _)); ProcessAckPacket(&ack); @@ -4393,8 +4403,7 @@ writer_->Reset(); // Send the same ack, but send both data and an ack together. - ack = InitAckFrame(3); - NackPacket(1, &ack); + ack = ConstructAckFrame(3, 1); EXPECT_CALL(*loss_algorithm_, DetectLosses(_, _, _, _, _)); EXPECT_CALL(visitor_, OnCanWrite()) .WillOnce(IgnoreResult(InvokeWithoutArgs( @@ -4676,9 +4685,11 @@ connection_.GetRetransmissionAlarm()->Fire(); // Retransmit due to explicit nacks. - QuicAckFrame nack_three = InitAckFrame(4); - NackPacket(3, &nack_three); - NackPacket(1, &nack_three); + QuicAckFrame nack_three; + nack_three.packets.Add(2); + nack_three.packets.Add(4); + nack_three.largest_observed = 4; + SendAlgorithmInterface::CongestionVector lost_packets; lost_packets.push_back(std::make_pair(1, kMaxPacketSize)); lost_packets.push_back(std::make_pair(3, kMaxPacketSize)); @@ -4717,7 +4728,7 @@ frames.push_back(QuicFrame(&frame1_)); frames.push_back(QuicFrame(&qccf)); std::unique_ptr<QuicPacket> packet(ConstructPacket(header, frames)); - EXPECT_TRUE(nullptr != packet.get()); + EXPECT_TRUE(nullptr != packet); char buffer[kMaxPacketSize]; size_t encrypted_length = peer_framer_.EncryptPayload( ENCRYPTION_NONE, 1, *packet, buffer, kMaxPacketSize); @@ -4824,8 +4835,7 @@ // Now we receive ACK for packets 2 and 3, but importantly missing packet 1 // which we registered to be notified about. - QuicAckFrame frame = InitAckFrame(3); - NackPacket(1, &frame); + QuicAckFrame frame = ConstructAckFrame(3, 1); SendAlgorithmInterface::CongestionVector lost_packets; lost_packets.push_back(std::make_pair(1, kMaxPacketSize)); EXPECT_CALL(*loss_algorithm_, DetectLosses(_, _, _, _, _)) @@ -4850,8 +4860,7 @@ connection_.SendStreamDataWithString(3, "qux", 0, NO_FIN, nullptr); // Now we receive ACK for packets 1, 3, and 4 and lose 2. - QuicAckFrame frame = InitAckFrame(4); - NackPacket(2, &frame); + QuicAckFrame frame = ConstructAckFrame(4, 2); SendAlgorithmInterface::CongestionVector lost_packets; lost_packets.push_back(std::make_pair(2, kMaxPacketSize)); EXPECT_CALL(*loss_algorithm_, DetectLosses(_, _, _, _, _)) @@ -4924,8 +4933,7 @@ connection_.SendStreamDataWithString(3, "qux", 0, NO_FIN, nullptr); // Now we receive ACK for packets 1, 3, and 4 and lose 2. - QuicAckFrame frame = InitAckFrame(4); - NackPacket(2, &frame); + QuicAckFrame frame = ConstructAckFrame(4, 2); EXPECT_CALL(*listener, OnPacketRetransmitted(_)); EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); SendAlgorithmInterface::CongestionVector lost_packets;
diff --git a/net/quic/core/quic_crypto_client_stream.cc b/net/quic/core/quic_crypto_client_stream.cc index b9303c4..d37087d 100644 --- a/net/quic/core/quic_crypto_client_stream.cc +++ b/net/quic/core/quic_crypto_client_stream.cc
@@ -102,7 +102,10 @@ proof_handler_(proof_handler), verify_ok_(false), stateless_reject_received_(false), - num_scup_messages_received_(0) { + num_scup_messages_received_(0), + encryption_established_(false), + handshake_confirmed_(false), + crypto_negotiated_params_(new QuicCryptoNegotiatedParameters) { DCHECK_EQ(Perspective::IS_CLIENT, session->connection()->perspective()); } @@ -166,6 +169,19 @@ return channel_id_source_callback_run_; } +bool QuicCryptoClientStream::encryption_established() const { + return encryption_established_; +} + +bool QuicCryptoClientStream::handshake_confirmed() const { + return handshake_confirmed_; +} + +const QuicCryptoNegotiatedParameters& +QuicCryptoClientStream::crypto_negotiated_params() const { + return *crypto_negotiated_params_; +} + void QuicCryptoClientStream::HandleServerConfigUpdateMessage( const CryptoHandshakeMessage& server_config_update) { DCHECK(server_config_update.tag() == kSCUP);
diff --git a/net/quic/core/quic_crypto_client_stream.h b/net/quic/core/quic_crypto_client_stream.h index 76ca62ba..d56dbd4 100644 --- a/net/quic/core/quic_crypto_client_stream.h +++ b/net/quic/core/quic_crypto_client_stream.h
@@ -101,6 +101,11 @@ std::string chlo_hash() const { return chlo_hash_; } + bool encryption_established() const override; + bool handshake_confirmed() const override; + const QuicCryptoNegotiatedParameters& crypto_negotiated_params() + const override; + private: // ChannelIDSourceCallbackImpl is passed as the callback method to // GetChannelIDKey. The ChannelIDSource calls this class with the result of @@ -271,6 +276,11 @@ int num_scup_messages_received_; + bool encryption_established_; + bool handshake_confirmed_; + QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> + crypto_negotiated_params_; + DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); };
diff --git a/net/quic/core/quic_crypto_server_stream.cc b/net/quic/core/quic_crypto_server_stream.cc index 61fbaab..4dd9da7 100644 --- a/net/quic/core/quic_crypto_server_stream.cc +++ b/net/quic/core/quic_crypto_server_stream.cc
@@ -98,7 +98,10 @@ zero_rtt_attempted_(false), chlo_packet_size_(0), validate_client_hello_cb_(nullptr), - process_client_hello_cb_(nullptr) { + process_client_hello_cb_(nullptr), + encryption_established_(false), + handshake_confirmed_(false), + crypto_negotiated_params_(new QuicCryptoNegotiatedParameters) { DCHECK_EQ(Perspective::IS_SERVER, session->connection()->perspective()); } @@ -389,7 +392,7 @@ bool QuicCryptoServerStream::GetBase64SHA256ClientChannelID( string* output) const { - if (!encryption_established_ || + if (!encryption_established() || crypto_negotiated_params_->channel_id.empty()) { return false; } @@ -403,6 +406,19 @@ return true; } +bool QuicCryptoServerStream::encryption_established() const { + return encryption_established_; +} + +bool QuicCryptoServerStream::handshake_confirmed() const { + return handshake_confirmed_; +} + +const QuicCryptoNegotiatedParameters& +QuicCryptoServerStream::crypto_negotiated_params() const { + return *crypto_negotiated_params_; +} + void QuicCryptoServerStream::ProcessClientHello( QuicReferenceCountedPointer<ValidateClientHelloResultCallback::Result> result,
diff --git a/net/quic/core/quic_crypto_server_stream.h b/net/quic/core/quic_crypto_server_stream.h index 3f836753..9bbfcf2 100644 --- a/net/quic/core/quic_crypto_server_stream.h +++ b/net/quic/core/quic_crypto_server_stream.h
@@ -128,6 +128,11 @@ return signed_config_->proof.send_expect_ct_header; } + bool encryption_established() const override; + bool handshake_confirmed() const override; + const QuicCryptoNegotiatedParameters& crypto_negotiated_params() + const override; + protected: virtual void ProcessClientHello( QuicReferenceCountedPointer<ValidateClientHelloResultCallback::Result> @@ -285,6 +290,11 @@ // field is mutually exclusive with validate_client_hello_cb_. ProcessClientHelloCallback* process_client_hello_cb_; + bool encryption_established_; + bool handshake_confirmed_; + QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> + crypto_negotiated_params_; + DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerStream); };
diff --git a/net/quic/core/quic_crypto_stream.cc b/net/quic/core/quic_crypto_stream.cc index 60ab843..7534419 100644 --- a/net/quic/core/quic_crypto_stream.cc +++ b/net/quic/core/quic_crypto_stream.cc
@@ -24,10 +24,7 @@ " ") QuicCryptoStream::QuicCryptoStream(QuicSession* session) - : QuicStream(kCryptoStreamId, session), - encryption_established_(false), - handshake_confirmed_(false), - crypto_negotiated_params_(new QuicCryptoNegotiatedParameters) { + : QuicStream(kCryptoStreamId, session) { crypto_framer_.set_visitor(this); // The crypto stream is exempt from connection level flow control. DisableConnectionFlowControlForThisStream(); @@ -71,7 +68,7 @@ return; } sequencer()->MarkConsumed(iov.iov_len); - if (handshake_confirmed_ && crypto_framer_.InputBytesRemaining() == 0 && + if (handshake_confirmed() && crypto_framer_.InputBytesRemaining() == 0 && FLAGS_quic_reloadable_flag_quic_release_crypto_stream_buffer) { QUIC_FLAG_COUNT(quic_reloadable_flag_quic_release_crypto_stream_buffer); // If the handshake is complete and the current message has been fully @@ -103,7 +100,7 @@ return false; } return CryptoUtils::ExportKeyingMaterial( - crypto_negotiated_params_->subkey_secret, label, context, result_len, + crypto_negotiated_params().subkey_secret, label, context, result_len, result); } @@ -114,14 +111,9 @@ return false; } return CryptoUtils::ExportKeyingMaterial( - crypto_negotiated_params_->initial_subkey_secret, + crypto_negotiated_params().initial_subkey_secret, "EXPORTER-Token-Binding", /* context= */ "", 32, result); } -const QuicCryptoNegotiatedParameters& -QuicCryptoStream::crypto_negotiated_params() const { - return *crypto_negotiated_params_; -} - } // namespace net
diff --git a/net/quic/core/quic_crypto_stream.h b/net/quic/core/quic_crypto_stream.h index a977242..3f4b9b8 100644 --- a/net/quic/core/quic_crypto_stream.h +++ b/net/quic/core/quic_crypto_stream.h
@@ -73,17 +73,15 @@ // value. bool ExportTokenBindingKeyingMaterial(std::string* result) const; - bool encryption_established() const { return encryption_established_; } - bool handshake_confirmed() const { return handshake_confirmed_; } + // Returns true once an encrypter has been set for the connection. + virtual bool encryption_established() const = 0; - const QuicCryptoNegotiatedParameters& crypto_negotiated_params() const; + // Returns true once the crypto handshake has completed. + virtual bool handshake_confirmed() const = 0; - protected: - bool encryption_established_; - bool handshake_confirmed_; - - QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> - crypto_negotiated_params_; + // Returns the parameters negotiated in the crypto handshake. + virtual const QuicCryptoNegotiatedParameters& crypto_negotiated_params() + const = 0; private: CryptoFramer crypto_framer_;
diff --git a/net/quic/core/quic_crypto_stream_test.cc b/net/quic/core/quic_crypto_stream_test.cc index 9850a8cd..ca24a4fe 100644 --- a/net/quic/core/quic_crypto_stream_test.cc +++ b/net/quic/core/quic_crypto_stream_test.cc
@@ -27,7 +27,8 @@ class MockQuicCryptoStream : public QuicCryptoStream { public: explicit MockQuicCryptoStream(QuicSession* session) - : QuicCryptoStream(session) {} + : QuicCryptoStream(session), + params_(new QuicCryptoNegotiatedParameters) {} void OnHandshakeMessage(const CryptoHandshakeMessage& message) override { messages_.push_back(message); @@ -35,7 +36,16 @@ std::vector<CryptoHandshakeMessage>* messages() { return &messages_; } + bool encryption_established() const override { return false; } + bool handshake_confirmed() const override { return false; } + + const QuicCryptoNegotiatedParameters& crypto_negotiated_params() + const override { + return *params_; + } + private: + QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> params_; std::vector<CryptoHandshakeMessage> messages_; DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoStream);
diff --git a/net/quic/core/quic_flags_list.h b/net/quic/core/quic_flags_list.h index 9e7b1ae7..324093b 100644 --- a/net/quic/core/quic_flags_list.h +++ b/net/quic/core/quic_flags_list.h
@@ -27,9 +27,6 @@ FLAGS_quic_reloadable_flag_enable_quic_stateless_reject_support, true) -// If true, multipath is enabled for the connection. -QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_enable_multipath, false) - // If true, require handshake confirmation for QUIC connections, functionally // disabling 0-rtt handshakes. // TODO(rtenneti): Enable this flag after CryptoServerTest's are fixed. @@ -86,22 +83,10 @@ // allow CHLO packets to be buffered until next iteration of the event loop. QUIC_FLAG(bool, FLAGS_quic_allow_chlo_buffering, true) -// If true, fix some casts that were causing off-by-one errors in QUIC's cubic -// "convex" increases. -QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_fix_cubic_convex_mode, true) - // If true, GFE sends SETTINGS_MAX_HEADER_LIST_SIZE to the client at the // beginning of a connection. QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_send_max_header_list_size, true) -// If true, fix quantization of CubicBytes while performing convex increases. -QUIC_FLAG(bool, - FLAGS_quic_reloadable_flag_quic_fix_cubic_bytes_quantization, - true) - -// If true, fix Cubic\'s use of kBetaLastMax for n-connection emulation. -QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_fix_beta_last_max, true) - // If greater than zero, mean RTT variation is multiplied by the specified // factor and added to the congestion window limit. QUIC_FLAG(double, FLAGS_quic_bbr_rtt_variation_weight, 0.0f) @@ -120,12 +105,6 @@ // faster than the sending rate. QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes, true) -// If true, allow cubic updates on every ack, rather than occasionally limiting -// the frequency to once every 30ms. -QUIC_FLAG(bool, - FLAGS_quic_reloadable_flag_quic_enable_cubic_per_ack_updates, - true) - // Support bandwidth resumption in QUIC BBR. QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_bbr_bandwidth_resumption, false) @@ -172,7 +151,7 @@ // client IP for proxied session. QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_use_client_address_for_stk_in_proxy, - false) + true) // If true, export a varz mapping QUIC non 0-rtt handshake with corresponding // frontend service. @@ -189,7 +168,7 @@ QUIC_FLAG(bool, FLAGS_quic_enable_version_40, false) // If true, use the more CPU efficient bandwidth sampler datastructure. -QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_faster_bandwidth_sampler, false) +QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_faster_bandwidth_sampler, true) // In QUIC, QuicSession gets notified when stream frames are acked, discarded or // retransmitted. @@ -197,3 +176,19 @@ // When true, defaults to BBR congestion control instead of Cubic. QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_default_to_bbr, false) + +// Allow a new rate based recovery in QUIC BBR to be enabled via connection +// option. +QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_bbr_rate_recovery, false) + +// If true, allow trailing headers with duplicate keys, and combine the values +// from duplicate keys into a single delimted header. +QUIC_FLAG(bool, + FLAGS_quic_reloadable_flag_quic_handle_duplicate_trailers, + false) + +// Allows QUIC BBR up to twice the previously measured ack aggregation to be +// added to the CWND as long as bytes_in_flight goes below the target recently. +QUIC_FLAG(bool, + FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes2, + false)
diff --git a/net/quic/core/quic_sent_packet_manager_test.cc b/net/quic/core/quic_sent_packet_manager_test.cc index 49354b5..2263299a 100644 --- a/net/quic/core/quic_sent_packet_manager_test.cc +++ b/net/quic/core/quic_sent_packet_manager_test.cc
@@ -262,11 +262,20 @@ return frame; } - // Explicitly nack packet [lower, higher). - void NackPackets(QuicPacketNumber lower, - QuicPacketNumber higher, - QuicAckFrame* frame) { - frame->packets.Remove(lower, higher); + // Creates an ackframe that contains up to two ranges of packets + QuicAckFrame ConstructAckFrame(QuicPacketNumber range1_start, + QuicPacketNumber range1_end, + QuicPacketNumber range2_start, + QuicPacketNumber range2_end) { + QuicAckFrame ack_frame; + if (range1_start < range1_end) { + ack_frame.packets.Add(range1_start, range1_end); + } + if (range2_start <= range2_end) { + ack_frame.packets.Add(range2_start, range2_end + 1); + } + ack_frame.largest_observed = range2_end; + return ack_frame; } QuicSentPacketManager manager_; @@ -302,8 +311,8 @@ RetransmitAndSendPacket(1, 2); // Ack 2 but not 1. - QuicAckFrame ack_frame = InitAckFrame(2); - NackPackets(1, 2, &ack_frame); + QuicAckFrame ack_frame = ConstructAckFrame(1, 1, 2, 2); + ExpectAck(2); manager_.OnIncomingAck(ack_frame, clock_.Now()); @@ -388,18 +397,16 @@ clock_.AdvanceTime(rtt); // Next, NACK packet 2 three times. - ack_frame = InitAckFrame(3); - NackPackets(2, 3, &ack_frame); + ack_frame = ConstructAckFrame(1, 2, 3, 3); + ExpectAck(3); manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); - ack_frame = InitAckFrame(4); - NackPackets(2, 3, &ack_frame); + ack_frame = ConstructAckFrame(1, 2, 3, 4); ExpectAck(4); manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); - ack_frame = InitAckFrame(5); - NackPackets(2, 3, &ack_frame); + ack_frame = ConstructAckFrame(1, 2, 3, 5); ExpectAckAndLoss(true, 5, 2); manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); @@ -469,8 +476,7 @@ // Ensure packet 2 is lost when 4 is sent and 3 and 4 are acked. SendDataPacket(4); - ack_frame = InitAckFrame(4); - NackPackets(2, 3, &ack_frame); + ack_frame = ConstructAckFrame(1, 2, 3, 4); QuicPacketNumber acked[] = {3, 4}; ExpectAcksAndLosses(true, acked, arraysize(acked), nullptr, 0); manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); @@ -480,8 +486,7 @@ EXPECT_TRUE(QuicSentPacketManagerPeer::HasPendingPackets(&manager_)); SendDataPacket(5); - ack_frame = InitAckFrame(5); - NackPackets(2, 3, &ack_frame); + ack_frame = ConstructAckFrame(1, 2, 3, 5); ExpectAckAndLoss(true, 5, 2); EXPECT_CALL(debug_delegate, OnPacketLoss(2, LOSS_RETRANSMISSION, _)); manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); @@ -511,8 +516,7 @@ SendDataPacket(4); // Ack 4, which causes 3 to be retransmitted. { - QuicAckFrame ack_frame = InitAckFrame(4); - NackPackets(2, 4, &ack_frame); + QuicAckFrame ack_frame = ConstructAckFrame(1, 2, 4, 4); ExpectAck(4); EXPECT_CALL(*loss_algorithm, DetectLosses(_, _, _, _, _)); manager_.OnIncomingAck(ack_frame, clock_.Now()); @@ -520,10 +524,7 @@ } // Ack 3, which causes SpuriousRetransmitDetected to be called. - { - QuicAckFrame ack_frame = InitAckFrame(4); - NackPackets(2, 3, &ack_frame); - } + { QuicAckFrame ack_frame = ConstructAckFrame(1, 2, 3, 4); } } TEST_F(QuicSentPacketManagerTest, GetLeastUnacked) { @@ -648,8 +649,7 @@ // Ack the third and ensure the first two are still pending. ExpectAck(3); - QuicAckFrame ack_frame = InitAckFrame(3); - NackPackets(1, 3, &ack_frame); + QuicAckFrame ack_frame = ConstructAckFrame(1, 1, 3, 3); manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); EXPECT_TRUE(QuicSentPacketManagerPeer::HasPendingPackets(&manager_)); @@ -657,8 +657,7 @@ // Acking two more packets will lose both of them due to nacks. SendDataPacket(4); SendDataPacket(5); - ack_frame = InitAckFrame(5); - NackPackets(1, 3, &ack_frame); + ack_frame = ConstructAckFrame(1, 1, 3, 5); QuicPacketNumber acked[] = {4, 5}; QuicPacketNumber lost[] = {1, 2}; ExpectAcksAndLosses(true, acked, arraysize(acked), lost, arraysize(lost)); @@ -724,8 +723,7 @@ QuicSentPacketManagerPeer::GetBytesInFlight(&manager_)); RetransmitNextPacket(103); - QuicAckFrame ack_frame = InitAckFrame(103); - NackPackets(0, 103, &ack_frame); + QuicAckFrame ack_frame = ConstructAckFrame(1, 0, 103, 103); EXPECT_CALL(*send_algorithm_, OnRetransmissionTimeout(true)); EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, ElementsAre(Pair(103, _)), _)); @@ -767,9 +765,10 @@ // and ensure the first four crypto packets get abandoned, but not lost. QuicPacketNumber acked[] = {3, 4, 5, 8, 9}; ExpectAcksAndLosses(true, acked, arraysize(acked), nullptr, 0); - QuicAckFrame ack_frame = InitAckFrame(9); - NackPackets(1, 3, &ack_frame); - NackPackets(6, 8, &ack_frame); + QuicAckFrame ack_frame; + ack_frame.packets.Add(3, 6); + ack_frame.packets.Add(8, 10); + ack_frame.largest_observed = 9; manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); EXPECT_FALSE(QuicSentPacketManagerPeer::HasUnackedCryptoPackets(&manager_)); @@ -817,10 +816,7 @@ // crypto packets. QuicPacketNumber acked[] = {8, 9}; ExpectAcksAndLosses(true, acked, arraysize(acked), nullptr, 0); - QuicAckFrame ack_frame = InitAckFrame(9); - for (QuicPacketNumber i = 1; i < 8; ++i) { - NackPackets(i, i + 1, &ack_frame); - } + QuicAckFrame ack_frame = ConstructAckFrame(1, 1, 8, 9); manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); EXPECT_EQ(10u, manager_.GetLeastUnacked()); } @@ -841,8 +837,7 @@ // Now ack the second crypto packet, and ensure the first gets removed, but // the third does not. ExpectUpdatedRtt(2); - QuicAckFrame ack_frame = InitAckFrame(2); - NackPackets(1, 2, &ack_frame); + QuicAckFrame ack_frame = ConstructAckFrame(1, 1, 2, 2); manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); EXPECT_FALSE(QuicSentPacketManagerPeer::HasUnackedCryptoPackets(&manager_)); @@ -915,8 +910,7 @@ EXPECT_FALSE(QuicSentPacketManagerPeer::HasPendingPackets(&manager_)); // Ensure both packets get discarded when packet 2 is acked. - QuicAckFrame ack_frame = InitAckFrame(3); - NackPackets(1, 3, &ack_frame); + QuicAckFrame ack_frame = ConstructAckFrame(1, 1, 3, 3); ExpectUpdatedRtt(3); manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); VerifyUnackedPackets(nullptr, 0); @@ -943,8 +937,7 @@ EXPECT_FALSE(manager_.HasPendingRetransmissions()); // Ack a retransmission. - QuicAckFrame ack_frame = InitAckFrame(102); - NackPackets(0, 102, &ack_frame); + QuicAckFrame ack_frame = ConstructAckFrame(1, 0, 102, 102); ack_frame.ack_delay_time = QuicTime::Delta::Zero(); // Ensure no packets are lost. EXPECT_CALL(*send_algorithm_, @@ -992,8 +985,7 @@ EXPECT_FALSE(manager_.HasPendingRetransmissions()); // Ack a retransmission and expect no call to OnRetransmissionTimeout. - QuicAckFrame ack_frame = InitAckFrame(102); - NackPackets(0, 102, &ack_frame); + QuicAckFrame ack_frame = ConstructAckFrame(1, 0, 102, 102); ack_frame.ack_delay_time = QuicTime::Delta::Zero(); // This will include packets in the lost packet map. EXPECT_CALL(*send_algorithm_, @@ -1025,8 +1017,7 @@ // Ack a retransmission and ensure OnRetransmissionTimeout is called. EXPECT_CALL(*send_algorithm_, OnRetransmissionTimeout(true)); - QuicAckFrame ack_frame = InitAckFrame(2); - NackPackets(1, 2, &ack_frame); + QuicAckFrame ack_frame = ConstructAckFrame(1, 1, 2, 2); ack_frame.ack_delay_time = QuicTime::Delta::Zero(); ExpectAck(2); manager_.OnIncomingAck(ack_frame, clock_.Now()); @@ -1058,8 +1049,7 @@ // Ack a retransmission and ensure OnRetransmissionTimeout is called. EXPECT_CALL(*send_algorithm_, OnRetransmissionTimeout(true)); - QuicAckFrame ack_frame = InitAckFrame(3); - NackPackets(1, 3, &ack_frame); + QuicAckFrame ack_frame = ConstructAckFrame(1, 1, 3, 3); ack_frame.ack_delay_time = QuicTime::Delta::Zero(); ExpectAck(3); manager_.OnIncomingAck(ack_frame, clock_.Now()); @@ -1226,8 +1216,7 @@ // Ack a packet before the first RTO and ensure the RTO timeout returns to the // original value and OnRetransmissionTimeout is not called or reverted. - QuicAckFrame ack_frame = InitAckFrame(2); - NackPackets(1, 2, &ack_frame); + QuicAckFrame ack_frame = ConstructAckFrame(1, 1, 2, 2); ExpectAck(2); manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); EXPECT_FALSE(manager_.HasPendingRetransmissions()); @@ -1337,8 +1326,7 @@ // set the loss timeout. ExpectAck(2); EXPECT_CALL(*loss_algorithm, DetectLosses(_, _, _, _, _)); - QuicAckFrame ack_frame = InitAckFrame(2); - NackPackets(1, 2, &ack_frame); + QuicAckFrame ack_frame = ConstructAckFrame(1, 1, 2, 2); manager_.OnIncomingAck(ack_frame, clock_.Now()); QuicTime timeout(clock_.Now() + QuicTime::Delta::FromMilliseconds(10)); @@ -1661,8 +1649,8 @@ } EXPECT_CALL(*loss_algorithm, DetectLosses(_, _, _, _, _)) .WillOnce(SetArgPointee<4>(lost_packets)); - QuicAckFrame ack_frame = InitAckFrame(kNumSentPackets); - NackPackets(1, kNumSentPackets, &ack_frame); + QuicAckFrame ack_frame = + ConstructAckFrame(1, 1, kNumSentPackets, kNumSentPackets); // Congestion block the sending right before losing the packets. EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _)) .WillRepeatedly(Return(QuicTime::Delta::Infinite())); @@ -1672,8 +1660,7 @@ // Ack 1 and ensure the retransmissions are cancelled and put back in flight. EXPECT_CALL(*loss_algorithm, DetectLosses(_, _, _, _, _)); - ack_frame = InitAckFrame(5); - NackPackets(2, kNumSentPackets, &ack_frame); + ack_frame = ConstructAckFrame(1, 2, kNumSentPackets, 5); manager_.OnIncomingAck(ack_frame, clock_.Now()); EXPECT_FALSE(manager_.HasPendingRetransmissions()); EXPECT_EQ(3u * kDefaultLength, BytesInFlight());
diff --git a/net/quic/core/quic_server_session_base_test.cc b/net/quic/core/quic_server_session_base_test.cc index 7a925483..b6ac5dbf 100644 --- a/net/quic/core/quic_server_session_base_test.cc +++ b/net/quic/core/quic_server_session_base_test.cc
@@ -410,10 +410,6 @@ MOCK_METHOD1(SendServerConfigUpdate, void(const CachedNetworkParameters* cached_network_parameters)); - void set_encryption_established(bool has_established) { - encryption_established_ = has_established; - } - private: DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoServerStream); };
diff --git a/net/quic/core/quic_session_test.cc b/net/quic/core/quic_session_test.cc index 8877be8..8bfcb7d 100644 --- a/net/quic/core/quic_session_test.cc +++ b/net/quic/core/quic_session_test.cc
@@ -51,7 +51,11 @@ class TestCryptoStream : public QuicCryptoStream { public: - explicit TestCryptoStream(QuicSession* session) : QuicCryptoStream(session) {} + explicit TestCryptoStream(QuicSession* session) + : QuicCryptoStream(session), + encryption_established_(false), + handshake_confirmed_(false), + params_(new QuicCryptoNegotiatedParameters) {} void OnHandshakeMessage(const CryptoHandshakeMessage& /*message*/) override { encryption_established_ = true; @@ -76,7 +80,22 @@ encryption_established_ = value; } + // QuicCryptoStream implementation + bool encryption_established() const override { + return encryption_established_; + } + bool handshake_confirmed() const override { return handshake_confirmed_; } + const QuicCryptoNegotiatedParameters& crypto_negotiated_params() + const override { + return *params_; + } + MOCK_METHOD0(OnCanWrite, void()); + + private: + bool encryption_established_; + bool handshake_confirmed_; + QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> params_; }; class TestHeadersStream : public QuicHeadersStream { @@ -1256,7 +1275,7 @@ TEST_P(QuicSessionTestServer, EnableFHOLThroughConfigOption) { QuicConfigPeer::SetReceivedForceHolBlocking(session_.config()); session_.OnConfigNegotiated(); - if (version() != QUIC_VERSION_36) { + if (version() != QUIC_VERSION_36 || session_.use_stream_notifier()) { EXPECT_FALSE(session_.force_hol_blocking()); } else { EXPECT_TRUE(session_.force_hol_blocking()); @@ -1341,7 +1360,7 @@ TEST_P(QuicSessionTestClient, EnableFHOLThroughConfigOption) { session_.config()->SetForceHolBlocking(); session_.OnConfigNegotiated(); - if (version() != QUIC_VERSION_36) { + if (version() != QUIC_VERSION_36 || session_.use_stream_notifier()) { EXPECT_FALSE(session_.force_hol_blocking()); } else { EXPECT_TRUE(session_.force_hol_blocking());
diff --git a/net/quic/core/quic_spdy_session.cc b/net/quic/core/quic_spdy_session.cc index be9aa55d..ec950dc 100644 --- a/net/quic/core/quic_spdy_session.cc +++ b/net/quic/core/quic_spdy_session.cc
@@ -628,7 +628,8 @@ DisableHpackDynamicTable(); } const QuicVersion version = connection()->version(); - if (FLAGS_quic_reloadable_flag_quic_enable_force_hol_blocking && + if (!use_stream_notifier() && + FLAGS_quic_reloadable_flag_quic_enable_force_hol_blocking && version == QUIC_VERSION_36 && config()->ForceHolBlocking(perspective())) { force_hol_blocking_ = true; // Since all streams are tunneled through the headers stream, it
diff --git a/net/quic/core/quic_stream.cc b/net/quic/core/quic_stream.cc index 2aa2ac93..4e8d7a6 100644 --- a/net/quic/core/quic_stream.cc +++ b/net/quic/core/quic_stream.cc
@@ -82,10 +82,14 @@ } QuicStream::~QuicStream() { - QUIC_DLOG_IF(WARNING, session_ != nullptr && - session_->use_stream_notifier() && - IsWaitingForAcks()) - << "Stream destroyed while waiting for acks."; + if (session_ != nullptr && session_->use_stream_notifier() && + IsWaitingForAcks()) { + QUIC_DVLOG(1) + << ENDPOINT << "Stream " << id_ + << " gets destroyed while waiting for acks. stream_bytes_outstanding = " + << stream_bytes_outstanding_ + << ", fin_outstanding: " << fin_outstanding_; + } } void QuicStream::SetFromConfig() {}
diff --git a/net/quic/core/spdy_utils.cc b/net/quic/core/spdy_utils.cc index 5ad6a43..2dfec6b30 100644 --- a/net/quic/core/spdy_utils.cc +++ b/net/quic/core/spdy_utils.cc
@@ -7,6 +7,8 @@ #include <memory> #include <vector> +#include "net/quic/platform/api/quic_flag_utils.h" +#include "net/quic/platform/api/quic_flags.h" #include "net/quic/platform/api/quic_logging.h" #include "net/quic/platform/api/quic_map_util.h" #include "net/quic/platform/api/quic_string_piece.h" @@ -96,6 +98,8 @@ bool SpdyUtils::CopyAndValidateTrailers(const QuicHeaderList& header_list, size_t* final_byte_offset, SpdyHeaderBlock* trailers) { + const bool handle_duplicate_trailers = + FLAGS_quic_reloadable_flag_quic_handle_duplicate_trailers; bool found_final_byte_offset = false; for (const auto& p : header_list) { const string& name = p.first; @@ -121,13 +125,22 @@ return false; } - if (trailers->find(name) != trailers->end()) { - QUIC_DLOG(ERROR) << "Duplicate header '" << name - << "' found in trailers."; - return false; + if (handle_duplicate_trailers) { + QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_handle_duplicate_trailers, 1, + 3); + trailers->AppendValueOrAddHeader(name, p.second); + } else { + QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_handle_duplicate_trailers, 2, + 3); + if (trailers->find(name) != trailers->end()) { + QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_handle_duplicate_trailers, + 3, 3); + QUIC_DLOG(ERROR) << "Duplicate header '" << name + << "' found in trailers."; + return false; + } + (*trailers)[name] = p.second; } - - (*trailers)[name] = p.second; } if (!found_final_byte_offset) {
diff --git a/net/quic/core/spdy_utils_test.cc b/net/quic/core/spdy_utils_test.cc index 1b19488f..6acfc83 100644 --- a/net/quic/core/spdy_utils_test.cc +++ b/net/quic/core/spdy_utils_test.cc
@@ -6,8 +6,9 @@ #include <memory> #include "base/macros.h" +#include "net/quic/platform/api/quic_flag_utils.h" +#include "net/quic/platform/api/quic_flags.h" #include "net/quic/platform/api/quic_string_piece.h" -#include "net/quic/platform/api/quic_test.h" #include "net/quic/platform/api/quic_text_utils.h" #include "net/test/gtest_util.h" @@ -29,9 +30,7 @@ return headers; } -class SpdyUtilsTest : public QuicTest {}; - -TEST_F(SpdyUtilsTest, CopyAndValidateHeaders) { +TEST(CopyAndValidateHeaders, NormalUsage) { auto headers = FromList({// All cookie crumbs are joined. {"cookie", " part 1"}, {"cookie", "part 2 "}, @@ -70,7 +69,7 @@ EXPECT_EQ(-1, content_length); } -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersEmptyName) { +TEST(CopyAndValidateHeaders, EmptyName) { auto headers = FromList({{"foo", "foovalue"}, {"", "barvalue"}, {"baz", ""}}); int64_t content_length = -1; SpdyHeaderBlock block; @@ -78,7 +77,7 @@ SpdyUtils::CopyAndValidateHeaders(*headers, &content_length, &block)); } -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersUpperCaseName) { +TEST(CopyAndValidateHeaders, UpperCaseName) { auto headers = FromList({{"foo", "foovalue"}, {"bar", "barvalue"}, {"bAz", ""}}); int64_t content_length = -1; @@ -87,7 +86,7 @@ SpdyUtils::CopyAndValidateHeaders(*headers, &content_length, &block)); } -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersMultipleContentLengths) { +TEST(CopyAndValidateHeaders, MultipleContentLengths) { auto headers = FromList({{"content-length", "9"}, {"foo", "foovalue"}, {"content-length", "9"}, @@ -107,7 +106,7 @@ EXPECT_EQ(9, content_length); } -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersInconsistentContentLengths) { +TEST(CopyAndValidateHeaders, InconsistentContentLengths) { auto headers = FromList({{"content-length", "9"}, {"foo", "foovalue"}, {"content-length", "8"}, @@ -119,7 +118,7 @@ SpdyUtils::CopyAndValidateHeaders(*headers, &content_length, &block)); } -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersLargeContentLength) { +TEST(CopyAndValidateHeaders, LargeContentLength) { auto headers = FromList({{"content-length", "9000000000"}, {"foo", "foovalue"}, {"bar", "barvalue"}, @@ -135,7 +134,7 @@ EXPECT_EQ(9000000000, content_length); } -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersMultipleValues) { +TEST(CopyAndValidateHeaders, MultipleValues) { auto headers = FromList({{"foo", "foovalue"}, {"bar", "barvalue"}, {"baz", ""}, @@ -152,7 +151,7 @@ EXPECT_EQ(-1, content_length); } -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersMoreThanTwoValues) { +TEST(CopyAndValidateHeaders, MoreThanTwoValues) { auto headers = FromList({{"set-cookie", "value1"}, {"set-cookie", "value2"}, {"set-cookie", "value3"}}); @@ -166,7 +165,7 @@ EXPECT_EQ(-1, content_length); } -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersCookie) { +TEST(CopyAndValidateHeaders, Cookie) { auto headers = FromList({{"foo", "foovalue"}, {"bar", "barvalue"}, {"cookie", "value1"}, @@ -181,7 +180,7 @@ EXPECT_EQ(-1, content_length); } -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersMultipleCookies) { +TEST(CopyAndValidateHeaders, MultipleCookies) { auto headers = FromList({{"foo", "foovalue"}, {"bar", "barvalue"}, {"cookie", "value1"}, @@ -197,7 +196,108 @@ EXPECT_EQ(-1, content_length); } -TEST_F(SpdyUtilsTest, GetUrlFromHeaderBlock) { +TEST(CopyAndValidateTrailers, SimplestValidList) { + // Verify that the simplest trailers are valid: just a final byte offset that + // gets parsed successfully. + auto trailers = FromList({{kFinalOffsetHeaderKey, "1234"}}); + size_t final_byte_offset = 0; + SpdyHeaderBlock block; + EXPECT_TRUE(SpdyUtils::CopyAndValidateTrailers(*trailers, &final_byte_offset, + &block)); + EXPECT_EQ(1234u, final_byte_offset); +} + +TEST(CopyAndValidateTrailers, EmptyTrailerList) { + // An empty trailer list will fail as required key kFinalOffsetHeaderKey is + // not present. + QuicHeaderList trailers; + size_t final_byte_offset = 0; + SpdyHeaderBlock block; + EXPECT_FALSE( + SpdyUtils::CopyAndValidateTrailers(trailers, &final_byte_offset, &block)); +} + +TEST(CopyAndValidateTrailers, FinalByteOffsetNotPresent) { + // Validation fails if required kFinalOffsetHeaderKey is not present, even if + // the rest of the header block is valid. + auto trailers = FromList({{"key", "value"}}); + size_t final_byte_offset = 0; + SpdyHeaderBlock block; + EXPECT_FALSE(SpdyUtils::CopyAndValidateTrailers(*trailers, &final_byte_offset, + &block)); +} + +TEST(CopyAndValidateTrailers, EmptyName) { + // Trailer validation will fail with an empty header key, in an otherwise + // valid block of trailers. + auto trailers = FromList({{"", "value"}, {kFinalOffsetHeaderKey, "1234"}}); + size_t final_byte_offset = 0; + SpdyHeaderBlock block; + EXPECT_FALSE(SpdyUtils::CopyAndValidateTrailers(*trailers, &final_byte_offset, + &block)); +} + +TEST(CopyAndValidateTrailers, PseudoHeaderInTrailers) { + // Pseudo headers are illegal in trailers. + auto trailers = + FromList({{":pseudo_key", "value"}, {kFinalOffsetHeaderKey, "1234"}}); + size_t final_byte_offset = 0; + SpdyHeaderBlock block; + EXPECT_FALSE(SpdyUtils::CopyAndValidateTrailers(*trailers, &final_byte_offset, + &block)); +} + +TEST(CopyAndValidateTrailers, DuplicateTrailers) { + // Duplicate trailers are allowed, and their values are concatenated into a + // single string delimted with '\0'. Some of the duplicate headers + // deliberately have an empty value. + FLAGS_quic_reloadable_flag_quic_handle_duplicate_trailers = true; + auto trailers = FromList({{"key", "value0"}, + {"key", "value1"}, + {"key", ""}, + {"key", ""}, + {"key", "value2"}, + {"key", ""}, + {kFinalOffsetHeaderKey, "1234"}, + {"other_key", "value"}, + {"key", "non_contiguous_duplicate"}}); + size_t final_byte_offset = 0; + SpdyHeaderBlock block; + EXPECT_TRUE(SpdyUtils::CopyAndValidateTrailers(*trailers, &final_byte_offset, + &block)); + EXPECT_THAT( + block, + UnorderedElementsAre( + Pair("key", + QuicStringPiece( + "value0\0value1\0\0\0value2\0\0non_contiguous_duplicate", + 48)), + Pair("other_key", "value"))); +} + +TEST(CopyAndValidateTrailers, DuplicateCookies) { + // Duplicate cookie headers in trailers should be concatenated into a single + // "; " delimted string. + FLAGS_quic_reloadable_flag_quic_handle_duplicate_trailers = true; + auto headers = FromList({{"cookie", " part 1"}, + {"cookie", "part 2 "}, + {"cookie", "part3"}, + {"key", "value"}, + {kFinalOffsetHeaderKey, "1234"}, + {"cookie", " non_contiguous_cookie!"}}); + + size_t final_byte_offset = 0; + SpdyHeaderBlock block; + EXPECT_TRUE( + SpdyUtils::CopyAndValidateTrailers(*headers, &final_byte_offset, &block)); + EXPECT_THAT( + block, + UnorderedElementsAre( + Pair("cookie", " part 1; part 2 ; part3; non_contiguous_cookie!"), + Pair("key", "value"))); +} + +TEST(GetUrlFromHeaderBlock, Basic) { SpdyHeaderBlock headers; EXPECT_EQ(SpdyUtils::GetUrlFromHeaderBlock(headers), ""); headers[":scheme"] = "https"; @@ -213,7 +313,7 @@ "https://www.google.com/index.html"); } -TEST_F(SpdyUtilsTest, GetHostNameFromHeaderBlock) { +TEST(GetHostNameFromHeaderBlock, NormalUsage) { SpdyHeaderBlock headers; EXPECT_EQ(SpdyUtils::GetHostNameFromHeaderBlock(headers), ""); headers[":scheme"] = "https"; @@ -233,7 +333,7 @@ EXPECT_EQ(SpdyUtils::GetHostNameFromHeaderBlock(headers), "192.168.1.1"); } -TEST_F(SpdyUtilsTest, PopulateHeaderBlockFromUrl) { +TEST(PopulateHeaderBlockFromUrl, NormalUsage) { string url = "https://www.google.com/index.html"; SpdyHeaderBlock headers; EXPECT_TRUE(SpdyUtils::PopulateHeaderBlockFromUrl(url, &headers)); @@ -242,7 +342,7 @@ EXPECT_EQ("/index.html", headers[":path"].as_string()); } -TEST_F(SpdyUtilsTest, PopulateHeaderBlockFromUrlWithNoPath) { +TEST(PopulateHeaderBlockFromUrl, UrlWithNoPath) { string url = "https://www.google.com"; SpdyHeaderBlock headers; EXPECT_TRUE(SpdyUtils::PopulateHeaderBlockFromUrl(url, &headers)); @@ -251,7 +351,7 @@ EXPECT_EQ("/", headers[":path"].as_string()); } -TEST_F(SpdyUtilsTest, PopulateHeaderBlockFromUrlFails) { +TEST(PopulateHeaderBlockFromUrl, Failure) { SpdyHeaderBlock headers; EXPECT_FALSE(SpdyUtils::PopulateHeaderBlockFromUrl("/", &headers)); EXPECT_FALSE(SpdyUtils::PopulateHeaderBlockFromUrl("/index.html", &headers));
diff --git a/net/quic/platform/api/quic_logging.h b/net/quic/platform/api/quic_logging.h index 5031e9f..75a0572 100644 --- a/net/quic/platform/api/quic_logging.h +++ b/net/quic/platform/api/quic_logging.h
@@ -25,4 +25,6 @@ #define QUIC_NOTREACHED() QUIC_NOTREACHED_IMPL() +#define QUIC_PLOG(severity) QUIC_PLOG_IMPL(severity) + #endif // NET_QUIC_PLATFORM_API_QUIC_LOGGING_H_
diff --git a/net/quic/platform/impl/quic_logging_impl.h b/net/quic/platform/impl/quic_logging_impl.h index d6e6cdc..ef6426aa 100644 --- a/net/quic/platform/impl/quic_logging_impl.h +++ b/net/quic/platform/impl/quic_logging_impl.h
@@ -57,4 +57,6 @@ #define QUIC_NOTREACHED_IMPL() NOTREACHED() +#define QUIC_PLOG_IMPL(severity) DVLOG(1) + #endif // NET_QUIC_PLATFORM_IMPL_QUIC_LOGGING_IMPL_H_
diff --git a/net/quic/test_tools/mock_crypto_client_stream.cc b/net/quic/test_tools/mock_crypto_client_stream.cc index 1a2449a8..c5f19069 100644 --- a/net/quic/test_tools/mock_crypto_client_stream.cc +++ b/net/quic/test_tools/mock_crypto_client_stream.cc
@@ -30,6 +30,9 @@ crypto_config, session), handshake_mode_(handshake_mode), + encryption_established_(false), + handshake_confirmed_(false), + crypto_negotiated_params_(new QuicCryptoNegotiatedParameters), server_id_(server_id), proof_verify_details_(proof_verify_details), config_(config) {} @@ -110,6 +113,19 @@ return session()->connection()->connected(); } +bool MockCryptoClientStream::encryption_established() const { + return encryption_established_; +} + +bool MockCryptoClientStream::handshake_confirmed() const { + return handshake_confirmed_; +} + +const QuicCryptoNegotiatedParameters& +MockCryptoClientStream::crypto_negotiated_params() const { + return *crypto_negotiated_params_; +} + void MockCryptoClientStream::SendOnCryptoHandshakeEvent( QuicSession::CryptoHandshakeEvent event) { encryption_established_ = true;
diff --git a/net/quic/test_tools/mock_crypto_client_stream.h b/net/quic/test_tools/mock_crypto_client_stream.h index 0d0f5a4..4fb896e 100644 --- a/net/quic/test_tools/mock_crypto_client_stream.h +++ b/net/quic/test_tools/mock_crypto_client_stream.h
@@ -60,6 +60,12 @@ // QuicCryptoClientStream implementation. bool CryptoConnect() override; + // QuicCryptoStream implementation. + bool encryption_established() const override; + bool handshake_confirmed() const override; + const QuicCryptoNegotiatedParameters& crypto_negotiated_params() + const override; + // Invokes the sessions's CryptoHandshakeEvent method with the specified // event. void SendOnCryptoHandshakeEvent(QuicSession::CryptoHandshakeEvent event); @@ -69,6 +75,11 @@ private: void SetConfigNegotiated(); + bool encryption_established_; + bool handshake_confirmed_; + QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> + crypto_negotiated_params_; + const QuicServerId server_id_; const ProofVerifyDetailsChromium* proof_verify_details_; const QuicConfig config_;
diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc index c339e185..51136c56 100644 --- a/net/quic/test_tools/quic_test_utils.cc +++ b/net/quic/test_tools/quic_test_utils.cc
@@ -349,7 +349,7 @@ MockQuicSession::MockQuicSession(QuicConnection* connection) : QuicSession(connection, nullptr, DefaultQuicConfig()) { - crypto_stream_.reset(new QuicCryptoStream(this)); + crypto_stream_.reset(new MockQuicCryptoStream(this)); Initialize(); ON_CALL(*this, WritevData(_, _, _, _, _, _)) .WillByDefault(testing::Return(QuicConsumedData(0, false))); @@ -379,9 +379,27 @@ return QuicConsumedData(data.total_length, state != NO_FIN); } +MockQuicCryptoStream::MockQuicCryptoStream(QuicSession* session) + : QuicCryptoStream(session), params_(new QuicCryptoNegotiatedParameters) {} + +MockQuicCryptoStream::~MockQuicCryptoStream() {} + +bool MockQuicCryptoStream::encryption_established() const { + return false; +} + +bool MockQuicCryptoStream::handshake_confirmed() const { + return false; +} + +const QuicCryptoNegotiatedParameters& +MockQuicCryptoStream::crypto_negotiated_params() const { + return *params_; +} + MockQuicSpdySession::MockQuicSpdySession(QuicConnection* connection) : QuicSpdySession(connection, nullptr, DefaultQuicConfig()) { - crypto_stream_.reset(new QuicCryptoStream(this)); + crypto_stream_.reset(new MockQuicCryptoStream(this)); Initialize(); ON_CALL(*this, WritevData(_, _, _, _, _, _)) .WillByDefault(testing::Return(QuicConsumedData(0, false)));
diff --git a/net/quic/test_tools/quic_test_utils.h b/net/quic/test_tools/quic_test_utils.h index e6aa723..1781752 100644 --- a/net/quic/test_tools/quic_test_utils.h +++ b/net/quic/test_tools/quic_test_utils.h
@@ -517,6 +517,21 @@ DISALLOW_COPY_AND_ASSIGN(MockQuicSession); }; +class MockQuicCryptoStream : public QuicCryptoStream { + public: + explicit MockQuicCryptoStream(QuicSession* session); + + ~MockQuicCryptoStream() override; + + bool encryption_established() const override; + bool handshake_confirmed() const override; + const QuicCryptoNegotiatedParameters& crypto_negotiated_params() + const override; + + private: + QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> params_; +}; + class MockQuicSpdySession : public QuicSpdySession { public: // Takes ownership of |connection|.
diff --git a/net/socket/ssl_client_socket_pool_unittest.cc b/net/socket/ssl_client_socket_pool_unittest.cc index 8074680..39a11f0 100644 --- a/net/socket/ssl_client_socket_pool_unittest.cc +++ b/net/socket/ssl_client_socket_pool_unittest.cc
@@ -854,8 +854,8 @@ socket_factory_.AddSSLSocketDataProvider(&ssl); CreatePool(true /* tcp pool */, false, false); - base::WeakPtr<SpdySession> spdy_session = CreateSecureSpdySession( - session_.get(), test_hosts[0].key, NetLogWithSource()); + base::WeakPtr<SpdySession> spdy_session = + CreateSpdySession(session_.get(), test_hosts[0].key, NetLogWithSource()); EXPECT_TRUE( HasSpdySession(session_->spdy_session_pool(), test_hosts[0].key)); @@ -909,8 +909,8 @@ socket_factory_.AddSSLSocketDataProvider(ssl); CreatePool(true /* tcp pool */, false, false); - base::WeakPtr<SpdySession> spdy_session = CreateSecureSpdySession( - session_.get(), test_hosts[0].key, NetLogWithSource()); + base::WeakPtr<SpdySession> spdy_session = + CreateSpdySession(session_.get(), test_hosts[0].key, NetLogWithSource()); EXPECT_TRUE( HasSpdySession(session_->spdy_session_pool(), test_hosts[0].key));
diff --git a/net/spdy/chromium/bidirectional_stream_spdy_impl_unittest.cc b/net/spdy/chromium/bidirectional_stream_spdy_impl_unittest.cc index e291424b..18af57d 100644 --- a/net/spdy/chromium/bidirectional_stream_spdy_impl_unittest.cc +++ b/net/spdy/chromium/bidirectional_stream_spdy_impl_unittest.cc
@@ -262,8 +262,7 @@ session_deps_.socket_factory->AddSocketDataProvider(sequenced_data_.get()); session_deps_.net_log = net_log_.bound().net_log(); http_session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_); - session_ = - CreateSecureSpdySession(http_session_.get(), key_, net_log_.bound()); + session_ = CreateSpdySession(http_session_.get(), key_, net_log_.bound()); } BoundTestNetLog net_log_;
diff --git a/net/spdy/chromium/spdy_http_stream_unittest.cc b/net/spdy/chromium/spdy_http_stream_unittest.cc index 5fab85a..d715f51 100644 --- a/net/spdy/chromium/spdy_http_stream_unittest.cc +++ b/net/spdy/chromium/spdy_http_stream_unittest.cc
@@ -155,8 +155,7 @@ session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl_); http_session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_); - session_ = - CreateSecureSpdySession(http_session_.get(), key_, NetLogWithSource()); + session_ = CreateSpdySession(http_session_.get(), key_, NetLogWithSource()); } void TestSendCredentials(ChannelIDService* channel_id_service,
diff --git a/net/spdy/chromium/spdy_network_transaction_unittest.cc b/net/spdy/chromium/spdy_network_transaction_unittest.cc index 6579764..aa81bcd 100644 --- a/net/spdy/chromium/spdy_network_transaction_unittest.cc +++ b/net/spdy/chromium/spdy_network_transaction_unittest.cc
@@ -6685,4 +6685,33 @@ RunTLSUsageCheckTest(std::move(ssl_provider)); } +// Regression test for https://crbug.com/737143. +// This test sets up an old TLS version just like in TLSVersionTooOld, +// and makes sure that it results in an ERROR_CODE_INADEQUATE_SECURITY +// even for a non-secure request URL. +TEST_F(SpdyNetworkTransactionTest, InsecureUrlCreatesSecureSpdySession) { + auto ssl_provider = base::MakeUnique<SSLSocketDataProvider>(ASYNC, OK); + SSLConnectionStatusSetVersion(SSL_CONNECTION_VERSION_SSL3, + &ssl_provider->connection_status); + + SpdySerializedFrame goaway( + spdy_util_.ConstructSpdyGoAway(0, ERROR_CODE_INADEQUATE_SECURITY, "")); + MockWrite writes[] = {CreateMockWrite(goaway)}; + StaticSocketDataProvider data(nullptr, 0, writes, arraysize(writes)); + + HttpRequestInfo request; + request.method = "GET"; + request.url = GURL("http://www.example.org/"); + + // Need secure proxy so that insecure URL can use HTTP/2. + auto session_deps = base::MakeUnique<SpdySessionDependencies>( + ProxyService::CreateFixedFromPacResult("HTTPS myproxy:70")); + NormalSpdyTransactionHelper helper( + request, DEFAULT_PRIORITY, NetLogWithSource(), std::move(session_deps)); + + helper.RunToCompletionWithSSLData(&data, std::move(ssl_provider)); + TransactionHelperResult out = helper.output(); + EXPECT_THAT(out.rv, IsError(ERR_SPDY_INADEQUATE_TRANSPORT_SECURITY)); +}; + } // namespace net
diff --git a/net/spdy/chromium/spdy_proxy_client_socket_unittest.cc b/net/spdy/chromium/spdy_proxy_client_socket_unittest.cc index 7dc98b4..a3fd2340 100644 --- a/net/spdy/chromium/spdy_proxy_client_socket_unittest.cc +++ b/net/spdy/chromium/spdy_proxy_client_socket_unittest.cc
@@ -197,8 +197,8 @@ session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_); // Creates the SPDY session and stream. - spdy_session_ = CreateSecureSpdySession( - session_.get(), endpoint_spdy_session_key_, NetLogWithSource()); + spdy_session_ = CreateSpdySession(session_.get(), endpoint_spdy_session_key_, + NetLogWithSource()); base::WeakPtr<SpdyStream> spdy_stream( CreateStreamSynchronously( SPDY_BIDIRECTIONAL_STREAM, spdy_session_, url_, LOWEST,
diff --git a/net/spdy/chromium/spdy_session.cc b/net/spdy/chromium/spdy_session.cc index f8bb219..4a6afcc5 100644 --- a/net/spdy/chromium/spdy_session.cc +++ b/net/spdy/chromium/spdy_session.cc
@@ -753,7 +753,6 @@ bytes_pushed_and_unclaimed_count_(0u), in_flight_write_frame_type_(SpdyFrameType::DATA), in_flight_write_frame_size_(0), - is_secure_(false), availability_state_(STATE_AVAILABLE), read_state_(READ_STATE_DO_READ), write_state_(WRITE_STATE_IDLE), @@ -875,8 +874,7 @@ void SpdySession::InitializeWithSocket( std::unique_ptr<ClientSocketHandle> connection, - SpdySessionPool* pool, - bool is_secure) { + SpdySessionPool* pool) { CHECK(!in_io_loop_); DCHECK_EQ(availability_state_, STATE_AVAILABLE); DCHECK_EQ(read_state_, READ_STATE_DO_READ); @@ -888,7 +886,6 @@ DCHECK(connection->socket()); connection_ = std::move(connection); - is_secure_ = is_secure; session_send_window_size_ = kDefaultInitialWindowSize; session_recv_window_size_ = kDefaultInitialWindowSize; @@ -1140,11 +1137,6 @@ return LOAD_STATE_IDLE; } -url::SchemeHostPort SpdySession::GetServer() { - return url::SchemeHostPort(is_secure_ ? "https" : "http", - host_port_pair().host(), host_port_pair().port()); -} - bool SpdySession::GetRemoteEndpoint(IPEndPoint* endpoint) { return GetPeerAddress(endpoint) == OK; } @@ -1156,10 +1148,6 @@ Error SpdySession::GetTokenBindingSignature(crypto::ECPrivateKey* key, TokenBindingType tb_type, std::vector<uint8_t>* out) { - if (!is_secure_) { - NOTREACHED(); - return ERR_FAILED; - } SSLClientSocket* ssl_socket = static_cast<SSLClientSocket*>(connection_->socket()); return ssl_socket->GetTokenBindingSignature(key, tb_type, out); @@ -1268,8 +1256,6 @@ dict->SetInteger("unclaimed_pushed_streams", unclaimed_pushed_streams_.size()); - dict->SetBoolean("is_secure", is_secure_); - dict->SetString( "negotiated_protocol", NextProtoToString(connection_->socket()->GetNegotiatedProtocol())); @@ -1335,11 +1321,6 @@ } bool SpdySession::HasAcceptableTransportSecurity() const { - // If we're not even using TLS, we have no standards to meet. - if (!is_secure_) { - return true; - } - SSLInfo ssl_info; CHECK(GetSSLInfo(&ssl_info)); @@ -2981,9 +2962,6 @@ SpdyStreamId stream_id, SpdyStringPiece origin, const SpdyAltSvcWireFormat::AlternativeServiceVector& altsvc_vector) { - if (!is_secure_) - return; - url::SchemeHostPort scheme_host_port; if (stream_id == 0) { if (origin.empty())
diff --git a/net/spdy/chromium/spdy_session.h b/net/spdy/chromium/spdy_session.h index aad4c26..67eb00e 100644 --- a/net/spdy/chromium/spdy_session.h +++ b/net/spdy/chromium/spdy_session.h
@@ -343,10 +343,7 @@ // not claimed and active, sends RST to the server to cancel the stream. void CancelPush(const GURL& url); - // Initialize the session with the given connection. |is_secure| - // must indicate whether |connection| uses an SSL socket or not; it - // is usually true, but it can be false for testing or when SPDY is - // configured to work with non-secure sockets. + // Initialize the session with the given connection. // // |pool| is the SpdySessionPool that owns us. Its lifetime must // strictly be greater than |this|. @@ -355,8 +352,7 @@ // iteration, so the SpdySession may close immediately afterwards if the first // read of |connection| fails. void InitializeWithSocket(std::unique_ptr<ClientSocketHandle> connection, - SpdySessionPool* pool, - bool is_secure); + SpdySessionPool* pool); // Check to see if this SPDY session can support an additional domain. // If the session is un-authenticated, then this call always returns true. @@ -416,9 +412,6 @@ // status, such as "resolving host", "connecting", etc. LoadState GetLoadState() const; - // Returns server infomation in the form of (scheme/host/port). - url::SchemeHostPort GetServer(); - // MultiplexedSession methods: bool GetRemoteEndpoint(IPEndPoint* endpoint) override; bool GetSSLInfo(SSLInfo* ssl_info) const override; @@ -1090,9 +1083,6 @@ // the socket completely. base::WeakPtr<SpdyStream> in_flight_write_stream_; - // Flag if we're using an SSL connection for this SpdySession. - bool is_secure_; - // Spdy Frame state. std::unique_ptr<BufferedSpdyFramer> buffered_spdy_framer_;
diff --git a/net/spdy/chromium/spdy_session_fuzzer.cc b/net/spdy/chromium/spdy_session_fuzzer.cc index f219295e..f8ed8c69 100644 --- a/net/spdy/chromium/spdy_session_fuzzer.cc +++ b/net/spdy/chromium/spdy_session_fuzzer.cc
@@ -4,14 +4,22 @@ #include "base/logging.h" #include "base/macros.h" +#include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "base/test/fuzzed_data_provider.h" +#include "net/base/host_port_pair.h" #include "net/base/net_errors.h" #include "net/base/request_priority.h" #include "net/log/net_log_source.h" #include "net/log/test_net_log.h" +#include "net/socket/client_socket_handle.h" #include "net/socket/fuzzed_socket_factory.h" +#include "net/socket/socket_test_util.h" +#include "net/socket/ssl_client_socket.h" #include "net/spdy/chromium/spdy_test_util_common.h" +#include "net/ssl/ssl_config.h" +#include "net/test/cert_test_util.h" +#include "net/test/test_data_directory.h" namespace { @@ -40,14 +48,65 @@ } // namespace +namespace net { + +namespace { + +class FuzzedSocketFactoryWithMockSSLData : public FuzzedSocketFactory { + public: + explicit FuzzedSocketFactoryWithMockSSLData( + base::FuzzedDataProvider* data_provider); + + void AddSSLSocketDataProvider(SSLSocketDataProvider* socket); + + std::unique_ptr<SSLClientSocket> CreateSSLClientSocket( + std::unique_ptr<ClientSocketHandle> transport_socket, + const HostPortPair& host_and_port, + const SSLConfig& ssl_config, + const SSLClientSocketContext& context) override; + + private: + SocketDataProviderArray<SSLSocketDataProvider> mock_ssl_data_; +}; + +FuzzedSocketFactoryWithMockSSLData::FuzzedSocketFactoryWithMockSSLData( + base::FuzzedDataProvider* data_provider) + : FuzzedSocketFactory(data_provider) {} + +void FuzzedSocketFactoryWithMockSSLData::AddSSLSocketDataProvider( + SSLSocketDataProvider* data) { + mock_ssl_data_.Add(data); +} + +std::unique_ptr<SSLClientSocket> +FuzzedSocketFactoryWithMockSSLData::CreateSSLClientSocket( + std::unique_ptr<ClientSocketHandle> transport_socket, + const HostPortPair& host_and_port, + const SSLConfig& ssl_config, + const SSLClientSocketContext& context) { + return base::MakeUnique<MockSSLClientSocket>(std::move(transport_socket), + host_and_port, ssl_config, + mock_ssl_data_.GetNext()); +} + +} // namespace + +} // namespace net + // Fuzzer for SpdySession // // |data| is used to create a FuzzedServerSocket. extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { net::BoundTestNetLog bound_test_net_log; base::FuzzedDataProvider data_provider(data, size); - net::FuzzedSocketFactory socket_factory(&data_provider); + net::FuzzedSocketFactoryWithMockSSLData socket_factory(&data_provider); socket_factory.set_fuzz_connect_result(false); + + net::SSLSocketDataProvider ssl_provider(net::ASYNC, net::OK); + ssl_provider.cert = + net::ImportCertFromFile(net::GetTestCertsDirectory(), "spdy_pooling.pem"); + socket_factory.AddSSLSocketDataProvider(&ssl_provider); + net::SpdySessionDependencies deps; std::unique_ptr<net::HttpNetworkSession> http_session( net::SpdySessionDependencies::SpdyCreateSessionWithSocketFactory( @@ -56,7 +115,7 @@ net::ProxyServer direct_connect(net::ProxyServer::Direct()); net::SpdySessionKey session_key(net::HostPortPair("127.0.0.1", 80), direct_connect, net::PRIVACY_MODE_DISABLED); - base::WeakPtr<net::SpdySession> spdy_session(net::CreateInsecureSpdySession( + base::WeakPtr<net::SpdySession> spdy_session(net::CreateSpdySession( http_session.get(), session_key, bound_test_net_log.bound())); net::SpdyStreamRequest stream_request;
diff --git a/net/spdy/chromium/spdy_session_pool.cc b/net/spdy/chromium/spdy_session_pool.cc index 2fc5e2b..a8aca9b 100644 --- a/net/spdy/chromium/spdy_session_pool.cc +++ b/net/spdy/chromium/spdy_session_pool.cc
@@ -94,8 +94,7 @@ base::WeakPtr<SpdySession> SpdySessionPool::CreateAvailableSessionFromSocket( const SpdySessionKey& key, std::unique_ptr<ClientSocketHandle> connection, - const NetLogWithSource& net_log, - bool is_secure) { + const NetLogWithSource& net_log) { TRACE_EVENT0(kNetTracingCategory, "SpdySessionPool::CreateAvailableSessionFromSocket"); @@ -109,7 +108,7 @@ initial_settings_, time_func_, push_delegate_, proxy_delegate_, net_log.net_log()); - new_session->InitializeWithSocket(std::move(connection), this, is_secure); + new_session->InitializeWithSocket(std::move(connection), this); base::WeakPtr<SpdySession> available_session = new_session->GetWeakPtr(); sessions_.insert(new_session.release());
diff --git a/net/spdy/chromium/spdy_session_pool.h b/net/spdy/chromium/spdy_session_pool.h index 4b74ffd..077fc56f 100644 --- a/net/spdy/chromium/spdy_session_pool.h +++ b/net/spdy/chromium/spdy_session_pool.h
@@ -7,6 +7,7 @@ #include <stddef.h> +#include <list> #include <map> #include <memory> #include <set> @@ -77,17 +78,13 @@ // Create a new SPDY session from an existing socket. There must // not already be a session for the given key. // - // |is_secure| can be false for testing or when SPDY is configured - // to work with non-secure sockets. - // // Returns the new SpdySession. Note that the SpdySession begins reading from // |connection| on a subsequent event loop iteration, so it may be closed // immediately afterwards if the first read of |connection| fails. base::WeakPtr<SpdySession> CreateAvailableSessionFromSocket( const SpdySessionKey& key, std::unique_ptr<ClientSocketHandle> connection, - const NetLogWithSource& net_log, - bool is_secure); + const NetLogWithSource& net_log); // If |url| is not empty and there is a session for |key| that has an // unclaimed push stream for |url|, return it.
diff --git a/net/spdy/chromium/spdy_session_pool_unittest.cc b/net/spdy/chromium/spdy_session_pool_unittest.cc index e11ce80..c561e5a 100644 --- a/net/spdy/chromium/spdy_session_pool_unittest.cc +++ b/net/spdy/chromium/spdy_session_pool_unittest.cc
@@ -128,8 +128,8 @@ CreateNetworkSession(); // Setup the first session to the first host. - base::WeakPtr<SpdySession> session = CreateSecureSpdySession( - http_session_.get(), test_key, NetLogWithSource()); + base::WeakPtr<SpdySession> session = + CreateSpdySession(http_session_.get(), test_key, NetLogWithSource()); // Flush the SpdySession::OnReadComplete() task. base::RunLoop().RunUntilIdle(); @@ -174,7 +174,7 @@ SpdySessionKey key1(test_host_port_pair1, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); base::WeakPtr<SpdySession> session1 = - CreateSecureSpdySession(http_session_.get(), key1, NetLogWithSource()); + CreateSpdySession(http_session_.get(), key1, NetLogWithSource()); GURL url1(kTestHost1); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously( SPDY_BIDIRECTIONAL_STREAM, session1, url1, MEDIUM, NetLogWithSource()); @@ -189,7 +189,7 @@ SpdySessionKey key2(test_host_port_pair2, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); base::WeakPtr<SpdySession> session2 = - CreateSecureSpdySession(http_session_.get(), key2, NetLogWithSource()); + CreateSpdySession(http_session_.get(), key2, NetLogWithSource()); GURL url2(kTestHost2); base::WeakPtr<SpdyStream> spdy_stream2 = CreateStreamSynchronously( SPDY_BIDIRECTIONAL_STREAM, session2, url2, MEDIUM, NetLogWithSource()); @@ -204,7 +204,7 @@ SpdySessionKey key3(test_host_port_pair3, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); base::WeakPtr<SpdySession> session3 = - CreateSecureSpdySession(http_session_.get(), key3, NetLogWithSource()); + CreateSpdySession(http_session_.get(), key3, NetLogWithSource()); GURL url3(kTestHost3); base::WeakPtr<SpdyStream> spdy_stream3 = CreateStreamSynchronously( SPDY_BIDIRECTIONAL_STREAM, session3, url3, MEDIUM, NetLogWithSource()); @@ -300,8 +300,8 @@ CreateNetworkSession(); // Setup the first session to the first host. - base::WeakPtr<SpdySession> session = CreateSecureSpdySession( - http_session_.get(), test_key, NetLogWithSource()); + base::WeakPtr<SpdySession> session = + CreateSpdySession(http_session_.get(), test_key, NetLogWithSource()); // Flush the SpdySession::OnReadComplete() task. base::RunLoop().RunUntilIdle(); @@ -380,7 +380,7 @@ CreateNetworkSession(); // Setup the first session to the first host. - base::WeakPtr<SpdySession> session = CreateSecureSpdySession( + base::WeakPtr<SpdySession> session = CreateSpdySession( http_session_.get(), test_hosts[0].key, NetLogWithSource()); // Flush the SpdySession::OnReadComplete() task. @@ -416,7 +416,7 @@ AddSSLSocketData(); - base::WeakPtr<SpdySession> session2 = CreateSecureSpdySession( + base::WeakPtr<SpdySession> session2 = CreateSpdySession( http_session_.get(), test_hosts[2].key, NetLogWithSource()); // Verify that we have sessions for everything. @@ -562,7 +562,7 @@ CreateNetworkSession(); // Open SpdySession to the first host. - base::WeakPtr<SpdySession> session0 = CreateSecureSpdySession( + base::WeakPtr<SpdySession> session0 = CreateSpdySession( http_session_.get(), test_hosts[0].key, NetLogWithSource()); // A request to the second host should pool to the existing connection. @@ -648,7 +648,7 @@ CreateNetworkSession(); // Open SpdySession to the first host. - base::WeakPtr<SpdySession> session0 = CreateSecureSpdySession( + base::WeakPtr<SpdySession> session0 = CreateSpdySession( http_session_.get(), test_hosts[0].key, NetLogWithSource()); // A request to the second host should pool to the existing connection. @@ -709,7 +709,7 @@ SpdySessionKey keyA( test_host_port_pairA, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); base::WeakPtr<SpdySession> sessionA = - CreateSecureSpdySession(http_session_.get(), keyA, NetLogWithSource()); + CreateSpdySession(http_session_.get(), keyA, NetLogWithSource()); GURL urlA("http://www.example.org"); base::WeakPtr<SpdyStream> spdy_streamA = CreateStreamSynchronously( @@ -740,7 +740,7 @@ SpdySessionKey keyB( test_host_port_pairB, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); base::WeakPtr<SpdySession> sessionB = - CreateSecureSpdySession(http_session_.get(), keyB, NetLogWithSource()); + CreateSpdySession(http_session_.get(), keyB, NetLogWithSource()); EXPECT_TRUE(sessionB->IsAvailable()); GURL urlB("http://mail.example.org"); @@ -762,7 +762,7 @@ SpdySessionKey keyC( test_host_port_pairC, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); base::WeakPtr<SpdySession> sessionC = - CreateSecureSpdySession(http_session_.get(), keyC, NetLogWithSource()); + CreateSpdySession(http_session_.get(), keyC, NetLogWithSource()); sessionC->CloseSessionOnError(ERR_SPDY_PROTOCOL_ERROR, "Error!"); EXPECT_TRUE(sessionC->IsDraining()); @@ -814,7 +814,7 @@ CreateNetworkSession(); base::WeakPtr<SpdySession> session = - CreateSecureSpdySession(http_session_.get(), key, NetLogWithSource()); + CreateSpdySession(http_session_.get(), key, NetLogWithSource()); // Flush the SpdySession::OnReadComplete() task. base::RunLoop().RunUntilIdle(); @@ -865,7 +865,7 @@ CreateNetworkSession(); base::WeakPtr<SpdySession> session = - CreateSecureSpdySession(http_session_.get(), key, NetLogWithSource()); + CreateSpdySession(http_session_.get(), key, NetLogWithSource()); // Flush the SpdySession::OnReadComplete() task. base::RunLoop().RunUntilIdle();
diff --git a/net/spdy/chromium/spdy_session_unittest.cc b/net/spdy/chromium/spdy_session_unittest.cc index 6b09f43..77598a7 100644 --- a/net/spdy/chromium/spdy_session_unittest.cc +++ b/net/spdy/chromium/spdy_session_unittest.cc
@@ -161,22 +161,16 @@ spdy_session_pool_ = http_session_->spdy_session_pool(); } - void CreateInsecureSpdySession() { - DCHECK(!session_); - session_ = ::net::CreateInsecureSpdySession(http_session_.get(), key_, - log_.bound()); - } - void AddSSLSocketData() { ssl_.cert = ImportCertFromFile(GetTestCertsDirectory(), "spdy_pooling.pem"); ASSERT_TRUE(ssl_.cert); session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl_); } - void CreateSecureSpdySession() { + void CreateSpdySession() { DCHECK(!session_); session_ = - ::net::CreateSecureSpdySession(http_session_.get(), key_, log_.bound()); + ::net::CreateSpdySession(http_session_.get(), key_, log_.bound()); } void StallSessionSend() { @@ -283,7 +277,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); // Create the maximum number of concurrent streams. for (size_t i = 0; i < kInitialMaxConcurrentStreams; ++i) { @@ -330,7 +324,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); EXPECT_TRUE(HasSpdySession(spdy_session_pool_, key_)); @@ -388,7 +382,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -458,7 +452,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -519,7 +513,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -588,7 +582,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -676,7 +670,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -717,7 +711,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -777,7 +771,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -827,7 +821,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -889,7 +883,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, session_, test_url_, @@ -942,7 +936,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, session_, test_url_, @@ -987,7 +981,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -1051,7 +1045,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); // Fix stream_hi_water_mark_ to allow for two stream activations. session_->stream_hi_water_mark_ = kLastStreamId - 2; @@ -1175,7 +1169,7 @@ // Create session. CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); // Receive SETTINGS frame that sets max_concurrent_streams to zero. base::RunLoop().RunUntilIdle(); @@ -1239,7 +1233,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); // Fix max_concurrent_streams to allow for one open stream. session_->max_concurrent_streams_ = 1; @@ -1326,7 +1320,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); // Process the principal request, and the first push stream request & body. base::WeakPtr<SpdyStream> spdy_stream = @@ -1418,7 +1412,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); // Process the principal request, and the first push stream request & body. base::WeakPtr<SpdyStream> spdy_stream = @@ -1511,7 +1505,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); // Process the principal request, and the first push stream request & body. base::WeakPtr<SpdyStream> spdy_stream = @@ -1602,7 +1596,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); // Process the principal request, and the first push stream request & body. base::WeakPtr<SpdyStream> spdy_stream = @@ -1701,7 +1695,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); // Process the principal request, and the first push stream request & body. base::WeakPtr<SpdyStream> spdy_stream = @@ -1776,7 +1770,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, session_, test_url_, @@ -1841,7 +1835,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); // Create the maximum number of concurrent streams. for (size_t i = 0; i < kInitialMaxConcurrentStreams; ++i) { @@ -1888,7 +1882,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); // Leave room for only one more stream to be created. for (size_t i = 0; i < kInitialMaxConcurrentStreams - 1; ++i) { @@ -1938,7 +1932,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); EXPECT_TRUE(HasSpdySession(spdy_session_pool_, key_)); // Flush the read completion task. @@ -1977,7 +1971,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); EXPECT_TRUE(HasSpdySession(spdy_session_pool_, key_)); // Flush the read completion task. @@ -2034,7 +2028,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); EXPECT_TRUE(HasSpdySession(spdy_session_pool_, key_)); // Flush the read completion task. @@ -2077,7 +2071,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -2136,7 +2130,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream_lowest = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -2198,7 +2192,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -2259,7 +2253,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, session_, test_url_, @@ -2313,7 +2307,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, session_, test_url_, @@ -2381,7 +2375,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -2454,7 +2448,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -2551,7 +2545,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -2593,7 +2587,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); EXPECT_TRUE(session_->VerifyDomainAuthentication("www.example.org")); EXPECT_TRUE(session_->VerifyDomainAuthentication("mail.example.org")); @@ -2611,7 +2605,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); EXPECT_TRUE(session_->VerifyDomainAuthentication("www.example.org")); EXPECT_TRUE(session_->VerifyDomainAuthentication("mail.example.org")); @@ -2673,7 +2667,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); // Read the settings frame. base::RunLoop().RunUntilIdle(); @@ -2780,7 +2774,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); // Leave room for only one more stream to be created. for (size_t i = 0; i < kInitialMaxConcurrentStreams - 1; ++i) { @@ -2896,7 +2890,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -2958,7 +2952,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -3028,7 +3022,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -3110,7 +3104,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -3218,7 +3212,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -3282,7 +3276,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -3354,7 +3348,7 @@ HttpNetworkSession::NORMAL_SOCKET_POOL); // Create an idle SPDY session. - CreateSecureSpdySession(); + CreateSpdySession(); EXPECT_FALSE(pool->IsStalled()); // Trying to create a new connection should cause the pool to be stalled, and @@ -3414,8 +3408,8 @@ // Create an idle SPDY session. SpdySessionKey key1(HostPortPair("www.example.org", 80), ProxyServer::Direct(), PRIVACY_MODE_DISABLED); - base::WeakPtr<SpdySession> session1 = ::net::CreateSecureSpdySession( - http_session_.get(), key1, NetLogWithSource()); + base::WeakPtr<SpdySession> session1 = + ::net::CreateSpdySession(http_session_.get(), key1, NetLogWithSource()); EXPECT_FALSE(pool->IsStalled()); // Set up an alias for the idle SPDY session, increasing its ref count to 2. @@ -3497,7 +3491,7 @@ HttpNetworkSession::NORMAL_SOCKET_POOL); // Create a SPDY session. - CreateSecureSpdySession(); + CreateSpdySession(); EXPECT_FALSE(pool->IsStalled()); // Create a stream using the session, and send a request. @@ -3628,7 +3622,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -3692,7 +3686,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, session_, test_url_, MEDIUM, NetLogWithSource()); @@ -3747,7 +3741,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); EXPECT_EQ(initial_window_size, session_->session_recv_window_size_); EXPECT_EQ(0, session_->session_unacked_recv_window_bytes_); @@ -3824,7 +3818,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); EXPECT_EQ(kDefaultInitialWindowSize, session_->session_recv_window_size_); EXPECT_EQ(0, session_->session_unacked_recv_window_bytes_); @@ -3858,7 +3852,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); EXPECT_EQ(kDefaultInitialWindowSize, session_->session_recv_window_size_); EXPECT_EQ(0, session_->session_unacked_recv_window_bytes_); @@ -3906,7 +3900,7 @@ stream_max_recv_window_size; CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -3978,7 +3972,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); // Setting session level receiving window size to smaller than initial is not // possible via SpdySessionPoolPeer. session_->session_recv_window_size_ = session_max_recv_window_size; @@ -4044,7 +4038,7 @@ stream_max_recv_window_size; CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -4131,7 +4125,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> stream = CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, session_, test_url_, @@ -4196,7 +4190,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> stream = CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, session_, test_url_, @@ -4279,7 +4273,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> stream = CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, session_, test_url_, @@ -4377,7 +4371,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> stream = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -4503,7 +4497,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -4636,7 +4630,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -4770,7 +4764,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -4863,7 +4857,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -4923,7 +4917,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); // Read the settings frame. base::RunLoop().RunUntilIdle(); @@ -5009,7 +5003,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); session_->set_max_concurrent_pushed_streams(1); base::WeakPtr<SpdyStream> spdy_stream1 = @@ -5106,7 +5100,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -5185,7 +5179,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -5255,7 +5249,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); session_->set_max_concurrent_pushed_streams(1); base::WeakPtr<SpdyStream> spdy_stream1 = @@ -5346,7 +5340,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -5418,7 +5412,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); session_->stream_hi_water_mark_ = 5; // Low client (odd) ids are fine. @@ -5487,7 +5481,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, @@ -5533,7 +5527,7 @@ SpdySessionPoolPeer pool_peer(spdy_session_pool_); pool_peer.SetEnableSendingInitialData(true); - CreateSecureSpdySession(); + CreateSpdySession(); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(data.AllWriteDataConsumed()); @@ -5615,9 +5609,9 @@ session_deps_.socket_factory->AddSocketDataProvider(data_.get()); } - void CreateSecureSpdySession() { - session_ = ::net::CreateSecureSpdySession(http_session_.get(), key_, - NetLogWithSource()); + void CreateSpdySession() { + session_ = + ::net::CreateSpdySession(http_session_.get(), key_, NetLogWithSource()); } SpdyAltSvcWireFormat::AlternativeService alternative_service_; @@ -5637,7 +5631,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::RunLoop().RunUntilIdle(); @@ -5675,7 +5669,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::RunLoop().RunUntilIdle(); @@ -5692,31 +5686,6 @@ ASSERT_EQ(0u, altsvc_info_vector.size()); } -TEST_F(AltSvcFrameTest, DoNotProcessAltSvcFrameOnInsecureSession) { - const char origin[] = "https://mail.example.org"; - SpdyAltSvcIR altsvc_ir(/* stream_id = */ 0); - altsvc_ir.add_altsvc(alternative_service_); - altsvc_ir.set_origin(origin); - AddSocketData(altsvc_ir); - AddSSLSocketData(); - - CreateNetworkSession(); - CreateInsecureSpdySession(); - - base::RunLoop().RunUntilIdle(); - - const url::SchemeHostPort session_origin("https", test_url_.host(), - test_url_.EffectiveIntPort()); - ASSERT_TRUE(spdy_session_pool_->http_server_properties() - ->GetAlternativeServiceInfos(session_origin) - .empty()); - - ASSERT_TRUE( - spdy_session_pool_->http_server_properties() - ->GetAlternativeServiceInfos(url::SchemeHostPort(GURL(origin))) - .empty()); -} - TEST_F(AltSvcFrameTest, DoNotProcessAltSvcFrameForOriginNotCoveredByCert) { const char origin[] = "https://invalid.example.org"; SpdyAltSvcIR altsvc_ir(/* stream_id = */ 0); @@ -5726,7 +5695,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::RunLoop().RunUntilIdle(); @@ -5751,7 +5720,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::RunLoop().RunUntilIdle(); @@ -5773,7 +5742,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::RunLoop().RunUntilIdle(); @@ -5808,7 +5777,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously( SPDY_REQUEST_RESPONSE_STREAM, session_, GURL(request_origin), MEDIUM, @@ -5862,7 +5831,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously( SPDY_REQUEST_RESPONSE_STREAM, session_, GURL(request_origin), MEDIUM, @@ -5895,7 +5864,7 @@ AddSSLSocketData(); CreateNetworkSession(); - CreateSecureSpdySession(); + CreateSpdySession(); base::RunLoop().RunUntilIdle();
diff --git a/net/spdy/chromium/spdy_stream_unittest.cc b/net/spdy/chromium/spdy_stream_unittest.cc index 9b04687..d81a98c 100644 --- a/net/spdy/chromium/spdy_stream_unittest.cc +++ b/net/spdy/chromium/spdy_stream_unittest.cc
@@ -74,7 +74,7 @@ base::WeakPtr<SpdySession> CreateDefaultSpdySession() { SpdySessionKey key(HostPortPair::FromURL(url_), ProxyServer::Direct(), PRIVACY_MODE_DISABLED); - return CreateSecureSpdySession(session_.get(), key, NetLogWithSource()); + return CreateSpdySession(session_.get(), key, NetLogWithSource()); } void TearDown() override { base::RunLoop().RunUntilIdle(); }
diff --git a/net/spdy/chromium/spdy_test_util_common.cc b/net/spdy/chromium/spdy_test_util_common.cc index 9da3d1c..fa88cec 100644 --- a/net/spdy/chromium/spdy_test_util_common.cc +++ b/net/spdy/chromium/spdy_test_util_common.cc
@@ -498,7 +498,6 @@ const SpdySessionKey& key, const NetLogWithSource& net_log, Error expected_status, - bool is_secure, bool enable_ip_based_pooling) { EXPECT_FALSE(http_session->spdy_session_pool()->FindAvailableSession( key, GURL(), enable_ip_based_pooling, NetLogWithSource())); @@ -512,30 +511,15 @@ TestCompletionCallback callback; int rv = ERR_UNEXPECTED; - if (is_secure) { - SSLConfig ssl_config; - scoped_refptr<SSLSocketParams> ssl_params( - new SSLSocketParams(transport_params, - NULL, - NULL, - key.host_port_pair(), - ssl_config, - key.privacy_mode(), - 0, - false)); - rv = connection->Init( - key.host_port_pair().ToString(), ssl_params, MEDIUM, - ClientSocketPool::RespectLimits::ENABLED, callback.callback(), - http_session->GetSSLSocketPool(HttpNetworkSession::NORMAL_SOCKET_POOL), - net_log); - } else { - rv = connection->Init(key.host_port_pair().ToString(), transport_params, - MEDIUM, ClientSocketPool::RespectLimits::ENABLED, - callback.callback(), - http_session->GetTransportSocketPool( - HttpNetworkSession::NORMAL_SOCKET_POOL), - net_log); - } + SSLConfig ssl_config; + scoped_refptr<SSLSocketParams> ssl_params( + new SSLSocketParams(transport_params, NULL, NULL, key.host_port_pair(), + ssl_config, key.privacy_mode(), 0, false)); + rv = connection->Init( + key.host_port_pair().ToString(), ssl_params, MEDIUM, + ClientSocketPool::RespectLimits::ENABLED, callback.callback(), + http_session->GetSSLSocketPool(HttpNetworkSession::NORMAL_SOCKET_POOL), + net_log); if (rv == ERR_IO_PENDING) rv = callback.WaitForResult(); @@ -544,7 +528,7 @@ base::WeakPtr<SpdySession> spdy_session = http_session->spdy_session_pool()->CreateAvailableSessionFromSocket( - key, std::move(connection), net_log, is_secure); + key, std::move(connection), net_log); // Failure is reported asynchronously. EXPECT_TRUE(spdy_session); EXPECT_TRUE(HasSpdySession(http_session->spdy_session_pool(), key)); @@ -553,15 +537,6 @@ } // namespace -base::WeakPtr<SpdySession> CreateInsecureSpdySession( - HttpNetworkSession* http_session, - const SpdySessionKey& key, - const NetLogWithSource& net_log) { - return CreateSpdySessionHelper(http_session, key, net_log, OK, - /* is_secure = */ false, - /* enable_ip_based_pooling = */ true); -} - base::WeakPtr<SpdySession> TryCreateSpdySessionExpectingFailure( HttpNetworkSession* http_session, const SpdySessionKey& key, @@ -569,16 +544,13 @@ const NetLogWithSource& net_log) { DCHECK_LT(expected_error, ERR_IO_PENDING); return CreateSpdySessionHelper(http_session, key, net_log, expected_error, - /* is_secure = */ true, /* enable_ip_based_pooling = */ true); } -base::WeakPtr<SpdySession> CreateSecureSpdySession( - HttpNetworkSession* http_session, - const SpdySessionKey& key, - const NetLogWithSource& net_log) { +base::WeakPtr<SpdySession> CreateSpdySession(HttpNetworkSession* http_session, + const SpdySessionKey& key, + const NetLogWithSource& net_log) { return CreateSpdySessionHelper(http_session, key, net_log, OK, - /* is_secure = */ true, /* enable_ip_based_pooling = */ true); } @@ -587,7 +559,6 @@ const SpdySessionKey& key, const NetLogWithSource& net_log) { return CreateSpdySessionHelper(http_session, key, net_log, OK, - /* is_secure = */ true, /* enable_ip_based_pooling = */ false); } @@ -657,8 +628,8 @@ handle->SetSocket(base::MakeUnique<FakeSpdySessionClientSocket>( expected_status == OK ? ERR_IO_PENDING : expected_status)); base::WeakPtr<SpdySession> spdy_session = - pool->CreateAvailableSessionFromSocket( - key, std::move(handle), NetLogWithSource(), true /* is_secure */); + pool->CreateAvailableSessionFromSocket(key, std::move(handle), + NetLogWithSource()); // Failure is reported asynchronously. EXPECT_TRUE(spdy_session); EXPECT_TRUE(HasSpdySession(pool, key));
diff --git a/net/spdy/chromium/spdy_test_util_common.h b/net/spdy/chromium/spdy_test_util_common.h index 82e5a56c..6937c4e 100644 --- a/net/spdy/chromium/spdy_test_util_common.h +++ b/net/spdy/chromium/spdy_test_util_common.h
@@ -234,14 +234,6 @@ // NULL. bool HasSpdySession(SpdySessionPool* pool, const SpdySessionKey& key); -// Creates a SPDY session for the given key and puts it in the SPDY -// session pool in |http_session|. A SPDY session for |key| must not -// already exist. -base::WeakPtr<SpdySession> CreateInsecureSpdySession( - HttpNetworkSession* http_session, - const SpdySessionKey& key, - const NetLogWithSource& net_log); - // Tries to create a SPDY session for the given key but expects the // attempt to fail with the given error. A SPDY session for |key| must // not already exist. The session will be created but close in the @@ -252,13 +244,14 @@ Error expected_error, const NetLogWithSource& net_log); -// Like CreateInsecureSpdySession(), but uses TLS. -base::WeakPtr<SpdySession> CreateSecureSpdySession( - HttpNetworkSession* http_session, - const SpdySessionKey& key, - const NetLogWithSource& net_log); +// Creates a SPDY session for the given key and puts it in the SPDY +// session pool in |http_session|. A SPDY session for |key| must not +// already exist. +base::WeakPtr<SpdySession> CreateSpdySession(HttpNetworkSession* http_session, + const SpdySessionKey& key, + const NetLogWithSource& net_log); -// Like CreateSecureSpdySession(), but does not fail if there is already an IP +// Like CreateSpdySession(), but does not fail if there is already an IP // pooled session for |key|. base::WeakPtr<SpdySession> CreateSecureSpdySessionWithIpBasedPoolingDisabled( HttpNetworkSession* http_session,
diff --git a/net/ssl/client_cert_store_nss.cc b/net/ssl/client_cert_store_nss.cc index 09b594f..b3c2766 100644 --- a/net/ssl/client_cert_store_nss.cc +++ b/net/ssl/client_cert_store_nss.cc
@@ -84,7 +84,7 @@ // Caller is responsible for keeping the ClientCertStore // alive until the callback is run. base::Unretained(this), std::move(password_delegate), - &request), + base::Unretained(&request)), callback)) { return; }
diff --git a/net/test/android/javatests/src/org/chromium/net/test/EmbeddedTestServer.java b/net/test/android/javatests/src/org/chromium/net/test/EmbeddedTestServer.java index 9ebe2ba..6cc7878d 100644 --- a/net/test/android/javatests/src/org/chromium/net/test/EmbeddedTestServer.java +++ b/net/test/android/javatests/src/org/chromium/net/test/EmbeddedTestServer.java
@@ -279,6 +279,21 @@ } } + /** Get the full URLs for the given relative URLs. + * + * @see #getURL(String) + * + * @param relativeUrls The relative URLs for which full URLs will be obtained. + * @return The URLs as a String array. + */ + public String[] getURLs(String... relativeUrls) { + String[] absoluteUrls = new String[relativeUrls.length]; + + for (int i = 0; i < relativeUrls.length; ++i) absoluteUrls[i] = getURL(relativeUrls[i]); + + return absoluteUrls; + } + /** Shutdown the server. * * @return Whether the server was successfully shut down.
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc index 3d1c0ac..e7ce866d5 100644 --- a/net/tools/quic/end_to_end_test.cc +++ b/net/tools/quic/end_to_end_test.cc
@@ -384,16 +384,13 @@ // TODO(nimia): Consider setting the congestion control algorithm for the // client as well according to the test parameter. copt.push_back(GetParam().congestion_control_tag); - if (GetParam().congestion_control_tag == kQBIC && - FLAGS_quic_reloadable_flag_quic_fix_cubic_convex_mode) { + if (GetParam().congestion_control_tag == kQBIC) { copt.push_back(kCCVX); } - if (GetParam().congestion_control_tag == kQBIC && - FLAGS_quic_reloadable_flag_quic_fix_cubic_bytes_quantization) { + if (GetParam().congestion_control_tag == kQBIC) { copt.push_back(kCBQT); } - if (GetParam().congestion_control_tag == kQBIC && - FLAGS_quic_reloadable_flag_quic_enable_cubic_per_ack_updates) { + if (GetParam().congestion_control_tag == kQBIC) { copt.push_back(kCPAU); } if (GetParam().congestion_control_tag == kTPCC && @@ -2218,9 +2215,6 @@ TEST_P(EndToEndTest, CanceledStreamDoesNotBecomeZombie) { ASSERT_TRUE(Initialize()); - if (GetParam().force_hol_blocking) { - return; - } EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed()); // Lose the request. SetPacketLossPercentage(100);
diff --git a/net/tools/quic/quic_dispatcher_test.cc b/net/tools/quic/quic_dispatcher_test.cc index 95c73c1..6491ebfc 100644 --- a/net/tools/quic/quic_dispatcher_test.cc +++ b/net/tools/quic/quic_dispatcher_test.cc
@@ -670,12 +670,17 @@ compressed_certs_cache, FLAGS_quic_reloadable_flag_enable_quic_stateless_reject_support, session, - helper) {} + helper), + handshake_confirmed_(false) {} + void set_handshake_confirmed_for_testing(bool handshake_confirmed) { handshake_confirmed_ = handshake_confirmed; } + bool handshake_confirmed() const override { return handshake_confirmed_; } + private: + bool handshake_confirmed_; DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoServerStream); };
diff --git a/net/tools/quic/quic_simple_server_session_test.cc b/net/tools/quic/quic_simple_server_session_test.cc index 85e80ad3..3349def 100644 --- a/net/tools/quic/quic_simple_server_session_test.cc +++ b/net/tools/quic/quic_simple_server_session_test.cc
@@ -103,10 +103,17 @@ void(const CachedNetworkParameters* cached_network_parameters)); void set_encryption_established(bool has_established) { - encryption_established_ = has_established; + encryption_established_override_ = has_established; + } + + bool encryption_established() const override { + return QuicCryptoServerStream::encryption_established() || + encryption_established_override_; } private: + bool encryption_established_override_ = false; + DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoServerStream); };
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc index 823f557..fa28333 100644 --- a/net/url_request/url_request_http_job.cc +++ b/net/url_request/url_request_http_job.cc
@@ -628,7 +628,7 @@ bool advertise_brotli = false; if (request()->context()->enable_brotli()) { if (request()->url().SchemeIsCryptographic() || - IsLocalhost(request()->url().HostNoBrackets())) { + IsLocalhost(request()->url().HostNoBracketsPiece())) { advertise_brotli = true; } }
diff --git a/remoting/DEPS b/remoting/DEPS index adc2778..a5c68f17 100644 --- a/remoting/DEPS +++ b/remoting/DEPS
@@ -9,7 +9,7 @@ "+third_party/google_toolbox_for_mac/src", "+third_party/libvpx", "+third_party/libyuv", - "+third_party/webrtc/base", + "+third_party/webrtc/rtc_base", "+third_party/webrtc/media", "+third_party/webrtc/p2p", "+third_party/webrtc/modules/desktop_capture",
diff --git a/remoting/android/BUILD.gn b/remoting/android/BUILD.gn index 248c1ea0..46798cb 100644 --- a/remoting/android/BUILD.gn +++ b/remoting/android/BUILD.gn
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//base/android/jni_generator/jni_exception_list.gni") import("//build/config/android/config.gni") import("//build/config/android/rules.gni") import("//remoting/android/client_java_tmpl.gni") @@ -20,6 +21,12 @@ jni_package = "remoting" } +generate_jni_registration("remoting_jni_registration") { + target = ":remoting_apk" + output = "$root_gen_dir/remoting/client/${target_name}.h" + exception_files = jni_exception_files +} + _raw_resources_base_dir = "$target_gen_dir/credits_resources_raw/res" # The target is named this way, instead of "..._raw_resources", specifically
diff --git a/remoting/base/typed_buffer.h b/remoting/base/typed_buffer.h index 26306fc4..7e64d8f 100644 --- a/remoting/base/typed_buffer.h +++ b/remoting/base/typed_buffer.h
@@ -64,10 +64,8 @@ return reinterpret_cast<T*>(reinterpret_cast<uint8_t*>(buffer_) + offset); } - // Allow TypedBuffer<T> to be used in boolean expressions, but not - // implicitly convertible to a real bool (which is dangerous). - typedef T* TypedBuffer::*Testable; - operator Testable() const { return buffer_ ? &TypedBuffer::buffer_ : NULL; } + // Allow TypedBuffer<T> to be used in boolean expressions. + explicit operator bool() const { return buffer_ != nullptr; } // Swap two buffers. void Swap(TypedBuffer& other) {
diff --git a/remoting/client/BUILD.gn b/remoting/client/BUILD.gn index e24508e..b6f0f78 100644 --- a/remoting/client/BUILD.gn +++ b/remoting/client/BUILD.gn
@@ -104,6 +104,6 @@ "//remoting/proto", "//testing/gmock", "//testing/gtest", - "//third_party/webrtc/base:rtc_base_approved", + "//third_party/webrtc/rtc_base:rtc_base_approved", ] }
diff --git a/remoting/client/display/BUILD.gn b/remoting/client/display/BUILD.gn index fd8fbf0..ca57762 100644 --- a/remoting/client/display/BUILD.gn +++ b/remoting/client/display/BUILD.gn
@@ -35,7 +35,7 @@ deps = [ "//third_party/libyuv", "//third_party/protobuf:protobuf_lite", - "//third_party/webrtc/base:rtc_base_approved", + "//third_party/webrtc/rtc_base:rtc_base_approved", ] public_configs = [ "//third_party/khronos:khronos_headers" ] @@ -90,7 +90,7 @@ "//remoting/proto", "//testing/gmock", "//testing/gtest", - "//third_party/webrtc/base:rtc_base_approved", + "//third_party/webrtc/rtc_base:rtc_base_approved", ] } }
diff --git a/remoting/client/input/BUILD.gn b/remoting/client/input/BUILD.gn index 5dc460e2..60d527a7 100644 --- a/remoting/client/input/BUILD.gn +++ b/remoting/client/input/BUILD.gn
@@ -29,7 +29,7 @@ ":normalizing_input_filter", "//remoting/base", "//remoting/client/ui:ui_manipulation", - "//third_party/webrtc/base:rtc_base_approved", + "//third_party/webrtc/rtc_base:rtc_base_approved", "//ui/events:dom_keycode_converter", ] @@ -54,7 +54,7 @@ deps = [ "//remoting/base", - "//third_party/webrtc/base:rtc_base_approved", + "//third_party/webrtc/rtc_base:rtc_base_approved", "//third_party/webrtc/modules/desktop_capture:primitives", "//ui/events:dom_keycode_converter", ] @@ -79,7 +79,7 @@ "//remoting/proto", "//testing/gmock", "//testing/gtest", - "//third_party/webrtc/base:rtc_base_approved", + "//third_party/webrtc/rtc_base:rtc_base_approved", ] } @@ -104,6 +104,6 @@ "//remoting/proto", "//testing/gmock", "//testing/gtest", - "//third_party/webrtc/base:rtc_base_approved", + "//third_party/webrtc/rtc_base:rtc_base_approved", ] }
diff --git a/remoting/client/jni/BUILD.gn b/remoting/client/jni/BUILD.gn index f0f8082..6f10926 100644 --- a/remoting/client/jni/BUILD.gn +++ b/remoting/client/jni/BUILD.gn
@@ -19,6 +19,7 @@ shared_library("remoting_client_jni") { deps = [ "//remoting/android:jni_headers", + "//remoting/android:remoting_jni_registration", "//remoting/base", "//remoting/client", "//remoting/client/display",
diff --git a/remoting/client/jni/remoting_jni_onload.cc b/remoting/client/jni/remoting_jni_onload.cc index 9db79a8..dd1a283d 100644 --- a/remoting/client/jni/remoting_jni_onload.cc +++ b/remoting/client/jni/remoting_jni_onload.cc
@@ -11,6 +11,7 @@ #include "base/macros.h" #include "net/android/net_jni_registrar.h" #include "remoting/client/jni/remoting_jni_registrar.h" +#include "remoting/client/remoting_jni_registration.h" #include "ui/gfx/android/gfx_jni_registrar.h" namespace { @@ -32,6 +33,12 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { base::android::InitVM(vm); JNIEnv* env = base::android::AttachCurrentThread(); + if (!RegisterMainDexNatives(env) || !RegisterNonMainDexNatives(env)) { + return -1; + } + + // TODO(agrieve): Delete this block, this is a no-op now. + // https://crbug.com/683256. if (!RegisterJNI(env) || !base::android::OnJNIOnLoadInit()) { return -1; }
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc index 95c0fe4..a0df02f 100644 --- a/remoting/client/plugin/chromoting_instance.cc +++ b/remoting/client/plugin/chromoting_instance.cc
@@ -56,8 +56,8 @@ #include "remoting/protocol/host_stub.h" #include "remoting/protocol/transport_context.h" #include "remoting/signaling/delegating_signal_strategy.h" -#include "third_party/webrtc/base/helpers.h" #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" +#include "third_party/webrtc/rtc_base/helpers.h" #include "url/gurl.h" namespace remoting {
diff --git a/remoting/client/plugin/pepper_address_resolver.h b/remoting/client/plugin/pepper_address_resolver.h index c130751..93d953ff 100644 --- a/remoting/client/plugin/pepper_address_resolver.h +++ b/remoting/client/plugin/pepper_address_resolver.h
@@ -10,7 +10,7 @@ #include "base/macros.h" #include "ppapi/cpp/host_resolver.h" #include "ppapi/utility/completion_callback_factory.h" -#include "third_party/webrtc/base/asyncresolverinterface.h" +#include "third_party/webrtc/rtc_base/asyncresolverinterface.h" namespace remoting {
diff --git a/remoting/client/plugin/pepper_network_manager.cc b/remoting/client/plugin/pepper_network_manager.cc index bb1dc7c..fb38f49 100644 --- a/remoting/client/plugin/pepper_network_manager.cc +++ b/remoting/client/plugin/pepper_network_manager.cc
@@ -14,7 +14,7 @@ #include "ppapi/cpp/net_address.h" #include "ppapi/cpp/network_list.h" #include "remoting/client/plugin/pepper_util.h" -#include "third_party/webrtc/base/socketaddress.h" +#include "third_party/webrtc/rtc_base/socketaddress.h" namespace remoting {
diff --git a/remoting/client/plugin/pepper_network_manager.h b/remoting/client/plugin/pepper_network_manager.h index 0907a530..43d27ef 100644 --- a/remoting/client/plugin/pepper_network_manager.h +++ b/remoting/client/plugin/pepper_network_manager.h
@@ -12,7 +12,7 @@ #include "ppapi/cpp/instance_handle.h" #include "ppapi/cpp/network_monitor.h" #include "ppapi/utility/completion_callback_factory.h" -#include "third_party/webrtc/base/network.h" +#include "third_party/webrtc/rtc_base/network.h" namespace pp { class NetworkList;
diff --git a/remoting/client/plugin/pepper_packet_socket_factory.cc b/remoting/client/plugin/pepper_packet_socket_factory.cc index d8b8dd7..8786880 100644 --- a/remoting/client/plugin/pepper_packet_socket_factory.cc +++ b/remoting/client/plugin/pepper_packet_socket_factory.cc
@@ -17,8 +17,8 @@ #include "remoting/client/plugin/pepper_address_resolver.h" #include "remoting/client/plugin/pepper_util.h" #include "remoting/protocol/socket_util.h" -#include "third_party/webrtc/base/asyncpacketsocket.h" -#include "third_party/webrtc/base/nethelpers.h" +#include "third_party/webrtc/rtc_base/asyncpacketsocket.h" +#include "third_party/webrtc/rtc_base/nethelpers.h" namespace remoting {
diff --git a/remoting/client/plugin/pepper_util.cc b/remoting/client/plugin/pepper_util.cc index 0315382..4eabe7b3 100644 --- a/remoting/client/plugin/pepper_util.cc +++ b/remoting/client/plugin/pepper_util.cc
@@ -10,7 +10,7 @@ #include "base/sys_byteorder.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/net_address.h" -#include "third_party/webrtc/base/socketaddress.h" +#include "third_party/webrtc/rtc_base/socketaddress.h" namespace remoting {
diff --git a/remoting/client/ui/BUILD.gn b/remoting/client/ui/BUILD.gn index 25b3106..8bd0494 100644 --- a/remoting/client/ui/BUILD.gn +++ b/remoting/client/ui/BUILD.gn
@@ -17,7 +17,7 @@ public_deps = [ "//remoting/proto", - "//third_party/webrtc/base:rtc_base_approved", + "//third_party/webrtc/rtc_base:rtc_base_approved", ] } @@ -33,7 +33,7 @@ public_deps = [ "//remoting/proto", - "//third_party/webrtc/base:rtc_base_approved", + "//third_party/webrtc/rtc_base:rtc_base_approved", ] }
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc index 4bfd9e2..3e2ce47 100644 --- a/remoting/host/chromoting_host.cc +++ b/remoting/host/chromoting_host.cc
@@ -263,7 +263,8 @@ clients_.push_back(base::MakeUnique<ClientSession>( this, std::move(connection), desktop_environment_factory_, desktop_environment_options_, max_session_duration_, pairing_registry_, - extension_ptrs)); + extension_ptrs, + std::vector<protocol::DataChannelManager::NameCallbackPair>())); } } // namespace remoting
diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc index 74498a63..5fc75e40 100644 --- a/remoting/host/chromoting_host_unittest.cc +++ b/remoting/host/chromoting_host_unittest.cc
@@ -132,7 +132,8 @@ std::unique_ptr<ClientSession> client(new ClientSession( host_.get(), std::move(connection), desktop_environment_factory_.get(), DesktopEnvironmentOptions::CreateDefault(), base::TimeDelta(), nullptr, - std::vector<HostExtension*>())); + std::vector<HostExtension*>(), + std::vector<protocol::DataChannelManager::NameCallbackPair>())); ClientSession* client_ptr = client.get(); connection_ptr->set_host_stub(client.get());
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc index 0dd9389..b9877821 100644 --- a/remoting/host/client_session.cc +++ b/remoting/host/client_session.cc
@@ -49,7 +49,9 @@ const DesktopEnvironmentOptions& desktop_environment_options, const base::TimeDelta& max_duration, scoped_refptr<protocol::PairingRegistry> pairing_registry, - const std::vector<HostExtension*>& extensions) + const std::vector<HostExtension*>& extensions, + const std::vector<protocol::DataChannelManager::NameCallbackPair>& + data_channel_callbacks) : event_handler_(event_handler), connection_(std::move(connection)), client_jid_(connection_->session()->jid()), @@ -74,6 +76,11 @@ // Create a manager for the configured extensions, if any. extension_manager_.reset(new HostExtensionSessionManager(extensions, this)); + for (const auto& callback : data_channel_callbacks) { + data_channel_manager_.RegisterCreateHandlerCallback(callback.first, + callback.second); + } + #if defined(OS_WIN) // LocalInputMonitorWin filters out an echo of the injected input before it // reaches |remote_input_filter_|. @@ -356,13 +363,18 @@ event_handler_->OnSessionClosed(this); } -void ClientSession::OnRouteChange( - const std::string& channel_name, - const protocol::TransportRoute& route) { +void ClientSession::OnRouteChange(const std::string& channel_name, + const protocol::TransportRoute& route) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); event_handler_->OnSessionRouteChange(this, channel_name, route); } +void ClientSession::OnIncomingDataChannel( + const std::string& channel_name, + std::unique_ptr<protocol::MessagePipe> pipe) { + data_channel_manager_.OnIncomingDataChannel(channel_name, std::move(pipe)); +} + const std::string& ClientSession::client_jid() const { return client_jid_; }
diff --git a/remoting/host/client_session.h b/remoting/host/client_session.h index 24440d8..d0c830b 100644 --- a/remoting/host/client_session.h +++ b/remoting/host/client_session.h
@@ -26,6 +26,7 @@ #include "remoting/protocol/clipboard_filter.h" #include "remoting/protocol/clipboard_stub.h" #include "remoting/protocol/connection_to_client.h" +#include "remoting/protocol/data_channel_manager.h" #include "remoting/protocol/host_stub.h" #include "remoting/protocol/input_event_tracker.h" #include "remoting/protocol/input_filter.h" @@ -89,13 +90,16 @@ // |event_handler| and |desktop_environment_factory| must outlive |this|. // All |HostExtension|s in |extensions| must outlive |this|. - ClientSession(EventHandler* event_handler, - std::unique_ptr<protocol::ConnectionToClient> connection, - DesktopEnvironmentFactory* desktop_environment_factory, - const DesktopEnvironmentOptions& desktop_environment_options, - const base::TimeDelta& max_duration, - scoped_refptr<protocol::PairingRegistry> pairing_registry, - const std::vector<HostExtension*>& extensions); + ClientSession( + EventHandler* event_handler, + std::unique_ptr<protocol::ConnectionToClient> connection, + DesktopEnvironmentFactory* desktop_environment_factory, + const DesktopEnvironmentOptions& desktop_environment_options, + const base::TimeDelta& max_duration, + scoped_refptr<protocol::PairingRegistry> pairing_registry, + const std::vector<HostExtension*>& extensions, + const std::vector<protocol::DataChannelManager::NameCallbackPair>& + data_channel_callbacks); ~ClientSession() override; // Returns the set of capabilities negotiated between client and host. @@ -119,6 +123,9 @@ void OnConnectionClosed(protocol::ErrorCode error) override; void OnRouteChange(const std::string& channel_name, const protocol::TransportRoute& route) override; + void OnIncomingDataChannel( + const std::string& channel_name, + std::unique_ptr<protocol::MessagePipe> pipe) override; // ClientSessionControl interface. const std::string& client_jid() const override; @@ -227,6 +234,9 @@ // Used to manage extension functionality. std::unique_ptr<HostExtensionSessionManager> extension_manager_; + // Used to dispatch new data channels to factory methods. + protocol::DataChannelManager data_channel_manager_; + // Set to true if the client was authenticated successfully. bool is_authenticated_ = false;
diff --git a/remoting/host/client_session_unittest.cc b/remoting/host/client_session_unittest.cc index d2e830f..7530800 100644 --- a/remoting/host/client_session_unittest.cc +++ b/remoting/host/client_session_unittest.cc
@@ -29,6 +29,7 @@ #include "remoting/host/host_mock_objects.h" #include "remoting/protocol/fake_connection_to_client.h" #include "remoting/protocol/fake_desktop_capturer.h" +#include "remoting/protocol/fake_message_pipe.h" #include "remoting/protocol/fake_session.h" #include "remoting/protocol/protocol_mock_objects.h" #include "remoting/protocol/test_event_matchers.h" @@ -56,6 +57,8 @@ namespace { +constexpr char kTestDataChannelCallbackName[] = "test_channel_name"; + // Matches a |protocol::Capabilities| argument against a list of capabilities // formatted as a space-separated string. MATCHER_P(EqCapabilities, expected_capabilities, "") { @@ -132,6 +135,9 @@ // ownership of the HostExtensions themselves. std::vector<HostExtension*> extensions_; + std::vector<protocol::DataChannelManager::NameCallbackPair> + data_channel_callbacks_; + // ClientSession instance under test. std::unique_ptr<ClientSession> client_session_; @@ -180,11 +186,11 @@ connection->set_client_stub(&client_stub_); connection_ = connection.get(); - client_session_.reset( - new ClientSession(&session_event_handler_, std::move(connection), - desktop_environment_factory_.get(), - DesktopEnvironmentOptions::CreateDefault(), - base::TimeDelta(), nullptr, extensions_)); + client_session_.reset(new ClientSession( + &session_event_handler_, std::move(connection), + desktop_environment_factory_.get(), + DesktopEnvironmentOptions::CreateDefault(), base::TimeDelta(), nullptr, + extensions_, data_channel_callbacks_)); } void ClientSessionTest::CreateClientSession() { @@ -429,6 +435,29 @@ EXPECT_FALSE(extension3.was_instantiated()); } +TEST_F(ClientSessionTest, DataChannelCallbackIsCalled) { + bool callback_called = false; + + data_channel_callbacks_.push_back( + protocol::DataChannelManager::NameCallbackPair( + kTestDataChannelCallbackName, + base::Bind([](bool* callback_was_called, const std::string& name, + std::unique_ptr<protocol::MessagePipe> pipe) + -> void { *callback_was_called = true; }, + &callback_called))); + + CreateClientSession(); + ConnectClientSession(); + + std::unique_ptr<protocol::MessagePipe> pipe = + base::WrapUnique(new protocol::FakeMessagePipe(false)); + + client_session_->OnIncomingDataChannel(kTestDataChannelCallbackName, + std::move(pipe)); + + ASSERT_TRUE(callback_called); +} + TEST_F(ClientSessionTest, ForwardHostSessionOptions1) { auto session = base::MakeUnique<protocol::FakeSession>(); auto configuration = base::MakeUnique<buzz::XmlElement>(
diff --git a/remoting/host/it2me/it2me_native_messaging_host_main.cc b/remoting/host/it2me/it2me_native_messaging_host_main.cc index 129d7e18..8bf9a28 100644 --- a/remoting/host/it2me/it2me_native_messaging_host_main.cc +++ b/remoting/host/it2me/it2me_native_messaging_host_main.cc
@@ -40,11 +40,30 @@ #include <commctrl.h> #include "remoting/host/switches.h" -#include "remoting/host/win/elevation_helpers.h" #endif // defined(OS_WIN) namespace remoting { +namespace { + +#if defined(OS_WIN) && defined(OFFICIAL_BUILD) +bool CurrentProcessHasUiAccess() { + HANDLE process_token; + OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &process_token); + + DWORD size; + DWORD uiaccess_value = 0; + if (!GetTokenInformation(process_token, TokenUIAccess, &uiaccess_value, + sizeof(uiaccess_value), &size)) { + PLOG(ERROR) << "GetTokenInformation() failed"; + } + CloseHandle(process_token); + return uiaccess_value != 0; +} +#endif // defined(OS_WIN) && defined(OFFICIAL_BUILD) + +} // namespace + // Creates a It2MeNativeMessagingHost instance, attaches it to stdin/stdout and // runs the message loop until It2MeNativeMessagingHost signals shutdown. int It2MeNativeMessagingHostMain(int argc, char** argv) {
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc index a4f12046..5c10a908 100644 --- a/remoting/host/remoting_me2me_host.cc +++ b/remoting/host/remoting_me2me_host.cc
@@ -101,7 +101,7 @@ #include "remoting/protocol/transport_context.h" #include "remoting/signaling/push_notification_subscriber.h" #include "remoting/signaling/xmpp_signal_strategy.h" -#include "third_party/webrtc/base/scoped_ref_ptr.h" +#include "third_party/webrtc/rtc_base/scoped_ref_ptr.h" #if defined(OS_POSIX) #include <signal.h>
diff --git a/remoting/host/setup/me2me_native_messaging_host_main.cc b/remoting/host/setup/me2me_native_messaging_host_main.cc index bfcb60c..c6f63ea6 100644 --- a/remoting/host/setup/me2me_native_messaging_host_main.cc +++ b/remoting/host/setup/me2me_native_messaging_host_main.cc
@@ -39,9 +39,9 @@ #endif // defined(OS_MACOSX) #if defined(OS_WIN) +#include "base/process/process_info.h" #include "base/win/registry.h" #include "remoting/host/pairing_registry_delegate_win.h" -#include "remoting/host/win/elevation_helpers.h" #endif // defined(OS_WIN) #if defined(USE_GLIB) && !defined(OS_CHROMEOS) @@ -123,7 +123,7 @@ bool needs_elevation = false; #if defined(OS_WIN) - needs_elevation = !IsProcessElevated(); + needs_elevation = !base::IsCurrentProcessElevated(); if (command_line->HasSwitch(kElevateSwitchName)) { DCHECK(!needs_elevation);
diff --git a/remoting/host/setup/start_host_main.cc b/remoting/host/setup/start_host_main.cc index df74f6d1..0fa66f8 100644 --- a/remoting/host/setup/start_host_main.cc +++ b/remoting/host/setup/start_host_main.cc
@@ -31,7 +31,7 @@ #endif // defined(OS_POSIX) #if defined(OS_WIN) -#include "remoting/host/win/elevation_helpers.h" +#include "base/process/process_info.h" #endif // defined(OS_WIN) namespace remoting { @@ -151,7 +151,7 @@ #if defined(OS_WIN) // The tool must be run elevated on Windows so the host has access to the // directories used to store the configuration JSON files. - if (!remoting::IsProcessElevated()) { + if (!base::IsCurrentProcessElevated()) { fprintf(stderr, "Error: %s must be run as an elevated process.", argv[0]); return 1; }
diff --git a/remoting/host/win/BUILD.gn b/remoting/host/win/BUILD.gn index e91354bc..bf3ed08 100644 --- a/remoting/host/win/BUILD.gn +++ b/remoting/host/win/BUILD.gn
@@ -85,8 +85,6 @@ "com_security.h", "default_audio_device_change_detector.cc", "default_audio_device_change_detector.h", - "elevation_helpers.cc", - "elevation_helpers.h", "launch_process_with_token.cc", "launch_process_with_token.h", "omaha.cc",
diff --git a/remoting/host/win/elevation_helpers.cc b/remoting/host/win/elevation_helpers.cc deleted file mode 100644 index dee9016..0000000 --- a/remoting/host/win/elevation_helpers.cc +++ /dev/null
@@ -1,57 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "remoting/host/win/elevation_helpers.h" - -#include <windows.h> - -#include "base/logging.h" -#include "base/win/scoped_handle.h" - -namespace { - -void GetCurrentProcessToken(base::win::ScopedHandle* scoped_handle) { - DCHECK(scoped_handle); - - HANDLE process_token; - OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &process_token); - scoped_handle->Set(process_token); - DCHECK(scoped_handle->IsValid()); -} - -} // namespace - -namespace remoting { - -bool IsProcessElevated() { - base::win::ScopedHandle scoped_process_token; - GetCurrentProcessToken(&scoped_process_token); - - // Unlike TOKEN_ELEVATION_TYPE which returns TokenElevationTypeDefault when - // UAC is turned off, TOKEN_ELEVATION returns whether the process is elevated. - DWORD size; - TOKEN_ELEVATION elevation; - if (!GetTokenInformation(scoped_process_token.Get(), TokenElevation, - &elevation, sizeof(elevation), &size)) { - PLOG(ERROR) << "GetTokenInformation() failed"; - return false; - } - return elevation.TokenIsElevated != 0; -} - -bool CurrentProcessHasUiAccess() { - base::win::ScopedHandle scoped_process_token; - GetCurrentProcessToken(&scoped_process_token); - - DWORD size; - DWORD uiaccess_value = 0; - if (!GetTokenInformation(scoped_process_token.Get(), TokenUIAccess, - &uiaccess_value, sizeof(uiaccess_value), &size)) { - PLOG(ERROR) << "GetTokenInformation() failed"; - return false; - } - return uiaccess_value != 0; -} - -} // namespace remoting \ No newline at end of file
diff --git a/remoting/host/win/elevation_helpers.h b/remoting/host/win/elevation_helpers.h deleted file mode 100644 index eb4fab6..0000000 --- a/remoting/host/win/elevation_helpers.h +++ /dev/null
@@ -1,18 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef REMOTING_HOST_WIN_ELEVATION_HELPERS_H -#define REMOTING_HOST_WIN_ELEVATION_HELPERS_H - -namespace remoting { - -// Determines whether the current process is elevated. -bool IsProcessElevated(); - -// Determines whether the current process has the UiAccess privilege. -bool CurrentProcessHasUiAccess(); - -} // namespace remoting - -#endif // REMOTING_HOST_WIN_ELEVATION_HELPERS_H \ No newline at end of file
diff --git a/remoting/ios/BUILD.gn b/remoting/ios/BUILD.gn index 50204d4..67589d8 100644 --- a/remoting/ios/BUILD.gn +++ b/remoting/ios/BUILD.gn
@@ -47,7 +47,7 @@ "//remoting/ios/domain", "//remoting/ios/facade", "//remoting/ios/session", - "//third_party/webrtc/base:rtc_base", + "//third_party/webrtc/rtc_base:rtc_base", "//third_party/webrtc/modules/desktop_capture:primitives", ]
diff --git a/remoting/ios/app/BUILD.gn b/remoting/ios/app/BUILD.gn index f1a05251b6..6b3e6cd 100644 --- a/remoting/ios/app/BUILD.gn +++ b/remoting/ios/app/BUILD.gn
@@ -53,7 +53,9 @@ "//remoting/client", "//remoting/client/input", "//remoting/ios:ios_core", + "//remoting/ios/app/resources:assets", "//remoting/ios/app/settings", + "//remoting/ios/display", "//remoting/ios/mdc", "//remoting/protocol", "//ui/base", @@ -77,13 +79,19 @@ ] deps = [ ":common_source_set", - "//remoting/ios/app/resources:system_icons", + "//base", ] configs += [ "//build/config/compiler:enable_arc" ] } ios_remoting_app_tmpl("ios_remoting_app") { output_name = "chromoting" + info_plist_path = "resources/Info.plist" entitlements_path = "resources/Remoting.entitlements" - remoting_source_set = ":main" + deps = [ + ":main", + "//remoting/ios/app/resources:launchscreen_assets", + "//remoting/ios/app/resources:remoting_icons", + "//remoting/ios/app/resources:system_icons", + ] }
diff --git a/remoting/ios/app/host_setup_footer_view.mm b/remoting/ios/app/host_setup_footer_view.mm index f271133..fcfc022 100644 --- a/remoting/ios/app/host_setup_footer_view.mm +++ b/remoting/ios/app/host_setup_footer_view.mm
@@ -31,8 +31,9 @@ [raisedButton setTitle:@"Email link and instructions" forState:UIControlStateNormal]; - [raisedButton setTitleColor:RemotingTheme.buttonTextColor - forState:UIControlStateNormal]; + raisedButton.customTitleColor = RemotingTheme.buttonTextColor; + [raisedButton setBackgroundColor:RemotingTheme.buttonBackgroundColor + forState:UIControlStateNormal]; [raisedButton sizeToFit]; [raisedButton addTarget:self action:@selector(didTapEmailInstructions:)
diff --git a/remoting/ios/app/remoting_ios_tmpl.gni b/remoting/ios/app/remoting_ios_tmpl.gni index 9f3e0942..88113df 100644 --- a/remoting/ios/app/remoting_ios_tmpl.gni +++ b/remoting/ios/app/remoting_ios_tmpl.gni
@@ -15,11 +15,14 @@ # output_name: # string, the filename of the generated .app folder # -# entitlements_path: -# string, ath of the .entitlements file +# info_plist_path: +# string, path of the Info.plist template # -# remoting_source_set: -# The source set to be compiled +# entitlements_path: +# string, path of the .entitlements file +# +# deps: +# string array, deps to be compiled. E.g. source sets, launch screen, icons. # # bundle_id: # (optional) string, the bundle_id. If this is not set, it will come from @@ -27,7 +30,7 @@ template("ios_remoting_app_tmpl") { info_plist_target_name = "${target_name}_tweak_info_plist" tweak_info_plist(info_plist_target_name) { - info_plist = "//remoting/ios/app/resources/Info.plist" + info_plist = invoker.info_plist_path args = [ "--platform=ios" ] } @@ -74,15 +77,7 @@ "SystemConfiguration.framework", ] - deps = [ - "//base", - "//remoting/ios/app/resources:assets", - "//remoting/ios/app/resources:launchscreen_assets", - "//remoting/ios/app/resources:remoting_icons", - "//remoting/ios/display", - ] - - deps += [ invoker.remoting_source_set ] + deps = invoker.deps bundle_deps = [ ":$launchscreen_storyboard_target_name" ] }
diff --git a/remoting/ios/app/remoting_theme.h b/remoting/ios/app/remoting_theme.h index a929e82..4f19702 100644 --- a/remoting/ios/app/remoting_theme.h +++ b/remoting/ios/app/remoting_theme.h
@@ -18,6 +18,7 @@ @property(class, nonatomic, readonly) UIColor* menuBlueColor; @property(class, nonatomic, readonly) UIColor* offlineHostColor; @property(class, nonatomic, readonly) UIColor* onlineHostColor; +@property(class, nonatomic, readonly) UIColor* buttonBackgroundColor; @property(class, nonatomic, readonly) UIColor* buttonTextColor; @property(class, nonatomic, readonly) UIColor* setupListBackgroundColor; @property(class, nonatomic, readonly) UIColor* setupListTextColor;
diff --git a/remoting/ios/app/remoting_theme.mm b/remoting/ios/app/remoting_theme.mm index a0306646..0430e5e 100644 --- a/remoting/ios/app/remoting_theme.mm +++ b/remoting/ios/app/remoting_theme.mm
@@ -69,6 +69,15 @@ return color; } ++ (UIColor*)buttonBackgroundColor { + static UIColor* color; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + color = [UIColor colorWithRed:0.11f green:0.55f blue:0.95f alpha:1.f]; + }); + return color; +} + + (UIColor*)buttonTextColor { return UIColor.whiteColor; }
diff --git a/remoting/ios/app/resources/LaunchScreen.storyboard b/remoting/ios/app/resources/LaunchScreen.storyboard index 6ecb008c..7d5751c 100644 --- a/remoting/ios/app/resources/LaunchScreen.storyboard +++ b/remoting/ios/app/resources/LaunchScreen.storyboard
@@ -1,8 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11542" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> + <device id="retina5_5" orientation="portrait"> + <adaptation id="fullscreen"/> + </device> <dependencies> - <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/> + <capability name="Aspect ratio constraints" minToolsVersion="5.1"/> + <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <scenes> <!--View Controller--> @@ -14,19 +19,50 @@ <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/> </layoutGuides> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> - <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> + <rect key="frame" x="0.0" y="0.0" width="414" height="736"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="CDr-2c-Hcj" image="launchscreen_app_logo"> - <rect key="frame" x="127" y="274" width="120" height="120"/> - <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="launchscreen_brand_name" translatesAutoresizingMaskIntoConstraints="NO" id="gJ9-5V-g0g"> + <rect key="frame" x="153" y="676" width="107" height="35"/> + <constraints> + <constraint firstAttribute="width" constant="107" id="8W7-lV-Vso"/> + <constraint firstAttribute="height" constant="35" id="98E-ct-IJt"/> + </constraints> </imageView> - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="gJ9-5V-g0g" image="launchscreen_brand_name"> - <rect key="frame" x="127" y="575" width="120" height="60"/> - <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES"/> + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="launchscreen_app_logo" translatesAutoresizingMaskIntoConstraints="NO" id="CDr-2c-Hcj"> + <rect key="frame" x="128" y="279" width="158" height="158"/> + <constraints> + <constraint firstAttribute="width" secondItem="CDr-2c-Hcj" secondAttribute="height" multiplier="1:1" id="G0j-Yg-R7O"/> + <constraint firstAttribute="width" relation="lessThanOrEqual" constant="192" id="kkf-Jl-iWe"/> + <constraint firstAttribute="height" relation="lessThanOrEqual" constant="192" id="t72-9w-8fc"/> + </constraints> </imageView> </subviews> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <constraints> + <constraint firstItem="CDr-2c-Hcj" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" constant="-10" id="9gL-gt-0xy"/> + <constraint firstItem="CDr-2c-Hcj" firstAttribute="height" secondItem="Ze5-6b-2t3" secondAttribute="height" multiplier="0.381966" id="V2r-At-rWh"/> + <constraint firstItem="xb3-aO-Qok" firstAttribute="top" secondItem="gJ9-5V-g0g" secondAttribute="bottom" constant="25" id="WZn-Rc-HMJ"/> + <constraint firstItem="CDr-2c-Hcj" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="bJa-vf-3u1"/> + <constraint firstItem="CDr-2c-Hcj" firstAttribute="width" secondItem="Ze5-6b-2t3" secondAttribute="width" multiplier="0.381966" id="jwl-Dv-wUx"/> + <constraint firstItem="gJ9-5V-g0g" firstAttribute="centerX" secondItem="CDr-2c-Hcj" secondAttribute="centerX" id="yI0-0x-PBa"/> + </constraints> + <variation key="default"> + <mask key="constraints"> + <exclude reference="V2r-At-rWh"/> + <exclude reference="jwl-Dv-wUx"/> + </mask> + </variation> + <variation key="heightClass=compact"> + <mask key="constraints"> + <include reference="V2r-At-rWh"/> + </mask> + </variation> + <variation key="heightClass=regular-widthClass=compact"> + <mask key="constraints"> + <include reference="jwl-Dv-wUx"/> + </mask> + </variation> </view> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> @@ -34,4 +70,8 @@ <point key="canvasLocation" x="52" y="374.66266866566718"/> </scene> </scenes> + <resources> + <image name="launchscreen_app_logo" width="192" height="192"/> + <image name="launchscreen_brand_name" width="107" height="35"/> + </resources> </document>
diff --git a/remoting/ios/display/BUILD.gn b/remoting/ios/display/BUILD.gn index 5b24ebb7..5379574 100644 --- a/remoting/ios/display/BUILD.gn +++ b/remoting/ios/display/BUILD.gn
@@ -29,7 +29,7 @@ public_deps = [ "//remoting/client", "//third_party/protobuf:protobuf_lite", - "//third_party/webrtc/base:rtc_base_approved", + "//third_party/webrtc/rtc_base:rtc_base_approved", ] deps = [
diff --git a/remoting/protocol/channel_socket_adapter.h b/remoting/protocol/channel_socket_adapter.h index 7e664c4..30e3c5db 100644 --- a/remoting/protocol/channel_socket_adapter.h +++ b/remoting/protocol/channel_socket_adapter.h
@@ -12,9 +12,6 @@ #include "base/macros.h" #include "base/threading/thread_checker.h" #include "remoting/protocol/p2p_datagram_socket.h" -#include "third_party/webrtc/base/asyncpacketsocket.h" -#include "third_party/webrtc/base/sigslot.h" -#include "third_party/webrtc/base/socketaddress.h" // TODO(zhihuang):Replace #include by forward declaration once proper // inheritance is defined for cricket::IceTransportInternal and // cricket::P2PTransportChannel. @@ -23,6 +20,9 @@ // inheritance is defined for rtc::PacketTransportInterface and // cricket::TransportChannel. #include "third_party/webrtc/p2p/base/packettransportinterface.h" +#include "third_party/webrtc/rtc_base/asyncpacketsocket.h" +#include "third_party/webrtc/rtc_base/sigslot.h" +#include "third_party/webrtc/rtc_base/socketaddress.h" namespace remoting { namespace protocol {
diff --git a/remoting/protocol/chromium_socket_factory.cc b/remoting/protocol/chromium_socket_factory.cc index 2741ac3..934c1cd 100644 --- a/remoting/protocol/chromium_socket_factory.cc +++ b/remoting/protocol/chromium_socket_factory.cc
@@ -21,10 +21,10 @@ #include "net/log/net_log_source.h" #include "net/socket/udp_server_socket.h" #include "remoting/protocol/socket_util.h" -#include "third_party/webrtc/base/asyncpacketsocket.h" -#include "third_party/webrtc/base/nethelpers.h" -#include "third_party/webrtc/base/socket.h" #include "third_party/webrtc/media/base/rtputils.h" +#include "third_party/webrtc/rtc_base/asyncpacketsocket.h" +#include "third_party/webrtc/rtc_base/nethelpers.h" +#include "third_party/webrtc/rtc_base/socket.h" namespace remoting { namespace protocol {
diff --git a/remoting/protocol/chromium_socket_factory_unittest.cc b/remoting/protocol/chromium_socket_factory_unittest.cc index f81d4984..328c18c 100644 --- a/remoting/protocol/chromium_socket_factory_unittest.cc +++ b/remoting/protocol/chromium_socket_factory_unittest.cc
@@ -14,8 +14,8 @@ #include "base/single_thread_task_runner.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/webrtc/base/asyncpacketsocket.h" -#include "third_party/webrtc/base/socketaddress.h" +#include "third_party/webrtc/rtc_base/asyncpacketsocket.h" +#include "third_party/webrtc/rtc_base/socketaddress.h" namespace remoting { namespace protocol {
diff --git a/remoting/protocol/connection_to_client.h b/remoting/protocol/connection_to_client.h index 2694117..ce7934f9 100644 --- a/remoting/protocol/connection_to_client.h +++ b/remoting/protocol/connection_to_client.h
@@ -9,6 +9,7 @@ #include <string> +#include "remoting/protocol/message_pipe.h" #include "remoting/protocol/transport.h" namespace webrtc { @@ -19,8 +20,8 @@ namespace protocol { -class AudioStream; class AudioSource; +class AudioStream; class ClientStub; class ClipboardStub; class HostStub; @@ -56,6 +57,10 @@ virtual void OnRouteChange(const std::string& channel_name, const TransportRoute& route) = 0; + // Called when a new Data Channel has been created by the client. + virtual void OnIncomingDataChannel(const std::string& channel_name, + std::unique_ptr<MessagePipe> pipe) = 0; + protected: virtual ~EventHandler() {} };
diff --git a/remoting/protocol/data_channel_manager.h b/remoting/protocol/data_channel_manager.h index 32b0198..dfe3a08 100644 --- a/remoting/protocol/data_channel_manager.h +++ b/remoting/protocol/data_channel_manager.h
@@ -24,6 +24,8 @@ const std::string& name, std::unique_ptr<MessagePipe> pipe)>; + using NameCallbackPair = std::pair<std::string, CreateHandlerCallback>; + DataChannelManager(); ~DataChannelManager(); @@ -38,7 +40,7 @@ std::unique_ptr<MessagePipe> pipe); private: - std::vector<std::pair<std::string, CreateHandlerCallback>> constructors_; + std::vector<NameCallbackPair> constructors_; }; } // namespace protocol
diff --git a/remoting/protocol/ice_config.h b/remoting/protocol/ice_config.h index b039ba3f..5831a5a9 100644 --- a/remoting/protocol/ice_config.h +++ b/remoting/protocol/ice_config.h
@@ -9,8 +9,8 @@ #include <vector> #include "base/time/time.h" -#include "third_party/webrtc/base/socketaddress.h" #include "third_party/webrtc/p2p/base/portallocator.h" +#include "third_party/webrtc/rtc_base/socketaddress.h" namespace base { class DictionaryValue;
diff --git a/remoting/protocol/ice_transport_channel.cc b/remoting/protocol/ice_transport_channel.cc index 7eaf858..5270818 100644 --- a/remoting/protocol/ice_transport_channel.cc +++ b/remoting/protocol/ice_transport_channel.cc
@@ -16,11 +16,11 @@ #include "remoting/protocol/channel_socket_adapter.h" #include "remoting/protocol/port_allocator_factory.h" #include "remoting/protocol/transport_context.h" -#include "third_party/webrtc/base/network.h" #include "third_party/webrtc/p2p/base/p2pconstants.h" #include "third_party/webrtc/p2p/base/p2ptransportchannel.h" #include "third_party/webrtc/p2p/base/packettransportinterface.h" #include "third_party/webrtc/p2p/base/port.h" +#include "third_party/webrtc/rtc_base/network.h" namespace remoting { namespace protocol {
diff --git a/remoting/protocol/ice_transport_channel.h b/remoting/protocol/ice_transport_channel.h index 2fbb33c..d41cc79 100644 --- a/remoting/protocol/ice_transport_channel.h +++ b/remoting/protocol/ice_transport_channel.h
@@ -13,8 +13,6 @@ #include "base/timer/timer.h" #include "remoting/protocol/network_settings.h" #include "remoting/protocol/transport.h" -#include "third_party/webrtc/base/sigslot.h" - // TODO(zhihuang):Replace #include by forward declaration once proper // inheritance is defined for cricket::IceTransportInternal and // cricket::P2PTransportChannel. @@ -22,6 +20,7 @@ // TODO(johan): Replace #include by forward declaration once proper inheritance // is defined for rtc::PacketTransportInterface and cricket::TransportChannel. #include "third_party/webrtc/p2p/base/packettransportinterface.h" +#include "third_party/webrtc/rtc_base/sigslot.h" namespace cricket { class Candidate;
diff --git a/remoting/protocol/jingle_info_request.cc b/remoting/protocol/jingle_info_request.cc index b61b8c17..b6764bd9 100644 --- a/remoting/protocol/jingle_info_request.cc +++ b/remoting/protocol/jingle_info_request.cc
@@ -15,7 +15,7 @@ #include "remoting/signaling/iq_sender.h" #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" #include "third_party/libjingle_xmpp/xmpp/constants.h" -#include "third_party/webrtc/base/socketaddress.h" +#include "third_party/webrtc/rtc_base/socketaddress.h" namespace remoting { namespace protocol {
diff --git a/remoting/protocol/jingle_session_manager.cc b/remoting/protocol/jingle_session_manager.cc index b4eebeb..4aabd443 100644 --- a/remoting/protocol/jingle_session_manager.cc +++ b/remoting/protocol/jingle_session_manager.cc
@@ -16,7 +16,7 @@ #include "remoting/signaling/signal_strategy.h" #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" #include "third_party/libjingle_xmpp/xmpp/constants.h" -#include "third_party/webrtc/base/socketaddress.h" +#include "third_party/webrtc/rtc_base/socketaddress.h" using buzz::QName;
diff --git a/remoting/protocol/message_decoder.cc b/remoting/protocol/message_decoder.cc index 3da1b1b..3e7882e 100644 --- a/remoting/protocol/message_decoder.cc +++ b/remoting/protocol/message_decoder.cc
@@ -10,7 +10,7 @@ #include "net/base/io_buffer.h" #include "remoting/base/compound_buffer.h" #include "remoting/proto/internal.pb.h" -#include "third_party/webrtc/base/byteorder.h" +#include "third_party/webrtc/rtc_base/byteorder.h" namespace remoting { namespace protocol {
diff --git a/remoting/protocol/message_reader_unittest.cc b/remoting/protocol/message_reader_unittest.cc index f67466a..cde2e3d 100644 --- a/remoting/protocol/message_reader_unittest.cc +++ b/remoting/protocol/message_reader_unittest.cc
@@ -16,7 +16,7 @@ #include "remoting/protocol/message_reader.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/webrtc/base/byteorder.h" +#include "third_party/webrtc/rtc_base/byteorder.h" using testing::_; using testing::DoAll;
diff --git a/remoting/protocol/message_serialization.cc b/remoting/protocol/message_serialization.cc index 9dab710..bde2f05 100644 --- a/remoting/protocol/message_serialization.cc +++ b/remoting/protocol/message_serialization.cc
@@ -9,7 +9,7 @@ #include "base/containers/hash_tables.h" #include "base/logging.h" #include "net/base/io_buffer.h" -#include "third_party/webrtc/base/byteorder.h" +#include "third_party/webrtc/rtc_base/byteorder.h" namespace remoting { namespace protocol {
diff --git a/remoting/protocol/protocol_mock_objects.h b/remoting/protocol/protocol_mock_objects.h index 391eb4d..936d94f 100644 --- a/remoting/protocol/protocol_mock_objects.h +++ b/remoting/protocol/protocol_mock_objects.h
@@ -85,6 +85,13 @@ void(const std::string& channel_name, const TransportRoute& route)); + MOCK_METHOD2(OnIncomingDataChannelPtr, + void(const std::string& channel_name, MessagePipe* pipe)); + void OnIncomingDataChannel(const std::string& channel_name, + std::unique_ptr<MessagePipe> pipe) override { + OnIncomingDataChannelPtr(channel_name, pipe.get()); + } + private: DISALLOW_COPY_AND_ASSIGN(MockConnectionToClientEventHandler); };
diff --git a/remoting/protocol/transport_context.cc b/remoting/protocol/transport_context.cc index 43c5014..974c34d 100644 --- a/remoting/protocol/transport_context.cc +++ b/remoting/protocol/transport_context.cc
@@ -15,7 +15,7 @@ #include "remoting/protocol/http_ice_config_request.h" #include "remoting/protocol/jingle_info_request.h" #include "remoting/protocol/port_allocator_factory.h" -#include "third_party/webrtc/base/socketaddress.h" +#include "third_party/webrtc/rtc_base/socketaddress.h" #if !defined(OS_NACL) #include "jingle/glue/thread_wrapper.h"
diff --git a/remoting/protocol/webrtc_audio_source_adapter_unittest.cc b/remoting/protocol/webrtc_audio_source_adapter_unittest.cc index 8b4407c..191af0c1 100644 --- a/remoting/protocol/webrtc_audio_source_adapter_unittest.cc +++ b/remoting/protocol/webrtc_audio_source_adapter_unittest.cc
@@ -15,7 +15,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/webrtc/api/mediastreaminterface.h" -#include "third_party/webrtc/base/refcount.h" +#include "third_party/webrtc/rtc_base/refcount.h" namespace remoting { namespace protocol {
diff --git a/remoting/protocol/webrtc_audio_stream.cc b/remoting/protocol/webrtc_audio_stream.cc index 5ede04e..0402719 100644 --- a/remoting/protocol/webrtc_audio_stream.cc +++ b/remoting/protocol/webrtc_audio_stream.cc
@@ -13,7 +13,7 @@ #include "remoting/protocol/webrtc_transport.h" #include "third_party/webrtc/api/mediastreaminterface.h" #include "third_party/webrtc/api/peerconnectioninterface.h" -#include "third_party/webrtc/base/refcount.h" +#include "third_party/webrtc/rtc_base/refcount.h" namespace remoting { namespace protocol {
diff --git a/remoting/protocol/webrtc_connection_to_client.cc b/remoting/protocol/webrtc_connection_to_client.cc index a6fdc5b..fc1c335 100644 --- a/remoting/protocol/webrtc_connection_to_client.cc +++ b/remoting/protocol/webrtc_connection_to_client.cc
@@ -183,10 +183,15 @@ const std::string& name, std::unique_ptr<MessagePipe> pipe) { DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK(event_handler_); + if (name == event_dispatcher_->channel_name() && !event_dispatcher_->is_connected()) { event_dispatcher_->Init(std::move(pipe), this); + return; } + + event_handler_->OnIncomingDataChannel(name, std::move(pipe)); } void WebrtcConnectionToClient::OnWebrtcTransportMediaStreamAdded(
diff --git a/remoting/protocol/webrtc_data_stream_adapter.h b/remoting/protocol/webrtc_data_stream_adapter.h index 51a7825..e47e0a8 100644 --- a/remoting/protocol/webrtc_data_stream_adapter.h +++ b/remoting/protocol/webrtc_data_stream_adapter.h
@@ -12,7 +12,7 @@ #include "base/macros.h" #include "remoting/protocol/message_pipe.h" #include "third_party/webrtc/api/peerconnectioninterface.h" -#include "third_party/webrtc/base/refcount.h" +#include "third_party/webrtc/rtc_base/refcount.h" namespace remoting { namespace protocol {
diff --git a/remoting/protocol/webrtc_video_renderer_adapter.cc b/remoting/protocol/webrtc_video_renderer_adapter.cc index 202ed9b..56e7701 100644 --- a/remoting/protocol/webrtc_video_renderer_adapter.cc +++ b/remoting/protocol/webrtc_video_renderer_adapter.cc
@@ -40,11 +40,13 @@ auto yuv_to_rgb_function = (pixel_format == FrameConsumer::FORMAT_BGRA) ? &libyuv::I420ToARGB : &libyuv::I420ToABGR; - yuv_to_rgb_function(yuv_frame->DataY(), yuv_frame->StrideY(), - yuv_frame->DataU(), yuv_frame->StrideU(), - yuv_frame->DataV(), yuv_frame->StrideV(), + rtc::scoped_refptr<const webrtc::I420BufferInterface> i420_frame = + yuv_frame->ToI420(); + yuv_to_rgb_function(i420_frame->DataY(), i420_frame->StrideY(), + i420_frame->DataU(), i420_frame->StrideU(), + i420_frame->DataV(), i420_frame->StrideV(), rgb_frame->data(), rgb_frame->stride(), - yuv_frame->width(), yuv_frame->height()); + i420_frame->width(), i420_frame->height()); rgb_frame->mutable_updated_region()->AddRect( webrtc::DesktopRect::MakeSize(rgb_frame->size()));
diff --git a/remoting/signaling/DEPS b/remoting/signaling/DEPS index 735bee7..a0e9629 100644 --- a/remoting/signaling/DEPS +++ b/remoting/signaling/DEPS
@@ -1,7 +1,7 @@ include_rules = [ "+net", "+jingle", - "+third_party/webrtc/base", + "+third_party/webrtc/rtc_base", "+third_party/libjingle_xmpp/xmllite", "+third_party/libjingle_xmpp/xmpp", ]
diff --git a/remoting/test/fake_network_manager.cc b/remoting/test/fake_network_manager.cc index 7328cf4..8b11a42 100644 --- a/remoting/test/fake_network_manager.cc +++ b/remoting/test/fake_network_manager.cc
@@ -10,7 +10,7 @@ #include "base/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" #include "jingle/glue/utils.h" -#include "third_party/webrtc/base/socketaddress.h" +#include "third_party/webrtc/rtc_base/socketaddress.h" namespace remoting {
diff --git a/remoting/test/fake_network_manager.h b/remoting/test/fake_network_manager.h index cce6f9f..23b0b649 100644 --- a/remoting/test/fake_network_manager.h +++ b/remoting/test/fake_network_manager.h
@@ -8,7 +8,7 @@ #include <memory> #include "base/memory/weak_ptr.h" -#include "third_party/webrtc/base/network.h" +#include "third_party/webrtc/rtc_base/network.h" namespace remoting {
diff --git a/remoting/test/fake_socket_factory.cc b/remoting/test/fake_socket_factory.cc index f639d8e..f08881d 100644 --- a/remoting/test/fake_socket_factory.cc +++ b/remoting/test/fake_socket_factory.cc
@@ -22,9 +22,9 @@ #include "base/time/time.h" #include "net/base/io_buffer.h" #include "remoting/base/leaky_bucket.h" -#include "third_party/webrtc/base/asyncpacketsocket.h" -#include "third_party/webrtc/base/socket.h" #include "third_party/webrtc/media/base/rtputils.h" +#include "third_party/webrtc/rtc_base/asyncpacketsocket.h" +#include "third_party/webrtc/rtc_base/socket.h" namespace remoting {
diff --git a/remoting/test/it2me_standalone_host.cc b/remoting/test/it2me_standalone_host.cc index eed5c913..82de866 100644 --- a/remoting/test/it2me_standalone_host.cc +++ b/remoting/test/it2me_standalone_host.cc
@@ -90,8 +90,8 @@ session_.reset(new ClientSession( &handler_, std::unique_ptr<protocol::ConnectionToClient>(&connection_), &factory_, options, base::TimeDelta(), - scoped_refptr<protocol::PairingRegistry>(), - std::vector<HostExtension*>())); + scoped_refptr<protocol::PairingRegistry>(), std::vector<HostExtension*>(), + std::vector<protocol::DataChannelManager::NameCallbackPair>())); session_->OnConnectionAuthenticated(); session_->OnConnectionChannelsConnected(); session_->CreateMediaStreams();
diff --git a/services/identity/identity_manager.cc b/services/identity/identity_manager.cc index 7321998b..7d03d82 100644 --- a/services/identity/identity_manager.cc +++ b/services/identity/identity_manager.cc
@@ -10,7 +10,6 @@ #include "components/signin/core/browser/account_tracker_service.h" #include "components/signin/core/browser/signin_manager_base.h" #include "google_apis/gaia/google_service_auth_error.h" -#include "mojo/public/cpp/bindings/strong_binding.h" namespace identity { @@ -61,17 +60,24 @@ AccountTrackerService* account_tracker, SigninManagerBase* signin_manager, ProfileOAuth2TokenService* token_service) { - mojo::MakeStrongBinding(base::MakeUnique<IdentityManager>( - account_tracker, signin_manager, token_service), - std::move(request)); + new IdentityManager(std::move(request), account_tracker, signin_manager, + token_service); } -IdentityManager::IdentityManager(AccountTrackerService* account_tracker, +IdentityManager::IdentityManager(mojom::IdentityManagerRequest request, + AccountTrackerService* account_tracker, SigninManagerBase* signin_manager, ProfileOAuth2TokenService* token_service) - : account_tracker_(account_tracker), + : binding_(this, std::move(request)), + account_tracker_(account_tracker), signin_manager_(signin_manager), - token_service_(token_service) {} + token_service_(token_service) { + signin_manager_shutdown_subscription_ = + signin_manager_->RegisterOnShutdownCallback(base::Bind( + &IdentityManager::OnSigninManagerShutdown, base::Unretained(this))); + binding_.set_connection_error_handler( + base::Bind(&IdentityManager::OnConnectionError, base::Unretained(this))); +} IdentityManager::~IdentityManager() {} @@ -120,4 +126,12 @@ return account_state; } +void IdentityManager::OnSigninManagerShutdown() { + delete this; +} + +void IdentityManager::OnConnectionError() { + delete this; +} + } // namespace identity
diff --git a/services/identity/identity_manager.h b/services/identity/identity_manager.h index 9e371d4..dd3d381e 100644 --- a/services/identity/identity_manager.h +++ b/services/identity/identity_manager.h
@@ -5,8 +5,10 @@ #ifndef SERVICES_IDENTITY_IDENTITY_MANAGER_H_ #define SERVICES_IDENTITY_IDENTITY_MANAGER_H_ +#include "base/callback_list.h" #include "components/signin/core/browser/account_info.h" #include "components/signin/core/browser/profile_oauth2_token_service.h" +#include "mojo/public/cpp/bindings/binding.h" #include "services/identity/public/cpp/account_state.h" #include "services/identity/public/cpp/scope_set.h" #include "services/identity/public/interfaces/identity_manager.mojom.h" @@ -23,7 +25,8 @@ SigninManagerBase* signin_manager, ProfileOAuth2TokenService* token_service); - IdentityManager(AccountTrackerService* account_tracker, + IdentityManager(mojom::IdentityManagerRequest request, + AccountTrackerService* account_tracker, SigninManagerBase* signin_manager, ProfileOAuth2TokenService* token_service); ~IdentityManager() override; @@ -79,10 +82,24 @@ // Gets the current state of the account represented by |account_info|. AccountState GetStateOfAccount(const AccountInfo& account_info); + // Called when |signin_manager_| is shutting down. Destroys this instance, + // since this instance can't outlive the signin classes that it is depending + // on. Note that once IdentityManager manages the lifetime of its dependencies + // internally, this will no longer be necessary. + void OnSigninManagerShutdown(); + + // Called when |binding_| hits a connection error. Destroys this instance, + // since it's no longer needed. + void OnConnectionError(); + + mojo::Binding<mojom::IdentityManager> binding_; AccountTrackerService* account_tracker_; SigninManagerBase* signin_manager_; ProfileOAuth2TokenService* token_service_; + std::unique_ptr<base::CallbackList<void()>::Subscription> + signin_manager_shutdown_subscription_; + // The set of pending requests for access tokens. AccessTokenRequests access_token_requests_; };
diff --git a/services/identity/identity_manager_unittest.cc b/services/identity/identity_manager_unittest.cc index 61afcdd..215a828 100644 --- a/services/identity/identity_manager_unittest.cc +++ b/services/identity/identity_manager_unittest.cc
@@ -89,6 +89,13 @@ account_tracker_.Initialize(&signin_client_); } + void TearDown() override { + // Shut down the SigninManager so that the IdentityManager doesn't end up + // outliving it. + signin_manager_.Shutdown(); + ServiceTest::TearDown(); + } + void OnReceivedPrimaryAccountInfo( base::Closure quit_closure, const base::Optional<AccountInfo>& account_info, @@ -151,6 +158,19 @@ DISALLOW_COPY_AND_ASSIGN(IdentityManagerTest); }; +// Tests that the Identity Manager destroys itself on SigninManager shutdown. +TEST_F(IdentityManagerTest, SigninManagerShutdown) { + base::RunLoop run_loop; + identity_manager_.set_connection_error_handler(run_loop.QuitClosure()); + + // Ensure that the IdentityManager instance has actually been created before + // invoking SigninManagerBase::Shutdown(), since otherwise this test will + // spin forever. + identity_manager_.FlushForTesting(); + signin_manager()->Shutdown(); + run_loop.Run(); +} + // Check that the primary account info is null if not signed in. TEST_F(IdentityManagerTest, GetPrimaryAccountInfoNotSignedIn) { base::RunLoop run_loop;
diff --git a/services/resource_coordinator/BUILD.gn b/services/resource_coordinator/BUILD.gn index 7582b287..a947735 100644 --- a/services/resource_coordinator/BUILD.gn +++ b/services/resource_coordinator/BUILD.gn
@@ -22,8 +22,14 @@ "coordination_unit/coordination_unit_manager.h", "coordination_unit/coordination_unit_provider_impl.cc", "coordination_unit/coordination_unit_provider_impl.h", + "coordination_unit/frame_coordination_unit_impl.cc", + "coordination_unit/frame_coordination_unit_impl.h", "coordination_unit/process_coordination_unit_impl.cc", "coordination_unit/process_coordination_unit_impl.h", + "coordination_unit/tab_signal_generator.cc", + "coordination_unit/tab_signal_generator.h", + "coordination_unit/web_contents_coordination_unit_impl.cc", + "coordination_unit/web_contents_coordination_unit_impl.h", "memory_instrumentation/coordinator_impl.cc", "memory_instrumentation/coordinator_impl.h", "memory_instrumentation/process_map.cc", @@ -70,6 +76,7 @@ "coordination_unit/process_coordination_unit_impl_unittest.cc", "memory_instrumentation/coordinator_impl_unittest.cc", "memory_instrumentation/process_map_unittest.cc", + "public/cpp/memory_instrumentation/process_metrics_memory_dump_provider_unittest.cc", "public/cpp/tracing/chrome_trace_event_agent_unittest.cc", "tracing/agent_registry_unittest.cc", "tracing/recorder_unittest.cc",
diff --git a/services/resource_coordinator/coordination_unit/coordination_unit_factory.cc b/services/resource_coordinator/coordination_unit/coordination_unit_factory.cc index c44e2da0..d251592 100644 --- a/services/resource_coordinator/coordination_unit/coordination_unit_factory.cc +++ b/services/resource_coordinator/coordination_unit/coordination_unit_factory.cc
@@ -8,7 +8,9 @@ #include <utility> #include "services/resource_coordinator/coordination_unit/coordination_unit_impl.h" +#include "services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h" #include "services/resource_coordinator/coordination_unit/process_coordination_unit_impl.h" +#include "services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.h" #include "services/resource_coordinator/public/cpp/coordination_unit_id.h" #include "services/resource_coordinator/public/cpp/coordination_unit_types.h" #include "services/service_manager/public/cpp/service_context_ref.h" @@ -21,9 +23,15 @@ const CoordinationUnitID& id, std::unique_ptr<service_manager::ServiceContextRef> service_ref) { switch (id.type) { + case CoordinationUnitType::kFrame: + return base::MakeUnique<FrameCoordinationUnitImpl>( + id, std::move(service_ref)); case CoordinationUnitType::kProcess: return base::MakeUnique<ProcessCoordinationUnitImpl>( id, std::move(service_ref)); + case CoordinationUnitType::kWebContents: + return base::MakeUnique<WebContentsCoordinationUnitImpl>( + id, std::move(service_ref)); default: return base::MakeUnique<CoordinationUnitImpl>(id, std::move(service_ref)); }
diff --git a/services/resource_coordinator/coordination_unit/coordination_unit_graph_observer.h b/services/resource_coordinator/coordination_unit/coordination_unit_graph_observer.h index 9f33e8d..cfc08ff 100644 --- a/services/resource_coordinator/coordination_unit/coordination_unit_graph_observer.h +++ b/services/resource_coordinator/coordination_unit/coordination_unit_graph_observer.h
@@ -27,9 +27,9 @@ // initialized and valid. // // To create and install a new observer: -// (1) derive from this class -// (2) register in CoordinationUnitManager::RegisterObserver -// inside of CoordinationUnitManager::CoordinationUnitManager +// (1) Derive from this class. +// (2) Register by calling on |coordination_unit_manager().ResgiterObserver| +// inside of the ResourceCoordinatorService::Create. class CoordinationUnitGraphObserver { public: CoordinationUnitGraphObserver();
diff --git a/services/resource_coordinator/coordination_unit/coordination_unit_graph_observer_unittest.cc b/services/resource_coordinator/coordination_unit/coordination_unit_graph_observer_unittest.cc index 9d3e4be..2239721 100644 --- a/services/resource_coordinator/coordination_unit/coordination_unit_graph_observer_unittest.cc +++ b/services/resource_coordinator/coordination_unit/coordination_unit_graph_observer_unittest.cc
@@ -97,7 +97,7 @@ } // namespace -TEST_F(CoordinationUnitGraphObserverTest, CallbacksInvokedNoFilters) { +TEST_F(CoordinationUnitGraphObserverTest, CallbacksInvoked) { EXPECT_TRUE(coordination_unit_manager().observers_for_testing().empty()); coordination_unit_manager().RegisterObserver( base::MakeUnique<TestCoordinationUnitGraphObserver>());
diff --git a/services/resource_coordinator/coordination_unit/coordination_unit_impl.cc b/services/resource_coordinator/coordination_unit/coordination_unit_impl.cc index 277e110..50b6628e 100644 --- a/services/resource_coordinator/coordination_unit/coordination_unit_impl.cc +++ b/services/resource_coordinator/coordination_unit/coordination_unit_impl.cc
@@ -26,9 +26,6 @@ } // namespace -const double CoordinationUnitImpl::kCPUUsageMinimumForTesting = 0.0; -const double CoordinationUnitImpl::kCPUUsageUnmeasuredForTesting = -1.0; - CoordinationUnitImpl::CoordinationUnitImpl( const CoordinationUnitID& id, std::unique_ptr<service_manager::ServiceContextRef> service_ref) @@ -262,8 +259,49 @@ current_policy_.reset(); } -double CoordinationUnitImpl::GetCPUUsageForTesting() { - return kCPUUsageUnmeasuredForTesting; +std::set<CoordinationUnitImpl*> +CoordinationUnitImpl::GetChildCoordinationUnitsOfType( + CoordinationUnitType type) { + std::set<CoordinationUnitImpl*> coordination_units; + + for (auto* child : children()) { + if (child->id().type == type) { + coordination_units.insert(child); + } + + for (auto* coordination_unit : + child->GetChildCoordinationUnitsOfType(type)) { + coordination_units.insert(coordination_unit); + } + } + + return coordination_units; +} + +std::set<CoordinationUnitImpl*> +CoordinationUnitImpl::GetParentCoordinationUnitsOfType( + CoordinationUnitType type) { + std::set<CoordinationUnitImpl*> coordination_units; + + for (auto* parent : parents()) { + if (parent->id().type == type) { + coordination_units.insert(parent); + } + + for (auto* coordination_unit : + parent->GetParentCoordinationUnitsOfType(type)) { + coordination_units.insert(coordination_unit); + } + } + + return coordination_units; +} + +std::set<CoordinationUnitImpl*> +CoordinationUnitImpl::GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType type) { + NOTREACHED(); + return std::set<CoordinationUnitImpl*>(); } base::Value CoordinationUnitImpl::GetProperty( @@ -313,4 +351,32 @@ observers_.RemoveObserver(observer); } +// static +bool CoordinationUnitImpl::IsCoordinationUnitType( + const CoordinationUnitImpl* coordination_unit, + CoordinationUnitType type) { + return coordination_unit->id().type == type; +} + +// static +bool CoordinationUnitImpl::IsFrameCoordinationUnit( + const CoordinationUnitImpl* coordination_unit) { + return IsCoordinationUnitType(coordination_unit, + CoordinationUnitType::kFrame); +} + +// static +bool CoordinationUnitImpl::IsProcessCoordinationUnit( + const CoordinationUnitImpl* coordination_unit) { + return IsCoordinationUnitType(coordination_unit, + CoordinationUnitType::kProcess); +} + +// static +bool CoordinationUnitImpl::IsWebContentsCoordinationUnit( + const CoordinationUnitImpl* coordination_unit) { + return IsCoordinationUnitType(coordination_unit, + CoordinationUnitType::kWebContents); +} + } // namespace resource_coordinator
diff --git a/services/resource_coordinator/coordination_unit/coordination_unit_impl.h b/services/resource_coordinator/coordination_unit/coordination_unit_impl.h index af6e92fff..2e69cc80 100644 --- a/services/resource_coordinator/coordination_unit/coordination_unit_impl.h +++ b/services/resource_coordinator/coordination_unit/coordination_unit_impl.h
@@ -37,6 +37,29 @@ std::unique_ptr<service_manager::ServiceContextRef> service_ref); ~CoordinationUnitImpl() override; + // Utility functions for working with CoordinationUnitImpl instances. + static bool IsCoordinationUnitType( + const CoordinationUnitImpl* coordination_unit, + CoordinationUnitType type); + static bool IsFrameCoordinationUnit( + const CoordinationUnitImpl* coordination_unit); + static bool IsProcessCoordinationUnit( + const CoordinationUnitImpl* coordination_unit); + static bool IsWebContentsCoordinationUnit( + const CoordinationUnitImpl* coordination_unit); + + // Return all of the reachable |CoordinationUnitImpl| instances + // of type |CoordinationUnitType|. Note that a callee should + // never be associated with itself. + virtual std::set<CoordinationUnitImpl*> GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType type); + + // Recalculate property internally. + virtual void RecalculateProperty(mojom::PropertyType property) {} + // Propagate property change to relevant |CoordinationUnitImpl| instances + // by invoking their their |RecalculateProperty|. + virtual void PropagateProperty(mojom::PropertyType property) {} + // Overridden from mojom::CoordinationUnit: void SendEvent(mojom::EventPtr event) override; void GetID(const GetIDCallback& callback) override; @@ -47,6 +70,17 @@ mojom::CoordinationPolicyCallbackPtr callback) override; void SetProperty(mojom::PropertyPtr property) override; + // Operations performed on the internal key-value store. + void ClearProperty(mojom::PropertyType property); + base::Value GetProperty(mojom::PropertyType property) const; + void SetProperty(mojom::PropertyType property, base::Value value); + + // Methods utilized by the |CoordinationUnitGraphObserver| framework. + void WillBeDestroyed(); + void AddObserver(CoordinationUnitGraphObserver* observer); + void RemoveObserver(CoordinationUnitGraphObserver* observer); + + // Getters and setters. const CoordinationUnitID& id() const { return id_; } const std::set<CoordinationUnitImpl*>& children() const { return children_; } const std::set<CoordinationUnitImpl*>& parents() const { return parents_; } @@ -55,26 +89,17 @@ return property_store_; } - static const double kCPUUsageMinimumForTesting; - static const double kCPUUsageUnmeasuredForTesting; - virtual double GetCPUUsageForTesting(); - - // Clear property from internal key-value store - void ClearProperty(mojom::PropertyType property); - // Retrieve property from internal key-value store - base::Value GetProperty(mojom::PropertyType property) const; - // Set property from internal key-value store - void SetProperty(mojom::PropertyType property, base::Value value); - - void WillBeDestroyed(); - void AddObserver(CoordinationUnitGraphObserver* observer); - void RemoveObserver(CoordinationUnitGraphObserver* observer); - protected: const CoordinationUnitID id_; std::set<CoordinationUnitImpl*> children_; std::set<CoordinationUnitImpl*> parents_; + // Coordination unit graph traversal helper functions. + std::set<CoordinationUnitImpl*> GetChildCoordinationUnitsOfType( + CoordinationUnitType type); + std::set<CoordinationUnitImpl*> GetParentCoordinationUnitsOfType( + CoordinationUnitType type); + private: bool AddChild(CoordinationUnitImpl* child); bool RemoveChild(CoordinationUnitImpl* child); @@ -82,7 +107,6 @@ void RemoveParent(CoordinationUnitImpl* parent); bool HasParent(CoordinationUnitImpl* unit); bool HasChild(CoordinationUnitImpl* unit); - void RecalcCoordinationPolicy(); void UnregisterCoordinationPolicyCallback();
diff --git a/services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest.cc b/services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest.cc index bec8c8e..fd21706 100644 --- a/services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest.cc +++ b/services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest.cc
@@ -11,7 +11,6 @@ #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/values.h" -#include "services/resource_coordinator/coordination_unit/coordination_unit_factory.h" #include "services/resource_coordinator/coordination_unit/coordination_unit_impl.h" #include "services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest_util.h" #include "services/resource_coordinator/coordination_unit/coordination_unit_provider_impl.h" @@ -142,15 +141,10 @@ } TEST_F(CoordinationUnitImplTest, RemoveChild) { - CoordinationUnitID parent_cu_id(CoordinationUnitType::kFrame, std::string()); - CoordinationUnitID child_cu_id(CoordinationUnitType::kFrame, std::string()); - - std::unique_ptr<CoordinationUnitImpl> parent_coordination_unit = - coordination_unit_factory::CreateCoordinationUnit( - parent_cu_id, service_context_ref_factory()->CreateRef()); - std::unique_ptr<CoordinationUnitImpl> child_coordination_unit = - coordination_unit_factory::CreateCoordinationUnit( - child_cu_id, service_context_ref_factory()->CreateRef()); + auto parent_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kFrame); + auto child_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kFrame); // Parent-child relationships have not been established yet. EXPECT_EQ(0u, parent_coordination_unit->children().size()); @@ -214,11 +208,8 @@ } TEST_F(CoordinationUnitImplTest, GetSetProperty) { - CoordinationUnitID cu_id(CoordinationUnitType::kWebContents, std::string()); - - std::unique_ptr<CoordinationUnitImpl> coordination_unit = - coordination_unit_factory::CreateCoordinationUnit( - cu_id, service_context_ref_factory()->CreateRef()); + auto coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kWebContents); // An empty value should be returned if property is not found EXPECT_EQ(base::Value(), @@ -240,4 +231,233 @@ EXPECT_EQ(0u, coordination_unit->property_store_for_testing().size()); } +TEST_F(CoordinationUnitImplTest, + GetAssociatedCoordinationUnitsForSingleTabInSingleProcess) { + // The following coordination unit graph topology is created to emulate a + // scenario when a single tab are executes in a single process: + // + // T P + // \ / + // F + // + // Where: + // T: tab_coordination_unit + // F: frame_coordination_unit + // P: process_coordination_unit + auto frame_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kFrame); + auto process_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kProcess); + auto tab_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kWebContents); + + tab_coordination_unit->AddChild(frame_coordination_unit->id()); + process_coordination_unit->AddChild(frame_coordination_unit->id()); + + auto tabs_associated_with_process = + process_coordination_unit->GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType::kWebContents); + EXPECT_EQ(1u, tabs_associated_with_process.size()); + EXPECT_EQ(1u, + tabs_associated_with_process.count(tab_coordination_unit.get())); + + auto processes_associated_with_tab = + tab_coordination_unit->GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType::kProcess); + EXPECT_EQ(1u, processes_associated_with_tab.size()); + EXPECT_EQ( + 1u, processes_associated_with_tab.count(process_coordination_unit.get())); +} + +TEST_F(CoordinationUnitImplTest, + GetAssociatedCoordinationUnitsForMultipleTabsInSingleProcess) { + // The following coordination unit graph topology is created to emulate a + // scenario where multiple tabs are executing in a single process: + // + // T P OT + // \ / \ / + // F OF + // + // Where: + // T: tab_coordination_unit + // OT: other_tab_coordination_unit + // F: frame_coordination_unit + // OF: other_frame_coordination_unit + // P: process_coordination_unit + auto frame_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kFrame); + auto other_frame_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kFrame); + auto process_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kProcess); + auto tab_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kWebContents); + auto other_tab_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kWebContents); + + tab_coordination_unit->AddChild(frame_coordination_unit->id()); + other_tab_coordination_unit->AddChild(other_frame_coordination_unit->id()); + process_coordination_unit->AddChild(frame_coordination_unit->id()); + process_coordination_unit->AddChild(other_frame_coordination_unit->id()); + + auto tabs_associated_with_process = + process_coordination_unit->GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType::kWebContents); + EXPECT_EQ(2u, tabs_associated_with_process.size()); + EXPECT_EQ(1u, + tabs_associated_with_process.count(tab_coordination_unit.get())); + EXPECT_EQ(1u, tabs_associated_with_process.count( + other_tab_coordination_unit.get())); + + auto processes_associated_with_tab = + tab_coordination_unit->GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType::kProcess); + EXPECT_EQ(1u, processes_associated_with_tab.size()); + EXPECT_EQ( + 1u, processes_associated_with_tab.count(process_coordination_unit.get())); + + auto processes_associated_with_other_tab = + other_tab_coordination_unit->GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType::kProcess); + EXPECT_EQ(1u, processes_associated_with_other_tab.size()); + EXPECT_EQ( + 1u, processes_associated_with_tab.count(process_coordination_unit.get())); +} + +TEST_F(CoordinationUnitImplTest, + GetAssociatedCoordinationUnitsForSingleTabWithMultipleProcesses) { + // The following coordination unit graph topology is created to emulate a + // scenario where a single tab that has frames executing in different + // processes (e.g. out-of-process iFrames): + // + // T P + // \ / + // F OP + // \ / + // OF + // + // Where: + // T: tab_coordination_unit + // F: frame_coordination_unit + // OF: other_frame_coordination_unit + // P: process_coordination_unit + // OP: other_process_coordination_unit + auto frame_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kFrame); + auto other_frame_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kFrame); + auto process_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kProcess); + auto other_process_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kProcess); + auto tab_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kWebContents); + + frame_coordination_unit->AddChild(other_frame_coordination_unit->id()); + tab_coordination_unit->AddChild(frame_coordination_unit->id()); + tab_coordination_unit->AddChild(other_frame_coordination_unit->id()); + process_coordination_unit->AddChild(frame_coordination_unit->id()); + other_process_coordination_unit->AddChild( + other_frame_coordination_unit->id()); + + auto tabs_associated_with_process = + process_coordination_unit->GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType::kWebContents); + EXPECT_EQ(1u, tabs_associated_with_process.size()); + EXPECT_EQ(1u, + tabs_associated_with_process.count(tab_coordination_unit.get())); + + auto tabs_associated_with_other_process = + other_process_coordination_unit->GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType::kWebContents); + EXPECT_EQ(1u, tabs_associated_with_other_process.size()); + EXPECT_EQ(1u, tabs_associated_with_other_process.count( + tab_coordination_unit.get())); + + auto processes_associated_with_tab = + tab_coordination_unit->GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType::kProcess); + EXPECT_EQ(2u, processes_associated_with_tab.size()); + EXPECT_EQ( + 1u, processes_associated_with_tab.count(process_coordination_unit.get())); + EXPECT_EQ(1u, processes_associated_with_tab.count( + other_process_coordination_unit.get())); +} + +TEST_F(CoordinationUnitImplTest, + GetAssociatedCoordinationUnitsForMultipeTabsWithMultipleProcesses) { + // The following coordination unit graph topology is created to emulate a + // scenario where multiple tabs are utilizing multiple processes (e.g. + // out-of-process iFrames and multiple tabs in a process): + // + // OT P T + // \ / \ / + // OF F OP + // \ / + // AF + // + // Where: + // T: tab_coordination_unit + // OT: other_tab_coordination_unit + // F: frame_coordination_unit + // OF: other_frame_coordination_unit + // AF: another_frame_coordination_unit + // P: process_coordination_unit + // OP: other_process_coordination_unit + auto frame_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kFrame); + auto other_frame_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kFrame); + auto another_frame_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kFrame); + auto process_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kProcess); + auto other_process_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kProcess); + auto tab_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kWebContents); + auto other_tab_coordination_unit = + CreateCoordinationUnit(CoordinationUnitType::kWebContents); + + frame_coordination_unit->AddChild(another_frame_coordination_unit->id()); + tab_coordination_unit->AddChild(frame_coordination_unit->id()); + other_tab_coordination_unit->AddChild(other_frame_coordination_unit->id()); + process_coordination_unit->AddChild(frame_coordination_unit->id()); + process_coordination_unit->AddChild(other_frame_coordination_unit->id()); + other_process_coordination_unit->AddChild( + another_frame_coordination_unit->id()); + + auto tabs_associated_with_process = + process_coordination_unit->GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType::kWebContents); + EXPECT_EQ(2u, tabs_associated_with_process.size()); + EXPECT_EQ(1u, + tabs_associated_with_process.count(tab_coordination_unit.get())); + EXPECT_EQ(1u, tabs_associated_with_process.count( + other_tab_coordination_unit.get())); + + auto tabs_associated_with_other_process = + other_process_coordination_unit->GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType::kWebContents); + EXPECT_EQ(1u, tabs_associated_with_other_process.size()); + EXPECT_EQ(1u, tabs_associated_with_other_process.count( + tab_coordination_unit.get())); + + auto processes_associated_with_tab = + tab_coordination_unit->GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType::kProcess); + EXPECT_EQ(2u, processes_associated_with_tab.size()); + EXPECT_EQ( + 1u, processes_associated_with_tab.count(process_coordination_unit.get())); + EXPECT_EQ(1u, processes_associated_with_tab.count( + other_process_coordination_unit.get())); + + auto processes_associated_with_other_tab = + other_tab_coordination_unit->GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType::kProcess); + EXPECT_EQ(1u, processes_associated_with_other_tab.size()); + EXPECT_EQ(1u, processes_associated_with_other_tab.count( + process_coordination_unit.get())); +} + } // namespace resource_coordinator
diff --git a/services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest_util.cc b/services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest_util.cc index fc46579..f87940b 100644 --- a/services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest_util.cc +++ b/services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest_util.cc
@@ -4,8 +4,12 @@ #include "services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest_util.h" +#include <string> + #include "base/bind.h" #include "base/run_loop.h" +#include "services/resource_coordinator/coordination_unit/coordination_unit_factory.h" +#include "services/resource_coordinator/public/interfaces/coordination_unit.mojom.h" namespace resource_coordinator { @@ -28,4 +32,17 @@ base::RunLoop().RunUntilIdle(); } +std::unique_ptr<CoordinationUnitImpl> +CoordinationUnitImplTestBase::CreateCoordinationUnit(CoordinationUnitID cu_id) { + return coordination_unit_factory::CreateCoordinationUnit( + cu_id, service_context_ref_factory()->CreateRef()); +} + +std::unique_ptr<CoordinationUnitImpl> +CoordinationUnitImplTestBase::CreateCoordinationUnit( + CoordinationUnitType type) { + CoordinationUnitID cu_id(type, std::string()); + return CreateCoordinationUnit(cu_id); +} + } // namespace resource_coordinator
diff --git a/services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest_util.h b/services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest_util.h index 70c8626..c1ed7ac1 100644 --- a/services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest_util.h +++ b/services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest_util.h
@@ -5,14 +5,21 @@ #ifndef SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_IMPL_UNITTEST_UTIL_H_ #define SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_IMPL_UNITTEST_UTIL_H_ +#include <stdint.h> + +#include <memory> + #include "base/message_loop/message_loop.h" #include "services/resource_coordinator/coordination_unit/coordination_unit_manager.h" #include "services/resource_coordinator/coordination_unit/coordination_unit_provider_impl.h" +#include "services/resource_coordinator/public/interfaces/coordination_unit.mojom.h" #include "services/service_manager/public/cpp/service_context_ref.h" #include "testing/gtest/include/gtest/gtest.h" namespace resource_coordinator { +struct CoordinationUnitID; + class CoordinationUnitImplTestBase : public testing::Test { public: CoordinationUnitImplTestBase(); @@ -21,6 +28,11 @@ // testing::Test: void TearDown() override; + std::unique_ptr<CoordinationUnitImpl> CreateCoordinationUnit( + CoordinationUnitID cu_id); + std::unique_ptr<CoordinationUnitImpl> CreateCoordinationUnit( + CoordinationUnitType type); + protected: service_manager::ServiceContextRefFactory* service_context_ref_factory() { return &service_ref_factory_;
diff --git a/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.cc b/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.cc new file mode 100644 index 0000000..a64d1c1 --- /dev/null +++ b/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.cc
@@ -0,0 +1,48 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h" + +#include <utility> + +namespace service_manager { +class ServiceContextRef; +} + +namespace resource_coordinator { + +struct CoordinationUnitID; + +FrameCoordinationUnitImpl::FrameCoordinationUnitImpl( + const CoordinationUnitID& id, + std::unique_ptr<service_manager::ServiceContextRef> service_ref) + : CoordinationUnitImpl(id, std::move(service_ref)) {} + +FrameCoordinationUnitImpl::~FrameCoordinationUnitImpl() = default; + +std::set<CoordinationUnitImpl*> +FrameCoordinationUnitImpl::GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType type) { + switch (type) { + case CoordinationUnitType::kProcess: + case CoordinationUnitType::kWebContents: + // Processes and WebContents are only associated with a frame if + // they are a direct parents of the frame. + return GetParentCoordinationUnitsOfType(type); + case CoordinationUnitType::kFrame: { + // Frame association is recursive: any frame connected to a frame the + // frame is connected to are all associated with one another. + auto frame_coordination_units = GetChildCoordinationUnitsOfType(type); + for (auto* frame_coordination_unit : + GetParentCoordinationUnitsOfType(type)) { + frame_coordination_units.insert(frame_coordination_unit); + } + return frame_coordination_units; + } + default: + return std::set<CoordinationUnitImpl*>(); + } +} + +} // namespace resource_coordinator
diff --git a/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h b/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h new file mode 100644 index 0000000..0bfc24d0 --- /dev/null +++ b/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h
@@ -0,0 +1,40 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_FRAME_COORDINATION_UNIT_IMPL_H_ +#define SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_FRAME_COORDINATION_UNIT_IMPL_H_ + +#include <memory> +#include <set> + +#include "base/macros.h" +#include "services/resource_coordinator/coordination_unit/coordination_unit_impl.h" +#include "services/resource_coordinator/public/interfaces/coordination_unit.mojom.h" + +namespace service_manager { +class ServiceContextRef; +} + +namespace resource_coordinator { + +struct CoordinationUnitID; + +class FrameCoordinationUnitImpl : public CoordinationUnitImpl { + public: + FrameCoordinationUnitImpl( + const CoordinationUnitID& id, + std::unique_ptr<service_manager::ServiceContextRef> service_ref); + ~FrameCoordinationUnitImpl() override; + + // CoordinationUnitImpl implementation. + std::set<CoordinationUnitImpl*> GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType type) override; + + private: + DISALLOW_COPY_AND_ASSIGN(FrameCoordinationUnitImpl); +}; + +} // namespace resource_coordinator + +#endif // SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_FRAME_COORDINATION_UNIT_IMPL_H_
diff --git a/services/resource_coordinator/coordination_unit/process_coordination_unit_impl.cc b/services/resource_coordinator/coordination_unit/process_coordination_unit_impl.cc index 0bc6d1ab..b66777f 100644 --- a/services/resource_coordinator/coordination_unit/process_coordination_unit_impl.cc +++ b/services/resource_coordinator/coordination_unit/process_coordination_unit_impl.cc
@@ -4,13 +4,13 @@ #include "services/resource_coordinator/coordination_unit/process_coordination_unit_impl.h" -#include <memory> #include <utility> #include "base/process/process.h" #include "base/process/process_handle.h" #include "base/process/process_metrics.h" #include "base/time/time.h" +#include "base/values.h" #if defined(OS_MACOSX) #include "services/service_manager/public/cpp/standalone_service/mach_broker.h" @@ -37,7 +37,7 @@ ProcessCoordinationUnitImpl::ProcessCoordinationUnitImpl( const CoordinationUnitID& id, std::unique_ptr<service_manager::ServiceContextRef> service_ref) - : CoordinationUnitImpl(id, std::move(service_ref)), cpu_usage_(-1.0) { + : CoordinationUnitImpl(id, std::move(service_ref)) { // ProcessCoordinationUnit ids should correspond to its pid base::ProcessId pid = id.id; #if defined(OS_WIN) @@ -62,16 +62,51 @@ ProcessCoordinationUnitImpl::~ProcessCoordinationUnitImpl() = default; +std::set<CoordinationUnitImpl*> +ProcessCoordinationUnitImpl::GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType type) { + switch (type) { + case CoordinationUnitType::kWebContents: { + // There is currently not a direct relationship between processes and + // tabs. However, frames are children of both processes and frames, so we + // find all of the tabs that are reachable from the process's child + // frames. + std::set<CoordinationUnitImpl*> web_contents_coordination_units; + + for (auto* frame_coordination_unit : + GetChildCoordinationUnitsOfType(CoordinationUnitType::kFrame)) { + for (auto* web_contents_coordination_unit : + frame_coordination_unit->GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType::kWebContents)) { + web_contents_coordination_units.insert( + web_contents_coordination_unit); + } + } + + return web_contents_coordination_units; + } + case CoordinationUnitType::kFrame: + return GetChildCoordinationUnitsOfType(type); + default: + return std::set<CoordinationUnitImpl*>(); + } +} + void ProcessCoordinationUnitImpl::MeasureProcessCPUUsage() { - cpu_usage_ = process_metrics_->GetPlatformIndependentCPUUsage(); + double cpu_usage = process_metrics_->GetPlatformIndependentCPUUsage(); + SetProperty(mojom::PropertyType::kCPUUsage, base::Value(cpu_usage)); + + // Trigger tab coordination units to recalculate their CPU usage. + // TODO(matthalp): Move propagation functionality into a separate, + // more generalized method to support other property changes. + for (auto* tab : GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType::kWebContents)) { + tab->RecalculateProperty(mojom::PropertyType::kCPUUsage); + } repeating_timer_.Start( FROM_HERE, base::TimeDelta::FromSeconds(kCPUProfilingIntervalInSeconds), this, &ProcessCoordinationUnitImpl::MeasureProcessCPUUsage); } -double ProcessCoordinationUnitImpl::GetCPUUsageForTesting() { - return cpu_usage_; -} - } // namespace resource_coordinator
diff --git a/services/resource_coordinator/coordination_unit/process_coordination_unit_impl.h b/services/resource_coordinator/coordination_unit/process_coordination_unit_impl.h index eadb06423..bbe57211 100644 --- a/services/resource_coordinator/coordination_unit/process_coordination_unit_impl.h +++ b/services/resource_coordinator/coordination_unit/process_coordination_unit_impl.h
@@ -5,12 +5,16 @@ #ifndef SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_PROCESS_COORDINATION_UNIT_IMPL_H_ #define SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_PROCESS_COORDINATION_UNIT_IMPL_H_ +#include <stdint.h> + #include <memory> +#include <set> #include "base/macros.h" #include "base/process/process_metrics.h" #include "base/timer/timer.h" #include "services/resource_coordinator/coordination_unit/coordination_unit_impl.h" +#include "services/resource_coordinator/public/interfaces/coordination_unit.mojom.h" namespace service_manager { class ServiceContextRef; @@ -26,13 +30,16 @@ const CoordinationUnitID& id, std::unique_ptr<service_manager::ServiceContextRef> service_ref); ~ProcessCoordinationUnitImpl() override; + + // CoordinationUnitImpl implementation. + std::set<CoordinationUnitImpl*> GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType type) override; + void MeasureProcessCPUUsage(); - double GetCPUUsageForTesting() override; private: std::unique_ptr<base::ProcessMetrics> process_metrics_; base::OneShotTimer repeating_timer_; - double cpu_usage_; DISALLOW_COPY_AND_ASSIGN(ProcessCoordinationUnitImpl); };
diff --git a/services/resource_coordinator/coordination_unit/process_coordination_unit_impl_unittest.cc b/services/resource_coordinator/coordination_unit/process_coordination_unit_impl_unittest.cc index 30e9e1d1..292b86f 100644 --- a/services/resource_coordinator/coordination_unit/process_coordination_unit_impl_unittest.cc +++ b/services/resource_coordinator/coordination_unit/process_coordination_unit_impl_unittest.cc
@@ -9,6 +9,7 @@ #include "services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest_util.h" #include "services/resource_coordinator/public/cpp/coordination_unit_id.h" #include "services/resource_coordinator/public/cpp/coordination_unit_types.h" +#include "services/resource_coordinator/public/interfaces/coordination_unit.mojom.h" #include "testing/gtest/include/gtest/gtest.h" namespace resource_coordinator { @@ -29,7 +30,9 @@ base::RunLoop().RunUntilIdle(); - EXPECT_LE(0.0, coordination_unit_->GetCPUUsageForTesting()); + base::Value cpu_usage_value = + coordination_unit_->GetProperty(mojom::PropertyType::kCPUUsage); + EXPECT_LE(0.0, cpu_usage_value.GetDouble()); } } // namespace resource_coordinator
diff --git a/services/resource_coordinator/coordination_unit/tab_signal_generator.cc b/services/resource_coordinator/coordination_unit/tab_signal_generator.cc new file mode 100644 index 0000000..7cc179e6 --- /dev/null +++ b/services/resource_coordinator/coordination_unit/tab_signal_generator.cc
@@ -0,0 +1,20 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "services/resource_coordinator/coordination_unit/tab_signal_generator.h" + +#include "services/resource_coordinator/coordination_unit/coordination_unit_impl.h" + +namespace resource_coordinator { + +TabSignalGenerator::TabSignalGenerator() = default; + +TabSignalGenerator::~TabSignalGenerator() = default; + +bool TabSignalGenerator::ShouldObserve( + const CoordinationUnitImpl* coordination_unit) { + return coordination_unit->id().type == CoordinationUnitType::kWebContents; +} + +} // namespace resource_coordinator
diff --git a/services/resource_coordinator/coordination_unit/tab_signal_generator.h b/services/resource_coordinator/coordination_unit/tab_signal_generator.h new file mode 100644 index 0000000..5c5980d7 --- /dev/null +++ b/services/resource_coordinator/coordination_unit/tab_signal_generator.h
@@ -0,0 +1,32 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_TAB_SIGNAL_GENERATOR_H_ +#define SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_TAB_SIGNAL_GENERATOR_H_ + +#include "base/macros.h" +#include "services/resource_coordinator/coordination_unit/coordination_unit_graph_observer.h" + +namespace resource_coordinator { + +class CoordinationUnitImpl; + +// The TabSignalGenerator is a unified |CoordinationUnitGraphObserver| for +// calculating and emitting tab-scoped signals. Nonetheless, the observer +// has access to the whole coordination unit graph and thus can utilize +// the information contained within the entire graph to generate the signals. +class TabSignalGenerator : public CoordinationUnitGraphObserver { + public: + TabSignalGenerator(); + ~TabSignalGenerator() override; + + bool ShouldObserve(const CoordinationUnitImpl* coordination_unit) override; + + private: + DISALLOW_COPY_AND_ASSIGN(TabSignalGenerator); +}; + +} // namespace resource_coordinator + +#endif // SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_TAB_SIGNAL_GENERATOR_H_
diff --git a/services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.cc b/services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.cc new file mode 100644 index 0000000..e5b840ab --- /dev/null +++ b/services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.cc
@@ -0,0 +1,84 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.h" + +#include <utility> + +namespace service_manager { +class ServiceContextRef; +} + +namespace resource_coordinator { + +struct CoordinationUnitID; + +WebContentsCoordinationUnitImpl::WebContentsCoordinationUnitImpl( + const CoordinationUnitID& id, + std::unique_ptr<service_manager::ServiceContextRef> service_ref) + : CoordinationUnitImpl(id, std::move(service_ref)) {} + +WebContentsCoordinationUnitImpl::~WebContentsCoordinationUnitImpl() = default; + +std::set<CoordinationUnitImpl*> +WebContentsCoordinationUnitImpl::GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType type) { + switch (type) { + case CoordinationUnitType::kProcess: { + std::set<CoordinationUnitImpl*> process_coordination_units; + + // There is currently not a direct relationship between processes and + // tabs. However, frames are children of both processes and frames, so we + // find all of the processes that are reachable from the tabs's child + // frames. + for (auto* frame_coordination_unit : + GetChildCoordinationUnitsOfType(CoordinationUnitType::kFrame)) { + for (auto* process_coordination_unit : + frame_coordination_unit->GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType::kProcess)) { + process_coordination_units.insert(process_coordination_unit); + } + } + + return process_coordination_units; + } + case CoordinationUnitType::kFrame: + return GetChildCoordinationUnitsOfType(type); + default: + return std::set<CoordinationUnitImpl*>(); + } +} + +double WebContentsCoordinationUnitImpl::CalculateCPUUsage() { + double cpu_usage = 0.0; + + for (auto* process_coordination_unit : + GetAssociatedCoordinationUnitsOfType(CoordinationUnitType::kProcess)) { + size_t tabs_in_process = process_coordination_unit + ->GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType::kWebContents) + .size(); + DCHECK_LE(1u, tabs_in_process); + + base::Value process_cpu_usage_value = + process_coordination_unit->GetProperty(mojom::PropertyType::kCPUUsage); + double process_cpu_usage = + process_cpu_usage_value.IsType(base::Value::Type::NONE) + ? 0.0 + : process_cpu_usage_value.GetDouble(); + cpu_usage += process_cpu_usage / tabs_in_process; + } + + return cpu_usage; +} + +void WebContentsCoordinationUnitImpl::RecalculateProperty( + mojom::PropertyType property_type) { + if (property_type == mojom::PropertyType::kCPUUsage) { + double cpu_usage = CalculateCPUUsage(); + SetProperty(mojom::PropertyType::kCPUUsage, base::Value(cpu_usage)); + } +} + +} // namespace resource_coordinator
diff --git a/services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.h b/services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.h new file mode 100644 index 0000000..35523d8 --- /dev/null +++ b/services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.h
@@ -0,0 +1,45 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_WEB_CONTENTS_COORDINATION_UNIT_IMPL_H_ +#define SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_WEB_CONTENTS_COORDINATION_UNIT_IMPL_H_ + +#include <stdint.h> + +#include <memory> +#include <set> + +#include "base/macros.h" +#include "services/resource_coordinator/coordination_unit/coordination_unit_impl.h" +#include "services/resource_coordinator/public/interfaces/coordination_unit.mojom.h" + +namespace service_manager { +class ServiceContextRef; +} + +namespace resource_coordinator { + +struct CoordinationUnitID; + +class WebContentsCoordinationUnitImpl : public CoordinationUnitImpl { + public: + WebContentsCoordinationUnitImpl( + const CoordinationUnitID& id, + std::unique_ptr<service_manager::ServiceContextRef> service_ref); + ~WebContentsCoordinationUnitImpl() override; + + // CoordinationUnitImpl implementation. + std::set<CoordinationUnitImpl*> GetAssociatedCoordinationUnitsOfType( + CoordinationUnitType type) override; + void RecalculateProperty(mojom::PropertyType property_type) override; + + private: + double CalculateCPUUsage(); + + DISALLOW_COPY_AND_ASSIGN(WebContentsCoordinationUnitImpl); +}; + +} // namespace resource_coordinator + +#endif // SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_WEB_CONTENTS_COORDINATION_UNIT_IMPL_H_
diff --git a/services/resource_coordinator/public/cpp/BUILD.gn b/services/resource_coordinator/public/cpp/BUILD.gn index ca5c067..e26cb413 100644 --- a/services/resource_coordinator/public/cpp/BUILD.gn +++ b/services/resource_coordinator/public/cpp/BUILD.gn
@@ -12,6 +12,8 @@ "memory_instrumentation/coordinator.h", "memory_instrumentation/memory_instrumentation.cc", "memory_instrumentation/memory_instrumentation.h", + "memory_instrumentation/process_metrics_memory_dump_provider.cc", + "memory_instrumentation/process_metrics_memory_dump_provider.h", "resource_coordinator_features.cc", "resource_coordinator_features.h", "resource_coordinator_interface.cc", @@ -26,6 +28,10 @@ ":struct_traits", ] + if (is_win) { + deps += [ "//base/win:pe_image" ] + } + public_deps = [ "//base", "//mojo/public/cpp/bindings",
diff --git a/services/resource_coordinator/public/cpp/memory_instrumentation/process_metrics_memory_dump_provider.cc b/services/resource_coordinator/public/cpp/memory_instrumentation/process_metrics_memory_dump_provider.cc new file mode 100644 index 0000000..d948b7b8 --- /dev/null +++ b/services/resource_coordinator/public/cpp/memory_instrumentation/process_metrics_memory_dump_provider.cc
@@ -0,0 +1,771 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "services/resource_coordinator/public/cpp/memory_instrumentation/process_metrics_memory_dump_provider.h" + +#include <fcntl.h> +#include <stdint.h> + +#include <map> + +#include "base/files/file_util.h" +#include "base/files/scoped_file.h" +#include "base/format_macros.h" +#include "base/lazy_instance.h" +#include "base/logging.h" +#include "base/memory/ptr_util.h" +#include "base/process/process_metrics.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/string_util.h" +#include "base/trace_event/memory_dump_manager.h" +#include "base/trace_event/process_memory_dump.h" +#include "base/trace_event/process_memory_maps.h" +#include "base/trace_event/process_memory_totals.h" +#include "build/build_config.h" + +#if defined(OS_MACOSX) +#include <libproc.h> +#include <mach/mach.h> +#include <mach/mach_vm.h> +#include <mach/shared_region.h> +#include <sys/param.h> + +#include <mach-o/dyld_images.h> +#include <mach-o/loader.h> +#include <mach/mach.h> + +#include "base/numerics/safe_math.h" +#include "base/process/process_metrics.h" +#endif // defined(OS_MACOSX) + +#if defined(OS_WIN) +#include <psapi.h> +#include <tchar.h> +#include <windows.h> + +#include <base/strings/sys_string_conversions.h> +#include <base/win/pe_image.h> +#include <base/win/win_util.h> +#endif // defined(OS_WIN) + +namespace memory_instrumentation { + +namespace { + +base::LazyInstance< + std::map<base::ProcessId, + std::unique_ptr<ProcessMetricsMemoryDumpProvider>>>::Leaky + g_dump_providers_map = LAZY_INSTANCE_INITIALIZER; + +#if defined(OS_LINUX) || defined(OS_ANDROID) +const char kClearPeakRssCommand[] = "5"; + +const uint32_t kMaxLineSize = 4096; + +bool ParseSmapsHeader(const char* header_line, + base::trace_event::ProcessMemoryMaps::VMRegion* region) { + // e.g., "00400000-00421000 r-xp 00000000 fc:01 1234 /foo.so\n" + bool res = true; // Whether this region should be appended or skipped. + uint64_t end_addr = 0; + char protection_flags[5] = {0}; + char mapped_file[kMaxLineSize]; + + if (sscanf(header_line, "%" SCNx64 "-%" SCNx64 " %4c %*s %*s %*s%4095[^\n]\n", + ®ion->start_address, &end_addr, protection_flags, + mapped_file) != 4) + return false; + + if (end_addr > region->start_address) { + region->size_in_bytes = end_addr - region->start_address; + } else { + // This is not just paranoia, it can actually happen (See crbug.com/461237). + region->size_in_bytes = 0; + res = false; + } + + region->protection_flags = 0; + if (protection_flags[0] == 'r') { + region->protection_flags |= + base::trace_event::ProcessMemoryMaps::VMRegion::kProtectionFlagsRead; + } + if (protection_flags[1] == 'w') { + region->protection_flags |= + base::trace_event::ProcessMemoryMaps::VMRegion::kProtectionFlagsWrite; + } + if (protection_flags[2] == 'x') { + region->protection_flags |= + base::trace_event::ProcessMemoryMaps::VMRegion::kProtectionFlagsExec; + } + if (protection_flags[3] == 's') { + region->protection_flags |= base::trace_event::ProcessMemoryMaps::VMRegion:: + kProtectionFlagsMayshare; + } + + region->mapped_file = mapped_file; + base::TrimWhitespaceASCII(region->mapped_file, base::TRIM_ALL, + ®ion->mapped_file); + + return res; +} + +uint64_t ReadCounterBytes(char* counter_line) { + uint64_t counter_value = 0; + int res = sscanf(counter_line, "%*s %" SCNu64 " kB", &counter_value); + return res == 1 ? counter_value * 1024 : 0; +} + +uint32_t ParseSmapsCounter( + char* counter_line, + base::trace_event::ProcessMemoryMaps::VMRegion* region) { + // A smaps counter lines looks as follows: "RSS: 0 Kb\n" + uint32_t res = 1; + char counter_name[20]; + int did_read = sscanf(counter_line, "%19[^\n ]", counter_name); + if (did_read != 1) + return 0; + + if (strcmp(counter_name, "Pss:") == 0) { + region->byte_stats_proportional_resident = ReadCounterBytes(counter_line); + } else if (strcmp(counter_name, "Private_Dirty:") == 0) { + region->byte_stats_private_dirty_resident = ReadCounterBytes(counter_line); + } else if (strcmp(counter_name, "Private_Clean:") == 0) { + region->byte_stats_private_clean_resident = ReadCounterBytes(counter_line); + } else if (strcmp(counter_name, "Shared_Dirty:") == 0) { + region->byte_stats_shared_dirty_resident = ReadCounterBytes(counter_line); + } else if (strcmp(counter_name, "Shared_Clean:") == 0) { + region->byte_stats_shared_clean_resident = ReadCounterBytes(counter_line); + } else if (strcmp(counter_name, "Swap:") == 0) { + region->byte_stats_swapped = ReadCounterBytes(counter_line); + } else { + res = 0; + } + + return res; +} + +uint32_t ReadLinuxProcSmapsFile(FILE* smaps_file, + base::trace_event::ProcessMemoryMaps* pmm) { + if (!smaps_file) + return 0; + + fseek(smaps_file, 0, SEEK_SET); + + char line[kMaxLineSize]; + const uint32_t kNumExpectedCountersPerRegion = 6; + uint32_t counters_parsed_for_current_region = 0; + uint32_t num_valid_regions = 0; + base::trace_event::ProcessMemoryMaps::VMRegion region; + bool should_add_current_region = false; + for (;;) { + line[0] = '\0'; + if (fgets(line, kMaxLineSize, smaps_file) == nullptr || !strlen(line)) + break; + if (isxdigit(line[0]) && !isupper(line[0])) { + region = base::trace_event::ProcessMemoryMaps::VMRegion(); + counters_parsed_for_current_region = 0; + should_add_current_region = ParseSmapsHeader(line, ®ion); + } else { + counters_parsed_for_current_region += ParseSmapsCounter(line, ®ion); + DCHECK_LE(counters_parsed_for_current_region, + kNumExpectedCountersPerRegion); + if (counters_parsed_for_current_region == kNumExpectedCountersPerRegion) { + if (should_add_current_region) { + pmm->AddVMRegion(region); + ++num_valid_regions; + should_add_current_region = false; + } + } + } + } + return num_valid_regions; +} + +bool GetResidentAndSharedPagesFromStatmFile(int fd, + uint64_t* resident_pages, + uint64_t* shared_pages) { + lseek(fd, 0, SEEK_SET); + char line[kMaxLineSize]; + int res = read(fd, line, kMaxLineSize - 1); + if (res <= 0) + return false; + line[res] = '\0'; + int num_scanned = + sscanf(line, "%*s %" SCNu64 " %" SCNu64, resident_pages, shared_pages); + return num_scanned == 2; +} + +#endif // defined(OS_LINUX) || defined(OS_ANDROID) + +std::unique_ptr<base::ProcessMetrics> CreateProcessMetrics( + base::ProcessId process) { + if (process == base::kNullProcessId) + return base::ProcessMetrics::CreateCurrentProcessMetrics(); +#if defined(OS_LINUX) || defined(OS_ANDROID) + // Just pass ProcessId instead of handle since they are the same in linux and + // android. + return base::ProcessMetrics::CreateProcessMetrics(process); +#else + // Creating process metrics for child processes in mac or windows requires + // additional information like ProcessHandle or port provider. + NOTREACHED(); + return std::unique_ptr<base::ProcessMetrics>(); +#endif // defined(OS_LINUX) || defined(OS_ANDROID) +} + +} // namespace + +// static +uint64_t ProcessMetricsMemoryDumpProvider::rss_bytes_for_testing = 0; + +// static +ProcessMetricsMemoryDumpProvider::FactoryFunction + ProcessMetricsMemoryDumpProvider::factory_for_testing = nullptr; + +#if defined(OS_LINUX) || defined(OS_ANDROID) + +// static +FILE* ProcessMetricsMemoryDumpProvider::proc_smaps_for_testing = nullptr; + +// static +int ProcessMetricsMemoryDumpProvider::fast_polling_statm_fd_for_testing = -1; + +bool ProcessMetricsMemoryDumpProvider::DumpProcessMemoryMaps( + const base::trace_event::MemoryDumpArgs& args, + base::trace_event::ProcessMemoryDump* pmd) { + uint32_t res = 0; + if (proc_smaps_for_testing) { + res = ReadLinuxProcSmapsFile(proc_smaps_for_testing, pmd->process_mmaps()); + } else { + std::string file_name = + "/proc/" + + (process_ == base::kNullProcessId ? "self" + : base::IntToString(process_)) + + "/smaps"; + base::ScopedFILE smaps_file(fopen(file_name.c_str(), "r")); + res = ReadLinuxProcSmapsFile(smaps_file.get(), pmd->process_mmaps()); + } + + if (res) + pmd->set_has_process_mmaps(); + return res; +} +#endif // defined(OS_LINUX) || defined(OS_ANDROID) + +#if defined(OS_WIN) +bool ProcessMetricsMemoryDumpProvider::DumpProcessMemoryMaps( + const base::trace_event::MemoryDumpArgs& args, + base::trace_event::ProcessMemoryDump* pmd) { + std::vector<HMODULE> modules; + if (!base::win::GetLoadedModulesSnapshot(::GetCurrentProcess(), &modules)) + return false; + + // Query the base address for each module, and attach it to the dump. + for (size_t i = 0; i < modules.size(); ++i) { + wchar_t module_name[MAX_PATH]; + if (!::GetModuleFileName(modules[i], module_name, MAX_PATH)) + continue; + + MODULEINFO module_info; + if (!::GetModuleInformation(::GetCurrentProcess(), modules[i], &module_info, + sizeof(MODULEINFO))) { + continue; + } + base::trace_event::ProcessMemoryMaps::VMRegion region; + region.size_in_bytes = module_info.SizeOfImage; + region.mapped_file = base::SysWideToNativeMB(module_name); + region.start_address = reinterpret_cast<uint64_t>(module_info.lpBaseOfDll); + + // The PE header field |TimeDateStamp| is required to build the PE code + // identifier which is used as a key to query symbols servers. + base::win::PEImage pe_image(module_info.lpBaseOfDll); + region.module_timestamp = pe_image.GetNTHeaders()->FileHeader.TimeDateStamp; + + pmd->process_mmaps()->AddVMRegion(region); + } + if (!pmd->process_mmaps()->vm_regions().empty()) + pmd->set_has_process_mmaps(); + return true; +} +#endif // defined(OS_WIN) + +#if defined(OS_MACOSX) + +namespace { + +using VMRegion = base::trace_event::ProcessMemoryMaps::VMRegion; + +bool IsAddressInSharedRegion(uint64_t address) { + return address >= SHARED_REGION_BASE_X86_64 && + address < (SHARED_REGION_BASE_X86_64 + SHARED_REGION_SIZE_X86_64); +} + +bool IsRegionContainedInRegion(const VMRegion& containee, + const VMRegion& container) { + uint64_t containee_end_address = + containee.start_address + containee.size_in_bytes; + uint64_t container_end_address = + container.start_address + container.size_in_bytes; + return containee.start_address >= container.start_address && + containee_end_address <= container_end_address; +} + +bool DoRegionsIntersect(const VMRegion& a, const VMRegion& b) { + uint64_t a_end_address = a.start_address + a.size_in_bytes; + uint64_t b_end_address = b.start_address + b.size_in_bytes; + return a.start_address < b_end_address && b.start_address < a_end_address; +} + +// Creates VMRegions for all dyld images. Returns whether the operation +// succeeded. +bool GetDyldRegions(std::vector<VMRegion>* regions) { + task_dyld_info_data_t dyld_info; + mach_msg_type_number_t count = TASK_DYLD_INFO_COUNT; + kern_return_t kr = + task_info(mach_task_self(), TASK_DYLD_INFO, + reinterpret_cast<task_info_t>(&dyld_info), &count); + if (kr != KERN_SUCCESS) + return false; + + const struct dyld_all_image_infos* all_image_infos = + reinterpret_cast<const struct dyld_all_image_infos*>( + dyld_info.all_image_info_addr); + + bool emitted_linkedit_from_dyld_shared_cache = false; + for (size_t i = 0; i < all_image_infos->infoArrayCount; i++) { + const char* image_name = all_image_infos->infoArray[i].imageFilePath; + + // The public definition for dyld_all_image_infos/dyld_image_info is wrong + // for 64-bit platforms. We explicitly cast to struct mach_header_64 even + // though the public definition claims that this is a struct mach_header. + const struct mach_header_64* const header = + reinterpret_cast<const struct mach_header_64* const>( + all_image_infos->infoArray[i].imageLoadAddress); + + uint64_t next_command = reinterpret_cast<uint64_t>(header + 1); + uint64_t command_end = next_command + header->sizeofcmds; + uint64_t slide = 0; + for (unsigned int j = 0; j < header->ncmds; ++j) { + // Ensure that next_command doesn't run past header->sizeofcmds. + if (next_command + sizeof(struct load_command) > command_end) + return false; + const struct load_command* load_cmd = + reinterpret_cast<const struct load_command*>(next_command); + next_command += load_cmd->cmdsize; + + if (load_cmd->cmd == LC_SEGMENT_64) { + if (load_cmd->cmdsize < sizeof(segment_command_64)) + return false; + const segment_command_64* seg = + reinterpret_cast<const segment_command_64*>(load_cmd); + if (strcmp(seg->segname, SEG_PAGEZERO) == 0) + continue; + if (strcmp(seg->segname, SEG_TEXT) == 0) { + slide = reinterpret_cast<uint64_t>(header) - seg->vmaddr; + } + + // Avoid emitting LINKEDIT regions in the dyld shared cache, since they + // all overlap. + if (IsAddressInSharedRegion(seg->vmaddr) && + strcmp(seg->segname, SEG_LINKEDIT) == 0) { + if (emitted_linkedit_from_dyld_shared_cache) { + continue; + } else { + emitted_linkedit_from_dyld_shared_cache = true; + image_name = "dyld shared cache combined __LINKEDIT"; + } + } + + uint32_t protection_flags = 0; + if (seg->initprot & VM_PROT_READ) + protection_flags |= VMRegion::kProtectionFlagsRead; + if (seg->initprot & VM_PROT_WRITE) + protection_flags |= VMRegion::kProtectionFlagsWrite; + if (seg->initprot & VM_PROT_EXECUTE) + protection_flags |= VMRegion::kProtectionFlagsExec; + + VMRegion region; + region.size_in_bytes = seg->vmsize; + region.protection_flags = protection_flags; + region.mapped_file = image_name; + region.start_address = slide + seg->vmaddr; + + // We intentionally avoid setting any page information, which is not + // available from dyld. The fields will be populated later. + regions->push_back(region); + } + } + } + return true; +} + +void PopulateByteStats(VMRegion* region, + const vm_region_top_info_data_t& info) { + uint64_t dirty_bytes = + (info.private_pages_resident + info.shared_pages_resident) * PAGE_SIZE; + switch (info.share_mode) { + case SM_LARGE_PAGE: + case SM_PRIVATE: + case SM_COW: + region->byte_stats_private_dirty_resident = dirty_bytes; + case SM_SHARED: + case SM_PRIVATE_ALIASED: + case SM_TRUESHARED: + case SM_SHARED_ALIASED: + region->byte_stats_shared_dirty_resident = dirty_bytes; + break; + case SM_EMPTY: + break; + default: + NOTREACHED(); + break; + } +} + +// Creates VMRegions using mach vm syscalls. Returns whether the operation +// succeeded. +bool GetAllRegions(std::vector<VMRegion>* regions) { + const int pid = getpid(); + task_t task = mach_task_self(); + mach_vm_size_t size = 0; + mach_vm_address_t address = MACH_VM_MIN_ADDRESS; + while (true) { + base::CheckedNumeric<mach_vm_address_t> next_address(address); + next_address += size; + if (!next_address.IsValid()) + return false; + address = next_address.ValueOrDie(); + mach_vm_address_t address_copy = address; + + vm_region_top_info_data_t info; + base::MachVMRegionResult result = + base::GetTopInfo(task, &size, &address, &info); + if (result == base::MachVMRegionResult::Error) + return false; + if (result == base::MachVMRegionResult::Finished) + break; + + vm_region_basic_info_64 basic_info; + mach_vm_size_t dummy_size = 0; + result = base::GetBasicInfo(task, &dummy_size, &address_copy, &basic_info); + if (result == base::MachVMRegionResult::Error) + return false; + if (result == base::MachVMRegionResult::Finished) + break; + + VMRegion region; + PopulateByteStats(®ion, info); + + if (basic_info.protection & VM_PROT_READ) + region.protection_flags |= VMRegion::kProtectionFlagsRead; + if (basic_info.protection & VM_PROT_WRITE) + region.protection_flags |= VMRegion::kProtectionFlagsWrite; + if (basic_info.protection & VM_PROT_EXECUTE) + region.protection_flags |= VMRegion::kProtectionFlagsExec; + + char buffer[MAXPATHLEN]; + int length = proc_regionfilename(pid, address, buffer, MAXPATHLEN); + if (length != 0) + region.mapped_file.assign(buffer, length); + + // There's no way to get swapped or clean bytes without doing a + // very expensive syscalls that crawls every single page in the memory + // object. + region.start_address = address; + region.size_in_bytes = size; + regions->push_back(region); + } + return true; +} + +void AddRegionByteStats(VMRegion* dest, const VMRegion& source) { + dest->byte_stats_private_dirty_resident += + source.byte_stats_private_dirty_resident; + dest->byte_stats_private_clean_resident += + source.byte_stats_private_clean_resident; + dest->byte_stats_shared_dirty_resident += + source.byte_stats_shared_dirty_resident; + dest->byte_stats_shared_clean_resident += + source.byte_stats_shared_clean_resident; + dest->byte_stats_swapped += source.byte_stats_swapped; + dest->byte_stats_proportional_resident += + source.byte_stats_proportional_resident; +} + +} // namespace + +bool ProcessMetricsMemoryDumpProvider::DumpProcessMemoryMaps( + const base::trace_event::MemoryDumpArgs& args, + base::trace_event::ProcessMemoryDump* pmd) { + using VMRegion = base::trace_event::ProcessMemoryMaps::VMRegion; + + std::vector<VMRegion> dyld_regions; + if (!GetDyldRegions(&dyld_regions)) + return false; + std::vector<VMRegion> all_regions; + if (!GetAllRegions(&all_regions)) + return false; + + // Merge information from dyld regions and all regions. + for (const VMRegion& region : all_regions) { + bool skip = false; + const bool in_shared_region = IsAddressInSharedRegion(region.start_address); + for (VMRegion& dyld_region : dyld_regions) { + // If this region is fully contained in a dyld region, then add the bytes + // stats. + if (IsRegionContainedInRegion(region, dyld_region)) { + AddRegionByteStats(&dyld_region, region); + skip = true; + break; + } + + // Check to see if the region is likely used for the dyld shared cache. + if (in_shared_region) { + // This region is likely used for the dyld shared cache. Don't record + // any byte stats since: + // 1. It's not possible to figure out which dyld regions the byte + // stats correspond to. + // 2. The region is likely shared by non-Chrome processes, so there's + // no point in charging the pages towards Chrome. + if (DoRegionsIntersect(region, dyld_region)) { + skip = true; + break; + } + } + } + if (skip) + continue; + pmd->process_mmaps()->AddVMRegion(region); + } + + for (VMRegion& region : dyld_regions) { + pmd->process_mmaps()->AddVMRegion(region); + } + + pmd->set_has_process_mmaps(); + return true; +} +#endif // defined(OS_MACOSX) + +// static +void ProcessMetricsMemoryDumpProvider::RegisterForProcess( + base::ProcessId process) { + std::unique_ptr<ProcessMetricsMemoryDumpProvider> owned_provider; + if (factory_for_testing) { + owned_provider = factory_for_testing(process); + } else { + owned_provider = std::unique_ptr<ProcessMetricsMemoryDumpProvider>( + new ProcessMetricsMemoryDumpProvider(process)); + } + + ProcessMetricsMemoryDumpProvider* provider = owned_provider.get(); + bool did_insert = + g_dump_providers_map.Get() + .insert(std::make_pair(process, std::move(owned_provider))) + .second; + if (!did_insert) { + DLOG(ERROR) << "ProcessMetricsMemoryDumpProvider already registered for " + << (process == base::kNullProcessId + ? "current process" + : "process id " + base::IntToString(process)); + return; + } + base::trace_event::MemoryDumpProvider::Options options; + options.target_pid = process; + options.is_fast_polling_supported = true; + base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( + provider, "ProcessMemoryMetrics", nullptr, options); +} + +// static +void ProcessMetricsMemoryDumpProvider::UnregisterForProcess( + base::ProcessId process) { + auto iter = g_dump_providers_map.Get().find(process); + if (iter == g_dump_providers_map.Get().end()) + return; + base::trace_event::MemoryDumpManager::GetInstance() + ->UnregisterAndDeleteDumpProviderSoon(std::move(iter->second)); + g_dump_providers_map.Get().erase(iter); +} + +ProcessMetricsMemoryDumpProvider::ProcessMetricsMemoryDumpProvider( + base::ProcessId process) + : process_(process), + process_metrics_(CreateProcessMetrics(process)), + is_rss_peak_resettable_(true) {} + +ProcessMetricsMemoryDumpProvider::~ProcessMetricsMemoryDumpProvider() {} + +// Called at trace dump point time. Creates a snapshot of the memory maps for +// the current process. +bool ProcessMetricsMemoryDumpProvider::OnMemoryDump( + const base::trace_event::MemoryDumpArgs& args, + base::trace_event::ProcessMemoryDump* pmd) { + bool res = DumpProcessTotals(args, pmd); + + if (args.level_of_detail == + base::trace_event::MemoryDumpLevelOfDetail::DETAILED) + res &= DumpProcessMemoryMaps(args, pmd); + return res; +} + +bool ProcessMetricsMemoryDumpProvider::DumpProcessTotals( + const base::trace_event::MemoryDumpArgs& args, + base::trace_event::ProcessMemoryDump* pmd) { +#if defined(OS_MACOSX) + size_t private_bytes; + size_t shared_bytes; + size_t resident_bytes; + size_t locked_bytes; + if (!process_metrics_->GetMemoryBytes(&private_bytes, &shared_bytes, + &resident_bytes, &locked_bytes)) { + return false; + } + uint64_t rss_bytes = resident_bytes; + pmd->process_totals()->SetExtraFieldInBytes("private_bytes", private_bytes); + pmd->process_totals()->SetExtraFieldInBytes("shared_bytes", shared_bytes); + pmd->process_totals()->SetExtraFieldInBytes("locked_bytes", locked_bytes); + + base::trace_event::ProcessMemoryTotals::PlatformPrivateFootprint footprint; + base::ProcessMetrics::TaskVMInfo info = process_metrics_->GetTaskVMInfo(); + footprint.phys_footprint_bytes = info.phys_footprint; + footprint.internal_bytes = info.internal; + footprint.compressed_bytes = info.compressed; + + pmd->process_totals()->SetPlatformPrivateFootprint(footprint); +#else + uint64_t rss_bytes = process_metrics_->GetWorkingSetSize(); +#endif // defined(OS_MACOSX) + if (rss_bytes_for_testing) + rss_bytes = rss_bytes_for_testing; + + // rss_bytes will be 0 if the process ended while dumping. + if (!rss_bytes) + return false; + + uint64_t peak_rss_bytes = 0; + +#if defined(OS_LINUX) || defined(OS_ANDROID) + base::trace_event::ProcessMemoryTotals::PlatformPrivateFootprint footprint; + + base::ScopedFD autoclose; + int statm_fd = fast_polling_statm_fd_.get(); + if (statm_fd == -1) { + autoclose = OpenStatm(); + statm_fd = autoclose.get(); + } + if (statm_fd == -1) + return false; + const static size_t page_size = base::GetPageSize(); + uint64_t resident_pages; + uint64_t shared_pages; + bool success = GetResidentAndSharedPagesFromStatmFile( + statm_fd, &resident_pages, &shared_pages); + if (!success) + return false; + + footprint.rss_anon_bytes = (resident_pages - shared_pages) * page_size; + footprint.vm_swap_bytes = process_metrics_->GetVmSwapBytes(); + pmd->process_totals()->SetPlatformPrivateFootprint(footprint); +#endif // defined(OS_LINUX) || defined(OS_ANDROID) + +#if defined(OS_WIN) + { + size_t private_bytes; + base::trace_event::ProcessMemoryTotals::PlatformPrivateFootprint footprint; + process_metrics_->GetMemoryBytes(&private_bytes, nullptr); + footprint.private_bytes = private_bytes; + pmd->process_totals()->SetPlatformPrivateFootprint(footprint); + } +#endif + +#if !defined(OS_IOS) + peak_rss_bytes = process_metrics_->GetPeakWorkingSetSize(); +#if defined(OS_LINUX) || defined(OS_ANDROID) + if (is_rss_peak_resettable_) { + std::string clear_refs_file = + "/proc/" + + (process_ == base::kNullProcessId ? "self" + : base::IntToString(process_)) + + "/clear_refs"; + int clear_refs_fd = open(clear_refs_file.c_str(), O_WRONLY); + if (clear_refs_fd > 0 && + base::WriteFileDescriptor(clear_refs_fd, kClearPeakRssCommand, + sizeof(kClearPeakRssCommand))) { + pmd->process_totals()->set_is_peak_rss_resetable(true); + } else { + is_rss_peak_resettable_ = false; + } + close(clear_refs_fd); + } +#elif defined(OS_WIN) + if (args.level_of_detail == + base::trace_event::MemoryDumpLevelOfDetail::DETAILED) { + uint64_t pss_bytes = 0; + bool res = process_metrics_->GetProportionalSetSizeBytes(&pss_bytes); + if (res) { + base::trace_event::ProcessMemoryMaps::VMRegion region; + region.byte_stats_proportional_resident = pss_bytes; + pmd->process_mmaps()->AddVMRegion(region); + pmd->set_has_process_mmaps(); + } + } + +#endif +#endif // !defined(OS_IOS) + + pmd->process_totals()->set_resident_set_bytes(rss_bytes); + pmd->set_has_process_totals(); + pmd->process_totals()->set_peak_resident_set_bytes(peak_rss_bytes); + + // Returns true even if other metrics failed, since rss is reported. + return true; +} + +#if defined(OS_LINUX) || defined(OS_ANDROID) +base::ScopedFD ProcessMetricsMemoryDumpProvider::OpenStatm() { + std::string name = + "/proc/" + + (process_ == base::kNullProcessId ? "self" + : base::IntToString(process_)) + + "/statm"; + base::ScopedFD fd = base::ScopedFD(open(name.c_str(), O_RDONLY)); + DCHECK(fd.is_valid()); + return fd; +} +#endif // defined(OS_LINUX) || defined(OS_ANDROID) + +void ProcessMetricsMemoryDumpProvider::PollFastMemoryTotal( + uint64_t* memory_total) { + *memory_total = 0; +#if defined(OS_LINUX) || defined(OS_ANDROID) + + int statm_fd = fast_polling_statm_fd_for_testing; + if (statm_fd == -1) { + if (!fast_polling_statm_fd_.is_valid()) + fast_polling_statm_fd_ = OpenStatm(); + statm_fd = fast_polling_statm_fd_.get(); + if (statm_fd == -1) + return; + } + + uint64_t resident_pages = 0; + uint64_t ignored_shared_pages = 0; + if (!GetResidentAndSharedPagesFromStatmFile(statm_fd, &resident_pages, + &ignored_shared_pages)) + return; + + static size_t page_size = base::GetPageSize(); + *memory_total = resident_pages * page_size; +#else + *memory_total = process_metrics_->GetWorkingSetSize(); +#endif +} + +void ProcessMetricsMemoryDumpProvider::SuspendFastMemoryPolling() { +#if defined(OS_LINUX) || defined(OS_ANDROID) + fast_polling_statm_fd_.reset(); +#endif +} + +} // namespace memory_instrumentation
diff --git a/services/resource_coordinator/public/cpp/memory_instrumentation/process_metrics_memory_dump_provider.h b/services/resource_coordinator/public/cpp/memory_instrumentation/process_metrics_memory_dump_provider.h new file mode 100644 index 0000000..1489845 --- /dev/null +++ b/services/resource_coordinator/public/cpp/memory_instrumentation/process_metrics_memory_dump_provider.h
@@ -0,0 +1,95 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +#ifndef SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_INSTRUMENTATION_PROCESS_MEMORY_METRICS_DUMP_PROVIDER_H_ +#define SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_INSTRUMENTATION_PROCESS_MEMORY_METRICS_DUMP_PROVIDER_H_ + +#include <memory> + +#include "base/files/scoped_file.h" +#include "base/gtest_prod_util.h" +#include "base/macros.h" +#include "base/process/process_handle.h" +#include "base/trace_event/memory_dump_provider.h" +#include "build/build_config.h" +#include "services/resource_coordinator/public/cpp/resource_coordinator_export.h" + +namespace base { +class ProcessMetrics; +} + +namespace memory_instrumentation { + +// Dump provider which collects process-wide memory stats. +class SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_EXPORT + ProcessMetricsMemoryDumpProvider + : public base::trace_event::MemoryDumpProvider { + public: + // Pass base::kNullProcessId to register for current process. + static void RegisterForProcess(base::ProcessId process); + static void UnregisterForProcess(base::ProcessId process); + + ~ProcessMetricsMemoryDumpProvider() override; + + // MemoryDumpProvider implementation. + bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, + base::trace_event::ProcessMemoryDump* pmd) override; + void PollFastMemoryTotal(uint64_t* memory_total) override; + void SuspendFastMemoryPolling() override; + + protected: + ProcessMetricsMemoryDumpProvider(base::ProcessId process); + + private: + using FactoryFunction = + std::unique_ptr<ProcessMetricsMemoryDumpProvider> (*)(base::ProcessId); + + FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, + ParseProcSmaps); + FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, DumpRSS); + FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, + TestPollFastMemoryTotal); +#if defined(OS_MACOSX) + FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, + TestMachOReading); + FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, + NoDuplicateRegions); +#elif defined(OS_WIN) + FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, + TestWinModuleReading); +#elif defined(OS_LINUX) || defined(OS_ANDROID) + FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, + DoubleRegister); +#endif + + bool DumpProcessTotals(const base::trace_event::MemoryDumpArgs& args, + base::trace_event::ProcessMemoryDump* pmd); + bool DumpProcessMemoryMaps(const base::trace_event::MemoryDumpArgs& args, + base::trace_event::ProcessMemoryDump* pmd); + + static uint64_t rss_bytes_for_testing; + static FactoryFunction factory_for_testing; + +#if defined(OS_LINUX) || defined(OS_ANDROID) + static FILE* proc_smaps_for_testing; + static int fast_polling_statm_fd_for_testing; + + base::ScopedFD fast_polling_statm_fd_; + + base::ScopedFD OpenStatm(); +#endif + + base::ProcessId process_; + std::unique_ptr<base::ProcessMetrics> process_metrics_; + + // The peak may not be resettable on all the processes if the linux kernel is + // older than http://bit.ly/reset_rss or only on child processes if yama LSM + // sandbox is enabled. + bool is_rss_peak_resettable_; + + DISALLOW_COPY_AND_ASSIGN(ProcessMetricsMemoryDumpProvider); +}; + +} // namespace memory_instrumentation + +#endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_INSTRUMENTATION_PROCESS_MEMORY_METRICS_DUMP_PROVIDER_H_
diff --git a/services/resource_coordinator/public/cpp/memory_instrumentation/process_metrics_memory_dump_provider_unittest.cc b/services/resource_coordinator/public/cpp/memory_instrumentation/process_metrics_memory_dump_provider_unittest.cc new file mode 100644 index 0000000..a9c32497 --- /dev/null +++ b/services/resource_coordinator/public/cpp/memory_instrumentation/process_metrics_memory_dump_provider_unittest.cc
@@ -0,0 +1,414 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "services/resource_coordinator/public/cpp/memory_instrumentation/process_metrics_memory_dump_provider.h" + +#include <stdint.h> + +#include <memory> +#include <unordered_set> + +#include "base/files/file_util.h" +#include "base/memory/ptr_util.h" +#include "base/process/process_metrics.h" +#include "base/trace_event/memory_dump_manager.h" +#include "base/trace_event/process_memory_dump.h" +#include "base/trace_event/process_memory_maps.h" +#include "base/trace_event/process_memory_totals.h" +#include "base/trace_event/trace_event_argument.h" +#include "testing/gtest/include/gtest/gtest.h" + +#if defined(OS_MACOSX) +#include <libgen.h> +#include <mach-o/dyld.h> +#endif + +#if defined(OS_WIN) +#include <base/strings/sys_string_conversions.h> +#endif + +namespace memory_instrumentation { + +#if defined(OS_LINUX) || defined(OS_ANDROID) +namespace { +const char kTestSmaps1[] = + "00400000-004be000 r-xp 00000000 fc:01 1234 /file/1\n" + "Size: 760 kB\n" + "Rss: 296 kB\n" + "Pss: 162 kB\n" + "Shared_Clean: 228 kB\n" + "Shared_Dirty: 0 kB\n" + "Private_Clean: 0 kB\n" + "Private_Dirty: 68 kB\n" + "Referenced: 296 kB\n" + "Anonymous: 68 kB\n" + "AnonHugePages: 0 kB\n" + "Swap: 4 kB\n" + "KernelPageSize: 4 kB\n" + "MMUPageSize: 4 kB\n" + "Locked: 0 kB\n" + "VmFlags: rd ex mr mw me dw sd\n" + "ff000000-ff800000 -w-p 00001080 fc:01 0 /file/name with space\n" + "Size: 0 kB\n" + "Rss: 192 kB\n" + "Pss: 128 kB\n" + "Shared_Clean: 120 kB\n" + "Shared_Dirty: 4 kB\n" + "Private_Clean: 60 kB\n" + "Private_Dirty: 8 kB\n" + "Referenced: 296 kB\n" + "Anonymous: 0 kB\n" + "AnonHugePages: 0 kB\n" + "Swap: 0 kB\n" + "KernelPageSize: 4 kB\n" + "MMUPageSize: 4 kB\n" + "Locked: 0 kB\n" + "VmFlags: rd ex mr mw me dw sd"; + +const char kTestSmaps2[] = + // An invalid region, with zero size and overlapping with the last one + // (See crbug.com/461237). + "7fe7ce79c000-7fe7ce79c000 ---p 00000000 00:00 0 \n" + "Size: 4 kB\n" + "Rss: 0 kB\n" + "Pss: 0 kB\n" + "Shared_Clean: 0 kB\n" + "Shared_Dirty: 0 kB\n" + "Private_Clean: 0 kB\n" + "Private_Dirty: 0 kB\n" + "Referenced: 0 kB\n" + "Anonymous: 0 kB\n" + "AnonHugePages: 0 kB\n" + "Swap: 0 kB\n" + "KernelPageSize: 4 kB\n" + "MMUPageSize: 4 kB\n" + "Locked: 0 kB\n" + "VmFlags: rd ex mr mw me dw sd\n" + // A invalid region with its range going backwards. + "00400000-00200000 ---p 00000000 00:00 0 \n" + "Size: 4 kB\n" + "Rss: 0 kB\n" + "Pss: 0 kB\n" + "Shared_Clean: 0 kB\n" + "Shared_Dirty: 0 kB\n" + "Private_Clean: 0 kB\n" + "Private_Dirty: 0 kB\n" + "Referenced: 0 kB\n" + "Anonymous: 0 kB\n" + "AnonHugePages: 0 kB\n" + "Swap: 0 kB\n" + "KernelPageSize: 4 kB\n" + "MMUPageSize: 4 kB\n" + "Locked: 0 kB\n" + "VmFlags: rd ex mr mw me dw sd\n" + // A good anonymous region at the end. + "7fe7ce79c000-7fe7ce7a8000 ---p 00000000 00:00 0 \n" + "Size: 48 kB\n" + "Rss: 40 kB\n" + "Pss: 32 kB\n" + "Shared_Clean: 16 kB\n" + "Shared_Dirty: 12 kB\n" + "Private_Clean: 8 kB\n" + "Private_Dirty: 4 kB\n" + "Referenced: 40 kB\n" + "Anonymous: 16 kB\n" + "AnonHugePages: 0 kB\n" + "Swap: 0 kB\n" + "KernelPageSize: 4 kB\n" + "MMUPageSize: 4 kB\n" + "Locked: 0 kB\n" + "VmFlags: rd wr mr mw me ac sd\n"; + +const char kTestStatm[] = "200 100 20 2 3 4"; + +void CreateTempFileWithContents(const char* contents, base::ScopedFILE* file) { + base::FilePath temp_path; + FILE* temp_file = CreateAndOpenTemporaryFile(&temp_path); + file->reset(temp_file); + ASSERT_TRUE(temp_file); + + ASSERT_TRUE( + base::WriteFileDescriptor(fileno(temp_file), contents, strlen(contents))); +} + +} // namespace +#endif // defined(OS_LINUX) || defined(OS_ANDROID) + +class MockMemoryDumpProvider : public ProcessMetricsMemoryDumpProvider { + public: + MockMemoryDumpProvider(base::ProcessId process); + ~MockMemoryDumpProvider() override; +}; + +std::unordered_set<MockMemoryDumpProvider*> g_live_mocks; +std::unordered_set<MockMemoryDumpProvider*> g_dead_mocks; + +MockMemoryDumpProvider::MockMemoryDumpProvider(base::ProcessId process) + : ProcessMetricsMemoryDumpProvider(process) { + g_live_mocks.insert(this); +} + +MockMemoryDumpProvider::~MockMemoryDumpProvider() { + g_live_mocks.erase(this); + g_dead_mocks.insert(this); +} + +TEST(ProcessMetricsMemoryDumpProviderTest, DumpRSS) { + const base::trace_event::MemoryDumpArgs high_detail_args = { + base::trace_event::MemoryDumpLevelOfDetail::DETAILED}; + std::unique_ptr<ProcessMetricsMemoryDumpProvider> pmtdp( + new ProcessMetricsMemoryDumpProvider(base::kNullProcessId)); + std::unique_ptr<base::trace_event::ProcessMemoryDump> pmd_before( + new base::trace_event::ProcessMemoryDump(nullptr, high_detail_args)); + std::unique_ptr<base::trace_event::ProcessMemoryDump> pmd_after( + new base::trace_event::ProcessMemoryDump(nullptr, high_detail_args)); + + ProcessMetricsMemoryDumpProvider::rss_bytes_for_testing = 1024; + pmtdp->OnMemoryDump(high_detail_args, pmd_before.get()); + + // Pretend that the RSS of the process increased of +1M. + const size_t kAllocSize = 1048576; + ProcessMetricsMemoryDumpProvider::rss_bytes_for_testing += kAllocSize; + + pmtdp->OnMemoryDump(high_detail_args, pmd_after.get()); + + ProcessMetricsMemoryDumpProvider::rss_bytes_for_testing = 0; + + ASSERT_TRUE(pmd_before->has_process_totals()); + ASSERT_TRUE(pmd_after->has_process_totals()); + + const uint64_t rss_before = + pmd_before->process_totals()->resident_set_bytes(); + const uint64_t rss_after = pmd_after->process_totals()->resident_set_bytes(); + + EXPECT_NE(0U, rss_before); + EXPECT_NE(0U, rss_after); + + EXPECT_EQ(rss_after - rss_before, kAllocSize); +} + +#if defined(OS_LINUX) || defined(OS_ANDROID) +TEST(ProcessMetricsMemoryDumpProviderTest, ParseProcSmaps) { + const uint32_t kProtR = + base::trace_event::ProcessMemoryMaps::VMRegion::kProtectionFlagsRead; + const uint32_t kProtW = + base::trace_event::ProcessMemoryMaps::VMRegion::kProtectionFlagsWrite; + const uint32_t kProtX = + base::trace_event::ProcessMemoryMaps::VMRegion::kProtectionFlagsExec; + const base::trace_event::MemoryDumpArgs dump_args = { + base::trace_event::MemoryDumpLevelOfDetail::DETAILED}; + + std::unique_ptr<ProcessMetricsMemoryDumpProvider> pmmdp( + new ProcessMetricsMemoryDumpProvider(base::kNullProcessId)); + + // Emulate an empty /proc/self/smaps. + base::trace_event::ProcessMemoryDump pmd_invalid(nullptr /* session_state */, + dump_args); + base::ScopedFILE empty_file(OpenFile(base::FilePath("/dev/null"), "r")); + ASSERT_TRUE(empty_file.get()); + ProcessMetricsMemoryDumpProvider::proc_smaps_for_testing = empty_file.get(); + pmmdp->OnMemoryDump(dump_args, &pmd_invalid); + ASSERT_FALSE(pmd_invalid.has_process_mmaps()); + + // Parse the 1st smaps file. + base::trace_event::ProcessMemoryDump pmd_1(nullptr /* session_state */, + dump_args); + base::ScopedFILE temp_file1; + CreateTempFileWithContents(kTestSmaps1, &temp_file1); + ProcessMetricsMemoryDumpProvider::proc_smaps_for_testing = temp_file1.get(); + pmmdp->OnMemoryDump(dump_args, &pmd_1); + ASSERT_TRUE(pmd_1.has_process_mmaps()); + const auto& regions_1 = pmd_1.process_mmaps()->vm_regions(); + ASSERT_EQ(2UL, regions_1.size()); + + EXPECT_EQ(0x00400000UL, regions_1[0].start_address); + EXPECT_EQ(0x004be000UL - 0x00400000UL, regions_1[0].size_in_bytes); + EXPECT_EQ(kProtR | kProtX, regions_1[0].protection_flags); + EXPECT_EQ("/file/1", regions_1[0].mapped_file); + EXPECT_EQ(162 * 1024UL, regions_1[0].byte_stats_proportional_resident); + EXPECT_EQ(228 * 1024UL, regions_1[0].byte_stats_shared_clean_resident); + EXPECT_EQ(0UL, regions_1[0].byte_stats_shared_dirty_resident); + EXPECT_EQ(0UL, regions_1[0].byte_stats_private_clean_resident); + EXPECT_EQ(68 * 1024UL, regions_1[0].byte_stats_private_dirty_resident); + EXPECT_EQ(4 * 1024UL, regions_1[0].byte_stats_swapped); + + EXPECT_EQ(0xff000000UL, regions_1[1].start_address); + EXPECT_EQ(0xff800000UL - 0xff000000UL, regions_1[1].size_in_bytes); + EXPECT_EQ(kProtW, regions_1[1].protection_flags); + EXPECT_EQ("/file/name with space", regions_1[1].mapped_file); + EXPECT_EQ(128 * 1024UL, regions_1[1].byte_stats_proportional_resident); + EXPECT_EQ(120 * 1024UL, regions_1[1].byte_stats_shared_clean_resident); + EXPECT_EQ(4 * 1024UL, regions_1[1].byte_stats_shared_dirty_resident); + EXPECT_EQ(60 * 1024UL, regions_1[1].byte_stats_private_clean_resident); + EXPECT_EQ(8 * 1024UL, regions_1[1].byte_stats_private_dirty_resident); + EXPECT_EQ(0 * 1024UL, regions_1[1].byte_stats_swapped); + + // Parse the 2nd smaps file. + base::trace_event::ProcessMemoryDump pmd_2(nullptr /* session_state */, + dump_args); + base::ScopedFILE temp_file2; + CreateTempFileWithContents(kTestSmaps2, &temp_file2); + ProcessMetricsMemoryDumpProvider::proc_smaps_for_testing = temp_file2.get(); + pmmdp->OnMemoryDump(dump_args, &pmd_2); + ASSERT_TRUE(pmd_2.has_process_mmaps()); + const auto& regions_2 = pmd_2.process_mmaps()->vm_regions(); + ASSERT_EQ(1UL, regions_2.size()); + EXPECT_EQ(0x7fe7ce79c000UL, regions_2[0].start_address); + EXPECT_EQ(0x7fe7ce7a8000UL - 0x7fe7ce79c000UL, regions_2[0].size_in_bytes); + EXPECT_EQ(0U, regions_2[0].protection_flags); + EXPECT_EQ("", regions_2[0].mapped_file); + EXPECT_EQ(32 * 1024UL, regions_2[0].byte_stats_proportional_resident); + EXPECT_EQ(16 * 1024UL, regions_2[0].byte_stats_shared_clean_resident); + EXPECT_EQ(12 * 1024UL, regions_2[0].byte_stats_shared_dirty_resident); + EXPECT_EQ(8 * 1024UL, regions_2[0].byte_stats_private_clean_resident); + EXPECT_EQ(4 * 1024UL, regions_2[0].byte_stats_private_dirty_resident); + EXPECT_EQ(0 * 1024UL, regions_2[0].byte_stats_swapped); +} + +TEST(ProcessMetricsMemoryDumpProviderTest, DoubleRegister) { + auto factory = [](base::ProcessId process) { + return std::unique_ptr<ProcessMetricsMemoryDumpProvider>( + new MockMemoryDumpProvider(process)); + }; + ProcessMetricsMemoryDumpProvider::factory_for_testing = factory; + ProcessMetricsMemoryDumpProvider::RegisterForProcess(1); + ProcessMetricsMemoryDumpProvider::RegisterForProcess(1); + ASSERT_EQ(1u, g_live_mocks.size()); + ASSERT_EQ(1u, g_dead_mocks.size()); + auto* manager = base::trace_event::MemoryDumpManager::GetInstance(); + MockMemoryDumpProvider* live_mock = *g_live_mocks.begin(); + EXPECT_TRUE(manager->IsDumpProviderRegisteredForTesting(live_mock)); + auto* dead_mock = *g_dead_mocks.begin(); + EXPECT_FALSE(manager->IsDumpProviderRegisteredForTesting(dead_mock)); + ProcessMetricsMemoryDumpProvider::UnregisterForProcess(1); + g_live_mocks.clear(); + g_dead_mocks.clear(); +} + +#endif // defined(OS_LINUX) || defined(OS_ANDROID) + +TEST(ProcessMetricsMemoryDumpProviderTest, TestPollFastMemoryTotal) { + ProcessMetricsMemoryDumpProvider mdp(base::kNullProcessId); + + uint64_t total1, total2; + mdp.PollFastMemoryTotal(&total1); + ASSERT_GT(total1, 0u); + size_t kBufSize = 16 * 1024 * 1024; + auto buf = base::MakeUnique<char[]>(kBufSize); + for (size_t i = 0; i < kBufSize; i++) + buf[i] = *((volatile char*)&buf[i]) + 1; + mdp.PollFastMemoryTotal(&total2); + ASSERT_GT(total2, 0u); + EXPECT_GT(total2, total1 + kBufSize / 2); + +#if defined(OS_LINUX) || defined(OS_ANDROID) + EXPECT_GE(mdp.fast_polling_statm_fd_.get(), 0); + + base::ScopedFILE temp_file; + CreateTempFileWithContents(kTestStatm, &temp_file); + mdp.fast_polling_statm_fd_for_testing = fileno(temp_file.get()); + size_t page_size = base::GetPageSize(); + uint64_t value; + mdp.PollFastMemoryTotal(&value); + EXPECT_EQ(100 * page_size, value); + + mdp.SuspendFastMemoryPolling(); + EXPECT_FALSE(mdp.fast_polling_statm_fd_.is_valid()); +#else + mdp.SuspendFastMemoryPolling(); +#endif +} + +#if defined(OS_WIN) + +void DummyFunction() {} + +TEST(ProcessMetricsMemoryDumpProviderTest, TestWinModuleReading) { + using VMRegion = base::trace_event::ProcessMemoryMaps::VMRegion; + + ProcessMetricsMemoryDumpProvider mdp(base::kNullProcessId); + base::trace_event::MemoryDumpArgs args; + base::trace_event::ProcessMemoryDump dump(nullptr, args); + ASSERT_TRUE(mdp.DumpProcessMemoryMaps(args, &dump)); + ASSERT_TRUE(dump.has_process_mmaps()); + + wchar_t module_name[MAX_PATH]; + DWORD result = GetModuleFileName(nullptr, module_name, MAX_PATH); + ASSERT_TRUE(result); + std::string executable_name = base::SysWideToNativeMB(module_name); + + HMODULE module_containing_dummy = nullptr; + uintptr_t dummy_function_address = + reinterpret_cast<uintptr_t>(&DummyFunction); + result = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, + reinterpret_cast<LPCWSTR>(dummy_function_address), + &module_containing_dummy); + ASSERT_TRUE(result); + result = GetModuleFileName(nullptr, module_name, MAX_PATH); + ASSERT_TRUE(result); + std::string module_containing_dummy_name = + base::SysWideToNativeMB(module_name); + + bool found_executable = false; + bool found_region_with_dummy = false; + for (const VMRegion& region : dump.process_mmaps()->vm_regions()) { + EXPECT_NE(0u, region.start_address); + EXPECT_NE(0u, region.size_in_bytes); + + if (region.mapped_file.find(executable_name) != std::string::npos) + found_executable = true; + + if (dummy_function_address >= region.start_address && + dummy_function_address < region.start_address + region.size_in_bytes) { + found_region_with_dummy = true; + EXPECT_EQ(module_containing_dummy_name, region.mapped_file); + } + } + EXPECT_TRUE(found_executable); + EXPECT_TRUE(found_region_with_dummy); +} +#endif + +#if defined(OS_MACOSX) +TEST(ProcessMetricsMemoryDumpProviderTest, TestMachOReading) { + using VMRegion = base::trace_event::ProcessMemoryMaps::VMRegion; + ProcessMetricsMemoryDumpProvider mdp(base::kNullProcessId); + base::trace_event::MemoryDumpArgs args; + base::trace_event::ProcessMemoryDump dump(nullptr, args); + ASSERT_TRUE(mdp.DumpProcessMemoryMaps(args, &dump)); + ASSERT_TRUE(dump.has_process_mmaps()); + uint32_t size = 100; + char full_path[size]; + int result = _NSGetExecutablePath(full_path, &size); + ASSERT_EQ(0, result); + std::string name = basename(full_path); + + uint64_t components_unittests_resident_pages = 0; + bool found_appkit = false; + for (const VMRegion& region : dump.process_mmaps()->vm_regions()) { + EXPECT_NE(0u, region.start_address); + EXPECT_NE(0u, region.size_in_bytes); + + EXPECT_LT(region.size_in_bytes, 1ull << 32); + uint32_t required_protection_flags = + VMRegion::kProtectionFlagsRead | VMRegion::kProtectionFlagsExec; + if (region.mapped_file.find(name) != std::string::npos && + region.protection_flags == required_protection_flags) { + components_unittests_resident_pages += + region.byte_stats_private_dirty_resident + + region.byte_stats_shared_dirty_resident + + region.byte_stats_private_clean_resident + + region.byte_stats_shared_clean_resident; + } + + if (region.mapped_file.find("AppKit") != std::string::npos) { + found_appkit = true; + } + } + EXPECT_GT(components_unittests_resident_pages, 0u); + EXPECT_TRUE(found_appkit); +} + +#endif // defined(OS_MACOSX) +} // namespace memory_instrumentation
diff --git a/services/resource_coordinator/public/interfaces/coordination_unit.mojom b/services/resource_coordinator/public/interfaces/coordination_unit.mojom index c9b50ef9..16a1b54 100644 --- a/services/resource_coordinator/public/interfaces/coordination_unit.mojom +++ b/services/resource_coordinator/public/interfaces/coordination_unit.mojom
@@ -34,6 +34,7 @@ // CoordinationUnitImpl internal key-value store. enum PropertyType { kTest, + kCPUUsage, }; // Key-value pair that corresponds to an entry in the CoordinationUnitImpl's
diff --git a/services/resource_coordinator/resource_coordinator_service.cc b/services/resource_coordinator/resource_coordinator_service.cc index 1b879a9..12a38fa98 100644 --- a/services/resource_coordinator/resource_coordinator_service.cc +++ b/services/resource_coordinator/resource_coordinator_service.cc
@@ -6,13 +6,22 @@ #include <utility> +#include "base/memory/ptr_util.h" +#include "services/resource_coordinator/coordination_unit/tab_signal_generator.h" #include "services/resource_coordinator/service_callbacks_impl.h" #include "services/service_manager/public/cpp/service_context.h" namespace resource_coordinator { std::unique_ptr<service_manager::Service> ResourceCoordinatorService::Create() { - return base::MakeUnique<ResourceCoordinatorService>(); + auto resource_coordinator_service = + base::MakeUnique<ResourceCoordinatorService>(); + + // Register new |CoordinationUnitGraphObserver| implementations here. + resource_coordinator_service->coordination_unit_manager()->RegisterObserver( + base::MakeUnique<TabSignalGenerator>()); + + return resource_coordinator_service; } ResourceCoordinatorService::ResourceCoordinatorService()
diff --git a/services/resource_coordinator/resource_coordinator_service.h b/services/resource_coordinator/resource_coordinator_service.h index a56fda5..c88e81e3 100644 --- a/services/resource_coordinator/resource_coordinator_service.h +++ b/services/resource_coordinator/resource_coordinator_service.h
@@ -41,6 +41,9 @@ return ref_factory_.get(); } ukm::MojoUkmRecorder* ukm_recorder() { return ukm_recorder_.get(); } + CoordinationUnitManager* coordination_unit_manager() { + return &coordination_unit_manager_; + } private: service_manager::BinderRegistry registry_;
diff --git a/services/service_manager/embedder/BUILD.gn b/services/service_manager/embedder/BUILD.gn index ff47b778..231f064 100644 --- a/services/service_manager/embedder/BUILD.gn +++ b/services/service_manager/embedder/BUILD.gn
@@ -8,24 +8,31 @@ "embedded_service_info.h", "embedded_service_runner.cc", "embedded_service_runner.h", - "main.cc", - "main.h", - "main_delegate.cc", - "main_delegate.h", "manifest_utils.cc", "manifest_utils.h", - "process_type.h", - "service_manager_embedder_export.h", - "set_process_title.cc", - "set_process_title.h", - "set_process_title_linux.cc", - "set_process_title_linux.h", - "shared_file_util.cc", - "shared_file_util.h", - "switches.cc", - "switches.h", ] + # iOS embeds the Service Manager but does not use service_manager::Main() (and + # cannot use or even build it as-is). + if (!is_ios) { + sources += [ + "main.cc", + "main.h", + "main_delegate.cc", + "main_delegate.h", + "process_type.h", + "service_manager_embedder_export.h", + "set_process_title.cc", + "set_process_title.h", + "set_process_title_linux.cc", + "set_process_title_linux.h", + "shared_file_util.cc", + "shared_file_util.h", + "switches.cc", + "switches.h", + ] + } + if (is_mac) { sources += [ "mac_init.h", @@ -37,21 +44,30 @@ deps = [ "//base:base_static", - "//base/allocator:features", - "//components/tracing:startup_tracing", - "//ui/base", ] public_deps = [ "//base", - "//mojo/edk/system", - "//services/service_manager/background:lib", "//services/service_manager/public/cpp", - "//services/service_manager/public/cpp/standalone_service", - "//services/service_manager/runner:init", - "//services/service_manager/runner/common", ] + if (!is_ios) { + # deps of ServiceManager::Main and related functionality. + deps += [ + "//base/allocator:features", + "//components/tracing:startup_tracing", + "//ui/base", + ] + + public_deps += [ + "//mojo/edk/system", + "//services/service_manager/background:lib", + "//services/service_manager/public/cpp/standalone_service", + "//services/service_manager/runner:init", + "//services/service_manager/runner/common", + ] + } + defines = [ "SERVICE_MANAGER_EMBEDDER_IMPL" ] }
diff --git a/services/ui/gpu/gpu_main.cc b/services/ui/gpu/gpu_main.cc index 426d901..6b70fcf4 100644 --- a/services/ui/gpu/gpu_main.cc +++ b/services/ui/gpu/gpu_main.cc
@@ -9,7 +9,7 @@ #include "base/message_loop/message_loop.h" #include "base/power_monitor/power_monitor_device_source.h" #include "base/single_thread_task_runner.h" -#include "components/viz/service/display_compositor/gpu_display_provider.h" +#include "components/viz/service/display_embedder/gpu_display_provider.h" #include "components/viz/service/frame_sinks/frame_sink_manager_impl.h" #include "gpu/command_buffer/common/activity_flags.h" #include "gpu/ipc/common/gpu_memory_buffer_support.h"
diff --git a/skia/config/SkUserConfig.h b/skia/config/SkUserConfig.h index d74c8a4..c87c670e 100644 --- a/skia/config/SkUserConfig.h +++ b/skia/config/SkUserConfig.h
@@ -216,8 +216,8 @@ #define SK_SUPPORT_LEGACY_TILED_BITMAPS #endif -#ifndef SK_SUPPORT_LEGACY_2PTCONICAL_GRADIENT -#define SK_SUPPORT_LEGACY_2PTCONICAL_GRADIENT +#ifndef SK_SUPPORT_NONSTD_BLENDMODES +#define SK_SUPPORT_NONSTD_BLENDMODES #endif ///////////////////////// Imported from BUILD.gn and skia_common.gypi
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 9cad5757..c66f1554 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -947,7 +947,8 @@ }, { "args": [ - "--use-gpu-in-tests" + "--use-gpu-in-tests", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": true,
diff --git a/testing/buildbot/chromium.gpu.fyi.json b/testing/buildbot/chromium.gpu.fyi.json index 4a3dcac..87107b1 100644 --- a/testing/buildbot/chromium.gpu.fyi.json +++ b/testing/buildbot/chromium.gpu.fyi.json
@@ -2371,7 +2371,8 @@ { "args": [ "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" + "--test-launcher-retry-limit=0", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": false, @@ -2411,7 +2412,8 @@ { "args": [ "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" + "--test-launcher-retry-limit=0", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": false, @@ -2459,7 +2461,8 @@ }, { "args": [ - "--use-gpu-in-tests" + "--use-gpu-in-tests", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": false, @@ -2840,7 +2843,8 @@ { "args": [ "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" + "--test-launcher-retry-limit=0", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": true, @@ -2888,7 +2892,8 @@ }, { "args": [ - "--use-gpu-in-tests" + "--use-gpu-in-tests", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": true, @@ -3326,7 +3331,8 @@ { "args": [ "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" + "--test-launcher-retry-limit=0", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": true, @@ -3374,7 +3380,8 @@ }, { "args": [ - "--use-gpu-in-tests" + "--use-gpu-in-tests", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": true, @@ -3459,7 +3466,8 @@ { "args": [ "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" + "--test-launcher-retry-limit=0", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": false, @@ -3521,7 +3529,8 @@ }, { "args": [ - "--use-gpu-in-tests" + "--use-gpu-in-tests", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": false, @@ -3929,7 +3938,8 @@ { "args": [ "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" + "--test-launcher-retry-limit=0", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": false, @@ -3991,7 +4001,8 @@ }, { "args": [ - "--use-gpu-in-tests" + "--use-gpu-in-tests", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": false, @@ -4426,7 +4437,8 @@ { "args": [ "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" + "--test-launcher-retry-limit=0", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": false, @@ -4488,7 +4500,8 @@ }, { "args": [ - "--use-gpu-in-tests" + "--use-gpu-in-tests", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": false, @@ -4953,7 +4966,8 @@ { "args": [ "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" + "--test-launcher-retry-limit=0", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": true, @@ -5022,7 +5036,8 @@ }, { "args": [ - "--use-gpu-in-tests" + "--use-gpu-in-tests", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": true,
diff --git a/testing/buildbot/chromium.gpu.json b/testing/buildbot/chromium.gpu.json index 4d562ae7..5f677998 100644 --- a/testing/buildbot/chromium.gpu.json +++ b/testing/buildbot/chromium.gpu.json
@@ -12,7 +12,8 @@ { "args": [ "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" + "--test-launcher-retry-limit=0", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": true, @@ -44,7 +45,8 @@ }, { "args": [ - "--use-gpu-in-tests" + "--use-gpu-in-tests", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": true, @@ -331,7 +333,8 @@ { "args": [ "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" + "--test-launcher-retry-limit=0", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": true, @@ -384,7 +387,8 @@ }, { "args": [ - "--use-gpu-in-tests" + "--use-gpu-in-tests", + "--no-xvfb" ], "swarming": { "can_use_on_swarming_builders": true,
diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json index dc93bd6..2f06781 100644 --- a/testing/buildbot/chromium.linux.json +++ b/testing/buildbot/chromium.linux.json
@@ -3224,7 +3224,15 @@ } ] }, + "Cast Android (dbg)": { + "additional_compile_targets": [ + "cast_shell_apk" + ] + }, "Cast Audio Linux": { + "additional_compile_targets": [ + "cast_shell" + ], "gtest_tests": [ { "swarming": { @@ -3406,6 +3414,9 @@ ] }, "Cast Linux": { + "additional_compile_targets": [ + "cast_shell" + ], "gtest_tests": [ { "swarming": { @@ -3596,6 +3607,12 @@ "all" ] }, + "Linux Builder (dbg)(32)": { + "additional_compile_targets": [ + "google_apis_unittests", + "sync_integration_tests" + ] + }, "Linux Tests": { "gtest_tests": [ {
diff --git a/testing/buildbot/chromium.perf.fyi.json b/testing/buildbot/chromium.perf.fyi.json index 9c4edf9..6ed33aa 100644 --- a/testing/buildbot/chromium.perf.fyi.json +++ b/testing/buildbot/chromium.perf.fyi.json
@@ -713,6 +713,65 @@ }, { "args": [ + "blob_storage.blob_storage", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-chromium" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blob_storage.blob_storage", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build248-m4--device6", + "os": "Android", + "pool": "Chrome-perf-fyi" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "blob_storage.blob_storage", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blob_storage.blob_storage.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build248-m4--device6", + "os": "Android", + "pool": "Chrome-perf-fyi" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "dromaeo.domcoreattr", "-v", "--upload-results", @@ -3338,6 +3397,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-chromium" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build248-m4--device2", + "os": "Android", + "pool": "Chrome-perf-fyi" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build248-m4--device2", + "os": "Android", + "pool": "Chrome-perf-fyi" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_url.cold.startup_pages", "-v", "--upload-results", @@ -8427,6 +8545,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:22b1", + "id": "build48-b4", + "os": "Windows-10-10586", + "pool": "Chrome-perf-fyi" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:22b1", + "id": "build48-b4", + "os": "Windows-10-10586", + "pool": "Chrome-perf-fyi" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_ext.cold.blank_page", "-v", "--upload-results", @@ -13377,6 +13554,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:9874", + "id": "build221-b4", + "os": "Windows-10-10586", + "pool": "Chrome-perf-fyi" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:9874", + "id": "build221-b4", + "os": "Windows-10-10586", + "pool": "Chrome-perf-fyi" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_ext.cold.blank_page", "-v", "--upload-results",
diff --git a/testing/buildbot/chromium.perf.json b/testing/buildbot/chromium.perf.json index 291a048a..bccb223 100644 --- a/testing/buildbot/chromium.perf.json +++ b/testing/buildbot/chromium.perf.json
@@ -717,6 +717,65 @@ } }, { + "args": [ + "blob_storage.blob_storage", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-chromium" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blob_storage.blob_storage", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build14-b1--device6", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "blob_storage.blob_storage", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blob_storage.blob_storage.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build14-b1--device6", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { "args": [], "isolate_name": "cc_perftests", "name": "cc_perftests", @@ -3383,6 +3442,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-chromium" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build14-b1--device2", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build14-b1--device2", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_url.cold.startup_pages", "-v", "--upload-results", @@ -5472,6 +5590,65 @@ }, { "args": [ + "blob_storage.blob_storage", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-chromium" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blob_storage.blob_storage", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build74-b1--device6", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "blob_storage.blob_storage", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blob_storage.blob_storage.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build74-b1--device6", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "dromaeo.domcoreattr", "-v", "--upload-results", @@ -8117,6 +8294,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-chromium" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build74-b1--device2", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build74-b1--device2", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_url.cold.startup_pages", "-v", "--upload-results", @@ -9858,6 +10094,36 @@ }, { "args": [ + "blob_storage.blob_storage", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-webview", + "--webview-embedder-apk=../../out/Release/apks/SystemWebViewShell.apk" + ], + "isolate_name": "telemetry_perf_webview_tests", + "name": "blob_storage.blob_storage", + "override_compile_targets": [ + "telemetry_perf_webview_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build166-b1--device7", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ "dromaeo.domcoreattr", "-v", "--upload-results", @@ -11208,6 +11474,36 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-webview", + "--webview-embedder-apk=../../out/Release/apks/SystemWebViewShell.apk" + ], + "isolate_name": "telemetry_perf_webview_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_webview_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build166-b1--device3", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_url.cold.startup_pages", "-v", "--upload-results", @@ -12609,6 +12905,65 @@ } }, { + "args": [ + "blob_storage.blob_storage", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-chromium" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blob_storage.blob_storage", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build16-b1--device6", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "blob_storage.blob_storage", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blob_storage.blob_storage.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build16-b1--device6", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { "args": [], "isolate_name": "cc_perftests", "name": "cc_perftests", @@ -15275,6 +15630,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-chromium" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build16-b1--device2", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build16-b1--device2", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_url.cold.startup_pages", "-v", "--upload-results", @@ -17016,6 +17430,36 @@ }, { "args": [ + "blob_storage.blob_storage", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-webview", + "--webview-embedder-apk=../../out/Release/apks/SystemWebViewShell.apk" + ], + "isolate_name": "telemetry_perf_webview_tests", + "name": "blob_storage.blob_storage", + "override_compile_targets": [ + "telemetry_perf_webview_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build114-b1--device7", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ "dromaeo.domcoreattr", "-v", "--upload-results", @@ -18366,6 +18810,36 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-webview", + "--webview-embedder-apk=../../out/Release/apks/SystemWebViewShell.apk" + ], + "isolate_name": "telemetry_perf_webview_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_webview_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build114-b1--device3", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_url.cold.startup_pages", "-v", "--upload-results", @@ -19767,6 +20241,65 @@ } }, { + "args": [ + "blob_storage.blob_storage", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-chromium" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blob_storage.blob_storage", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build10-b1--device6", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "blob_storage.blob_storage", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blob_storage.blob_storage.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build10-b1--device6", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { "args": [], "isolate_name": "cc_perftests", "name": "cc_perftests", @@ -22433,6 +22966,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-chromium" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build10-b1--device2", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build10-b1--device2", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_url.cold.startup_pages", "-v", "--upload-results", @@ -24522,6 +25114,65 @@ }, { "args": [ + "blob_storage.blob_storage", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-chromium" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blob_storage.blob_storage", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build18-b1--device7", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "blob_storage.blob_storage", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blob_storage.blob_storage.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build18-b1--device7", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "dromaeo.domcoreattr", "-v", "--upload-results", @@ -27167,6 +27818,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-chromium" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build47-b1--device1", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build47-b1--device1", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_url.cold.startup_pages", "-v", "--upload-results", @@ -28550,3775 +29260,7 @@ ] }, "Linux Perf": { - "isolated_scripts": [ - { - "args": [ - "battor.trivial_pages", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "battor.trivial_pages", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "battor.trivial_pages", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "battor.trivial_pages.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "blink_perf.bindings", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "blink_perf.bindings", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "blink_perf.bindings", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "blink_perf.bindings.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "blink_perf.canvas", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "blink_perf.canvas", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "blink_perf.canvas", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "blink_perf.canvas.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "blink_perf.dom", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "blink_perf.dom", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "blink_perf.dom", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "blink_perf.dom.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "blink_perf.layout", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "blink_perf.layout", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "blink_perf.layout", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "blink_perf.layout.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "blink_perf.paint", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "blink_perf.paint", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "blink_perf.paint", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "blink_perf.paint.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "blink_perf.parser", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "blink_perf.parser", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "blink_perf.parser", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "blink_perf.parser.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "blink_perf.svg", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "blink_perf.svg", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "blink_perf.svg", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "blink_perf.svg.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "blob_storage.blob_storage", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "blob_storage.blob_storage", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "blob_storage.blob_storage", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "blob_storage.blob_storage.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "dromaeo.domcoreattr", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "dromaeo.domcoreattr", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "dromaeo.domcoreattr", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "dromaeo.domcoreattr.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "dromaeo.domcoremodify", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "dromaeo.domcoremodify", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "dromaeo.domcoremodify", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "dromaeo.domcoremodify.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "dromaeo.domcorequery", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "dromaeo.domcorequery", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "dromaeo.domcorequery", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "dromaeo.domcorequery.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "dromaeo.domcoretraverse", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "dromaeo.domcoretraverse", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "dromaeo.domcoretraverse", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "dromaeo.domcoretraverse.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "dummy_benchmark.noisy_benchmark_1", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "dummy_benchmark.noisy_benchmark_1", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "dummy_benchmark.noisy_benchmark_1", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "dummy_benchmark.noisy_benchmark_1.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "dummy_benchmark.stable_benchmark_1", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "dummy_benchmark.stable_benchmark_1", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "dummy_benchmark.stable_benchmark_1", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "dummy_benchmark.stable_benchmark_1.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "image_decoding.image_decoding_measurement", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "image_decoding.image_decoding_measurement", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "image_decoding.image_decoding_measurement", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "image_decoding.image_decoding_measurement.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "jetstream", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "jetstream", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "jetstream", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "jetstream.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [], - "isolate_name": "load_library_perf_tests", - "name": "load_library_perf_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "loading.desktop", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "loading.desktop", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "loading.desktop", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "loading.desktop.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "media.tough_video_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "media.tough_video_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "media.tough_video_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "media.tough_video_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [], - "isolate_name": "media_perftests", - "name": "media_perftests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "memory.desktop", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "memory.desktop", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "memory.desktop", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "memory.desktop.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "memory.long_running_idle_gmail_background_tbmv2", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "memory.long_running_idle_gmail_background_tbmv2", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "memory.long_running_idle_gmail_background_tbmv2", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "memory.long_running_idle_gmail_background_tbmv2.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [], - "isolate_name": "net_perftests", - "name": "net_perftests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "octane", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "octane", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "octane", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "octane.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "oortonline", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "oortonline", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "oortonline", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "oortonline.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "oortonline_tbmv2", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "oortonline_tbmv2", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "oortonline_tbmv2", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "oortonline_tbmv2.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "page_cycler_v2.basic_oopif", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "page_cycler_v2.basic_oopif", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "page_cycler_v2.basic_oopif", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "page_cycler_v2.basic_oopif.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "power.idle_platform", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "power.idle_platform", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "power.steady_state", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "power.steady_state", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "power.steady_state", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "power.steady_state.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "power.trivial_pages", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "power.trivial_pages", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "power.trivial_pages", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "power.trivial_pages.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "rasterize_and_record_micro.top_25", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "rasterize_and_record_micro.top_25", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "rasterize_and_record_micro.top_25", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "rasterize_and_record_micro.top_25.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "scheduler.tough_scheduling_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "scheduler.tough_scheduling_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "scheduler.tough_scheduling_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "scheduler.tough_scheduling_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "service_worker.service_worker", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "service_worker.service_worker", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "service_worker.service_worker", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "service_worker.service_worker.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "service_worker.service_worker_micro_benchmark", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "service_worker.service_worker_micro_benchmark", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "service_worker.service_worker_micro_benchmark", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "service_worker.service_worker_micro_benchmark.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.gpu_rasterization.tough_filters_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.gpu_rasterization.tough_filters_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.gpu_rasterization.tough_filters_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.gpu_rasterization.tough_filters_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.gpu_rasterization_and_decoding.image_decoding_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.gpu_rasterization_and_decoding.image_decoding_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.gpu_rasterization_and_decoding.image_decoding_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.gpu_rasterization_and_decoding.image_decoding_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.image_decoding_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.image_decoding_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.image_decoding_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.image_decoding_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.key_desktop_move_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.key_desktop_move_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.key_desktop_move_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.key_desktop_move_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.scrolling_tough_ad_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.scrolling_tough_ad_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.scrolling_tough_ad_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.scrolling_tough_ad_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.tough_ad_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.tough_ad_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.tough_ad_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.tough_ad_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.tough_canvas_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.tough_canvas_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.tough_canvas_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.tough_canvas_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.tough_filters_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.tough_filters_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.tough_filters_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.tough_filters_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.tough_image_decode_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.tough_image_decode_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.tough_image_decode_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.tough_image_decode_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.tough_path_rendering_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.tough_path_rendering_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.tough_path_rendering_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.tough_path_rendering_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.tough_scrolling_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.tough_scrolling_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.tough_scrolling_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.tough_scrolling_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.tough_webgl_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.tough_webgl_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.tough_webgl_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.tough_webgl_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "speedometer", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "speedometer", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "speedometer", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "speedometer.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "start_with_ext.cold.blank_page", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "start_with_ext.cold.blank_page", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "start_with_ext.cold.blank_page", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "start_with_ext.cold.blank_page.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "startup.cold.blank_page", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "startup.cold.blank_page", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "startup.cold.blank_page", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "startup.cold.blank_page.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "startup.large_profile.warm.blank_page", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "startup.large_profile.warm.blank_page", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "startup.large_profile.warm.blank_page", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "startup.large_profile.warm.blank_page.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "startup.warm.blank_page", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "startup.warm.blank_page", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "startup.warm.blank_page", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "startup.warm.blank_page.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "storage.indexeddb_endure", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "storage.indexeddb_endure", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "storage.indexeddb_endure", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "storage.indexeddb_endure.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "storage.indexeddb_endure_tracing", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "storage.indexeddb_endure_tracing", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "storage.indexeddb_endure_tracing", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "storage.indexeddb_endure_tracing.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "system_health.memory_desktop", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "system_health.memory_desktop", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "system_health.memory_desktop", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "system_health.memory_desktop.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "tab_switching.typical_25", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "tab_switching.typical_25", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "tab_switching.typical_25", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "tab_switching.typical_25.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "thread_times.tough_compositor_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "thread_times.tough_compositor_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "thread_times.tough_compositor_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "thread_times.tough_compositor_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "thread_times.tough_scrolling_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "thread_times.tough_scrolling_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "thread_times.tough_scrolling_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "thread_times.tough_scrolling_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "tracing.tracing_with_background_memory_infra", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "tracing.tracing_with_background_memory_infra", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "tracing.tracing_with_background_memory_infra", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "tracing.tracing_with_background_memory_infra.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "tracing.tracing_with_debug_overhead", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "tracing.tracing_with_debug_overhead", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "tracing.tracing_with_debug_overhead", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "tracing.tracing_with_debug_overhead.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build148-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [], - "isolate_name": "tracing_perftests", - "name": "tracing_perftests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build150-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.browsing_desktop", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.browsing_desktop", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.browsing_desktop", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.browsing_desktop.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.detached_context_age_in_gc", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.detached_context_age_in_gc", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.detached_context_age_in_gc", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.detached_context_age_in_gc.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.runtime_stats.top_25", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.runtime_stats.top_25", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.runtime_stats.top_25", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.runtime_stats.top_25.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.runtimestats.browsing_desktop", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.runtimestats.browsing_desktop", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.runtimestats.browsing_desktop", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.runtimestats.browsing_desktop.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build151-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ - "webrtc", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "webrtc", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "webrtc", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "webrtc.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build149-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - } - ] + "isolated_scripts": [] }, "Mac 10.11 Perf": { "isolated_scripts": [ @@ -35972,6 +32914,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0166", + "id": "build104-b1", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0166", + "id": "build104-b1", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_ext.cold.blank_page", "-v", "--upload-results", @@ -38984,6 +35985,26 @@ } }, { + "args": [], + "isolate_name": "net_perftests", + "name": "net_perftests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "id": "build159-m1", + "os": "Mac-10.12", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { "args": [ "octane", "-v", @@ -40902,6 +37923,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "id": "build160-m1", + "os": "Mac-10.12", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "id": "build160-m1", + "os": "Mac-10.12", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_ext.cold.blank_page", "-v", "--upload-results", @@ -45852,6 +42932,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:1626", + "id": "build125-b1", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:1626", + "id": "build125-b1", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_ext.cold.blank_page", "-v", "--upload-results", @@ -50782,6 +47921,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a26", + "id": "build26-b1", + "os": "Mac-10.12", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a26", + "id": "build26-b1", + "os": "Mac-10.12", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_ext.cold.blank_page", "-v", "--upload-results", @@ -55732,6 +52930,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "id": "build130-b1", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "id": "build130-b1", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_ext.cold.blank_page", "-v", "--upload-results", @@ -60682,6 +57939,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build6-b1", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build6-b1", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_ext.cold.blank_page", "-v", "--upload-results", @@ -65612,6 +62928,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:1616", + "id": "build119-b1", + "os": "Windows-10-10240", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:1616", + "id": "build119-b1", + "os": "Windows-10-10240", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_ext.cold.blank_page", "-v", "--upload-results", @@ -70562,6 +67937,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0534", + "id": "build134-m1", + "os": "Windows-10-10240", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0534", + "id": "build134-m1", + "os": "Windows-10-10240", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_ext.cold.blank_page", "-v", "--upload-results", @@ -75572,6 +73006,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6613", + "id": "build103-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6613", + "id": "build103-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_ext.cold.blank_page", "-v", "--upload-results", @@ -80562,6 +78055,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:041a", + "id": "build166-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:041a", + "id": "build166-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_ext.cold.blank_page", "-v", "--upload-results", @@ -85552,6 +83104,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:104a", + "id": "build94-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:104a", + "id": "build94-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_ext.cold.blank_page", "-v", "--upload-results", @@ -90522,6 +88133,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0532", + "id": "build187-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0532", + "id": "build187-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_ext.cold.blank_page", "-v", "--upload-results", @@ -95492,6 +93162,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0532", + "id": "build140-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0532", + "id": "build140-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_ext.cold.blank_page", "-v", "--upload-results", @@ -100482,6 +98211,65 @@ }, { "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0532", + "id": "build145-m1", + "os": "Windows-2012ServerR2-SP0", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "speedometer2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "speedometer2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0532", + "id": "build145-m1", + "os": "Windows-2012ServerR2-SP0", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "start_with_ext.cold.blank_page", "-v", "--upload-results",
diff --git a/testing/buildbot/filters/fuchsia.base_unittests.filter b/testing/buildbot/filters/fuchsia.base_unittests.filter index ff9857b..790bf9b 100644 --- a/testing/buildbot/filters/fuchsia.base_unittests.filter +++ b/testing/buildbot/filters/fuchsia.base_unittests.filter
@@ -128,6 +128,3 @@ # TaskScheduler is racy, causing bot instability: https://crbug.com/735701. -*TaskScheduler* - -# Flaky on waterfall bot, https://crbug.com/738275 --MessageLoopForIOOnMainThread/FileDescriptorWatcherTest.*
diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl index 2b6a3bd..f682d53a 100644 --- a/testing/buildbot/gn_isolate_map.pyl +++ b/testing/buildbot/gn_isolate_map.pyl
@@ -117,8 +117,7 @@ }, "angle_unittests": { "label": "//third_party/angle/src/tests:angle_unittests", - "type": "raw", - "args": [], + "type": "console_test_launcher", }, "app_list_unittests": { "label": "//ui/app_list:app_list_unittests", @@ -319,10 +318,6 @@ "label": "//:chromium_builder_perf", "type": "additional_compile_target", }, - "chromium_builder_tests": { - "label": "//:chromium_builder_tests", - "type": "additional_compile_target", - }, "chromium_swarm_tests": { "label": "//:chromium_swarm_tests", "type": "additional_compile_target", @@ -491,8 +486,7 @@ }, "gl_unittests": { "label": "//ui/gl:gl_unittests", - "type": "raw", - "args": [], + "type": "console_test_launcher", }, "gl_unittests_ozone": { "label": "//ui/gl:gl_unittests_ozone",
diff --git a/testing/buildbot/manage.py b/testing/buildbot/manage.py index 8751b30..2015442 100755 --- a/testing/buildbot/manage.py +++ b/testing/buildbot/manage.py
@@ -145,7 +145,6 @@ 'chrome_official_builder_no_unittests', 'chromium_builder_asan', 'chromium_builder_perf', - 'chromium_builder_tests', 'chromium_swarm_tests', 'chromiumos_preflight', 'mini_installer',
diff --git a/testing/test.gni b/testing/test.gni index 36e0d91..64619b3 100644 --- a/testing/test.gni +++ b/testing/test.gni
@@ -63,7 +63,7 @@ # the default shared_library configs rather than executable configs. configs -= [ "//build/config:shared_library_config", - "//build/config/android:hide_all_but_jni_onload", + "//build/config/android:hide_all_but_jni", ] configs += [ "//build/config:executable_config" ] @@ -321,6 +321,8 @@ set_defaults("test") { if (is_android) { configs = default_shared_library_configs + configs -= [ "//build/config/android:hide_all_but_jni_onload" ] + configs += [ "//build/config/android:hide_all_but_jni" ] } else { configs = default_executable_configs }
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index d819d2c..9c3385a 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -1783,7 +1783,6 @@ { "platforms": [ "linux", - "mac", "win" ], "experiments": [
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG index c8d44709..a785468 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
@@ -229,16 +229,10 @@ crbug.com/591099 animations/3d/change-transform-in-end-event.html [ Failure Pass ] crbug.com/591099 animations/3d/state-at-end-event-transform.html [ Failure Pass ] crbug.com/591099 animations/animation-css-rule-types.html [ Failure ] -crbug.com/591099 animations/animation-end-event-destroy-renderer.html [ Failure ] crbug.com/591099 animations/animation-events-create.html [ Failure ] crbug.com/591099 animations/animation-inherit-initial-unprefixed.html [ Failure ] -crbug.com/591099 animations/animation-iteration-event-destroy-renderer.html [ Failure ] -crbug.com/591099 animations/animation-on-inline-crash.html [ Failure ] -crbug.com/591099 animations/animation-start-event-destroy-renderer.html [ Failure ] crbug.com/591099 animations/animations-parsing.html [ Timeout ] crbug.com/591099 animations/animations-responsive-to-color-change.html [ Crash ] -crbug.com/591099 animations/base-render-style-crash.html [ Crash ] -crbug.com/591099 animations/checkbox-padding-animation-crash.html [ Crash ] crbug.com/591099 animations/clear-svg-animation-effects.html [ Crash ] crbug.com/591099 animations/composition/background-position-composition.html [ Crash ] crbug.com/591099 animations/composition/caret-color-composition.html [ Crash ] @@ -250,11 +244,6 @@ crbug.com/591099 animations/display-inline-style-adjust.html [ Failure ] crbug.com/591099 animations/display-none-cancel-computedstyle.html [ Failure ] crbug.com/591099 animations/display-none-terminates-animation.html [ Failure ] -crbug.com/591099 animations/element-animate-float-crash.html [ Failure Pass ] -crbug.com/591099 animations/empty-keyframe-animation-composited.html [ Failure ] -crbug.com/591099 animations/empty-keyframes-composited.html [ Failure ] -crbug.com/591099 animations/empty-keyframes.html [ Failure ] -crbug.com/591099 animations/import-crash.html [ Failure ] crbug.com/591099 animations/inline-element-animation-end-hit-test.html [ Failure ] crbug.com/591099 animations/interpolation/backdrop-filter-interpolation.html [ Crash ] crbug.com/591099 animations/interpolation/background-color-interpolation.html [ Crash ] @@ -344,17 +333,32 @@ crbug.com/591099 animations/keyframes-cssom-unprefixed-02.html [ Failure ] crbug.com/591099 animations/keyframes-rule.html [ Failure ] crbug.com/591099 animations/lazy-detached-animation-stop.html [ Failure ] -crbug.com/591099 animations/length-zero-percent-crash.html [ Failure Pass ] crbug.com/591099 animations/negative-delay-events.html [ Failure ] -crbug.com/591099 animations/option-element-crash.html [ Crash ] -crbug.com/591099 animations/option-opacity-inherit-crash.html [ Crash ] -crbug.com/591099 animations/pause-crash.html [ Failure ] crbug.com/591099 animations/play-state-initially-paused-start-event.html [ Failure ] crbug.com/591099 animations/play-state.html [ Failure ] crbug.com/591099 animations/responsive/d-responsive.html [ Crash ] crbug.com/591099 animations/responsive/line-height-responsive.html [ Pass Timeout ] crbug.com/591099 animations/rotate-transform-equivalent.html [ Failure ] crbug.com/591099 animations/skew-notsequential-compositor.html [ Failure ] +crbug.com/591099 animations/stability/animation-end-event-destroy-renderer.html [ Failure ] +crbug.com/591099 animations/stability/animation-iteration-event-destroy-renderer.html [ Failure ] +crbug.com/591099 animations/stability/animation-on-inline-crash.html [ Failure ] +crbug.com/591099 animations/stability/animation-start-event-destroy-renderer.html [ Failure ] +crbug.com/591099 animations/stability/base-render-style-crash.html [ Crash ] +crbug.com/591099 animations/stability/checkbox-padding-animation-crash.html [ Crash ] +crbug.com/591099 animations/stability/element-animate-float-crash.html [ Failure Pass ] +crbug.com/591099 animations/stability/empty-keyframe-animation-composited.html [ Failure ] +crbug.com/591099 animations/stability/empty-keyframes-composited.html [ Failure ] +crbug.com/591099 animations/stability/empty-keyframes.html [ Failure ] +crbug.com/591099 animations/stability/import-crash.html [ Failure ] +crbug.com/591099 animations/stability/length-zero-percent-crash.html [ Failure Pass ] +crbug.com/591099 animations/stability/option-element-crash.html [ Crash ] +crbug.com/591099 animations/stability/option-opacity-inherit-crash.html [ Crash ] +crbug.com/591099 animations/stability/pause-crash.html [ Failure ] +crbug.com/591099 animations/stability/svg-element-css-animation-crash.html [ Crash ] +crbug.com/591099 animations/stability/svg-length-unittype-crash.html [ Crash ] +crbug.com/591099 animations/stability/zero-duration-infinite-iterations.html [ Failure ] +crbug.com/591099 animations/stability/zero-duration-large-start-delay.html [ Failure ] crbug.com/591099 animations/state-at-end-event.html [ Failure Pass ] crbug.com/591099 animations/svg-attribute-composition/svg-amplitude-composition.html [ Crash ] crbug.com/591099 animations/svg-attribute-composition/svg-azimuth-composition.html [ Crash ] @@ -503,13 +507,9 @@ crbug.com/591099 animations/svg-attribute-responsive/svg-tableValues-responsive.html [ Crash ] crbug.com/591099 animations/svg-attribute-responsive/svg-transform-responsive.html [ Crash ] crbug.com/591099 animations/svg-attribute-responsive/svg-x-list-responsive.html [ Crash ] -crbug.com/591099 animations/svg-element-css-animation-crash.html [ Crash ] -crbug.com/591099 animations/svg-length-unittype-crash.html [ Crash ] crbug.com/591099 animations/svg-presentation-attribute-animation.html [ Crash ] crbug.com/591099 animations/svg-responsive-to-timing-updates.html [ Crash ] crbug.com/591099 animations/timing-model.html [ Pass Timeout ] -crbug.com/591099 animations/zero-duration-infinite-iterations.html [ Failure ] -crbug.com/591099 animations/zero-duration-large-start-delay.html [ Failure ] crbug.com/591099 battery-status/api-defined.html [ Failure ] crbug.com/591099 battery-status/detached-no-crash.html [ Failure ] crbug.com/591099 battery-status/multiple-promises-after-resolve.html [ Failure ] @@ -874,10 +874,10 @@ crbug.com/591099 compositing/visibility/visibility-image-layers-dynamic.html [ Failure ] crbug.com/591099 compositing/visibility/visibility-on-distant-descendant.html [ Failure ] crbug.com/591099 compositing/webgl/webgl-background-color.html [ Failure ] -crbug.com/591099 compositing/webgl/webgl-no-alpha.html [ Failure ] +crbug.com/591099 compositing/webgl/webgl-no-alpha.html [ Failure Pass ] crbug.com/591099 compositing/webgl/webgl-nonpremultiplied-blend.html [ Failure ] crbug.com/591099 compositing/webgl/webgl-reflection.html [ Failure ] -crbug.com/591099 compositing/webgl/webgl-repaint.html [ Failure ] +crbug.com/591099 compositing/webgl/webgl-repaint.html [ Failure Pass ] crbug.com/591099 compositing/will-change/composited-layers.html [ Failure Pass ] crbug.com/591099 compositing/will-change/parse-will-change.html [ Failure ] crbug.com/591099 compositing/z-order/collect-layers-does-not-initialize-pos-z-order-list.html [ Failure ] @@ -1649,7 +1649,7 @@ crbug.com/591099 css2.1/t170602-bdr-conflct-w-99-d.html [ Failure Pass ] crbug.com/591099 css3/background/background-color-gradient-alignment.html [ Failure Pass ] crbug.com/591099 css3/background/background-large-position-and-size-remains-stable.html [ Failure ] -crbug.com/591099 css3/background/background-positioning-area-vrl.html [ Failure ] +crbug.com/591099 css3/background/background-positioning-area-vrl.html [ Failure Pass ] crbug.com/591099 css3/blending/background-blend-mode-crossfade-image-gradient.html [ Failure ] crbug.com/591099 css3/blending/background-blend-mode-data-uri-svg-image.html [ Failure Pass ] crbug.com/591099 css3/blending/background-blend-mode-default-value.html [ Failure Pass ] @@ -1670,9 +1670,13 @@ crbug.com/591099 css3/blending/background-blend-mode-separate-layer-declaration.html [ Failure Pass ] crbug.com/591099 css3/blending/background-blend-mode-single-layer-no-blending.html [ Failure Pass ] crbug.com/591099 css3/blending/background-blend-mode-svg-color.html [ Failure ] +crbug.com/591099 css3/blending/background-blend-mode-tiled-gradient.html [ Failure ] crbug.com/591099 css3/blending/blend-mode-property-parsing-invalid.html [ Failure ] crbug.com/591099 css3/blending/blend-mode-property-parsing.html [ Failure ] crbug.com/591099 css3/blending/blend-mode-property.html [ Failure ] +crbug.com/591099 css3/blending/effect-background-blend-mode-stacking.html [ Failure ] +crbug.com/591099 css3/blending/effect-background-blend-mode-tiled.html [ Failure ] +crbug.com/591099 css3/blending/effect-background-blend-mode.html [ Failure ] crbug.com/591099 css3/blending/mix-blend-mode-2nd-stacking-context-composited.html [ Crash ] crbug.com/591099 css3/blending/mix-blend-mode-composited-layers.html [ Failure Pass ] crbug.com/591099 css3/blending/mix-blend-mode-composited-reason-children.html [ Crash ] @@ -1711,6 +1715,8 @@ crbug.com/591099 css3/calc/simple-calcs-prefixed.html [ Failure ] crbug.com/591099 css3/calc/simple-calcs.html [ Failure ] crbug.com/591099 css3/calc/table-calcs.html [ Failure ] +crbug.com/591099 css3/calc/transition-crash3.html [ Failure ] +crbug.com/591099 css3/calc/transition-crash4.html [ Failure ] crbug.com/591099 css3/calc/zoom-with-em.html [ Failure ] crbug.com/591099 css3/css3-modsel-33.html [ Failure ] crbug.com/591099 css3/css3-modsel-35.html [ Failure Pass ] @@ -1772,6 +1778,7 @@ crbug.com/591099 css3/filters/filter-animation-multi-hw.html [ Crash ] crbug.com/591099 css3/filters/filter-animation-multi.html [ Crash ] crbug.com/591099 css3/filters/filter-animation.html [ Crash ] +crbug.com/591099 css3/filters/filter-change-repaint-composited.html [ Failure ] crbug.com/591099 css3/filters/filter-repaint-shadow-clipped.html [ Failure ] crbug.com/591099 css3/filters/filter-repaint-shadow-rotated.html [ Failure ] crbug.com/591099 css3/filters/filter-with-opacity-and-children.html [ Failure ] @@ -1829,6 +1836,7 @@ crbug.com/591099 css3/flexbox/min-size-auto.html [ Crash ] crbug.com/591099 css3/flexbox/multiline-align-self.html [ Failure ] crbug.com/591099 css3/flexbox/multiline-reverse-wrap-baseline.html [ Failure ] +crbug.com/591099 css3/flexbox/multiline-shrink-to-fit.html [ Failure ] crbug.com/591099 css3/flexbox/negative-flex-rounding-assert.html [ Failure ] crbug.com/591099 css3/flexbox/nested-stretch.html [ Failure ] crbug.com/591099 css3/flexbox/overflow-auto-dynamic-changes.html [ Failure ] @@ -3106,7 +3114,6 @@ crbug.com/591099 dom/legacy_dom_conformance/xhtml/level2/html/HTMLImageElement04.xhtml [ Crash Pass ] crbug.com/591099 dom/legacy_dom_conformance/xhtml/level2/html/HTMLImageElement05.xhtml [ Crash ] crbug.com/591099 dom/legacy_dom_conformance/xhtml/level2/html/HTMLImageElement07.xhtml [ Crash Pass ] -crbug.com/591099 dom/legacy_dom_conformance/xhtml/level2/html/HTMLImageElement08.xhtml [ Crash Pass ] crbug.com/591099 dom/legacy_dom_conformance/xhtml/level2/html/HTMLImageElement09.xhtml [ Crash Pass ] crbug.com/591099 dom/legacy_dom_conformance/xhtml/level2/html/HTMLImageElement11.xhtml [ Crash Pass ] crbug.com/591099 dom/legacy_dom_conformance/xhtml/level2/html/HTMLImageElement12.xhtml [ Crash ] @@ -3230,6 +3237,7 @@ crbug.com/591099 editing/deleting/delete_block_merge_whitespace.html [ Crash ] crbug.com/591099 editing/deleting/delete_image.html [ Crash ] crbug.com/591099 editing/deleting/delete_line_end_ws.html [ Failure ] +crbug.com/591099 editing/deleting/delete_map_area.html [ Failure ] crbug.com/591099 editing/deleting/delete_trailing_ws.html [ Crash ] crbug.com/591099 editing/deleting/delete_ws_fixup.html [ Crash ] crbug.com/591099 editing/deleting/forward-delete-key.html [ Failure ] @@ -3672,7 +3680,6 @@ crbug.com/591099 editing/pasteboard/smart_paste.html [ Failure ] crbug.com/591099 editing/pasteboard/styled-element-markup.html [ Failure ] crbug.com/591099 editing/pasteboard/subframe-dragndrop-1.html [ Crash ] -crbug.com/591099 editing/selection/3690719.html [ Failure ] crbug.com/591099 editing/selection/4402375.html [ Failure ] crbug.com/591099 editing/selection/4776665.html [ Failure ] crbug.com/591099 editing/selection/4960116.html [ Failure ] @@ -3938,7 +3945,7 @@ crbug.com/591099 editing/selection/selection-invalid-offset.html [ Failure Pass ] crbug.com/591099 editing/selection/selection-plugin-clear-crash.html [ Crash ] crbug.com/591099 editing/selection/selectstart_detaches_frame.html [ Crash ] -crbug.com/591099 editing/selection/shift-click.html [ Failure ] +crbug.com/591099 editing/selection/shift-click.html [ Crash Failure ] crbug.com/591099 editing/selection/shrink-selection-after-shift-pagedown.html [ Crash Failure ] crbug.com/591099 editing/selection/skip-non-editable-1.html [ Crash Failure ] crbug.com/591099 editing/selection/skip-non-editable-2.html [ Crash Failure ] @@ -4071,6 +4078,7 @@ crbug.com/591099 editing/undo/5658727.html [ Failure ] crbug.com/591099 editing/undo/5738768.html [ Failure ] crbug.com/591099 editing/undo/audio-in-undo-stack-crash.html [ Crash ] +crbug.com/591099 editing/undo/crash-redo-with-iframes.html [ Failure ] crbug.com/591099 editing/undo/orphaned-selection-crash-bug32823-2.html [ Crash ] crbug.com/591099 editing/undo/orphaned-selection-crash-bug32823-4.html [ Crash ] crbug.com/591099 editing/undo/paste_with_mutation_event_undo_order.html [ Failure ] @@ -4180,31 +4188,35 @@ crbug.com/591099 external/wpt/cors/remote-origin.htm [ Crash ] crbug.com/591099 external/wpt/css/CSS2/abspos/abspos-containing-block-initial-001.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/abspos/abspos-containing-block-initial-009a.xht [ Failure ] -crbug.com/591099 external/wpt/css/CSS2/floats-clear/float-replaced-height-001.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/floats-clear/float-replaced-height-001.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/float-replaced-width-002.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-001.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-026.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-027.xht [ Crash Failure ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-029.xht [ Failure ] -crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-101.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-031.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-101.xht [ Failure Pass ] +crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-114.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-125.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-132.xht [ Failure Pass ] -crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-141.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-141.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-143.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-144.xht [ Failure ] -crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-145.xht [ Failure ] -crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-146.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-145.xht [ Failure Pass ] +crbug.com/591099 external/wpt/css/CSS2/floats-clear/floats-146.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-018.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-027.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-033.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-034.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-035.xht [ Failure ] -crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-121.xht [ Failure ] -crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-122.xht [ Failure ] -crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-123.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-121.xht [ Failure Pass ] +crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-122.xht [ Failure Pass ] +crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-123.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-125.xht [ Failure ] -crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-134.xht [ Failure ] -crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-142.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-134.xht [ Failure Pass ] +crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-142.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-157.xht [ Failure ] -crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-158.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-158.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-clear-002.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-clear-003.xht [ Crash Failure ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-clear-008.xht [ Failure ] @@ -4224,7 +4236,7 @@ crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-007.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-top-below-bfc-001l.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-top-below-bfc-001r.xht [ Failure ] -crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-top-below-bfc-003r.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-top-below-bfc-003r.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-top-below-inline-001l.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-top-below-inline-001r.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-top-below-inline-002l.xht [ Crash Failure ] @@ -4236,14 +4248,14 @@ crbug.com/591099 external/wpt/css/CSS2/linebox/inline-formatting-context-001.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/linebox/vertical-align-baseline-004a.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/linebox/vertical-align-baseline-005a.xht [ Failure ] -crbug.com/591099 external/wpt/css/CSS2/normal-flow/block-formatting-context-height-001.xht [ Failure ] -crbug.com/591099 external/wpt/css/CSS2/normal-flow/block-formatting-context-height-002.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/normal-flow/block-formatting-context-height-001.xht [ Failure Pass ] +crbug.com/591099 external/wpt/css/CSS2/normal-flow/block-formatting-context-height-002.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/CSS2/normal-flow/block-in-inline-percents-001.xht [ Failure ] -crbug.com/591099 external/wpt/css/CSS2/normal-flow/block-non-replaced-height-005.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/normal-flow/block-non-replaced-height-005.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/CSS2/normal-flow/block-non-replaced-width-007.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/normal-flow/block-replaced-width-006.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/normal-flow/blocks-025.xht [ Failure ] -crbug.com/591099 external/wpt/css/CSS2/normal-flow/inline-block-non-replaced-height-002.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/normal-flow/inline-block-non-replaced-height-002.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/CSS2/normal-flow/inline-block-valign-001.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/CSS2/normal-flow/inline-block-valign-002.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/normal-flow/inline-replaced-width-012.xht [ Failure Pass ] @@ -4332,13 +4344,14 @@ crbug.com/591099 external/wpt/css/CSS2/text/text-indent-intrinsic-004.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/text/text-indent-percent-001.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/text/text-transform-capitalize-003.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/text/white-space-mixed-002.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/text/white-space-normal-001.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/text/white-space-normal-002.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/text/white-space-normal-003.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/text/white-space-normal-004.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/text/white-space-normal-005.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/text/white-space-normal-006.xht [ Failure ] -crbug.com/591099 external/wpt/css/CSS2/text/white-space-nowrap-001.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/text/white-space-nowrap-001.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/CSS2/text/white-space-nowrap-005.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/text/white-space-nowrap-006.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/text/white-space-pre-001.xht [ Failure ] @@ -4385,7 +4398,7 @@ crbug.com/591099 external/wpt/css/css-flexbox-1/flexbox_direction-column.html [ Crash Failure ] crbug.com/591099 external/wpt/css/css-flexbox-1/flexbox_fbfc.html [ Failure ] crbug.com/591099 external/wpt/css/css-flexbox-1/flexbox_fbfc2.html [ Failure ] -crbug.com/591099 external/wpt/css/css-flexbox-1/flexbox_first-line.html [ Failure ] +crbug.com/591099 external/wpt/css/css-flexbox-1/flexbox_first-line.html [ Failure Pass ] crbug.com/591099 external/wpt/css/css-flexbox-1/flexbox_flex-0-0-0-unitless.html [ Failure ] crbug.com/591099 external/wpt/css/css-flexbox-1/flexbox_flex-0-0-0.html [ Failure ] crbug.com/591099 external/wpt/css/css-flexbox-1/flexbox_flex-0-0-1-unitless-basis.html [ Failure ] @@ -4535,7 +4548,7 @@ crbug.com/591099 external/wpt/css/css-flexbox-1/ttwf-reftest-flex-direction-column-reverse.html [ Failure ] crbug.com/591099 external/wpt/css/css-flexbox-1/ttwf-reftest-flex-direction-column.html [ Crash Failure ] crbug.com/591099 external/wpt/css/css-flexbox-1/ttwf-reftest-flex-direction-row-reverse.html [ Failure ] -crbug.com/591099 external/wpt/css/css-flexbox-1/ttwf-reftest-flex-inline.html [ Crash Failure ] +crbug.com/591099 external/wpt/css/css-flexbox-1/ttwf-reftest-flex-inline.html [ Crash Failure Pass ] crbug.com/591099 external/wpt/css/css-flexbox-1/ttwf-reftest-flex-order.html [ Failure ] crbug.com/591099 external/wpt/css/css-flexbox-1/ttwf-reftest-flex-wrap-reverse.html [ Failure ] crbug.com/591099 external/wpt/css/css-flexbox-1/ttwf-reftest-flex-wrap.html [ Failure ] @@ -4634,9 +4647,6 @@ crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-box/shape-outside-box-007.html [ Failure ] crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-box/shape-outside-box-008.html [ Failure ] crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-linear-gradient-001.html [ Failure ] -crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-linear-gradient-002.html [ Failure Pass ] -crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-linear-gradient-003.html [ Failure Pass ] -crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-linear-gradient-004.html [ Failure Pass ] crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-radial-gradient-001.html [ Failure ] crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-radial-gradient-002.html [ Failure ] crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-radial-gradient-003.html [ Failure ] @@ -4655,9 +4665,6 @@ crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-image/shape-image-012.html [ Failure ] crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-image/shape-image-013.html [ Failure ] crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-image/shape-image-014.html [ Failure ] -crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-image/shape-image-015.html [ Failure Pass ] -crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-image/shape-image-016.html [ Failure Pass ] -crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-image/shape-image-017.html [ Failure Pass ] crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-image/shape-image-018.html [ Failure ] crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-image/shape-image-019.html [ Failure ] crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/shape-image/shape-image-020.html [ Failure ] @@ -4709,8 +4716,6 @@ crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-009.html [ Failure ] crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-010.html [ Failure ] crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-011.html [ Failure ] -crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-012.html [ Failure Pass ] -crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-013.html [ Failure Pass ] crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-014.html [ Failure ] crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-015.html [ Failure ] crbug.com/591099 external/wpt/css/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-016.html [ Failure ] @@ -4755,8 +4760,8 @@ crbug.com/591099 external/wpt/css/css-ui-3/box-sizing-007.html [ Failure ] crbug.com/591099 external/wpt/css/css-ui-3/box-sizing-008.html [ Failure ] crbug.com/591099 external/wpt/css/css-ui-3/box-sizing-009.html [ Failure ] -crbug.com/591099 external/wpt/css/css-ui-3/box-sizing-010.html [ Failure ] -crbug.com/591099 external/wpt/css/css-ui-3/box-sizing-020.html [ Failure ] +crbug.com/591099 external/wpt/css/css-ui-3/box-sizing-010.html [ Failure Pass ] +crbug.com/591099 external/wpt/css/css-ui-3/box-sizing-020.html [ Failure Pass ] crbug.com/591099 external/wpt/css/css-ui-3/caret-color-013.html [ Crash ] crbug.com/591099 external/wpt/css/css-ui-3/caret-color-018.html [ Crash ] crbug.com/591099 external/wpt/css/css-ui-3/caret-color-019.html [ Crash ] @@ -4765,7 +4770,7 @@ crbug.com/591099 external/wpt/css/css-ui-3/outline-004.html [ Failure ] crbug.com/591099 external/wpt/css/css-ui-3/outline-011.html [ Failure ] crbug.com/591099 external/wpt/css/css-ui-3/outline-019.html [ Failure ] -crbug.com/591099 external/wpt/css/css-ui-3/outline-offset.html [ Failure ] +crbug.com/591099 external/wpt/css/css-ui-3/outline-offset.html [ Failure Pass ] crbug.com/591099 external/wpt/css/css-ui-3/text-overflow-002.html [ Failure ] crbug.com/591099 external/wpt/css/css-ui-3/text-overflow-004.html [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/abs-pos-non-replaced-icb-vlr-023.xht [ Failure ] @@ -4942,10 +4947,10 @@ crbug.com/591099 external/wpt/css/css-writing-modes-3/background-position-vrl-018.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/background-position-vrl-020.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/background-position-vrl-022.xht [ Failure ] -crbug.com/591099 external/wpt/css/css-writing-modes-3/background-size-document-root-vrl-002.html [ Failure ] -crbug.com/591099 external/wpt/css/css-writing-modes-3/background-size-document-root-vrl-004.html [ Failure ] -crbug.com/591099 external/wpt/css/css-writing-modes-3/background-size-document-root-vrl-006.html [ Failure ] -crbug.com/591099 external/wpt/css/css-writing-modes-3/background-size-document-root-vrl-008.html [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes-3/background-size-document-root-vrl-002.html [ Failure Pass ] +crbug.com/591099 external/wpt/css/css-writing-modes-3/background-size-document-root-vrl-004.html [ Failure Pass ] +crbug.com/591099 external/wpt/css/css-writing-modes-3/background-size-document-root-vrl-006.html [ Failure Pass ] +crbug.com/591099 external/wpt/css/css-writing-modes-3/background-size-document-root-vrl-008.html [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes-3/baseline-inline-non-replaced-002.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/baseline-inline-non-replaced-003.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/baseline-inline-non-replaced-004.xht [ Failure ] @@ -4999,8 +5004,9 @@ crbug.com/591099 external/wpt/css/css-writing-modes-3/float-contiguous-vlr-009.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/float-contiguous-vlr-011.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/float-contiguous-vlr-013.xht [ Failure ] -crbug.com/591099 external/wpt/css/css-writing-modes-3/float-contiguous-vrl-002.xht [ Failure ] -crbug.com/591099 external/wpt/css/css-writing-modes-3/float-contiguous-vrl-004.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes-3/float-contiguous-vrl-002.xht [ Failure Pass ] +crbug.com/591099 external/wpt/css/css-writing-modes-3/float-contiguous-vrl-004.xht [ Failure Pass ] +crbug.com/591099 external/wpt/css/css-writing-modes-3/float-contiguous-vrl-006.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/float-contiguous-vrl-008.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/float-contiguous-vrl-010.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/float-contiguous-vrl-012.xht [ Failure ] @@ -5010,6 +5016,8 @@ crbug.com/591099 external/wpt/css/css-writing-modes-3/float-lft-orthog-vrl-in-htb-002.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/float-rgt-orthog-htb-in-vlr-003.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/float-rgt-orthog-htb-in-vrl-003.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes-3/float-rgt-orthog-vlr-in-htb-003.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes-3/float-rgt-orthog-vrl-in-htb-003.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/float-vlr-009.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes-3/float-vlr-013.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/float-vrl-008.xht [ Failure Pass ] @@ -5038,7 +5046,9 @@ crbug.com/591099 external/wpt/css/css-writing-modes-3/margin-vlr-003.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/margin-vrl-002.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/normal-flow-overconstrained-vlr-003.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes-3/normal-flow-overconstrained-vlr-005.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/normal-flow-overconstrained-vrl-002.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes-3/normal-flow-overconstrained-vrl-004.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/ortho-htb-alongside-vrl-floats-002.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/ortho-htb-alongside-vrl-floats-010.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes-3/orthogonal-parent-shrink-to-fit-001a.html [ Crash ] @@ -5180,24 +5190,26 @@ crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-align-self-vert-rtl-004.xhtml [ Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-baseline-multi-line-horiz-003.html [ Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-baseline-multi-line-horiz-004.html [ Failure ] +crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-baseline-multi-line-vert-002.html [ Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-baseline-single-item-001a.html [ Crash Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-baseline-single-item-001b.html [ Crash Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-flex-wrap-horiz-002.html [ Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-justify-content-horiz-002.xhtml [ Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-justify-content-horiz-004.xhtml [ Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-justify-content-vert-002.xhtml [ Failure ] +crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-justify-content-vert-003.xhtml [ Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-justify-content-vert-004.xhtml [ Failure ] -crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-margin-auto-horiz-001.xhtml [ Failure ] +crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-margin-auto-horiz-001.xhtml [ Failure Pass ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-margin-auto-horiz-002.xhtml [ Failure ] -crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-mbp-horiz-002a.xhtml [ Failure ] -crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-mbp-horiz-002b.xhtml [ Failure ] +crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-mbp-horiz-002a.xhtml [ Failure Pass ] +crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-mbp-horiz-002b.xhtml [ Failure Pass ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-min-height-auto-003.html [ Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-min-height-auto-004.html [ Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-overflow-horiz-001.html [ Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-overflow-vert-001.html [ Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-paint-ordering-001.xhtml [ Failure ] -crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-whitespace-handling-001a.xhtml [ Failure ] -crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-whitespace-handling-001b.xhtml [ Failure ] +crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-whitespace-handling-001a.xhtml [ Failure Pass ] +crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-whitespace-handling-001b.xhtml [ Failure Pass ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-whitespace-handling-002.xhtml [ Failure Pass ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/variables/variable-declaration-15.html [ Failure Pass ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/variables/variable-declaration-16.html [ Failure Pass ] @@ -5554,6 +5566,13 @@ crbug.com/591099 external/wpt/http/basic-auth-cache-test.html [ Crash Timeout ] crbug.com/591099 external/wpt/innerText/getter.html [ Crash ] crbug.com/591099 external/wpt/input-events/input-events-typing-data-manual.html [ Crash ] +crbug.com/591099 external/wpt/intersection-observer/client-rect.html [ Crash ] +crbug.com/591099 external/wpt/intersection-observer/cross-origin-iframe.html [ Crash ] +crbug.com/591099 external/wpt/intersection-observer/edge-inclusive-intersection.html [ Failure ] +crbug.com/591099 external/wpt/intersection-observer/iframe-no-root.html [ Crash ] +crbug.com/591099 external/wpt/intersection-observer/remove-element.html [ Failure ] +crbug.com/591099 external/wpt/intersection-observer/root-margin.html [ Crash ] +crbug.com/591099 external/wpt/intersection-observer/same-document-root.html [ Crash ] crbug.com/591099 external/wpt/media-source/mediasource-activesourcebuffers.html [ Crash ] crbug.com/591099 external/wpt/media-source/mediasource-addsourcebuffer-mode.html [ Crash ] crbug.com/591099 external/wpt/media-source/mediasource-addsourcebuffer.html [ Crash ] @@ -6576,7 +6595,7 @@ crbug.com/591099 fast/block/dynamic-padding-border.html [ Failure ] crbug.com/591099 fast/block/float/002.html [ Crash Failure ] crbug.com/591099 fast/block/float/003.html [ Failure ] -crbug.com/591099 fast/block/float/008.html [ Failure ] +crbug.com/591099 fast/block/float/008.html [ Failure Pass ] crbug.com/591099 fast/block/float/010.html [ Failure ] crbug.com/591099 fast/block/float/012.html [ Failure ] crbug.com/591099 fast/block/float/014.html [ Crash Failure ] @@ -6616,7 +6635,7 @@ crbug.com/591099 fast/block/float/containing-block-change-compositing.html [ Failure ] crbug.com/591099 fast/block/float/crash-on-absolute-positioning.html [ Failure ] crbug.com/591099 fast/block/float/crash-replaced-display-block.html [ Failure ] -crbug.com/591099 fast/block/float/dynamic-unfloat-pref-width.html [ Failure ] +crbug.com/591099 fast/block/float/dynamic-unfloat-pref-width.html [ Failure Pass ] crbug.com/591099 fast/block/float/editable-text-overlapping-float.html [ Failure ] crbug.com/591099 fast/block/float/element-clears-float-without-clearance.html [ Failure ] crbug.com/591099 fast/block/float/fit_line_below_floats.html [ Failure Pass ] @@ -6629,14 +6648,14 @@ crbug.com/591099 fast/block/float/float-inserted-into-clean-line.html [ Failure ] crbug.com/591099 fast/block/float/float-list-changed-before-layout-crash.html [ Crash ] crbug.com/591099 fast/block/float/float-not-removed-from-next-sibling-crash.html [ Failure ] -crbug.com/591099 fast/block/float/float-not-removed-from-next-sibling3.html [ Failure ] +crbug.com/591099 fast/block/float/float-not-removed-from-next-sibling3.html [ Failure Pass ] crbug.com/591099 fast/block/float/float-not-removed-from-next-sibling5.html [ Crash Failure ] crbug.com/591099 fast/block/float/float-on-empty-line.html [ Failure ] crbug.com/591099 fast/block/float/float-on-line-large-and-small-float-below.html [ Crash ] crbug.com/591099 fast/block/float/float-on-line-obeys-container-padding.html [ Failure ] crbug.com/591099 fast/block/float/float-on-zero-height-line.html [ Failure ] crbug.com/591099 fast/block/float/float-overflow-hidden-containing-block-width.html [ Failure ] -crbug.com/591099 fast/block/float/float-overhangs-root.html [ Crash Failure ] +crbug.com/591099 fast/block/float/float-overhangs-root.html [ Crash Failure Pass ] crbug.com/591099 fast/block/float/float-reparent-during-detach-crash.html [ Crash ] crbug.com/591099 fast/block/float/floats-and-text-indent-rl.html [ Failure ] crbug.com/591099 fast/block/float/floats-and-text-indent.html [ Failure ] @@ -6666,7 +6685,7 @@ crbug.com/591099 fast/block/float/negative-margin-on-element-avoiding-floats-with-margin-on-parent.html [ Failure ] crbug.com/591099 fast/block/float/negative-margin-on-element-avoiding-floats.html [ Failure ] crbug.com/591099 fast/block/float/nested-clearance.html [ Failure ] -crbug.com/591099 fast/block/float/nested-floats-expand-formatting-context.html [ Failure ] +crbug.com/591099 fast/block/float/nested-floats-expand-formatting-context.html [ Failure Pass ] crbug.com/591099 fast/block/float/nopaint-after-layer-destruction.html [ Failure ] crbug.com/591099 fast/block/float/nopaint-after-layer-destruction2.html [ Failure ] crbug.com/591099 fast/block/float/overhanging-float-add-in-static-position-block.html [ Crash Failure Pass ] @@ -6724,7 +6743,7 @@ crbug.com/591099 fast/block/margin-collapse/empty-clear-blocks.html [ Failure ] crbug.com/591099 fast/block/margin-collapse/line-beside-float-complex-margin-collapsing.html [ Crash Failure ] crbug.com/591099 fast/block/margin-collapse/self-collapsing-block-creates-block-formatting-context.html [ Failure ] -crbug.com/591099 fast/block/margin-collapse/self-collapsing-block-with-float-descendants.html [ Failure ] +crbug.com/591099 fast/block/margin-collapse/self-collapsing-block-with-float-descendants.html [ Failure Pass ] crbug.com/591099 fast/block/margin-collapse/self-collapsing-block-with-overflow-hidden-and-float-child.html [ Failure ] crbug.com/591099 fast/block/margin-collapse/self-collapsing-cols-creates-block-formatting-context.html [ Failure ] crbug.com/591099 fast/block/margin-collapse/self-collapsing-with-floats.html [ Failure ] @@ -6903,34 +6922,34 @@ crbug.com/591099 fast/borders/bidi-012.html [ Failure ] crbug.com/591099 fast/borders/border-antialiasing.html [ Failure ] crbug.com/591099 fast/borders/border-color-visited.html [ Crash Failure ] -crbug.com/591099 fast/borders/border-image-01.html [ Failure ] -crbug.com/591099 fast/borders/border-image-border-radius.html [ Failure ] +crbug.com/591099 fast/borders/border-image-01.html [ Failure Pass ] +crbug.com/591099 fast/borders/border-image-border-radius.html [ Failure Pass ] crbug.com/591099 fast/borders/border-image-fill-no-border.html [ Failure Pass ] -crbug.com/591099 fast/borders/border-image-longhand.html [ Failure ] -crbug.com/591099 fast/borders/border-image-massive-scale.html [ Failure ] -crbug.com/591099 fast/borders/border-image-outset-in-shorthand.html [ Failure ] -crbug.com/591099 fast/borders/border-image-outset.html [ Failure ] -crbug.com/591099 fast/borders/border-image-repeat-round.html [ Failure ] -crbug.com/591099 fast/borders/border-image-repeat.html [ Failure ] -crbug.com/591099 fast/borders/border-image-rotate-transform.html [ Failure ] -crbug.com/591099 fast/borders/border-image-scale-transform.html [ Failure ] +crbug.com/591099 fast/borders/border-image-longhand.html [ Failure Pass ] +crbug.com/591099 fast/borders/border-image-massive-scale.html [ Failure Pass ] +crbug.com/591099 fast/borders/border-image-outset-in-shorthand.html [ Failure Pass ] +crbug.com/591099 fast/borders/border-image-outset.html [ Failure Pass ] +crbug.com/591099 fast/borders/border-image-repeat-round.html [ Failure Pass ] +crbug.com/591099 fast/borders/border-image-repeat.html [ Failure Pass ] +crbug.com/591099 fast/borders/border-image-rotate-transform.html [ Failure Pass ] +crbug.com/591099 fast/borders/border-image-scale-transform.html [ Failure Pass ] crbug.com/591099 fast/borders/border-image-scaled.html [ Failure ] -crbug.com/591099 fast/borders/border-image-scrambled.html [ Failure ] -crbug.com/591099 fast/borders/border-image-side-reduction.html [ Failure ] -crbug.com/591099 fast/borders/border-image-slice-constrained.html [ Failure ] -crbug.com/591099 fast/borders/border-image-slices.html [ Failure ] -crbug.com/591099 fast/borders/border-image-source.html [ Failure ] +crbug.com/591099 fast/borders/border-image-scrambled.html [ Failure Pass ] +crbug.com/591099 fast/borders/border-image-side-reduction.html [ Failure Pass ] +crbug.com/591099 fast/borders/border-image-slice-constrained.html [ Failure Pass ] +crbug.com/591099 fast/borders/border-image-slices.html [ Failure Pass ] +crbug.com/591099 fast/borders/border-image-source.html [ Failure Pass ] crbug.com/591099 fast/borders/border-image-width-negative.html [ Failure ] crbug.com/591099 fast/borders/border-inner-bleed.html [ Failure ] crbug.com/591099 fast/borders/border-radius-child.html [ Failure ] -crbug.com/591099 fast/borders/border-radius-complex-inner-double.html [ Failure ] -crbug.com/591099 fast/borders/border-radius-complex-inner.html [ Failure ] +crbug.com/591099 fast/borders/border-radius-complex-inner-double.html [ Failure Pass ] +crbug.com/591099 fast/borders/border-radius-complex-inner.html [ Failure Pass ] crbug.com/591099 fast/borders/border-radius-constraints-double.html [ Failure ] crbug.com/591099 fast/borders/border-radius-constraints.html [ Failure ] crbug.com/591099 fast/borders/border-radius-different-width-001-double.html [ Failure ] crbug.com/591099 fast/borders/border-radius-different-width-001.html [ Failure ] crbug.com/591099 fast/borders/border-radius-huge-assert.html [ Failure ] -crbug.com/591099 fast/borders/border-radius-inset-outset.html [ Failure ] +crbug.com/591099 fast/borders/border-radius-inset-outset.html [ Failure Pass ] crbug.com/591099 fast/borders/border-radius-mask-canvas-all.html [ Crash Failure ] crbug.com/591099 fast/borders/border-radius-mask-canvas-border.html [ Failure ] crbug.com/591099 fast/borders/border-radius-mask-canvas-padding.html [ Failure ] @@ -6941,20 +6960,20 @@ crbug.com/591099 fast/borders/border-radius-mask-video-shadow.html [ Crash Failure ] crbug.com/591099 fast/borders/border-radius-mask-video.html [ Failure ] crbug.com/591099 fast/borders/border-radius-position.html [ Failure ] -crbug.com/591099 fast/borders/border-radius-split-inline.html [ Failure ] +crbug.com/591099 fast/borders/border-radius-split-inline.html [ Failure Pass ] crbug.com/591099 fast/borders/border-radius-wide-border-01.html [ Failure ] crbug.com/591099 fast/borders/border-styles-split.html [ Failure ] crbug.com/591099 fast/borders/border-width-percent.html [ Failure ] -crbug.com/591099 fast/borders/borderRadiusAllStylesAllCorners.html [ Failure ] +crbug.com/591099 fast/borders/borderRadiusAllStylesAllCorners.html [ Failure Pass ] crbug.com/591099 fast/borders/different-color-borders.html [ Failure ] crbug.com/591099 fast/borders/fieldsetBorderRadius.html [ Crash Failure ] crbug.com/591099 fast/borders/inline-mask-overlay-image-outset-vertical-rl.html [ Failure ] crbug.com/591099 fast/borders/inline-mask-overlay-image-outset.html [ Failure ] crbug.com/591099 fast/borders/inline-mask-overlay-image.html [ Failure ] -crbug.com/591099 fast/borders/mixed-border-styles-radius.html [ Failure ] -crbug.com/591099 fast/borders/mixed-border-styles-radius2.html [ Crash Failure ] -crbug.com/591099 fast/borders/mixed-border-styles.html [ Failure ] -crbug.com/591099 fast/borders/outline-alpha-block.html [ Failure ] +crbug.com/591099 fast/borders/mixed-border-styles-radius.html [ Failure Pass ] +crbug.com/591099 fast/borders/mixed-border-styles-radius2.html [ Crash Failure Pass ] +crbug.com/591099 fast/borders/mixed-border-styles.html [ Failure Pass ] +crbug.com/591099 fast/borders/outline-alpha-block.html [ Failure Pass ] crbug.com/591099 fast/borders/outline-alpha-inline.html [ Failure ] crbug.com/591099 fast/borders/overflow-hidden-border-radius-force-backing-store.html [ Failure ] crbug.com/591099 fast/borders/rtl-border-01.html [ Failure ] @@ -6962,7 +6981,7 @@ crbug.com/591099 fast/borders/rtl-border-03.html [ Failure ] crbug.com/591099 fast/borders/rtl-border-04.html [ Failure ] crbug.com/591099 fast/borders/rtl-border-05.html [ Crash Failure ] -crbug.com/591099 fast/borders/table-borders.html [ Failure ] +crbug.com/591099 fast/borders/table-borders.html [ Failure Pass ] crbug.com/591099 fast/box-decoration-break/box-decoration-break-parsing.html [ Failure ] crbug.com/591099 fast/box-decoration-break/box-decoration-break-rendering.html [ Failure Pass ] crbug.com/591099 fast/box-shadow/basic-shadows.html [ Failure ] @@ -6979,7 +6998,7 @@ crbug.com/591099 fast/box-shadow/inset-subpixel.html [ Failure ] crbug.com/591099 fast/box-shadow/inset-with-extraordinary-radii-and-border.html [ Failure ] crbug.com/591099 fast/box-shadow/inset.html [ Failure ] -crbug.com/591099 fast/box-shadow/no-blur-multiple-offsets.html [ Failure ] +crbug.com/591099 fast/box-shadow/no-blur-multiple-offsets.html [ Failure Pass ] crbug.com/591099 fast/box-shadow/scaled-box-shadow.html [ Failure ] crbug.com/591099 fast/box-shadow/shadow-buffer-partial.html [ Crash Failure ] crbug.com/591099 fast/box-shadow/shadow-tiling-artifact.html [ Failure ] @@ -7190,11 +7209,11 @@ crbug.com/591099 fast/clip/014.html [ Failure ] crbug.com/591099 fast/clip/nestedTransparencyClip.html [ Failure ] crbug.com/591099 fast/clip/outline-overflowClip.html [ Failure ] -crbug.com/591099 fast/clip/overflow-border-radius-combinations.html [ Failure ] -crbug.com/591099 fast/clip/overflow-border-radius-composited-parent.html [ Failure ] -crbug.com/591099 fast/clip/overflow-border-radius-composited.html [ Failure ] +crbug.com/591099 fast/clip/overflow-border-radius-combinations.html [ Failure Pass ] +crbug.com/591099 fast/clip/overflow-border-radius-composited-parent.html [ Failure Pass ] +crbug.com/591099 fast/clip/overflow-border-radius-composited.html [ Failure Pass ] crbug.com/591099 fast/clip/overflow-border-radius-fixed-position.html [ Failure ] -crbug.com/591099 fast/clip/overflow-border-radius-transformed.html [ Failure ] +crbug.com/591099 fast/clip/overflow-border-radius-transformed.html [ Failure Pass ] crbug.com/591099 fast/compact/001.html [ Failure ] crbug.com/591099 fast/compact/002.html [ Failure ] crbug.com/591099 fast/compact/003.html [ Failure ] @@ -7278,7 +7297,7 @@ crbug.com/591099 fast/css-grid-layout/flex-content-resolution-columns.html [ Failure ] crbug.com/591099 fast/css-grid-layout/flex-content-resolution-rows.html [ Failure ] crbug.com/591099 fast/css-grid-layout/flex-factor-sum-less-than-1.html [ Failure ] -crbug.com/591099 fast/css-grid-layout/float-not-protruding-into-next-grid-item.html [ Failure ] +crbug.com/591099 fast/css-grid-layout/float-not-protruding-into-next-grid-item.html [ Failure Pass ] crbug.com/591099 fast/css-grid-layout/floating-not-effect-on-grid-items.html [ Failure ] crbug.com/591099 fast/css-grid-layout/grid-add-item-with-positioned-items.html [ Failure ] crbug.com/591099 fast/css-grid-layout/grid-add-positioned-block-item-after-inline-item.html [ Failure ] @@ -7538,7 +7557,9 @@ crbug.com/591099 fast/css-intrinsic-dimensions/height-property-value.html [ Failure ] crbug.com/591099 fast/css-intrinsic-dimensions/height.html [ Failure ] crbug.com/591099 fast/css-intrinsic-dimensions/indefinite-percent-minmax-content-inlinesize-contribution-nonreplaced-blocks.html [ Failure ] +crbug.com/591099 fast/css-intrinsic-dimensions/intrinsic-sized-absolutes.html [ Failure Pass ] crbug.com/591099 fast/css-intrinsic-dimensions/intrinsic-sized-blocks.html [ Crash Failure Pass ] +crbug.com/591099 fast/css-intrinsic-dimensions/intrinsic-sized-replaced-absolutes.html [ Failure Pass ] crbug.com/591099 fast/css-intrinsic-dimensions/max-width-constrained.html [ Crash Failure Pass ] crbug.com/591099 fast/css-intrinsic-dimensions/max-width-unconstrained.html [ Crash Failure ] crbug.com/591099 fast/css-intrinsic-dimensions/maxcontent-minmax-content-inlinesize-contribution-nonreplaced-blocks.html [ Crash Failure Pass ] @@ -7547,7 +7568,7 @@ crbug.com/591099 fast/css-intrinsic-dimensions/resize-inside-percent-width-overflow-hidden.html [ Failure ] crbug.com/591099 fast/css-intrinsic-dimensions/width-avoid-floats.html [ Crash Failure ] crbug.com/591099 fast/css-intrinsic-dimensions/width-property-value.html [ Failure ] -crbug.com/591099 fast/css-intrinsic-dimensions/width-shrinks-avoid-floats.html [ Crash Failure ] +crbug.com/591099 fast/css-intrinsic-dimensions/width-shrinks-avoid-floats.html [ Crash Failure Pass ] crbug.com/591099 fast/css-intrinsic-dimensions/width.html [ Crash Failure ] crbug.com/591099 fast/css/001.html [ Crash Failure ] crbug.com/591099 fast/css/002.html [ Failure ] @@ -8101,7 +8122,7 @@ crbug.com/591099 fast/css/nth-child-of-pseudo-element-assert.html [ Failure ] crbug.com/591099 fast/css/nth-child-unary-prefix.html [ Failure ] crbug.com/591099 fast/css/number-parsing-crash-2.html [ Failure ] -crbug.com/591099 fast/css/number-parsing-crash.html [ Crash Pass ] +crbug.com/591099 fast/css/number-parsing-crash.html [ Crash Failure Pass ] crbug.com/591099 fast/css/object-fit-canvas.html [ Failure ] crbug.com/591099 fast/css/object-fit-embed.html [ Failure Pass ] crbug.com/591099 fast/css/object-fit-grow-landscape.html [ Failure ] @@ -8113,7 +8134,7 @@ crbug.com/591099 fast/css/object-fit-object.html [ Failure Pass ] crbug.com/591099 fast/css/object-fit-shrink.html [ Failure ] crbug.com/591099 fast/css/object-fit-video-poster.html [ Failure ] -crbug.com/591099 fast/css/object-position-svg.html [ Failure ] +crbug.com/591099 fast/css/object-position-svg.html [ Failure Pass ] crbug.com/591099 fast/css/object-position-with-fit-contain.html [ Failure ] crbug.com/591099 fast/css/object-position-with-fit-cover.html [ Failure ] crbug.com/591099 fast/css/object-position-with-fit-none.html [ Failure ] @@ -8380,7 +8401,6 @@ crbug.com/591099 fast/css3-text/css3-word-break/word-break-all-wrap-with-100percent-floats.html [ Failure Pass ] crbug.com/591099 fast/css3-text/css3-word-break/word-break-all-wrap-with-floats.html [ Failure ] crbug.com/591099 fast/css3-text/css3-word-break/word-break-break-all-in-span.html [ Failure ] -crbug.com/591099 fast/css3-text/css3-word-break/word-break-break-word-fit-content.html [ Failure Pass ] crbug.com/591099 fast/deprecated-flexbox/001.html [ Failure ] crbug.com/591099 fast/deprecated-flexbox/002.html [ Failure ] crbug.com/591099 fast/deprecated-flexbox/003.html [ Failure ] @@ -8420,10 +8440,10 @@ crbug.com/591099 fast/deprecated-flexbox/vertical-box-form-controls.html [ Failure ] crbug.com/591099 fast/dnd/dropEffect-for-file.html [ Crash ] crbug.com/591099 fast/dnd/dropEffect-for-image.html [ Timeout ] -crbug.com/591099 fast/dnd/link-dragging-draggable-div-with-dragged-link.html [ Timeout ] -crbug.com/591099 fast/dnd/link-dragging-draggable-div-with-link.html [ Timeout ] -crbug.com/591099 fast/dnd/link-dragging-draggable-link.html [ Timeout ] -crbug.com/591099 fast/dnd/link-dragging-non-draggable-link.html [ Timeout ] +crbug.com/591099 fast/dnd/link-dragging-draggable-div-with-dragged-link.html [ Pass Timeout ] +crbug.com/591099 fast/dnd/link-dragging-draggable-div-with-link.html [ Pass Timeout ] +crbug.com/591099 fast/dnd/link-dragging-draggable-link.html [ Pass Timeout ] +crbug.com/591099 fast/dnd/link-dragging-non-draggable-link.html [ Pass Timeout ] crbug.com/591099 fast/doctypes/001.html [ Crash Failure ] crbug.com/591099 fast/doctypes/002.html [ Crash Failure ] crbug.com/591099 fast/doctypes/003.html [ Crash Failure ] @@ -8669,7 +8689,7 @@ crbug.com/591099 fast/dom/HTMLLinkElement/prefetch-detached.html [ Failure ] crbug.com/591099 fast/dom/HTMLLinkElement/prefetch-onerror.html [ Failure ] crbug.com/591099 fast/dom/HTMLLinkElement/prefetch-onload.html [ Crash Failure ] -crbug.com/591099 fast/dom/HTMLLinkElement/prefetch.html [ Crash Failure ] +crbug.com/591099 fast/dom/HTMLLinkElement/prefetch.html [ Crash Failure Pass ] crbug.com/591099 fast/dom/HTMLLinkElement/prerender-insert-after-stop.html [ Failure ] crbug.com/591099 fast/dom/HTMLLinkElement/prerender-remove-after-stop.html [ Failure ] crbug.com/591099 fast/dom/HTMLLinkElement/programmatically-add-link-with-onerror-handler.html [ Failure ] @@ -9802,7 +9822,7 @@ crbug.com/591099 fast/events/flags-unset-on-init-event.html [ Failure ] crbug.com/591099 fast/events/focus-change-assertion.html [ Crash ] crbug.com/591099 fast/events/focus-change-crash.html [ Crash Failure ] -crbug.com/591099 fast/events/focus-change-crash2.html [ Crash ] +crbug.com/591099 fast/events/focus-change-crash2.html [ Crash Timeout ] crbug.com/591099 fast/events/focus-click-on-non-mouse-focusable-element.html [ Failure ] crbug.com/591099 fast/events/focus-event-source-device-from-keyboard.html [ Failure ] crbug.com/591099 fast/events/focus-event-source-device-from-mouse.html [ Failure ] @@ -9928,7 +9948,7 @@ crbug.com/591099 fast/events/mouse-events-within-no-element.html [ Failure ] crbug.com/591099 fast/events/mouse-focus-imagemap.html [ Failure ] crbug.com/591099 fast/events/mouse-moved-remove-frame-crash.html [ Timeout ] -crbug.com/591099 fast/events/mouse-relative-position.html [ Crash Failure ] +crbug.com/591099 fast/events/mouse-relative-position.html [ Crash Failure Pass ] crbug.com/591099 fast/events/mouseclick-target-and-positioning.html [ Failure ] crbug.com/591099 fast/events/mousedown-in-subframe-scrollbar.html [ Failure ] crbug.com/591099 fast/events/mousedown-inside-dragstart-should-not-cause-crash.html [ Failure ] @@ -9992,7 +10012,7 @@ crbug.com/591099 fast/events/pointerevents/fake-mouse-event-pointer-types.html [ Failure ] crbug.com/591099 fast/events/pointerevents/mouse-node-remove.html [ Failure ] crbug.com/591099 fast/events/pointerevents/mouse-on-object.html [ Crash ] -crbug.com/591099 fast/events/pointerevents/mouse-pointer-boundary-events-for-shadowdom.html [ Failure ] +crbug.com/591099 fast/events/pointerevents/mouse-pointer-boundary-events-for-shadowdom.html [ Failure Pass ] crbug.com/591099 fast/events/pointerevents/mouse-pointer-capture-transition-events.html [ Timeout ] crbug.com/591099 fast/events/pointerevents/mouse-pointer-capture.html [ Failure Timeout ] crbug.com/591099 fast/events/pointerevents/mouse-pointer-chorded-buttons.html [ Failure ] @@ -10366,7 +10386,7 @@ crbug.com/591099 fast/forms/button/button-inner-block-reuse.html [ Failure ] crbug.com/591099 fast/forms/button/button-submit.html [ Failure Pass ] crbug.com/591099 fast/forms/button/button-white-space.html [ Failure ] -crbug.com/591099 fast/forms/button/button-with-float.html [ Crash Failure ] +crbug.com/591099 fast/forms/button/button-with-float.html [ Crash Failure Pass ] crbug.com/591099 fast/forms/calendar-picker/calendar-picker-appearance-zoom125.html [ Failure Timeout ] crbug.com/591099 fast/forms/calendar-picker/calendar-picker-appearance-zoom200.html [ Failure ] crbug.com/591099 fast/forms/calendar-picker/calendar-picker-date-types.html [ Failure Timeout ] @@ -10421,6 +10441,8 @@ crbug.com/591099 fast/forms/color/color-value-sanitization.html [ Failure ] crbug.com/591099 fast/forms/color/input-appearance-color.html [ Failure ] crbug.com/591099 fast/forms/color/input-color-choose-default-value-after-set-value.html [ Failure ] +crbug.com/591099 fast/forms/color/input-color-chooser-shown-readonly.html [ Crash ] +crbug.com/591099 fast/forms/color/input-color-chooser-shown.html [ Crash ] crbug.com/591099 fast/forms/color/input-color-onchange-event.html [ Failure ] crbug.com/591099 fast/forms/color/input-value-sanitization-color.html [ Failure ] crbug.com/591099 fast/forms/control-clip-overflow.html [ Failure ] @@ -10432,9 +10454,9 @@ crbug.com/591099 fast/forms/datalist/datalist-child-validation.html [ Failure ] crbug.com/591099 fast/forms/datalist/datalist-nonoption-child.html [ Failure ] crbug.com/591099 fast/forms/datalist/input-appearance-range-with-datalist-zoomed.html [ Failure ] -crbug.com/591099 fast/forms/datalist/input-appearance-range-with-datalist.html [ Crash Failure ] +crbug.com/591099 fast/forms/datalist/input-appearance-range-with-datalist.html [ Crash Failure Pass ] crbug.com/591099 fast/forms/datalist/input-appearance-range-with-padding-with-datalist.html [ Failure ] -crbug.com/591099 fast/forms/datalist/input-appearance-range-with-transform.html [ Failure ] +crbug.com/591099 fast/forms/datalist/input-appearance-range-with-transform.html [ Failure Pass ] crbug.com/591099 fast/forms/datalist/input-list.html [ Failure ] crbug.com/591099 fast/forms/datalist/range-snap-to-datalist.html [ Failure ] crbug.com/591099 fast/forms/datalist/slider-appearance-with-ticks-crash.html [ Failure ] @@ -10525,6 +10547,7 @@ crbug.com/591099 fast/forms/enctype-attribute.html [ Failure ] crbug.com/591099 fast/forms/enter-clicks-buttons.html [ Crash ] crbug.com/591099 fast/forms/fieldset/fieldset-align.html [ Failure ] +crbug.com/591099 fast/forms/fieldset/fieldset-crash.html [ Failure ] crbug.com/591099 fast/forms/fieldset/fieldset-disabled.html [ Crash Failure ] crbug.com/591099 fast/forms/fieldset/fieldset-elements.html [ Crash ] crbug.com/591099 fast/forms/fieldset/fieldset-form-collection-radionode-list.html [ Crash Failure ] @@ -10848,7 +10871,7 @@ crbug.com/591099 fast/forms/range/slider-padding.html [ Failure ] crbug.com/591099 fast/forms/range/slider-thumb-shared-style.html [ Failure ] crbug.com/591099 fast/forms/range/slider-thumb-stylability.html [ Failure ] -crbug.com/591099 fast/forms/range/slider-transformed.html [ Failure ] +crbug.com/591099 fast/forms/range/slider-transformed.html [ Failure Pass ] crbug.com/591099 fast/forms/range/slider-zoomed.html [ Failure ] crbug.com/591099 fast/forms/range/thumbslider-crash.html [ Failure ] crbug.com/591099 fast/forms/range/thumbslider-no-parent-slider.html [ Failure ] @@ -10888,10 +10911,8 @@ crbug.com/591099 fast/forms/select-popup/popup-menu-appearance-minimum-font.html [ Failure ] crbug.com/591099 fast/forms/select-popup/popup-menu-appearance-rtl-default.html [ Failure ] crbug.com/591099 fast/forms/select-popup/popup-menu-appearance-rtl.html [ Failure ] -crbug.com/591099 fast/forms/select-popup/popup-menu-appearance-single-option.html [ Failure Pass ] crbug.com/591099 fast/forms/select-popup/popup-menu-appearance-styled.html [ Failure ] crbug.com/591099 fast/forms/select-popup/popup-menu-appearance-texttransform.html [ Failure ] -crbug.com/591099 fast/forms/select-popup/popup-menu-appearance-transform.html [ Failure Pass ] crbug.com/591099 fast/forms/select-popup/popup-menu-appearance-zoom.html [ Failure ] crbug.com/591099 fast/forms/select-popup/popup-menu-appearance-zoom090.html [ Failure ] crbug.com/591099 fast/forms/select-popup/popup-menu-appearance-zoom110.html [ Failure ] @@ -10901,7 +10922,6 @@ crbug.com/591099 fast/forms/select-popup/popup-menu-crash-on-close.html [ Failure ] crbug.com/591099 fast/forms/select-popup/popup-menu-crash-on-select.html [ Failure ] crbug.com/591099 fast/forms/select-popup/popup-menu-crash-on-style-update.html [ Crash ] -crbug.com/591099 fast/forms/select-popup/popup-menu-key-operations.html [ Failure Pass ] crbug.com/591099 fast/forms/select-popup/popup-menu-mouse-operations.html [ Failure ] crbug.com/591099 fast/forms/select-popup/popup-menu-nested-style.html [ Failure ] crbug.com/591099 fast/forms/select-popup/popup-menu-touch-operations.html [ Failure Timeout ] @@ -11535,7 +11555,7 @@ crbug.com/591099 fast/gradients/crash-on-remove.html [ Failure ] crbug.com/591099 fast/gradients/crash-on-tr.html [ Failure ] crbug.com/591099 fast/gradients/crash-on-zero-radius.html [ Failure ] -crbug.com/591099 fast/gradients/css3-color-stop-units.html [ Failure ] +crbug.com/591099 fast/gradients/css3-color-stop-units.html [ Failure Pass ] crbug.com/591099 fast/gradients/css3-color-stops.html [ Failure ] crbug.com/591099 fast/gradients/css3-degenerate-color-stops.html [ Failure ] crbug.com/591099 fast/gradients/css3-gradient-parsing.html [ Failure ] @@ -11544,10 +11564,10 @@ crbug.com/591099 fast/gradients/css3-radial-gradient-crash.html [ Failure ] crbug.com/591099 fast/gradients/css3-radial-gradients.html [ Failure ] crbug.com/591099 fast/gradients/css3-radial-gradients2.html [ Failure ] -crbug.com/591099 fast/gradients/css3-radial-gradients3.html [ Failure ] +crbug.com/591099 fast/gradients/css3-radial-gradients3.html [ Failure Pass ] crbug.com/591099 fast/gradients/css3-radial-gradients4.html [ Failure ] crbug.com/591099 fast/gradients/css3-repeating-linear-gradients.html [ Failure ] -crbug.com/591099 fast/gradients/css3-repeating-linear-gradients2.html [ Failure ] +crbug.com/591099 fast/gradients/css3-repeating-linear-gradients2.html [ Failure Pass ] crbug.com/591099 fast/gradients/css3-repeating-radial-gradients.html [ Failure ] crbug.com/591099 fast/gradients/generated-gradients.html [ Failure ] crbug.com/591099 fast/gradients/gradient-after-transparent-border.html [ Failure ] @@ -11556,7 +11576,7 @@ crbug.com/591099 fast/gradients/radial-clamping.html [ Failure Pass ] crbug.com/591099 fast/gradients/repeating-conic-gradient.html [ Failure ] crbug.com/591099 fast/gradients/simple-gradients.html [ Failure ] -crbug.com/591099 fast/gradients/unprefixed-color-stop-units.html [ Failure ] +crbug.com/591099 fast/gradients/unprefixed-color-stop-units.html [ Failure Pass ] crbug.com/591099 fast/gradients/unprefixed-color-stops.html [ Failure ] crbug.com/591099 fast/gradients/unprefixed-gradient-parsing.html [ Failure ] crbug.com/591099 fast/gradients/unprefixed-linear-angle-gradients.html [ Failure ] @@ -11566,7 +11586,7 @@ crbug.com/591099 fast/gradients/unprefixed-radial-gradients-color-hints.html [ Failure Pass ] crbug.com/591099 fast/gradients/unprefixed-radial-gradients.html [ Failure ] crbug.com/591099 fast/gradients/unprefixed-radial-gradients2.html [ Failure ] -crbug.com/591099 fast/gradients/unprefixed-radial-gradients3.html [ Failure ] +crbug.com/591099 fast/gradients/unprefixed-radial-gradients3.html [ Failure Pass ] crbug.com/591099 fast/gradients/unprefixed-repeating-linear-gradient.html [ Failure ] crbug.com/591099 fast/gradients/unprefixed-repeating-radial-gradients.html [ Failure ] crbug.com/591099 fast/gradients/zero-range-repeating-gradient-hang.html [ Failure Pass ] @@ -11668,7 +11688,7 @@ crbug.com/591099 fast/inline-block/overflow-clip.html [ Failure ] crbug.com/591099 fast/inline-block/tricky-baseline.html [ Failure ] crbug.com/591099 fast/inline-block/vertical-align-top-and-bottom-2.html [ Failure ] -crbug.com/591099 fast/inline/001.html [ Failure ] +crbug.com/591099 fast/inline/001.html [ Failure Pass ] crbug.com/591099 fast/inline/absolute-positioned-inline-in-centred-block.html [ Failure ] crbug.com/591099 fast/inline/br-client-rect.html [ Failure ] crbug.com/591099 fast/inline/break-between-nobr.html [ Failure ] @@ -11711,11 +11731,11 @@ crbug.com/591099 fast/inline/nested-text-descendants.html [ Failure Pass ] crbug.com/591099 fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline.html [ Crash Failure ] crbug.com/591099 fast/inline/outline-continuations.html [ Failure ] -crbug.com/591099 fast/inline/outline-offset.html [ Failure ] +crbug.com/591099 fast/inline/outline-offset.html [ Failure Pass ] crbug.com/591099 fast/inline/parent-inline-element-padding-contributes-width.html [ Failure ] crbug.com/591099 fast/inline/positioned-element-padding-contributes-width.html [ Failure ] -crbug.com/591099 fast/inline/positioned-object-between-replaced-elements.html [ Failure ] -crbug.com/591099 fast/inline/positionedLifetime.html [ Failure ] +crbug.com/591099 fast/inline/positioned-object-between-replaced-elements.html [ Failure Pass ] +crbug.com/591099 fast/inline/positionedLifetime.html [ Failure Pass ] crbug.com/591099 fast/inline/reattach-inlines-in-anonymous-blocks-with-out-of-flow-siblings.html [ Failure ] crbug.com/591099 fast/inline/relative-positioned-overflow.html [ Failure ] crbug.com/591099 fast/inline/reparent-inline-box.html [ Crash ] @@ -12158,7 +12178,7 @@ crbug.com/591099 fast/loader/frame-creation-removal.html [ Failure ] crbug.com/591099 fast/loader/goto-anchor-infinite-layout.html [ Failure ] crbug.com/591099 fast/loader/hashchange-event-properties.html [ Failure ] -crbug.com/591099 fast/loader/iframe-crash-on-missing-image.xhtml [ Crash ] +crbug.com/591099 fast/loader/iframe-crash-on-missing-image.xhtml [ Crash Pass ] crbug.com/591099 fast/loader/iframe-recursive-synchronous-load.html [ Failure ] crbug.com/591099 fast/loader/inherit-charset-to-empty-frame.html [ Failure ] crbug.com/591099 fast/loader/javascript-detached-frame-no-crash.html [ Failure ] @@ -12278,7 +12298,7 @@ crbug.com/591099 fast/multicol/client-rects.html [ Failure ] crbug.com/591099 fast/multicol/column-break-with-balancing.html [ Failure ] crbug.com/591099 fast/multicol/column-count-with-rules.html [ Failure ] -crbug.com/591099 fast/multicol/column-rules.html [ Failure ] +crbug.com/591099 fast/multicol/column-rules.html [ Failure Pass ] crbug.com/591099 fast/multicol/column-width-zero.html [ Failure ] crbug.com/591099 fast/multicol/columns-shorthand-parsing-2.html [ Failure ] crbug.com/591099 fast/multicol/composited-inner-multicol.html [ Failure ] @@ -12354,7 +12374,7 @@ crbug.com/591099 fast/multicol/flipped-blocks-border-after.html [ Failure ] crbug.com/591099 fast/multicol/flipped-blocks-hit-test.html [ Failure Pass ] crbug.com/591099 fast/multicol/float-after-break-after.html [ Failure ] -crbug.com/591099 fast/multicol/float-avoidance.html [ Failure ] +crbug.com/591099 fast/multicol/float-avoidance.html [ Failure Pass ] crbug.com/591099 fast/multicol/float-beside-bfc.html [ Failure ] crbug.com/591099 fast/multicol/float-big-line.html [ Failure ] crbug.com/591099 fast/multicol/float-break.html [ Failure ] @@ -12386,6 +12406,7 @@ crbug.com/591099 fast/multicol/image-loaded-before-layout-assert.html [ Failure ] crbug.com/591099 fast/multicol/infinitely-tall-content-in-outer-crash.html [ Failure ] crbug.com/591099 fast/multicol/inline-children-crash.html [ Failure ] +crbug.com/591099 fast/multicol/inner-multicol-in-second-column.html [ Failure ] crbug.com/591099 fast/multicol/inner-multicol-moved-into-continuation.html [ Failure ] crbug.com/591099 fast/multicol/layers-split-across-columns.html [ Failure ] crbug.com/591099 fast/multicol/line-pushed-down-by-float.html [ Failure ] @@ -12491,7 +12512,7 @@ crbug.com/591099 fast/multicol/span/clone-anonymous-block-non-inline-child-crash.html [ Crash Failure ] crbug.com/591099 fast/multicol/span/fill-after-spanner-exact-fit.html [ Failure ] crbug.com/591099 fast/multicol/span/fill-after-spanner-extra-height.html [ Failure ] -crbug.com/591099 fast/multicol/span/float.html [ Failure ] +crbug.com/591099 fast/multicol/span/float.html [ Failure Pass ] crbug.com/591099 fast/multicol/span/foreignObject.html [ Failure ] crbug.com/591099 fast/multicol/span/in-nested-multicol-with-hard-breaks.html [ Failure ] crbug.com/591099 fast/multicol/span/in-nested-multicol-with-list-item.html [ Failure ] @@ -12509,7 +12530,7 @@ crbug.com/591099 fast/multicol/span/outer-column-break-after-inner-spanner-and-float.html [ Failure ] crbug.com/591099 fast/multicol/span/outer-column-break-after-inner-spanner.html [ Failure ] crbug.com/591099 fast/multicol/span/outline.html [ Failure ] -crbug.com/591099 fast/multicol/span/outside-multicol.html [ Failure ] +crbug.com/591099 fast/multicol/span/outside-multicol.html [ Failure Pass ] crbug.com/591099 fast/multicol/span/padding-before-unbreakable-content-crash.html [ Crash Failure ] crbug.com/591099 fast/multicol/span/percent-margins.html [ Failure ] crbug.com/591099 fast/multicol/span/preferred-widths-with-column-content.html [ Failure ] @@ -12538,7 +12559,7 @@ crbug.com/591099 fast/multicol/table-caption-with-block.html [ Failure ] crbug.com/591099 fast/multicol/table-cell-content-change-with-decorations.html [ Failure ] crbug.com/591099 fast/multicol/table-cell-content-change.html [ Failure ] -crbug.com/591099 fast/multicol/tall-float1.html [ Failure ] +crbug.com/591099 fast/multicol/tall-float1.html [ Failure Pass ] crbug.com/591099 fast/multicol/textarea-with-placeholder-as-multicol-crash.html [ Failure ] crbug.com/591099 fast/multicol/three-inner-rows.html [ Failure ] crbug.com/591099 fast/multicol/transform-inside-opacity.html [ Crash Failure ] @@ -12596,7 +12617,7 @@ crbug.com/591099 fast/multicol/vertical-rl/float-truncation.html [ Failure ] crbug.com/591099 fast/multicol/vertical-rl/gap-non-negative.html [ Failure ] crbug.com/591099 fast/multicol/vertical-rl/image-inside-nested-blocks-with-border.html [ Failure ] -crbug.com/591099 fast/multicol/vertical-rl/rule-style.html [ Failure ] +crbug.com/591099 fast/multicol/vertical-rl/rule-style.html [ Failure Pass ] crbug.com/591099 fast/multicol/vertical-rl/unsplittable-inline-block.html [ Failure ] crbug.com/591099 fast/multicol/very-tall-block-crash.html [ Failure ] crbug.com/591099 fast/multicol/very-wide-rtl-crash.html [ Failure ] @@ -12633,7 +12654,6 @@ crbug.com/591099 fast/overflow/overflow-auto-table.html [ Failure ] crbug.com/591099 fast/overflow/overflow-clamp-after-visible-rect-resize.html [ Failure ] crbug.com/591099 fast/overflow/overflow-float-stacking.html [ Failure ] -crbug.com/591099 fast/overflow/overflow-focus-ring.html [ Failure Pass ] crbug.com/591099 fast/overflow/overflow-rtl-inline-scrollbar.html [ Failure ] crbug.com/591099 fast/overflow/overflow-rtl-vertical-origin.html [ Failure ] crbug.com/591099 fast/overflow/overflow-rtl-vertical.html [ Crash Failure ] @@ -12896,7 +12916,7 @@ crbug.com/591099 fast/replaced/replaced-element-with-percentage-height-anonymous-block-parent.html [ Failure ] crbug.com/591099 fast/replaced/selection-rect-in-table-cell.html [ Failure ] crbug.com/591099 fast/replaced/selection-rect-transform.html [ Crash Failure ] -crbug.com/591099 fast/replaced/selection-rect.html [ Failure ] +crbug.com/591099 fast/replaced/selection-rect.html [ Failure Pass ] crbug.com/591099 fast/replaced/table-percent-height-text-controls.html [ Failure ] crbug.com/591099 fast/replaced/table-percent-height.html [ Failure ] crbug.com/591099 fast/replaced/table-percent-width.html [ Failure ] @@ -12914,7 +12934,7 @@ crbug.com/591099 fast/ruby/base-shorter-than-text.html [ Crash Failure ] crbug.com/591099 fast/ruby/float-overhang-from-ruby-text.html [ Crash Failure ] crbug.com/591099 fast/ruby/floating-ruby-text.html [ Crash Failure ] -crbug.com/591099 fast/ruby/generated-before-counter-doesnt-crash.html [ Crash Failure ] +crbug.com/591099 fast/ruby/generated-before-counter-doesnt-crash.html [ Crash Failure Pass ] crbug.com/591099 fast/ruby/line-break-ruby.html [ Crash ] crbug.com/591099 fast/ruby/list-item-marker-in-block-ruby.html [ Crash Failure ] crbug.com/591099 fast/ruby/merge-adjacent-anonymous-blocks-inside-ruby-run.html [ Crash Failure ] @@ -13147,16 +13167,12 @@ crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-top-left.html [ Failure ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-top-right.html [ Failure ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-inset.html [ Failure ] -crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-linetop-adjustment.html [ Failure Pass ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-margin-crash.html [ Failure ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-not-a-layer.html [ Failure ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-outermost.html [ Failure ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-polygon-000.html [ Crash Failure ] -crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-polygon-001.html [ Failure Pass ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-polygon-002.html [ Failure ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-shape-margin-percent.html [ Failure ] -crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-stacked-000.html [ Failure Pass ] -crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-stacked-001.html [ Failure Pass ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-stacked-002.html [ Crash Failure ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-image-fit-001.html [ Failure ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-image-fit-002.html [ Failure ] @@ -13170,15 +13186,12 @@ crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-line-height-crash2.html [ Crash Failure ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-linear-gradient.html [ Failure ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-negative-height-crash.html [ Crash Failure ] -crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-polygon-012.html [ Failure Pass ] -crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-polygon-013.html [ Failure Pass ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-polygon-014.html [ Failure ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-polygon-015.html [ Failure ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-polygon-zero-vertex.html [ Failure Pass ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-relative-size-svg.html [ Failure ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-rounded-boxes-001.html [ Failure ] crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-rounded-boxes-002.html [ Failure ] -crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-rounded-inset.html [ Failure Pass ] crbug.com/591099 fast/spatial-navigation/snav-aligned-not-aligned.html [ Failure ] crbug.com/591099 fast/spatial-navigation/snav-clipped-overflowed-content.html [ Failure ] crbug.com/591099 fast/spatial-navigation/snav-container-white-space.html [ Failure ] @@ -13235,7 +13248,6 @@ crbug.com/591099 fast/sub-pixel/float-percentage-widths.html [ Failure ] crbug.com/591099 fast/sub-pixel/float-with-margin-in-container.html [ Failure ] crbug.com/591099 fast/sub-pixel/float-with-right-margin-zoom.html [ Failure ] -crbug.com/591099 fast/sub-pixel/float-wrap-zoom.html [ Failure Pass ] crbug.com/591099 fast/sub-pixel/inline-block-with-padding.html [ Failure ] crbug.com/591099 fast/sub-pixel/repaint-subpixel-layer-in-subpixel-composited-layer.html [ Failure Pass ] crbug.com/591099 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html [ Failure ] @@ -13490,7 +13502,6 @@ crbug.com/591099 fast/text-autosizing/list-marker-with-images-and-forms-autosizing.html [ Crash Failure ] crbug.com/591099 fast/text-autosizing/list-marker-with-links-autosizing.html [ Crash Failure ] crbug.com/591099 fast/text-autosizing/narrow-child.html [ Failure ] -crbug.com/591099 http/tests/text-autosizing/narrow-iframe.html [ Failure ] crbug.com/591099 fast/text-autosizing/nested-child.html [ Failure ] crbug.com/591099 fast/text-autosizing/nested-em-line-height.html [ Failure ] crbug.com/591099 fast/text-autosizing/oscillation-javascript-fontsize-change.html [ Failure ] @@ -13523,7 +13534,6 @@ crbug.com/591099 fast/text-autosizing/vertical-writing-mode.html [ Failure ] crbug.com/591099 fast/text-autosizing/wide-block.html [ Failure ] crbug.com/591099 fast/text-autosizing/wide-child.html [ Failure ] -crbug.com/591099 http/tests/text-autosizing/wide-iframe.html [ Failure ] crbug.com/591099 fast/text-autosizing/wide-in-narrow-overflow-scroll.html [ Failure ] crbug.com/591099 fast/text/apply-start-width-after-skipped-text.html [ Failure ] crbug.com/591099 fast/text/atsui-kerning-and-ligatures.html [ Failure ] @@ -13533,7 +13543,7 @@ crbug.com/591099 fast/text/atsui-spacing-features.html [ Failure ] crbug.com/591099 fast/text/basic/002.html [ Failure ] crbug.com/591099 fast/text/basic/004.html [ Failure ] -crbug.com/591099 fast/text/basic/011.html [ Failure ] +crbug.com/591099 fast/text/basic/011.html [ Failure Pass ] crbug.com/591099 fast/text/basic/012.html [ Failure ] crbug.com/591099 fast/text/basic/014.html [ Failure ] crbug.com/591099 fast/text/basic/015.html [ Failure ] @@ -13799,7 +13809,6 @@ crbug.com/591099 fast/text/wide-preformatted.html [ Failure ] crbug.com/591099 fast/text/word-break-run-rounding.html [ Failure ] crbug.com/591099 fast/text/word-break-soft-hyphen.html [ Failure ] -crbug.com/591099 fast/text/word-break.html [ Failure Pass ] crbug.com/591099 fast/text/word-space-between-inlines.html [ Failure ] crbug.com/591099 fast/text/word-space.html [ Failure ] crbug.com/591099 fast/text/word-wrap-whitespace-pre.html [ Failure Pass ] @@ -13975,7 +13984,7 @@ crbug.com/591099 fast/writing-mode/text-combine-various-fonts.html [ Failure ] crbug.com/591099 fast/writing-mode/text-orientation-basic.html [ Failure ] crbug.com/591099 fast/writing-mode/vertical-baseline-alignment.html [ Failure ] -crbug.com/591099 fast/writing-mode/vertical-float-margin.html [ Failure ] +crbug.com/591099 fast/writing-mode/vertical-float-margin.html [ Failure Pass ] crbug.com/591099 fast/writing-mode/vertical-font-fallback.html [ Failure ] crbug.com/591099 fast/writing-mode/vertical-inline-block-hittest.html [ Crash ] crbug.com/591099 fast/writing-mode/vertical-lr-replaced-selection.html [ Failure ] @@ -14066,7 +14075,8 @@ crbug.com/591099 fast/xsl/xslt-translate.html [ Failure ] crbug.com/591099 fast/xsl/xslt-xhtml-template.xml [ Failure ] crbug.com/591099 fast/xsl/xslt_unicode.xml [ Failure ] -crbug.com/591099 fonts/cursive.html [ Failure ] +crbug.com/591099 fonts/cursive.html [ Failure Pass ] +crbug.com/591099 fonts/fantasy.html [ Failure ] crbug.com/591099 fonts/monospace.html [ Failure ] crbug.com/591099 fonts/sans-serif.html [ Failure ] crbug.com/591099 fonts/serif.html [ Failure ] @@ -14648,10 +14658,11 @@ crbug.com/591099 http/tests/inspector/appcache/appcache-manifest-with-non-existing-file.html [ Failure Timeout ] crbug.com/591099 http/tests/inspector/appcache/appcache-swap.html [ Failure Timeout ] crbug.com/591099 http/tests/inspector/application-panel/resources-panel-on-navigation.html [ Failure Timeout ] +crbug.com/591099 http/tests/inspector/application-panel/resources-panel-resource-preview.html [ Failure ] crbug.com/591099 http/tests/inspector/application-panel/resources-panel-selection-on-reload.html [ Failure Timeout ] crbug.com/591099 http/tests/inspector/application-panel/storage-view-reports-quota.html [ Crash Failure Timeout ] crbug.com/591099 http/tests/inspector/bindings/bindings-frame-attach-detach.html [ Crash Failure Timeout ] -crbug.com/591099 http/tests/inspector/bindings/bindings-frame-navigate.html [ Failure ] +crbug.com/591099 http/tests/inspector/bindings/bindings-frame-navigate.html [ Failure Timeout ] crbug.com/591099 http/tests/inspector/bindings/bindings-main-frame-navigated.html [ Failure ] crbug.com/591099 http/tests/inspector/bindings/bindings-multiple-frames.html [ Crash ] crbug.com/591099 http/tests/inspector/bindings/contentscripts-bindings-multiple-frames.html [ Crash ] @@ -14661,7 +14672,7 @@ crbug.com/591099 http/tests/inspector/bindings/livelocation-main-frame-navigated.html [ Failure ] crbug.com/591099 http/tests/inspector/bindings/navigator-frame-attach-detach.html [ Failure Timeout ] crbug.com/591099 http/tests/inspector/bindings/navigator-frame-navigate.html [ Failure Timeout ] -crbug.com/591099 http/tests/inspector/bindings/navigator-main-frame-navigated.html [ Failure ] +crbug.com/591099 http/tests/inspector/bindings/navigator-main-frame-navigated.html [ Failure Timeout ] crbug.com/591099 http/tests/inspector/bindings/navigator-multiple-frames.html [ Crash Timeout ] crbug.com/591099 http/tests/inspector/bindings/shadowdom-bindings.html [ Failure Timeout ] crbug.com/591099 http/tests/inspector/bindings/shadowdom-navigator.html [ Failure Timeout ] @@ -15711,6 +15722,8 @@ crbug.com/591099 http/tests/svg/svg-in-object-in-sandboxed-iframe.html [ Crash ] crbug.com/591099 http/tests/svg/use-contenttype-blocked.html [ Crash ] crbug.com/591099 http/tests/svg/use-no-contenttype-blocked.html [ Crash ] +crbug.com/591099 http/tests/text-autosizing/narrow-iframe.html [ Failure ] +crbug.com/591099 http/tests/text-autosizing/wide-iframe.html [ Failure ] crbug.com/591099 http/tests/uri/css-href.php [ Failure ] crbug.com/591099 http/tests/uri/escaped-entity.html [ Failure ] crbug.com/591099 http/tests/uri/resolve-encoding-relative.html [ Failure ] @@ -16136,7 +16149,7 @@ crbug.com/591099 http/tests/xmlhttprequest/zero-length-response-sync.html [ Crash Failure ] crbug.com/591099 http/tests/xmlhttprequest/zero-length-response.html [ Crash Failure ] crbug.com/591099 http/tests/xsl/xslt-transform-with-javascript-disabled.html [ Failure ] -crbug.com/591099 idle-callback/test-runner-run-idle-tasks.html [ Failure ] +crbug.com/591099 idle-callback/test-runner-run-idle-tasks.html [ Failure Timeout ] crbug.com/591099 ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling.htm [ Failure ] crbug.com/591099 ietestcenter/css3/bordersbackgrounds/background-color-applied-to-rounded-inline-element.htm [ Failure ] crbug.com/591099 ietestcenter/css3/bordersbackgrounds/background-color-border-box.htm [ Failure Pass ] @@ -16211,19 +16224,19 @@ crbug.com/591099 images/animated-background-image-crash.html [ Failure ] crbug.com/591099 images/color-jpeg-with-color-profile.html [ Failure ] crbug.com/591099 images/color-profile-background-clip-text.html [ Failure ] -crbug.com/591099 images/color-profile-background-image-cover.html [ Failure ] -crbug.com/591099 images/color-profile-background-image-cross-fade-png.html [ Failure ] -crbug.com/591099 images/color-profile-background-image-cross-fade.html [ Failure ] -crbug.com/591099 images/color-profile-background-image-repeat.html [ Failure ] -crbug.com/591099 images/color-profile-background-image-space.html [ Failure ] +crbug.com/591099 images/color-profile-background-image-cover.html [ Failure Pass ] +crbug.com/591099 images/color-profile-background-image-cross-fade-png.html [ Failure Pass ] +crbug.com/591099 images/color-profile-background-image-cross-fade.html [ Failure Pass ] +crbug.com/591099 images/color-profile-background-image-repeat.html [ Failure Pass ] +crbug.com/591099 images/color-profile-background-image-space.html [ Failure Pass ] crbug.com/591099 images/color-profile-border-image-source.html [ Failure ] crbug.com/591099 images/color-profile-border-radius.html [ Failure ] crbug.com/591099 images/color-profile-drag-image.html [ Failure ] crbug.com/591099 images/color-profile-filter.html [ Failure ] crbug.com/591099 images/color-profile-group.html [ Failure ] crbug.com/591099 images/color-profile-iframe.html [ Failure ] -crbug.com/591099 images/color-profile-image-canvas-pattern.html [ Failure ] -crbug.com/591099 images/color-profile-image-canvas.html [ Failure ] +crbug.com/591099 images/color-profile-image-canvas-pattern.html [ Failure Pass ] +crbug.com/591099 images/color-profile-image-canvas.html [ Failure Pass ] crbug.com/591099 images/color-profile-image-filter-all.html [ Failure ] crbug.com/591099 images/color-profile-image-object-fit.html [ Failure ] crbug.com/591099 images/color-profile-image-profile-match.html [ Failure ] @@ -16234,7 +16247,6 @@ crbug.com/591099 images/color-profile-layer.html [ Failure ] crbug.com/591099 images/color-profile-mask-image-svg.html [ Crash Failure ] crbug.com/591099 images/color-profile-svg-foreign-object.html [ Failure ] -crbug.com/591099 images/content-url-broken-image-with-alt-text.html [ Crash Pass ] crbug.com/591099 images/content-url-image-with-alt-text-dynamic-2.html [ Crash Pass ] crbug.com/591099 images/cross-fade-background-size.html [ Failure ] crbug.com/591099 images/cross-fade-blending.html [ Failure ] @@ -16295,10 +16307,9 @@ crbug.com/591099 images/imagemap-scroll.html [ Crash ] crbug.com/591099 images/img-dimensions-styled.html [ Crash ] crbug.com/591099 images/invalid-image-url-crash.html [ Crash ] -crbug.com/591099 images/jpeg-yuv-image-decoding.html [ Failure ] -crbug.com/591099 images/jpeg-yuv-progressive-canvas.html [ Failure ] -crbug.com/591099 images/jpeg-yuv-progressive-image.html [ Failure ] -crbug.com/591099 images/large-size-image-crash.html [ Crash Pass ] +crbug.com/591099 images/jpeg-yuv-image-decoding.html [ Failure Pass ] +crbug.com/591099 images/jpeg-yuv-progressive-canvas.html [ Failure Pass ] +crbug.com/591099 images/jpeg-yuv-progressive-image.html [ Failure Pass ] crbug.com/591099 images/link-body-content-imageDimensionChanged-crash.html [ Failure ] crbug.com/591099 images/load-img-with-empty-src.html [ Failure ] crbug.com/591099 images/motion-jpeg-single-frame.html [ Failure ] @@ -16309,7 +16320,6 @@ crbug.com/591099 images/percent-height-image.html [ Failure ] crbug.com/591099 images/pixel-crack-image-background-webkit-transform-scale.html [ Failure ] crbug.com/591099 images/png-extra-row-crash.html [ Failure ] -crbug.com/591099 images/png-missing-plte-before-trns-crash.html [ Crash Pass ] crbug.com/591099 images/png-suite/test.html [ Crash Failure ] crbug.com/591099 images/png_per_row_alpha_decoding.html [ Failure ] crbug.com/591099 images/rendering-broken-0px-images-quirk.html [ Crash Failure ] @@ -16365,7 +16375,6 @@ crbug.com/591099 inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot.js [ Crash Failure Timeout ] crbug.com/591099 inspector-protocol/emulation/device-emulation-small-dw.js [ Failure ] crbug.com/591099 inspector-protocol/emulation/device-emulation-small.js [ Failure ] -crbug.com/591099 inspector/device-mode/forced-viewport-unobserved.html [ Failure ] crbug.com/591099 inspector-protocol/heap-profiler/heap-objects-tracking.html [ Failure ] crbug.com/591099 inspector-protocol/heap-profiler/heap-samples-in-snapshot.html [ Failure ] crbug.com/591099 inspector-protocol/heap-profiler/heap-snapshot-with-active-dom-object.html [ Failure ] @@ -16396,7 +16405,7 @@ crbug.com/591099 inspector/components/datagrid-autosize.html [ Failure ] crbug.com/591099 inspector/components/datagrid.html [ Failure ] crbug.com/591099 inspector/components/dom-extension.html [ Failure ] -crbug.com/591099 inspector/components/file-path-scoring.html [ Failure ] +crbug.com/591099 inspector/components/file-path-scoring.html [ Crash Failure ] crbug.com/591099 inspector/components/flame-chart.html [ Failure ] crbug.com/591099 inspector/components/geometry.html [ Failure ] crbug.com/591099 inspector/components/linkifier.html [ Failure ] @@ -16414,7 +16423,7 @@ crbug.com/591099 inspector/components/widget-focus.html [ Failure ] crbug.com/591099 inspector/console-document-write-from-external-script-logging.html [ Failure ] crbug.com/591099 inspector/console/alert-toString-exception.html [ Crash ] -crbug.com/591099 inspector/console/command-line-api-getEventListeners.html [ Failure ] +crbug.com/591099 inspector/console/command-line-api-getEventListeners.html [ Crash Failure ] crbug.com/591099 inspector/console/command-line-api.html [ Crash ] crbug.com/591099 inspector/console/console-Object-overwritten.html [ Failure ] crbug.com/591099 inspector/console/console-api-on-call-frame.html [ Crash Failure ] @@ -16438,8 +16447,8 @@ crbug.com/591099 inspector/console/console-dir.html [ Failure ] crbug.com/591099 inspector/console/console-dirxml.html [ Crash Failure ] crbug.com/591099 inspector/console/console-edit-expanded-tree.html [ Failure ] -crbug.com/591099 inspector/console/console-edit-property-value.html [ Failure ] -crbug.com/591099 inspector/console/console-error-on-call-frame.html [ Failure ] +crbug.com/591099 inspector/console/console-edit-property-value.html [ Crash Failure ] +crbug.com/591099 inspector/console/console-error-on-call-frame.html [ Crash Failure ] crbug.com/591099 inspector/console/console-eval-blocked.html [ Failure ] crbug.com/591099 inspector/console/console-eval-exception-report.html [ Failure ] crbug.com/591099 inspector/console/console-eval-fake.html [ Crash Failure ] @@ -16528,6 +16537,7 @@ crbug.com/591099 inspector/console/exception-objects.html [ Crash Failure ] crbug.com/591099 inspector/console/function-name-in-console-message-stack.html [ Failure ] crbug.com/591099 inspector/console/inspect-html-all-collection.html [ Failure ] +crbug.com/591099 inspector/console/paintworklet-console-selector.html [ Failure ] crbug.com/591099 inspector/console/shadow-element.html [ Crash ] crbug.com/591099 inspector/console/worker-eval-contains-stack.html [ Failure ] crbug.com/591099 inspector/cookie-resource-match.html [ Failure ] @@ -16545,8 +16555,9 @@ crbug.com/591099 inspector/database-table-name-excaping.html [ Failure ] crbug.com/591099 inspector/device-mode/device-mode-responsive.html [ Crash Failure ] crbug.com/591099 inspector/device-mode/device-mode-switching-devices.html [ Crash Failure ] +crbug.com/591099 inspector/device-mode/forced-viewport-unobserved.html [ Failure ] crbug.com/591099 inspector/diff-module.html [ Failure ] -crbug.com/591099 inspector/domdebugger/domdebugger-getEventListeners.html [ Failure ] +crbug.com/591099 inspector/domdebugger/domdebugger-getEventListeners.html [ Crash Failure ] crbug.com/591099 inspector/editor/php-highlighter.html [ Crash Failure ] crbug.com/591099 inspector/editor/text-editor-auto-whitespace-removing.html [ Crash Failure Timeout ] crbug.com/591099 inspector/editor/text-editor-block-indent.html [ Crash Failure Timeout ] @@ -16640,7 +16651,7 @@ crbug.com/591099 inspector/elements/inspect-mode-after-profiling.html [ Crash ] crbug.com/591099 inspector/elements/inspect-mode-shadow-text.html [ Crash ] crbug.com/591099 inspector/elements/inspect-pointer-events-none.html [ Crash ] -crbug.com/591099 inspector/elements/inspect-pseudo-element.html [ Crash ] +crbug.com/591099 inspector/elements/inspect-pseudo-element.html [ Crash Timeout ] crbug.com/591099 inspector/elements/modify-chardata.html [ Crash ] crbug.com/591099 inspector/elements/move-node.html [ Crash ] crbug.com/591099 inspector/elements/node-reselect-on-append-child.html [ Crash ] @@ -16664,7 +16675,7 @@ crbug.com/591099 inspector/elements/styles-1/add-new-rule-invalid-selector.html [ Crash ] crbug.com/591099 inspector/elements/styles-1/add-new-rule-with-style-after-body.html [ Crash ] crbug.com/591099 inspector/elements/styles-1/cached-sync-computed-styles.html [ Crash ] -crbug.com/591099 inspector/elements/styles-1/case-sensitive-suggestions.html [ Crash Failure ] +crbug.com/591099 inspector/elements/styles-1/case-sensitive-suggestions.html [ Crash Failure Timeout ] crbug.com/591099 inspector/elements/styles-1/color-aware-property-value-edit.html [ Crash ] crbug.com/591099 inspector/elements/styles-1/color-nicknames-lowercase.html [ Crash Failure ] crbug.com/591099 inspector/elements/styles-1/color-swatch.html [ Crash ] @@ -16802,7 +16813,7 @@ crbug.com/591099 inspector/layers/layer-replay-scale.html [ Crash Failure ] crbug.com/591099 inspector/local-object-properties-section.html [ Failure ] crbug.com/591099 inspector/local-object.html [ Failure ] -crbug.com/591099 inspector/network/network-cookies-pane.html [ Failure ] +crbug.com/591099 inspector/network/network-cookies-pane.html [ Crash Failure ] crbug.com/591099 inspector/network/network-domain-filter.html [ Failure ] crbug.com/591099 inspector/network/network-filmstrip-overview-showing.html [ Failure ] crbug.com/591099 inspector/network/network-filter-http-requests.html [ Failure ] @@ -16864,7 +16875,7 @@ crbug.com/591099 inspector/runtime/runtime-es6-setSymbolPropertyValue.html [ Failure ] crbug.com/591099 inspector/runtime/runtime-getProperties-isOwnProperty.html [ Crash Failure ] crbug.com/591099 inspector/runtime/runtime-getProperties.html [ Failure ] -crbug.com/591099 inspector/runtime/runtime-localStorage-getProperties.html [ Failure ] +crbug.com/591099 inspector/runtime/runtime-localStorage-getProperties.html [ Crash Failure ] crbug.com/591099 inspector/runtime/runtime-setPropertyValue.html [ Crash Failure ] crbug.com/591099 inspector/sass/test-ast-css-1.html [ Crash ] crbug.com/591099 inspector/sass/test-ast-css-2.html [ Crash ] @@ -16888,7 +16899,7 @@ crbug.com/591099 inspector/sass/test-mapping-bad.html [ Crash Failure ] crbug.com/591099 inspector/sass/test-mapping-good.html [ Failure ] crbug.com/591099 inspector/sass/test-mapping-many-scss.html [ Failure ] -crbug.com/591099 inspector/sass/test-mapping-with-cache-busting-url.html [ Failure ] +crbug.com/591099 inspector/sass/test-mapping-with-cache-busting-url.html [ Crash Failure ] crbug.com/591099 inspector/sass/test-ssp-breaking-edits.html [ Crash ] crbug.com/591099 inspector/sass/test-ssp-editing.html [ Crash ] crbug.com/591099 inspector/sass/test-ssp-incremental-edit-invalid-value.html [ Crash ] @@ -16910,13 +16921,13 @@ crbug.com/591099 inspector/sources/debugger-async/async-callstack-get-as-string.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-async/async-callstack-in-console.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-async/async-callstack-indexed-db.html [ Crash Failure ] -crbug.com/591099 inspector/sources/debugger-async/async-callstack-middle-run.html [ Failure ] +crbug.com/591099 inspector/sources/debugger-async/async-callstack-middle-run.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-async/async-callstack-mutation-observer.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-async/async-callstack-post-message.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-async/async-callstack-promises.html [ Crash Failure Timeout ] crbug.com/591099 inspector/sources/debugger-async/async-callstack-reload-no-crash.html [ Failure ] crbug.com/591099 inspector/sources/debugger-async/async-callstack-scripted-scroll.html [ Crash Failure Timeout ] -crbug.com/591099 inspector/sources/debugger-async/async-callstack-set-interval.html [ Failure ] +crbug.com/591099 inspector/sources/debugger-async/async-callstack-set-interval.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-async/async-callstack-web-sql.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-async/async-callstack-xhrs.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-async/async-callstack.html [ Failure ] @@ -16930,7 +16941,7 @@ crbug.com/591099 inspector/sources/debugger-breakpoints/disable-breakpoints.html [ Failure ] crbug.com/591099 inspector/sources/debugger-breakpoints/dom-breakpoints-editing-dom-from-inspector.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-breakpoints/dom-breakpoints.html [ Crash Failure Timeout ] -crbug.com/591099 inspector/sources/debugger-breakpoints/dynamic-scripts-breakpoints.html [ Failure ] +crbug.com/591099 inspector/sources/debugger-breakpoints/dynamic-scripts-breakpoints.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-breakpoints/event-listener-breakpoints-after-suspension.html [ Failure ] crbug.com/591099 inspector/sources/debugger-breakpoints/event-listener-breakpoints-script-first-stmt.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-breakpoints/event-listener-breakpoints-xhr.html [ Failure ] @@ -16987,7 +16998,7 @@ crbug.com/591099 inspector/sources/debugger-step/debugger-step-out-custom-element-callbacks.html [ Failure ] crbug.com/591099 inspector/sources/debugger-step/debugger-step-out-document-write.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-step/debugger-step-out-event-listener.html [ Crash Failure ] -crbug.com/591099 inspector/sources/debugger-step/debugger-step-out.html [ Failure ] +crbug.com/591099 inspector/sources/debugger-step/debugger-step-out.html [ Failure Timeout ] crbug.com/591099 inspector/sources/debugger-step/debugger-step-over-across-timeouts.html [ Failure ] crbug.com/591099 inspector/sources/debugger-step/debugger-step-over-document-write.html [ Failure ] crbug.com/591099 inspector/sources/debugger-step/debugger-step-over-inlined-scripts.html [ Failure ] @@ -17027,7 +17038,7 @@ crbug.com/591099 inspector/sources/debugger-ui/show-function-definition.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-ui/show-generator-location.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-ui/source-frame-count.html [ Crash Failure ] -crbug.com/591099 inspector/sources/debugger-ui/source-frame.html [ Failure ] +crbug.com/591099 inspector/sources/debugger-ui/source-frame.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-ui/source-url-comment.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-ui/switch-file.html [ Crash Failure ] crbug.com/591099 inspector/sources/debugger-ui/ui-source-code-display-name.html [ Crash Failure ] @@ -17089,7 +17100,7 @@ crbug.com/591099 inspector/sources/pretty-print-html-2.html [ Failure ] crbug.com/591099 inspector/sources/pretty-print-html-3.html [ Failure ] crbug.com/591099 inspector/sources/pretty-print-javascript-1.html [ Failure ] -crbug.com/591099 inspector/sources/pretty-print-javascript-2.html [ Failure ] +crbug.com/591099 inspector/sources/pretty-print-javascript-2.html [ Crash Failure ] crbug.com/591099 inspector/sources/pretty-print-javascript-3.html [ Failure ] crbug.com/591099 inspector/sources/pretty-print-javascript-4.html [ Failure ] crbug.com/591099 inspector/sources/pretty-print-javascript-5.html [ Failure ] @@ -17357,11 +17368,11 @@ crbug.com/591099 media/autoplay/document-user-activation.html [ Failure ] crbug.com/591099 media/before-load-member-access.html [ Crash ] crbug.com/591099 media/broken-video.html [ Crash ] -crbug.com/591099 media/color-profile-video-poster-image.html [ Failure ] -crbug.com/591099 media/color-profile-video-seek-filter.html [ Failure ] -crbug.com/591099 media/color-profile-video-seek-object-fit.html [ Failure ] -crbug.com/591099 media/color-profile-video-seek.html [ Failure ] -crbug.com/591099 media/color-profile-video.html [ Failure ] +crbug.com/591099 media/color-profile-video-poster-image.html [ Failure Pass ] +crbug.com/591099 media/color-profile-video-seek-filter.html [ Failure Pass ] +crbug.com/591099 media/color-profile-video-seek-object-fit.html [ Failure Pass ] +crbug.com/591099 media/color-profile-video-seek.html [ Failure Pass ] +crbug.com/591099 media/color-profile-video.html [ Failure Pass ] crbug.com/591099 media/constructors.html [ Crash ] crbug.com/591099 media/controls-css-overload.html [ Crash ] crbug.com/591099 media/controls-drag-timebar.html [ Crash ] @@ -17691,11 +17702,12 @@ crbug.com/591099 paint/background/fieldset-legend-background-shadow-border-radius.html [ Failure ] crbug.com/591099 paint/background/rounded-clip-fractional-offset.html [ Crash Failure ] crbug.com/591099 paint/clipath/clip-path-with-background-and-box-behind.html [ Failure Pass ] +crbug.com/591099 paint/float-painted-when-no-longer-self-painting.html [ Failure ] crbug.com/591099 paint/frames/frameset-with-stacking-context-and-not-stacking-context-children.html [ Failure ] crbug.com/591099 paint/frames/frameset-with-stacking-contexts.html [ Failure ] crbug.com/591099 paint/high-contrast-mode/image-filter-all/text-on-backgrounds.html [ Failure ] crbug.com/591099 paint/images/animated-gif-last-frame-crash.html [ Crash ] -crbug.com/591099 paint/inline/floating-inline.html [ Failure ] +crbug.com/591099 paint/inline/floating-inline.html [ Failure Pass ] crbug.com/591099 paint/inline/focus-ring-under-absolute-with-relative-continuation.html [ Failure ] crbug.com/591099 paint/inline/outline-offset.html [ Failure ] crbug.com/591099 paint/invalidation/4774354.html [ Failure ] @@ -17865,7 +17877,7 @@ crbug.com/591099 paint/invalidation/destroy-overlay-scrollbar.html [ Failure ] crbug.com/591099 paint/invalidation/destroy-scrollbar.html [ Failure ] crbug.com/591099 paint/invalidation/details-open-repaint.html [ Crash Failure ] -crbug.com/591099 paint/invalidation/do-not-paint-below-image-baseline.html [ Failure ] +crbug.com/591099 paint/invalidation/do-not-paint-below-image-baseline.html [ Failure Pass ] crbug.com/591099 paint/invalidation/dont-invalidate-root-layer-when-composited-layer-becomes-visible.html [ Failure Pass ] crbug.com/591099 paint/invalidation/dynamic-table-vertical-alignment-change.html [ Failure ] crbug.com/591099 paint/invalidation/erase-overflow.html [ Failure Pass ] @@ -18261,7 +18273,6 @@ crbug.com/591099 paint/invalidation/text-selection-rect-in-overflow.html [ Failure Pass ] crbug.com/591099 paint/invalidation/text-shadow-horizontal.html [ Failure ] crbug.com/591099 paint/invalidation/text-shadow.html [ Failure ] -crbug.com/591099 paint/invalidation/textarea-caret.html [ Crash Failure Pass ] crbug.com/591099 paint/invalidation/trailing-floats-root-line-box-overflow.html [ Failure ] crbug.com/591099 paint/invalidation/transform-absolute-child.html [ Failure ] crbug.com/591099 paint/invalidation/transform-absolute-in-positioned-container.html [ Failure ] @@ -18270,7 +18281,7 @@ crbug.com/591099 paint/invalidation/transform-layout-repaint.html [ Failure Pass ] crbug.com/591099 paint/invalidation/transform-relative-position.html [ Failure ] crbug.com/591099 paint/invalidation/transform-repaint-descendants.html [ Failure ] -crbug.com/591099 paint/invalidation/transform-replaced-shadows.html [ Failure ] +crbug.com/591099 paint/invalidation/transform-replaced-shadows.html [ Failure Pass ] crbug.com/591099 paint/invalidation/transform-rotate-and-remove.html [ Failure ] crbug.com/591099 paint/invalidation/transform-translate.html [ Failure ] crbug.com/591099 paint/invalidation/update-visual-rects-after-compositing-change.html [ Failure ] @@ -18384,6 +18395,7 @@ crbug.com/591099 plugins/sequential-focus.html [ Failure ] crbug.com/591099 plugins/simple-expando.html [ Crash ] crbug.com/591099 plugins/tabindex.html [ Crash ] +crbug.com/591099 plugins/type-case.html [ Crash ] crbug.com/591099 plugins/webview-plugin-lifecycle.html [ Failure Pass ] crbug.com/591099 plugins/webview-plugin-nested-iframe-scroll.html [ Failure ] crbug.com/591099 plugins/webview-plugin-scroll.html [ Failure Pass ] @@ -18473,7 +18485,7 @@ crbug.com/591099 screen_orientation/screenorientation-unsupported-no-crash.html [ Crash ] crbug.com/591099 scrollbars/auto-scrollbar-fit-content.html [ Failure ] crbug.com/591099 scrollbars/basic-scrollbar.html [ Failure ] -crbug.com/591099 scrollbars/border-box-rect-clips-scrollbars.html [ Failure ] +crbug.com/591099 scrollbars/border-box-rect-clips-scrollbars.html [ Failure Pass ] crbug.com/591099 scrollbars/custom-scrollbar-changing-style-relayout-body-scrollablearea.html [ Crash Pass Timeout ] crbug.com/591099 scrollbars/custom-scrollbar-changing-style-relayout-div-body-scrollablearea.html [ Crash Pass Timeout ] crbug.com/591099 scrollbars/custom-scrollbar-enable-changes-thickness-with-iframe.html [ Failure Pass ] @@ -19190,7 +19202,7 @@ crbug.com/591099 svg/custom/svg-image-intrinsic-size-with-cssstyle-auto-dynamic-image-change.html [ Crash ] crbug.com/591099 svg/custom/svg-image-intrinsic-size-with-cssstyle-auto.html [ Crash ] crbug.com/591099 svg/custom/svg-modify-currentTranslate.html [ Failure ] -crbug.com/591099 svg/custom/svg-root-padding-border-margin.html [ Failure ] +crbug.com/591099 svg/custom/svg-root-padding-border-margin.html [ Failure Pass ] crbug.com/591099 svg/custom/svg-viewBox-dynamic.html [ Failure ] crbug.com/591099 svg/custom/svg-xml-dom-sync.html [ Failure ] crbug.com/591099 svg/custom/tabindex-order.html [ Failure ] @@ -19761,7 +19773,7 @@ crbug.com/591099 svg/transforms/transform-boxsize-usecounter-no-trigger-1.html [ Crash ] crbug.com/591099 svg/transforms/transform-boxsize-usecounter-no-trigger-2.html [ Crash ] crbug.com/591099 svg/transforms/transform-origin-presentation-attribute.xhtml [ Failure ] -crbug.com/591099 svg/wicd/rightsizing-grid.html [ Failure ] +crbug.com/591099 svg/wicd/rightsizing-grid.html [ Failure Pass ] crbug.com/591099 svg/wicd/test-rightsizing-a.xhtml [ Failure ] crbug.com/591099 svg/wicd/test-rightsizing-b.xhtml [ Failure ] crbug.com/591099 svg/wicd/test-scalable-background-image1.xhtml [ Failure ] @@ -19808,7 +19820,7 @@ crbug.com/591099 tables/mozilla/bugs/bug113235-2.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug11384q.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug12008.html [ Failure ] -crbug.com/591099 tables/mozilla/bugs/bug120364.html [ Failure ] +crbug.com/591099 tables/mozilla/bugs/bug120364.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug126742.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug1271.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug12908-1.html [ Failure ] @@ -20636,10 +20648,10 @@ crbug.com/591099 virtual/disable-spinvalidation/compositing/visibility/visibility-image-layers-dynamic.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/compositing/visibility/visibility-on-distant-descendant.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/compositing/webgl/webgl-background-color.html [ Failure ] -crbug.com/591099 virtual/disable-spinvalidation/compositing/webgl/webgl-no-alpha.html [ Failure ] +crbug.com/591099 virtual/disable-spinvalidation/compositing/webgl/webgl-no-alpha.html [ Failure Pass ] crbug.com/591099 virtual/disable-spinvalidation/compositing/webgl/webgl-nonpremultiplied-blend.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/compositing/webgl/webgl-reflection.html [ Failure ] -crbug.com/591099 virtual/disable-spinvalidation/compositing/webgl/webgl-repaint.html [ Failure ] +crbug.com/591099 virtual/disable-spinvalidation/compositing/webgl/webgl-repaint.html [ Failure Pass ] crbug.com/591099 virtual/disable-spinvalidation/compositing/will-change/composited-layers.html [ Failure Pass ] crbug.com/591099 virtual/disable-spinvalidation/compositing/will-change/parse-will-change.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/compositing/z-order/collect-layers-does-not-initialize-pos-z-order-list.html [ Failure ] @@ -20648,11 +20660,12 @@ crbug.com/591099 virtual/disable-spinvalidation/paint/background/fieldset-legend-background-shadow-border-radius.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/background/rounded-clip-fractional-offset.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/clipath/clip-path-with-background-and-box-behind.html [ Failure Pass ] +crbug.com/591099 virtual/disable-spinvalidation/paint/float-painted-when-no-longer-self-painting.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/frames/frameset-with-stacking-context-and-not-stacking-context-children.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/frames/frameset-with-stacking-contexts.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/high-contrast-mode/image-filter-all/text-on-backgrounds.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/images/animated-gif-last-frame-crash.html [ Crash ] -crbug.com/591099 virtual/disable-spinvalidation/paint/inline/floating-inline.html [ Failure ] +crbug.com/591099 virtual/disable-spinvalidation/paint/inline/floating-inline.html [ Failure Pass ] crbug.com/591099 virtual/disable-spinvalidation/paint/inline/focus-ring-under-absolute-with-relative-continuation.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/inline/outline-offset.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/4774354.html [ Failure ] @@ -20822,7 +20835,7 @@ crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/destroy-overlay-scrollbar.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/destroy-scrollbar.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/details-open-repaint.html [ Crash Failure ] -crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/do-not-paint-below-image-baseline.html [ Failure ] +crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/do-not-paint-below-image-baseline.html [ Failure Pass ] crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/dont-invalidate-root-layer-when-composited-layer-becomes-visible.html [ Failure Pass ] crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/dynamic-table-vertical-alignment-change.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/erase-overflow.html [ Failure Pass ] @@ -21218,7 +21231,6 @@ crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/text-selection-rect-in-overflow.html [ Failure Pass ] crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/text-shadow-horizontal.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/text-shadow.html [ Failure ] -crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/textarea-caret.html [ Crash Failure Pass ] crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/trailing-floats-root-line-box-overflow.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/transform-absolute-child.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/transform-absolute-in-positioned-container.html [ Failure ] @@ -21227,7 +21239,7 @@ crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/transform-layout-repaint.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/transform-relative-position.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/transform-repaint-descendants.html [ Failure ] -crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/transform-replaced-shadows.html [ Failure ] +crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/transform-replaced-shadows.html [ Failure Pass ] crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/transform-rotate-and-remove.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/transform-translate.html [ Failure ] crbug.com/591099 virtual/disable-spinvalidation/paint/invalidation/update-visual-rects-after-compositing-change.html [ Failure ] @@ -21491,19 +21503,19 @@ crbug.com/591099 virtual/exotic-color-space/images/animated-background-image-crash.html [ Failure ] crbug.com/591099 virtual/exotic-color-space/images/color-jpeg-with-color-profile.html [ Failure ] crbug.com/591099 virtual/exotic-color-space/images/color-profile-background-clip-text.html [ Failure ] -crbug.com/591099 virtual/exotic-color-space/images/color-profile-background-image-cover.html [ Failure ] -crbug.com/591099 virtual/exotic-color-space/images/color-profile-background-image-cross-fade-png.html [ Failure ] -crbug.com/591099 virtual/exotic-color-space/images/color-profile-background-image-cross-fade.html [ Failure ] -crbug.com/591099 virtual/exotic-color-space/images/color-profile-background-image-repeat.html [ Failure ] -crbug.com/591099 virtual/exotic-color-space/images/color-profile-background-image-space.html [ Failure ] +crbug.com/591099 virtual/exotic-color-space/images/color-profile-background-image-cover.html [ Failure Pass ] +crbug.com/591099 virtual/exotic-color-space/images/color-profile-background-image-cross-fade-png.html [ Failure Pass ] +crbug.com/591099 virtual/exotic-color-space/images/color-profile-background-image-cross-fade.html [ Failure Pass ] +crbug.com/591099 virtual/exotic-color-space/images/color-profile-background-image-repeat.html [ Failure Pass ] +crbug.com/591099 virtual/exotic-color-space/images/color-profile-background-image-space.html [ Failure Pass ] crbug.com/591099 virtual/exotic-color-space/images/color-profile-border-image-source.html [ Failure ] crbug.com/591099 virtual/exotic-color-space/images/color-profile-border-radius.html [ Failure ] crbug.com/591099 virtual/exotic-color-space/images/color-profile-drag-image.html [ Failure ] crbug.com/591099 virtual/exotic-color-space/images/color-profile-filter.html [ Failure ] crbug.com/591099 virtual/exotic-color-space/images/color-profile-group.html [ Failure ] crbug.com/591099 virtual/exotic-color-space/images/color-profile-iframe.html [ Failure ] -crbug.com/591099 virtual/exotic-color-space/images/color-profile-image-canvas-pattern.html [ Failure ] -crbug.com/591099 virtual/exotic-color-space/images/color-profile-image-canvas.html [ Failure ] +crbug.com/591099 virtual/exotic-color-space/images/color-profile-image-canvas-pattern.html [ Failure Pass ] +crbug.com/591099 virtual/exotic-color-space/images/color-profile-image-canvas.html [ Failure Pass ] crbug.com/591099 virtual/exotic-color-space/images/color-profile-image-filter-all.html [ Failure ] crbug.com/591099 virtual/exotic-color-space/images/color-profile-image-object-fit.html [ Failure ] crbug.com/591099 virtual/exotic-color-space/images/color-profile-image-profile-match.html [ Failure ] @@ -21525,7 +21537,6 @@ crbug.com/591099 virtual/exotic-color-space/images/cross-fade-svg-size.html [ Failure ] crbug.com/591099 virtual/exotic-color-space/images/cross-fade-tiled.html [ Failure ] crbug.com/591099 virtual/exotic-color-space/images/destroyed-image-load-event.html [ Crash ] -crbug.com/591099 virtual/exotic-color-space/images/drag-pdf-as-image.html [ Crash Pass ] crbug.com/591099 virtual/exotic-color-space/images/drag-svg-image.html [ Failure ] crbug.com/591099 virtual/exotic-color-space/images/embed-does-not-propagate-dimensions-to-object-ancestor.html [ Failure ] crbug.com/591099 virtual/exotic-color-space/images/exif-orientation-css.html [ Crash Failure ] @@ -21575,9 +21586,9 @@ crbug.com/591099 virtual/exotic-color-space/images/imagemap-scroll.html [ Crash ] crbug.com/591099 virtual/exotic-color-space/images/img-dimensions-styled.html [ Crash ] crbug.com/591099 virtual/exotic-color-space/images/invalid-image-url-crash.html [ Crash ] -crbug.com/591099 virtual/exotic-color-space/images/jpeg-yuv-image-decoding.html [ Failure ] -crbug.com/591099 virtual/exotic-color-space/images/jpeg-yuv-progressive-canvas.html [ Failure ] -crbug.com/591099 virtual/exotic-color-space/images/jpeg-yuv-progressive-image.html [ Failure ] +crbug.com/591099 virtual/exotic-color-space/images/jpeg-yuv-image-decoding.html [ Failure Pass ] +crbug.com/591099 virtual/exotic-color-space/images/jpeg-yuv-progressive-canvas.html [ Failure Pass ] +crbug.com/591099 virtual/exotic-color-space/images/jpeg-yuv-progressive-image.html [ Failure Pass ] crbug.com/591099 virtual/exotic-color-space/images/link-body-content-imageDimensionChanged-crash.html [ Failure ] crbug.com/591099 virtual/exotic-color-space/images/load-img-with-empty-src.html [ Failure ] crbug.com/591099 virtual/exotic-color-space/images/motion-jpeg-single-frame.html [ Failure ] @@ -21619,19 +21630,19 @@ crbug.com/591099 virtual/gpu-rasterization/images/alt-text-wrapping.html [ Crash Failure ] crbug.com/591099 virtual/gpu-rasterization/images/animated-background-image-crash.html [ Failure ] crbug.com/591099 virtual/gpu-rasterization/images/color-jpeg-with-color-profile.html [ Failure ] -crbug.com/591099 virtual/gpu-rasterization/images/color-profile-background-image-cover.html [ Failure ] -crbug.com/591099 virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-png.html [ Failure ] -crbug.com/591099 virtual/gpu-rasterization/images/color-profile-background-image-cross-fade.html [ Crash Failure ] -crbug.com/591099 virtual/gpu-rasterization/images/color-profile-background-image-repeat.html [ Failure ] -crbug.com/591099 virtual/gpu-rasterization/images/color-profile-background-image-space.html [ Failure ] +crbug.com/591099 virtual/gpu-rasterization/images/color-profile-background-image-cover.html [ Failure Pass ] +crbug.com/591099 virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-png.html [ Failure Pass ] +crbug.com/591099 virtual/gpu-rasterization/images/color-profile-background-image-cross-fade.html [ Crash Failure Pass ] +crbug.com/591099 virtual/gpu-rasterization/images/color-profile-background-image-repeat.html [ Failure Pass ] +crbug.com/591099 virtual/gpu-rasterization/images/color-profile-background-image-space.html [ Failure Pass ] crbug.com/591099 virtual/gpu-rasterization/images/color-profile-border-image-source.html [ Failure ] crbug.com/591099 virtual/gpu-rasterization/images/color-profile-border-radius.html [ Failure ] crbug.com/591099 virtual/gpu-rasterization/images/color-profile-drag-image.html [ Failure ] crbug.com/591099 virtual/gpu-rasterization/images/color-profile-filter.html [ Failure ] crbug.com/591099 virtual/gpu-rasterization/images/color-profile-group.html [ Crash Failure ] crbug.com/591099 virtual/gpu-rasterization/images/color-profile-iframe.html [ Failure ] -crbug.com/591099 virtual/gpu-rasterization/images/color-profile-image-canvas-pattern.html [ Failure ] -crbug.com/591099 virtual/gpu-rasterization/images/color-profile-image-canvas.html [ Failure ] +crbug.com/591099 virtual/gpu-rasterization/images/color-profile-image-canvas-pattern.html [ Failure Pass ] +crbug.com/591099 virtual/gpu-rasterization/images/color-profile-image-canvas.html [ Failure Pass ] crbug.com/591099 virtual/gpu-rasterization/images/color-profile-image-filter-all.html [ Failure ] crbug.com/591099 virtual/gpu-rasterization/images/color-profile-image-object-fit.html [ Failure ] crbug.com/591099 virtual/gpu-rasterization/images/color-profile-image-profile-match.html [ Failure ] @@ -21651,7 +21662,6 @@ crbug.com/591099 virtual/gpu-rasterization/images/cross-fade-sizing.html [ Failure ] crbug.com/591099 virtual/gpu-rasterization/images/cross-fade-tiled.html [ Failure ] crbug.com/591099 virtual/gpu-rasterization/images/destroyed-image-load-event.html [ Crash ] -crbug.com/591099 virtual/gpu-rasterization/images/drag-pdf-as-image.html [ Crash Pass ] crbug.com/591099 virtual/gpu-rasterization/images/drag-svg-image.html [ Failure ] crbug.com/591099 virtual/gpu-rasterization/images/embed-does-not-propagate-dimensions-to-object-ancestor.html [ Failure Pass ] crbug.com/591099 virtual/gpu-rasterization/images/exif-orientation-css.html [ Crash Failure ] @@ -21701,9 +21711,9 @@ crbug.com/591099 virtual/gpu-rasterization/images/imagemap-scroll.html [ Crash ] crbug.com/591099 virtual/gpu-rasterization/images/img-dimensions-styled.html [ Crash ] crbug.com/591099 virtual/gpu-rasterization/images/invalid-image-url-crash.html [ Crash ] -crbug.com/591099 virtual/gpu-rasterization/images/jpeg-yuv-image-decoding.html [ Failure ] -crbug.com/591099 virtual/gpu-rasterization/images/jpeg-yuv-progressive-canvas.html [ Failure ] -crbug.com/591099 virtual/gpu-rasterization/images/jpeg-yuv-progressive-image.html [ Failure ] +crbug.com/591099 virtual/gpu-rasterization/images/jpeg-yuv-image-decoding.html [ Failure Pass ] +crbug.com/591099 virtual/gpu-rasterization/images/jpeg-yuv-progressive-canvas.html [ Failure Pass ] +crbug.com/591099 virtual/gpu-rasterization/images/jpeg-yuv-progressive-image.html [ Failure Pass ] crbug.com/591099 virtual/gpu-rasterization/images/link-body-content-imageDimensionChanged-crash.html [ Failure ] crbug.com/591099 virtual/gpu-rasterization/images/load-img-with-empty-src.html [ Failure ] crbug.com/591099 virtual/gpu-rasterization/images/motion-jpeg-single-frame.html [ Failure ] @@ -21964,7 +21974,6 @@ crbug.com/591099 virtual/mojo-loading/http/tests/inspector/network/network-filters.html [ Failure Pass ] crbug.com/591099 virtual/mojo-loading/http/tests/inspector/network/waterfall-images.html [ Failure Pass ] crbug.com/591099 virtual/mojo-loading/http/tests/inspector/persistence/automapping-sourcemap.html [ Failure Pass Timeout ] -crbug.com/591099 virtual/mojo-loading/http/tests/misc/image-load-outlives-gc-without-crashing.html [ Failure Pass ] crbug.com/591099 virtual/mojo-loading/http/tests/security/cors-rfc1918/addressspace-document-csp-appcache.html [ Failure Pass Timeout ] crbug.com/591099 virtual/mojo-loading/http/tests/serviceworker/ServiceWorkerGlobalScope/registration-attribute.html [ Failure Pass ] crbug.com/591099 virtual/mojo-localstorage/external/wpt/webstorage/event_no_duplicates.html [ Crash ] @@ -22047,7 +22056,6 @@ crbug.com/591099 virtual/off-main-thread-fetch/external/wpt/service-workers/service-worker/register-link-header.https.html [ Crash ] crbug.com/591099 virtual/off-main-thread-fetch/external/wpt/service-workers/service-worker/register-same-scope-different-script-url.https.html [ Crash ] crbug.com/591099 virtual/off-main-thread-fetch/external/wpt/service-workers/service-worker/registration-iframe.https.html [ Crash ] -crbug.com/591099 virtual/off-main-thread-fetch/external/wpt/service-workers/service-worker/skip-waiting-using-registration.https.html [ Pass Timeout ] crbug.com/591099 virtual/off-main-thread-fetch/external/wpt/service-workers/service-worker/unregister-controller.https.html [ Crash ] crbug.com/591099 virtual/off-main-thread-fetch/external/wpt/service-workers/service-worker/unregister-then-register-new-script.https.html [ Crash ] crbug.com/591099 virtual/off-main-thread-fetch/external/wpt/service-workers/service-worker/unregister-then-register.https.html [ Crash ] @@ -22276,7 +22284,7 @@ crbug.com/591099 virtual/prefer_compositing_to_lcd_text/scrollbars/auto-scrollbar-fades-out.html [ Failure ] crbug.com/591099 virtual/prefer_compositing_to_lcd_text/scrollbars/auto-scrollbar-fit-content.html [ Failure ] crbug.com/591099 virtual/prefer_compositing_to_lcd_text/scrollbars/basic-scrollbar.html [ Failure ] -crbug.com/591099 virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars.html [ Failure ] +crbug.com/591099 virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars.html [ Failure Pass ] crbug.com/591099 virtual/prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-appearance-property.html [ Failure ] crbug.com/591099 virtual/prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-changing-style-relayout-body-scrollablearea.html [ Crash Pass Timeout ] crbug.com/591099 virtual/prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-changing-style-relayout-div-body-scrollablearea.html [ Crash Pass Timeout ] @@ -22316,7 +22324,6 @@ crbug.com/591099 virtual/rootlayerscrolls/fast/scrolling/content-box-smaller-than-scrollbar.html [ Crash ] crbug.com/591099 virtual/rootlayerscrolls/fast/scrolling/custom-scrollbar-style-applied.html [ Failure ] crbug.com/591099 virtual/rootlayerscrolls/fast/scrolling/editor-command-scroll-page-scale.html [ Failure ] -crbug.com/591099 virtual/rootlayerscrolls/fast/scrolling/fixed-position-behind-scrollbar.html [ Failure Pass ] crbug.com/591099 virtual/rootlayerscrolls/fast/scrolling/fractional-scroll-height-chaining.html [ Failure ] crbug.com/591099 virtual/rootlayerscrolls/fast/scrolling/fractional-scroll-offset-document.html [ Failure ] crbug.com/591099 virtual/rootlayerscrolls/fast/scrolling/hover-during-scroll.html [ Failure Timeout ] @@ -22341,7 +22348,7 @@ crbug.com/591099 virtual/rootlayerscrolls/scrollbars/auto-scrollbar-fades-out.html [ Failure ] crbug.com/591099 virtual/rootlayerscrolls/scrollbars/auto-scrollbar-fit-content.html [ Failure ] crbug.com/591099 virtual/rootlayerscrolls/scrollbars/basic-scrollbar.html [ Failure ] -crbug.com/591099 virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars.html [ Failure ] +crbug.com/591099 virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars.html [ Failure Pass ] crbug.com/591099 virtual/rootlayerscrolls/scrollbars/custom-scrollbar-appearance-property.html [ Failure ] crbug.com/591099 virtual/rootlayerscrolls/scrollbars/custom-scrollbar-changing-style-relayout-body-scrollablearea.html [ Crash Pass Timeout ] crbug.com/591099 virtual/rootlayerscrolls/scrollbars/custom-scrollbar-changing-style-relayout-div-body-scrollablearea.html [ Crash Pass Timeout ] @@ -22494,16 +22501,10 @@ crbug.com/591099 virtual/threaded/animations/3d/change-transform-in-end-event.html [ Failure Pass ] crbug.com/591099 virtual/threaded/animations/3d/state-at-end-event-transform.html [ Failure Pass ] crbug.com/591099 virtual/threaded/animations/animation-css-rule-types.html [ Failure ] -crbug.com/591099 virtual/threaded/animations/animation-end-event-destroy-renderer.html [ Failure ] crbug.com/591099 virtual/threaded/animations/animation-events-create.html [ Failure ] crbug.com/591099 virtual/threaded/animations/animation-inherit-initial-unprefixed.html [ Failure ] -crbug.com/591099 virtual/threaded/animations/animation-iteration-event-destroy-renderer.html [ Failure ] -crbug.com/591099 virtual/threaded/animations/animation-on-inline-crash.html [ Failure ] -crbug.com/591099 virtual/threaded/animations/animation-start-event-destroy-renderer.html [ Failure ] crbug.com/591099 virtual/threaded/animations/animations-parsing.html [ Timeout ] crbug.com/591099 virtual/threaded/animations/animations-responsive-to-color-change.html [ Crash ] -crbug.com/591099 virtual/threaded/animations/base-render-style-crash.html [ Crash ] -crbug.com/591099 virtual/threaded/animations/checkbox-padding-animation-crash.html [ Crash ] crbug.com/591099 virtual/threaded/animations/clear-svg-animation-effects.html [ Crash ] crbug.com/591099 virtual/threaded/animations/composition/background-position-composition.html [ Crash ] crbug.com/591099 virtual/threaded/animations/composition/caret-color-composition.html [ Crash ] @@ -22515,12 +22516,7 @@ crbug.com/591099 virtual/threaded/animations/display-inline-style-adjust.html [ Failure Timeout ] crbug.com/591099 virtual/threaded/animations/display-none-cancel-computedstyle.html [ Failure ] crbug.com/591099 virtual/threaded/animations/display-none-terminates-animation.html [ Failure ] -crbug.com/591099 virtual/threaded/animations/element-animate-float-crash.html [ Failure Pass ] -crbug.com/591099 virtual/threaded/animations/empty-keyframe-animation-composited.html [ Failure ] -crbug.com/591099 virtual/threaded/animations/empty-keyframes-composited.html [ Failure ] -crbug.com/591099 virtual/threaded/animations/empty-keyframes.html [ Failure ] crbug.com/591099 virtual/threaded/animations/img-element-transform.html [ Crash Timeout ] -crbug.com/591099 virtual/threaded/animations/import-crash.html [ Failure ] crbug.com/591099 virtual/threaded/animations/inline-block-transform.html [ Crash ] crbug.com/591099 virtual/threaded/animations/inline-element-animation-end-hit-test.html [ Failure ] crbug.com/591099 virtual/threaded/animations/interpolation/backdrop-filter-interpolation.html [ Crash ] @@ -22611,17 +22607,32 @@ crbug.com/591099 virtual/threaded/animations/keyframes-cssom-unprefixed-02.html [ Failure ] crbug.com/591099 virtual/threaded/animations/keyframes-rule.html [ Failure ] crbug.com/591099 virtual/threaded/animations/lazy-detached-animation-stop.html [ Failure ] -crbug.com/591099 virtual/threaded/animations/length-zero-percent-crash.html [ Failure Pass ] crbug.com/591099 virtual/threaded/animations/negative-delay-events.html [ Failure ] -crbug.com/591099 virtual/threaded/animations/option-element-crash.html [ Crash ] -crbug.com/591099 virtual/threaded/animations/option-opacity-inherit-crash.html [ Crash ] -crbug.com/591099 virtual/threaded/animations/pause-crash.html [ Failure ] crbug.com/591099 virtual/threaded/animations/play-state-initially-paused-start-event.html [ Failure ] crbug.com/591099 virtual/threaded/animations/play-state.html [ Failure ] crbug.com/591099 virtual/threaded/animations/responsive/d-responsive.html [ Crash ] crbug.com/591099 virtual/threaded/animations/responsive/line-height-responsive.html [ Pass Timeout ] crbug.com/591099 virtual/threaded/animations/rotate-transform-equivalent.html [ Failure Timeout ] crbug.com/591099 virtual/threaded/animations/skew-notsequential-compositor.html [ Failure Timeout ] +crbug.com/591099 virtual/threaded/animations/stability/animation-end-event-destroy-renderer.html [ Failure ] +crbug.com/591099 virtual/threaded/animations/stability/animation-iteration-event-destroy-renderer.html [ Failure ] +crbug.com/591099 virtual/threaded/animations/stability/animation-on-inline-crash.html [ Failure ] +crbug.com/591099 virtual/threaded/animations/stability/animation-start-event-destroy-renderer.html [ Failure ] +crbug.com/591099 virtual/threaded/animations/stability/base-render-style-crash.html [ Crash ] +crbug.com/591099 virtual/threaded/animations/stability/checkbox-padding-animation-crash.html [ Crash ] +crbug.com/591099 virtual/threaded/animations/stability/element-animate-float-crash.html [ Failure Pass ] +crbug.com/591099 virtual/threaded/animations/stability/empty-keyframe-animation-composited.html [ Failure ] +crbug.com/591099 virtual/threaded/animations/stability/empty-keyframes-composited.html [ Failure ] +crbug.com/591099 virtual/threaded/animations/stability/empty-keyframes.html [ Failure ] +crbug.com/591099 virtual/threaded/animations/stability/import-crash.html [ Failure ] +crbug.com/591099 virtual/threaded/animations/stability/length-zero-percent-crash.html [ Failure Pass ] +crbug.com/591099 virtual/threaded/animations/stability/option-element-crash.html [ Crash ] +crbug.com/591099 virtual/threaded/animations/stability/option-opacity-inherit-crash.html [ Crash ] +crbug.com/591099 virtual/threaded/animations/stability/pause-crash.html [ Failure ] +crbug.com/591099 virtual/threaded/animations/stability/svg-element-css-animation-crash.html [ Crash ] +crbug.com/591099 virtual/threaded/animations/stability/svg-length-unittype-crash.html [ Crash ] +crbug.com/591099 virtual/threaded/animations/stability/zero-duration-infinite-iterations.html [ Failure ] +crbug.com/591099 virtual/threaded/animations/stability/zero-duration-large-start-delay.html [ Failure ] crbug.com/591099 virtual/threaded/animations/state-at-end-event.html [ Failure Pass Timeout ] crbug.com/591099 virtual/threaded/animations/svg-attribute-composition/svg-amplitude-composition.html [ Crash ] crbug.com/591099 virtual/threaded/animations/svg-attribute-composition/svg-azimuth-composition.html [ Crash ] @@ -22770,13 +22781,9 @@ crbug.com/591099 virtual/threaded/animations/svg-attribute-responsive/svg-tableValues-responsive.html [ Crash ] crbug.com/591099 virtual/threaded/animations/svg-attribute-responsive/svg-transform-responsive.html [ Crash ] crbug.com/591099 virtual/threaded/animations/svg-attribute-responsive/svg-x-list-responsive.html [ Crash ] -crbug.com/591099 virtual/threaded/animations/svg-element-css-animation-crash.html [ Crash ] -crbug.com/591099 virtual/threaded/animations/svg-length-unittype-crash.html [ Crash ] crbug.com/591099 virtual/threaded/animations/svg-presentation-attribute-animation.html [ Crash ] crbug.com/591099 virtual/threaded/animations/svg-responsive-to-timing-updates.html [ Crash ] crbug.com/591099 virtual/threaded/animations/timing-model.html [ Pass Timeout ] -crbug.com/591099 virtual/threaded/animations/zero-duration-infinite-iterations.html [ Failure ] -crbug.com/591099 virtual/threaded/animations/zero-duration-large-start-delay.html [ Failure ] crbug.com/591099 virtual/threaded/compositing/visibility/compositing-and-visibility-turned-off-together.html [ Failure ] crbug.com/591099 virtual/threaded/compositing/visibility/hidden-iframe.html [ Failure ] crbug.com/591099 virtual/threaded/compositing/visibility/layer-visible-content.html [ Failure ] @@ -22785,10 +22792,10 @@ crbug.com/591099 virtual/threaded/compositing/visibility/visibility-image-layers-dynamic.html [ Failure ] crbug.com/591099 virtual/threaded/compositing/visibility/visibility-on-distant-descendant.html [ Failure ] crbug.com/591099 virtual/threaded/compositing/webgl/webgl-background-color.html [ Failure ] -crbug.com/591099 virtual/threaded/compositing/webgl/webgl-no-alpha.html [ Failure ] +crbug.com/591099 virtual/threaded/compositing/webgl/webgl-no-alpha.html [ Failure Pass ] crbug.com/591099 virtual/threaded/compositing/webgl/webgl-nonpremultiplied-blend.html [ Failure ] crbug.com/591099 virtual/threaded/compositing/webgl/webgl-reflection.html [ Failure ] -crbug.com/591099 virtual/threaded/compositing/webgl/webgl-repaint.html [ Failure ] +crbug.com/591099 virtual/threaded/compositing/webgl/webgl-repaint.html [ Failure Pass ] crbug.com/591099 virtual/threaded/fast/compositorworker/request-animation-frame.html [ Failure ] crbug.com/591099 virtual/threaded/fast/scroll-behavior/bordered-container-child-scroll.html [ Failure ] crbug.com/591099 virtual/threaded/fast/scroll-behavior/first-scroll-runs-on-compositor.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-network-service b/third_party/WebKit/LayoutTests/FlagExpectations/enable-network-service index ade9c10..17e0c13 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-network-service +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-network-service
@@ -2532,7 +2532,6 @@ Bug(none) http/tests/security/powerfulFeatureRestrictions/geolocation-on-secure-origin-in-insecure-origin.html [ Timeout ] Bug(none) http/tests/security/powerfulFeatureRestrictions/geolocation-on-secure-origin-in-secure-origin.html [ Timeout ] Bug(none) http/tests/security/powerfulFeatureRestrictions/serviceworker-on-insecure-origin.html [ Failure ] -Bug(none) http/tests/security/powerfulFeatureRestrictions/webshare-on-insecure-origin.html [ Timeout ] Bug(none) http/tests/security/referrer-on-client-redirect.html [ Timeout ] Bug(none) http/tests/security/referrer-policy-attribute-anchor-no-referrer-when-downgrade.html [ Timeout ] Bug(none) http/tests/security/referrer-policy-attribute-area-no-referrer-when-downgrade.html [ Timeout ] @@ -3358,4 +3357,3 @@ Bug(none) webshare/share-nonutf8-encoding.html [ Timeout ] Bug(none) webshare/share-success.html [ Timeout ] Bug(none) webshare/share-types.html [ Timeout ] -Bug(none) webshare/share-without-user-gesture.html [ Timeout ]
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 index bde2f64..ee82b8a 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
@@ -1005,35 +1005,22 @@ Bug(none) paint/invalidation/single-line-cells-repeating-thead-break-inside-on-thead-only.html [ Crash ] Bug(none) paint/invalidation/svg/deep-nested-embedded-svg-size-changes-no-layout-triggers-1.html [ Failure ] Bug(none) paint/invalidation/svg/deep-nested-embedded-svg-size-changes-no-layout-triggers-2.html [ Failure ] -Bug(none) paint/invalidation/svg/repaint-moving-svg-and-div.xhtml [ Failure ] Bug(none) paint/invalidation/svg/use-detach.svg [ Failure ] Bug(none) paint/background/rounded-clip-fractional-offset.html [ Failure ] Bug(none) paint/clipath/clip-path-with-background-and-box-behind.html [ Failure ] Bug(none) paint/frames/frameset-with-stacking-context-and-not-stacking-context-children.html [ Failure ] Bug(none) paint/frames/frameset-with-stacking-contexts.html [ Failure ] -Bug(none) paint/invalidation/absolute-position-change-containing-block.html [ Failure ] Bug(none) paint/invalidation/absolute-position-changed.html [ Failure ] Bug(none) paint/invalidation/absolute-position-moved.html [ Failure ] Bug(none) paint/invalidation/abspos-shift-image-incorrect-repaint.html [ Failure ] Bug(none) paint/invalidation/animated-gif-transformed-offscreen.html [ Failure ] Bug(none) paint/invalidation/background-image-paint-invalidation-large-abspos-div.html [ Failure ] -Bug(none) paint/invalidation/background-misaligned.html [ Failure ] Bug(none) paint/invalidation/background-resize-height.html [ Failure ] Bug(none) paint/invalidation/backgroundSizeRepaint.html [ Failure ] Bug(none) paint/invalidation/block-layout-inline-children-float-positioned.html [ Failure ] -Bug(none) paint/invalidation/body-background-image.html [ Failure ] -Bug(none) paint/invalidation/border-image-outset-add-repaint.html [ Failure ] -Bug(none) paint/invalidation/border-image-outset-change-repaint.html [ Failure ] -Bug(none) paint/invalidation/border-radius-repaint-2.html [ Failure ] -Bug(none) paint/invalidation/border-repaint-glitch.html [ Failure ] -Bug(none) paint/invalidation/box-sizing.html [ Failure ] -Bug(none) paint/invalidation/bugzilla-5699.html [ Failure ] -Bug(none) paint/invalidation/bugzilla-6473.html [ Failure ] crbug.com/732612 paint/invalidation/canvas-composite-repaint-by-all-imagesource.html [ Failure ] crbug.com/732612 paint/invalidation/canvas-putImageData.html [ Failure ] crbug.com/732612 paint/invalidation/canvas-resize.html [ Failure ] -Bug(none) paint/invalidation/caret-invalidation-in-overflow-scroll.html [ Failure ] -Bug(none) paint/invalidation/caret-subpixel.html [ Failure ] Bug(none) paint/invalidation/caret-with-composited-scroll.html [ Failure ] Bug(none) paint/invalidation/child-of-sub-pixel-offset-composited-layer.html [ Failure ] Bug(none) paint/invalidation/clip-path-constant-repaint.html [ Failure ] @@ -1089,22 +1076,14 @@ Bug(none) paint/invalidation/compositing/squashing-inside-preserve-3d-element.html [ Failure ] Bug(none) paint/invalidation/compositing/stacked-float-under-composited-inline.html [ Failure ] Bug(none) paint/invalidation/compositing/subpixel-offset-scaled-transform-composited.html [ Failure ] -Bug(none) paint/invalidation/compositing/text-color-change.html [ Failure ] -Bug(none) paint/invalidation/compositing/text-match-highlight.html [ Failure ] Bug(none) paint/invalidation/compositing/tricky-element-removal-crash.html [ Failure ] -Bug(none) paint/invalidation/compositing/updating-scrolling-container-and-content.html [ Failure ] -Bug(none) paint/invalidation/compositing/updating-scrolling-container.html [ Failure ] Bug(none) paint/invalidation/compositing/updating-scrolling-content.html [ Failure ] -Bug(none) paint/invalidation/control-clip.html [ Failure ] Bug(none) paint/invalidation/create-layer-repaint.html [ Failure ] Bug(none) paint/invalidation/css-grid-layout/grid-item-z-index-change-repaint.html [ Failure ] Bug(none) paint/invalidation/destroy-composited-scrollbar.html [ Failure ] -Bug(none) paint/invalidation/destroy-overlay-scrollbar.html [ Failure ] -Bug(none) paint/invalidation/destroy-scrollbar.html [ Failure ] Bug(none) paint/invalidation/document-flipped-blocks-writing-mode-scroll.html [ Failure ] Bug(none) paint/invalidation/dont-invalidate-root-layer-when-composited-layer-becomes-visible.html [ Failure ] Bug(none) paint/invalidation/empty-object-move-and-resize.html [ Failure ] -Bug(none) paint/invalidation/filter-invalidation-after-display.html [ Failure ] Bug(none) paint/invalidation/filter-invalidation-positioned-child.html [ Failure ] Bug(none) paint/invalidation/filter-invalidation-with-composited-container-change.html [ Failure ] Bug(none) paint/invalidation/filter-on-html-element-with-fixed-position-child.html [ Failure ] @@ -1145,7 +1124,6 @@ Bug(none) paint/invalidation/fixed.html [ Failure ] Bug(none) paint/invalidation/flexbox/repaint-on-layout.html [ Failure ] Bug(none) paint/invalidation/flexbox/repaint-opacity-change.html [ Failure ] -Bug(none) paint/invalidation/flexbox/repaint-rtl-column.html [ Failure ] Bug(none) paint/invalidation/flexbox/repaint.html [ Failure ] Bug(none) paint/invalidation/flipped-blocks-writing-mode-scroll.html [ Failure ] Bug(none) paint/invalidation/full-viewport-repaint-for-background-attachment-fixed.html [ Failure ] @@ -1153,7 +1131,6 @@ Bug(none) paint/invalidation/iframe-display-none-to-display-block.html [ Failure ] Bug(none) paint/invalidation/image-resize.html [ Failure ] Bug(none) paint/invalidation/inline-focus.html [ Failure ] -Bug(none) paint/invalidation/inline-outline-repaint-2.html [ Failure ] Bug(none) paint/invalidation/inline-style-change-in-scrolled-view.html [ Failure ] Bug(none) paint/invalidation/invalidate-after-composited-scroll-of-window.html [ Failure ] Bug(none) paint/invalidation/invalidate-after-composited-scroll.html [ Failure ] @@ -1161,17 +1138,11 @@ Bug(none) paint/invalidation/invalidate-caret-in-non-composited-scrolling-container.html [ Failure ] Bug(none) paint/invalidation/invalidate-cell-in-row-with-offset.html [ Failure ] Bug(none) paint/invalidation/invalidate-descendants-when-receiving-paint-layer.html [ Failure ] -Bug(none) paint/invalidation/invalidate-invisible-element.html [ Failure ] Bug(none) paint/invalidation/invalidate-paint-in-iframe-in-composited-layer.html [ Failure ] Bug(none) paint/invalidation/invalidation-after-opacity-change-subtree.html [ Failure ] Bug(none) paint/invalidation/invalidation-on-foreground-graphics-layer.html [ Failure ] Bug(none) paint/invalidation/japanese-rl-selection-repaint.html [ Failure ] -Bug(none) paint/invalidation/layer-hide-when-needs-layout.html [ Failure ] Bug(none) paint/invalidation/layout-state-only-positioned.html [ Failure ] -Bug(none) paint/invalidation/layout-state-scrolloffset3.html [ Failure ] -Bug(none) paint/invalidation/layoutstate-invalid-invalidation-inline-relative-positioned.html [ Failure ] -Bug(none) paint/invalidation/line-flow-with-floats-3.html [ Failure ] -Bug(none) paint/invalidation/line-flow-with-floats-5.html [ Failure ] Bug(none) paint/invalidation/media-audio-no-spurious-repaints.html [ Failure ] Bug(none) paint/invalidation/mix-blend-mode-separate-stacking-context.html [ Failure ] Bug(none) paint/invalidation/multicol-as-paint-container.html [ Failure ] @@ -1185,46 +1156,33 @@ Bug(none) paint/invalidation/multicol-with-text.html [ Failure ] Bug(none) paint/invalidation/multiple-backgrounds-style-change.html [ Failure ] Bug(none) paint/invalidation/nested-fixed-iframe-scrolled.html [ Failure ] -Bug(none) paint/invalidation/non-text-link-invalidation-optimization.html [ Failure ] Bug(none) paint/invalidation/offset-change-wrong-invalidation-with-float.html [ Failure ] Bug(none) paint/invalidation/opacity-change-on-overflow-float.html [ Failure ] Bug(none) paint/invalidation/outline-add-repaint.html [ Failure ] Bug(none) paint/invalidation/outline-change-repaint.html [ Failure ] -Bug(none) paint/invalidation/overflow-auto-in-overflow-auto-scrolled.html [ Failure ] Bug(none) paint/invalidation/overflow-changed-on-child-of-composited-layer.html [ Failure ] Bug(none) paint/invalidation/overflow-flipped-writing-mode-block.html [ Failure ] Bug(none) paint/invalidation/overflow-flipped-writing-mode-table.html [ Failure ] Bug(none) paint/invalidation/overflow-hidden-yet-scrolled-with-custom-scrollbar.html [ Failure ] Bug(none) paint/invalidation/overflow-hidden-yet-scrolled.html [ Failure ] -Bug(none) paint/invalidation/overflow-hide.html [ Failure ] Bug(none) paint/invalidation/overflow-move-after-scroll.html [ Failure ] Bug(none) paint/invalidation/overflow-scroll-after-move.html [ Failure ] Bug(none) paint/invalidation/overflow-scroll-body-appear.html [ Failure ] -Bug(none) paint/invalidation/overflow-scroll-delete.html [ Failure ] -Bug(none) paint/invalidation/overflow-scroll-in-overflow-scroll-scrolled.html [ Failure ] Bug(none) paint/invalidation/overflow-scroll-local-background-text-color-change.html [ Failure ] Bug(none) paint/invalidation/paged-with-overflowing-block-rl.html [ Failure ] -Bug(none) paint/invalidation/paint-caret-in-div-with-negative-indent.html [ Failure ] Bug(none) paint/invalidation/paint-invalidation-with-opacity.html [ Failure ] Bug(none) paint/invalidation/paint-invalidation-with-reparent-across-frame-boundaries.html [ Failure ] Bug(none) paint/invalidation/percent-size-image-resize-container.html [ Failure ] -Bug(none) paint/invalidation/position-change-keeping-geometry.html [ Failure ] -Bug(none) paint/invalidation/positioned-document-element.html [ Failure ] Bug(none) paint/invalidation/reflection-invalidation-after-display.html [ Failure ] Bug(none) paint/invalidation/reflection-invalidation-positioned-child.html [ Failure ] Bug(none) paint/invalidation/reflection-redraw.html [ Failure ] Bug(none) paint/invalidation/relative-inline-positioned-movement-repaint.html [ Failure ] -Bug(none) paint/invalidation/relative-margin-change-repaint.html [ Failure ] Bug(none) paint/invalidation/relative-positioned-movement-repaint.html [ Failure ] Bug(none) paint/invalidation/remove-block-after-layout.html [ Failure ] Bug(none) paint/invalidation/remove-inline-layer-after-layout.html [ Failure ] crbug.com/732612 paint/invalidation/repaint-across-writing-mode-boundary.html [ Failure ] Bug(none) paint/invalidation/repaint-composited-child-in-scrolled-container.html [ Failure ] Bug(none) paint/invalidation/repaint-during-scroll.html [ Failure ] -Bug(none) paint/invalidation/repaint-resized-overflow.html [ Failure ] -Bug(none) paint/invalidation/requestAnimation-translation-leave-traces.html [ Failure ] -Bug(none) paint/invalidation/resize-iframe-text.html [ Failure ] -Bug(none) paint/invalidation/resize-scrollable-div.html [ Failure ] Bug(none) paint/invalidation/resize-skewed.html [ Failure ] Bug(none) paint/invalidation/resize-with-border-clipped.html [ Pass Failure ] Bug(none) paint/invalidation/scroll-absolute-layer-with-reflection.html [ Failure ] @@ -1234,81 +1192,43 @@ Bug(none) paint/invalidation/scroll-fixed-layer-with-transformed-parent-layer.html [ Failure ] Bug(none) paint/invalidation/scroll-fixed-reflected-layer.html [ Failure ] Bug(none) paint/invalidation/scroll-in-fixed-layer.html [ Failure ] -Bug(none) paint/invalidation/scroll-in-transformed-layer.html [ Failure ] Bug(none) paint/invalidation/scroll-stacking-context-backface-visiblity-leaves-traces.html [ Failure ] -Bug(none) paint/invalidation/scroll-with-transformed-parent-layer.html [ Failure ] -Bug(none) paint/invalidation/scrollbar-damage-and-full-viewport-repaint.html [ Failure ] -Bug(none) paint/invalidation/scrollbar-parts.html [ Failure ] -Bug(none) paint/invalidation/selection-after-delete.html [ Failure ] -Bug(none) paint/invalidation/selection-after-remove.html [ Failure ] Bug(none) paint/invalidation/selection-clear.html [ Failure ] -Bug(none) paint/invalidation/selection-partial-invalidation-between-blocks.html [ Failure ] -Bug(none) paint/invalidation/selection-rl.html [ Failure ] Bug(none) paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl.html [ Failure ] -Bug(none) paint/invalidation/selection/invalidation-rect-with-br-includes-newline.html [ Failure ] Bug(none) paint/invalidation/selection/repaint-rect-for-vertical-writing-mode-with-positioned-root.html [ Failure ] Bug(none) paint/invalidation/selection/selection-within-composited-scroller.html [ Failure ] -Bug(none) paint/invalidation/subpixel-offset-scaled-transform.html [ Failure ] -Bug(none) paint/invalidation/subtree-root-clip.html [ Failure ] -Bug(none) paint/invalidation/subtree-root-skipped.html [ Failure ] Bug(none) paint/invalidation/svg/absolute-sized-content-with-resources.xhtml [ Failure ] -Bug(none) paint/invalidation/svg/add-border-property-on-root.html [ Failure ] Bug(none) paint/invalidation/svg/add-outline-property-on-root.html [ Failure ] -Bug(none) paint/invalidation/svg/animated-path-inside-transformed-html.xhtml [ Failure ] Bug(none) paint/invalidation/svg/animated-svg-as-image-transformed-offscreen.html [ Failure ] Bug(none) paint/invalidation/svg/clip-path-child-changes.svg [ Failure ] Bug(none) paint/invalidation/svg/clip-path-href-changes.svg [ Failure ] Bug(none) paint/invalidation/svg/clip-path-id-changes.svg [ Failure ] Bug(none) paint/invalidation/svg/clip-path-units-changes.svg [ Failure ] -Bug(none) paint/invalidation/svg/container-repaint.svg [ Failure ] Bug(none) paint/invalidation/svg/deep-dynamic-updates.svg [ Failure ] Bug(none) paint/invalidation/svg/embedded-svg-size-changes-no-layout-triggers.html [ Failure ] Bug(none) paint/invalidation/svg/filter-refresh.svg [ Failure ] Bug(none) paint/invalidation/svg/foreign-object-repaint.svg [ Failure ] -Bug(none) paint/invalidation/svg/hairline-stroke-squarecap.svg [ Failure ] Bug(none) paint/invalidation/svg/image-animation-with-zoom.html [ Pass Failure ] Bug(none) paint/invalidation/svg/image-with-clip-path.svg [ Failure ] -Bug(none) paint/invalidation/svg/inner-svg-change-viewBox-contract.svg [ Failure ] -Bug(none) paint/invalidation/svg/inner-svg-change-viewBox.svg [ Failure ] Bug(none) paint/invalidation/svg/js-late-clipPath-and-object-creation.svg [ Failure ] Bug(none) paint/invalidation/svg/js-late-clipPath-creation.svg [ Failure ] -Bug(none) paint/invalidation/svg/js-late-gradient-and-object-creation.svg [ Failure ] -Bug(none) paint/invalidation/svg/js-late-marker-and-object-creation.svg [ Failure ] Bug(none) paint/invalidation/svg/js-update-bounce.svg [ Failure ] -Bug(none) paint/invalidation/svg/js-update-container.svg [ Failure ] Bug(none) paint/invalidation/svg/mask-child-changes.svg [ Failure ] Bug(none) paint/invalidation/svg/mask-invalidation.svg [ Failure ] -Bug(none) paint/invalidation/svg/nested-embedded-svg-size-changes-no-layout-triggers-1.html [ Failure ] -Bug(none) paint/invalidation/svg/nested-embedded-svg-size-changes-no-layout-triggers-2.html [ Failure ] Bug(none) paint/invalidation/svg/paintorder-filtered.svg [ Failure ] -Bug(none) paint/invalidation/svg/relative-sized-image.xhtml [ Failure ] -Bug(none) paint/invalidation/svg/remove-border-property-on-root.html [ Failure ] Bug(none) paint/invalidation/svg/remove-outline-property-on-root.html [ Failure ] Bug(none) paint/invalidation/svg/repaint-in-scrolled-view.html [ Failure ] Bug(none) paint/invalidation/svg/resize-svg-invalidate-children-2.html [ Failure ] Bug(none) paint/invalidation/svg/resize-svg-invalidate-children.html [ Failure ] Bug(none) paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem.html [ Failure ] -Bug(none) paint/invalidation/svg/shape-transform-change.html [ Failure ] -Bug(none) paint/invalidation/svg/tabgroup.svg [ Failure ] Bug(none) paint/invalidation/svg/text-mask-update.svg [ Failure ] -Bug(none) paint/invalidation/svg/text-pattern-update.html [ Failure ] -Bug(none) paint/invalidation/svg/text-repaint-including-stroke.svg [ Failure ] -Bug(none) paint/invalidation/svg/text-rescale.html [ Failure ] Bug(none) paint/invalidation/svg/text-selection-text-05-t.svg [ Failure ] Bug(none) paint/invalidation/svg/text-viewbox-rescale.html [ Failure ] Bug(none) paint/invalidation/svg/text-xy-updates-SVGList.xhtml [ Failure ] Bug(none) paint/invalidation/svg/transform-focus-ring-repaint.html [ Failure ] Bug(none) paint/invalidation/svg/transform-foreign-object.html [ Failure ] -Bug(none) paint/invalidation/svg/transform-text-element.html [ Failure ] Bug(none) paint/invalidation/svg/use-clipped-hit.svg [ Failure ] -Bug(none) paint/invalidation/svg/use-inherit-style.svg [ Failure ] -Bug(none) paint/invalidation/svg/window.svg [ Failure ] Bug(none) paint/invalidation/svg/zoom-coords-viewattr-01-b.svg [ Failure ] -Bug(none) paint/invalidation/svg/zoom-foreignObject.svg [ Failure ] -Bug(none) paint/invalidation/table-col-background.html [ Failure ] -Bug(none) paint/invalidation/table-overflow-auto-in-overflow-auto-scrolled.html [ Failure ] -Bug(none) paint/invalidation/table-overflow-scroll-in-overflow-scroll-scrolled.html [ Failure ] -Bug(none) paint/invalidation/table-two-pass-layout-overpaint.html [ Failure ] Bug(none) paint/invalidation/table/composited-table-background-composited-row-initial-empty.html [ Failure ] Bug(none) paint/invalidation/table/composited-table-background-composited-row.html [ Failure ] Bug(none) paint/invalidation/table/composited-table-background-initial-empty.html [ Failure ] @@ -1316,27 +1236,13 @@ Bug(none) paint/invalidation/table/composited-table-background-section-initial-empty.html [ Failure ] Bug(none) paint/invalidation/table/composited-table-background-section.html [ Failure ] Bug(none) paint/invalidation/table/composited-table-background.html [ Failure ] -Bug(none) paint/invalidation/text-in-relative-positioned-inline.html [ Failure ] -Bug(none) paint/invalidation/textarea-appearance-none-resize-handle.html [ Failure ] -Bug(none) paint/invalidation/textarea-caret.html [ Failure ] -Bug(none) paint/invalidation/transform-absolute-child.html [ Failure ] -Bug(none) paint/invalidation/transform-absolute-in-positioned-container.html [ Failure ] -Bug(none) paint/invalidation/transform-inline-layered-child.html [ Failure ] -Bug(none) paint/invalidation/transform-relative-position.html [ Failure ] Bug(none) paint/invalidation/transform-repaint-descendants.html [ Failure ] Bug(none) paint/invalidation/transform-replaced-shadows.html [ Failure ] Bug(none) paint/invalidation/transform-rotate-and-remove.html [ Failure ] -Bug(none) paint/invalidation/transform-translate.html [ Failure ] -Bug(none) paint/invalidation/vertical-align-length1.html [ Failure ] -Bug(none) paint/invalidation/vertical-overflow-child.html [ Failure ] -Bug(none) paint/invalidation/vertical-overflow-parent.html [ Failure ] -Bug(none) paint/invalidation/vertical-overflow-same.html [ Failure ] Bug(none) paint/invalidation/video-mute-repaint.html [ Failure ] Bug(none) paint/invalidation/video-unmute-repaint.html [ Failure ] -Bug(none) paint/invalidation/view-background-from-body-2.html [ Failure ] Bug(none) paint/invalidation/window-resize-background-image-fixed-centered-composited.html [ Failure ] Bug(none) paint/invalidation/window-resize-frameset.html [ Failure ] -Bug(none) paint/invalidation/window-resize-media-query.html [ Failure ] Bug(none) paint/invalidation/window-resize-percent-html.html [ Failure ] Bug(none) paint/invalidation/window-resize-vertical-writing-mode.html [ Failure ] Bug(none) paint/masks/fieldset-mask.html [ Failure ] @@ -1525,7 +1431,6 @@ crbug.com/644358 fast/css3-text/css3-text-decoration/repaint/repaint-text-decoration-style.html [ Failure ] crbug.com/644358 paint/invalidation/justify-items-overflow-change.html [ Failure ] crbug.com/644358 paint/invalidation/justify-self-overflow-change.html [ Failure ] -crbug.com/644358 paint/invalidation/svg/overflow-repaint.html [ Failure ] crbug.com/644358 paint/invalidation/video-paint-invalidation.html [ Crash ] Bug(none) compositing/layer-creation/main-thread-scrolling-for-non-composited-fixed-position-if-overflow-hidden.html [ Failure ] @@ -1825,9 +1730,6 @@ crbug.com/706066 paint/invalidation/compositing/page-scale-repaint.html [ Crash ] crbug.com/706066 paint/invalidation/relayout-fixed-position-after-scale.html [ Crash ] -Bug(none) paint/invalidation/svg/feImage-remove-target.svg [ Failure ] -Bug(none) paint/invalidation/svg/js-update-stop-linked-gradient.svg [ Failure ] - crbug.com/719721 virtual/threaded/animations/composited-animation-style-update.html [ Pass Failure ] Bug(none) paint/pagination/composited-paginated-outlined-box.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/NeverFixTests b/third_party/WebKit/LayoutTests/NeverFixTests index 9fa98d1..9bfedb0 100644 --- a/third_party/WebKit/LayoutTests/NeverFixTests +++ b/third_party/WebKit/LayoutTests/NeverFixTests
@@ -262,7 +262,7 @@ # Upstreaming WPT font matching tests first, then activating those once the new # font matching algorithm implementation is in place. -crbug.com/733154 external/wpt/fonts/matching [ WontFix ] +crbug.com/733154 external/wpt/css-fonts/matching [ WontFix ] # Temporary disabling of all encrypted-media WPT tests while enabling # https only. Once the switch is complete (and the WPT tests renamed so they
diff --git a/third_party/WebKit/LayoutTests/SlowTests b/third_party/WebKit/LayoutTests/SlowTests index d6267ed..89e2d00d 100644 --- a/third_party/WebKit/LayoutTests/SlowTests +++ b/third_party/WebKit/LayoutTests/SlowTests
@@ -170,7 +170,7 @@ crbug.com/248938 virtual/threaded/animations/animation-direction-reverse-fill-mode-hardware.html [ Slow ] crbug.com/248938 virtual/threaded/animations/animation-direction-reverse-fill-mode.html [ Slow ] crbug.com/248938 virtual/threaded/animations/animation-direction-reverse-hardware.html [ Slow ] -crbug.com/248938 virtual/threaded/animations/animation-on-inline-crash.html [ Slow ] +crbug.com/248938 virtual/threaded/animations/stability/animation-on-inline-crash.html [ Slow ] crbug.com/248938 virtual/threaded/animations/cross-fade-background-image.html [ Slow ] crbug.com/248938 virtual/threaded/animations/cross-fade-border-image-source.html [ Slow ] crbug.com/248938 virtual/threaded/animations/cross-fade-webkit-mask-box-image.html [ Slow ]
diff --git a/third_party/WebKit/LayoutTests/SmokeTests b/third_party/WebKit/LayoutTests/SmokeTests index 0e3d323..6884dfb 100644 --- a/third_party/WebKit/LayoutTests/SmokeTests +++ b/third_party/WebKit/LayoutTests/SmokeTests
@@ -2,7 +2,7 @@ accessibility/aria-link-supports-press.html accessibility/insert-adjacent-html-causes-crash.xhtml animations/animation-shorthand-overriding.html -animations/empty-keyframes.html +animations/stability/empty-keyframes.html animations/interpolation/border-image-slice-interpolation-stability.html animations/responsive/offset-rotate-responsive.html animations/svg-attribute-composition/svg-bias-composition.html @@ -998,7 +998,7 @@ virtual/stable/web-animations-api/additive-animations-unsupported.html virtual/stable/webexposed/global-interface-listing-compositor-worker.html virtual/stable/webexposed/internal-properties-should-not-be-exposed.html -virtual/threaded/animations/pseudo-element-animation-with-marker-crash.html +virtual/threaded/animations/stability/pseudo-element-animation-with-marker-crash.html virtual/threaded/printing/page-and-element-geometry-match.html virtual/without-smil/svg/animations/exposed/effect.html wake_lock/wakelock-api.html
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index fef8a61..0fd4cfe1 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -388,6 +388,12 @@ crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-013.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-014.xht [ Failure ] +# Regressions while changing zero-block-size float behaviour. +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-031.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-114.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-125.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-block-with-float-descendants.html [ Failure ] + ### virtual/layout_ng/external/wpt/css/CSS2/linebox # 1px glyph position diff at box boundary. Check if they need fix. @@ -820,7 +826,7 @@ crbug.com/432129 html/marquee/marquee-scroll.html [ Failure Pass ] crbug.com/326139 crbug.com/390125 media/video-frame-accurate-seek.html [ Failure Pass ] -crbug.com/248938 virtual/threaded/animations/animation-iteration-event-destroy-renderer.html [ Pass Timeout ] +crbug.com/248938 virtual/threaded/animations/stability/animation-iteration-event-destroy-renderer.html [ Pass Timeout ] crbug.com/446385 [ Win7 Debug ] http/tests/xmlhttprequest/xmlhttprequest-json-response-overflow.html [ Crash Pass Timeout ] crbug.com/446385 [ Win7 Debug ] virtual/mojo-loading/http/tests/xmlhttprequest/xmlhttprequest-json-response-overflow.html [ Crash Pass Timeout ] crbug.com/248938 virtual/threaded/animations/dynamic-stylesheet-loading.html [ Pass Failure Timeout ] @@ -1615,7 +1621,7 @@ crbug.com/240576 external/wpt/fullscreen/api/element-ready-check-containing-iframe-manual.html [ Timeout Failure Pass ] -crbug.com/567230 [ Debug ] virtual/threaded/animations/restart-not-visible.html [ Timeout ] +crbug.com/567230 [ Debug ] virtual/threaded/animations/stability/restart-not-visible.html [ Timeout ] crbug.com/567419 inspector/elements/styles-2/metrics-box-sizing.html [ Skip ] @@ -1751,14 +1757,6 @@ # This test fails with the stable release mode. crbug.com/694958 virtual/stable/http/tests/navigation/same-and-different-back.html [ Skip ] -# Failing because of module-related implementation/test issues. -crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/errorhandling.html [ Failure ] -crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/evaluation-error-1.html [ Failure ] -crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/evaluation-error-2.html [ Failure ] -crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/evaluation-error-3.html [ Failure ] -crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/evaluation-error-4.html [ Failure ] -crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/slow-cycle.html [ Failure ] - # This test has a failure console message with specific performance # numbers so a consistent baseline cannot be added. This test could be # imported if the test passed or if the results for testharness tests @@ -1769,13 +1767,6 @@ crbug.com/698077 inspector/sources/debugger/debug-inlined-scripts.html [ NeedsManualRebaseline ] -crbug.com/738149 svg/dynamic-updates/SVGFEDropShadowElement-dom-shadow-color-attr.html [ NeedsManualRebaseline ] -crbug.com/738149 svg/dynamic-updates/SVGFEDropShadowElement-dom-shadow-opacity-attr.html [ NeedsManualRebaseline ] -crbug.com/738149 svg/dynamic-updates/SVGFEDropShadowElement-svgdom-shadow-color-prop.html [ NeedsManualRebaseline ] -crbug.com/738149 svg/dynamic-updates/SVGFEDropShadowElement-svgdom-shadow-opacity-prop.html [ NeedsManualRebaseline ] -crbug.com/738149 svg/filters/feBlend-all-modes.html [ NeedsManualRebaseline ] -crbug.com/738149 svg/filters/feDropShadow.svg [ NeedsManualRebaseline ] - # Working on getting the CSP tests going: crbug.com/694525 external/wpt/content-security-policy/blink-contrib [ Skip ] crbug.com/694525 external/wpt/content-security-policy/blink-contrib-2 [ Skip ] @@ -1845,8 +1836,6 @@ #crbug.com/626703 [ Win ] external/wpt/css/css-flexbox-1/flex-minimum-width-flex-items-003.xht [ Failure ] #crbug.com/626703 [ Win ] external/wpt/css/css-flexbox-1/flexbox_flex-natural-mixed-basis-auto.html [ Failure ] #crbug.com/626703 external/wpt/css/css-cascade-4/revert-val-001.html [ Failure ] -crbug.com/626703 external/wpt/css/css-writing-modes-3/normal-flow-overconstrained-vlr-005.xht [ Failure ] -crbug.com/626703 external/wpt/css/css-writing-modes-3/normal-flow-overconstrained-vrl-004.xht [ Failure ] crbug.com/626703 external/wpt/css/css-writing-modes-3/sizing-orthog-htb-in-vlr-001.xht [ Failure ] crbug.com/626703 external/wpt/css/css-writing-modes-3/sizing-orthog-htb-in-vlr-004.xht [ Failure ] crbug.com/626703 external/wpt/css/css-writing-modes-3/sizing-orthog-htb-in-vlr-016.xht [ Failure ] @@ -2488,7 +2477,6 @@ crbug.com/701047 [ Mac10.12 ] editing/pasteboard/paste-line-endings-004.html [ Failure ] crbug.com/701047 [ Mac10.12 ] editing/pasteboard/paste-line-endings-005.html [ Failure ] crbug.com/701047 [ Mac10.12 ] editing/pasteboard/paste-text-016.html [ Failure ] -crbug.com/701047 [ Mac10.12 ] editing/selection/3690719.html [ Failure ] crbug.com/701047 [ Mac10.12 ] editing/selection/4975120.html [ Failure ] crbug.com/701047 [ Mac10.12 ] editing/selection/move-3875618-fix.html [ Failure ] crbug.com/701047 [ Mac10.12 ] editing/selection/move-3875641-fix.html [ Failure ] @@ -2782,9 +2770,6 @@ # Sheriff failures 2017-02-27 crbug.com/696407 [ Linux ] external/wpt/html/browsers/history/the-location-interface/location-protocol-setter-with-colon.sub.html [ Failure Pass ] -crbug.com/697342 http/tests/push_messaging/permission-state-granted-in-document.html [ Pass Failure ] -crbug.com/697342 virtual/mojo-loading/http/tests/push_messaging/permission-state-granted-in-document.html [ Pass Failure ] - crbug.com/698520 external/wpt/preload/fetch-destination.https.html [ Failure Pass ] # Sheriff failures 2017-03-10 @@ -2845,6 +2830,18 @@ crbug.com/718155 payments/payment-request-in-iframe.html [ Failure ] crbug.com/718155 payments/payment-request-in-iframe-nested-not-allowed.html [ Failure ] +# Feature Policy Header parsing is disabled in M60 - https://crbug.com/737643 +crbug.com/737643 external/wpt/payment-request/payment-allowed-by-feature-policy.https.sub.html [ Failure ] +crbug.com/737643 external/wpt/payment-request/payment-disabled-by-feature-policy.https.sub.html [ Failure ] +crbug.com/737643 external/wpt/webusb/usb-allowed-by-feature-policy.https.sub.html [ Failure ] +crbug.com/737643 external/wpt/webusb/usb-disabled-by-feature-policy.https.sub.html [ Failure ] +crbug.com/737643 http/tests/feature-policy/payment-disabled.php [ Failure ] +crbug.com/737643 http/tests/feature-policy/payment-enabledforall.php [ Failure ] +crbug.com/737643 virtual/feature-policy/http/tests/feature-policy/payment-disabled.php [ Failure ] +crbug.com/737643 virtual/feature-policy/http/tests/feature-policy/payment-enabledforall.php [ Failure ] +crbug.com/737643 virtual/mojo-loading/http/tests/feature-policy/payment-disabled.php [ Failure ] +crbug.com/737643 virtual/mojo-loading/http/tests/feature-policy/payment-enabledforall.php [ Failure ] + # Layout Tests on Swarming (Windows) - https://crbug.com/717347 crbug.com/724392 [ Win ] fast/css/font-family-case-insensitive.html [ Failure Pass Timeout ] crbug.com/713094 [ Win ] fast/css/fontfaceset-check-platform-fonts.html [ Failure Pass ] @@ -2899,8 +2896,6 @@ crbug.com/732103 [ Mac ] http/tests/shapedetection/shapedetection-cross-origin.html [ Failure Pass Timeout ] crbug.com/732103 [ Mac ] virtual/mojo-loading/http/tests/shapedetection/shapedetection-cross-origin.html [ Failure Pass Timeout ] -# Sheriff failures 2017-06-10 -crbug.com/732839 [ Win ] external/wpt/payment-request/payment-request-constructor-crash.https.html [ Pass Timeout ] # Sheriff failures 2017-06-14 crbug.com/733357 [ Win Mac ] inspector/elements/styles-4/styles-history.html [ Failure Pass ] @@ -2988,3 +2983,7 @@ crbug.com/736255 [ Mac ] external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-baseline-multi-item-vert-001b.html [ Skip ] crbug.com/736732 virtual/enable_wasm/external/wpt/wasm/wasm_local_iframe_test.html [ Timeout Pass ] + +# Sheriff failures 2017-07-03 +crbug.com/708994 http/tests/security/cross-frame-mouse-source-capabilities.html [ Timeout Pass ] +crbug.com/708994 virtual/mojo-loading/http/tests/security/cross-frame-mouse-source-capabilities.html [ Timeout Pass ]
diff --git a/third_party/WebKit/LayoutTests/accessibility/aria-roles-expected.txt b/third_party/WebKit/LayoutTests/accessibility/aria-roles-expected.txt index 3e45fce..f55d8e4 100644 --- a/third_party/WebKit/LayoutTests/accessibility/aria-roles-expected.txt +++ b/third_party/WebKit/LayoutTests/accessibility/aria-roles-expected.txt
@@ -7,7 +7,6 @@ Broccoli Asparagus This test PASSES in DumpRenderTree. The role is AXRole: AXCheckBox - The following should be a button: X @@ -15,7 +14,6 @@ Actual button: Hello This test PASSES in DumpRenderTree. The role is AXRole: AXButton - The following should be a heading: X @@ -25,7 +23,6 @@ Hello This test PASSES in DumpRenderTree. The role is AXRole: AXHeading - The following should be a link: X @@ -33,7 +30,6 @@ Actual link: Hello This test PASSES in DumpRenderTree. The role is AXRole: AXLink - The following should be a radio button: X @@ -43,7 +39,6 @@ Broccoli Asparagus This test PASSES in DumpRenderTree. The role is AXRole: AXRadioButton - The following should be a text box: X @@ -51,7 +46,6 @@ Actual text box: This test PASSES in DumpRenderTree. The role is AXRole: AXTextField - The following should be an image: X @@ -59,7 +53,6 @@ Actual image: This test PASSES in DumpRenderTree. The role is AXRole: AXImage - The following should be a list: X @@ -69,7 +62,6 @@ Broccoli Beets This test PASSES in DumpRenderTree. The role is AXRole: AXList - The following should be a dialog: X
diff --git a/third_party/WebKit/LayoutTests/accessibility/bounds-calc.html b/third_party/WebKit/LayoutTests/accessibility/bounds-calc.html index 3f2a7813..cc24ac0 100644 --- a/third_party/WebKit/LayoutTests/accessibility/bounds-calc.html +++ b/third_party/WebKit/LayoutTests/accessibility/bounds-calc.html
@@ -268,6 +268,17 @@ }, "Test spans inside of absolute-positioned container"); </script> +<div class="container"> + Before + <span id="span8" style="position:relative;">After</span> +</div> + +<script> +test(function(t) { + assertStaticTextChildDOMRectSameAsAXRect("span8", 0); +}, "Test node that's inline and relative-positioned"); +</script> + <script> if (window.testRunner) document.body.className = "hideAllContainers";
diff --git a/third_party/WebKit/LayoutTests/accessibility/element-role-mapping-focusable-expected.txt b/third_party/WebKit/LayoutTests/accessibility/element-role-mapping-focusable-expected.txt index 950638c..6e4a972c 100644 --- a/third_party/WebKit/LayoutTests/accessibility/element-role-mapping-focusable-expected.txt +++ b/third_party/WebKit/LayoutTests/accessibility/element-role-mapping-focusable-expected.txt
@@ -1,6 +1,6 @@ Visit Chromium Click the text! Button Copyright 2015. - I have a checkbox Radio Button + I have a checkbox Radio Button I have a menuItem Menu ItemRadio Birthday: Birthday(date and time): Birthday(datetime-local): Birthday (month and year): Select a week: Select a file: Min-Max: Color: Select a time: 0 100 + =
diff --git a/third_party/WebKit/LayoutTests/animations/animate-shorthand-var-crash.html b/third_party/WebKit/LayoutTests/animations/animate-shorthand-var-crash.html deleted file mode 100644 index 1bd15ec..0000000 --- a/third_party/WebKit/LayoutTests/animations/animate-shorthand-var-crash.html +++ /dev/null
@@ -1,16 +0,0 @@ -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<style> -@keyframes crash { - from { border-radius: var(--) } -} -#target { - animation: crash 1s infinite; -} -</style> -<div id="target"></div> -<script> -test(() => { - getComputedStyle(target).borderRadius; -}, 'Do not crash when animating a shorthand with var().'); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/animated-css-property-usecounter-for-transitions.html b/third_party/WebKit/LayoutTests/animations/animated-css-property-usecounter-for-transitions.html deleted file mode 100644 index 4018c3a..0000000 --- a/third_party/WebKit/LayoutTests/animations/animated-css-property-usecounter-for-transitions.html +++ /dev/null
@@ -1,62 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> - -<style> -#target { - width: 100px; - height: 100px; - transition: width 1s; -} -</style> - -<div id="target"></div> - -<script> -'use strict'; - -function waitForProgress() { - var initialWidth = getComputedStyle(target).width; - return new Promise(resolve => { - function poll() { - var width = getComputedStyle(target).width; - if (width === initialWidth) { - requestAnimationFrame(poll); - } else { - resolve(); - } - } - requestAnimationFrame(poll); - }); -} - -async_test(t => { - assert_true( - internals.isCSSPropertyUseCounted(document, "width"), - 'Usage of width in style causes it to be counted in normal CSS ' + - 'property UseCounter'); - assert_true( - internals.isCSSPropertyUseCounted(document, "height"), - 'Usage of height in style causes it to be counted in normal CSS ' + - 'property UseCounter'); - - assert_false( - internals.isAnimatedCSSPropertyUseCounted(document, "width"), - 'Initially width animation has not been UseCounted'); - assert_false( - internals.isAnimatedCSSPropertyUseCounted(document, "height"), - 'Initially height animation has not been UseCounted'); - - target.offsetTop; // force recalc - target.style.width = '200px'; - - waitForProgress().then(t.step_func_done(() => { - assert_true( - internals.isAnimatedCSSPropertyUseCounted(document, "width"), - 'After triggering the transition, width has been counted'); - assert_false( - internals.isAnimatedCSSPropertyUseCounted(document, "height"), - 'Height is not animated, so not counted'); - })); -}, 'Using CSS transitions causes UseCounter to be incremented.'); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/animated-css-property-usecounter.html b/third_party/WebKit/LayoutTests/animations/animated-css-property-usecounter.html deleted file mode 100644 index d5c8e47..0000000 --- a/third_party/WebKit/LayoutTests/animations/animated-css-property-usecounter.html +++ /dev/null
@@ -1,90 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> - -<style> -@keyframes bgColorAnim { - from { - background-color: blue; - } - to { - background-color: red; - } -} - -@keyframes customPropertyAnim { - from { - --x: blue; - } - to { - --x: red; - } -} - -#target { - width: 100px; - height: 100px; -} -</style> - -<div id="target"></div> - -<script> -'use strict'; - -test(() => { - assert_true( - internals.isCSSPropertyUseCounted(document, "background-color"), - 'Usage of background-color in style causes it to be counted in ' + - 'normal CSS property UseCounter'); - assert_true( - internals.isCSSPropertyUseCounted(document, "width"), - 'Usage of width in style causes it to be counted in normal CSS ' + - 'property UseCounter'); - - assert_false( - internals.isAnimatedCSSPropertyUseCounted(document, "background-color"), - 'Initially background-color animation has not been UseCounted'); - assert_false( - internals.isAnimatedCSSPropertyUseCounted(document, "width"), - 'Initially width animation has not been UseCounted'); - - target.style.animation = 'bgColorAnim 1s'; - target.offsetTop; // force recalc - - assert_true( - internals.isAnimatedCSSPropertyUseCounted(document, "background-color"), - 'After applying the animation, background-color has been counted'); - assert_false( - internals.isAnimatedCSSPropertyUseCounted(document, "width"), - 'Width is not animated, so not counted'); -}, 'Animating properties via CSS causes UseCounter to be incremented.'); - -test(() => { - assert_true( - internals.isCSSPropertyUseCounted(document, "--x"), - 'Usage of custom property --x in style causes it to be counted in ' + - 'normal CSS property UseCounter'); - assert_true( - internals.isCSSPropertyUseCounted(document, "--y"), - 'All custom properties are counted together in normal CSS property ' + - 'UseCounter'); - - assert_false( - internals.isAnimatedCSSPropertyUseCounted(document, "--x"), - 'Initially custom property --x animation has not been UseCounted'); - assert_false( - internals.isAnimatedCSSPropertyUseCounted(document, "--y"), - 'Initially custom property --y animation has not been UseCounted'); - - target.style.animation = 'customPropertyAnim 1s'; - target.offsetTop; // force recalc - - assert_true( - internals.isAnimatedCSSPropertyUseCounted(document, "--x"), - 'After applying the animation, custom property animation has been counted'); - assert_true( - internals.isAnimatedCSSPropertyUseCounted(document, "--y"), - 'All custom property animations are counted together'); -}, 'Animating custom CSS properties causes UseCounter to be incremented.'); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/animation-css-cancel-update-crash.html b/third_party/WebKit/LayoutTests/animations/animation-css-cancel-update-crash.html deleted file mode 100644 index 6ab6a4f..0000000 --- a/third_party/WebKit/LayoutTests/animations/animation-css-cancel-update-crash.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<style> - @keyframes anim { - from { background-color: blue; } - to { background-color: red; } - } - - @keyframes anim2 { - from { opacity: 0; } - to { opacity: 1; } - } -</style> -<div id="target"></div> -<script> - test(function() { - target.style.animation = "anim 1s, anim2 1s"; - target.offsetTop; - target.style.animation = "anim2 2s"; - target.offsetTop; - }, "Check that cancelling one running animation and updating another doesn't crash"); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/animation-transition-collision-crash.html b/third_party/WebKit/LayoutTests/animations/animation-transition-collision-crash.html deleted file mode 100644 index d0b756e..0000000 --- a/third_party/WebKit/LayoutTests/animations/animation-transition-collision-crash.html +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<style> -@keyframes test { - from { - /* These properties have -webkit-* equivalents. */ - background-size: 10px 10px; - box-shadow: 10px 10px green; - perspective: 10px; - transform: translate(10px, 10px); - perspective-origin: 10px 10px; - transform-origin: 10px 10px; - } -} -#target { - animation: test 1s; - transition: all 1s; -} -</style> -<div id="target"></div> -<script> -'use strict'; -async_test(t => { - let frameWait = 5; - function frame() { - frameWait--; - if (frameWait) { - requestAnimationFrame(frame); - } else { - t.done(); - } - } - requestAnimationFrame(frame); -}, 'Don\'t crash when animating transitioned properties'); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/background-trailing-comma-crash.html b/third_party/WebKit/LayoutTests/animations/background-trailing-comma-crash.html deleted file mode 100644 index 00c3119..0000000 --- a/third_party/WebKit/LayoutTests/animations/background-trailing-comma-crash.html +++ /dev/null
@@ -1,9 +0,0 @@ -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<div id="target"></div> -<script> -test(() => { - target.animate({background: 'none, 10px'}, {fill: 'forwards'}); - getComputedStyle(target).backgroundPosition; -}, "Don't crash when animating background with implicit longhand values and more than one bg-layer."); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/checkbox-padding-animation-crash.html b/third_party/WebKit/LayoutTests/animations/checkbox-padding-animation-crash.html deleted file mode 100644 index 973421f..0000000 --- a/third_party/WebKit/LayoutTests/animations/checkbox-padding-animation-crash.html +++ /dev/null
@@ -1,14 +0,0 @@ -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<style> -@keyframes anim { - to { padding-top: 50px; } -} -input { animation: anim 1s; } -</style> -<input type="checkbox" id="target"></input> -<script> -test(function() { - getComputedStyle(target); -}, 'This test passes if it does not crash.') -</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/animations/composited-identity-animation-layer-squash-crash.html b/third_party/WebKit/LayoutTests/animations/composited-identity-animation-layer-squash-crash.html deleted file mode 100644 index cd8f10ed..0000000 --- a/third_party/WebKit/LayoutTests/animations/composited-identity-animation-layer-squash-crash.html +++ /dev/null
@@ -1,26 +0,0 @@ -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<div id="opacity"> - <div style="position: relative"></div> -</div> -<div id="transform"> - <div style="position: relative"></div> -</div> -<script> -var asyncHandle = async_test('This test passes if it does not crash.'); -var opacityPlayer = opacity.animate([ - {opacity: 1}, - {opacity: 1}, -], 1e6); -var transformPlayer = transform.animate([ - {transform: 'none'}, - {transform: 'none'}, -], 1e6); -requestAnimationFrame(function() { - opacityPlayer.cancel(); - transformPlayer.cancel(); - requestAnimationFrame(function() { - asyncHandle.done(); - }); -}); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/css-length-range-crash.html b/third_party/WebKit/LayoutTests/animations/css-length-range-crash.html deleted file mode 100644 index c2ea97d6..0000000 --- a/third_party/WebKit/LayoutTests/animations/css-length-range-crash.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<div id="target"></div> -<script> -target.animate([{ - left: '1e100px', - top: '-1e100px', -}, { - left: '0px', - top: '0px', -}], 1000); - -var async_handle = async_test('This test passes if it does not crash'); -requestAnimationFrame(function() { - async_handle.done(); -}); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-chain.html b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-chain.html new file mode 100644 index 0000000..da47db8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-chain.html
@@ -0,0 +1,56 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<div id="target">target</div> +<script> +setup(() => { + for (let name of ['--a', '--b', '--c']) { + CSS.registerProperty({ + name, + syntax: '<number>', + initialValue: '0', + }); + } +}); + +test(() => { + // These keyframes are equivalent to: { + // '--a': ['100', '200'], + // '--b': ['100', '300'], + // '--c': ['100', '400'], + // }. + let animation = target.animate({ + '--a': ['100', '200'], + '--b': ['var(--a)', 'calc(var(--a) + 100)'], + '--c': ['var(--b)', 'calc(var(--b) + 100)'], + }, { + duration: 100, + fill: 'forwards', + }); + + animation.currentTime = 0; + assert_equals(getComputedStyle(target).getPropertyValue('--a'), '100', '--a at 0%'); + assert_equals(getComputedStyle(target).getPropertyValue('--b'), '100', '--b at 0%'); + assert_equals(getComputedStyle(target).getPropertyValue('--c'), '100', '--c at 0%'); + + animation.currentTime = 25; + assert_equals(getComputedStyle(target).getPropertyValue('--a'), '125', '--a at 25%'); + assert_equals(getComputedStyle(target).getPropertyValue('--b'), '150', '--b at 25%'); + assert_equals(getComputedStyle(target).getPropertyValue('--c'), '175', '--c at 25%'); + + animation.currentTime = 50; + assert_equals(getComputedStyle(target).getPropertyValue('--a'), '150', '--a at 50%'); + assert_equals(getComputedStyle(target).getPropertyValue('--b'), '200', '--b at 50%'); + assert_equals(getComputedStyle(target).getPropertyValue('--c'), '250', '--c at 50%'); + + animation.currentTime = 75; + assert_equals(getComputedStyle(target).getPropertyValue('--a'), '175', '--a at 75%'); + assert_equals(getComputedStyle(target).getPropertyValue('--b'), '250', '--b at 75%'); + assert_equals(getComputedStyle(target).getPropertyValue('--c'), '325', '--c at 75%'); + + animation.currentTime = 100; + assert_equals(getComputedStyle(target).getPropertyValue('--a'), '200', '--a at 100%'); + assert_equals(getComputedStyle(target).getPropertyValue('--b'), '300', '--b at 100%'); + assert_equals(getComputedStyle(target).getPropertyValue('--c'), '400', '--c at 100%'); +}, 'Animated registered custom properties can var() reference each other to create a chain of dependencies.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-fallback.html b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-fallback.html new file mode 100644 index 0000000..3276948 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-fallback.html
@@ -0,0 +1,36 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +#target { + --has-value: 100; + --fallback-value: 200; +} +</style> +<div id="target"></div> +<script> +setup(() => { + for (let name of ['--test', '--has-value']) { + CSS.registerProperty({ + name, + syntax: '<number>', + initialValue: '0', + }); + } +}); + +test(() => { + let animation = target.animate({ + '--test': [ + 'var(--has-value)', + 'var(--has-no-value, var(--fallback-value))', + ], + }, 100); + + animation.currentTime = 25; + assert_equals(getComputedStyle(target).getPropertyValue('--test'), '125', 'target at 25%'); + + animation.currentTime = 75; + assert_equals(getComputedStyle(target).getPropertyValue('--test'), '175', 'target at 75%'); +}, 'Animated registered custom properties will use var() fallback values when the referenced custom property has no value.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-registered-animating.html b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-registered-animating.html new file mode 100644 index 0000000..b062b74 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-registered-animating.html
@@ -0,0 +1,48 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +#target { + --static: 100; +} +</style> +<div id="target"></div> +<script> +setup(() => { + for (let name of ['--test', '--static', '--animated']) { + CSS.registerProperty({ + name, + syntax: '<number>', + initialValue: '0', + }); + } +}); + +test(() => { + // --test is animating from a static value to an animated value resulting in it changing quadratically. + let animation = target.animate({'--test': ['var(--static)', 'var(--animated)']}, 100); + let referencedAnimation = target.animate({'--animated': ['200', '300']}, 100); + + referencedAnimation.currentTime = 25; + { + animation.currentTime = 25; + // lerp(100, lerp(200, 300, 25%), 25%) == 0.75*100 + 0.25*(0.75*200 + 0.25*300) == 131.25 + assert_equals(getComputedStyle(target).getPropertyValue('--test'), '131.25', 'target at 25%, to at 25%'); + + animation.currentTime = 75; + // lerp(100, lerp(200, 300, 25%), 75%) == 0.25*100 + 0.75*(0.75*200 + 0.25*300) == 193.75 + assert_equals(getComputedStyle(target).getPropertyValue('--test'), '193.75', 'target at 75%, to at 25%'); + } + + referencedAnimation.currentTime = 75; + { + animation.currentTime = 25; + // lerp(100, lerp(200, 300, 75%), 25%) == 0.75*100 + 0.25*(0.25*200 + 0.75*300) == 143.75 + assert_equals(getComputedStyle(target).getPropertyValue('--test'), '143.75', 'target at 25%, to at 25%'); + + animation.currentTime = 75; + // lerp(100, lerp(200, 300, 75%), 75%) == 0.25*100 + 0.75*(0.25*200 + 0.75*300) == 231.25 + assert_equals(getComputedStyle(target).getPropertyValue('--test'), '231.25', 'target at 75%, to at 25%'); + } +}, 'Animated registered custom properties can var() reference other animated registered custom properties across separate Animations.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-registered-any-order.html b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-registered-any-order.html new file mode 100644 index 0000000..281796a --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-registered-any-order.html
@@ -0,0 +1,34 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<div id="target"></div> +<script> +setup(() => { + for (let name of ['--a', '--b']) { + CSS.registerProperty({ + name, + syntax: '<number>', + initialValue: '0', + }); + } +}); + +test(() => { + let a = target.animate({'--a': ['100', 'var(--b)']}, 100); + let b = target.animate({'--b': ['200', '200']}, 100); + + a.currentTime = 50; + assert_equals(getComputedStyle(target).getPropertyValue('--a'), '150', '--a animating towards --b'); + assert_equals(getComputedStyle(target).getPropertyValue('--b'), '200', '--b stationary at 200'); + + a.cancel(); + b.cancel(); + + a = target.animate({'--a': ['200', '200']}, 100); + b = target.animate({'--b': ['100', 'var(--a)']}, 100); + + b.currentTime = 50; + assert_equals(getComputedStyle(target).getPropertyValue('--a'), '200', '--a stationary at 200'); + assert_equals(getComputedStyle(target).getPropertyValue('--b'), '150', '--b animating towards --a'); +}, 'The resolution order of var() references in animated registered custom properties is independent of the lexicographical ordering of property names.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-registered-transitioning.html b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-registered-transitioning.html new file mode 100644 index 0000000..305e9445 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-registered-transitioning.html
@@ -0,0 +1,67 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +#target { + transition-property: --transitioning-property; + transition-duration: 1s; + transition-delay: -0.5s; + transition-timing-function: linear; + --transitioning-property: 100; +} +</style> +<div id="target">target</div> +<script> +setup(() => { + for (let name of ['--transitioning-property', '--test']) { + CSS.registerProperty({ + name, + syntax: '<number>', + initialValue: '0', + }); + } +}); + +function assert_computed_value_equals(property, expectedValue, description) { + assert_equals(getComputedStyle(target).getPropertyValue(property), expectedValue, description); + } + +test(() => { + assert_computed_value_equals('--test', '0', + '--test at initial value'); + assert_computed_value_equals('--transitioning-property', '100', + '--transitioning-property at initial value'); + + let animation = target.animate({ + '--test': ['50', 'var(--transitioning-property)'], + }, { + duration: 100, + fill: 'forwards', + }); + + animation.currentTime = 0; + assert_computed_value_equals('--test', '50', + '--test at 0% with no transition'); + animation.currentTime = 50; + assert_computed_value_equals('--test', '75', + '--test at 50% with no transition'); + animation.currentTime = 100; + assert_computed_value_equals('--test', '100', + '--test at 100% with no transition'); + + target.style.setProperty('--transitioning-property', '200'); + // Transition jumps to half way through due to negative transition-delay. + assert_computed_value_equals('--transitioning-property', '150', + '--transitioning-property at initial transitioning value'); + + animation.currentTime = 0; + assert_computed_value_equals('--test', '50', + '--test at 0% with transition'); + animation.currentTime = 50; + assert_computed_value_equals('--test', '100', + '--test at 50% with transition'); + animation.currentTime = 100; + assert_computed_value_equals('--test', '150', + '--test at 100% with transition'); +}, 'Animated registered custom properties can var() reference transitioning registered custom properties.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-registered.html b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-registered.html new file mode 100644 index 0000000..6994eef --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-registered.html
@@ -0,0 +1,31 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +#target { + --from: 100; + --to: 200; +} +</style> +<div id="target"></div> +<script> +setup(() => { + for (let name of ['--test', '--from', '--to']) { + CSS.registerProperty({ + name, + syntax: '<number>', + initialValue: '0', + }); + } +}); + +test(() => { + let animation = target.animate({'--test': ['var(--from)', 'var(--to)']}, 100); + + animation.currentTime = 25; + assert_equals(getComputedStyle(target).getPropertyValue('--test'), '125', 'target at 25%'); + + animation.currentTime = 75; + assert_equals(getComputedStyle(target).getPropertyValue('--test'), '175', 'target at 75%'); +}, 'Animated registered custom properties can var() reference other registered custom properties.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-unregistered-animating.html b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-unregistered-animating.html new file mode 100644 index 0000000..69185a8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-unregistered-animating.html
@@ -0,0 +1,42 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +#target { + --unregistered-a: 100; +} +</style> +<div id="target"></div> +<script> +setup(() => { + CSS.registerProperty({ + name: '--test', + syntax: '<number>', + initialValue: '0', + }); +}); + +test(() => { + let animation = target.animate({'--test': ['var(--unregistered-a)', 'var(--unregistered-b)']}, 100); + // Because this property is unregistered it will not interpolate smoothly, instead it will flip at 50%. + let unregisteredAnimation = target.animate({'--unregistered-b': ['200', '300']}, 100); + + unregisteredAnimation.currentTime = 25; + { + animation.currentTime = 25; + assert_equals(getComputedStyle(target).getPropertyValue('--test'), '125', 'target at 25%, to at 25%'); + + animation.currentTime = 75; + assert_equals(getComputedStyle(target).getPropertyValue('--test'), '175', 'target at 75%, to at 25%'); + } + + unregisteredAnimation.currentTime = 75; + { + animation.currentTime = 25; + assert_equals(getComputedStyle(target).getPropertyValue('--test'), '150', 'target at 25%, to at 75%'); + + animation.currentTime = 75; + assert_equals(getComputedStyle(target).getPropertyValue('--test'), '250', 'target at 75%, to at 75%'); + } +}, 'Animated registered custom properties can var() reference animated unregistered custom properties across separate Animations.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-unregistered.html b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-unregistered.html new file mode 100644 index 0000000..cd575dc --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-unregistered.html
@@ -0,0 +1,29 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +#target { + --unregistered-a: 100; + --unregistered-b: 200; +} +</style> +<div id="target"></div> +<script> +setup(() => { + CSS.registerProperty({ + name: '--test', + syntax: '<number>', + initialValue: '0', + }); +}); + +test(() => { + let animation = target.animate({'--test': ['var(--unregistered-a)', 'var(--unregistered-b)']}, 100); + + animation.currentTime = 25; + assert_equals(getComputedStyle(target).getPropertyValue('--test'), '125', 'target at 25%'); + + animation.currentTime = 75; + assert_equals(getComputedStyle(target).getPropertyValue('--test'), '175', 'target at 75%'); +}, 'Registered custom property animation keyframes with var() references to unregistered custom properties'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/d-path-neutral-value-crash.html b/third_party/WebKit/LayoutTests/animations/d-path-neutral-value-crash.html deleted file mode 100644 index 90291d1..0000000 --- a/third_party/WebKit/LayoutTests/animations/d-path-neutral-value-crash.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<div id="target"></div> -<script> -test(function() { - target.style.d = 'path("m0 0a0 0 0 0 0 0 0")'; - target.animate({d: 'none'}, 1); - getComputedStyle(target).d; -}, 'Do not crash when animating path with an underlying value involving arc flags.'); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/detached-document-element-animate-crash.html b/third_party/WebKit/LayoutTests/animations/detached-document-element-animate-crash.html deleted file mode 100644 index 88b57580..0000000 --- a/third_party/WebKit/LayoutTests/animations/detached-document-element-animate-crash.html +++ /dev/null
@@ -1,8 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<script> -test(() => { - document.implementation.createDocument('', '').createElement('div').animate({transform: 'none'}, 1000); -}, 'Don\'t crash when animating elements attached to detached documents.'); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/function-easing-use-counters-linear.html b/third_party/WebKit/LayoutTests/animations/function-easing-use-counters-linear.html deleted file mode 100644 index 8a1814c..0000000 --- a/third_party/WebKit/LayoutTests/animations/function-easing-use-counters-linear.html +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<script> -'use strict'; -// From UseCounter.h -var WebAnimationsEasingAsFunctionLinear = 1295; -var WebAnimationsEasingAsFunctionOther = 1296; - -test(() => { - document.documentElement.animate([], { }); - document.documentElement.animate([], { easing: 'linear' }); - document.documentElement.animate([], { easing: 'step-start' }); - assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLinear)); - assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOther)); -}, 'Non-function values for easing are not use-counted.'); - -test(() => { - assert_throws( - {name: 'TypeError'}, - function() { document.documentElement.animate([], { easing: 'invalid' }) }); - assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLinear)); - assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOther)); -}, 'Invalid non-function values for easing are not use-counted.'); - -test(() => { - // This linear function value is the one expected from uses of the unpatched - // Web Animations polyfill (i.e. old versions lacking - // https://github.com/web-animations/web-animations-next/pull/423). - assert_throws( - {name: 'TypeError'}, - function() { document.documentElement.animate([], { easing: 'function (a){return a}' }) }); - assert_true(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLinear)); - assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOther)); -}, 'A specific linear function for easing is counted in WebAnimationsEasingAsFunctionLinear.'); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/function-easing-use-counters-other1.html b/third_party/WebKit/LayoutTests/animations/function-easing-use-counters-other1.html deleted file mode 100644 index 7670d69e..0000000 --- a/third_party/WebKit/LayoutTests/animations/function-easing-use-counters-other1.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<script> -'use strict'; -// From UseCounter.h -var WebAnimationsEasingAsFunctionLinear = 1295; -var WebAnimationsEasingAsFunctionOther = 1296; - -test(() => { - assert_throws( - {name: 'TypeError'}, - function() { document.documentElement.animate([], { easing: 'function (x){return x}' }) }); - assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLinear)); - assert_true(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOther)); -}, 'Any linear function for easing other than "function (a){return a}" is counted in WebAnimationsEasingAsFunctionOther.'); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/function-easing-use-counters-other2.html b/third_party/WebKit/LayoutTests/animations/function-easing-use-counters-other2.html deleted file mode 100644 index b02fd1e..0000000 --- a/third_party/WebKit/LayoutTests/animations/function-easing-use-counters-other2.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<script> -'use strict'; -// From UseCounter.h -var WebAnimationsEasingAsFunctionLinear = 1295; -var WebAnimationsEasingAsFunctionOther = 1296; - -test(() => { - assert_throws( - {name: 'TypeError'}, - function() { document.documentElement.animate([], { easing: 'function(x, y){return 0.3}' }) }); - assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLinear)); - assert_true(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOther)); -}, 'Arbitrary functions for easing are counted in WebAnimationsEasingAsFunctionOther.'); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/invalid-decompose-invert.html b/third_party/WebKit/LayoutTests/animations/invalid-decompose-invert.html deleted file mode 100644 index ea8a8d28..0000000 --- a/third_party/WebKit/LayoutTests/animations/invalid-decompose-invert.html +++ /dev/null
@@ -1,10 +0,0 @@ -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<div id="target"></div> -<script> -var asyncHandle = async_test('Don\'t crash MSAN when decomposing a matrix that has an invalid inversion step.'); -target.animate([{"transform":"matrix3d( 0.9 , 0.9 , -0.1 , 66.33333333 , 0.9 , 0.3 , -0.1 , 0.1 , 0.9 , -1 , 9.5 , 0.9 , 1.5 , 0.3 , 0.3 , 1000 ) matrix( 0.3 , -0.1 , 0.3 , 66.33333333 , 9.5 , 1.5 ) rotateY( 45deg )"},{"transform":"none"},{"transform":"none"}], {"duration":2652.899310924113}); -requestAnimationFrame(function() { - asyncHandle.done(); -}); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/keyframe-effect-null-target-crash.html b/third_party/WebKit/LayoutTests/animations/keyframe-effect-null-target-crash.html deleted file mode 100644 index 467cdeae..0000000 --- a/third_party/WebKit/LayoutTests/animations/keyframe-effect-null-target-crash.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<div id="target"></div> -<script> -test(() => { - new KeyframeEffect(null, [], {}); -}, 'Do not crash when creating KeyframeEffects with null targets.'); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/keyframe-iteration-exception-crash.html b/third_party/WebKit/LayoutTests/animations/keyframe-iteration-exception-crash.html deleted file mode 100644 index 812106b..0000000 --- a/third_party/WebKit/LayoutTests/animations/keyframe-iteration-exception-crash.html +++ /dev/null
@@ -1,15 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<div id="target"></div> -<script> -test(() => { - assert_throws(null, () => { - target.animate({ - [Symbol.iterator]() { - return { next() { throw 'error'; } }; - } - }); - }); -}, 'Do not crash when exceptions are thrown during keyframe iteration.'); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/keyword-composition-crash.html b/third_party/WebKit/LayoutTests/animations/keyword-composition-crash.html deleted file mode 100644 index 5b93f9e..0000000 --- a/third_party/WebKit/LayoutTests/animations/keyword-composition-crash.html +++ /dev/null
@@ -1,10 +0,0 @@ -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<div id="target"></div> -<script> -test(() => { - target.animate([{position: 'absolute'}], {fill: 'forwards'}); - target.animate([{position: 'static', composite: 'add'}], {fill: 'forwards'}); - getComputedStyle(target).position; -}, "Don't crash when compositing keyword animations."); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/length-zero-percent-crash.html b/third_party/WebKit/LayoutTests/animations/length-zero-percent-crash.html deleted file mode 100644 index 4e74f0d..0000000 --- a/third_party/WebKit/LayoutTests/animations/length-zero-percent-crash.html +++ /dev/null
@@ -1,9 +0,0 @@ -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<div id="target"></div> -<script> -test(() => { - target.animate({margin: ['1px', '0%']}, {iterationStart: 0.5, fill: 'forwards'}); - assert_equals(getComputedStyle(target).margin, '0.5px'); -}, "Don't crash when animating length properties to 0%"); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/min-max-content-crash.html b/third_party/WebKit/LayoutTests/animations/min-max-content-crash.html deleted file mode 100644 index 206c2daf..0000000 --- a/third_party/WebKit/LayoutTests/animations/min-max-content-crash.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<style> -@keyframes test { - from { - min-width: -webkit-min-content; - min-height: -webkit-max-content; - } -} - -#target { - animation: test 1000s; -} -</style> -<div id="target"></div> -<script> -var async_handle = async_test('This test passes if it does not crash'); -requestAnimationFrame(function() { - async_handle.done(); -}); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/multiple-same-animations-asan-crash.html b/third_party/WebKit/LayoutTests/animations/multiple-same-animations-asan-crash.html deleted file mode 100644 index 3a223974..0000000 --- a/third_party/WebKit/LayoutTests/animations/multiple-same-animations-asan-crash.html +++ /dev/null
@@ -1,22 +0,0 @@ -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<style> -#target { - animation: test 1s, test 2s; -} -@keyframes test { - to { color: green; } -} -</style> -<div id="target"></div> -<script> -var asyncHandle = async_test('Don\'t crash ASAN when updating style with an element that has two animations with the same keyframes name and different timings.'); -// Wait a frame to let the animations get created. -requestAnimationFrame(function() { - // Force the next style recalc to be non-animation triggered. - target.style.color = 'blue'; - requestAnimationFrame(function() { - asyncHandle.done(); - }); -}); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/mutate-detached-keyframe-crash.html b/third_party/WebKit/LayoutTests/animations/mutate-detached-keyframe-crash.html deleted file mode 100644 index 1559ef73..0000000 --- a/third_party/WebKit/LayoutTests/animations/mutate-detached-keyframe-crash.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!DOCTYPE html> -<style id="sheet"> -@keyframes test { to { } } -</style> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<script> -test(() => { - var keyframeRule = document.styleSheets[0].cssRules[0].cssRules[0]; - sheet.remove(); - gc(); - keyframeRule.style.left = '0px'; -}, "Don't crash when mutating @keyframes rules that have been detached from the document."); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/option-opacity-inherit-crash.html b/third_party/WebKit/LayoutTests/animations/option-opacity-inherit-crash.html deleted file mode 100644 index 0e13d21a..0000000 --- a/third_party/WebKit/LayoutTests/animations/option-opacity-inherit-crash.html +++ /dev/null
@@ -1,33 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<object> - <a> - <option id="objectAOption"></option> - </a> -</object> - -<canvas> - <div> - <option id="canvasDivOption"></option> - </div> -</canvas> - -<script> -var objectAOptionTest = async_test("Don't crash when animating opacity with inherit on an <option> in an <a> in an <object>."); -objectAOptionTest.step(function() { - objectAOption.animate([{"opacity":"inherit"},{"opacity":"inherit"}], 1000); -}); - -var canvasDivOptionTest = async_test("Don't crash when animating opacity with inherit on an <option> in a <div> in a <canvas>."); -canvasDivOptionTest.step(function() { - canvasDivOption.animate([{"opacity":"inherit"},{"opacity":"inherit"}], 1000); -}); - -requestAnimationFrame(_ => { - requestAnimationFrame(_ => { - objectAOptionTest.done(); - canvasDivOptionTest.done(); - }); -}); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/pause-paused-animation-for-testing.html b/third_party/WebKit/LayoutTests/animations/pause-paused-animation-for-testing.html deleted file mode 100644 index ba6364b..0000000 --- a/third_party/WebKit/LayoutTests/animations/pause-paused-animation-for-testing.html +++ /dev/null
@@ -1,15 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<style> -@keyframes test {} -#target { - animation: test 1s paused; -} -</style> -<div id="target"></div> -<script> -test(() => { - internals.pauseAnimations(0); -}, 'Do not crash when pausing a paused animation for testing'); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/resource-loading.html b/third_party/WebKit/LayoutTests/animations/resource-loading.html deleted file mode 100644 index 39c7c31..0000000 --- a/third_party/WebKit/LayoutTests/animations/resource-loading.html +++ /dev/null
@@ -1,24 +0,0 @@ -<!DOCTYPE html> -<style> -#target { - width: 100px; - height: 100px; -} -</style> -<div id='target'></div> -This test passes if it does not crash. Newly referenced resources in the Web Animations api should be resolved in the style building stage. -<script> -target.animate([ - {backgroundImage: 'url(../animations/resources/blue-100.png)', color: 'blue'}, - {backgroundImage: 'url(../animations/resources/green-100.png)', color: 'green'}, - ], {duration: 1, fill: 'forwards'}); -if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); -} -requestAnimationFrame(function() { - if (window.testRunner) { - testRunner.notifyDone(); - } -}); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/restart-not-visible.html b/third_party/WebKit/LayoutTests/animations/restart-not-visible.html deleted file mode 100644 index f8c094b7..0000000 --- a/third_party/WebKit/LayoutTests/animations/restart-not-visible.html +++ /dev/null
@@ -1,31 +0,0 @@ -<!DOCTYPE html> -<style> -.run { - animation: foo 1s infinite alternate; -} - -@keyframes foo { - 100% { - transform: translateX(100px) - } -} -</style> -<div id="target"></div> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<script> -var test = async_test('Race between visibility and set compositor pending should not crash'); -requestAnimationFrame(t => { - requestAnimationFrame(t => { - target.classList.add('run'); - setTimeout(() => { - testRunner.setPageVisibility("hidden"); - target.style.transform = 'translateX(50px)'; - target.offsetTop; - setTimeout(() => { - test.done(); - }, 0); - }, 0); - }); -}); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/stability/animate-shorthand-var-crash.html b/third_party/WebKit/LayoutTests/animations/stability/animate-shorthand-var-crash.html new file mode 100644 index 0000000..bf03cdc --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/animate-shorthand-var-crash.html
@@ -0,0 +1,16 @@ +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +@keyframes crash { + from { border-radius: var(--) } +} +#target { + animation: crash 1s infinite; +} +</style> +<div id="target"></div> +<script> +test(() => { + getComputedStyle(target).borderRadius; +}, 'Do not crash when animating a shorthand with var().'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/animation-add-events-in-handler-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/animation-add-events-in-handler-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/animation-add-events-in-handler-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/animation-add-events-in-handler-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/animation-add-events-in-handler.html b/third_party/WebKit/LayoutTests/animations/stability/animation-add-events-in-handler.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/animation-add-events-in-handler.html rename to third_party/WebKit/LayoutTests/animations/stability/animation-add-events-in-handler.html
diff --git a/third_party/WebKit/LayoutTests/animations/stability/animation-css-cancel-update-crash.html b/third_party/WebKit/LayoutTests/animations/stability/animation-css-cancel-update-crash.html new file mode 100644 index 0000000..facb908 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/animation-css-cancel-update-crash.html
@@ -0,0 +1,23 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> + @keyframes anim { + from { background-color: blue; } + to { background-color: red; } + } + + @keyframes anim2 { + from { opacity: 0; } + to { opacity: 1; } + } +</style> +<div id="target"></div> +<script> + test(function() { + target.style.animation = "anim 1s, anim2 1s"; + target.offsetTop; + target.style.animation = "anim2 2s"; + target.offsetTop; + }, "Check that cancelling one running animation and updating another doesn't crash"); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/animation-end-event-destroy-renderer-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/animation-end-event-destroy-renderer-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/animation-end-event-destroy-renderer-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/animation-end-event-destroy-renderer-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/animation-end-event-destroy-renderer.html b/third_party/WebKit/LayoutTests/animations/stability/animation-end-event-destroy-renderer.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/animation-end-event-destroy-renderer.html rename to third_party/WebKit/LayoutTests/animations/stability/animation-end-event-destroy-renderer.html
diff --git a/third_party/WebKit/LayoutTests/animations/animation-iteration-event-destroy-renderer-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/animation-iteration-event-destroy-renderer-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/animation-iteration-event-destroy-renderer-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/animation-iteration-event-destroy-renderer-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/animation-iteration-event-destroy-renderer.html b/third_party/WebKit/LayoutTests/animations/stability/animation-iteration-event-destroy-renderer.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/animation-iteration-event-destroy-renderer.html rename to third_party/WebKit/LayoutTests/animations/stability/animation-iteration-event-destroy-renderer.html
diff --git a/third_party/WebKit/LayoutTests/animations/animation-name-none-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/animation-name-none-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/animation-name-none-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/animation-name-none-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/animation-name-none.html b/third_party/WebKit/LayoutTests/animations/stability/animation-name-none.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/animation-name-none.html rename to third_party/WebKit/LayoutTests/animations/stability/animation-name-none.html
diff --git a/third_party/WebKit/LayoutTests/animations/animation-on-inline-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/animation-on-inline-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/animation-on-inline-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/animation-on-inline-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/animation-on-inline-crash.html b/third_party/WebKit/LayoutTests/animations/stability/animation-on-inline-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/animation-on-inline-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/animation-on-inline-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/animation-shadow-element-crash-expected.html b/third_party/WebKit/LayoutTests/animations/stability/animation-shadow-element-crash-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/animation-shadow-element-crash-expected.html rename to third_party/WebKit/LayoutTests/animations/stability/animation-shadow-element-crash-expected.html
diff --git a/third_party/WebKit/LayoutTests/animations/animation-start-event-destroy-renderer-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/animation-start-event-destroy-renderer-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/animation-start-event-destroy-renderer-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/animation-start-event-destroy-renderer-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/animation-start-event-destroy-renderer.html b/third_party/WebKit/LayoutTests/animations/stability/animation-start-event-destroy-renderer.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/animation-start-event-destroy-renderer.html rename to third_party/WebKit/LayoutTests/animations/stability/animation-start-event-destroy-renderer.html
diff --git a/third_party/WebKit/LayoutTests/animations/stability/animation-transition-collision-crash.html b/third_party/WebKit/LayoutTests/animations/stability/animation-transition-collision-crash.html new file mode 100644 index 0000000..c60152b --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/animation-transition-collision-crash.html
@@ -0,0 +1,37 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +@keyframes test { + from { + /* These properties have -webkit-* equivalents. */ + background-size: 10px 10px; + box-shadow: 10px 10px green; + perspective: 10px; + transform: translate(10px, 10px); + perspective-origin: 10px 10px; + transform-origin: 10px 10px; + } +} +#target { + animation: test 1s; + transition: all 1s; +} +</style> +<div id="target"></div> +<script> +'use strict'; +async_test(t => { + let frameWait = 5; + function frame() { + frameWait--; + if (frameWait) { + requestAnimationFrame(frame); + } else { + t.done(); + } + } + requestAnimationFrame(frame); +}, 'Don\'t crash when animating transitioned properties'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/background-shorthand-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/background-shorthand-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/background-shorthand-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/background-shorthand-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/background-shorthand-crash.html b/third_party/WebKit/LayoutTests/animations/stability/background-shorthand-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/background-shorthand-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/background-shorthand-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/stability/background-trailing-comma-crash.html b/third_party/WebKit/LayoutTests/animations/stability/background-trailing-comma-crash.html new file mode 100644 index 0000000..93b94932 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/background-trailing-comma-crash.html
@@ -0,0 +1,9 @@ +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<div id="target"></div> +<script> +test(() => { + target.animate({background: 'none, 10px'}, {fill: 'forwards'}); + getComputedStyle(target).backgroundPosition; +}, "Don't crash when animating background with implicit longhand values and more than one bg-layer."); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/base-render-style-body-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/base-render-style-body-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/base-render-style-body-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/base-render-style-body-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/base-render-style-body-crash.html b/third_party/WebKit/LayoutTests/animations/stability/base-render-style-body-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/base-render-style-body-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/base-render-style-body-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/base-render-style-crash-expected.html b/third_party/WebKit/LayoutTests/animations/stability/base-render-style-crash-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/base-render-style-crash-expected.html rename to third_party/WebKit/LayoutTests/animations/stability/base-render-style-crash-expected.html
diff --git a/third_party/WebKit/LayoutTests/animations/base-render-style-crash.html b/third_party/WebKit/LayoutTests/animations/stability/base-render-style-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/base-render-style-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/base-render-style-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/base-render-style-font-selector-version-assert-expected.html b/third_party/WebKit/LayoutTests/animations/stability/base-render-style-font-selector-version-assert-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/base-render-style-font-selector-version-assert-expected.html rename to third_party/WebKit/LayoutTests/animations/stability/base-render-style-font-selector-version-assert-expected.html
diff --git a/third_party/WebKit/LayoutTests/animations/base-render-style-font-selector-version-assert.html b/third_party/WebKit/LayoutTests/animations/stability/base-render-style-font-selector-version-assert.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/base-render-style-font-selector-version-assert.html rename to third_party/WebKit/LayoutTests/animations/stability/base-render-style-font-selector-version-assert.html
diff --git a/third_party/WebKit/LayoutTests/animations/body-removal-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/body-removal-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/body-removal-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/body-removal-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/body-removal-crash.html b/third_party/WebKit/LayoutTests/animations/stability/body-removal-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/body-removal-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/body-removal-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/stability/checkbox-padding-animation-crash.html b/third_party/WebKit/LayoutTests/animations/stability/checkbox-padding-animation-crash.html new file mode 100644 index 0000000..94f2d14e --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/checkbox-padding-animation-crash.html
@@ -0,0 +1,14 @@ +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +@keyframes anim { + to { padding-top: 50px; } +} +input { animation: anim 1s; } +</style> +<input type="checkbox" id="target"></input> +<script> +test(function() { + getComputedStyle(target); +}, 'This test passes if it does not crash.') +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/animations/stability/composited-identity-animation-layer-squash-crash.html b/third_party/WebKit/LayoutTests/animations/stability/composited-identity-animation-layer-squash-crash.html new file mode 100644 index 0000000..07a018f --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/composited-identity-animation-layer-squash-crash.html
@@ -0,0 +1,26 @@ +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<div id="opacity"> + <div style="position: relative"></div> +</div> +<div id="transform"> + <div style="position: relative"></div> +</div> +<script> +var asyncHandle = async_test('This test passes if it does not crash.'); +var opacityPlayer = opacity.animate([ + {opacity: 1}, + {opacity: 1}, +], 1e6); +var transformPlayer = transform.animate([ + {transform: 'none'}, + {transform: 'none'}, +], 1e6); +requestAnimationFrame(function() { + opacityPlayer.cancel(); + transformPlayer.cancel(); + requestAnimationFrame(function() { + asyncHandle.done(); + }); +}); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/stability/css-length-range-crash.html b/third_party/WebKit/LayoutTests/animations/stability/css-length-range-crash.html new file mode 100644 index 0000000..e3b945a --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/css-length-range-crash.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<div id="target"></div> +<script> +target.animate([{ + left: '1e100px', + top: '-1e100px', +}, { + left: '0px', + top: '0px', +}], 1000); + +var async_handle = async_test('This test passes if it does not crash'); +requestAnimationFrame(function() { + async_handle.done(); +}); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/stability/d-path-neutral-value-crash.html b/third_party/WebKit/LayoutTests/animations/stability/d-path-neutral-value-crash.html new file mode 100644 index 0000000..99f08240 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/d-path-neutral-value-crash.html
@@ -0,0 +1,11 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<div id="target"></div> +<script> +test(function() { + target.style.d = 'path("m0 0a0 0 0 0 0 0 0")'; + target.animate({d: 'none'}, 1); + getComputedStyle(target).d; +}, 'Do not crash when animating path with an underlying value involving arc flags.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/deleted-image-set-transition-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/deleted-image-set-transition-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/deleted-image-set-transition-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/deleted-image-set-transition-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/deleted-image-set-transition-crash.html b/third_party/WebKit/LayoutTests/animations/stability/deleted-image-set-transition-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/deleted-image-set-transition-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/deleted-image-set-transition-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/stability/detached-document-element-animate-crash.html b/third_party/WebKit/LayoutTests/animations/stability/detached-document-element-animate-crash.html new file mode 100644 index 0000000..fe5c250 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/detached-document-element-animate-crash.html
@@ -0,0 +1,8 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +test(() => { + document.implementation.createDocument('', '').createElement('div').animate({transform: 'none'}, 1000); +}, 'Don\'t crash when animating elements attached to detached documents.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/element-animate-float-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/element-animate-float-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/element-animate-float-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/element-animate-float-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/element-animate-float-crash.html b/third_party/WebKit/LayoutTests/animations/stability/element-animate-float-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/element-animate-float-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/element-animate-float-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/element-animate-font-style-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/element-animate-font-style-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/element-animate-font-style-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/element-animate-font-style-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/element-animate-font-style-crash.html b/third_party/WebKit/LayoutTests/animations/stability/element-animate-font-style-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/element-animate-font-style-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/element-animate-font-style-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/element-animate-position-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/element-animate-position-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/element-animate-position-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/element-animate-position-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/element-animate-position-crash.html b/third_party/WebKit/LayoutTests/animations/stability/element-animate-position-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/element-animate-position-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/element-animate-position-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/empty-keyframe-animation-composited-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/empty-keyframe-animation-composited-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/empty-keyframe-animation-composited-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/empty-keyframe-animation-composited-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/empty-keyframe-animation-composited.html b/third_party/WebKit/LayoutTests/animations/stability/empty-keyframe-animation-composited.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/empty-keyframe-animation-composited.html rename to third_party/WebKit/LayoutTests/animations/stability/empty-keyframe-animation-composited.html
diff --git a/third_party/WebKit/LayoutTests/animations/empty-keyframes-composited-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/empty-keyframes-composited-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/empty-keyframes-composited-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/empty-keyframes-composited-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/empty-keyframes-composited.html b/third_party/WebKit/LayoutTests/animations/stability/empty-keyframes-composited.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/empty-keyframes-composited.html rename to third_party/WebKit/LayoutTests/animations/stability/empty-keyframes-composited.html
diff --git a/third_party/WebKit/LayoutTests/animations/empty-keyframes-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/empty-keyframes-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/empty-keyframes-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/empty-keyframes-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/empty-keyframes.html b/third_party/WebKit/LayoutTests/animations/stability/empty-keyframes.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/empty-keyframes.html rename to third_party/WebKit/LayoutTests/animations/stability/empty-keyframes.html
diff --git a/third_party/WebKit/LayoutTests/animations/font-builder-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/font-builder-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/font-builder-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/font-builder-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/font-builder-crash.html b/third_party/WebKit/LayoutTests/animations/stability/font-builder-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/font-builder-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/font-builder-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/import-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/import-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/import-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/import-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/import-crash.html b/third_party/WebKit/LayoutTests/animations/stability/import-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/import-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/import-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/inherit-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/inherit-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/inherit-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/inherit-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/inherit-crash.html b/third_party/WebKit/LayoutTests/animations/stability/inherit-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/inherit-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/inherit-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/stability/invalid-decompose-invert.html b/third_party/WebKit/LayoutTests/animations/stability/invalid-decompose-invert.html new file mode 100644 index 0000000..1014385e --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/invalid-decompose-invert.html
@@ -0,0 +1,10 @@ +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<div id="target"></div> +<script> +var asyncHandle = async_test('Don\'t crash MSAN when decomposing a matrix that has an invalid inversion step.'); +target.animate([{"transform":"matrix3d( 0.9 , 0.9 , -0.1 , 66.33333333 , 0.9 , 0.3 , -0.1 , 0.1 , 0.9 , -1 , 9.5 , 0.9 , 1.5 , 0.3 , 0.3 , 1000 ) matrix( 0.3 , -0.1 , 0.3 , 66.33333333 , 9.5 , 1.5 ) rotateY( 45deg )"},{"transform":"none"},{"transform":"none"}], {"duration":2652.899310924113}); +requestAnimationFrame(function() { + asyncHandle.done(); +}); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/stability/keyframe-effect-null-target-crash.html b/third_party/WebKit/LayoutTests/animations/stability/keyframe-effect-null-target-crash.html new file mode 100644 index 0000000..9d10c3e --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/keyframe-effect-null-target-crash.html
@@ -0,0 +1,9 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<div id="target"></div> +<script> +test(() => { + new KeyframeEffect(null, [], {}); +}, 'Do not crash when creating KeyframeEffects with null targets.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/keyframe-iteration-exception-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/keyframe-iteration-exception-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/keyframe-iteration-exception-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/keyframe-iteration-exception-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/stability/keyframe-iteration-exception-crash.html b/third_party/WebKit/LayoutTests/animations/stability/keyframe-iteration-exception-crash.html new file mode 100644 index 0000000..4cde82c --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/keyframe-iteration-exception-crash.html
@@ -0,0 +1,15 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<div id="target"></div> +<script> +test(() => { + assert_throws(null, () => { + target.animate({ + [Symbol.iterator]() { + return { next() { throw 'error'; } }; + } + }); + }); +}, 'Do not crash when exceptions are thrown during keyframe iteration.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/keyframe-timing-function-unset-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/keyframe-timing-function-unset-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/keyframe-timing-function-unset-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/keyframe-timing-function-unset-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/keyframe-timing-function-unset-crash.html b/third_party/WebKit/LayoutTests/animations/stability/keyframe-timing-function-unset-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/keyframe-timing-function-unset-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/keyframe-timing-function-unset-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/keyframeeffect-no-target-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/keyframeeffect-no-target-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/keyframeeffect-no-target-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/keyframeeffect-no-target-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/keyframeeffect-no-target-crash.html b/third_party/WebKit/LayoutTests/animations/stability/keyframeeffect-no-target-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/keyframeeffect-no-target-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/keyframeeffect-no-target-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/stability/keyword-composition-crash.html b/third_party/WebKit/LayoutTests/animations/stability/keyword-composition-crash.html new file mode 100644 index 0000000..8cfd896 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/keyword-composition-crash.html
@@ -0,0 +1,10 @@ +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<div id="target"></div> +<script> +test(() => { + target.animate([{position: 'absolute'}], {fill: 'forwards'}); + target.animate([{position: 'static', composite: 'add'}], {fill: 'forwards'}); + getComputedStyle(target).position; +}, "Don't crash when compositing keyword animations."); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/stability/length-zero-percent-crash.html b/third_party/WebKit/LayoutTests/animations/stability/length-zero-percent-crash.html new file mode 100644 index 0000000..86806e95e --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/length-zero-percent-crash.html
@@ -0,0 +1,9 @@ +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<div id="target"></div> +<script> +test(() => { + target.animate({margin: ['1px', '0%']}, {iterationStart: 0.5, fill: 'forwards'}); + assert_equals(getComputedStyle(target).margin, '0.5px'); +}, "Don't crash when animating length properties to 0%"); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/stability/min-max-content-crash.html b/third_party/WebKit/LayoutTests/animations/stability/min-max-content-crash.html new file mode 100644 index 0000000..7553564c --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/min-max-content-crash.html
@@ -0,0 +1,22 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +@keyframes test { + from { + min-width: -webkit-min-content; + min-height: -webkit-max-content; + } +} + +#target { + animation: test 1000s; +} +</style> +<div id="target"></div> +<script> +var async_handle = async_test('This test passes if it does not crash'); +requestAnimationFrame(function() { + async_handle.done(); +}); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/stability/multiple-same-animations-asan-crash.html b/third_party/WebKit/LayoutTests/animations/stability/multiple-same-animations-asan-crash.html new file mode 100644 index 0000000..8a04ae7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/multiple-same-animations-asan-crash.html
@@ -0,0 +1,22 @@ +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +#target { + animation: test 1s, test 2s; +} +@keyframes test { + to { color: green; } +} +</style> +<div id="target"></div> +<script> +var asyncHandle = async_test('Don\'t crash ASAN when updating style with an element that has two animations with the same keyframes name and different timings.'); +// Wait a frame to let the animations get created. +requestAnimationFrame(function() { + // Force the next style recalc to be non-animation triggered. + target.style.color = 'blue'; + requestAnimationFrame(function() { + asyncHandle.done(); + }); +}); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/stability/mutate-detached-keyframe-crash.html b/third_party/WebKit/LayoutTests/animations/stability/mutate-detached-keyframe-crash.html new file mode 100644 index 0000000..202cb6a --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/mutate-detached-keyframe-crash.html
@@ -0,0 +1,14 @@ +<!DOCTYPE html> +<style id="sheet"> +@keyframes test { to { } } +</style> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +test(() => { + var keyframeRule = document.styleSheets[0].cssRules[0].cssRules[0]; + sheet.remove(); + gc(); + keyframeRule.style.left = '0px'; +}, "Don't crash when mutating @keyframes rules that have been detached from the document."); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/option-element-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/option-element-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/option-element-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/option-element-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/option-element-crash.html b/third_party/WebKit/LayoutTests/animations/stability/option-element-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/option-element-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/option-element-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/stability/option-opacity-inherit-crash.html b/third_party/WebKit/LayoutTests/animations/stability/option-opacity-inherit-crash.html new file mode 100644 index 0000000..0875e7a --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/option-opacity-inherit-crash.html
@@ -0,0 +1,33 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<object> + <a> + <option id="objectAOption"></option> + </a> +</object> + +<canvas> + <div> + <option id="canvasDivOption"></option> + </div> +</canvas> + +<script> +var objectAOptionTest = async_test("Don't crash when animating opacity with inherit on an <option> in an <a> in an <object>."); +objectAOptionTest.step(function() { + objectAOption.animate([{"opacity":"inherit"},{"opacity":"inherit"}], 1000); +}); + +var canvasDivOptionTest = async_test("Don't crash when animating opacity with inherit on an <option> in a <div> in a <canvas>."); +canvasDivOptionTest.step(function() { + canvasDivOption.animate([{"opacity":"inherit"},{"opacity":"inherit"}], 1000); +}); + +requestAnimationFrame(_ => { + requestAnimationFrame(_ => { + objectAOptionTest.done(); + canvasDivOptionTest.done(); + }); +}); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/pause-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/pause-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/pause-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/pause-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/pause-crash.html b/third_party/WebKit/LayoutTests/animations/stability/pause-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/pause-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/pause-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/stability/pause-paused-animation-for-testing.html b/third_party/WebKit/LayoutTests/animations/stability/pause-paused-animation-for-testing.html new file mode 100644 index 0000000..4616656 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/pause-paused-animation-for-testing.html
@@ -0,0 +1,15 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +@keyframes test {} +#target { + animation: test 1s paused; +} +</style> +<div id="target"></div> +<script> +test(() => { + internals.pauseAnimations(0); +}, 'Do not crash when pausing a paused animation for testing'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/pseudo-element-animation-with-color-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/pseudo-element-animation-with-color-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/pseudo-element-animation-with-color-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/pseudo-element-animation-with-color-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/pseudo-element-animation-with-color-crash.html b/third_party/WebKit/LayoutTests/animations/stability/pseudo-element-animation-with-color-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/pseudo-element-animation-with-color-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/pseudo-element-animation-with-color-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/pseudo-element-animation-with-marker-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/pseudo-element-animation-with-marker-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/pseudo-element-animation-with-marker-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/pseudo-element-animation-with-marker-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/pseudo-element-animation-with-marker-crash.html b/third_party/WebKit/LayoutTests/animations/stability/pseudo-element-animation-with-marker-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/pseudo-element-animation-with-marker-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/pseudo-element-animation-with-marker-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/pseudo-element-animation-with-rems-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/pseudo-element-animation-with-rems-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/pseudo-element-animation-with-rems-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/pseudo-element-animation-with-rems-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/pseudo-element-animation-with-rems.html b/third_party/WebKit/LayoutTests/animations/stability/pseudo-element-animation-with-rems.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/pseudo-element-animation-with-rems.html rename to third_party/WebKit/LayoutTests/animations/stability/pseudo-element-animation-with-rems.html
diff --git a/third_party/WebKit/LayoutTests/animations/resource-loading-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/resource-loading-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/resource-loading-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/resource-loading-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/stability/resource-loading.html b/third_party/WebKit/LayoutTests/animations/stability/resource-loading.html new file mode 100644 index 0000000..56f5d13 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/resource-loading.html
@@ -0,0 +1,24 @@ +<!DOCTYPE html> +<style> +#target { + width: 100px; + height: 100px; +} +</style> +<div id='target'></div> +This test passes if it does not crash. Newly referenced resources in the Web Animations api should be resolved in the style building stage. +<script> +target.animate([ + {backgroundImage: 'url(../../animations/resources/blue-100.png)', color: 'blue'}, + {backgroundImage: 'url(../../animations/resources/green-100.png)', color: 'green'}, + ], {duration: 1, fill: 'forwards'}); +if (window.testRunner) { + testRunner.dumpAsText(); + testRunner.waitUntilDone(); +} +requestAnimationFrame(function() { + if (window.testRunner) { + testRunner.notifyDone(); + } +}); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/stability/restart-not-visible.html b/third_party/WebKit/LayoutTests/animations/stability/restart-not-visible.html new file mode 100644 index 0000000..6ac765a --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/restart-not-visible.html
@@ -0,0 +1,31 @@ +<!DOCTYPE html> +<style> +.run { + animation: foo 1s infinite alternate; +} + +@keyframes foo { + 100% { + transform: translateX(100px) + } +} +</style> +<div id="target"></div> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +var test = async_test('Race between visibility and set compositor pending should not crash'); +requestAnimationFrame(t => { + requestAnimationFrame(t => { + target.classList.add('run'); + setTimeout(() => { + testRunner.setPageVisibility("hidden"); + target.style.transform = 'translateX(50px)'; + target.offsetTop; + setTimeout(() => { + test.done(); + }, 0); + }, 0); + }); +}); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/stability/svg-element-css-animation-crash.html b/third_party/WebKit/LayoutTests/animations/stability/svg-element-css-animation-crash.html new file mode 100644 index 0000000..ba6fab725 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/svg-element-css-animation-crash.html
@@ -0,0 +1,16 @@ +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +@keyframes crash { + to {color: green;} +} +rect { + animation: crash 100s; +} +</style> +<svg> + <rect></rect> +</svg> +<script> +test(() => {}, 'This test passes if it does not crash.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/stability/svg-length-unittype-crash.html b/third_party/WebKit/LayoutTests/animations/stability/svg-length-unittype-crash.html new file mode 100644 index 0000000..8479f511 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/svg-length-unittype-crash.html
@@ -0,0 +1,9 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<svg><circle id="target"/></svg> +<script> +test(() => { + target.animate([{'svg-r': '10px'}, {'svg-r': '100px'}], 1000); +}, "Don't crash when applying SVG R attribute."); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/stability/transform-css-animation-squash-crash.html b/third_party/WebKit/LayoutTests/animations/stability/transform-css-animation-squash-crash.html new file mode 100644 index 0000000..6efef0c --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/transform-css-animation-squash-crash.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> + +<style> +@keyframes test { + to { transform: rotate(360deg); } +} +</style> + +<div id="target" style="animation: test 1s;"> + <div style="transform: translateZ(0);"></div> + <div style="position: relative;"></div> +</div> + +<script> +test(() => {}, "Don't crash when squashing layers in newly started CSS transform animations."); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/universal-selector-opacity-inherit-crash-expected.html b/third_party/WebKit/LayoutTests/animations/stability/universal-selector-opacity-inherit-crash-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/universal-selector-opacity-inherit-crash-expected.html rename to third_party/WebKit/LayoutTests/animations/stability/universal-selector-opacity-inherit-crash-expected.html
diff --git a/third_party/WebKit/LayoutTests/animations/universal-selector-opacity-inherit-crash.html b/third_party/WebKit/LayoutTests/animations/stability/universal-selector-opacity-inherit-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/universal-selector-opacity-inherit-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/universal-selector-opacity-inherit-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/stability/unstringable-keyframe-value-crash.html b/third_party/WebKit/LayoutTests/animations/stability/unstringable-keyframe-value-crash.html new file mode 100644 index 0000000..438973a --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/unstringable-keyframe-value-crash.html
@@ -0,0 +1,10 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +test(() => { + assert_throws({name: 'TypeError'}, () => { + document.body.animate({left: [{toString:null}]}); + }); +}, 'Do not crash when passing an unstringable value in a property indexed keyframe'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/stability/webkit-filter-default-arg-crash.html b/third_party/WebKit/LayoutTests/animations/stability/webkit-filter-default-arg-crash.html new file mode 100644 index 0000000..fdce388b --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/webkit-filter-default-arg-crash.html
@@ -0,0 +1,59 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +@keyframes anim-blur { + from { -webkit-filter: blur(); } + to { -webkit-filter: blur(1px); } +} +@keyframes anim-brightness { + from { -webkit-filter: brightness(); } + to { -webkit-filter: brightness(1); } +} +@keyframes anim-contrast { + from { -webkit-filter: contrast(); } + to { -webkit-filter: contrast(1); } +} +@keyframes anim-drop-shadow { + from { -webkit-filter: drop-shadow(); } + to { -webkit-filter: drop-shadow(1px 1px); } +} +@keyframes anim-grayscale { + from { -webkit-filter: grayscale(); } + to { -webkit-filter: grayscale(1); } +} +@keyframes anim-hue-rotate { + from { -webkit-filter: hue-rotate(); } + to { -webkit-filter: hue-rotate(1deg); } +} +@keyframes anim-invert { + from { -webkit-filter: invert(); } + to { -webkit-filter: invert(1); } +} +@keyframes anim-opacity { + from { -webkit-filter: opacity(); } + to { -webkit-filter: opacity(1); } +} +@keyframes anim-sepia { + from { -webkit-filter: sepia(); } + to { -webkit-filter: sepia(1); } +} +@keyframes anim-saturate { + from { -webkit-filter: saturate(); } + to { -webkit-filter: saturate(1); } +} +</style> +<div style="animation: anim-blur 1s"></div> +<div style="animation: anim-brightness 1s"></div> +<div style="animation: anim-contrast 1s"></div> +<div style="animation: anim-drop-shadow 1s"></div> +<div style="animation: anim-grayscale 1s"></div> +<div style="animation: anim-hue-rotate 1s"></div> +<div style="animation: anim-invert 1s"></div> +<div style="animation: anim-opacity 1s"></div> +<div style="animation: anim-sepia 1s"></div> +<div style="animation: anim-saturate 1s"></div> +<script> +var asyncHandle = async_test("Don't crash when animating default filter parameters."); +requestAnimationFrame(() => asyncHandle.done()); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/stability/webkit-origin-dimension-animation-crash.html b/third_party/WebKit/LayoutTests/animations/stability/webkit-origin-dimension-animation-crash.html new file mode 100644 index 0000000..8f4a5e5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/stability/webkit-origin-dimension-animation-crash.html
@@ -0,0 +1,22 @@ +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +@keyframes test { + to { + -webkit-perspective-origin-x: 1px; + -webkit-perspective-origin-y: 1px; + -webkit-transform-origin-x: 1px; + -webkit-transform-origin-y: 1px; + -webkit-transform-origin-z: 1px; + } +} +#target { + animation: test 1s; +} +</style> +<div id="target"></div> +<script> +test(function() { + getComputedStyle(target); +}, 'This test passes if it does not crash'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/zero-duration-infinite-iterations-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/zero-duration-infinite-iterations-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/zero-duration-infinite-iterations-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/zero-duration-infinite-iterations-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/zero-duration-infinite-iterations.html b/third_party/WebKit/LayoutTests/animations/stability/zero-duration-infinite-iterations.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/zero-duration-infinite-iterations.html rename to third_party/WebKit/LayoutTests/animations/stability/zero-duration-infinite-iterations.html
diff --git a/third_party/WebKit/LayoutTests/animations/zero-duration-large-start-delay-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/zero-duration-large-start-delay-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/zero-duration-large-start-delay-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/zero-duration-large-start-delay-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/zero-duration-large-start-delay.html b/third_party/WebKit/LayoutTests/animations/stability/zero-duration-large-start-delay.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/zero-duration-large-start-delay.html rename to third_party/WebKit/LayoutTests/animations/stability/zero-duration-large-start-delay.html
diff --git a/third_party/WebKit/LayoutTests/animations/zoomed-length-crash-expected.txt b/third_party/WebKit/LayoutTests/animations/stability/zoomed-length-crash-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/zoomed-length-crash-expected.txt rename to third_party/WebKit/LayoutTests/animations/stability/zoomed-length-crash-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/zoomed-length-crash.html b/third_party/WebKit/LayoutTests/animations/stability/zoomed-length-crash.html similarity index 100% rename from third_party/WebKit/LayoutTests/animations/zoomed-length-crash.html rename to third_party/WebKit/LayoutTests/animations/stability/zoomed-length-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/step-middle-keyword-timing-function-deprecated.html b/third_party/WebKit/LayoutTests/animations/step-middle-keyword-timing-function-deprecated.html deleted file mode 100644 index eeee64d..0000000 --- a/third_party/WebKit/LayoutTests/animations/step-middle-keyword-timing-function-deprecated.html +++ /dev/null
@@ -1,24 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<script> -'use strict'; -// From WebFeature.h -var kDeprecatedTimingFunctionStepMiddle = 2024; - -test(() => { - assert_false(internals.isUseCounted(document, kDeprecatedTimingFunctionStepMiddle)); - var element = document.createElement('div'); - element.style.animationTimingFunction = 'step-middle'; - document.documentElement.appendChild(element); - assert_equals(getComputedStyle(element).animationTimingFunction, 'ease'); - assert_false(internals.isUseCounted(document, kDeprecatedTimingFunctionStepMiddle)); -}, 'The step-middle timing function does not function outside of Web Animations.'); - -test(() => { - assert_false(internals.isUseCounted(document, kDeprecatedTimingFunctionStepMiddle)); - document.documentElement.animate([], { easing: 'step-middle' }); - assert_true(internals.isUseCounted(document, kDeprecatedTimingFunctionStepMiddle)); -}, 'The step-middle timing function is deprecated in Web Animations.'); - -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/step-middle-timing-function-deprecated.html b/third_party/WebKit/LayoutTests/animations/step-middle-timing-function-deprecated.html deleted file mode 100644 index bda90b4..0000000 --- a/third_party/WebKit/LayoutTests/animations/step-middle-timing-function-deprecated.html +++ /dev/null
@@ -1,24 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<script> -'use strict'; -// From WebFeature.h -var kDeprecatedTimingFunctionStepMiddle = 2024; - -test(() => { - assert_false(internals.isUseCounted(document, kDeprecatedTimingFunctionStepMiddle)); - var element = document.createElement('div'); - element.style.animationTimingFunction = 'steps(3, middle)'; - document.documentElement.appendChild(element); - assert_equals(getComputedStyle(element).animationTimingFunction, 'ease'); - assert_false(internals.isUseCounted(document, kDeprecatedTimingFunctionStepMiddle)); -}, 'The step timing function with step position \'middle\' does not function outside of Web Animations.'); - -test(() => { - assert_false(internals.isUseCounted(document, kDeprecatedTimingFunctionStepMiddle)); - document.documentElement.animate([], { easing: 'steps(3, middle)' }); - assert_true(internals.isUseCounted(document, kDeprecatedTimingFunctionStepMiddle)); -}, 'The step timing function with step position \'middle\' is deprecated in Web Animations.'); - -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/svg-element-css-animation-crash.html b/third_party/WebKit/LayoutTests/animations/svg-element-css-animation-crash.html deleted file mode 100644 index a66769c..0000000 --- a/third_party/WebKit/LayoutTests/animations/svg-element-css-animation-crash.html +++ /dev/null
@@ -1,16 +0,0 @@ -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<style> -@keyframes crash { - to {color: green;} -} -rect { - animation: crash 100s; -} -</style> -<svg> - <rect></rect> -</svg> -<script> -test(() => {}, 'This test passes if it does not crash.'); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/svg-length-unittype-crash.html b/third_party/WebKit/LayoutTests/animations/svg-length-unittype-crash.html deleted file mode 100644 index a3dcca5..0000000 --- a/third_party/WebKit/LayoutTests/animations/svg-length-unittype-crash.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<svg><circle id="target"/></svg> -<script> -test(() => { - target.animate([{'svg-r': '10px'}, {'svg-r': '100px'}], 1000); -}, "Don't crash when applying SVG R attribute."); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/transform-css-animation-squash-crash.html b/third_party/WebKit/LayoutTests/animations/transform-css-animation-squash-crash.html deleted file mode 100644 index 334c135..0000000 --- a/third_party/WebKit/LayoutTests/animations/transform-css-animation-squash-crash.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> - -<style> -@keyframes test { - to { transform: rotate(360deg); } -} -</style> - -<div id="target" style="animation: test 1s;"> - <div style="transform: translateZ(0);"></div> - <div style="position: relative;"></div> -</div> - -<script> -test(() => {}, "Don't crash when squashing layers in newly started CSS transform animations."); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/unstringable-keyframe-value-crash.html b/third_party/WebKit/LayoutTests/animations/unstringable-keyframe-value-crash.html deleted file mode 100644 index ee495b25..0000000 --- a/third_party/WebKit/LayoutTests/animations/unstringable-keyframe-value-crash.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<script> -test(() => { - assert_throws({name: 'TypeError'}, () => { - document.body.animate({left: [{toString:null}]}); - }); -}, 'Do not crash when passing an unstringable value in a property indexed keyframe'); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/use-count-SyntheticKeyframesInCompositedCSSAnimation.html b/third_party/WebKit/LayoutTests/animations/use-count-SyntheticKeyframesInCompositedCSSAnimation.html deleted file mode 100644 index f6b97ab..0000000 --- a/third_party/WebKit/LayoutTests/animations/use-count-SyntheticKeyframesInCompositedCSSAnimation.html +++ /dev/null
@@ -1,57 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<style> -@keyframes noSyntheticKeyframes { - from { color: black; } - to { color: green; } -} -@keyframes customPropertySyntheticKeyframes { - to { --x: pants; } -} -@keyframes nonCompositedSyntheticKeyframes { - to { color: green; } -} -@keyframes compositedSyntheticKeyframes { - from { - opacity: 0; - } - to { - transform: rotate(45deg); - opacity: 1; - } -} -#target { - animation-duration: 1s; -} -</style> -<div id="target"></div> -<script> -// From UseCounter.h. -var SyntheticKeyframesInCompositedCSSAnimation = 664; - -function forceStyleRecalc() { - getComputedStyle(target).left; -} - -test(() => { - forceStyleRecalc(); - assert_false(internals.isUseCounted(document, SyntheticKeyframesInCompositedCSSAnimation), 'No animations started'); - - target.style.animationName = 'noSyntheticKeyframes'; - forceStyleRecalc(); - assert_false(internals.isUseCounted(document, SyntheticKeyframesInCompositedCSSAnimation), 'noSyntheticKeyframes'); - - target.style.animationName = 'customPropertySyntheticKeyframes'; - forceStyleRecalc(); - assert_false(internals.isUseCounted(document, SyntheticKeyframesInCompositedCSSAnimation), 'customPropertySyntheticKeyframes'); - - target.style.animationName = 'nonCompositedSyntheticKeyframes'; - forceStyleRecalc(); - assert_false(internals.isUseCounted(document, SyntheticKeyframesInCompositedCSSAnimation), 'nonCompositedSyntheticKeyframes'); - - target.style.animationName = 'compositedSyntheticKeyframes'; - forceStyleRecalc(); - assert_true(internals.isUseCounted(document, SyntheticKeyframesInCompositedCSSAnimation), 'compositedSyntheticKeyframes'); -}, 'The SyntheticKeyframesInCompositedCSSAnimation use counter should only be triggered by animations with composited properties with neutral keyframes'); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/use-count-stacked-neutral-keyframe.html b/third_party/WebKit/LayoutTests/animations/use-count-stacked-neutral-keyframe.html deleted file mode 100644 index 84fce3e..0000000 --- a/third_party/WebKit/LayoutTests/animations/use-count-stacked-neutral-keyframe.html +++ /dev/null
@@ -1,31 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<style> -#target { - animation-name: a, b; - animation-duration: 1e10s; -} - -@keyframes a { - from { left: 1px; } - to { left: 1px; } -} - -@keyframes b { - from { left: 1px; } - to { left: 1px; } -} -</style> -<div id="target"></div> -<script> -var CSSAnimationsStackedNeutralKeyframe = 937; // From UseCounter.h -test(function() { - getComputedStyle(target).left; // Force style recalc; - assert_false(internals.isUseCounted(document, CSSAnimationsStackedNeutralKeyframe)); - - document.styleSheets[0].rules[2].deleteRule('from'); - getComputedStyle(target).left; // Force style recalc; - assert_true(internals.isUseCounted(document, CSSAnimationsStackedNeutralKeyframe)); -}); -</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/animations/usecounter-tests/animated-css-property-usecounter-for-transitions.html b/third_party/WebKit/LayoutTests/animations/usecounter-tests/animated-css-property-usecounter-for-transitions.html new file mode 100644 index 0000000..a37a2bc --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/usecounter-tests/animated-css-property-usecounter-for-transitions.html
@@ -0,0 +1,62 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> + +<style> +#target { + width: 100px; + height: 100px; + transition: width 1s; +} +</style> + +<div id="target"></div> + +<script> +'use strict'; + +function waitForProgress() { + var initialWidth = getComputedStyle(target).width; + return new Promise(resolve => { + function poll() { + var width = getComputedStyle(target).width; + if (width === initialWidth) { + requestAnimationFrame(poll); + } else { + resolve(); + } + } + requestAnimationFrame(poll); + }); +} + +async_test(t => { + assert_true( + internals.isCSSPropertyUseCounted(document, "width"), + 'Usage of width in style causes it to be counted in normal CSS ' + + 'property UseCounter'); + assert_true( + internals.isCSSPropertyUseCounted(document, "height"), + 'Usage of height in style causes it to be counted in normal CSS ' + + 'property UseCounter'); + + assert_false( + internals.isAnimatedCSSPropertyUseCounted(document, "width"), + 'Initially width animation has not been UseCounted'); + assert_false( + internals.isAnimatedCSSPropertyUseCounted(document, "height"), + 'Initially height animation has not been UseCounted'); + + target.offsetTop; // force recalc + target.style.width = '200px'; + + waitForProgress().then(t.step_func_done(() => { + assert_true( + internals.isAnimatedCSSPropertyUseCounted(document, "width"), + 'After triggering the transition, width has been counted'); + assert_false( + internals.isAnimatedCSSPropertyUseCounted(document, "height"), + 'Height is not animated, so not counted'); + })); +}, 'Using CSS transitions causes UseCounter to be incremented.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/usecounter-tests/animated-css-property-usecounter.html b/third_party/WebKit/LayoutTests/animations/usecounter-tests/animated-css-property-usecounter.html new file mode 100644 index 0000000..5e179d4f --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/usecounter-tests/animated-css-property-usecounter.html
@@ -0,0 +1,90 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> + +<style> +@keyframes bgColorAnim { + from { + background-color: blue; + } + to { + background-color: red; + } +} + +@keyframes customPropertyAnim { + from { + --x: blue; + } + to { + --x: red; + } +} + +#target { + width: 100px; + height: 100px; +} +</style> + +<div id="target"></div> + +<script> +'use strict'; + +test(() => { + assert_true( + internals.isCSSPropertyUseCounted(document, "background-color"), + 'Usage of background-color in style causes it to be counted in ' + + 'normal CSS property UseCounter'); + assert_true( + internals.isCSSPropertyUseCounted(document, "width"), + 'Usage of width in style causes it to be counted in normal CSS ' + + 'property UseCounter'); + + assert_false( + internals.isAnimatedCSSPropertyUseCounted(document, "background-color"), + 'Initially background-color animation has not been UseCounted'); + assert_false( + internals.isAnimatedCSSPropertyUseCounted(document, "width"), + 'Initially width animation has not been UseCounted'); + + target.style.animation = 'bgColorAnim 1s'; + target.offsetTop; // force recalc + + assert_true( + internals.isAnimatedCSSPropertyUseCounted(document, "background-color"), + 'After applying the animation, background-color has been counted'); + assert_false( + internals.isAnimatedCSSPropertyUseCounted(document, "width"), + 'Width is not animated, so not counted'); +}, 'Animating properties via CSS causes UseCounter to be incremented.'); + +test(() => { + assert_true( + internals.isCSSPropertyUseCounted(document, "--x"), + 'Usage of custom property --x in style causes it to be counted in ' + + 'normal CSS property UseCounter'); + assert_true( + internals.isCSSPropertyUseCounted(document, "--y"), + 'All custom properties are counted together in normal CSS property ' + + 'UseCounter'); + + assert_false( + internals.isAnimatedCSSPropertyUseCounted(document, "--x"), + 'Initially custom property --x animation has not been UseCounted'); + assert_false( + internals.isAnimatedCSSPropertyUseCounted(document, "--y"), + 'Initially custom property --y animation has not been UseCounted'); + + target.style.animation = 'customPropertyAnim 1s'; + target.offsetTop; // force recalc + + assert_true( + internals.isAnimatedCSSPropertyUseCounted(document, "--x"), + 'After applying the animation, custom property animation has been counted'); + assert_true( + internals.isAnimatedCSSPropertyUseCounted(document, "--y"), + 'All custom property animations are counted together'); +}, 'Animating custom CSS properties causes UseCounter to be incremented.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/usecounter-tests/function-easing-use-counters-linear.html b/third_party/WebKit/LayoutTests/animations/usecounter-tests/function-easing-use-counters-linear.html new file mode 100644 index 0000000..8e11d59 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/usecounter-tests/function-easing-use-counters-linear.html
@@ -0,0 +1,36 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +'use strict'; +// From UseCounter.h +var WebAnimationsEasingAsFunctionLinear = 1295; +var WebAnimationsEasingAsFunctionOther = 1296; + +test(() => { + document.documentElement.animate([], { }); + document.documentElement.animate([], { easing: 'linear' }); + document.documentElement.animate([], { easing: 'step-start' }); + assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLinear)); + assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOther)); +}, 'Non-function values for easing are not use-counted.'); + +test(() => { + assert_throws( + {name: 'TypeError'}, + function() { document.documentElement.animate([], { easing: 'invalid' }) }); + assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLinear)); + assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOther)); +}, 'Invalid non-function values for easing are not use-counted.'); + +test(() => { + // This linear function value is the one expected from uses of the unpatched + // Web Animations polyfill (i.e. old versions lacking + // https://github.com/web-animations/web-animations-next/pull/423). + assert_throws( + {name: 'TypeError'}, + function() { document.documentElement.animate([], { easing: 'function (a){return a}' }) }); + assert_true(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLinear)); + assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOther)); +}, 'A specific linear function for easing is counted in WebAnimationsEasingAsFunctionLinear.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/usecounter-tests/function-easing-use-counters-other1.html b/third_party/WebKit/LayoutTests/animations/usecounter-tests/function-easing-use-counters-other1.html new file mode 100644 index 0000000..fc932b0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/usecounter-tests/function-easing-use-counters-other1.html
@@ -0,0 +1,17 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +'use strict'; +// From UseCounter.h +var WebAnimationsEasingAsFunctionLinear = 1295; +var WebAnimationsEasingAsFunctionOther = 1296; + +test(() => { + assert_throws( + {name: 'TypeError'}, + function() { document.documentElement.animate([], { easing: 'function (x){return x}' }) }); + assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLinear)); + assert_true(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOther)); +}, 'Any linear function for easing other than "function (a){return a}" is counted in WebAnimationsEasingAsFunctionOther.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/usecounter-tests/function-easing-use-counters-other2.html b/third_party/WebKit/LayoutTests/animations/usecounter-tests/function-easing-use-counters-other2.html new file mode 100644 index 0000000..6972e0a --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/usecounter-tests/function-easing-use-counters-other2.html
@@ -0,0 +1,17 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +'use strict'; +// From UseCounter.h +var WebAnimationsEasingAsFunctionLinear = 1295; +var WebAnimationsEasingAsFunctionOther = 1296; + +test(() => { + assert_throws( + {name: 'TypeError'}, + function() { document.documentElement.animate([], { easing: 'function(x, y){return 0.3}' }) }); + assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLinear)); + assert_true(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOther)); +}, 'Arbitrary functions for easing are counted in WebAnimationsEasingAsFunctionOther.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/step-middle-keyword-timing-function-deprecated-expected.txt b/third_party/WebKit/LayoutTests/animations/usecounter-tests/step-middle-keyword-timing-function-deprecated-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/step-middle-keyword-timing-function-deprecated-expected.txt rename to third_party/WebKit/LayoutTests/animations/usecounter-tests/step-middle-keyword-timing-function-deprecated-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/usecounter-tests/step-middle-keyword-timing-function-deprecated.html b/third_party/WebKit/LayoutTests/animations/usecounter-tests/step-middle-keyword-timing-function-deprecated.html new file mode 100644 index 0000000..e5e266c --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/usecounter-tests/step-middle-keyword-timing-function-deprecated.html
@@ -0,0 +1,24 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +'use strict'; +// From WebFeature.h +var kDeprecatedTimingFunctionStepMiddle = 2024; + +test(() => { + assert_false(internals.isUseCounted(document, kDeprecatedTimingFunctionStepMiddle)); + var element = document.createElement('div'); + element.style.animationTimingFunction = 'step-middle'; + document.documentElement.appendChild(element); + assert_equals(getComputedStyle(element).animationTimingFunction, 'ease'); + assert_false(internals.isUseCounted(document, kDeprecatedTimingFunctionStepMiddle)); +}, 'The step-middle timing function does not function outside of Web Animations.'); + +test(() => { + assert_false(internals.isUseCounted(document, kDeprecatedTimingFunctionStepMiddle)); + document.documentElement.animate([], { easing: 'step-middle' }); + assert_true(internals.isUseCounted(document, kDeprecatedTimingFunctionStepMiddle)); +}, 'The step-middle timing function is deprecated in Web Animations.'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/step-middle-timing-function-deprecated-expected.txt b/third_party/WebKit/LayoutTests/animations/usecounter-tests/step-middle-timing-function-deprecated-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/animations/step-middle-timing-function-deprecated-expected.txt rename to third_party/WebKit/LayoutTests/animations/usecounter-tests/step-middle-timing-function-deprecated-expected.txt
diff --git a/third_party/WebKit/LayoutTests/animations/usecounter-tests/step-middle-timing-function-deprecated.html b/third_party/WebKit/LayoutTests/animations/usecounter-tests/step-middle-timing-function-deprecated.html new file mode 100644 index 0000000..8079d319a --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/usecounter-tests/step-middle-timing-function-deprecated.html
@@ -0,0 +1,24 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +'use strict'; +// From WebFeature.h +var kDeprecatedTimingFunctionStepMiddle = 2024; + +test(() => { + assert_false(internals.isUseCounted(document, kDeprecatedTimingFunctionStepMiddle)); + var element = document.createElement('div'); + element.style.animationTimingFunction = 'steps(3, middle)'; + document.documentElement.appendChild(element); + assert_equals(getComputedStyle(element).animationTimingFunction, 'ease'); + assert_false(internals.isUseCounted(document, kDeprecatedTimingFunctionStepMiddle)); +}, 'The step timing function with step position \'middle\' does not function outside of Web Animations.'); + +test(() => { + assert_false(internals.isUseCounted(document, kDeprecatedTimingFunctionStepMiddle)); + document.documentElement.animate([], { easing: 'steps(3, middle)' }); + assert_true(internals.isUseCounted(document, kDeprecatedTimingFunctionStepMiddle)); +}, 'The step timing function with step position \'middle\' is deprecated in Web Animations.'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/usecounter-tests/use-count-SyntheticKeyframesInCompositedCSSAnimation.html b/third_party/WebKit/LayoutTests/animations/usecounter-tests/use-count-SyntheticKeyframesInCompositedCSSAnimation.html new file mode 100644 index 0000000..5329228e --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/usecounter-tests/use-count-SyntheticKeyframesInCompositedCSSAnimation.html
@@ -0,0 +1,57 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +@keyframes noSyntheticKeyframes { + from { color: black; } + to { color: green; } +} +@keyframes customPropertySyntheticKeyframes { + to { --x: pants; } +} +@keyframes nonCompositedSyntheticKeyframes { + to { color: green; } +} +@keyframes compositedSyntheticKeyframes { + from { + opacity: 0; + } + to { + transform: rotate(45deg); + opacity: 1; + } +} +#target { + animation-duration: 1s; +} +</style> +<div id="target"></div> +<script> +// From UseCounter.h. +var SyntheticKeyframesInCompositedCSSAnimation = 664; + +function forceStyleRecalc() { + getComputedStyle(target).left; +} + +test(() => { + forceStyleRecalc(); + assert_false(internals.isUseCounted(document, SyntheticKeyframesInCompositedCSSAnimation), 'No animations started'); + + target.style.animationName = 'noSyntheticKeyframes'; + forceStyleRecalc(); + assert_false(internals.isUseCounted(document, SyntheticKeyframesInCompositedCSSAnimation), 'noSyntheticKeyframes'); + + target.style.animationName = 'customPropertySyntheticKeyframes'; + forceStyleRecalc(); + assert_false(internals.isUseCounted(document, SyntheticKeyframesInCompositedCSSAnimation), 'customPropertySyntheticKeyframes'); + + target.style.animationName = 'nonCompositedSyntheticKeyframes'; + forceStyleRecalc(); + assert_false(internals.isUseCounted(document, SyntheticKeyframesInCompositedCSSAnimation), 'nonCompositedSyntheticKeyframes'); + + target.style.animationName = 'compositedSyntheticKeyframes'; + forceStyleRecalc(); + assert_true(internals.isUseCounted(document, SyntheticKeyframesInCompositedCSSAnimation), 'compositedSyntheticKeyframes'); +}, 'The SyntheticKeyframesInCompositedCSSAnimation use counter should only be triggered by animations with composited properties with neutral keyframes'); +</script>
diff --git a/third_party/WebKit/LayoutTests/animations/usecounter-tests/use-count-stacked-neutral-keyframe.html b/third_party/WebKit/LayoutTests/animations/usecounter-tests/use-count-stacked-neutral-keyframe.html new file mode 100644 index 0000000..57923af --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/usecounter-tests/use-count-stacked-neutral-keyframe.html
@@ -0,0 +1,31 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +#target { + animation-name: a, b; + animation-duration: 1e10s; +} + +@keyframes a { + from { left: 1px; } + to { left: 1px; } +} + +@keyframes b { + from { left: 1px; } + to { left: 1px; } +} +</style> +<div id="target"></div> +<script> +var CSSAnimationsStackedNeutralKeyframe = 937; // From UseCounter.h +test(function() { + getComputedStyle(target).left; // Force style recalc; + assert_false(internals.isUseCounted(document, CSSAnimationsStackedNeutralKeyframe)); + + document.styleSheets[0].rules[2].deleteRule('from'); + getComputedStyle(target).left; // Force style recalc; + assert_true(internals.isUseCounted(document, CSSAnimationsStackedNeutralKeyframe)); +}); +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/animations/webkit-filter-default-arg-crash.html b/third_party/WebKit/LayoutTests/animations/webkit-filter-default-arg-crash.html deleted file mode 100644 index 27d382d..0000000 --- a/third_party/WebKit/LayoutTests/animations/webkit-filter-default-arg-crash.html +++ /dev/null
@@ -1,59 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<style> -@keyframes anim-blur { - from { -webkit-filter: blur(); } - to { -webkit-filter: blur(1px); } -} -@keyframes anim-brightness { - from { -webkit-filter: brightness(); } - to { -webkit-filter: brightness(1); } -} -@keyframes anim-contrast { - from { -webkit-filter: contrast(); } - to { -webkit-filter: contrast(1); } -} -@keyframes anim-drop-shadow { - from { -webkit-filter: drop-shadow(); } - to { -webkit-filter: drop-shadow(1px 1px); } -} -@keyframes anim-grayscale { - from { -webkit-filter: grayscale(); } - to { -webkit-filter: grayscale(1); } -} -@keyframes anim-hue-rotate { - from { -webkit-filter: hue-rotate(); } - to { -webkit-filter: hue-rotate(1deg); } -} -@keyframes anim-invert { - from { -webkit-filter: invert(); } - to { -webkit-filter: invert(1); } -} -@keyframes anim-opacity { - from { -webkit-filter: opacity(); } - to { -webkit-filter: opacity(1); } -} -@keyframes anim-sepia { - from { -webkit-filter: sepia(); } - to { -webkit-filter: sepia(1); } -} -@keyframes anim-saturate { - from { -webkit-filter: saturate(); } - to { -webkit-filter: saturate(1); } -} -</style> -<div style="animation: anim-blur 1s"></div> -<div style="animation: anim-brightness 1s"></div> -<div style="animation: anim-contrast 1s"></div> -<div style="animation: anim-drop-shadow 1s"></div> -<div style="animation: anim-grayscale 1s"></div> -<div style="animation: anim-hue-rotate 1s"></div> -<div style="animation: anim-invert 1s"></div> -<div style="animation: anim-opacity 1s"></div> -<div style="animation: anim-sepia 1s"></div> -<div style="animation: anim-saturate 1s"></div> -<script> -var asyncHandle = async_test("Don't crash when animating default filter parameters."); -requestAnimationFrame(() => asyncHandle.done()); -</script>
diff --git a/third_party/WebKit/LayoutTests/animations/webkit-origin-dimension-animation-crash.html b/third_party/WebKit/LayoutTests/animations/webkit-origin-dimension-animation-crash.html deleted file mode 100644 index 1e6b53c4..0000000 --- a/third_party/WebKit/LayoutTests/animations/webkit-origin-dimension-animation-crash.html +++ /dev/null
@@ -1,22 +0,0 @@ -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<style> -@keyframes test { - to { - -webkit-perspective-origin-x: 1px; - -webkit-perspective-origin-y: 1px; - -webkit-transform-origin-x: 1px; - -webkit-transform-origin-y: 1px; - -webkit-transform-origin-z: 1px; - } -} -#target { - animation: test 1s; -} -</style> -<div id="target"></div> -<script> -test(function() { - getComputedStyle(target); -}, 'This test passes if it does not crash'); -</script>
diff --git a/third_party/WebKit/LayoutTests/compositing/lots-of-img-layers-expected.txt b/third_party/WebKit/LayoutTests/compositing/lots-of-img-layers-expected.txt index 2db3158..d4394c2 100644 --- a/third_party/WebKit/LayoutTests/compositing/lots-of-img-layers-expected.txt +++ b/third_party/WebKit/LayoutTests/compositing/lots-of-img-layers-expected.txt
@@ -3,7 +3,6 @@ layer at (0,0) size 800x8 LayoutBlockFlow {HTML} at (0,0) size 800x8 LayoutBlockFlow {BODY} at (8,8) size 784x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 214x232 LayoutImage (positioned) {IMG} at (8,8) size 214x232 layer at (8,8) size 214x232
diff --git a/third_party/WebKit/LayoutTests/compositing/lots-of-img-layers-with-opacity-expected.txt b/third_party/WebKit/LayoutTests/compositing/lots-of-img-layers-with-opacity-expected.txt index 751d6c6d..e985a94 100644 --- a/third_party/WebKit/LayoutTests/compositing/lots-of-img-layers-with-opacity-expected.txt +++ b/third_party/WebKit/LayoutTests/compositing/lots-of-img-layers-with-opacity-expected.txt
@@ -3,7 +3,6 @@ layer at (0,0) size 800x8 LayoutBlockFlow {HTML} at (0,0) size 800x8 LayoutBlockFlow {BODY} at (8,8) size 784x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 214x232 transparent LayoutImage (positioned) {IMG} at (8,8) size 214x232 layer at (8,8) size 214x232 transparent
diff --git a/third_party/WebKit/LayoutTests/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt b/third_party/WebKit/LayoutTests/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt index f97dd19..dded8e3 100644 --- a/third_party/WebKit/LayoutTests/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt +++ b/third_party/WebKit/LayoutTests/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE ERROR: line 56: Discontiguous selection is not supported. PASS repainted when expected FAIL did not repaint when expected PASS repainted when expected
diff --git a/third_party/WebKit/LayoutTests/editing/assert_selection.html b/third_party/WebKit/LayoutTests/editing/assert_selection.html index 17a95e1f..1c8d757 100644 --- a/third_party/WebKit/LayoutTests/editing/assert_selection.html +++ b/third_party/WebKit/LayoutTests/editing/assert_selection.html
@@ -345,4 +345,27 @@ assert_equals(internals.textAffinity, 'Upstream'); }, '<div contenteditable style="width: 25px;">foo|bar</div>'); }, 'Textaffinity'); + +test(() => { + assert_exists(window, 'eventSender'); + assert_selection( + [ + '<div id="first">one <span id="start"></span>two three</div>', + '<div id="second">four <span id="end"></span>five six</div>', + ].join(''), + selection => { + const start = selection.document.getElementById('start'); + const end = selection.document.getElementById('end'); + eventSender.mouseMoveTo(selection.computeLeft(start), + selection.computeTop(start)); + eventSender.mouseDown(); + eventSender.mouseMoveTo(selection.computeLeft(end), + selection.computeTop(end)); + eventSender.mouseUp(); + }, + [ + '<div id="first">one <span id="start"></span>^two three</div>', + '<div id="second">four |<span id="end"></span>five six</div>', + ].join('')); +}, 'computeLeft() and computeTop()'); </script>
diff --git a/third_party/WebKit/LayoutTests/editing/assert_selection.js b/third_party/WebKit/LayoutTests/editing/assert_selection.js index a92d65e3..f9551de 100644 --- a/third_party/WebKit/LayoutTests/editing/assert_selection.js +++ b/third_party/WebKit/LayoutTests/editing/assert_selection.js
@@ -60,6 +60,10 @@ FLAT_TREE: 'flattree', }; +// border-size of IFRAME which hosts sample HTML. This value comes from +// "core/css/html.css". +const kIFrameBorderSize = 2; + /** @const @type {string} */ const kTextArea = 'TEXTAREA'; @@ -664,6 +668,28 @@ } /** + * @param {!HTMLElement} element + * @return {number} + */ +function computeLeft(element) { + let left = kIFrameBorderSize + element.ownerDocument.offsetLeft; + for (let runner = element; runner; runner = runner.offsetParent) + left += runner.offsetLeft; + return left; +} + +/** + * @param {!HTMLElement} element + * @return {number} + */ +function computeTop(element) { + let top = kIFrameBorderSize + element.ownerDocument.offsetTop; + for (let runner = element; runner; runner = runner.offsetParent) + top += runner.offsetTop; + return top; +} + +/** * @this {!DOMSelection} * @param {string} html * @param {string=} opt_text @@ -712,6 +738,8 @@ this.selection_.document.offsetLeft = this.iframe_.offsetLeft; this.selection_.document.offsetTop = this.iframe_.offsetTop; this.selection_.setClipboardData = setClipboardData; + this.selection_.computeLeft = computeLeft; + this.selection_.computeTop = computeTop; this.load(sampleText); }
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/outdent-break-with-style-expected.txt b/third_party/WebKit/LayoutTests/editing/execCommand/outdent-break-with-style-expected.txt index c2a89b5..5ee50322 100644 --- a/third_party/WebKit/LayoutTests/editing/execCommand/outdent-break-with-style-expected.txt +++ b/third_party/WebKit/LayoutTests/editing/execCommand/outdent-break-with-style-expected.txt
@@ -6,3 +6,5 @@ | <b> | <#selection-caret> | <br> +| " +"
diff --git a/third_party/WebKit/LayoutTests/editing/selection/3690719.html b/third_party/WebKit/LayoutTests/editing/selection/3690719.html deleted file mode 100644 index 5b58a4be..0000000 --- a/third_party/WebKit/LayoutTests/editing/selection/3690719.html +++ /dev/null
@@ -1,30 +0,0 @@ -<html> -<head> - -<link rel=stylesheet href="../editingStyle.css" type="text/css"> -<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script> - -<script> - -function editingTest() { - selectAllCommand(); -} - -</script> - -<title>Editing Test</title> -</head> -<body bgcolor=#ffffff text=#000000 link=#0000cc vlink=#551a8b alink=#ff0000 topmargin=3 marginheight=3><center><table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td align=right nowrap><font size=-1><a href="/url?sa=p&pref=ig&pval=2&q=http://www.google.com/ig">Personalized Home</a></font></td></tr><tr height=4><td><img alt="" width=1 height=1></td></tr></table><br><br> - -<div contentEditable="true" id="test"> -<table border=0 cellspacing=0 cellpadding=4><tr><td nowrap><font size=-1><b>Web</b> <a id=1a class=q href="/imghp?hl=en&tab=wi" onClick="return qs(this);">Images</a> <a id=2a class=q href="http://groups.google.com/grphp?hl=en&tab=wg" onClick="return qs(this);">Groups</a> <a id=4a class=q href="http://news.google.com/nwshp?hl=en&tab=wn" onClick="return qs(this);">News</a> <a id=5a class=q href="http://froogle.google.com/frghp?hl=en&tab=wf" onClick="return qs(this);">Froogle</a> <a id=7a class=q href="/lochp?hl=en&tab=wl" onClick="return qs(this);">Local<sup><a style="text-decoration:none"><font color=red>New!</font></a></sup></a> <b><a href="/intl/en/options/" class=q>more »</a></b></font></td></tr></table><table cellspacing=0 cellpadding=0><tr><td width=25%> </td><td align=center><input type=hidden name=hl value=en><input maxLength=256 size=55 name=q value=""><br><input type=submit value="Google Search" name=btnG><input type=submit value="I'm Feeling Lucky" name=btnI></td><td valign=top nowrap width=25%><font size=-2> <a href=/advanced_search?hl=en>Advanced Search</a><br> <a href=/preferences?hl=en>Preferences</a><br> <a href=/language_tools?hl=en>Language Tools</a></font></td></tr></table></form><br><font size=-1><font color=#ff0000>New!</font> <a href="http://www.google.com/ig" onmousedown="return asq(event,this,'pro','hppweb:en_us','')">Personalize this page</a>.</font> -</div> - -<br><br><br><font size=-1><a href="/ads/">Advertising Programs</a> - <a href=/services/>Business Solutions</a> - <a href=/intl/en/about.html>About Google</a></font><p><font size=-2>©2005 Google</font></p></center> - -<script> -runEditingTest(); -</script> - -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/editing/selection/extend-byline-withfloat-expected.txt b/third_party/WebKit/LayoutTests/editing/selection/extend-byline-withfloat-expected.txt index 43aae75..e3d7959 100644 --- a/third_party/WebKit/LayoutTests/editing/selection/extend-byline-withfloat-expected.txt +++ b/third_party/WebKit/LayoutTests/editing/selection/extend-byline-withfloat-expected.txt
@@ -2,5 +2,4 @@ between a rock and a hard rock cafe by rahcel (rahcel), 11 hours, 31 minutes ago. -Favorited by -PASSPASS +Favorited byPASSPASS
diff --git a/third_party/WebKit/LayoutTests/editing/selection/focus-crash-expected.txt b/third_party/WebKit/LayoutTests/editing/selection/focus-crash-expected.txt index 70155ba..bd626aa 100644 --- a/third_party/WebKit/LayoutTests/editing/selection/focus-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/editing/selection/focus-crash-expected.txt
@@ -1,2 +1,2 @@ -To run this test manually, click the "Crash me" button. +To run this test manually, click the "Crash me" button. SUCCEEDED
diff --git a/third_party/WebKit/LayoutTests/editing/selection/node-removal-2.html b/third_party/WebKit/LayoutTests/editing/selection/node-removal-2.html index d32ba44b..2fa76b0 100644 --- a/third_party/WebKit/LayoutTests/editing/selection/node-removal-2.html +++ b/third_party/WebKit/LayoutTests/editing/selection/node-removal-2.html
@@ -1,38 +1,16 @@ -<html> -<head> +<!doctype html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script src="../assert_selection.js"></script> <script> -if (window.testRunner) - testRunner.dumpEditingCallbacks(); +test(() => { + assert_selection( + '^foo<span>b|ar</span>baz', + selection => { + const span = selection.document.querySelector('span'); + span.parentNode.removeChild(span); + selection.document.execCommand('selectAll'); + }, + '^foobaz|'); +}, 'selectAll after node remove'); </script> - - -<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script> - -<script> - -function runTest() { - var selection = window.getSelection(); - var e = document.getElementById("test"); - var r = document.getElementById("removeme"); - - selection.setBaseAndExtent(e, 0, r.childNodes[0], 2); - - r.parentNode.removeChild(r); - selectAllCommand(); -} - -</script> - -<title>Removing the endpoints of a selection</title> -</head> -<body> -<p>This tests behavior when a node that serves as the start or end of a selection is removed from the document. Ideally, we would just adjust the selection when an endpoint is removed, for now, we just blow away the selection.</p> -<p>This test creates a selection that ends inside of a node that will be removed. Then the node is removed. Then a Select All is executed. The entire document should be selected.</p> -<div id="test"> -hello <span style="color:red;" id="removeme">removeme</span> world! -</div> - -<script>runTest()</script> - -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/editing/selection/script-tests/shift-click.js b/third_party/WebKit/LayoutTests/editing/selection/script-tests/shift-click.js deleted file mode 100644 index af1ea17..0000000 --- a/third_party/WebKit/LayoutTests/editing/selection/script-tests/shift-click.js +++ /dev/null
@@ -1,91 +0,0 @@ -description("Tests that shift+clicking does the platform correct behavior."); - -var first = document.createElement('div'); -first.innerHTML = 'one <span id="start"></span>two three'; -document.body.appendChild(first); - -var second = document.createElement('div'); -second.innerHTML = 'four <span id="end"></span>five six'; -document.body.appendChild(second); - -var start = document.getElementById('start'); -var end = document.getElementById('end'); - -function shiftClick(x, y, expected) -{ - eventSender.mouseMoveTo(x, y); - eventSender.mouseDown(0, ['shiftKey']); - eventSender.mouseUp(0, ['shiftKey']); - assertSelectionString(expected); -} - -function assertSelectionString(expected) -{ - if (window.getSelection().toString() == expected) - testPassed('window.getSelection().toString() is correct'); - else - testFailed('window.getSelection().toString() is "' + window.getSelection().toString() + '" and should be "' + expected + '"'); -} - -function assertSelectionOrder(direction) -{ - var expectedPosition; - if (direction == 'forward') - expectedPosition = Node.DOCUMENT_POSITION_FOLLOWING; - else if (direction == 'backward') - expectedPosition = Node.DOCUMENT_POSITION_PRECEDING; - - var sel = window.getSelection(); - if (sel.anchorNode.compareDocumentPosition(sel.focusNode) == expectedPosition) - testPassed("Selection direction is correct."); - else - testFailed("Selection direction is not correct. Expected a " + direction + " selection." + selectionAsString(sel)); -} - -function runShiftClickTest(editingBehavior) -{ - internals.settings.setEditingBehavior(editingBehavior); - - // Double-click select to get around eventSender bug where it won't select - // text just using single-click. - eventSender.mouseMoveTo(start.offsetLeft, start.offsetTop); - eventSender.mouseDown(); - eventSender.mouseUp(); - eventSender.mouseDown(); - - eventSender.mouseMoveTo(end.offsetLeft, end.offsetTop); - eventSender.mouseUp(); - - assertSelectionString('two three\nfour five'); - assertSelectionOrder('forward'); - - shiftClick(second.offsetLeft + second.offsetWidth, second.offsetTop, 'two three\nfour five six'); - assertSelectionOrder('forward'); - - shiftClick(end.offsetLeft, end.offsetTop, 'two three\nfour five'); - assertSelectionOrder('forward'); - - // These two fail on Mac due to https://bugs.webkit.org/show_bug.cgi?id=36256. - // In the first shiftClick call, the space after five is selected and shouldn't be. - // In the second shiftClick call, "six" is selected and shouldn't be. - if (editingBehavior == "mac") - shiftClick(first.offsetLeft, first.offsetTop, 'one two three\nfour five'); - else - shiftClick(first.offsetLeft, first.offsetTop, 'one two'); - assertSelectionOrder('backward'); - - if (editingBehavior == "mac") - shiftClick(start.offsetLeft, start.offsetTop, 'two three\nfour five'); - else - shiftClick(start.offsetLeft, start.offsetTop, 'two'); - - // FIXME: The selection direction is incorrect on Win/Linux here. It should be backward. - assertSelectionOrder('backward'); -} - -if (window.eventSender && window.internals) { - runShiftClickTest("mac"); - runShiftClickTest("win"); -} - -var successfullyParsed = true;
diff --git a/third_party/WebKit/LayoutTests/editing/selection/select_all/select_all_in_contenteditable.html b/third_party/WebKit/LayoutTests/editing/selection/select_all/select_all_in_contenteditable.html new file mode 100644 index 0000000..f1f6d5b --- /dev/null +++ b/third_party/WebKit/LayoutTests/editing/selection/select_all/select_all_in_contenteditable.html
@@ -0,0 +1,13 @@ +<!doctype html> +<script src="../../../resources/testharness.js"></script> +<script src="../../../resources/testharnessreport.js"></script> +<script src="../../assert_selection.js"></script> +<div id="log"></div> +<script> +test(() => { + assert_selection( + 'foo<div contenteditablele>|bar</div>baz', + 'selectAll', + '^foo<div contenteditablele>bar</div>baz|'); +}, '"Select All" when in an editable area selects the whole containing document'); +</script>
diff --git a/third_party/WebKit/LayoutTests/editing/selection/selection-button-text.html b/third_party/WebKit/LayoutTests/editing/selection/selection-button-text.html index 31cd264..f2f3339 100644 --- a/third_party/WebKit/LayoutTests/editing/selection/selection-button-text.html +++ b/third_party/WebKit/LayoutTests/editing/selection/selection-button-text.html
@@ -10,8 +10,7 @@ <div> and text <input type="button" value="too much"> too much </div> -Should not be selected in the selection. -</div> +Should not be selected in the selection.</div> </body> <script> document.execCommand("SelectAll");
diff --git a/third_party/WebKit/LayoutTests/editing/selection/shift-click-expected.txt b/third_party/WebKit/LayoutTests/editing/selection/shift-click-expected.txt deleted file mode 100644 index 3aa8fc4..0000000 --- a/third_party/WebKit/LayoutTests/editing/selection/shift-click-expected.txt +++ /dev/null
@@ -1,34 +0,0 @@ -Tests that shift+clicking does the platform correct behavior. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS window.getSelection().toString() is correct -PASS Selection direction is correct. -PASS window.getSelection().toString() is correct -PASS Selection direction is correct. -PASS window.getSelection().toString() is correct -PASS Selection direction is correct. -FAIL window.getSelection().toString() is "one two three -four five " and should be "one two three -four five" -PASS Selection direction is correct. -FAIL window.getSelection().toString() is "two three -four five six" and should be "two three -four five" -PASS Selection direction is correct. -PASS window.getSelection().toString() is correct -PASS Selection direction is correct. -PASS window.getSelection().toString() is correct -PASS Selection direction is correct. -PASS window.getSelection().toString() is correct -PASS Selection direction is correct. -PASS window.getSelection().toString() is correct -PASS Selection direction is correct. -PASS window.getSelection().toString() is correct -FAIL Selection direction is not correct. Expected a backward selection.[anchorNode: [object Text](two three) anchorOffset: 0 focusNode: [object Text](two three) focusOffset: 3 isCollapsed: false] -PASS successfullyParsed is true - -TEST COMPLETE -one two three -four five six
diff --git a/third_party/WebKit/LayoutTests/editing/selection/shift-click.html b/third_party/WebKit/LayoutTests/editing/selection/shift-click.html index aaf8860..fa9ca68 100644 --- a/third_party/WebKit/LayoutTests/editing/selection/shift-click.html +++ b/third_party/WebKit/LayoutTests/editing/selection/shift-click.html
@@ -1,12 +1,143 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../resources/js-test.js"></script> -<script src="resources/js-test-selection-shared.js"></script> -</head> -<body> -<p id="description"></p> -<div id="console"></div> -<script src="script-tests/shift-click.js"></script> -</body> -</html> +<!doctype html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script src="../assert_selection.js"></script> +<script> +// TODO(editing-dev): Once http://crbug.com/736253 fixed, we should use +// |chrome.pointerActionSequence()| instead of |eventSender|. +const kSample = [ + '<div id="first">one <span id="start"></span>two three</div>', + '<div id="second">four <span id="end"></span>five six</div>', +].join(''); + +function doTest(behavior) { + assert_exists(window, 'eventSender', 'This test requires eventSender.'); + assert_exists(window, 'internals', 'This test requires internals.'); + + function doDrag(selection) { + const document = selection.document; + const start = document.getElementById('start'); + const end = document.getElementById('end'); + + // Reset selection granularity + eventSender.leapForward(1000); + eventSender.mouseMoveTo(0, 0); + eventSender.mouseDown(); + eventSender.leapForward(1000); + + // Double-click select to get around eventSender bug where it won't select + // text just using single-click. + eventSender.mouseMoveTo(selection.computeLeft(start), + selection.computeTop(start)); + eventSender.mouseDown(); + eventSender.mouseUp(); + eventSender.mouseDown(); + eventSender.mouseMoveTo(selection.computeLeft(end), + selection.computeTop(end)); + eventSender.mouseUp(); + } + + function doShiftClick(selection, target, offsetX) { + const document = selection.document; + const parent = target.parentNode; + eventSender.mouseMoveTo(selection.computeLeft(target) + offsetX, + selection.computeTop(target)); + eventSender.mouseDown(0, ['shiftKey']); + eventSender.mouseUp(0, ['shiftKey']); + } + + internals.settings.setEditingBehavior(behavior); + + assert_selection( + kSample, + selection => doDrag(selection), + [ + '<div id="first">one <span id="start"></span>^two three</div>', + '<div id="second">four <span id="end"></span>five| six</div>', + ].join(''), + `${behavior}-1: Drag start to end`); + + assert_selection( + kSample, + selection => { + const second = selection.document.getElementById('second'); + doDrag(selection); + doShiftClick(selection, second, second.offsetWidth); + }, + [ + '<div id="first">one <span id="start"></span>^two three</div>', + '<div id="second">four <span id="end"></span>five six|</div>', + ].join(''), + `${behavior}-2: Shift click second`); + + assert_selection( + kSample, + selection => { + const end = selection.document.getElementById('end'); + const second = selection.document.getElementById('second'); + doDrag(selection); + doShiftClick(selection, second, second.offsetWidth); + doShiftClick(selection, end, 0); + }, + [ + '<div id="first">one <span id="start"></span>^two three</div>', + '<div id="second">four <span id="end"></span>five| six</div>', + ].join(''), + `${behavior}-3: Shift click end`); + + // These two fail on Mac due https://bugs.webkit.org/show_bug.cgi?id=36256 + // In the first shiftClick call, the space after five is selected and + // shouldn't be. In the second shiftClick call, "six" is selected and + // shouldn't be. + assert_selection( + kSample, + selection => { + const end = selection.document.getElementById('end'); + const first = selection.document.getElementById('first'); + const second = selection.document.getElementById('second'); + doDrag(selection); + doShiftClick(selection, second, second.offsetWidth); + doShiftClick(selection, end, 0); + doShiftClick(selection, first, 0); + }, + behavior === 'mac' + ? [ + '<div id="first">|one <span id="start"></span>two three</div>', + '<div id="second">four <span id="end"></span>five ^six</div>', + ].join('') + : [ + '<div id="first">|one <span id="start"></span>two^ three</div>', + '<div id="second">four <span id="end"></span>five six</div>', + ].join(''), + `${behavior}-4: Shift click first`); + + assert_selection( + kSample, + selection => { + const end = selection.document.getElementById('end'); + const first = selection.document.getElementById('first'); + const second = selection.document.getElementById('second'); + const start = selection.document.getElementById('start'); + doDrag(selection); + doShiftClick(selection, second, second.offsetWidth); + doShiftClick(selection, end, 0); + doShiftClick(selection, first, 0); + doShiftClick(selection, start, 0); + }, + behavior === 'mac' + ? [ + '<div id="first">one <span id="start"></span>|two three</div>', + '<div id="second">four <span id="end"></span>five six^</div>', + ].join('') + : [ + '<div id="first">one <span id="start"></span>^two| three</div>', + '<div id="second">four <span id="end"></span>five six</div>', + ].join(''), + `${behavior}-5: Shift click start`); +} + +for (const behavior of ['mac', 'win']) { + test(() => doTest(behavior), + `${behavior}: Expand selection with Shift+Click`); +} +</script>
diff --git a/third_party/WebKit/LayoutTests/editing/selection/undo-crash-expected.txt b/third_party/WebKit/LayoutTests/editing/selection/undo-crash-expected.txt index e0d4da83..aff90a1 100644 --- a/third_party/WebKit/LayoutTests/editing/selection/undo-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/editing/selection/undo-crash-expected.txt
@@ -1,2 +1,2 @@ -To run this test manually, type some text in the input field, then click the "Crash me" button. +To run this test manually, type some text in the input field, then click the "Crash me" button. SUCCEEDED
diff --git a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json index 3e8d0ed..093e9f8 100644 --- a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json +++ b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
@@ -4863,6 +4863,78 @@ {} ] ], + "css-fonts/matching/fixed-stretch-style-over-weight.html": [ + [ + "/css-fonts/matching/fixed-stretch-style-over-weight.html", + [ + [ + "/css-fonts/matching/fixed-stretch-style-over-weight-ref.html", + "==" + ] + ], + {} + ] + ], + "css-fonts/matching/stretch-distance-over-weight-distance.html": [ + [ + "/css-fonts/matching/stretch-distance-over-weight-distance.html", + [ + [ + "/css-fonts/matching/stretch-distance-over-weight-distance-ref.html", + "==" + ] + ], + {} + ] + ], + "css-fonts/matching/style-ranges-over-weight-direction.html": [ + [ + "/css-fonts/matching/style-ranges-over-weight-direction.html", + [ + [ + "/css-fonts/matching/style-ranges-over-weight-direction-ref.html", + "==" + ] + ], + {} + ] + ], + "css-fonts/variations/variable-box-font.html": [ + [ + "/css-fonts/variations/variable-box-font.html", + [ + [ + "/css-fonts/variations/variable-box-font-ref.html", + "==" + ] + ], + {} + ] + ], + "css-fonts/variations/variable-gpos-m2b.html": [ + [ + "/css-fonts/variations/variable-gpos-m2b.html", + [ + [ + "/css-fonts/variations/variable-gpos-m2b-ref.html", + "==" + ] + ], + {} + ] + ], + "css-fonts/variations/variable-gsub.html": [ + [ + "/css-fonts/variations/variable-gsub.html", + [ + [ + "/css-fonts/variations/variable-gsub-ref.html", + "==" + ] + ], + {} + ] + ], "css-paint-api/background-image-alpha.html": [ [ "/css-paint-api/background-image-alpha.html", @@ -33287,6 +33359,18 @@ {} ] ], + "css/css-grid-1/placement/grid-placement-using-named-grid-lines-001.html": [ + [ + "/css/css-grid-1/placement/grid-placement-using-named-grid-lines-001.html", + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], "css/css-position-3/position-sticky-bottom.html": [ [ "/css/css-position-3/position-sticky-bottom.html", @@ -57203,78 +57287,6 @@ {} ] ], - "fonts/matching/fixed-stretch-style-over-weight.html": [ - [ - "/fonts/matching/fixed-stretch-style-over-weight.html", - [ - [ - "/fonts/matching/fixed-stretch-style-over-weight-ref.html", - "==" - ] - ], - {} - ] - ], - "fonts/matching/stretch-distance-over-weight-distance.html": [ - [ - "/fonts/matching/stretch-distance-over-weight-distance.html", - [ - [ - "/fonts/matching/stretch-distance-over-weight-distance-ref.html", - "==" - ] - ], - {} - ] - ], - "fonts/matching/style-ranges-over-weight-direction.html": [ - [ - "/fonts/matching/style-ranges-over-weight-direction.html", - [ - [ - "/fonts/matching/style-ranges-over-weight-direction-ref.html", - "==" - ] - ], - {} - ] - ], - "fonts/variations/variable-box-font.html": [ - [ - "/fonts/variations/variable-box-font.html", - [ - [ - "/fonts/variations/variable-box-font-ref.html", - "==" - ] - ], - {} - ] - ], - "fonts/variations/variable-gpos-m2b.html": [ - [ - "/fonts/variations/variable-gpos-m2b.html", - [ - [ - "/fonts/variations/variable-gpos-m2b-ref.html", - "==" - ] - ], - {} - ] - ], - "fonts/variations/variable-gsub.html": [ - [ - "/fonts/variations/variable-gsub.html", - [ - [ - "/fonts/variations/variable-gsub-ref.html", - "==" - ] - ], - {} - ] - ], "html/dom/elements/global-attributes/dir_auto-EN-L.html": [ [ "/html/dom/elements/global-attributes/dir_auto-EN-L.html", @@ -65073,11 +65085,6 @@ {} ] ], - "2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside3-expected.txt": [ - [ - {} - ] - ], "2dcontext/fill-and-stroke-styles/2d.pattern.image.broken-expected.txt": [ [ {} @@ -66003,16 +66010,6 @@ {} ] ], - "XMLHttpRequest/overridemimetype-headers-received-state-force-shiftjis-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/overridemimetype-invalid-mime-type-expected.txt": [ - [ - {} - ] - ], "XMLHttpRequest/resources/accept-language.py": [ [ {} @@ -68523,6 +68520,56 @@ {} ] ], + "css-fonts/matching/README.md": [ + [ + {} + ] + ], + "css-fonts/matching/fixed-stretch-style-over-weight-ref.html": [ + [ + {} + ] + ], + "css-fonts/matching/font-matching.css": [ + [ + {} + ] + ], + "css-fonts/matching/resources/variabletest_matching.ttf": [ + [ + {} + ] + ], + "css-fonts/matching/stretch-distance-over-weight-distance-ref.html": [ + [ + {} + ] + ], + "css-fonts/matching/style-ranges-over-weight-direction-ref.html": [ + [ + {} + ] + ], + "css-fonts/variations/resources/variabletest_box.ttf": [ + [ + {} + ] + ], + "css-fonts/variations/variable-box-font-ref.html": [ + [ + {} + ] + ], + "css-fonts/variations/variable-gpos-m2b-ref.html": [ + [ + {} + ] + ], + "css-fonts/variations/variable-gsub-ref.html": [ + [ + {} + ] + ], "css-paint-api/background-image-alpha-ref.html": [ [ {} @@ -81838,11 +81885,6 @@ {} ] ], - "css/geometry-1/DOMMatrixInit-validate-fixup-expected.txt": [ - [ - {} - ] - ], "css/geometry-1/DOMPoint-001-expected.txt": [ [ {} @@ -86328,52 +86370,7 @@ {} ] ], - "fonts/matching/README.md": [ - [ - {} - ] - ], - "fonts/matching/fixed-stretch-style-over-weight-ref.html": [ - [ - {} - ] - ], - "fonts/matching/font-matching.css": [ - [ - {} - ] - ], - "fonts/matching/resources/variabletest_matching.ttf": [ - [ - {} - ] - ], - "fonts/matching/stretch-distance-over-weight-distance-ref.html": [ - [ - {} - ] - ], - "fonts/matching/style-ranges-over-weight-direction-ref.html": [ - [ - {} - ] - ], - "fonts/variations/resources/variabletest_box.ttf": [ - [ - {} - ] - ], - "fonts/variations/variable-box-font-ref.html": [ - [ - {} - ] - ], - "fonts/variations/variable-gpos-m2b-ref.html": [ - [ - {} - ] - ], - "fonts/variations/variable-gsub-ref.html": [ + "fonts/README.md": [ [ {} ] @@ -95668,6 +95665,11 @@ {} ] ], + "html/semantics/forms/the-label-element/label-attributes-expected.txt": [ + [ + {} + ] + ], "html/semantics/forms/the-label-element/labelable-elements-expected.txt": [ [ {} @@ -95723,6 +95725,11 @@ {} ] ], + "html/semantics/forms/the-textarea-element/value-defaultValue-textContent-expected.txt": [ + [ + {} + ] + ], "html/semantics/forms/the-textarea-element/wrap-reflect-1-ref.html": [ [ {} @@ -98423,6 +98430,11 @@ {} ] ], + "media-source/mediasource-append-buffer-expected.txt": [ + [ + {} + ] + ], "media-source/mediasource-buffered-expected.txt": [ [ {} @@ -99863,11 +99875,6 @@ {} ] ], - "offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.outside3-expected.txt": [ - [ - {} - ] - ], "offscreen-canvas/filter/offscreencanvas.filter.js": [ [ {} @@ -105923,11 +105930,6 @@ {} ] ], - "web-animations/interfaces/DocumentTimeline/constructor-expected.txt": [ - [ - {} - ] - ], "web-animations/interfaces/KeyframeEffect/composite-expected.txt": [ [ {} @@ -120614,6 +120616,12 @@ {} ] ], + "css-cascade/inherit-initial.html": [ + [ + "/css-cascade/inherit-initial.html", + {} + ] + ], "css-font-loading/fontfacesetloadevent-constructor.html": [ [ "/css-font-loading/fontfacesetloadevent-constructor.html", @@ -123314,6 +123322,12 @@ {} ] ], + "css/css-writing-modes-3/wm-propagation-body-computed-root.html": [ + [ + "/css/css-writing-modes-3/wm-propagation-body-computed-root.html", + {} + ] + ], "css/css-writing-modes-3/writing-mode-parsing-001.html": [ [ "/css/css-writing-modes-3/writing-mode-parsing-001.html", @@ -173461,10 +173475,6 @@ "c69aae7dd6d4d35b8d9cee922d382af6ffe17861", "testharness" ], - "2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside3-expected.txt": [ - "610aa5f508222b319f3cc973b0868ed94acea981", - "support" - ], "2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside3.html": [ "6a208096c02c6b94efaf5903bc9638de6f808597", "testharness" @@ -178134,7 +178144,7 @@ "testharness" ], "XMLHttpRequest/overridemimetype-blob-expected.txt": [ - "27e81c73318b46c97fb6bd12bf001cce656e999f", + "f6a7104f61e4b2f44f21c37ff7bac3a36204fadf", "support" ], "XMLHttpRequest/overridemimetype-blob.html": [ @@ -178145,18 +178155,10 @@ "167f34f8dfc1312a9124c12ee4f8de808fa41680", "testharness" ], - "XMLHttpRequest/overridemimetype-headers-received-state-force-shiftjis-expected.txt": [ - "6a12e118e5af1262edee556c1c4a8ae6e87079e0", - "support" - ], "XMLHttpRequest/overridemimetype-headers-received-state-force-shiftjis.htm": [ "92a00af686310d8b44fb5e4c70cc6fbea28e0a88", "testharness" ], - "XMLHttpRequest/overridemimetype-invalid-mime-type-expected.txt": [ - "76233fc637d694345315e8a2c12a11838f681dc8", - "support" - ], "XMLHttpRequest/overridemimetype-invalid-mime-type.htm": [ "1deea1bfa844816a404b90cf5650382383df5d57", "testharness" @@ -179030,7 +179032,7 @@ "support" ], "accelerometer/idlharness.https.html": [ - "eedb225d9e8a05d528e62cc2d689dbfe36858052", + "ac421649ad01868af57e06d322515b4fa36a2dda", "testharness" ], "accelerometer/support-iframe.html": [ @@ -182221,6 +182223,10 @@ "e9a108beef51c52bbaaf2e53371aec57e69541c0", "testharness" ], + "css-cascade/inherit-initial.html": [ + "67ecb845c4bcdacc8185b0f78d36856f9a408342", + "testharness" + ], "css-font-display/font-display-ref.html": [ "26fcc2758c649ce922397cd1c4aa862bdbf1e6a0", "support" @@ -182237,6 +182243,70 @@ "ad355c3d5220c1b938182241a8e8abe030ace699", "testharness" ], + "css-fonts/matching/README.md": [ + "194fbc4cdaf1ff4a43e1a4e6b7bc7fbc17eec6d8", + "support" + ], + "css-fonts/matching/fixed-stretch-style-over-weight-ref.html": [ + "ad90e9467acd3120ba00239b453199aa95497c5e", + "support" + ], + "css-fonts/matching/fixed-stretch-style-over-weight.html": [ + "9416d454fb13f9cdf3f8335ef2b93875b630fd66", + "reftest" + ], + "css-fonts/matching/font-matching.css": [ + "aa898540134a6971823aba54b36027a436c99fd9", + "support" + ], + "css-fonts/matching/resources/variabletest_matching.ttf": [ + "de5e05decac0303e5297ed2cb067c715ff4c4adf", + "support" + ], + "css-fonts/matching/stretch-distance-over-weight-distance-ref.html": [ + "40ff6866132dd3e29a8d85c5fd949aba729ae304", + "support" + ], + "css-fonts/matching/stretch-distance-over-weight-distance.html": [ + "334199682aa1641d9904d5fb38be61f96c590a8f", + "reftest" + ], + "css-fonts/matching/style-ranges-over-weight-direction-ref.html": [ + "05fe52539dc7bb809fc88ee1fee597288d843bf1", + "support" + ], + "css-fonts/matching/style-ranges-over-weight-direction.html": [ + "7c9fdc01ea1591a5926942f5c577ff8fbd36b260", + "reftest" + ], + "css-fonts/variations/resources/variabletest_box.ttf": [ + "2fc122ff444d3ddef1f29ebde9a87827244ceeb0", + "support" + ], + "css-fonts/variations/variable-box-font-ref.html": [ + "65ccabcdeaa322eeceaa646863eba52654e3149b", + "support" + ], + "css-fonts/variations/variable-box-font.html": [ + "f3836fd9ea898b84bcef5dc259eeadbd4ecaeb68", + "reftest" + ], + "css-fonts/variations/variable-gpos-m2b-ref.html": [ + "769b04d218db5f7d882512b17c70683281499481", + "support" + ], + "css-fonts/variations/variable-gpos-m2b.html": [ + "af751a58338e49cc18b0b54c9451662d223f4977", + "reftest" + ], + "css-fonts/variations/variable-gsub-ref.html": [ + "1b80955335d4a14f3e0d545a6b5165aadff05a87", + "support" + ], + "css-fonts/variations/variable-gsub.html": [ + "2ae8392efc584c909f11ca04fb33a77f1b3c65ba", + "reftest" + ], "css-paint-api/background-image-alpha-ref.html": [ "45ef6e998e5f266741f5403df650cd9557dbe005", "support" @@ -199933,6 +200003,10 @@ "eced3add6efb636f7d33e8a66048da2179c8a152", "reftest" ], + "css/css-grid-1/placement/grid-placement-using-named-grid-lines-001.html": [ + "8015ca1523215344ba88559f5efd3407e1b22de2", + "reftest" + ], "css/css-grid-1/reference/display-grid-ref.html": [ "6819ecfa15b9553b99dadf71aaa1959c1a22d6d4", "support" @@ -214549,6 +214623,10 @@ "cd58814cd747579216fc3d038849b2ecfaa22e39", "reftest" ], + "css/css-writing-modes-3/wm-propagation-body-computed-root.html": [ + "a212bca7bfbf52fb0358d0ea6567fa8e3df643a9", + "testharness" + ], "css/css-writing-modes-3/writing-mode-horizontal-001l.html": [ "b8266a3ac8d55bcf9ee7ddddc31cdedb07717da1", "reftest" @@ -214913,10 +214991,6 @@ "fbcaa50f5daab1a11325cbbd46e10c524a1f6f80", "testharness" ], - "css/geometry-1/DOMMatrixInit-validate-fixup-expected.txt": [ - "688cedbc6dda3f162a6fff2785a5b5432a3dfe5c", - "support" - ], "css/geometry-1/DOMMatrixInit-validate-fixup.html": [ "201d59db6923ae141d980ac40ddce08375bd1900", "testharness" @@ -218542,7 +218616,7 @@ "testharness" ], "custom-elements/reactions/ChildNode.html": [ - "abd91594d98ab546b9901c70fb9797532b269f5e", + "7c0f92f4447c3abb74cddc7a111d7a0c5993b166", "testharness" ], "custom-elements/reactions/DOMStringMap.html": [ @@ -220898,7 +220972,7 @@ "testharness" ], "encoding/iso-2022-jp-decoder-expected.txt": [ - "2d8f16746443603cfeb096e50a43d0720edb69ca", + "0b5cf594d9b2a56a4f613c9a02cb683302360713", "support" ], "encoding/iso-2022-jp-decoder.html": [ @@ -222722,7 +222796,7 @@ "testharness" ], "fetch/api/basic/block-mime-as-script.html": [ - "1dd503f1537b09f7aa875ea9a636d587b03601e3", + "63ec2123a1f652ddd34d63bed20494068222c98d", "testharness" ], "fetch/api/basic/conditional-get.html": [ @@ -223422,7 +223496,7 @@ "support" ], "fetch/api/resources/script-with-header.py": [ - "0c988e869e2e7af06bef67a2eba8211554b38323", + "07a90ffa656f67c9774d8080f80456e81750dc0c", "support" ], "fetch/api/resources/status.py": [ @@ -223705,70 +223779,10 @@ "10a7017b4caead6817aa08b25f14950e6402dd95", "support" ], - "fonts/matching/README.md": [ - "194fbc4cdaf1ff4a43e1a4e6b7bc7fbc17eec6d8", + "fonts/README.md": [ + "eb192c5fe03811a1b69578c92bf77d8abab89f29", "support" ], - "fonts/matching/fixed-stretch-style-over-weight-ref.html": [ - "ad90e9467acd3120ba00239b453199aa95497c5e", - "support" - ], - "fonts/matching/fixed-stretch-style-over-weight.html": [ - "9416d454fb13f9cdf3f8335ef2b93875b630fd66", - "reftest" - ], - "fonts/matching/font-matching.css": [ - "aa898540134a6971823aba54b36027a436c99fd9", - "support" - ], - "fonts/matching/resources/variabletest_matching.ttf": [ - "de5e05decac0303e5297ed2cb067c715ff4c4adf", - "support" - ], - "fonts/matching/stretch-distance-over-weight-distance-ref.html": [ - "40ff6866132dd3e29a8d85c5fd949aba729ae304", - "support" - ], - "fonts/matching/stretch-distance-over-weight-distance.html": [ - "334199682aa1641d9904d5fb38be61f96c590a8f", - "reftest" - ], - "fonts/matching/style-ranges-over-weight-direction-ref.html": [ - "05fe52539dc7bb809fc88ee1fee597288d843bf1", - "support" - ], - "fonts/matching/style-ranges-over-weight-direction.html": [ - "7c9fdc01ea1591a5926942f5c577ff8fbd36b260", - "reftest" - ], - "fonts/variations/resources/variabletest_box.ttf": [ - "2fc122ff444d3ddef1f29ebde9a87827244ceeb0", - "support" - ], - "fonts/variations/variable-box-font-ref.html": [ - "65ccabcdeaa322eeceaa646863eba52654e3149b", - "support" - ], - "fonts/variations/variable-box-font.html": [ - "f3836fd9ea898b84bcef5dc259eeadbd4ecaeb68", - "reftest" - ], - "fonts/variations/variable-gpos-m2b-ref.html": [ - "769b04d218db5f7d882512b17c70683281499481", - "support" - ], - "fonts/variations/variable-gpos-m2b.html": [ - "af751a58338e49cc18b0b54c9451662d223f4977", - "reftest" - ], - "fonts/variations/variable-gsub-ref.html": [ - "1b80955335d4a14f3e0d545a6b5165aadff05a87", - "support" - ], - "fonts/variations/variable-gsub.html": [ - "2ae8392efc584c909f11ca04fb33a77f1b3c65ba", - "reftest" - ], "fullscreen/api/document-exit-fullscreen-active-document-expected.txt": [ "0fe00e0f1b873cef51a3c142190ce821a76549ed", "support" @@ -223982,7 +223996,7 @@ "testharness" ], "generic-sensor/generic-sensor-tests.js": [ - "7b36a69dd7d9148f70a1d40d4108dcd747cb2913", + "b7b1b322951b0d2f5a00a60feca93da8746dceb3", "support" ], "generic-sensor/idlharness-expected.txt": [ @@ -223990,7 +224004,7 @@ "support" ], "generic-sensor/idlharness.html": [ - "0e3f29a3a065a3db2f6e0e77d9c6bbdf47bf5ca8", + "f968f5a81d25796f79cd22987810ec6832fa120d", "testharness" ], "geolocation-API/PositionOptions.https.html": [ @@ -224074,7 +224088,7 @@ "support" ], "gyroscope/idlharness.https.html": [ - "567b200f0ea88894bbffbffb6d20ea546f516e7d", + "69699b3b533c8fd4047a3b5e80f95f8cdc82d24d", "testharness" ], "gyroscope/support-iframe.html": [ @@ -228518,7 +228532,7 @@ "support" ], "html/dom/interfaces-expected.txt": [ - "69c9f72c602a581ea237b6e3a69ad1e0d6da1e36", + "f3a223067481ba42ffbbf26aa314da421b787ab5", "support" ], "html/dom/interfaces.html": [ @@ -228558,7 +228572,7 @@ "testharness" ], "html/dom/reflection-metadata-expected.txt": [ - "d129314a83384c1c536321480fac3b5de3ed1fb3", + "d6e20d78c55d3c0fdf2bd8e4b92cb2583aa3aab7", "support" ], "html/dom/reflection-metadata.html": [ @@ -235813,6 +235827,10 @@ "3629d93c34f27a575114b15256803941c9893f6e", "support" ], + "html/semantics/forms/the-label-element/label-attributes-expected.txt": [ + "9e89204ec2f306cad312af21568787a111048593", + "support" + ], "html/semantics/forms/the-label-element/label-attributes.html": [ "612957c0c5b28b8797118eb5975bb41bc240d257", "testharness" @@ -236001,6 +236019,10 @@ "81a270bc3c9304f8b2e7dd526519f4eab7d94f45", "testharness" ], + "html/semantics/forms/the-textarea-element/value-defaultValue-textContent-expected.txt": [ + "4b67f78e43f749b7e9ad5bff993a68909c3ae28f", + "support" + ], "html/semantics/forms/the-textarea-element/value-defaultValue-textContent-xhtml.xhtml": [ "03ce5d00e9887037bbd96f2d49e116c6b3329802", "testharness" @@ -236710,7 +236732,7 @@ "support" ], "html/semantics/scripting-1/the-script-element/module/error-and-slow-dependency.html": [ - "3c45e09c2192615bc44da576403a5ba065eb1ebf", + "32455a1418d94fa68368bae3b1c0291204f6b4e3", "testharness" ], "html/semantics/scripting-1/the-script-element/module/errorhandling-parseerror-common.js": [ @@ -236726,7 +236748,7 @@ "support" ], "html/semantics/scripting-1/the-script-element/module/errorhandling-parseerror-dependentmultiple.html": [ - "956e41c3916bdf33307cd8c6e76fd48079433807", + "06f50ed88c9b682cea7bc511adc92dff6cd7d1dc", "support" ], "html/semantics/scripting-1/the-script-element/module/errorhandling-parseerror-dependentmultiple.js": [ @@ -240198,7 +240220,7 @@ "support" ], "magnetometer/idlharness.https.html": [ - "b21217da9dc986e605d172d72a5f4f3e7b2aa216", + "caa1de6ebcd32508ea4e61a7412f6c165699cc58", "testharness" ], "magnetometer/support-iframe.html": [ @@ -240305,6 +240327,10 @@ "c65d474f5279b3238dccf50415b5995b9d6b80ca", "testharness" ], + "media-source/mediasource-append-buffer-expected.txt": [ + "526c827aa5e5d8985048836ba785db4e7e2cf499", + "support" + ], "media-source/mediasource-append-buffer.html": [ "fed1254d64c59b625af9745bbffcf5788ac5906e", "testharness" @@ -245697,10 +245723,6 @@ "236e23b359363eb0d1293ec2bdd43bbf66d23bd7", "testharness" ], - "offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.outside3-expected.txt": [ - "a3748f9427b53c807ea01e7cc83e20d83aa66485", - "support" - ], "offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.outside3.html": [ "0e1150a5f96be06472d5512931c67d99064094c6", "testharness" @@ -249186,7 +249208,7 @@ "support" ], "orientation-sensor/idlharness.https.html": [ - "049b5e9505165723cec70237e2ae5f0e2c7948f0", + "71100177bcb537c18f98edfd7bf04d420714a78b", "testharness" ], "page-visibility/idlharness-expected.txt": [ @@ -262414,7 +262436,7 @@ "testharness" ], "url/setters_tests.json": [ - "6e388e46caf1a0259a6dc6778e7b33619e389751", + "4b01281c0f8811cf57f261f9328d7916c52f3619", "support" ], "url/toascii.json": [ @@ -262997,10 +263019,6 @@ "bd39d7f28dd03ba22a32ce09226dc263180254eb", "testharness" ], - "web-animations/interfaces/DocumentTimeline/constructor-expected.txt": [ - "093755f220fdabce1edfadbabdba86bedb9e173b", - "support" - ], "web-animations/interfaces/DocumentTimeline/constructor.html": [ "3a626b145f4eb77e816b9020f6fc67630088a00b", "testharness" @@ -263038,7 +263056,7 @@ "testharness" ], "web-animations/interfaces/KeyframeEffect/iterationComposite-expected.txt": [ - "9d41436009325e656c4ee4cc83de7df45070a8e3", + "1a5a2e42f7cd123bc37e09f5463fc908d333d13a", "support" ], "web-animations/interfaces/KeyframeEffect/iterationComposite.html": [ @@ -263046,7 +263064,7 @@ "testharness" ], "web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-expected.txt": [ - "ec538ee9201ee99bd1d4b4b954b84449a5395d6b", + "30cabebc85771a9822dd8c55018ac2c6dce05049", "support" ], "web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument.html": [ @@ -263062,7 +263080,7 @@ "testharness" ], "web-animations/interfaces/KeyframeEffect/setTarget-expected.txt": [ - "688e432c8eaa727144ce8263918c358653e28f25", + "91c873ec0a32dddd793b479d2e0e91e59cf39ef2", "support" ], "web-animations/interfaces/KeyframeEffect/setTarget.html": [
diff --git a/third_party/WebKit/LayoutTests/external/wpt/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside3-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside3-expected.txt deleted file mode 100644 index 74b9f42..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside3-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -FAIL Canvas test: 2d.gradient.radial.outside3 assert_equals: Red channel of the pixel at (1, 1) expected 0 but got 255 -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/accelerometer/idlharness.https.html b/third_party/WebKit/LayoutTests/external/wpt/accelerometer/idlharness.https.html index 66e228c..6c9c9bb 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/accelerometer/idlharness.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/accelerometer/idlharness.https.html
@@ -39,7 +39,7 @@ readonly attribute DOMHighResTimeStamp? timestamp; void start(); void stop(); - attribute EventHandler onchange; + attribute EventHandler onreading; attribute EventHandler onactivate; attribute EventHandler onerror; };
diff --git a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/checkReport.sub.js b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/checkReport.sub.js index b56106f7..803dc06 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/checkReport.sub.js +++ b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/checkReport.sub.js
@@ -13,16 +13,9 @@ var reportValue = "{{GET[reportValue]}}"; var reportExists = "{{GET[reportExists]}}"; var noCookies = "{{GET[noCookies]}}"; - var reportCookieName = "{{GET[reportCookieName]}}" - var testName = "{{GET[testName]}}" - var cookiePresent = "{{GET[cookiePresent]}}" - var reportCount = "{{GET[reportCount]}}" var location = window.location; - if (reportCookieName == "") { - // fallback on test file name if cookie name not specified - reportCookieName = location.pathname.split('/')[location.pathname.split('/').length - 1].split('.')[0]; - } + var thisTestName = location.pathname.split('/')[location.pathname.split('/').length - 1].split('.')[0]; var reportID = ""; @@ -31,7 +24,7 @@ var cookieName = cookies[i].split('=')[0].trim(); var cookieValue = cookies[i].split('=')[1].trim(); - if (cookieName == reportCookieName) { + if (cookieName == thisTestName) { reportID = cookieValue; var cookieToDelete = cookieName + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=" + document.location.pathname.substring(0, document.location.pathname.lastIndexOf('/') + 1); document.cookie = cookieToDelete; @@ -40,10 +33,9 @@ } var timeout = document.querySelector("meta[name=timeout][content=long]") ? 50 : 5; - var reportLocation = location.protocol + "//" + location.host + "/content-security-policy/support/report.py?op=retrieve_report&timeout=" + timeout + "&reportID=" + reportID; + var reportLocation = location.protocol + "//" + location.host + "/content-security-policy/support/report.py?op=take&timeout=" + timeout + "&reportID=" + reportID; - if (testName == "") testName = "Violation report status OK."; - var reportTest = async_test(testName); + var reportTest = async_test("Violation report status OK."); reportTest.step(function () { var report = new XMLHttpRequest(); @@ -76,38 +68,17 @@ report.send(); }); - if (noCookies || cookiePresent) { - var cookieTest = async_test("Test report cookies."); + if (noCookies) { + var cookieTest = async_test("No cookies sent with report."); var cookieReport = new XMLHttpRequest(); cookieReport.onload = cookieTest.step_func(function () { - var data = JSON.parse(cookieReport.responseText); - if (noCookies) { - assert_equals(data.reportCookies, "None", "Report should not contain any cookies"); - } - - if (cookiePresent) { - assert_true(data.reportCookies.hasOwnProperty(cookiePresent), "Report should contain cookie: " + cookiePresent); - } - cookieTest.done(); + var data = JSON.parse(cookieReport.responseText); + assert_equals(data.reportCookies, "None"); + cookieTest.done(); }); - var cReportLocation = location.protocol + "//" + location.host + "/content-security-policy/support/report.py?op=retrieve_cookies&timeout=" + timeout + "&reportID=" + reportID; + var cReportLocation = location.protocol + "//" + location.host + "/content-security-policy/support/report.py?op=cookies&timeout=" + timeout + "&reportID=" + reportID; cookieReport.open("GET", cReportLocation, true); cookieReport.send(); - } - - if (reportCount != "") { - var reportCountTest = async_test("Test number of sent reports."); - var reportCountReport = new XMLHttpRequest(); - reportCountReport.onload = reportCountTest.step_func(function () { - var data = JSON.parse(reportCountReport.responseText); - - assert_equals(data.report_count, reportCount, "Report count was not what was expected."); - - reportCountTest.done(); - }); - var cReportLocation = location.protocol + "//" + location.host + "/content-security-policy/support/report.py?op=retrieve_count&timeout=" + timeout + "&reportID=" + reportID; - reportCountReport.open("GET", cReportLocation, true); - reportCountReport.send(); - } + }; })();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/passs.png b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/passs.png deleted file mode 100644 index 2fa1e0a..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/passs.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/report.py b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/report.py index 9f48ca2..193315fa 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/report.py +++ b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/report.py
@@ -2,58 +2,33 @@ import json import re -def retrieve_from_stash(request, key, timeout, default_value): - t0 = time.time() - while time.time() - t0 < timeout: - time.sleep(0.5) - value = request.server.stash.take(key=key) - if value is not None: - return value - - return default_value - def main(request, response): - op = request.GET.first("op"); - key = request.GET.first("reportID") - cookie_key = re.sub('^....', 'cccc', key) - count_key = re.sub('^....', 'dddd', key) + op = request.GET.first("op"); + key = request.GET.first("reportID") - try: - timeout = request.GET.first("timeout") - except: - timeout = 0.5 - timeout = float(timeout) + if op == "take": + timeout = float(request.GET.first("timeout")) + t0 = time.time() + while time.time() - t0 < timeout: + time.sleep(0.5) + value = request.server.stash.take(key=key) + if value is not None: + return [("Content-Type", "application/json")], value - if op == "retrieve_report": - return [("Content-Type", "application/json")], retrieve_from_stash(request, key, timeout, json.dumps({'error': 'No such report.' , 'guid' : key})) + return [("Content-Type", "application/json")], json.dumps({'error': 'No such report.' , 'guid' : key}) - if op == "retrieve_cookies": - return [("Content-Type", "application/json")], "{ \"reportCookies\" : " + str(retrieve_from_stash(request, cookie_key, timeout, "\"None\"")) + "}" + if op == "cookies": + cval = request.server.stash.take(key=re.sub('^...', 'ccc', key)) + if cval is None: + cval = "\"None\"" - if op == "retrieve_count": - return [("Content-Type", "application/json")], json.dumps({'report_count': str(retrieve_from_stash(request, count_key, timeout, 0))}) + return [("Content-Type", "application/json")], "{ \"reportCookies\" : " + cval + "}" - # save cookies - if hasattr(request, 'cookies') and len(request.cookies.keys()) > 0: - # convert everything into strings and dump it into a dict so it can be jsoned - temp_cookies_dict = {} - for dict_key in request.cookies.keys(): - temp_cookies_dict[str(dict_key)] = str(request.cookies.get_list(dict_key)) - request.server.stash.take(key=cookie_key) - request.server.stash.put(key=cookie_key, value=json.dumps(temp_cookies_dict)) + if hasattr(request, 'Cookies'): + request.server.stash.put(key=re.sub('^...', 'ccc', key), value=request.Cookies) - # save latest report - report = request.body - report.rstrip() - request.server.stash.take(key=key) - request.server.stash.put(key=key, value=report) - - # increment report count - count = request.server.stash.take(key=count_key) - if count is None: - count = 0 - count += 1 - request.server.stash.put(key=count_key, value=count) - - # return acknowledgement report - return [("Content-Type", "text/plain")], "Recorded report " + report + report = request.body + report.rstrip() + request.server.stash.take(key=key) + request.server.stash.put(key=key, value=report) + return [("Content-Type", "text/plain")], "Recorded report " + report
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/matching/README.md b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/README.md similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/fonts/matching/README.md rename to third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/README.md
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/matching/fixed-stretch-style-over-weight-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/fixed-stretch-style-over-weight-ref.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/fonts/matching/fixed-stretch-style-over-weight-ref.html rename to third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/fixed-stretch-style-over-weight-ref.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/matching/fixed-stretch-style-over-weight.html b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/fixed-stretch-style-over-weight.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/fonts/matching/fixed-stretch-style-over-weight.html rename to third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/fixed-stretch-style-over-weight.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/matching/font-matching.css b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/font-matching.css similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/fonts/matching/font-matching.css rename to third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/font-matching.css
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/matching/resources/variabletest_matching.ttf b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/resources/variabletest_matching.ttf similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/fonts/matching/resources/variabletest_matching.ttf rename to third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/resources/variabletest_matching.ttf Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/matching/stretch-distance-over-weight-distance-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/stretch-distance-over-weight-distance-ref.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/fonts/matching/stretch-distance-over-weight-distance-ref.html rename to third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/stretch-distance-over-weight-distance-ref.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/matching/stretch-distance-over-weight-distance.html b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/stretch-distance-over-weight-distance.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/fonts/matching/stretch-distance-over-weight-distance.html rename to third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/stretch-distance-over-weight-distance.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/matching/style-ranges-over-weight-direction-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/style-ranges-over-weight-direction-ref.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/fonts/matching/style-ranges-over-weight-direction-ref.html rename to third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/style-ranges-over-weight-direction-ref.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/matching/style-ranges-over-weight-direction.html b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/style-ranges-over-weight-direction.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/fonts/matching/style-ranges-over-weight-direction.html rename to third_party/WebKit/LayoutTests/external/wpt/css-fonts/matching/style-ranges-over-weight-direction.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/variations/resources/variabletest_box.ttf b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/variations/resources/variabletest_box.ttf similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/fonts/variations/resources/variabletest_box.ttf rename to third_party/WebKit/LayoutTests/external/wpt/css-fonts/variations/resources/variabletest_box.ttf Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/variations/variable-box-font-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/variations/variable-box-font-ref.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/fonts/variations/variable-box-font-ref.html rename to third_party/WebKit/LayoutTests/external/wpt/css-fonts/variations/variable-box-font-ref.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/variations/variable-box-font.html b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/variations/variable-box-font.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/fonts/variations/variable-box-font.html rename to third_party/WebKit/LayoutTests/external/wpt/css-fonts/variations/variable-box-font.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/variations/variable-gpos-m2b-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/variations/variable-gpos-m2b-ref.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/fonts/variations/variable-gpos-m2b-ref.html rename to third_party/WebKit/LayoutTests/external/wpt/css-fonts/variations/variable-gpos-m2b-ref.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/variations/variable-gpos-m2b.html b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/variations/variable-gpos-m2b.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/fonts/variations/variable-gpos-m2b.html rename to third_party/WebKit/LayoutTests/external/wpt/css-fonts/variations/variable-gpos-m2b.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/variations/variable-gsub-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/variations/variable-gsub-ref.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/fonts/variations/variable-gsub-ref.html rename to third_party/WebKit/LayoutTests/external/wpt/css-fonts/variations/variable-gsub-ref.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/variations/variable-gsub.html b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/variations/variable-gsub.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/fonts/variations/variable-gsub.html rename to third_party/WebKit/LayoutTests/external/wpt/css-fonts/variations/variable-gsub.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/placement/grid-placement-using-named-grid-lines-001.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/placement/grid-placement-using-named-grid-lines-001.html new file mode 100644 index 0000000..12fdd78 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/placement/grid-placement-using-named-grid-lines-001.html
@@ -0,0 +1,28 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Grid item placement mixing named grid areas and lines</title> +<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com"> +<link rel="help" href="http://www.w3.org/TR/css-grid-1/#line-placement"> +<link rel="help" href="http://www.w3.org/TR/css-grid-1/#grid-placement-slot"> +<link rel="help" href="http://www.w3.org/TR/css-grid-1/#named-grid-area"> +<link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> +<meta name="assert" content="Line placement algorithm selects the first matching column when using a grid line name associated to several columns and no integer is specified within the custom-ident."> +<style> +.grid { + display: inline-grid; + background: red; + grid-template-columns: [C] 25px [C] 25px [C] 25px [C] 25px; + grid-auto-rows: 50px; + grid-template-areas: "A1 A2 A3 A4" + ". A2 A3 A4"; +} +.grid > div { background: green; } +</style> +<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> +<div class="grid"> + <div style="grid-area: A1"></div> + <div style="grid-area: A2"></div> + <div style="grid-area: A3"></div> + <div style="grid-area: A4"></div> + <div style="grid-column: C; grid-row: 2;"></div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes-3/wm-propagation-body-computed-root.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes-3/wm-propagation-body-computed-root.html new file mode 100644 index 0000000..7741ac705 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes-3/wm-propagation-body-computed-root.html
@@ -0,0 +1,26 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<title>CSS Writing Modes Test: Computed writing-mode for html element when writing mode for body propagated to viewport</title> +<link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com"> +<link rel="help" href="https://www.w3.org/TR/css-writing-modes-3/#principal-flow"> +<meta name="assert" content="Test that propagating writing-mode from body to viewport does not affect the computed writing-mode of the html element"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<style> + .vertical-lr { writing-mode: vertical-lr } +</style> +<body class="vertical-lr"> +<script> + test(function() { + assert_equals(getComputedStyle(document.body).writingMode, "vertical-lr"); + }, "Check computed writing-mode for body element."); + + test(function() { + assert_not_equals(getComputedStyle(document.documentElement).writingMode, "vertical-lr"); + }, "Check computed writing-mode for html root element."); + + test(function() { + document.body.className = ""; + assert_not_equals(getComputedStyle(document.body).writingMode, "vertical-lr"); + }, "Check computed writing-mode for body element when style no longer applies."); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/geometry-1/DOMMatrixInit-validate-fixup-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/geometry-1/DOMMatrixInit-validate-fixup-expected.txt deleted file mode 100644 index f7be317..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/geometry-1/DOMMatrixInit-validate-fixup-expected.txt +++ /dev/null
@@ -1,95 +0,0 @@ -This is a testharness.js-based test. -Found 91 tests; 89 PASS, 2 FAIL, 0 TIMEOUT, 0 NOTRUN. -PASS {a: 1, m11: 2} (invalid) -PASS {b: 0, m12: -1} (invalid) -PASS {c: Infinity, m21: -Infinity} (invalid) -PASS {d: 0, m22: NaN} (invalid) -PASS {e: 1, m41: 1.00000001} (invalid) -PASS {f: 0, m42: 5e-324} (invalid) -PASS {m13: 1, is2D: true} (invalid) -PASS {m14: 1, is2D: true} (invalid) -PASS {m23: 1, is2D: true} (invalid) -PASS {m24: 1, is2D: true} (invalid) -PASS {m31: 1, is2D: true} (invalid) -PASS {m32: 1, is2D: true} (invalid) -PASS {m33: 0, is2D: true} (invalid) -PASS {m33: -0, is2D: true} (invalid) -PASS {m33: -1, is2D: true} (invalid) -PASS {m34: 1, is2D: true} (invalid) -PASS {m43: 1, is2D: true} (invalid) -PASS {m44: 0, is2D: true} (invalid) -PASS {} (2d) -PASS {is2D: undefined} (2d) -PASS {a: 1, m11: 1} (2d) -PASS {b: 0, m12: undefined} (2d) -PASS {c: 0, m21: 0} (2d) -PASS {c: 0, m21: -0} (2d) -PASS {c: -0, m21: 0} (2d) -PASS {c: -0, m21: -0} (2d) -PASS {d: Infinity, m22: Infinity} (2d) -PASS {e: -Infinity, m41: -Infinity} (2d) -FAIL {f: NaN, m42: NaN} (2d) Failed to execute 'fromMatrix' on 'DOMMatrix': The 'f' property should equal the 'm42' property. -FAIL {f: NaN, m42: NaN, is2D: true} (2d) Failed to execute 'fromMatrix' on 'DOMMatrix': The 'f' property should equal the 'm42' property. -PASS {f: 0, m42: null} (2d) -PASS {f: -0, m42: null} (2d) -PASS {a: 2} (2d) -PASS {b: 2} (2d) -PASS {c: 2} (2d) -PASS {d: 2} (2d) -PASS {e: 2} (2d) -PASS {f: 2} (2d) -PASS {a: -0, b: -0, c: -0, d: -0, e: -0, f: -0} (2d) -PASS {a: -0, b: -0, c: -0, d: -0, e: -0, f: -0, is2D: true} (2d) -PASS {m11: 2} (2d) -PASS {m12: 2} (2d) -PASS {m21: 2} (2d) -PASS {m22: 2} (2d) -PASS {m41: 2} (2d) -PASS {m42: 2} (2d) -PASS {m11: -0, m12: -0, m21: -0, m22: -0, m41: -0, m42: -0} (2d) -PASS {m11: -0, m12: -0, m21: -0, m22: -0, m41: -0, m42: -0, is2D: true} (2d) -PASS {m13: 0, is2D: true} (2d) -PASS {m13: -0, is2D: true} (2d) -PASS {m14: 0, is2D: true} (2d) -PASS {m14: -0, is2D: true} (2d) -PASS {m23: 0, is2D: true} (2d) -PASS {m23: -0, is2D: true} (2d) -PASS {m24: 0, is2D: true} (2d) -PASS {m24: -0, is2D: true} (2d) -PASS {m31: 0, is2D: true} (2d) -PASS {m31: -0, is2D: true} (2d) -PASS {m32: 0, is2D: true} (2d) -PASS {m32: -0, is2D: true} (2d) -PASS {m33: 1, is2D: true} (2d) -PASS {m34: 0, is2D: true} (2d) -PASS {m34: -0, is2D: true} (2d) -PASS {m43: 0, is2D: true} (2d) -PASS {m43: -0, is2D: true} (2d) -PASS {m44: 1, is2D: true} (2d) -PASS {is2D: true} (2d) -PASS {m13: 1, is2D: false} (3d) -PASS {m14: 1, is2D: false} (3d) -PASS {m23: 1, is2D: false} (3d) -PASS {m24: 1, is2D: false} (3d) -PASS {m31: 1, is2D: false} (3d) -PASS {m32: 1, is2D: false} (3d) -PASS {m33: 0, is2D: false} (3d) -PASS {m33: -0, is2D: false} (3d) -PASS {m33: -1, is2D: false} (3d) -PASS {m34: 1, is2D: false} (3d) -PASS {m43: 1, is2D: false} (3d) -PASS {m44: 0, is2D: false} (3d) -PASS {m13: 1} (3d) -PASS {m14: 1} (3d) -PASS {m23: 1} (3d) -PASS {m24: 1} (3d) -PASS {m31: 1} (3d) -PASS {m32: 1} (3d) -PASS {m33: 0} (3d) -PASS {m34: 1} (3d) -PASS {m43: 1} (3d) -PASS {m44: 0} (3d) -PASS {is2D: false} (3d) -PASS {is2D: null} (3d) -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/custom-elements/reactions/ChildNode.html b/third_party/WebKit/LayoutTests/external/wpt/custom-elements/reactions/ChildNode.html index 256e42ef..f808b67a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/custom-elements/reactions/ChildNode.html +++ b/third_party/WebKit/LayoutTests/external/wpt/custom-elements/reactions/ChildNode.html
@@ -3,8 +3,8 @@ <head> <title>Custom Elements: CEReactions on ChildNode interface</title> <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> -<meta name="assert" content="before, after, after, replaceWith, and remove of ChildNode interface must have CEReactions"> -<meta name="help" content="https://dom.spec.whatwg.org/#parentnode"> +<meta name="assert" content="before, after, replaceWith, and remove of ChildNode interface must have CEReactions"> +<meta name="help" content="https://dom.spec.whatwg.org/#childnode"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../resources/custom-elements-helpers.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fonts/README.md b/third_party/WebKit/LayoutTests/external/wpt/fonts/README.md new file mode 100644 index 0000000..f69b95a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fonts/README.md
@@ -0,0 +1,2 @@ +This directory only contains auxiliary font files used by other tests. See +/css-fonts for tests covering the CSS Fonts Module specification.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/generic-sensor/generic-sensor-tests.js b/third_party/WebKit/LayoutTests/external/wpt/generic-sensor/generic-sensor-tests.js index 222bde95..4314ea3 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/generic-sensor/generic-sensor-tests.js +++ b/third_party/WebKit/LayoutTests/external/wpt/generic-sensor/generic-sensor-tests.js
@@ -35,14 +35,14 @@ function runGenericSensorTests(sensorType) { async_test(t => { let sensor = new sensorType(); - sensor.onchange = t.step_func_done(() => { + sensor.onreading = t.step_func_done(() => { assert_reading_not_null(sensor); sensor.stop(); assert_reading_null(sensor); }); sensor.onerror = t.step_func_done(unreached); sensor.start(); - }, "Test that 'onchange' is called and sensor reading is valid"); + }, "Test that 'onreading' is called and sensor reading is valid"); async_test(t => { let sensor1 = new sensorType(); @@ -75,7 +75,7 @@ sensor.onerror = t.step_func_done(unreached); sensor.start(); t.step_timeout(() => { - sensor.onchange = t.step_func_done(() => { + sensor.onreading = t.step_func_done(() => { //sensor.timestamp changes. let cachedTimeStamp2 = sensor.timestamp; assert_greater_than(cachedTimeStamp2, cachedTimeStamp1); @@ -88,7 +88,7 @@ let sensor = new sensorType(); sensor.onerror = t.step_func_done(unreached); assert_false(sensor.activated); - sensor.onchange = t.step_func_done(() => { + sensor.onreading = t.step_func_done(() => { assert_true(sensor.activated); sensor.stop(); assert_false(sensor.activated);
diff --git a/third_party/WebKit/LayoutTests/external/wpt/generic-sensor/idlharness.html b/third_party/WebKit/LayoutTests/external/wpt/generic-sensor/idlharness.html index 07a43cf..5fffbbb 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/generic-sensor/idlharness.html +++ b/third_party/WebKit/LayoutTests/external/wpt/generic-sensor/idlharness.html
@@ -24,49 +24,30 @@ dictionary EventInit { }; +[SecureContext] interface Sensor : EventTarget { - readonly attribute SensorState state; - readonly attribute SensorReading? reading; + readonly attribute boolean activated; + readonly attribute DOMHighResTimeStamp? timestamp; void start(); void stop(); - attribute EventHandler onchange; - attribute EventHandler onstatechange; + attribute EventHandler onreading; + attribute EventHandler onactivate; attribute EventHandler onerror; }; dictionary SensorOptions { double? frequency; }; - -enum SensorState { - "idle", - "activating", - "active", - "errored" -}; - -interface SensorReading { - readonly attribute DOMHighResTimeStamp timeStamp; -}; - -[Constructor(DOMString type, SensorReadingEventInit eventInitDict)] -interface SensorReadingEvent : Event { - readonly attribute SensorReading reading; -}; - -dictionary SensorReadingEventInit : EventInit { - SensorReading reading; -}; </pre> <pre id="generic-idl"> -[Constructor(DOMString type, SensorErrorEventInit errorEventInitDict)] +[SecureContext, Constructor(DOMString type, SensorErrorEventInit errorEventInitDict)] interface SensorErrorEvent : Event { readonly attribute Error error; }; dictionary SensorErrorEventInit : EventInit { - Error error; + required Error error; }; </pre> @@ -78,9 +59,9 @@ idl_array.add_idls(document.getElementById('generic-idl').textContent); idl_array.add_objects({ - SensorErrorEvent: ['new SensorErrorEvent({ error: new TypeError("Boom!") });'] + SensorErrorEvent: ['new SensorErrorEvent("SECURITY_ERR", { errorCode: 18 });'] }); idl_array.test(); })(); -</script> \ No newline at end of file +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/gyroscope/idlharness.https.html b/third_party/WebKit/LayoutTests/external/wpt/gyroscope/idlharness.https.html index da1f67b6..791bdc1 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/gyroscope/idlharness.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/gyroscope/idlharness.https.html
@@ -39,7 +39,7 @@ readonly attribute DOMHighResTimeStamp? timestamp; void start(); void stop(); - attribute EventHandler onchange; + attribute EventHandler onreading; attribute EventHandler onactivate; attribute EventHandler onerror; };
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces-expected.txt index 286de04..e9e146b2 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 5187 tests; 4980 PASS, 207 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 5193 tests; 4986 PASS, 207 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Test driver PASS Document interface: attribute domain PASS Document interface: attribute referrer @@ -4332,12 +4332,12 @@ PASS Window interface object length PASS Window interface object name PASS Window interface: existence and properties of interface prototype object -PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Object.setPrototypeOf should throw a TypeError -PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via __proto__ should throw a TypeError -PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Reflect.setPrototypeOf should return false -PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Object.setPrototypeOf should not throw -PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via __proto__ should not throw -PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Reflect.setPrototypeOf should return true +PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Object.setPrototypeOf should throw a TypeError +PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via __proto__ should throw a TypeError +PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Reflect.setPrototypeOf should return false +PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Object.setPrototypeOf should not throw +PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via __proto__ should not throw +PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Reflect.setPrototypeOf should return true PASS Window interface: existence and properties of interface prototype object's "constructor" property FAIL Window interface: attribute self assert_equals: "self" must have a getter expected "function" but got "undefined" PASS Window interface: attribute name @@ -4458,6 +4458,12 @@ PASS Window interface: operation createImageBitmap(ImageBitmapSource,long,long,long,long,ImageBitmapOptions) PASS Window interface: attribute sessionStorage PASS Window interface: attribute localStorage +PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Object.setPrototypeOf should throw a TypeError +PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via __proto__ should throw a TypeError +PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Reflect.setPrototypeOf should return false +PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Object.setPrototypeOf should not throw +PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via __proto__ should not throw +PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Reflect.setPrototypeOf should return true PASS Window must be primary interface of window PASS Stringification of window FAIL Window interface: window must have own property "window" assert_false: property descriptor should not have a "value" field expected false got true
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/error-and-slow-dependency.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/error-and-slow-dependency.html index 88d6a29..f336276f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/error-and-slow-dependency.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/error-and-slow-dependency.html
@@ -5,6 +5,7 @@ <script type="module"> setup({allow_uncaught_exception: true}); window.log = []; +window.loaded = false; </script> <script type="module"> import "./syntaxerror.js";
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/errorhandling-parseerror-dependentmultiple.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/errorhandling-parseerror-dependentmultiple.html index 37487aa5..7775aea 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/errorhandling-parseerror-dependentmultiple.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/errorhandling-parseerror-dependentmultiple.html
@@ -5,26 +5,19 @@ <script src="errorhandling-parseerror-common.js"></script> </head> <body> - <script type="module" onerror="errorHandler(event);createSecondDependentRoot();"> + <script type="module" onerror="errorHandler(event)"> // No parse errors in the root module, just in the dependent module import test from "./errorhandling-parseerror-dependentmultiple.js"; document._errorReported = "shouldn't have run dependent module"; </script> - <script> + <script type="module" onerror="errorHandler(event)"> - function createSecondDependentRoot() - { - // With the broken dependent module already acquired, try to import it - // again from another root. This root should be unwound appropriately. - var script = document.createElement("script"); - script.type = "module"; - script.textContent = "import test from './errorhandling-parseerror-dependentmultiple.js';" + - "document._errorReported = 'really shouldn\\'t have run dependent module';"; - script.addEventListener("error", errorHandler); - document.body.appendChild(script); - } + // With the broken dependent module already acquired, try to import it + // again from another root. This root should be unwound appropriately. + import test from "./errorhandling-parseerror-dependentmultiple.js"; + document._errorReported = "really shouldn't have run dependent module"; </script> </body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/magnetometer/idlharness.https.html b/third_party/WebKit/LayoutTests/external/wpt/magnetometer/idlharness.https.html index 55a0851..f32b72706 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/magnetometer/idlharness.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/magnetometer/idlharness.https.html
@@ -39,7 +39,7 @@ readonly attribute DOMHighResTimeStamp? timestamp; void start(); void stop(); - attribute EventHandler onchange; + attribute EventHandler onreading; attribute EventHandler onactivate; attribute EventHandler onerror; }; @@ -65,6 +65,16 @@ readonly attribute unrestricted double? y; readonly attribute unrestricted double? z; }; + +[Constructor(optional SensorOptions sensorOptions)] +interface UncalibratedMagnetometer : Sensor { + readonly attribute unrestricted double? x; + readonly attribute unrestricted double? y; + readonly attribute unrestricted double? z; + readonly attribute unrestricted double? xBias; + readonly attribute unrestricted double? yBias; + readonly attribute unrestricted double? zBias; +}; </pre> <script> @@ -80,6 +90,10 @@ Magnetometer: ['new Magnetometer();'] }); + idl_array.add_objects({ + UncalibratedMagnetometer: ['new UncalibratedMagnetometer();'] + }); + idl_array.test(); })();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.outside3-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.outside3-expected.txt deleted file mode 100644 index 4786c45..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/offscreen-canvas/fill-and-stroke-styles/2d.gradient.radial.outside3-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -FAIL OffscreenCanvas test: 2d.gradient.radial.outside3 assert_equals: Red channel of the pixel at (1, 1) expected 0 but got 255 -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/orientation-sensor/idlharness.https.html b/third_party/WebKit/LayoutTests/external/wpt/orientation-sensor/idlharness.https.html index 8f556ca31..92ed7d4bd 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/orientation-sensor/idlharness.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/orientation-sensor/idlharness.https.html
@@ -39,7 +39,7 @@ readonly attribute DOMHighResTimeStamp? timestamp; void start(); void stop(); - attribute EventHandler onchange; + attribute EventHandler onreading; attribute EventHandler onactivate; attribute EventHandler onerror; }; @@ -68,6 +68,10 @@ [Constructor(optional SensorOptions sensorOptions)] interface AbsoluteOrientationSensor : OrientationSensor { }; + +[Constructor(optional SensorOptions sensorOptions)] +interface RelativeOrientationSensor : OrientationSensor { +}; </pre> <script> @@ -83,6 +87,10 @@ AbsoluteOrientationSensor: ['new AbsoluteOrientationSensor();'] }); + idl_array.add_objects({ + RelativeOrientationSensor: ['new RelativeOrientationSensor();'] + }); + idl_array.test(); })();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/resources/idlharness.js b/third_party/WebKit/LayoutTests/external/wpt/resources/idlharness.js index 6dd1db3d4..d057457 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/resources/idlharness.js +++ b/third_party/WebKit/LayoutTests/external/wpt/resources/idlharness.js
@@ -1380,81 +1380,14 @@ } }.bind(this), this.name + " interface: existence and properties of interface prototype object"); - if (this.is_global() && typeof Object.setPrototypeOf === "function") { - // These functions test WebIDL as of 2017-06-06. - // https://heycam.github.io/webidl/#platform-object-setprototypeof - test(function() { - var originalValue = Object.getPrototypeOf(self[this.name].prototype); - var newValue = Object.create(null); - - assert_throws(new TypeError(), function() { - Object.setPrototypeOf(self[this.name].prototype, newValue); - }); - - assert_equals( - Object.getPrototypeOf(self[this.name].prototype), - originalValue, - "original value not modified" - ); - }.bind(this), this.name + " interface: internal [[SetPrototypeOf]] method " + - "of global platform object - setting to a new value via Object.setPrototypeOf " + - "should throw a TypeError"); - - test(function() { - var originalValue = Object.getPrototypeOf(self[this.name].prototype); - var newValue = Object.create(null); - - assert_throws(new TypeError(), function() { - self[this.name].prototype.__proto__ = newValue; - }); - - assert_equals( - Object.getPrototypeOf(self[this.name].prototype), - originalValue, - "original value not modified" - ); - }.bind(this), this.name + " interface: internal [[SetPrototypeOf]] method " + - "of global platform object - setting to a new value via __proto__ " + - "should throw a TypeError"); - - test(function() { - var originalValue = Object.getPrototypeOf(self[this.name].prototype); - var newValue = Object.create(null); - - assert_false(Reflect.setPrototypeOf(self[this.name].prototype.__proto__, newValue)); - - assert_equals( - Object.getPrototypeOf(self[this.name].prototype), - originalValue, - "original value not modified" - ); - }.bind(this), this.name + " interface: internal [[SetPrototypeOf]] method " + - "of global platform object - setting to a new value via Reflect.setPrototypeOf " + - "should return false"); - - test(function() { - var originalValue = Object.getPrototypeOf(self[this.name].prototype); - - Object.setPrototypeOf(self[this.name].prototype, originalValue); - }.bind(this), this.name + " interface: internal [[SetPrototypeOf]] method " + - "of global platform object - setting to its original value via Object.setPrototypeOf " + - "should not throw"); - - test(function() { - var originalValue = Object.getPrototypeOf(self[this.name].prototype); - - self[this.name].prototype.__proto__ = originalValue; - }.bind(this), this.name + " interface: internal [[SetPrototypeOf]] method " + - "of global platform object - setting to its original value via __proto__ " + - "should not throw"); - - test(function() { - var originalValue = Object.getPrototypeOf(self[this.name].prototype); - - assert_true(Reflect.setPrototypeOf(self[this.name].prototype, originalValue)); - }.bind(this), this.name + " interface: internal [[SetPrototypeOf]] method " + - "of global platform object - setting to its original value via Reflect.setPrototypeOf " + - "should return true"); + // "If the interface is declared with the [Global] or [PrimaryGlobal] + // extended attribute, or the interface is in the set of inherited + // interfaces for any other interface that is declared with one of these + // attributes, then the interface prototype object must be an immutable + // prototype exotic object." + // https://heycam.github.io/webidl/#interface-prototype-object + if (this.is_global()) { + this.test_immutable_prototype("interface prototype object", self[this.name].prototype); } test(function() @@ -1494,6 +1427,110 @@ }; //@} +IdlInterface.prototype.test_immutable_prototype = function(type, obj) +//@{ +{ + if (typeof Object.setPrototypeOf !== "function") { + return; + } + + test(function(t) { + var originalValue = Object.getPrototypeOf(obj); + var newValue = Object.create(null); + + t.add_cleanup(function() { + try { + Object.setPrototypeOf(obj, originalValue); + } catch (err) {} + }); + + assert_throws(new TypeError(), function() { + Object.setPrototypeOf(obj, newValue); + }); + + assert_equals( + Object.getPrototypeOf(obj), + originalValue, + "original value not modified" + ); + }.bind(this), this.name + " interface: internal [[SetPrototypeOf]] method " + + "of " + type + " - setting to a new value via Object.setPrototypeOf " + + "should throw a TypeError"); + + test(function(t) { + var originalValue = Object.getPrototypeOf(obj); + var newValue = Object.create(null); + + t.add_cleanup(function() { + var setter = Object.getOwnPropertyDescriptor( + Object.prototype, '__proto__' + ).set; + + try { + setter.call(obj, originalValue); + } catch (err) {} + }); + + assert_throws(new TypeError(), function() { + obj.__proto__ = newValue; + }); + + assert_equals( + Object.getPrototypeOf(obj), + originalValue, + "original value not modified" + ); + }.bind(this), this.name + " interface: internal [[SetPrototypeOf]] method " + + "of " + type + " - setting to a new value via __proto__ " + + "should throw a TypeError"); + + test(function(t) { + var originalValue = Object.getPrototypeOf(obj); + var newValue = Object.create(null); + + t.add_cleanup(function() { + try { + Reflect.setPrototypeOf(obj, originalValue); + } catch (err) {} + }); + + assert_false(Reflect.setPrototypeOf(obj, newValue)); + + assert_equals( + Object.getPrototypeOf(obj), + originalValue, + "original value not modified" + ); + }.bind(this), this.name + " interface: internal [[SetPrototypeOf]] method " + + "of " + type + " - setting to a new value via Reflect.setPrototypeOf " + + "should return false"); + + test(function() { + var originalValue = Object.getPrototypeOf(obj); + + Object.setPrototypeOf(obj, originalValue); + }.bind(this), this.name + " interface: internal [[SetPrototypeOf]] method " + + "of " + type + " - setting to its original value via Object.setPrototypeOf " + + "should not throw"); + + test(function() { + var originalValue = Object.getPrototypeOf(obj); + + obj.__proto__ = originalValue; + }.bind(this), this.name + " interface: internal [[SetPrototypeOf]] method " + + "of " + type + " - setting to its original value via __proto__ " + + "should not throw"); + + test(function() { + var originalValue = Object.getPrototypeOf(obj); + + assert_true(Reflect.setPrototypeOf(obj, originalValue)); + }.bind(this), this.name + " interface: internal [[SetPrototypeOf]] method " + + "of " + type + " - setting to its original value via Reflect.setPrototypeOf " + + "should return true"); +}; + +//@} IdlInterface.prototype.test_member_const = function(member) //@{ { @@ -2042,6 +2079,18 @@ return; } + // "The internal [[SetPrototypeOf]] method of every platform object that + // implements an interface with the [Global] or [PrimaryGlobal] extended + // attribute must execute the same algorithm as is defined for the + // [[SetPrototypeOf]] internal method of an immutable prototype exotic + // object." + // https://heycam.github.io/webidl/#platform-object-setprototypeof + if (this.is_global()) + { + this.test_immutable_prototype("global platform object", obj); + } + + // We can't easily test that its prototype is correct if there's no // interface object, or the object is from a different global environment // (not instanceof Object). TODO: test in this case that its prototype at
diff --git a/third_party/WebKit/LayoutTests/external/wpt/resources/test/tests/idlharness/IdlInterface/test_immutable_prototype.html b/third_party/WebKit/LayoutTests/external/wpt/resources/test/tests/idlharness/IdlInterface/test_immutable_prototype.html new file mode 100644 index 0000000..16214c4d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/resources/test/tests/idlharness/IdlInterface/test_immutable_prototype.html
@@ -0,0 +1,321 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="utf-8"> + <title>idlharness: Immutable prototypes</title> + <script src="../../../../testharness.js"></script> + <script src="../../../../testharnessreport.js"></script> + <script src="../../../../WebIDLParser.js"></script> + <script src="../../../../idlharness.js"></script> +</head> +<body> +<script> +"use strictt"; + +Object.defineProperty(window, "Foo", { + enumerable: false, + writable: true, + configurable: true, + value: function Foo() {} + }); +Object.defineProperty(window.Foo, "prototype", { + writable: false, + value: window.Foo.prototype + }); +Foo.prototype[Symbol.toStringTag] = "Foo"; + +var idlArray = new IdlArray(); +idlArray.add_untested_idls("interface EventTarget {};"); +idlArray.add_idls( + "[Global=Window, Exposed=Window]\n" + + "interface Window : EventTarget {};\n" + + + "[Global=Window, Exposed=Window, Constructor()]\n" + + "interface Foo {};" + ); +idlArray.add_objects({ + Foo: ["new Foo()"], + Window: ["window"] +}); +idlArray.test(); +</script> +<script type="text/json" id="expected"> +{ + "summarized_status": { + "message": null, + "status_string": "OK", + "stack": null + }, + "summarized_tests": [ + { + "name": "Foo interface object length", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Foo interface object name", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Foo interface: existence and properties of interface object", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Foo interface: existence and properties of interface prototype object", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Foo interface: existence and properties of interface prototype object's \"constructor\" property", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Object.setPrototypeOf should throw a TypeError", + "status_string": "FAIL", + "properties": {}, + "message": "assert_throws: function \"function() {\n Object.setPrototypeOf(obj, newValue);\n }\" did not throw", + "stack": "(implementation-defined)" + }, + { + "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Reflect.setPrototypeOf should return false", + "status_string": "FAIL", + "properties": {}, + "message": "assert_false: expected false got true", + "stack": "(implementation-defined)" + }, + { + "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via __proto__ should throw a TypeError", + "status_string": "FAIL", + "properties": {}, + "message": "assert_throws: function \"function() {\n obj.__proto__ = newValue;\n }\" did not throw", + "stack": "(implementation-defined)" + }, + { + "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Object.setPrototypeOf should not throw", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Reflect.setPrototypeOf should return true", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via __proto__ should not throw", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Object.setPrototypeOf should throw a TypeError", + "status_string": "FAIL", + "properties": {}, + "message": "assert_throws: function \"function() {\n Object.setPrototypeOf(obj, newValue);\n }\" did not throw", + "stack": "(implementation-defined)" + }, + { + "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Reflect.setPrototypeOf should return false", + "status_string": "FAIL", + "properties": {}, + "message": "assert_false: expected false got true", + "stack": "(implementation-defined)" + }, + { + "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via __proto__ should throw a TypeError", + "status_string": "FAIL", + "properties": {}, + "message": "assert_throws: function \"function() {\n obj.__proto__ = newValue;\n }\" did not throw", + "stack": "(implementation-defined)" + }, + { + "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Object.setPrototypeOf should not throw", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Reflect.setPrototypeOf should return true", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via __proto__ should not throw", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Foo must be primary interface of new Foo()", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Stringification of new Foo()", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Stringification of window", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface object length", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface object name", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface: existence and properties of interface object", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface: existence and properties of interface prototype object", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface: existence and properties of interface prototype object's \"constructor\" property", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Object.setPrototypeOf should throw a TypeError", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Reflect.setPrototypeOf should return false", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via __proto__ should throw a TypeError", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Object.setPrototypeOf should not throw", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Reflect.setPrototypeOf should return true", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via __proto__ should not throw", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Object.setPrototypeOf should throw a TypeError", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Reflect.setPrototypeOf should return false", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via __proto__ should throw a TypeError", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Object.setPrototypeOf should not throw", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Reflect.setPrototypeOf should return true", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via __proto__ should not throw", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + }, + { + "name": "Window must be primary interface of window", + "status_string": "PASS", + "properties": {}, + "message": null, + "stack": null + } + ], + "type": "complete" +} +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/url/setters_tests.json b/third_party/WebKit/LayoutTests/external/wpt/url/setters_tests.json index fa40dda..f35db16 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/url/setters_tests.json +++ b/third_party/WebKit/LayoutTests/external/wpt/url/setters_tests.json
@@ -259,6 +259,16 @@ "href": "view-source+data:text/html,<p>Test", "protocol": "view-source+data:" } + }, + { + "comment": "Port is set to null if it is the default for new scheme.", + "href": "http://foo.com:443/", + "new_value": "https", + "expected": { + "href": "https://foo.com/", + "protocol": "https:", + "port": "" + } } ], "username": [
diff --git a/third_party/WebKit/LayoutTests/fast/block/float/float-not-removed-from-pre-block-expected.txt b/third_party/WebKit/LayoutTests/fast/block/float/float-not-removed-from-pre-block-expected.txt index 086d4ec..9c1b291 100644 --- a/third_party/WebKit/LayoutTests/fast/block/float/float-not-removed-from-pre-block-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/block/float/float-not-removed-from-pre-block-expected.txt
@@ -1,3 +1,3 @@ Bug 101970: Heap-use-after-free in WebCore::LayoutLayerModelObject::hasSelfPaintingLayer Test passes if it does not crash. - +
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-ellipse-connecting-line-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-ellipse-connecting-line-expected.txt deleted file mode 100644 index d990b54..0000000 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-ellipse-connecting-line-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x320 - LayoutBlockFlow {HTML} at (0,0) size 800x320 - LayoutBlockFlow {BODY} at (8,8) size 784x304 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,8) size 300x300 - LayoutHTMLCanvas {CANVAS} at (0,0) size 300x300
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-render-layer-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-render-layer-expected.txt index 0fc3715..c76827f 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-render-layer-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-render-layer-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x116 LayoutBlockFlow {BODY} at (8,8) size 784x100 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 100x100 LayoutHTMLCanvas {CANVAS} at (0,0) size 100x100 layer at (108,8) size 100x100
diff --git a/third_party/WebKit/LayoutTests/fast/css-generated-content/before-content-continuation-chain-expected.txt b/third_party/WebKit/LayoutTests/fast/css-generated-content/before-content-continuation-chain-expected.txt index defe321..b204e636 100644 --- a/third_party/WebKit/LayoutTests/fast/css-generated-content/before-content-continuation-chain-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/css-generated-content/before-content-continuation-chain-expected.txt
@@ -15,4 +15,3 @@ LayoutText {#text} at (0,0) size 200x200 text run at (0,0) width 200: "B" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/fast/css-generated-content/nested-tables-with-before-after-content-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/css-generated-content/nested-tables-with-before-after-content-crash-expected.txt index 9455f85..e3c8e972 100644 --- a/third_party/WebKit/LayoutTests/fast/css-generated-content/nested-tables-with-before-after-content-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/css-generated-content/nested-tables-with-before-after-content-crash-expected.txt
@@ -23,4 +23,3 @@ LayoutTextFragment (anonymous) at (16,0) size 16x16 text run at (16,0) width 16: "\"" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-template-areas-must-keep-named-columns-order-expected.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-template-areas-must-keep-named-columns-order-expected.html new file mode 100644 index 0000000..30e6f9d --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-template-areas-must-keep-named-columns-order-expected.html
@@ -0,0 +1,22 @@ +<!DOCTYPE html> +<style> +.grid { + display: inline-grid; + background: grey; + grid-template-columns: 50px 50px 50px 50px; + grid-template-rows: 50px 50px; +} +.grid > :nth-child(1) { background: magenta; } +.grid > :nth-child(2) { background: blue; } +.grid > :nth-child(3) { background: yellow; } +.grid > :nth-child(4) { background: green; } +.grid > :nth-child(5) { background: red; } +</style> +<p>This is a regression test for the issue crbug.com/733577 and it passes if the red item is positioned in the first column of the second row, since the spec states that we must select the first one among several equally named grid lines.</p> +<div class="grid"> + <div style="grid-row: 1; grid-column: 1"></div> + <div style="grid-row: 1; grid-column: 2"></div> + <div style="grid-row: 1; grid-column: 3"></div> + <div style="grid-row: 1; grid-column: 4"></div> + <div style="grid-row: 2; grid-column: 1"></div> +</div>
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-template-areas-must-keep-named-columns-order.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-template-areas-must-keep-named-columns-order.html new file mode 100644 index 0000000..90e280fc --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-template-areas-must-keep-named-columns-order.html
@@ -0,0 +1,23 @@ +<!DOCTYPE html> +<style> +.grid { + display: inline-grid; + background: grey; + grid-template-columns: [col] 50px [col] 50px [col] 50px [col] 50px; + grid-auto-rows: 50px; + grid-template-areas: "A . . ."; +} +.grid > :nth-child(1) { background: magenta; } +.grid > :nth-child(2) { background: blue; } +.grid > :nth-child(3) { background: yellow; } +.grid > :nth-child(4) { background: green; } +.grid > :nth-child(5) { background: red; } +</style> +<p>This is a regression test for the issue crbug.com/733577 and it passes if the red item is positioned in the first column of the second row, since the spec states that we must select the first one among several equally named grid lines.</p> +<div class="grid"> + <div></div> + <div></div> + <div></div> + <div></div> + <div style="grid-column: col"></div> +</div>
diff --git a/third_party/WebKit/LayoutTests/fast/css/positioned-overflow-scroll-expected.txt b/third_party/WebKit/LayoutTests/fast/css/positioned-overflow-scroll-expected.txt index 315c9b59..11194b69 100644 --- a/third_party/WebKit/LayoutTests/fast/css/positioned-overflow-scroll-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/css/positioned-overflow-scroll-expected.txt
@@ -1,2 +1,2 @@ Test that scrollbar width is added to the intrinsic width of different display types. - PASS +PASS
diff --git a/third_party/WebKit/LayoutTests/fast/css/style-tag-display-none-expected.txt b/third_party/WebKit/LayoutTests/fast/css/style-tag-display-none-expected.txt index 8af7f24..dae70df 100644 --- a/third_party/WebKit/LayoutTests/fast/css/style-tag-display-none-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/css/style-tag-display-none-expected.txt
@@ -5,4 +5,3 @@ LayoutBlockFlow {BODY} at (8,8) size 784x0 LayoutInline {A} at (0,0) size 0x0 [color=#551A8B] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/scroll-width-hidden-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/scroll-width-hidden-expected.txt index 3a0446a..2ff6509 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Element/scroll-width-hidden-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Element/scroll-width-hidden-expected.txt
@@ -1,2 +1,2 @@ Tests that element.clientWidth of visible element with scrollbars returns proper values - PASS +PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/scroll-width-visible-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/scroll-width-visible-expected.txt index 3a0446a..2ff6509 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Element/scroll-width-visible-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Element/scroll-width-visible-expected.txt
@@ -1,2 +1,2 @@ Tests that element.clientWidth of visible element with scrollbars returns proper values - PASS +PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-sizes-2x-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-sizes-2x-expected.txt index 263cb650..f5778473f 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-sizes-2x-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-sizes-2x-expected.txt
@@ -25,4 +25,4 @@ PASS currentSrcFileNameNoParams("half_size") is "image-set-2x.png" PASS document.getElementById("infitisimal_sizes").clientWidth is (window.innerWidth/100) PASS currentSrcFileNameNoParams("infitisimal_sizes") is "image-set-2x.png" - +
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-expected.txt index ac1b174..09a568f 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-expected.txt
@@ -2,7 +2,7 @@ nick.jpg has MIME type image/jpeg This test verifies that an image which is prefetched, and which is also contained as a subresource of the current document can be loaded correctly as a subresource. See bug 49236 in which this wasn't working. -When this test succeeds, you'll see an image of Nick on a sailboat immediately below this text. When this test fails, you will see no images at all. +When this test succeeds, you'll see an image of Nick on a sailboat immediately below this text. When this test fails, you will see no images at all. NICK_ONLOAD called NICK_ONLOAD called
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt index d1f1eef1..a144013b 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt
@@ -1,6 +1,6 @@ This test verifies that an image which is prefetched, and which is also contained as a subresource of the current document can be loaded correctly as a subresource, even if the URI doesn't exist. -When this test succeeds, you will see nothing. When this test fails, you will crash or have another error. +When this test succeeds, you will see nothing. When this test fails, you will crash or have another error. DNE_ONERROR called DNE_ONERROR called
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-expected.txt index 8ac0b16..035c81c5 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-expected.txt
@@ -1,4 +1,3 @@ prefetch.link has MIME type text/plain This test requires DumpRenderTree to see the log of what resources are loaded. - SUCCESS! prefetch onload called.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.txt index c6b0fdb..c9ea649 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.txt
@@ -8,4 +8,3 @@ LayoutBlockFlow {DIV} at (0,0) size 80x16 LayoutBlockFlow {DIV} at (0,0) size 40x16 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency2-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency2-expected.txt index d2e5788..c153fd8c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency2-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency2-expected.txt
@@ -1,4 +1,4 @@ -Test that DOMSubtreeModified listeners cannot cause DocumentOrderedMap to be incorrect +Test that DOMSubtreeModified listeners cannot cause TreeOrderedMap to be incorrect On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency2.html b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency2.html index b370c96..bcac7e7b 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency2.html +++ b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency2.html
@@ -5,7 +5,7 @@ <span id=el> </span> <script> -description('Test that DOMSubtreeModified listeners cannot cause DocumentOrderedMap to be incorrect'); +description('Test that DOMSubtreeModified listeners cannot cause TreeOrderedMap to be incorrect'); var counter = 0; var container = document.getElementById('container');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency3-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency3-expected.txt index d2e5788..c153fd8c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency3-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency3-expected.txt
@@ -1,4 +1,4 @@ -Test that DOMSubtreeModified listeners cannot cause DocumentOrderedMap to be incorrect +Test that DOMSubtreeModified listeners cannot cause TreeOrderedMap to be incorrect On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency3.html b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency3.html index a0ee8f70e..b30448d1 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency3.html +++ b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency3.html
@@ -5,7 +5,7 @@ </span> </div> <script> -description('Test that DOMSubtreeModified listeners cannot cause DocumentOrderedMap to be incorrect'); +description('Test that DOMSubtreeModified listeners cannot cause TreeOrderedMap to be incorrect'); var counter = 0; var container = document.getElementById('container');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency4-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency4-expected.txt index d2e5788..c153fd8c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency4-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency4-expected.txt
@@ -1,4 +1,4 @@ -Test that DOMSubtreeModified listeners cannot cause DocumentOrderedMap to be incorrect +Test that DOMSubtreeModified listeners cannot cause TreeOrderedMap to be incorrect On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency4.html b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency4.html index 3abbf7ef..7d78fc4 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency4.html +++ b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency4.html
@@ -5,7 +5,7 @@ </span> </div> <script> -description('Test that DOMSubtreeModified listeners cannot cause DocumentOrderedMap to be incorrect'); +description('Test that DOMSubtreeModified listeners cannot cause TreeOrderedMap to be incorrect'); var counter = 0; var container = document.getElementById('container');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency5-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency5-expected.txt index d2e5788..c153fd8c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency5-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency5-expected.txt
@@ -1,4 +1,4 @@ -Test that DOMSubtreeModified listeners cannot cause DocumentOrderedMap to be incorrect +Test that DOMSubtreeModified listeners cannot cause TreeOrderedMap to be incorrect On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency5.html b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency5.html index fe2bf9b0..39eec46 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency5.html +++ b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency5.html
@@ -5,7 +5,7 @@ </span> </div> <script> -description('Test that DOMSubtreeModified listeners cannot cause DocumentOrderedMap to be incorrect'); +description('Test that DOMSubtreeModified listeners cannot cause TreeOrderedMap to be incorrect'); var counter = 0; var container = document.getElementById('container');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/hidden-iframe-no-focus-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/hidden-iframe-no-focus-expected.txt index 19b07a3..22ccc8b 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/hidden-iframe-no-focus-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/hidden-iframe-no-focus-expected.txt
@@ -1,4 +1,4 @@ Press tab twice. The second input should be focused. - + PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/float-from-empty-line-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/float-from-empty-line-expected.txt index d083c68..24ce0c3 100644 --- a/third_party/WebKit/LayoutTests/fast/dynamic/float-from-empty-line-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dynamic/float-from-empty-line-expected.txt
@@ -8,7 +8,6 @@ LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow (floating) {DIV} at (0,50) size 50x50 [bgcolor=#FF0000] LayoutBlockFlow {DIV} at (0,0) size 50x50 [bgcolor=#008000] - LayoutText {#text} at (0,0) size 0x0 LayoutBR {BR} at (0,0) size 0x0 LayoutImage {IMG} at (50,50) size 0x0 LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/fast/forms/datalist/input-appearance-range-with-datalist-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/datalist/input-appearance-range-with-datalist-expected.txt index b055673..163b4d3f 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/datalist/input-appearance-range-with-datalist-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/datalist/input-appearance-range-with-datalist-expected.txt
@@ -1 +1 @@ - +
diff --git a/third_party/WebKit/LayoutTests/fast/forms/focus-selection-input-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/focus-selection-input-expected.txt index 492d12a..acb53fc 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/focus-selection-input-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/focus-selection-input-expected.txt
@@ -21,10 +21,8 @@ 7) , only the word "SUCCESS" should be selected: 8) , the whole phrase "SUCCESS and SUCCESS" should be selected: - 9) Hit Ctrl-Option-I (or Alt-I on Windows), the whole phrase "SUCCESS and SUCCESS" should be selected: - PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/forms/focus-selection-textarea-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/focus-selection-textarea-expected.txt index 6290055..882bde54 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/focus-selection-textarea-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/focus-selection-textarea-expected.txt
@@ -21,10 +21,8 @@ 7) , only the word "SUCCESS" should be selected: 8) , only the word "SUCCESS" should be selected: - 9) Hit Ctrl-Option-I (or Alt-I on Windows), only the word "SUCCESS" should be selected: - PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-added-to-table.html b/third_party/WebKit/LayoutTests/fast/forms/form-added-to-table.html index 209ec259..9d7a5869 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/form-added-to-table.html +++ b/third_party/WebKit/LayoutTests/fast/forms/form-added-to-table.html
@@ -1,14 +1,18 @@ <html> <head> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> <script> +var t = async_test(); function loaded() { var selection = window.getSelection(); var range = document.createRange(); range.selectNode(document.getElementById("selectMe")); selection.addRange(range); - + var table = document.createElement("table"); document.getElementById('form').appendChild(table); + t.done(); } </script> </head>
diff --git a/third_party/WebKit/LayoutTests/fast/forms/interactive-validation-prevented-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/interactive-validation-prevented-expected.txt index 2787ab7..95e094a4a 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/interactive-validation-prevented-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/interactive-validation-prevented-expected.txt
@@ -11,4 +11,4 @@ PASS The form was not submitted PASS document.activeElement is document.getElementById("i2") TEST COMPLETE - +
diff --git a/third_party/WebKit/LayoutTests/fast/forms/select/select-listbox-focus-displaynone-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/select/select-listbox-focus-displaynone-expected.txt index 5df6241..660b40f4 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/select/select-listbox-focus-displaynone-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/select/select-listbox-focus-displaynone-expected.txt
@@ -1 +1 @@ - PASS + PASS
diff --git a/third_party/WebKit/LayoutTests/fast/forms/select/select-no-name-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/select/select-no-name-expected.txt index a0369272..9a17c52d 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/select/select-no-name-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/select/select-no-name-expected.txt
@@ -1,5 +1,4 @@ Test for bug 20184: SELECT with no name generates invalid query string. - -PASS + PASS reload
diff --git a/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-setvalue-submit-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-setvalue-submit-expected.txt index 5d26d33..3582111 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-setvalue-submit-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-setvalue-submit-expected.txt
@@ -1,2 +1 @@ - Success
diff --git a/third_party/WebKit/LayoutTests/fast/frames/content-opacity-2-expected.txt b/third_party/WebKit/LayoutTests/fast/frames/content-opacity-2-expected.txt index 391f1d3..c373473b 100644 --- a/third_party/WebKit/LayoutTests/fast/frames/content-opacity-2-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/frames/content-opacity-2-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutBlockFlow (floating) {DIV} at (0,0) size 304x154 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 304x154 LayoutIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #EEEEEE)] layer at (0,0) size 300x150
diff --git a/third_party/WebKit/LayoutTests/fast/gradients/css3-degenerate-color-stops-expected.png b/third_party/WebKit/LayoutTests/fast/gradients/css3-degenerate-color-stops-expected.png deleted file mode 100644 index edcd3da..0000000 --- a/third_party/WebKit/LayoutTests/fast/gradients/css3-degenerate-color-stops-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/gradients/css3-radial-gradients-expected.png b/third_party/WebKit/LayoutTests/fast/gradients/css3-radial-gradients-expected.png deleted file mode 100644 index 3c6a1b0d..0000000 --- a/third_party/WebKit/LayoutTests/fast/gradients/css3-radial-gradients-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/gradients/css3-repeating-radial-gradients-expected.png b/third_party/WebKit/LayoutTests/fast/gradients/css3-repeating-radial-gradients-expected.png deleted file mode 100644 index 67b95ce..0000000 --- a/third_party/WebKit/LayoutTests/fast/gradients/css3-repeating-radial-gradients-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/gradients/unprefixed-radial-gradients-color-hints-expected.png b/third_party/WebKit/LayoutTests/fast/gradients/unprefixed-radial-gradients-color-hints-expected.png deleted file mode 100644 index eb281b1a..0000000 --- a/third_party/WebKit/LayoutTests/fast/gradients/unprefixed-radial-gradients-color-hints-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/gradients/unprefixed-radial-gradients-expected.png b/third_party/WebKit/LayoutTests/fast/gradients/unprefixed-radial-gradients-expected.png deleted file mode 100644 index 3c6a1b0d..0000000 --- a/third_party/WebKit/LayoutTests/fast/gradients/unprefixed-radial-gradients-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/gradients/unprefixed-repeating-gradient-color-hint-expected.png b/third_party/WebKit/LayoutTests/fast/gradients/unprefixed-repeating-gradient-color-hint-expected.png deleted file mode 100644 index e08173a..0000000 --- a/third_party/WebKit/LayoutTests/fast/gradients/unprefixed-repeating-gradient-color-hint-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/gradients/unprefixed-repeating-radial-gradients-expected.png b/third_party/WebKit/LayoutTests/fast/gradients/unprefixed-repeating-radial-gradients-expected.png deleted file mode 100644 index 67b95ce..0000000 --- a/third_party/WebKit/LayoutTests/fast/gradients/unprefixed-repeating-radial-gradients-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/html/layout-runs-and-floats-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/html/layout-runs-and-floats-crash-expected.txt index 588a563b..23eb37c 100644 --- a/third_party/WebKit/LayoutTests/fast/html/layout-runs-and-floats-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/html/layout-runs-and-floats-crash-expected.txt
@@ -1,2 +1,2 @@ - + This test passes if it doesn't crash
diff --git a/third_party/WebKit/LayoutTests/fast/parser/comments-expected.txt b/third_party/WebKit/LayoutTests/fast/parser/comments-expected.txt index 9e5125e..8190d684 100644 --- a/third_party/WebKit/LayoutTests/fast/parser/comments-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/parser/comments-expected.txt
@@ -12,10 +12,8 @@ Multiple lines: PASSED - Compatibility: PASSED PASSED - White space after comment close: Extra comment after markup declaration close: FAILED: extra comment end and markup declaration close -->
diff --git a/third_party/WebKit/LayoutTests/fast/ruby/ruby-base-merge-block-children-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/ruby/ruby-base-merge-block-children-crash-expected.txt index 080d24a..880a615 100644 --- a/third_party/WebKit/LayoutTests/fast/ruby/ruby-base-merge-block-children-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/ruby/ruby-base-merge-block-children-crash-expected.txt
@@ -14,5 +14,4 @@ LayoutInline {SPAN} at (0,0) size 0x0 LayoutInline {SPAN} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutInline {I} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/fast/ruby/ruby-text-before-child-split-expected.txt b/third_party/WebKit/LayoutTests/fast/ruby/ruby-text-before-child-split-expected.txt index 5b9df92..d79812a 100644 --- a/third_party/WebKit/LayoutTests/fast/ruby/ruby-text-before-child-split-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/ruby/ruby-text-before-child-split-expected.txt
@@ -21,4 +21,3 @@ LayoutText {#text} at (0,0) size 10x10 text run at (0,0) width 10: "B" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/fast/ruby/select-ruby-expected.txt b/third_party/WebKit/LayoutTests/fast/ruby/select-ruby-expected.txt index e3d13a4..0a3eabcb 100644 --- a/third_party/WebKit/LayoutTests/fast/ruby/select-ruby-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/ruby/select-ruby-expected.txt
@@ -36,6 +36,5 @@ text run at (0,0) width 16: "4" LayoutText {#text} at (80,8) size 16x16 text run at (80,8) width 16: "b" - LayoutText {#text} at (0,0) size 0x0 selection start: position 1 of child 2 {#text} of body selection end: position 1 of child 4 {#text} of body
diff --git a/third_party/WebKit/LayoutTests/fast/ruby/select-ruby.html b/third_party/WebKit/LayoutTests/fast/ruby/select-ruby.html index b8abe9c..7cc04d3 100644 --- a/third_party/WebKit/LayoutTests/fast/ruby/select-ruby.html +++ b/third_party/WebKit/LayoutTests/fast/ruby/select-ruby.html
@@ -15,9 +15,7 @@ <!-- All texts inside the ruby should be highlighted. --> a<ruby>1<rt>1</rt>2<rt>2</rt>3<rt>3</rt>4<rt>4</rt></ruby>b <script> -var range = document.createRange(); -range.selectNodeContents(document.body); -window.getSelection().addRange(range); +window.getSelection().setBaseAndExtent(document.body.childNodes[2], 1, document.body.childNodes[4], 1) </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/ruby/split-ruby-run-percentage-height-descendant-expected.txt b/third_party/WebKit/LayoutTests/fast/ruby/split-ruby-run-percentage-height-descendant-expected.txt index 760eca3..91c21b6 100644 --- a/third_party/WebKit/LayoutTests/fast/ruby/split-ruby-run-percentage-height-descendant-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/ruby/split-ruby-run-percentage-height-descendant-expected.txt
@@ -1,3 +1,2 @@ - -This test checks that <ruby> doesn't leave any pointer in the percentage height descendant when it splits a ruby run. + This test checks that <ruby> doesn't leave any pointer in the percentage height descendant when it splits a ruby run. For this test to pass it should not crash or ASSERT!
diff --git a/third_party/WebKit/LayoutTests/fast/scrolling/scrollbar-repaint-two-level-scrollable-expected.txt b/third_party/WebKit/LayoutTests/fast/scrolling/scrollbar-repaint-two-level-scrollable-expected.txt index 449ce70..286ddc15 100644 --- a/third_party/WebKit/LayoutTests/fast/scrolling/scrollbar-repaint-two-level-scrollable-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/scrolling/scrollbar-repaint-two-level-scrollable-expected.txt
@@ -1,3 +1,2 @@ Tests invalidation and painting of scrollbar parts of a scroll area contained by another scroll area, when scrolling of the outer scroll area exposes a new port of the inner scrollbar. Passes if no assertion failure. PASS -
diff --git a/third_party/WebKit/LayoutTests/fast/selectors/shadow-host-div-with-span.html b/third_party/WebKit/LayoutTests/fast/selectors/shadow-host-div-with-span.html index 72b7931d..d33d3ce 100644 --- a/third_party/WebKit/LayoutTests/fast/selectors/shadow-host-div-with-span.html +++ b/third_party/WebKit/LayoutTests/fast/selectors/shadow-host-div-with-span.html
@@ -22,6 +22,6 @@ function SelectText() { var ele = document.getElementById('container'); var selection = window.getSelection(); - selection.selectAllChildren(ele); + selection.setBaseAndExtent(ele.childNodes[1], 0, ele.childNodes[5], 1); } </script>
diff --git a/third_party/WebKit/LayoutTests/fast/selectors/shadow-host-div-with-text.html b/third_party/WebKit/LayoutTests/fast/selectors/shadow-host-div-with-text.html index ced764e..5c86dc1 100644 --- a/third_party/WebKit/LayoutTests/fast/selectors/shadow-host-div-with-text.html +++ b/third_party/WebKit/LayoutTests/fast/selectors/shadow-host-div-with-text.html
@@ -28,9 +28,7 @@ var span = root.querySelector('span'); var selection = window.getSelection(); - var range = document.createRange(); - range.selectNodeContents(span); - selection.addRange(range); + selection.setBaseAndExtent(span.firstChild, 2, span.firstChild, 54); </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/selectors/style-sharing-last-child-expected.txt b/third_party/WebKit/LayoutTests/fast/selectors/style-sharing-last-child-expected.txt index 0183da5..750154c 100644 --- a/third_party/WebKit/LayoutTests/fast/selectors/style-sharing-last-child-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/selectors/style-sharing-last-child-expected.txt
@@ -1,3 +1,3 @@ You should see 1234 below (4 won't be visible in the DRT text dump, but it should still say PASS below) -1 2 3 +123 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/text/bidi-reverse-runs-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/text/bidi-reverse-runs-crash-expected.txt index 1434c039..f304caf8 100644 --- a/third_party/WebKit/LayoutTests/fast/text/bidi-reverse-runs-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/text/bidi-reverse-runs-crash-expected.txt
@@ -1,2 +1,2 @@ -sdf +sdf PASS if did not crash.
diff --git a/third_party/WebKit/LayoutTests/fast/text/whitespace/inline-whitespace-after-float-expected.html b/third_party/WebKit/LayoutTests/fast/text/whitespace/inline-whitespace-after-float-expected.html new file mode 100644 index 0000000..141bfb8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text/whitespace/inline-whitespace-after-float-expected.html
@@ -0,0 +1,3 @@ +<!DOCTYPE html> +<p>There should be a space between "Space" and "between" below.</p> +<div>Space between</div>
diff --git a/third_party/WebKit/LayoutTests/fast/text/whitespace/inline-whitespace-after-float.html b/third_party/WebKit/LayoutTests/fast/text/whitespace/inline-whitespace-after-float.html new file mode 100644 index 0000000..ff5b6ce --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text/whitespace/inline-whitespace-after-float.html
@@ -0,0 +1,6 @@ +<!DOCTYPE html> +<p>There should be a space between "Space" and "between" below.</p> +<div> + <div></div> + Space<span style="float: left;"></span> <span>between</span> +</div>
diff --git a/third_party/WebKit/LayoutTests/fast/text/whitespace/reattach-slotted-whitespace-expected.html b/third_party/WebKit/LayoutTests/fast/text/whitespace/reattach-slotted-whitespace-expected.html new file mode 100644 index 0000000..a17935b --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text/whitespace/reattach-slotted-whitespace-expected.html
@@ -0,0 +1,6 @@ +<!DOCTYPE html> +<p>There should be a space between every A and B.</p> +<div>A B</div> +<div>A B</div> +<div>A B</div> +<div>A B</div>
diff --git a/third_party/WebKit/LayoutTests/fast/text/whitespace/reattach-slotted-whitespace.html b/third_party/WebKit/LayoutTests/fast/text/whitespace/reattach-slotted-whitespace.html new file mode 100644 index 0000000..c9e8844 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text/whitespace/reattach-slotted-whitespace.html
@@ -0,0 +1,27 @@ +<!DOCTYPE html> +<p>There should be a space between every A and B.</p> +<div id="host1"> <span>B</span></div> +<div id="host2"><span style="position:absolute">A</span></div> +<div id="host3"><span slot="b">B</span> <span slot="a" style="position:absolute">A</span></div> +<div id="host4"><span style="display:contents"></span> <span>B</span></div> +<script> + var root1 = host1.attachShadow({mode:"open"}); + root1.innerHTML = '<span style="position:absolute">A</span><slot></slot>'; + host1.offsetTop; // Force layout tree generation. + root1.querySelector("span").style.position = "static"; + + var root2 = host2.attachShadow({mode:"open"}); + root2.innerHTML = "<slot></slot> <span>B</span>"; + host2.offsetTop; // Force layout tree generation. + host2.querySelector("span").style.position = "static"; + + var root3 = host3.attachShadow({mode:"open"}); + root3.innerHTML = '<slot name="a"></slot><slot></slot><slot name="b"></slot>'; + host3.offsetTop; // Force layout tree generation. + host3.querySelector("[slot=a]").style.position = "static"; + + var root4 = host4.attachShadow({mode:"open"}); + root4.innerHTML = '<div id="a">A</div><slot></slot>'; + host4.offsetTop; // Force layout tree generation. + root4.querySelector("#a").style.display = "inline"; +</script>
diff --git a/third_party/WebKit/LayoutTests/fast/text/word-break-next-linebox-not-dirty-crash-main-expected.txt b/third_party/WebKit/LayoutTests/fast/text/word-break-next-linebox-not-dirty-crash-main-expected.txt index 630c83f..c6f20fc 100644 --- a/third_party/WebKit/LayoutTests/fast/text/word-break-next-linebox-not-dirty-crash-main-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/text/word-break-next-linebox-not-dirty-crash-main-expected.txt
@@ -1 +1 @@ -Test passes if it does not crash. +Test passes if it does not crash.
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/absolute-position-change-containing-block-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/absolute-position-change-containing-block-expected.txt new file mode 100644 index 0000000..b07d34ae --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/absolute-position-change-containing-block-expected.txt
@@ -0,0 +1,32 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 2016], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow HTML", + "rect": [8, 8, 192, 192], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow BODY", + "reason": "style change" + }, + { + "object": "LayoutBlockFlow DIV id='container' class='fixed blue'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) DIV class='absolute green'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/background-misaligned-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/background-misaligned-expected.txt new file mode 100644 index 0000000..81413d3a --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/background-misaligned-expected.txt
@@ -0,0 +1,18 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) DIV id='target'", + "rect": [238, 241, 40, 40], + "reason": "disappeared" + } + ] + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/body-background-image-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/body-background-image-expected.txt new file mode 100644 index 0000000..6218a7b --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/body-background-image-expected.txt
@@ -0,0 +1,33 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutView #document", + "rect": [0, 0, 800, 600], + "reason": "style change" + }, + { + "object": "LayoutBlockFlow BODY", + "rect": [8, 240, 784, 288], + "reason": "style change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutView #document", + "reason": "style change" + }, + { + "object": "LayoutBlockFlow BODY", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/border-radius-repaint-2-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/border-radius-repaint-2-expected.txt new file mode 100644 index 0000000..6890805 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/border-radius-repaint-2-expected.txt
@@ -0,0 +1,46 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [874, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutView #document", + "rect": [0, 600, 874, 180], + "reason": "incremental" + }, + { + "object": "LayoutBlockFlow DIV", + "rect": [8, 8, 866, 764], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV", + "rect": [137, 88, 607, 604], + "reason": "geometry" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutView #document", + "reason": "incremental" + }, + { + "object": "LayoutBlockFlow BODY", + "reason": "incremental" + }, + { + "object": "LayoutBlockFlow DIV", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/border-repaint-glitch-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/border-repaint-glitch-expected.txt new file mode 100644 index 0000000..0c9ec5e --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/border-repaint-glitch-expected.txt
@@ -0,0 +1,51 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV", + "rect": [19, 349, 200, 88], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV", + "rect": [19, 187, 200, 88], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV id='b'", + "rect": [33, 403, 172, 20], + "reason": "incremental" + }, + { + "object": "LayoutBlockFlow DIV id='a'", + "rect": [33, 241, 172, 20], + "reason": "incremental" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV id='a'", + "reason": "incremental" + }, + { + "object": "LayoutBlockFlow DIV", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV id='b'", + "reason": "incremental" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/box-sizing-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/box-sizing-expected.txt new file mode 100644 index 0000000..7d428241 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/box-sizing-expected.txt
@@ -0,0 +1,33 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) DIV id='target2' class='border-box'", + "rect": [0, 200, 440, 140], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) DIV id='target1' class='content-box'", + "rect": [0, 0, 440, 140], + "reason": "geometry" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) DIV id='target1' class='content-box'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) DIV id='target2' class='border-box'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/bugzilla-5699-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/bugzilla-5699-expected.txt new file mode 100644 index 0000000..212aa8b --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/bugzilla-5699-expected.txt
@@ -0,0 +1,83 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox 'Hello'", + "rect": [8, 184, 35, 19], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'Hello'", + "rect": [8, 156, 35, 19], + "reason": "geometry" + }, + { + "object": "InlineTextBox '\u00A0'", + "rect": [8, 150, 4, 19], + "reason": "appeared" + }, + { + "object": "InlineTextBox '\u00A0'", + "rect": [8, 136, 4, 19], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow P", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutInline SPAN id='d'", + "reason": "style change" + }, + { + "object": "InlineFlowBox", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox '\u00A0'", + "reason": "style change" + }, + { + "object": "LayoutBR BR", + "reason": "geometry" + }, + { + "object": "InlineTextBox '\n'", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'Hello'", + "reason": "geometry" + }, + { + "object": "LayoutBR BR", + "reason": "geometry" + }, + { + "object": "InlineTextBox '\n'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/bugzilla-6473-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/bugzilla-6473-expected.txt new file mode 100644 index 0000000..92e4747e --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/bugzilla-6473-expected.txt
@@ -0,0 +1,50 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (relative positioned) P", + "rect": [8, 152, 784, 20], + "reason": "disappeared" + }, + { + "object": "LayoutBlockFlow (relative positioned) P", + "rect": [8, 136, 784, 20], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'SUCCESS'", + "rect": [8, 136, 71, 19], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='allcontent'", + "reason": "style change" + }, + { + "object": "LayoutBlockFlow (relative positioned) P", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'SUCCESS'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/caret-invalidation-in-overflow-scroll-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/caret-invalidation-in-overflow-scroll-expected.txt new file mode 100644 index 0000000..7de4778 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/caret-invalidation-in-overflow-scroll-expected.txt
@@ -0,0 +1,29 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "Caret", + "rect": [399, 11, 1, 16], + "reason": "caret" + }, + { + "object": "Caret", + "rect": [396, 11, 1, 16], + "reason": "caret" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "Caret", + "reason": "caret" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/caret-subpixel-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/caret-subpixel-expected.txt new file mode 100644 index 0000000..d90a0c32 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/caret-subpixel-expected.txt
@@ -0,0 +1,37 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutTextControl INPUT id='target'", + "rect": [8, 8, 224, 22], + "reason": "subtree" + }, + { + "object": "LayoutBlockFlow DIV id='inner-editor'", + "rect": [209, 11, 2, 16], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutTextControl INPUT id='target'", + "reason": "subtree" + }, + { + "object": "LayoutBlockFlow DIV id='inner-editor'", + "reason": "subtree" + }, + { + "object": "Caret", + "reason": "caret" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/compositing/text-color-change-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/compositing/text-color-change-expected.txt new file mode 100644 index 0000000..d43a134 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/compositing/text-color-change-expected.txt
@@ -0,0 +1,757 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "rect": [8, 61, 48, 185], + "reason": "style change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + }, + { + "object": "InlineTextBox ' Text'", + "reason": "style change" + }, + { + "object": "InlineTextBox '\n'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/compositing/text-match-highlight-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/compositing/text-match-highlight-expected.txt new file mode 100644 index 0000000..4b30e34 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/compositing/text-match-highlight-expected.txt
@@ -0,0 +1,119 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox 'Can you findme in this boring text?'", + "rect": [10, 135, 223, 19], + "reason": "DocumentMarker change" + }, + { + "object": "InlineTextBox 'Findme on a path! Did you findme?'", + "rect": [20, 224, 206, 72], + "reason": "DocumentMarker change" + }, + { + "object": "InlineTextBox 'Findme in a typewriter!'", + "rect": [10, 191, 138, 12], + "reason": "DocumentMarker change" + }, + { + "object": "InlineTextBox 'findme'", + "rect": [278, 40, 44, 19], + "reason": "DocumentMarker change" + }, + { + "object": "InlineTextBox 'findme'", + "rect": [264, 60, 44, 19], + "reason": "DocumentMarker change" + }, + { + "object": "InlineTextBox 'findme'", + "rect": [220, 60, 44, 19], + "reason": "DocumentMarker change" + }, + { + "object": "InlineTextBox 'findme'", + "rect": [89, 60, 44, 19], + "reason": "DocumentMarker change" + }, + { + "object": "InlineTextBox 'findme'", + "rect": [51, 80, 44, 19], + "reason": "DocumentMarker change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutText #text", + "reason": "DocumentMarker change" + }, + { + "object": "InlineTextBox 'findme'", + "reason": "DocumentMarker change" + }, + { + "object": "LayoutText #text", + "reason": "DocumentMarker change" + }, + { + "object": "InlineTextBox 'findme'", + "reason": "DocumentMarker change" + }, + { + "object": "LayoutText #text", + "reason": "DocumentMarker change" + }, + { + "object": "InlineTextBox 'findme'", + "reason": "DocumentMarker change" + }, + { + "object": "LayoutText #text", + "reason": "DocumentMarker change" + }, + { + "object": "InlineTextBox 'findme'", + "reason": "DocumentMarker change" + }, + { + "object": "LayoutText #text", + "reason": "DocumentMarker change" + }, + { + "object": "InlineTextBox 'findme'", + "reason": "DocumentMarker change" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "DocumentMarker change" + }, + { + "object": "InlineTextBox 'Can you findme in this boring text?'", + "reason": "DocumentMarker change" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "DocumentMarker change" + }, + { + "object": "InlineTextBox 'Findme in a typewriter!'", + "reason": "DocumentMarker change" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "DocumentMarker change" + }, + { + "object": "InlineTextBox 'Findme on a path! Did you findme?'", + "reason": "DocumentMarker change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.txt new file mode 100644 index 0000000..0113aac --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.txt
@@ -0,0 +1,169 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox 'CONTENT'", + "rect": [8, 258, 77, 19], + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "rect": [8, 238, 77, 19], + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "rect": [8, 218, 77, 19], + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "rect": [8, 198, 77, 19], + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "rect": [8, 178, 77, 19], + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "rect": [8, 158, 77, 19], + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "rect": [8, 138, 77, 19], + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "rect": [8, 118, 77, 19], + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "rect": [8, 278, 77, 15], + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "rect": [8, 108, 77, 9], + "reason": "style change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'CONTENT'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/compositing/updating-scrolling-container-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/compositing/updating-scrolling-container-expected.txt new file mode 100644 index 0000000..82b5c97a --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/compositing/updating-scrolling-container-expected.txt
@@ -0,0 +1,29 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='container'", + "rect": [8, 108, 210, 210], + "reason": "style change" + }, + { + "object": "LayoutBlockFlow DIV id='container'", + "rect": [8, 108, 210, 210], + "reason": "style change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='container'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/control-clip-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/control-clip-expected.txt new file mode 100644 index 0000000..2f63dde --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/control-clip-expected.txt
@@ -0,0 +1,67 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox 'SUCCESS'", + "rect": [76, 117, 64, 16], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'SUCCESS'", + "rect": [9, 87, 63, 16], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'FAILURE'", + "rect": [80, 117, 56, 16], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'FAILURE'", + "rect": [9, 87, 55, 16], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow (anonymous)", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutText (anonymous)", + "reason": "full" + }, + { + "object": "InlineTextBox 'SUCCESS'", + "reason": "full" + }, + { + "object": "LayoutBlockFlow (anonymous)", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "full" + }, + { + "object": "InlineTextBox 'SUCCESS'", + "reason": "full" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/destroy-overlay-scrollbar-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/destroy-overlay-scrollbar-expected.txt new file mode 100644 index 0000000..d8a9ce2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/destroy-overlay-scrollbar-expected.txt
@@ -0,0 +1,24 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) DIV", + "rect": [193, 100, 7, 200], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "VerticalScrollbar", + "reason": "scroll control" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/destroy-scrollbar-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/destroy-scrollbar-expected.txt new file mode 100644 index 0000000..c22897313 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/destroy-scrollbar-expected.txt
@@ -0,0 +1,28 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) DIV", + "rect": [185, 100, 15, 200], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "VerticalScrollbar", + "reason": "scroll control" + }, + { + "object": "LayoutBlockFlow (positioned) DIV", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/details-open-repaint-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/details-open-repaint-expected.txt index 4b89491..fc081e3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/details-open-repaint-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/details-open-repaint-expected.txt
@@ -61,10 +61,6 @@ { "object": "LayoutText #text", "reason": "appeared" - }, - { - "object": "LayoutText #text", - "reason": "appeared" } ] }
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/filter-invalidation-after-display-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/filter-invalidation-after-display-expected.txt new file mode 100644 index 0000000..7676c842 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/filter-invalidation-after-display-expected.txt
@@ -0,0 +1,29 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) DIV id='box' class='green drop-shadowed box'", + "rect": [300, 8, 330, 330], + "reason": "paint property change" + }, + { + "object": "LayoutBlockFlow (positioned) DIV id='box' class='green box'", + "rect": [300, 8, 200, 200], + "reason": "paint property change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) DIV id='box' class='green box'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/flexbox/repaint-rtl-column-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/flexbox/repaint-rtl-column-expected.txt new file mode 100644 index 0000000..e830390 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/flexbox/repaint-rtl-column-expected.txt
@@ -0,0 +1,79 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='content'", + "rect": [8, 116, 200, 252], + "reason": "style change" + }, + { + "object": "LayoutBlockFlow DIV id='content'", + "rect": [8, 119, 200, 249], + "reason": "style change" + }, + { + "object": "LayoutBlockFlow DIV id='left'", + "rect": [8, 68, 200, 145], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV id='left'", + "rect": [8, 68, 200, 52], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV", + "rect": [13, 124, 190, 351], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV", + "rect": [13, 124, 190, 351], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV", + "rect": [13, 121, 190, 351], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV", + "rect": [13, 218, 190, 350], + "reason": "geometry" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='left'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV id='content'", + "reason": "style change" + }, + { + "object": "LayoutBlockFlow DIV", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV id='left'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV id='content'", + "reason": "style change" + }, + { + "object": "LayoutBlockFlow DIV", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/inline-outline-repaint-2-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/inline-outline-repaint-2-expected.txt new file mode 100644 index 0000000..2437747 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/inline-outline-repaint-2-expected.txt
@@ -0,0 +1,42 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "position": [0, -5], + "bounds": [800, 605], + "contentsOpaque": false, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutInline SPAN", + "rect": [210, 0, 50, 20], + "reason": "outline" + }, + { + "object": "InlineTextBox 'Test'", + "rect": [215, 5, 40, 10], + "reason": "style change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutInline SPAN", + "reason": "outline" + }, + { + "object": "InlineFlowBox", + "reason": "outline" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'Test'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/inline-style-change-in-scrolled-view-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/inline-style-change-in-scrolled-view-expected.txt new file mode 100644 index 0000000..c48f2f5e --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/inline-style-change-in-scrolled-view-expected.txt
@@ -0,0 +1,28 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [2000, 2000], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox 'Text Text Text Text Text Text Text Text Text Text Text Text Text'", + "rect": [0, 320, 411, 19], + "reason": "style change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'Text Text Text Text Text Text Text Text Text Text Text Text Text'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/invalidate-invisible-element-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/invalidate-invisible-element-expected.txt new file mode 100644 index 0000000..9cb2e74 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/invalidate-invisible-element-expected.txt
@@ -0,0 +1,17 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) DIV id='target'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/layer-hide-when-needs-layout-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/layer-hide-when-needs-layout-expected.txt new file mode 100644 index 0000000..f730811a --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/layer-hide-when-needs-layout-expected.txt
@@ -0,0 +1,24 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) DIV id='target'", + "rect": [8, 8, 100, 100], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) DIV id='target'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/layout-state-scrolloffset3-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/layout-state-scrolloffset3-expected.txt new file mode 100644 index 0000000..ad5adbb --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/layout-state-scrolloffset3-expected.txt
@@ -0,0 +1,41 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox 'before'", + "rect": [100, 120, 34, 19], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'after'", + "rect": [100, 120, 29, 19], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='target'", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "full" + }, + { + "object": "InlineTextBox 'after'", + "reason": "full" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/layoutstate-invalid-invalidation-inline-relative-positioned-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/layoutstate-invalid-invalidation-inline-relative-positioned-expected.txt new file mode 100644 index 0000000..f32dc1b --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/layoutstate-invalid-invalidation-inline-relative-positioned-expected.txt
@@ -0,0 +1,73 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV", + "rect": [8, 220, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutBlockFlow DIV", + "rect": [8, 200, 100, 100], + "reason": "paint property change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow (anonymous)", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutInline (relative positioned) SPAN", + "reason": "geometry" + }, + { + "object": "InlineFlowBox", + "reason": "geometry" + }, + { + "object": "LayoutInline (relative positioned) SPAN id='target'", + "reason": "geometry" + }, + { + "object": "InlineFlowBox", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'x'", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/line-flow-with-floats-3-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/line-flow-with-floats-3-expected.txt new file mode 100644 index 0000000..fb563f0e --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/line-flow-with-floats-3-expected.txt
@@ -0,0 +1,473 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox 'Alice began to feel very uneasy: to be sure, she had not as\n'", + "rect": [13, 520, 408, 80], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Alice began to feel very uneasy: to be sure, she had not as\n'", + "rect": [13, 520, 408, 80], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'become of\n'", + "rect": [13, 520, 408, 80], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'become of\n'", + "rect": [13, 520, 408, 80], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'had any dispute with the Queen, but she knew that it might'", + "rect": [13, 520, 408, 80], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'had any dispute with the Queen, but she knew that it might'", + "rect": [13, 520, 408, 80], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'happen any minute, \u2018and then,\u2019 thought she, \u2018what would'", + "rect": [13, 520, 408, 80], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'happen any minute, \u2018and then,\u2019 thought she, \u2018what would'", + "rect": [13, 520, 408, 80], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'here; the great\n'", + "rect": [13, 520, 408, 80], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'here; the great\n'", + "rect": [13, 520, 408, 80], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'me? They\u2019re dreadfully fond of beheading people'", + "rect": [13, 520, 408, 80], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'me? They\u2019re dreadfully fond of beheading people'", + "rect": [13, 520, 408, 80], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'wonder is, that there\u2018s any one left alive!\u2019'", + "rect": [13, 520, 408, 80], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'wonder is, that there\u2018s any one left alive!\u2019'", + "rect": [13, 520, 408, 80], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'yet'", + "rect": [13, 520, 408, 80], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'yet'", + "rect": [13, 520, 408, 80], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'a ridge or furrow in the way wherever\n'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'begin again, it was very'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'getting up and walking off to other parts of\n'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'hedgehog to, and, as the doubled-up\n'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'in the act of crawling away: besides all\n'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'provoking to find that the hedgehog had\n'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'she wanted to send the'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'soldiers were always'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'soon came to the conclusion that it was a very\n'", + "rect": [13, 240, 407, 139], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'soon came to the conclusion that it was a very\n'", + "rect": [13, 240, 407, 139], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'the ground, Alice'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'this, there was generally'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'unrolled itself, and was'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'a very short time '", + "rect": [14, 400, 406, 59], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'for turns,'", + "rect": [14, 400, 406, 59], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'hedgehogs; and in\n'", + "rect": [14, 400, 406, 59], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'quarrelling all the while, and fighting for the'", + "rect": [14, 400, 406, 59], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'difficult'", + "rect": [65, 360, 356, 39], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'difficult'", + "rect": [65, 360, 356, 39], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'game indeed.\n'", + "rect": [65, 360, 356, 39], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'game indeed.\n'", + "rect": [65, 360, 356, 39], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'about once in a minute.\n'", + "rect": [14, 460, 355, 59], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'her head!\u2019'", + "rect": [14, 460, 355, 59], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'shouting \u2018Off with his head!\u2019 or \u2018Off with\n'", + "rect": [14, 460, 355, 59], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'stamping about, and'", + "rect": [14, 460, 355, 59], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'was in a furious passion, and went\n'", + "rect": [14, 460, 355, 59], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'a very short time '", + "rect": [14, 420, 355, 39], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'for the hedgehogs; and in\n'", + "rect": [14, 420, 355, 39], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'for turns,\n'", + "rect": [14, 420, 355, 39], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'quarrelling all the while, and fighting'", + "rect": [14, 420, 355, 39], + "reason": "disappeared" + }, + { + "object": "InlineTextBox ' was in'", + "rect": [14, 440, 339, 79], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'a furious passion, and went\n'", + "rect": [14, 440, 339, 79], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'about once in a minute.\n'", + "rect": [14, 440, 339, 79], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'her head!\u2019'", + "rect": [14, 440, 339, 79], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'shouting \u2018Off with his head!\u2019 or \u2018Off with\n'", + "rect": [14, 440, 339, 79], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'stamping about, and'", + "rect": [14, 440, 339, 79], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'The players all played at once without waiting'", + "rect": [65, 400, 304, 19], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'The players all played at once without waiting\n'", + "rect": [65, 400, 298, 19], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'the Queen'", + "rect": [302, 440, 66, 19], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'the Queen'", + "rect": [242, 440, 65, 19], + "reason": "appeared" + }, + { + "object": "LayoutBlockFlow (floating) SPAN id='greenFloat'", + "rect": [356, 423, 64, 81], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (floating) SPAN id='greenFloat'", + "rect": [372, 403, 48, 81], + "reason": "geometry" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'begin again, it was very'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'provoking to find that the hedgehog had\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'unrolled itself, and was'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'in the act of crawling away: besides all\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'this, there was generally'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'a ridge or furrow in the way wherever\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'she wanted to send the'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'hedgehog to, and, as the doubled-up\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'soldiers were always'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'getting up and walking off to other parts of\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'the ground, Alice'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'soon came to the conclusion that it was a very\n'", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'difficult'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'game indeed.\n'", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'The players all played at once without waiting\n'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (floating) SPAN id='greenFloat'", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'for turns,'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'quarrelling all the while, and fighting for the'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'hedgehogs; and in\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'a very short time '", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'the Queen'", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox ' was in'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'a furious passion, and went\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'stamping about, and'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'shouting \u2018Off with his head!\u2019 or \u2018Off with\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'her head!\u2019'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'about once in a minute.\n'", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'Alice began to feel very uneasy: to be sure, she had not as\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'yet'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'had any dispute with the Queen, but she knew that it might'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'happen any minute, \u2018and then,\u2019 thought she, \u2018what would'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'become of\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'me? They\u2019re dreadfully fond of beheading people'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'here; the great\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'wonder is, that there\u2018s any one left alive!\u2019'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/line-flow-with-floats-5-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/line-flow-with-floats-5-expected.txt new file mode 100644 index 0000000..5051fe67 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/line-flow-with-floats-5-expected.txt
@@ -0,0 +1,497 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox 'Alice began to feel very uneasy: to be sure, she had not as\n'", + "rect": [13, 520, 408, 80], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Alice began to feel very uneasy: to be sure, she had not as\n'", + "rect": [13, 520, 408, 80], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'become of\n'", + "rect": [13, 520, 408, 80], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'become of\n'", + "rect": [13, 520, 408, 80], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'had any dispute with the Queen, but she knew that it might'", + "rect": [13, 520, 408, 80], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'had any dispute with the Queen, but she knew that it might'", + "rect": [13, 520, 408, 80], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'happen any minute, \u2018and then,\u2019 thought she, \u2018what would'", + "rect": [13, 520, 408, 80], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'happen any minute, \u2018and then,\u2019 thought she, \u2018what would'", + "rect": [13, 520, 408, 80], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'here; the great\n'", + "rect": [13, 520, 408, 80], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'here; the great\n'", + "rect": [13, 520, 408, 80], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'me? They\u2019re dreadfully fond of beheading people'", + "rect": [13, 520, 408, 80], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'me? They\u2019re dreadfully fond of beheading people'", + "rect": [13, 520, 408, 80], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'wonder is, that there\u2018s any one left alive!\u2019'", + "rect": [13, 520, 408, 80], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'wonder is, that there\u2018s any one left alive!\u2019'", + "rect": [13, 520, 408, 80], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'yet'", + "rect": [13, 520, 408, 80], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'yet'", + "rect": [13, 520, 408, 80], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'a ridge or furrow in the way wherever\n'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'begin again, it was very'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'getting up and walking off to other parts of\n'", + "rect": [13, 240, 407, 139], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'getting up and walking off to other parts of\n'", + "rect": [13, 240, 407, 139], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'hedgehog to, and, as the doubled-up\n'", + "rect": [13, 240, 407, 139], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'hedgehog to, and, as the doubled-up\n'", + "rect": [13, 240, 407, 139], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'in the act of crawling away: besides all\n'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'provoking to find that the hedgehog had\n'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'she wanted to send the'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'soldiers were always'", + "rect": [13, 240, 407, 139], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'soldiers were always'", + "rect": [13, 240, 407, 139], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'soon came to the conclusion that it was a very\n'", + "rect": [13, 240, 407, 139], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'soon came to the conclusion that it was a very\n'", + "rect": [13, 240, 407, 139], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'the ground, Alice'", + "rect": [13, 240, 407, 139], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'the ground, Alice'", + "rect": [13, 240, 407, 139], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'this, there was generally'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'unrolled itself, and was'", + "rect": [13, 240, 407, 139], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'difficult'", + "rect": [49, 360, 372, 39], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'game indeed.\n'", + "rect": [49, 360, 372, 39], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'a very short time '", + "rect": [14, 400, 356, 59], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'for'", + "rect": [14, 400, 356, 59], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'hedgehogs; and in\n'", + "rect": [14, 400, 356, 59], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'quarrelling all the while, and fighting for the'", + "rect": [14, 400, 356, 59], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'turns,\n'", + "rect": [14, 400, 356, 59], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'difficult'", + "rect": [65, 360, 356, 39], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'game indeed.\n'", + "rect": [65, 360, 356, 39], + "reason": "disappeared" + }, + { + "object": "InlineTextBox ' was in a'", + "rect": [14, 440, 355, 79], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'furious passion, and went\n'", + "rect": [14, 440, 355, 79], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'her head!\u2019 about once'", + "rect": [14, 440, 355, 79], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'in a minute.\n'", + "rect": [14, 440, 355, 79], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'stamping about, and shouting'", + "rect": [14, 440, 355, 79], + "reason": "appeared" + }, + { + "object": "InlineTextBox '\u2018Off with his head!\u2019 or \u2018Off with\n'", + "rect": [14, 440, 355, 79], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'about once in a minute.\n'", + "rect": [14, 460, 355, 59], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'her head!\u2019'", + "rect": [14, 460, 355, 59], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'shouting \u2018Off with his head!\u2019 or \u2018Off with\n'", + "rect": [14, 460, 355, 59], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'stamping about, and'", + "rect": [14, 460, 355, 59], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'was in a furious passion, and went\n'", + "rect": [14, 460, 355, 59], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'a very short time '", + "rect": [14, 420, 355, 39], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'for the hedgehogs; and in\n'", + "rect": [14, 420, 355, 39], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'for turns,\n'", + "rect": [14, 420, 355, 39], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'quarrelling all the while, and fighting'", + "rect": [14, 420, 355, 39], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'The players all played at once without waiting'", + "rect": [65, 400, 304, 19], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'The players all played at once without waiting\n'", + "rect": [49, 400, 302, 19], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'the Queen'", + "rect": [302, 440, 66, 19], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'the Queen'", + "rect": [245, 440, 65, 19], + "reason": "appeared" + }, + { + "object": "LayoutBlockFlow (floating) SPAN id='blueFloat'", + "rect": [14, 363, 48, 65], + "reason": "geometry" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'begin again, it was very'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'provoking to find that the hedgehog had\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'unrolled itself, and was'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'in the act of crawling away: besides all\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'this, there was generally'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'a ridge or furrow in the way wherever\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'she wanted to send the'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'hedgehog to, and, as the doubled-up\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'soldiers were always'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'getting up and walking off to other parts of\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'the ground, Alice'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'soon came to the conclusion that it was a very\n'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (floating) SPAN id='blueFloat'", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'difficult'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'game indeed.\n'", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'The players all played at once without waiting\n'", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'for'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'turns,\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'quarrelling all the while, and fighting for the'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'hedgehogs; and in\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'a very short time '", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'the Queen'", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox ' was in a'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'furious passion, and went\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'stamping about, and shouting'", + "reason": "geometry" + }, + { + "object": "InlineTextBox '\u2018Off with his head!\u2019 or \u2018Off with\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'her head!\u2019 about once'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'in a minute.\n'", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'Alice began to feel very uneasy: to be sure, she had not as\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'yet'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'had any dispute with the Queen, but she knew that it might'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'happen any minute, \u2018and then,\u2019 thought she, \u2018what would'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'become of\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'me? They\u2019re dreadfully fond of beheading people'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'here; the great\n'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'wonder is, that there\u2018s any one left alive!\u2019'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/non-text-link-invalidation-optimization-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/non-text-link-invalidation-optimization-expected.txt new file mode 100644 index 0000000..4937ab4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/non-text-link-invalidation-optimization-expected.txt
@@ -0,0 +1,93 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox ' text is invalidated and '", + "rect": [164, 8, 145, 19], + "reason": "style change" + }, + { + "object": "InlineTextBox ' passes if '", + "rect": [75, 8, 61, 19], + "reason": "style change" + }, + { + "object": "InlineTextBox 'This test '", + "rect": [8, 8, 57, 19], + "reason": "style change" + }, + { + "object": "InlineTextBox ' images.'", + "rect": [353, 8, 52, 19], + "reason": "style change" + }, + { + "object": "InlineTextBox 'only'", + "rect": [136, 8, 28, 19], + "reason": "style change" + }, + { + "object": "InlineTextBox ' no '", + "rect": [319, 8, 24, 19], + "reason": "style change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'This test '", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox ' passes if '", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'only'", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox ' text is invalidated and '", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox ' no '", + "reason": "style change" + }, + { + "object": "LayoutText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox ' images.'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/overflow-auto-in-overflow-auto-scrolled-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/overflow-auto-in-overflow-auto-scrolled-expected.txt new file mode 100644 index 0000000..628a84d --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/overflow-auto-in-overflow-auto-scrolled-expected.txt
@@ -0,0 +1,41 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='innerDiv'", + "rect": [8, 8, 300, 300], + "reason": "paint property change" + }, + { + "object": "VerticalScrollbar", + "rect": [762, 8, 15, 300], + "reason": "scroll control" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='innerDiv'", + "reason": "subtree" + }, + { + "object": "VerticalScrollbar", + "reason": "scroll control" + }, + { + "object": "LayoutBlockFlow DIV", + "reason": "subtree" + }, + { + "object": "LayoutBlockFlow DIV", + "reason": "subtree" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/overflow-hide-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/overflow-hide-expected.txt new file mode 100644 index 0000000..cbe2965 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/overflow-hide-expected.txt
@@ -0,0 +1,29 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 2016], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (relative positioned) DIV class='relative red'", + "rect": [108, 108, 100, 100], + "reason": "disappeared" + }, + { + "object": "LayoutBlockFlow (positioned) DIV id='overflowParent' class='absolute green'", + "rect": [8, 8, 100, 100], + "reason": "style change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) DIV id='overflowParent' class='absolute green'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/overflow-scroll-delete-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/overflow-scroll-delete-expected.txt new file mode 100644 index 0000000..f3f2f20d --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/overflow-scroll-delete-expected.txt
@@ -0,0 +1,47 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox 'Passed'", + "rect": [8, 136, 44, 17], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Test'", + "rect": [8, 136, 44, 17], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Failed'", + "rect": [8, 136, 40, 17], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'Test'", + "rect": [8, 136, 40, 17], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutText #text", + "reason": "full" + }, + { + "object": "InlineTextBox 'Passed'", + "reason": "full" + }, + { + "object": "InlineTextBox 'Test'", + "reason": "full" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/overflow-scroll-in-overflow-scroll-scrolled-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/overflow-scroll-in-overflow-scroll-scrolled-expected.txt new file mode 100644 index 0000000..628a84d --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/overflow-scroll-in-overflow-scroll-scrolled-expected.txt
@@ -0,0 +1,41 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='innerDiv'", + "rect": [8, 8, 300, 300], + "reason": "paint property change" + }, + { + "object": "VerticalScrollbar", + "rect": [762, 8, 15, 300], + "reason": "scroll control" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='innerDiv'", + "reason": "subtree" + }, + { + "object": "VerticalScrollbar", + "reason": "scroll control" + }, + { + "object": "LayoutBlockFlow DIV", + "reason": "subtree" + }, + { + "object": "LayoutBlockFlow DIV", + "reason": "subtree" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/paint-caret-in-div-with-negative-indent-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/paint-caret-in-div-with-negative-indent-expected.txt new file mode 100644 index 0000000..04825bb --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/paint-caret-in-div-with-negative-indent-expected.txt
@@ -0,0 +1,24 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "Caret", + "rect": [358, 200, 1, 20], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "Caret", + "reason": "caret" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/position-change-keeping-geometry-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/position-change-keeping-geometry-expected.txt new file mode 100644 index 0000000..f700373f --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/position-change-keeping-geometry-expected.txt
@@ -0,0 +1,11 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/positioned-document-element-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/positioned-document-element-expected.txt new file mode 100644 index 0000000..e78cf794 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/positioned-document-element-expected.txt
@@ -0,0 +1,58 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutView #document", + "rect": [0, 0, 800, 600], + "reason": "style change" + }, + { + "object": "InlineTextBox 'Tests that the entire viewport is painted with a floated html element.'", + "rect": [108, 116, 424, 19], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Tests that the entire viewport is painted with a floated html element.'", + "rect": [8, 16, 424, 19], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutView #document", + "reason": "style change" + }, + { + "object": "LayoutBlockFlow (positioned) HTML class='changed'", + "reason": "style change" + }, + { + "object": "LayoutBlockFlow BODY", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow P", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'Tests that the entire viewport is painted with a floated html element.'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/relative-margin-change-repaint-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/relative-margin-change-repaint-expected.txt new file mode 100644 index 0000000..d8e6cbc --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/relative-margin-change-repaint-expected.txt
@@ -0,0 +1,37 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (relative positioned) DIV id='test'", + "rect": [0, 60, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (relative positioned) DIV id='test'", + "rect": [0, 40, 100, 100], + "reason": "geometry" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow BODY", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (relative positioned) DIV id='container'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (relative positioned) DIV id='test'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/repaint-resized-overflow-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/repaint-resized-overflow-expected.txt new file mode 100644 index 0000000..c9c6c17 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/repaint-resized-overflow-expected.txt
@@ -0,0 +1,29 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV", + "rect": [8, 156, 108, 108], + "reason": "paint property change" + }, + { + "object": "LayoutBlockFlow DIV", + "rect": [8, 156, 108, 56], + "reason": "paint property change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='s'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/requestAnimation-translation-leave-traces-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/requestAnimation-translation-leave-traces-expected.txt new file mode 100644 index 0000000..993db15 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/requestAnimation-translation-leave-traces-expected.txt
@@ -0,0 +1,56 @@ +This test checks that changing the transform on an element triggers a correct invalidation. +The paint invalidations below should match the transformed element's coordinates. +Tested locations: 1200,1500 +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [1600, 585], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutView #document", + "rect": [1300, 0, 300, 585], + "reason": "incremental" + }, + { + "object": "LayoutView #document", + "rect": [1000, 0, 300, 585], + "reason": "incremental" + }, + { + "object": "LayoutBlockFlow DIV id='box'", + "rect": [1500, 0, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutBlockFlow DIV id='box'", + "rect": [1200, 0, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutBlockFlow DIV id='box'", + "rect": [1200, 0, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutBlockFlow DIV id='box'", + "rect": [900, 0, 100, 100], + "reason": "paint property change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutView #document", + "reason": "incremental" + }, + { + "object": "LayoutView #document", + "reason": "incremental" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/resize-iframe-text-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/resize-iframe-text-expected.txt new file mode 100644 index 0000000..a756173 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/resize-iframe-text-expected.txt
@@ -0,0 +1,50 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [500, 400], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutView #document", + "rect": [0, 200, 500, 200], + "reason": "incremental" + }, + { + "object": "LayoutBlockFlow HTML", + "rect": [8, 300, 60, 22], + "reason": "paint property change" + }, + { + "object": "LayoutView #document", + "rect": [485, 0, 15, 200], + "reason": "disappeared" + }, + { + "object": "LayoutBlockFlow HTML", + "reason": "paint property change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutView #document", + "reason": "incremental" + }, + { + "object": "LayoutIFrame (positioned) IFRAME", + "reason": "incremental" + }, + { + "object": "VerticalScrollbar", + "reason": "scroll control" + }, + { + "object": "LayoutView #document", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/resize-scrollable-div-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/resize-scrollable-div-expected.txt new file mode 100644 index 0000000..386c026 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/resize-scrollable-div-expected.txt
@@ -0,0 +1,60 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='div'", + "rect": [8, 108, 300, 300], + "reason": "geometry" + }, + { + "object": "HorizontalScrollbar", + "rect": [8, 393, 285, 15], + "reason": "scroll control" + }, + { + "object": "HorizontalScrollbar", + "rect": [8, 193, 85, 15], + "reason": "scroll control" + }, + { + "object": "VerticalScrollbar", + "rect": [293, 108, 15, 285], + "reason": "scroll control" + }, + { + "object": "VerticalScrollbar", + "rect": [93, 108, 15, 85], + "reason": "scroll control" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='div'", + "reason": "incremental" + }, + { + "object": "LayoutBlockFlow DIV id='div'", + "reason": "geometry" + }, + { + "object": "HorizontalScrollbar", + "reason": "scroll control" + }, + { + "object": "LayoutBlockFlow DIV id='div'", + "reason": "geometry" + }, + { + "object": "VerticalScrollbar", + "reason": "scroll control" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scroll-in-transformed-layer-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scroll-in-transformed-layer-expected.png new file mode 100644 index 0000000..53f8671 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scroll-in-transformed-layer-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scroll-in-transformed-layer-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scroll-in-transformed-layer-expected.txt new file mode 100644 index 0000000..55766da --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scroll-in-transformed-layer-expected.txt
@@ -0,0 +1,37 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 2016], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) DIV class='absolute green'", + "rect": [79, 129, 142, 142], + "reason": "appeared" + }, + { + "object": "LayoutBlockFlow (positioned) DIV class='absolute red'", + "rect": [100, 150, 100, 100], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) DIV id='moveMe' class='absolute clipped rotated'", + "reason": "subtree" + }, + { + "object": "LayoutBlockFlow (positioned) DIV class='absolute green'", + "reason": "subtree" + }, + { + "object": "LayoutBlockFlow (positioned) DIV class='absolute red'", + "reason": "subtree" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scroll-with-transformed-parent-layer-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scroll-with-transformed-parent-layer-expected.png new file mode 100644 index 0000000..53f8671 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scroll-with-transformed-parent-layer-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scroll-with-transformed-parent-layer-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scroll-with-transformed-parent-layer-expected.txt new file mode 100644 index 0000000..392a26fc --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scroll-with-transformed-parent-layer-expected.txt
@@ -0,0 +1,37 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 2016], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) DIV class='absolute green'", + "rect": [79, 129, 142, 142], + "reason": "appeared" + }, + { + "object": "LayoutBlockFlow (positioned) DIV class='absolute red'", + "rect": [79, 129, 142, 142], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) DIV id='moveMe' class='absolute clipped'", + "reason": "subtree" + }, + { + "object": "LayoutBlockFlow (positioned) DIV class='absolute green'", + "reason": "subtree" + }, + { + "object": "LayoutBlockFlow (positioned) DIV class='absolute red'", + "reason": "subtree" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scrollbar-damage-and-full-viewport-repaint-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scrollbar-damage-and-full-viewport-repaint-expected.txt new file mode 100644 index 0000000..469e87c --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scrollbar-damage-and-full-viewport-repaint-expected.txt
@@ -0,0 +1,24 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [1000, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "HorizontalScrollbar", + "rect": [1, 236, 185, 15], + "reason": "scroll control" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "HorizontalScrollbar", + "reason": "scroll control" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scrollbar-parts-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scrollbar-parts-expected.txt new file mode 100644 index 0000000..11d1451f --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/scrollbar-parts-expected.txt
@@ -0,0 +1,33 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "HorizontalScrollbar", + "rect": [8, 93, 85, 15], + "reason": "scroll control" + }, + { + "object": "VerticalScrollbar", + "rect": [93, 8, 15, 85], + "reason": "scroll control" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "HorizontalScrollbar", + "reason": "scroll control" + }, + { + "object": "VerticalScrollbar", + "reason": "scroll control" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-after-delete-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-after-delete-expected.png new file mode 100644 index 0000000..fc9ab11 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-after-delete-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-after-delete-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-after-delete-expected.txt new file mode 100644 index 0000000..b74c6577 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-after-delete-expected.txt
@@ -0,0 +1,90 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox ' '", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "InlineTextBox ' '", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "InlineTextBox ' '", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "InlineTextBox ' '", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'hello world hello world'", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'hello world hello world'", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'hello world hello world'", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'hello world hello world'", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'hello'", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "LayoutBlockFlow DIV id='test'", + "rect": [38, 78, 152, 102], + "reason": "geometry" + }, + { + "object": "Caret", + "rect": [39, 79, 1, 19], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='test'", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "Caret", + "reason": "caret" + }, + { + "object": "LayoutBR BR", + "reason": "geometry" + }, + { + "object": "InlineTextBox '\n'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-after-remove-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-after-remove-expected.png new file mode 100644 index 0000000..3979e23 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-after-remove-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-after-remove-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-after-remove-expected.txt new file mode 100644 index 0000000..37e7d3f3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-after-remove-expected.txt
@@ -0,0 +1,117 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox ' '", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "InlineTextBox ' '", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "InlineTextBox ' '", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "InlineTextBox ' '", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'hello world hello world'", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'hello world hello world'", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'hello world hello world'", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'hello'", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'world hello world'", + "rect": [39, 79, 154, 99], + "reason": "disappeared" + }, + { + "object": "LayoutBlockFlow DIV id='test'", + "rect": [38, 78, 152, 102], + "reason": "geometry" + }, + { + "object": "InlineTextBox ' world'", + "rect": [70, 158, 42, 20], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'world'", + "rect": [74, 79, 38, 19], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'hello '", + "rect": [39, 79, 35, 19], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'hello '", + "rect": [39, 79, 35, 19], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='test'", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'hello '", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'world'", + "reason": "geometry" + }, + { + "object": "LayoutBR BR", + "reason": "geometry" + }, + { + "object": "InlineTextBox '\n'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-partial-invalidation-between-blocks-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-partial-invalidation-between-blocks-expected.txt new file mode 100644 index 0000000..8715f384 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-partial-invalidation-between-blocks-expected.txt
@@ -0,0 +1,61 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox 'Second cell'", + "rect": [11, 35, 77, 19], + "reason": "geometry" + }, + { + "object": "InlineTextBox 'First cell'", + "rect": [11, 11, 58, 19], + "reason": "geometry" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow HTML", + "reason": "selection" + }, + { + "object": "LayoutBlockFlow BODY", + "reason": "selection" + }, + { + "object": "LayoutTable TABLE", + "reason": "selection" + }, + { + "object": "LayoutTableCell TD id='firstCell'", + "reason": "selection" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'First cell'", + "reason": "geometry" + }, + { + "object": "LayoutTableCell TD id='secondCell'", + "reason": "selection" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'Second cell'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-rl-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-rl-expected.txt new file mode 100644 index 0000000..fcf99df --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection-rl-expected.txt
@@ -0,0 +1,36 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox 'Testing both hit testing'", + "rect": [773, 8, 19, 143], + "reason": "selection" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow HTML", + "reason": "selection" + }, + { + "object": "LayoutBlockFlow BODY", + "reason": "selection" + }, + { + "object": "LayoutText #text", + "reason": "selection" + }, + { + "object": "InlineTextBox 'Testing both hit testing'", + "reason": "selection" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt new file mode 100644 index 0000000..6e523a4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt
@@ -0,0 +1,66 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox 'b'", + "rect": [8, 24, 16, 17], + "reason": "selection" + }, + { + "object": "InlineTextBox 'a'", + "rect": [8, 8, 16, 17], + "reason": "selection" + }, + { + "object": "InlineTextBox '\n'", + "rect": [24, 8, 16, 16], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow HTML", + "reason": "selection" + }, + { + "object": "LayoutBlockFlow BODY", + "reason": "selection" + }, + { + "object": "LayoutBlockFlow DIV id='container'", + "reason": "selection" + }, + { + "object": "LayoutText #text", + "reason": "selection" + }, + { + "object": "InlineTextBox 'a'", + "reason": "selection" + }, + { + "object": "LayoutBR BR", + "reason": "appeared" + }, + { + "object": "InlineTextBox '\n'", + "reason": "appeared" + }, + { + "object": "LayoutText #text", + "reason": "selection" + }, + { + "object": "InlineTextBox 'b'", + "reason": "selection" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/shift-relative-positioned-container-with-image-addition-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/shift-relative-positioned-container-with-image-addition-expected.txt index 9595e5f0..d63a9ef84 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/shift-relative-positioned-container-with-image-addition-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/shift-relative-positioned-container-with-image-addition-expected.txt
@@ -17,14 +17,14 @@ "reason": "appeared" }, { - "object": "LayoutImage IMG", + "object": "LayoutBlockFlow (relative positioned) DIV class='relative paddingTop'", "rect": [58, 236, 489, 537], - "reason": "geometry" + "reason": "appeared" }, { "object": "LayoutImage IMG", "rect": [58, 142, 489, 537], - "reason": "geometry" + "reason": "disappeared" } ] }
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/shift-relative-positioned-container-with-image-removal-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/shift-relative-positioned-container-with-image-removal-expected.txt index 24890f1..067d529 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/shift-relative-positioned-container-with-image-removal-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/shift-relative-positioned-container-with-image-removal-expected.txt
@@ -17,14 +17,14 @@ "reason": "disappeared" }, { - "object": "LayoutImage IMG", + "object": "LayoutBlockFlow (relative positioned) DIV class='relative paddingTop'", "rect": [58, 241, 489, 537], - "reason": "geometry" + "reason": "disappeared" }, { "object": "LayoutImage IMG", "rect": [58, 142, 489, 537], - "reason": "geometry" + "reason": "appeared" } ] }
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/subpixel-offset-scaled-transform-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/subpixel-offset-scaled-transform-expected.txt new file mode 100644 index 0000000..bd5967f3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/subpixel-offset-scaled-transform-expected.txt
@@ -0,0 +1,29 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (relative positioned) DIV class='child scale'", + "rect": [9, 58, 40, 40], + "reason": "paint property change" + }, + { + "object": "LayoutBlockFlow (relative positioned) DIV class='child scale'", + "rect": [8, 58, 40, 40], + "reason": "paint property change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow (relative positioned) DIV class='container'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/subtree-root-clip-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/subtree-root-clip-expected.txt new file mode 100644 index 0000000..22eae45 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/subtree-root-clip-expected.txt
@@ -0,0 +1,33 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (floating) DIV", + "rect": [8, 8, 100, 100], + "reason": "appeared" + }, + { + "object": "LayoutBlockFlow (floating) DIV", + "rect": [8, 8, 100, 100], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow (floating) DIV", + "reason": "background" + }, + { + "object": "LayoutBlockFlow DIV id='inner'", + "reason": "disappeared" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/subtree-root-skipped-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/subtree-root-skipped-expected.txt new file mode 100644 index 0000000..ac9f6f17 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/subtree-root-skipped-expected.txt
@@ -0,0 +1,50 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox 'PASS'", + "rect": [10, 11, 35, 16], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'FAIL'", + "rect": [10, 11, 28, 16], + "reason": "disappeared" + }, + { + "object": "LayoutBlockFlow (positioned) DIV id='div'", + "rect": [8, 288, 10, 20], + "reason": "geometry" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='inner-editor'", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "full" + }, + { + "object": "InlineTextBox 'PASS'", + "reason": "full" + }, + { + "object": "LayoutBlockFlow (positioned) DIV id='div'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/add-border-property-on-root-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/add-border-property-on-root-expected.txt new file mode 100644 index 0000000..30a77d25 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/add-border-property-on-root-expected.txt
@@ -0,0 +1,24 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGRoot (positioned) svg", + "rect": [8, 8, 120, 120], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGRoot (positioned) svg", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/animated-path-inside-transformed-html-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/animated-path-inside-transformed-html-expected.png new file mode 100644 index 0000000..dff97e3d5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/animated-path-inside-transformed-html-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/animated-path-inside-transformed-html-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/animated-path-inside-transformed-html-expected.txt new file mode 100644 index 0000000..b417048 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/animated-path-inside-transformed-html-expected.txt
@@ -0,0 +1,73 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox 'This is some text'", + "rect": [246, 89, 127, 46], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'This is some text'", + "rect": [203, 336, 126, 45], + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect id='rect'", + "rect": [108, 84, 105, 102], + "reason": "full" + }, + { + "object": "LayoutSVGRect rect id='rect'", + "rect": [355, 125, 104, 104], + "reason": "full" + }, + { + "object": "LayoutSVGImage image id='image'", + "rect": [352, 398, 99, 98], + "reason": "full" + }, + { + "object": "LayoutSVGImage image id='image'", + "rect": [90, 207, 98, 99], + "reason": "full" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGRect rect id='rect'", + "reason": "full" + }, + { + "object": "LayoutSVGText text id='text'", + "reason": "full" + }, + { + "object": "RootInlineBox", + "reason": "full" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'This is some text'", + "reason": "geometry" + }, + { + "object": "LayoutSVGImage image id='image'", + "reason": "full" + }, + { + "object": "LayoutText #text", + "reason": "appeared" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/container-repaint-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/container-repaint-expected.txt new file mode 100644 index 0000000..9f83886 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/container-repaint-expected.txt
@@ -0,0 +1,29 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGViewportContainer svg id='mover'", + "rect": [0, 100, 100, 50], + "reason": "paint property change" + }, + { + "object": "LayoutSVGViewportContainer svg id='mover'", + "rect": [0, 50, 100, 50], + "reason": "paint property change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGViewportContainer svg id='mover'", + "reason": "full" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/deep-dynamic-updates-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/deep-dynamic-updates-expected.txt new file mode 100644 index 0000000..21846ddc --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/deep-dynamic-updates-expected.txt
@@ -0,0 +1,24 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGRect rect", + "rect": [23, 23, 404, 404], + "reason": "SVG resource change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGRect rect", + "reason": "SVG resource change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/feImage-remove-target-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/feImage-remove-target-expected.txt new file mode 100644 index 0000000..33b1e3c --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/feImage-remove-target-expected.txt
@@ -0,0 +1,24 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGRect rect", + "rect": [0, 0, 110, 110], + "reason": "full" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGRect rect", + "reason": "full" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/hairline-stroke-squarecap-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/hairline-stroke-squarecap-expected.txt new file mode 100644 index 0000000..c4ece62 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/hairline-stroke-squarecap-expected.txt
@@ -0,0 +1,29 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGPath path id='path'", + "rect": [198, 198, 105, 105], + "reason": "appeared" + }, + { + "object": "LayoutSVGRoot svg", + "rect": [98, 98, 104, 104], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGPath path id='path'", + "reason": "full" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/inner-svg-change-viewBox-contract-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/inner-svg-change-viewBox-contract-expected.txt new file mode 100644 index 0000000..c85d021 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/inner-svg-change-viewBox-contract-expected.txt
@@ -0,0 +1,24 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGViewportContainer svg id='inner'", + "rect": [0, 0, 200, 200], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGViewportContainer svg id='inner'", + "reason": "full" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/inner-svg-change-viewBox-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/inner-svg-change-viewBox-expected.txt new file mode 100644 index 0000000..029d9cf --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/inner-svg-change-viewBox-expected.txt
@@ -0,0 +1,33 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGRoot svg", + "rect": [0, 0, 100, 100], + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='s'", + "rect": [0, 0, 100, 100], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGViewportContainer svg id='s'", + "reason": "full" + }, + { + "object": "LayoutSVGRect rect", + "reason": "full" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/js-late-gradient-and-object-creation-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/js-late-gradient-and-object-creation-expected.txt new file mode 100644 index 0000000..81c92c52 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/js-late-gradient-and-object-creation-expected.txt
@@ -0,0 +1,72 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGRoot svg id='svg-root'", + "rect": [0, 15, 757, 365], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGContainer g id='content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Gradient on fill'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Gradient on stroke'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Gradient on fill/stroke'", + "reason": "appeared" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/js-late-marker-and-object-creation-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/js-late-marker-and-object-creation-expected.txt new file mode 100644 index 0000000..a430528 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/js-late-marker-and-object-creation-expected.txt
@@ -0,0 +1,37 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGPath path", + "rect": [202, 211, 112, 112], + "reason": "style change" + }, + { + "object": "LayoutSVGRoot svg id='svg-root'", + "rect": [202, 211, 112, 112], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGContainer g id='content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/js-update-container-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/js-update-container-expected.txt new file mode 100644 index 0000000..a09a292 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/js-update-container-expected.txt
@@ -0,0 +1,33 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGRoot svg", + "rect": [0, 0, 76, 76], + "reason": "disappeared" + }, + { + "object": "LayoutSVGContainer g id='group'", + "rect": [-1, -1, 42, 42], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGContainer g id='group'", + "reason": "full" + }, + { + "object": "LayoutSVGRect rect", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/js-update-stop-linked-gradient-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/js-update-stop-linked-gradient-expected.txt new file mode 100644 index 0000000..45cac4ab --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/js-update-stop-linked-gradient-expected.txt
@@ -0,0 +1,42 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGRect rect", + "rect": [10, 210, 430, 80], + "reason": "SVG resource change" + }, + { + "object": "LayoutSVGRect rect", + "rect": [10, 110, 430, 80], + "reason": "SVG resource change" + }, + { + "object": "LayoutSVGRect rect", + "rect": [10, 10, 430, 80], + "reason": "SVG resource change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGRect rect", + "reason": "SVG resource change" + }, + { + "object": "LayoutSVGRect rect", + "reason": "SVG resource change" + }, + { + "object": "LayoutSVGRect rect", + "reason": "SVG resource change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/nested-embedded-svg-size-changes-no-layout-triggers-1-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/nested-embedded-svg-size-changes-no-layout-triggers-1-expected.txt new file mode 100644 index 0000000..2338aedd --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/nested-embedded-svg-size-changes-no-layout-triggers-1-expected.txt
@@ -0,0 +1,85 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow HTML", + "rect": [0, 0, 402, 202], + "reason": "appeared" + }, + { + "object": "LayoutView #document", + "rect": [0, 0, 300, 150], + "reason": "disappeared" + }, + { + "object": "LayoutSVGRect rect", + "rect": [211, 11, 180, 180], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot svg", + "rect": [11, 11, 180, 180], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot svg", + "rect": [10, 10, 180, 125], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRect rect", + "rect": [210, 10, 75, 125], + "reason": "paint property change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow BODY", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutEmbeddedObject OBJECT", + "reason": "style change" + }, + { + "object": "HorizontalScrollbar", + "reason": "scroll control" + }, + { + "object": "VerticalScrollbar", + "reason": "scroll control" + }, + { + "object": "LayoutView #document", + "reason": "geometry" + }, + { + "object": "LayoutView #document", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow BODY", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutEmbeddedObject OBJECT", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/nested-embedded-svg-size-changes-no-layout-triggers-2-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/nested-embedded-svg-size-changes-no-layout-triggers-2-expected.txt new file mode 100644 index 0000000..2338aedd --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/nested-embedded-svg-size-changes-no-layout-triggers-2-expected.txt
@@ -0,0 +1,85 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow HTML", + "rect": [0, 0, 402, 202], + "reason": "appeared" + }, + { + "object": "LayoutView #document", + "rect": [0, 0, 300, 150], + "reason": "disappeared" + }, + { + "object": "LayoutSVGRect rect", + "rect": [211, 11, 180, 180], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot svg", + "rect": [11, 11, 180, 180], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot svg", + "rect": [10, 10, 180, 125], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRect rect", + "rect": [210, 10, 75, 125], + "reason": "paint property change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow BODY", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutEmbeddedObject OBJECT", + "reason": "style change" + }, + { + "object": "HorizontalScrollbar", + "reason": "scroll control" + }, + { + "object": "VerticalScrollbar", + "reason": "scroll control" + }, + { + "object": "LayoutView #document", + "reason": "geometry" + }, + { + "object": "LayoutView #document", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow BODY", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutEmbeddedObject OBJECT", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/overflow-repaint-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/overflow-repaint-expected.txt new file mode 100644 index 0000000..558effc3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/overflow-repaint-expected.txt
@@ -0,0 +1,36 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGRoot svg id='svg'", + "rect": [8, 108, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot svg id='svg'", + "reason": "paint property change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot svg id='svg'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/relative-sized-image-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/relative-sized-image-expected.txt new file mode 100644 index 0000000..9d2ab1e --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/relative-sized-image-expected.txt
@@ -0,0 +1,46 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow div id='contentBox'", + "rect": [8, 72, 402, 402], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot svg", + "rect": [9, 73, 400, 400], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot svg", + "rect": [9, 73, 100, 400], + "reason": "paint property change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow div id='contentBox'", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot svg", + "reason": "geometry" + }, + { + "object": "LayoutSVGImage image", + "reason": "image" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/remove-border-property-on-root-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/remove-border-property-on-root-expected.txt new file mode 100644 index 0000000..acb07020 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/remove-border-property-on-root-expected.txt
@@ -0,0 +1,24 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGRoot (positioned) svg", + "rect": [8, 8, 120, 120], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGRoot (positioned) svg", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/repaint-moving-svg-and-div-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/repaint-moving-svg-and-div-expected.txt new file mode 100644 index 0000000..0825a73 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/repaint-moving-svg-and-div-expected.txt
@@ -0,0 +1,483 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [550, 350, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [535, 325, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [535, 325, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [520, 300, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [520, 300, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [505, 275, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [505, 275, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [490, 250, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [490, 250, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [475, 225, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [475, 225, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [460, 200, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [460, 200, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [445, 175, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [445, 175, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [430, 150, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [430, 150, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "rect": [400, 100, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [250, 350, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [235, 325, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [235, 325, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [220, 300, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [220, 300, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [205, 275, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [205, 275, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [190, 250, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [190, 250, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [175, 225, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [175, 225, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [160, 200, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [160, 200, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [145, 175, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [145, 175, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [130, 150, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [130, 150, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [100, 100, 150, 150], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [575, 375, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [560, 350, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [560, 350, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [545, 325, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [545, 325, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [530, 300, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [530, 300, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [515, 275, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [515, 275, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [500, 250, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [500, 250, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [485, 225, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [485, 225, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [470, 200, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [470, 200, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [455, 175, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [455, 175, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "rect": [425, 125, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [275, 375, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [260, 350, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [260, 350, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [245, 325, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [245, 325, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [230, 300, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [230, 300, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [215, 275, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [215, 275, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [200, 250, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [200, 250, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [185, 225, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [185, 225, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [170, 200, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [170, 200, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [155, 175, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [155, 175, 100, 100], + "reason": "paint property change" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "rect": [125, 125, 100, 100], + "reason": "paint property change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "reason": "geometry" + }, + { + "object": "LayoutSVGRoot (positioned) svg id='svg'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow (positioned) div id='html' class='outerBox'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow div class='innerBox'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/shape-transform-change-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/shape-transform-change-expected.txt new file mode 100644 index 0000000..057342a --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/shape-transform-change-expected.txt
@@ -0,0 +1,29 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGRect rect", + "rect": [8, 8, 200, 200], + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "rect": [8, 8, 100, 100], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGRect rect", + "reason": "full" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/tabgroup-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/tabgroup-expected.txt new file mode 100644 index 0000000..2e23193 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/tabgroup-expected.txt
@@ -0,0 +1,1020 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGContainer g", + "rect": [389, 37, 316, 82], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "rect": [262, 278, 303, 303], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "rect": [6, 256, 238, 160], + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "rect": [6, 256, 238, 160], + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "rect": [6, 256, 238, 160], + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "rect": [6, 256, 238, 160], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "rect": [506, 233, 238, 159], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'This is a tabgroup with triangular tab corners'", + "rect": [15, 291, 211, 37], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRect'", + "rect": [37, 6, 160, 238], + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "rect": [66, 257, 57, 29], + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "rect": [10, 257, 50, 29], + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "rect": [130, 257, 47, 29], + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "rect": [184, 257, 32, 29], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGContainer g id='tabgroupRect'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupRect__0'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Biography'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRect__0_content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupRect__2'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Events'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRect__2_content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupRect__3'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Portrait'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRect__3_content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupRect__1'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Relations'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRect__1_content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupTriangle'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupTriangle__1'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Download'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Folder'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupTriangle__2'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Your'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Account'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupTriangle__3'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Help'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox '& Info'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupTriangle__0'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Geodata'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Browser'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupTriangle__0_content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text id='contentTabGroupTriangle0'", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'This is a tabgroup with triangular tab corners'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'and a double line tab. (use \"\\n\" as a line separator)'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Click on the second tab to see oversize content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRectTriangle'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupRectTriangle__0'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Biography'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRectTriangle__0_content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupRectTriangle__1'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Relations'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRectTriangle__1_content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupRectTriangle__3'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Portrait'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRectTriangle__3_content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupRectTriangle__2'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Events'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRectTriangle__2_content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRound'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupRound__0'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Biography'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRound__0_content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupRound__2'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Events'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRound__2_content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupRound__3'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Portrait'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRound__3_content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupRound__1'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Relations'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRound__1_content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRectRound'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupRectRound__1'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Relations'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRectRound__1_content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupRectRound__2'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Events'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRectRound__2_content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupRectRound__3'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Portrait'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRectRound__3_content'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath path id='tabgroupRectRound__0'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Biography'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='tabgroupRectRound__0_content'", + "reason": "appeared" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/text-pattern-update-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/text-pattern-update-expected.txt new file mode 100644 index 0000000..012e50b --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/text-pattern-update-expected.txt
@@ -0,0 +1,36 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox 'X'", + "rect": [8, 8, 100, 100], + "reason": "SVG resource change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGText text", + "reason": "SVG resource change" + }, + { + "object": "RootInlineBox", + "reason": "SVG resource change" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "SVG resource change" + }, + { + "object": "InlineTextBox 'X'", + "reason": "SVG resource change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/text-repaint-including-stroke-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/text-repaint-including-stroke-expected.txt new file mode 100644 index 0000000..a91f0c1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/text-repaint-including-stroke-expected.txt
@@ -0,0 +1,41 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGText text id='bounce'", + "rect": [80, 0, 553, 117], + "reason": "appeared" + }, + { + "object": "LayoutSVGRoot svg", + "rect": [30, 0, 404, 59], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGText text id='bounce'", + "reason": "full" + }, + { + "object": "RootInlineBox", + "reason": "full" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "style change" + }, + { + "object": "InlineTextBox 'Repaint me!'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/text-rescale-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/text-rescale-expected.txt new file mode 100644 index 0000000..59f9832 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/text-rescale-expected.txt
@@ -0,0 +1,179 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "InlineTextBox 'PASS '", + "rect": [0, 114, 302, 46], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'PASS '", + "rect": [0, 64, 302, 46], + "reason": "chunk reordered" + }, + { + "object": "LayoutSVGRoot (positioned) svg", + "rect": [0, 14, 302, 46], + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg", + "rect": [310, 114, 92, 46], + "reason": "paint property change" + }, + { + "object": "LayoutSVGViewportContainer svg", + "rect": [310, 14, 92, 46], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='text3g'", + "rect": [0, 3, 10, 3], + "reason": "disappeared" + }, + { + "object": "LayoutSVGViewportContainer svg", + "rect": [9, 3, 5, 3], + "reason": "paint property change" + }, + { + "object": "LayoutSVGContainer g id='text1g'", + "rect": [0, 0, 1, 1], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGContainer g id='text1g'", + "reason": "full" + }, + { + "object": "LayoutSVGText text", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'PASS '", + "reason": "geometry" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "geometry" + }, + { + "object": "InlineFlowBox", + "reason": "geometry" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'PASS'", + "reason": "geometry" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "geometry" + }, + { + "object": "LayoutSVGViewportContainer svg", + "reason": "geometry" + }, + { + "object": "LayoutSVGText text", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'PASS'", + "reason": "geometry" + }, + { + "object": "LayoutSVGContainer g id='text2g'", + "reason": "full" + }, + { + "object": "LayoutSVGContainer g id='text3g'", + "reason": "full" + }, + { + "object": "LayoutSVGText text", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'PASS '", + "reason": "geometry" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "geometry" + }, + { + "object": "InlineFlowBox", + "reason": "geometry" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'PASS'", + "reason": "geometry" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "geometry" + }, + { + "object": "LayoutSVGViewportContainer svg", + "reason": "geometry" + }, + { + "object": "LayoutSVGText text", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'PASS'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/transform-text-element-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/transform-text-element-expected.txt new file mode 100644 index 0000000..3d8b2c7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/transform-text-element-expected.txt
@@ -0,0 +1,41 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGText text", + "rect": [8, 58, 400, 100], + "reason": "appeared" + }, + { + "object": "LayoutSVGRoot svg", + "rect": [8, 8, 400, 100], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGText text", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'Test'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/use-inherit-style-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/use-inherit-style-expected.txt new file mode 100644 index 0000000..b8caaa2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/use-inherit-style-expected.txt
@@ -0,0 +1,32 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGRect rect id='rect'", + "rect": [0, 0, 100, 60], + "reason": "style change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGContainer g id='g'", + "reason": "style change" + }, + { + "object": "LayoutSVGContainer use", + "reason": "style change" + }, + { + "object": "LayoutSVGRect rect id='rect'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/window-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/window-expected.txt new file mode 100644 index 0000000..e31923b --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/window-expected.txt
@@ -0,0 +1,1170 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutSVGContainer g id='bigWindow'", + "rect": [37, 142, 551, 394], + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect id='titleBarbigWindow'", + "rect": [37, 142, 551, 17], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='nestedWindow'", + "rect": [76, 181, 316, 238], + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect id='titleBarnestedWindow'", + "rect": [76, 181, 316, 17], + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect id='decoGroupMinimizednavWindow'", + "rect": [612, 80, 187, 18], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='navWindow'", + "rect": [623, 91, 176, 160], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='colourPickerWindow'", + "rect": [76, 194, 176, 144], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='smallWindow'", + "rect": [311, 376, 160, 145], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='statusWindow'", + "rect": [248, 343, 144, 66], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='minimalWindow'", + "rect": [38, 475, 121, 50], + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "rect": [612, 80, 18, 160], + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "rect": [615, 153, 14, 81], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='closeButtonnavWindow'", + "rect": [615, 83, 12, 12], + "reason": "paint property change" + }, + { + "object": "LayoutSVGContainer use id='closeButtonnavWindow'", + "rect": [782, 94, 12, 11], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='closeButtonnavWindow'", + "rect": [782, 94, 12, 11], + "reason": "paint property change" + }, + { + "object": "LayoutSVGContainer use id='minimizeButtonnavWindow'", + "rect": [615, 115, 12, 11], + "reason": "paint property change" + }, + { + "object": "LayoutSVGContainer use id='maximizeButtonnavWindow'", + "rect": [615, 99, 12, 11], + "reason": "paint property change" + }, + { + "object": "LayoutSVGContainer use id='closeButtonbigWindow'", + "rect": [571, 145, 12, 11], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='minimizeButtonnestedWindow'", + "rect": [349, 184, 12, 11], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='closeButtoncolourPickerWindow'", + "rect": [235, 197, 12, 11], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='maximizeButtonstatusWindow'", + "rect": [376, 345, 11, 12], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='minimizeButtonstatusWindow'", + "rect": [363, 345, 11, 12], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='maximizeButtonnavWindow'", + "rect": [769, 94, 11, 11], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='maximizeButtonnavWindow'", + "rect": [769, 94, 11, 11], + "reason": "paint property change" + }, + { + "object": "LayoutSVGContainer use id='minimizeButtonnavWindow'", + "rect": [756, 94, 11, 11], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='minimizeButtonnavWindow'", + "rect": [756, 94, 11, 11], + "reason": "paint property change" + }, + { + "object": "LayoutSVGContainer use id='maximizeButtonbigWindow'", + "rect": [558, 145, 11, 11], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='minimizeButtonbigWindow'", + "rect": [545, 145, 11, 11], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='closeButtonsmallWindow'", + "rect": [454, 379, 11, 11], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='maximizeButtonsmallWindow'", + "rect": [441, 379, 11, 11], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='minimizeButtonsmallWindow'", + "rect": [428, 379, 11, 11], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='closeButtonnestedWindow'", + "rect": [376, 184, 11, 11], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='maximizeButtonnestedWindow'", + "rect": [363, 184, 11, 11], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='maximizeButtoncolourPickerWindow'", + "rect": [222, 197, 11, 11], + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='minimizeButtoncolourPickerWindow'", + "rect": [209, 197, 11, 11], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutSVGContainer g id='Windows'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='navWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='windowMainGroupnavWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text id='textNavWindow'", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'This window should'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'contain navigation tools'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Click on button'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox ''Resize Navigation Window' for a'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'random resize of this Window'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Note that this window also'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'features a window decoration'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Statusbar'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='windowTitlebarGroupnavWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='closeButtonnavWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='closeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath line", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath line", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='maximizeButtonnavWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='maximizeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='minimizeButtonnavWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='minimizeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath line", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='bigWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='windowMainGroupbigWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'This is a big movable window'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='nestedWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='windowMainGroupnestedWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'This window contains other windows'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='colourPickerWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='windowMainGroupcolourPickerWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Changing a colour changes background'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='windowTitlebarGroupcolourPickerWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect id='titleBarcolourPickerWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Colour Picker'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='closeButtoncolourPickerWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='closeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath line", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath line", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='maximizeButtoncolourPickerWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='maximizeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='minimizeButtoncolourPickerWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='minimizeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath line", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='statusWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='windowMainGroupstatusWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text id='textStatusWindow'", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'This is a none-moveable'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'none-closeable status'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'window'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='windowTitlebarGroupstatusWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect id='titleBarstatusWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Status Window'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='maximizeButtonstatusWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='maximizeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='minimizeButtonstatusWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='minimizeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath line", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='windowTitlebarGroupnestedWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect id='titleBarnestedWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Nested middlesize Window'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='closeButtonnestedWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='closeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath line", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath line", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='maximizeButtonnestedWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='maximizeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='minimizeButtonnestedWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='minimizeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath line", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='smallWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='windowMainGroupsmallWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text id='textSmallWindow'", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'This window has a callback'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'function indicating mouse'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'movements in the statusbar'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'and alerting window'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'events'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Callback function is active'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='windowTitlebarGroupsmallWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect id='titleBarsmallWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Small Window'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='closeButtonsmallWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='closeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath line", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath line", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='maximizeButtonsmallWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='maximizeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='minimizeButtonsmallWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='minimizeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath line", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='minimalWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='windowMainGroupminimalWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text id='textMinimalWindow'", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'This is a minimal window'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'without title and status bar.'", + "reason": "appeared" + }, + { + "object": "LayoutSVGTSpan tspan", + "reason": "appeared" + }, + { + "object": "InlineFlowBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'it is also not moveable'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='windowTitlebarGroupminimalWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='windowTitlebarGroupbigWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect id='titleBarbigWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Big Window'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='closeButtonbigWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='closeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath line", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath line", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='maximizeButtonbigWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='maximizeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='minimizeButtonbigWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGViewportContainer svg id='minimizeButton'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGPath line", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='Windows'", + "reason": "geometry" + }, + { + "object": "LayoutSVGContainer g id='navWindow'", + "reason": "geometry" + }, + { + "object": "LayoutSVGContainer g id='windowTitlebarGroupnavWindow'", + "reason": "geometry" + }, + { + "object": "LayoutSVGContainer g id='decoGroupnavWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect", + "reason": "appeared" + }, + { + "object": "LayoutSVGRect rect id='decoGroupMinimizednavWindow'", + "reason": "appeared" + }, + { + "object": "LayoutSVGText text", + "reason": "appeared" + }, + { + "object": "RootInlineBox", + "reason": "appeared" + }, + { + "object": "LayoutSVGInlineText #text", + "reason": "appeared" + }, + { + "object": "InlineTextBox 'Navigation Window'", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer use id='closeButtonnavWindow'", + "reason": "full" + }, + { + "object": "LayoutSVGViewportContainer svg id='closeButton'", + "reason": "full" + }, + { + "object": "LayoutSVGContainer use id='maximizeButtonnavWindow'", + "reason": "full" + }, + { + "object": "LayoutSVGViewportContainer svg id='maximizeButton'", + "reason": "full" + }, + { + "object": "LayoutSVGContainer use id='minimizeButtonnavWindow'", + "reason": "full" + }, + { + "object": "LayoutSVGViewportContainer svg id='minimizeButton'", + "reason": "full" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g", + "reason": "appeared" + }, + { + "object": "LayoutSVGContainer g id='windowTitlebarGroupminimalWindow'", + "reason": "appeared" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/zoom-foreignObject-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/zoom-foreignObject-expected.png new file mode 100644 index 0000000..6368e49 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/zoom-foreignObject-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/table-col-background-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/table-col-background-expected.txt new file mode 100644 index 0000000..3c9591e --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/table-col-background-expected.txt
@@ -0,0 +1,28 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutTableSection TBODY", + "rect": [8, 108, 106, 104], + "reason": "style change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutTableSection TBODY", + "reason": "style change" + }, + { + "object": "LayoutTableCol COL id='col'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/table-overflow-auto-in-overflow-auto-scrolled-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/table-overflow-auto-in-overflow-auto-scrolled-expected.txt new file mode 100644 index 0000000..01f5ced --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/table-overflow-auto-in-overflow-auto-scrolled-expected.txt
@@ -0,0 +1,57 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='innerDiv'", + "rect": [10, 8, 302, 300], + "reason": "paint property change" + }, + { + "object": "VerticalScrollbar", + "rect": [762, 8, 15, 300], + "reason": "scroll control" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='innerDiv'", + "reason": "subtree" + }, + { + "object": "VerticalScrollbar", + "reason": "scroll control" + }, + { + "object": "LayoutTable TABLE", + "reason": "subtree" + }, + { + "object": "LayoutTableSection TBODY", + "reason": "subtree" + }, + { + "object": "LayoutTableRow TR", + "reason": "subtree" + }, + { + "object": "LayoutTableCell TD", + "reason": "subtree" + }, + { + "object": "LayoutTableRow TR", + "reason": "subtree" + }, + { + "object": "LayoutTableCell TD", + "reason": "subtree" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/table-overflow-scroll-in-overflow-scroll-scrolled-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/table-overflow-scroll-in-overflow-scroll-scrolled-expected.txt new file mode 100644 index 0000000..01f5ced --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/table-overflow-scroll-in-overflow-scroll-scrolled-expected.txt
@@ -0,0 +1,57 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='innerDiv'", + "rect": [10, 8, 302, 300], + "reason": "paint property change" + }, + { + "object": "VerticalScrollbar", + "rect": [762, 8, 15, 300], + "reason": "scroll control" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='innerDiv'", + "reason": "subtree" + }, + { + "object": "VerticalScrollbar", + "reason": "scroll control" + }, + { + "object": "LayoutTable TABLE", + "reason": "subtree" + }, + { + "object": "LayoutTableSection TBODY", + "reason": "subtree" + }, + { + "object": "LayoutTableRow TR", + "reason": "subtree" + }, + { + "object": "LayoutTableCell TD", + "reason": "subtree" + }, + { + "object": "LayoutTableRow TR", + "reason": "subtree" + }, + { + "object": "LayoutTableCell TD", + "reason": "subtree" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/table-two-pass-layout-overpaint-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/table-two-pass-layout-overpaint-expected.txt new file mode 100644 index 0000000..c2aca03 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/table-two-pass-layout-overpaint-expected.txt
@@ -0,0 +1,42 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutTable TABLE", + "rect": [8, 106, 106, 1], + "reason": "incremental" + }, + { + "object": "LayoutBlockFlow DIV id='target'", + "rect": [11, 45, 100, 25], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV id='target'", + "rect": [11, 44, 50, 25], + "reason": "geometry" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutTable TABLE", + "reason": "incremental" + }, + { + "object": "LayoutTableCell TD", + "reason": "incremental" + }, + { + "object": "LayoutBlockFlow DIV id='target'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/text-in-relative-positioned-inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/text-in-relative-positioned-inline-expected.txt new file mode 100644 index 0000000..60395ff --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/text-in-relative-positioned-inline-expected.txt
@@ -0,0 +1,24 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow HTML", + "rect": [8, 8, 200, 100], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/textarea-appearance-none-resize-handle-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/textarea-appearance-none-resize-handle-expected.txt new file mode 100644 index 0000000..0e475d25 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/textarea-appearance-none-resize-handle-expected.txt
@@ -0,0 +1,24 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutTextControl (positioned) TEXTAREA id='textarea'", + "rect": [0, 50, 106, 206], + "reason": "geometry" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutTextControl (positioned) TEXTAREA id='textarea'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/textarea-caret-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/textarea-caret-expected.txt new file mode 100644 index 0000000..6ea8f41f --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/textarea-caret-expected.txt
@@ -0,0 +1,77 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutTextControl TEXTAREA id='editor'", + "rect": [7, 7, 183, 40], + "reason": "appeared" + }, + { + "object": "LayoutTextControl TEXTAREA id='editor'", + "rect": [7, 7, 183, 40], + "reason": "appeared" + }, + { + "object": "LayoutTextControl TEXTAREA id='editor'", + "rect": [7, 7, 183, 40], + "reason": "appeared" + }, + { + "object": "LayoutBlockFlow HTML", + "rect": [8, 8, 181, 38], + "reason": "disappeared" + }, + { + "object": "LayoutTextControl TEXTAREA id='editor'", + "rect": [9, 11, 179, 16], + "reason": "appeared" + }, + { + "object": "LayoutTextControl TEXTAREA id='editor'", + "rect": [9, 30, 164, 15], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutTextControl TEXTAREA id='editor'", + "reason": "subtree" + }, + { + "object": "LayoutTextControl TEXTAREA id='editor'", + "reason": "geometry" + }, + { + "object": "HorizontalScrollbar", + "reason": "scroll control" + }, + { + "object": "LayoutBlockFlow DIV id='inner-editor'", + "reason": "subtree" + }, + { + "object": "RootInlineBox", + "reason": "subtree" + }, + { + "object": "Caret", + "reason": "caret" + }, + { + "object": "LayoutText #text", + "reason": "subtree" + }, + { + "object": "InlineTextBox '------------------------------------------------------------'", + "reason": "subtree" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/transform-absolute-child-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/transform-absolute-child-expected.txt new file mode 100644 index 0000000..0985147 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/transform-absolute-child-expected.txt
@@ -0,0 +1,23 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (relative positioned) DIV id='box' class='rotated'", + "rect": [16, 8, 497, 464], + "reason": "paint property change" + }, + { + "object": "LayoutBlockFlow (relative positioned) DIV id='box'", + "rect": [58, 50, 477, 204], + "reason": "paint property change" + } + ] + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/transform-absolute-in-positioned-container-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/transform-absolute-in-positioned-container-expected.txt new file mode 100644 index 0000000..35c0f29e --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/transform-absolute-in-positioned-container-expected.txt
@@ -0,0 +1,23 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [802, 585], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (relative positioned) DIV id='box' class='rotated'", + "rect": [76, 190, 286, 286], + "reason": "paint property change" + }, + { + "object": "LayoutBlockFlow (relative positioned) DIV id='box'", + "rect": [118, 232, 202, 202], + "reason": "paint property change" + } + ] + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/transform-inline-layered-child-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/transform-inline-layered-child-expected.txt new file mode 100644 index 0000000..d5142d3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/transform-inline-layered-child-expected.txt
@@ -0,0 +1,157 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutInline (relative positioned) SPAN id='child'", + "rect": [135, 361, 159, 195], + "reason": "appeared" + }, + { + "object": "InlineTextBox 'A B C'", + "rect": [300, 302, 80, 177], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'D E F'", + "rect": [300, 302, 80, 177], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'G H I'", + "rect": [300, 302, 80, 177], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'J K L'", + "rect": [300, 302, 80, 177], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'M N O'", + "rect": [300, 302, 80, 177], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'P Q R'", + "rect": [300, 302, 80, 177], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'S T U'", + "rect": [300, 302, 80, 177], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'V W X'", + "rect": [300, 302, 80, 177], + "reason": "disappeared" + }, + { + "object": "InlineTextBox 'Y Z'", + "rect": [300, 302, 80, 177], + "reason": "disappeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow (positioned) DIV id='box'", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutInline (relative positioned) SPAN id='child'", + "reason": "geometry" + }, + { + "object": "InlineFlowBox", + "reason": "geometry" + }, + { + "object": "InlineFlowBox", + "reason": "geometry" + }, + { + "object": "InlineFlowBox", + "reason": "geometry" + }, + { + "object": "InlineFlowBox", + "reason": "geometry" + }, + { + "object": "InlineFlowBox", + "reason": "geometry" + }, + { + "object": "InlineFlowBox", + "reason": "geometry" + }, + { + "object": "InlineFlowBox", + "reason": "geometry" + }, + { + "object": "InlineFlowBox", + "reason": "geometry" + }, + { + "object": "InlineFlowBox", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'A B C'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'D E F'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'G H I'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'J K L'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'M N O'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'P Q R'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'S T U'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'V W X'", + "reason": "geometry" + }, + { + "object": "InlineTextBox 'Y Z'", + "reason": "geometry" + }, + { + "object": "LayoutText #text", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/transform-relative-position-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/transform-relative-position-expected.txt new file mode 100644 index 0000000..9cb974ed --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/transform-relative-position-expected.txt
@@ -0,0 +1,23 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow (relative positioned) DIV id='box' class='rotated'", + "rect": [66, 110, 286, 286], + "reason": "paint property change" + }, + { + "object": "LayoutBlockFlow (relative positioned) DIV id='box'", + "rect": [108, 152, 202, 202], + "reason": "paint property change" + } + ] + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/transform-translate-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/transform-translate-expected.txt new file mode 100644 index 0000000..d2ad5d6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/transform-translate-expected.txt
@@ -0,0 +1,23 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='target'", + "rect": [28, 66, 106, 107], + "reason": "paint property change" + }, + { + "object": "LayoutBlockFlow DIV id='target'", + "rect": [8, 66, 106, 107], + "reason": "paint property change" + } + ] + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/vertical-align-length1-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/vertical-align-length1-expected.txt new file mode 100644 index 0000000..8ede4da --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/vertical-align-length1-expected.txt
@@ -0,0 +1,60 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='target'", + "rect": [20, 0, 100, 100], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV class='other'", + "rect": [120, 130, 20, 20], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV class='other'", + "rect": [120, 100, 20, 20], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV class='other'", + "rect": [0, 130, 20, 20], + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV class='other'", + "rect": [0, 100, 20, 20], + "reason": "geometry" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow BODY", + "reason": "geometry" + }, + { + "object": "RootInlineBox", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV class='other'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV id='target'", + "reason": "geometry" + }, + { + "object": "LayoutBlockFlow DIV class='other'", + "reason": "geometry" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/vertical-overflow-child-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/vertical-overflow-child-expected.txt new file mode 100644 index 0000000..2a4f07cb --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/vertical-overflow-child-expected.txt
@@ -0,0 +1,24 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV class='container'", + "rect": [214, 21, 100, 100], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV class='target'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/vertical-overflow-parent-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/vertical-overflow-parent-expected.txt new file mode 100644 index 0000000..f86e7d3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/vertical-overflow-parent-expected.txt
@@ -0,0 +1,24 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV class='container'", + "rect": [29, 29, 100, 100], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV class='target'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/vertical-overflow-same-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/vertical-overflow-same-expected.txt new file mode 100644 index 0000000..1d40c08 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/vertical-overflow-same-expected.txt
@@ -0,0 +1,24 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV class='vertical-rl container'", + "rect": [29, 21, 100, 100], + "reason": "appeared" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutBlockFlow DIV class='target'", + "reason": "style change" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/view-background-from-body-2-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/view-background-from-body-2-expected.txt new file mode 100644 index 0000000..52e9543 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/view-background-from-body-2-expected.txt
@@ -0,0 +1,28 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutView #document", + "rect": [0, 0, 800, 600], + "reason": "style change" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutView #document", + "reason": "style change" + }, + { + "object": "LayoutBlockFlow BODY", + "reason": "appeared" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/window-resize-media-query-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/window-resize-media-query-expected.txt new file mode 100644 index 0000000..5e3ebd4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/window-resize-media-query-expected.txt
@@ -0,0 +1,93 @@ +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [600, 250], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutView #document", + "rect": [0, 250, 600, 250], + "reason": "incremental" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutView #document", + "reason": "incremental" + } + ] +} +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [400, 250], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutView #document", + "rect": [400, 0, 200, 250], + "reason": "incremental" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutView #document", + "reason": "incremental" + } + ] +} +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [400, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutView #document", + "rect": [0, 250, 400, 350], + "reason": "incremental" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutView #document", + "reason": "incremental" + } + ] +} +{ + "layers": [ + { + "name": "LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutView #document", + "rect": [400, 0, 400, 600], + "reason": "incremental" + } + ] + } + ], + "objectPaintInvalidations": [ + { + "object": "LayoutView #document", + "reason": "incremental" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/html/marquee/marquee-without-frame-no-crash-expected.txt b/third_party/WebKit/LayoutTests/html/marquee/marquee-without-frame-no-crash-expected.txt index b0ba67d..dea7c8c 100644 --- a/third_party/WebKit/LayoutTests/html/marquee/marquee-without-frame-no-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/html/marquee/marquee-without-frame-no-crash-expected.txt
@@ -2,4 +2,4 @@ PASS successfullyParsed is true TEST COMPLETE -foo +foo
diff --git a/third_party/WebKit/LayoutTests/http/tests/css/cross-fade-reload-expected.txt b/third_party/WebKit/LayoutTests/http/tests/css/cross-fade-reload-expected.txt index 630c83f..c6f20fc 100644 --- a/third_party/WebKit/LayoutTests/http/tests/css/cross-fade-reload-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/css/cross-fade-reload-expected.txt
@@ -1 +1 @@ -Test passes if it does not crash. +Test passes if it does not crash.
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js index e1941aba..0d394984 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
@@ -1055,7 +1055,7 @@ InspectorTest.isDedicatedWorker = function(target) { - return target && !target.hasBrowserCapability() && target.hasJSCapability() && !target.hasNetworkCapability() && !target.hasTargetCapability(); + return target && !target.hasBrowserCapability() && target.hasJSCapability() && !target.hasTargetCapability(); } InspectorTest.isServiceWorker = function(target)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-datareceived.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-datareceived.html index f079027..d78083b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-datareceived.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-datareceived.html
@@ -19,7 +19,7 @@ InspectorTest.evaluateInPage("loadIFrame()"); var encodedBytesReceived = 0; - function responseReceived(requestId, frameId, loaderId, time, resourceType, response) + function responseReceived(requestId, loaderId, time, resourceType, response, frameId) { var request = InspectorTest.networkLog.requestByManagerAndId(InspectorTest.networkManager, requestId); if (/resource\.php/.exec(request.url())) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/loading/preload-image-sizes-2x-expected.txt b/third_party/WebKit/LayoutTests/http/tests/loading/preload-image-sizes-2x-expected.txt index 8625515..bd558f9e 100644 --- a/third_party/WebKit/LayoutTests/http/tests/loading/preload-image-sizes-2x-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/loading/preload-image-sizes-2x-expected.txt
@@ -59,4 +59,4 @@ PASS successfullyParsed is true TEST COMPLETE - +
diff --git a/third_party/WebKit/LayoutTests/http/tests/loading/preload-image-sizes-expected.txt b/third_party/WebKit/LayoutTests/http/tests/loading/preload-image-sizes-expected.txt index 6eec29e..8fcd5be 100644 --- a/third_party/WebKit/LayoutTests/http/tests/loading/preload-image-sizes-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/loading/preload-image-sizes-expected.txt
@@ -51,4 +51,4 @@ PASS successfullyParsed is true TEST COMPLETE - +
diff --git a/third_party/WebKit/LayoutTests/http/tests/loading/slow-parsing-subframe-expected.txt b/third_party/WebKit/LayoutTests/http/tests/loading/slow-parsing-subframe-expected.txt index d91cdd9..45ce7fa3 100644 --- a/third_party/WebKit/LayoutTests/http/tests/loading/slow-parsing-subframe-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/loading/slow-parsing-subframe-expected.txt
@@ -8,5 +8,5 @@ frame "f1" - didFinishLoadForFrame main frame - didHandleOnloadEventsForFrame main frame - didFinishLoadForFrame -This tests that we get frame load callbacks in the proper order when a subframe is parsed and created from within a timer callback. +This tests that we get frame load callbacks in the proper order when a subframe is parsed and created from within a timer callback.
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/empty-urls-expected.txt b/third_party/WebKit/LayoutTests/http/tests/misc/empty-urls-expected.txt index a43904b..7efef2f 100644 --- a/third_party/WebKit/LayoutTests/http/tests/misc/empty-urls-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/misc/empty-urls-expected.txt
@@ -4,4 +4,4 @@ PASS: video src onerror fired PASS: audio onerror fired PASS: source onerror fired - +
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/form-target-iframe-location-change-expected.txt b/third_party/WebKit/LayoutTests/http/tests/misc/form-target-iframe-location-change-expected.txt index 65761ac..d9522d14 100644 --- a/third_party/WebKit/LayoutTests/http/tests/misc/form-target-iframe-location-change-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/misc/form-target-iframe-location-change-expected.txt
@@ -1,4 +1,4 @@ -Ensure that a form submission to a different frame is not cancelled if the origin frame navigates immediately thereafter. SUCCESS should appear in both iframes. +Ensure that a form submission to a different frame is not cancelled if the origin frame navigates immediately thereafter. SUCCESS should appear in both iframes. -------- Frame: 'formframe'
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigation/same-and-different-back-expected.txt b/third_party/WebKit/LayoutTests/http/tests/navigation/same-and-different-back-expected.txt index 33d5de9..821ca48 100644 --- a/third_party/WebKit/LayoutTests/http/tests/navigation/same-and-different-back-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/navigation/same-and-different-back-expected.txt
@@ -1,4 +1,4 @@ -We pass if we don't crash under ASAN. +We pass if we don't crash under ASAN. ============== Back Forward List ============== curr-> http://127.0.0.1:8000/navigation/same-and-different-back.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-denied-in-document.html b/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-denied-in-document.html index 84953fd..31a13c5b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-denied-in-document.html +++ b/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-denied-in-document.html
@@ -3,27 +3,27 @@ <head> <title>Push API: permissionState resolves with denied when permission is denied</title> <link rel="manifest" href="resources/push_manifest.json"> +<script src="../resources/permissions-helper.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="../serviceworker/resources/test-helpers.js"></script> </head> <body> <script> -async_test(function(test) { - var workerUrl = 'resources/empty_worker.js'; - var workerScope = 'resources/scope/' + location.pathname; - service_worker_unregister_and_register(test, workerUrl, workerScope) - .then(function(serviceWorkerRegistration) { - // If running manually, deny permission when prompted. - if (window.testRunner) - testRunner.setPermission('push-messaging', 'denied', location.origin, location.origin); - return serviceWorkerRegistration.pushManager.permissionState({userVisibleOnly: true}); +promise_test(function(test) { + const workerUrl = 'resources/empty_worker.js'; + const workerScope = 'resources/scope/' + location.pathname; + + // If running manually, deny permission when prompted. + return PermissionsHelper.setPermission('push-messaging', 'denied') + .then(() => service_worker_unregister_and_register(test, workerUrl, workerScope)) + .then(serviceWorkerRegistration => { + return serviceWorkerRegistration.pushManager.permissionState({ userVisibleOnly: true }); }) - .then(function(permissionStatus) { + .then(permissionStatus => { assert_equals(permissionStatus, 'denied'); return service_worker_unregister_and_done(test, workerScope); - }) - .catch(unreached_rejection(test)); + }); }, 'Push API: permissionState resolves with denied when permission is denied'); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-denied-in-service-worker.html b/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-denied-in-service-worker.html index 264c796..edef7ae 100644 --- a/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-denied-in-service-worker.html +++ b/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-denied-in-service-worker.html
@@ -2,9 +2,11 @@ <html> <head> <title> - Push API: permissionState when called in service worker resolves with denied when permission is denied + Push API: permissionState when called in service worker resolves with denied when permission is + denied </title> <link rel="manifest" href="resources/push_manifest.json"> +<script src="../resources/permissions-helper.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="../serviceworker/resources/test-helpers.js"></script> @@ -13,28 +15,30 @@ <body> <script> // This test uses the test runner. If running manually, deny permission when prompted. -async_test(function(test) { - if (window.testRunner) - testRunner.setPermission('push-messaging', 'denied', location.origin, location.origin); - +async_test(test => { var script = 'resources/instrumentation-service-worker.js'; var scope = 'resources/scope/' + location.pathname; - getActiveServiceWorkerWithMessagePort(test, script, scope).then(function(workerInfo) { - workerInfo.port.postMessage({command: 'permissionState', options: {userVisibleOnly: true}}); + PermissionsHelper.setPermission('push-messaging', 'denied') + .then(() => getActiveServiceWorkerWithMessagePort(test, script, scope)) + .then(workerInfo => { + workerInfo.port.postMessage({ command: 'permissionState', + options: { userVisibleOnly: true } }); - workerInfo.port.addEventListener('message', function(event) { - if (typeof event.data != 'object' || !event.data.command) - assert_unreached('Invalid message from the service worker'); + workerInfo.port.addEventListener('message', event => { + if (typeof event.data != 'object' || !event.data.command) + assert_unreached('Invalid message from the service worker'); - assert_equals(event.data.command, 'permissionState'); - assert_true(event.data.success, - 'permissionState should succeed. Error message: ' + event.data.errorMessage); - assert_equals(event.data.permission, 'denied'); + assert_equals(event.data.command, 'permissionState'); + assert_true(event.data.success, + 'permissionState should succeed. Error message: ' + + event.data.errorMessage); - test.done(); - }); - }).catch(unreached_rejection(test)); + assert_equals(event.data.permission, 'denied'); + test.done(); + }); + }) + .catch(unreached_rejection(test)); }, 'permissionState when called in service worker resolves with denied when permission is denied'); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-exception-in-document.html b/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-exception-in-document.html index 3b25291b..15afc1b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-exception-in-document.html +++ b/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-exception-in-document.html
@@ -3,31 +3,31 @@ <head> <title>Push API: permissionState fails with NotSupportedError if userVisibleOnly is not used</title> <link rel="manifest" href="resources/push_manifest.json"> +<script src="../resources/permissions-helper.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="../serviceworker/resources/test-helpers.js"></script> </head> <body> <script> -async_test(function(test) { - if (window.testRunner) - testRunner.setPermission('push-messaging', 'prompt', location.origin, location.origin); +promise_test(test => { + const workerUrl = 'resources/empty_worker.js'; + const workerScope = 'resources/scope/' + location.pathname; - var workerUrl = 'resources/empty_worker.js'; - var workerScope = 'resources/scope/' + location.pathname; - service_worker_unregister_and_register(test, workerUrl, workerScope) - .then(function(serviceWorkerRegistration) { - // If running manually, clear permissions before running this test. + // If running manually, clear permissions before running this test. + return PermissionsHelper.setPermission('push-messaging', 'prompt') + .then(() => service_worker_unregister_and_register(test, workerUrl, workerScope)) + .then(serviceWorkerRegistration => { return serviceWorkerRegistration.pushManager.permissionState(); }) - .then(function(permissionStatus) { + .then(permissionStatus => { assert_unreached('permissionStatus should have failed with a NotSupported exception'); - }, function(error) { + }, error => { assert_equals(error.name, 'NotSupportedError'); - assert_equals(error.message, - 'Push subscriptions that don\'t enable userVisibleOnly are not supported.'); - test.done(); - }).catch(unreached_rejection(test)); + assert_equals( + error.message, + 'Push subscriptions that don\'t enable userVisibleOnly are not supported.'); + }); }, 'Push API: permissionState fails with NotSupportedError if userVisibleOnly is not used'); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-exception-in-service-worker.html b/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-exception-in-service-worker.html index 7db69c13..fcead4e 100644 --- a/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-exception-in-service-worker.html +++ b/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-exception-in-service-worker.html
@@ -1,8 +1,12 @@ <!DOCTYPE html> <html> <head> -<title>Push API: permissionState when called in service worker fails with NotSupportedError if userVisibleOnly is not used</title> +<title> + Push API: permissionState when called in service worker fails with NotSupportedError if + userVisibleOnly is not used +</title> <link rel="manifest" href="resources/push_manifest.json"> +<script src="../resources/permissions-helper.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="../serviceworker/resources/test-helpers.js"></script> @@ -11,23 +15,24 @@ <body> <script> // This test uses the test runner. If running manually, clear permissions before running this test. -async_test(function(test) { - if (window.testRunner) - testRunner.setPermission('push-messaging', 'prompt', location.origin, location.origin); +async_test(test => { + const script = 'resources/instrumentation-service-worker.js'; + const scope = 'resources/scope/' + location.pathname; - var script = 'resources/instrumentation-service-worker.js'; - var scope = 'resources/scope/' + location.pathname; - - getActiveServiceWorkerWithMessagePort(test, script, scope).then(function(workerInfo) { - workerInfo.port.postMessage({command: 'permissionState'}); - workerInfo.port.addEventListener('message', function(event) { - assert_equals(event.data.errorMessage, - 'Push subscriptions that don\'t enable userVisibleOnly are not supported.'); - test.done(); - }); - - }).catch(unreached_rejection(test)); -}, 'Push API: permissionState when called in service worker fails with NotSupportedError if userVisibleOnly is not used'); + PermissionsHelper.setPermission('push-messaging', 'prompt') + .then(() => getActiveServiceWorkerWithMessagePort(test, script, scope)) + .then(workerInfo => { + workerInfo.port.postMessage({command: 'permissionState'}); + workerInfo.port.addEventListener('message', event => { + assert_equals( + event.data.errorMessage, + 'Push subscriptions that don\'t enable userVisibleOnly are not supported.'); + test.done(); + }); + }) + .catch(unreached_rejection(test)); +}, 'Push API: permissionState when called in service worker fails with NotSupportedError if ' + + 'userVisibleOnly is not used'); </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-granted-in-document.html b/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-granted-in-document.html index d5751f3..9ae1f8dd 100644 --- a/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-granted-in-document.html +++ b/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-granted-in-document.html
@@ -3,27 +3,27 @@ <head> <title>Push API: permissionState resolves with granted when permission is granted</title> <link rel="manifest" href="resources/push_manifest.json"> +<script src="../resources/permissions-helper.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="../serviceworker/resources/test-helpers.js"></script> </head> <body> <script> -async_test(function(test) { - var workerUrl = 'resources/empty_worker.js'; - var workerScope = 'resources/scope/' + location.pathname; - service_worker_unregister_and_register(test, workerUrl, workerScope) - .then(function(serviceWorkerRegistration) { - // If running manually, grant permission when prompted. - if (window.testRunner) - testRunner.setPermission('push-messaging', 'granted', location.origin, location.origin); +promise_test(test => { + const workerUrl = 'resources/empty_worker.js'; + const workerScope = 'resources/scope/' + location.pathname; + + // If running manually, grant permission when prompted. + return PermissionsHelper.setPermission('push-messaging', 'granted') + .then(() => service_worker_unregister_and_register(test, workerUrl, workerScope)) + .then(serviceWorkerRegistration => { return serviceWorkerRegistration.pushManager.permissionState({userVisibleOnly: true}); }) - .then(function(permissionStatus) { + .then(permissionStatus => { assert_equals(permissionStatus, 'granted'); return service_worker_unregister_and_done(test, workerScope); - }) - .catch(unreached_rejection(test)); + }); }, 'Push API: permissionState resolves with granted when permission is granted'); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-granted-in-service-worker.html b/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-granted-in-service-worker.html index dbe2c26..8e867ef 100644 --- a/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-granted-in-service-worker.html +++ b/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-granted-in-service-worker.html
@@ -5,6 +5,7 @@ permissionState when called in service worker resolves with granted when permission is granted </title> <link rel="manifest" href="resources/push_manifest.json"> +<script src="../resources/permissions-helper.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="../serviceworker/resources/test-helpers.js"></script> @@ -13,29 +14,32 @@ <body> <script> // This test uses the test runner. If running manually, grant permission when prompted. -async_test(function(test) { - if (window.testRunner) - testRunner.setPermission('push-messaging', 'granted', location.origin, location.origin); +async_test(test => { + const script = 'resources/instrumentation-service-worker.js'; + const scope = 'resources/scope/' + location.pathname; - var script = 'resources/instrumentation-service-worker.js'; - var scope = 'resources/scope/' + location.pathname; + PermissionsHelper.setPermission('push-messaging', 'granted') + .then(() => getActiveServiceWorkerWithMessagePort(test, script, scope)) + .then(workerInfo => { + workerInfo.port.postMessage({ command: 'permissionState', + options: { userVisibleOnly: true } }); - getActiveServiceWorkerWithMessagePort(test, script, scope).then(function(workerInfo) { - workerInfo.port.postMessage({command: 'permissionState', options: {userVisibleOnly: true}}); + workerInfo.port.addEventListener('message', event => { + if (typeof event.data != 'object' || !event.data.command) + assert_unreached('Invalid message from the service worker'); - workerInfo.port.addEventListener('message', function(event) { - if (typeof event.data != 'object' || !event.data.command) - assert_unreached('Invalid message from the service worker'); + assert_equals(event.data.command, 'permissionState'); + assert_true( + event.data.success, + 'permissionState should succeed. Error message: ' + event.data.errorMessage); - assert_equals(event.data.command, 'permissionState'); - assert_true(event.data.success, - 'permissionState should succeed. Error message: ' + event.data.errorMessage); - assert_equals(event.data.permission, 'granted'); + assert_equals(event.data.permission, 'granted'); - test.done(); - }); - }).catch(unreached_rejection(test)); -}, 'permissionState when called in service worker resolves with granted when permission is granted'); + test.done(); + }); + }) + .catch(unreached_rejection(test)); +}, 'permissionState in service workers resolves with granted when permission is granted'); </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-prompt-in-document.html b/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-prompt-in-document.html index 966b6d7..c7f4141 100644 --- a/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-prompt-in-document.html +++ b/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-prompt-in-document.html
@@ -3,28 +3,27 @@ <head> <title>Push API: permissionState resolves with prompt when no permission is set</title> <link rel="manifest" href="resources/push_manifest.json"> +<script src="../resources/permissions-helper.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="../serviceworker/resources/test-helpers.js"></script> </head> <body> <script> -async_test(function(test) { - if (window.testRunner) - testRunner.setPermission('push-messaging', 'prompt', location.origin, location.origin); +promise_test(test => { + const workerUrl = 'resources/empty_worker.js'; + const workerScope = 'resources/scope/' + location.pathname; - var workerUrl = 'resources/empty_worker.js'; - var workerScope = 'resources/scope/' + location.pathname; - service_worker_unregister_and_register(test, workerUrl, workerScope) - .then(function(serviceWorkerRegistration) { - // If running manually, clear permissions before running this test. - return serviceWorkerRegistration.pushManager.permissionState({userVisibleOnly: true}); + // If running manually, clear permissions before running this test. + return PermissionsHelper.setPermission('push-messaging', 'prompt') + .then(() => service_worker_unregister_and_register(test, workerUrl, workerScope)) + .then(serviceWorkerRegistration => { + return serviceWorkerRegistration.pushManager.permissionState({ userVisibleOnly: true }); }) - .then(function(permissionStatus) { + .then(permissionStatus => { assert_equals(permissionStatus, 'prompt'); return service_worker_unregister_and_done(test, workerScope); - }) - .catch(unreached_rejection(test)); + }); }, 'Push API: permissionState() resolves with prompt when permission is not set'); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-prompt-in-service-worker.html b/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-prompt-in-service-worker.html index f3a4240..bf8c4fc 100644 --- a/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-prompt-in-service-worker.html +++ b/third_party/WebKit/LayoutTests/http/tests/push_messaging/permission-state-prompt-in-service-worker.html
@@ -2,9 +2,11 @@ <html> <head> <title> - Push API: permissionState when called in service worker resolves with prompt when no permission is set + Push API: permissionState when called in service worker resolves with prompt when no permission + is set </title> <link rel="manifest" href="resources/push_manifest.json"> +<script src="../resources/permissions-helper.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="../serviceworker/resources/test-helpers.js"></script> @@ -13,28 +15,31 @@ <body> <script> // This test uses the test runner. If running manually, clear permissions before running this test. -async_test(function(test) { - if (window.testRunner) - testRunner.setPermission('push-messaging', 'prompt', location.origin, location.origin); +async_test(test => { + const script = 'resources/instrumentation-service-worker.js'; + const scope = 'resources/scope/' + location.pathname; - var script = 'resources/instrumentation-service-worker.js'; - var scope = 'resources/scope/' + location.pathname; + PermissionsHelper.setPermission('push-messaging', 'prompt') + .then(() => getActiveServiceWorkerWithMessagePort(test, script, scope)) + .then(workerInfo => { + workerInfo.port.postMessage({ command: 'permissionState', + options: { userVisibleOnly: true } }); - getActiveServiceWorkerWithMessagePort(test, script, scope).then(function(workerInfo) { - workerInfo.port.postMessage({command: 'permissionState', options: {userVisibleOnly: true}}); + workerInfo.port.addEventListener('message', event => { + if (typeof event.data != 'object' || !event.data.command) + assert_unreached('Invalid message from the service worker'); - workerInfo.port.addEventListener('message', function(event) { - if (typeof event.data != 'object' || !event.data.command) - assert_unreached('Invalid message from the service worker'); + assert_equals(event.data.command, 'permissionState'); + assert_true( + event.data.success, + 'permissionState should succeed. Error message: ' + event.data.errorMessage); - assert_equals(event.data.command, 'permissionState'); - assert_true(event.data.success, - 'permissionState should succeed. Error message: ' + event.data.errorMessage); - assert_equals(event.data.permission, 'prompt'); + assert_equals(event.data.permission, 'prompt'); - test.done(); - }); - }).catch(unreached_rejection(test)); + test.done(); + }); + }) + .catch(unreached_rejection(test)); }, 'permissionState when called in service worker resolves with prompt when no permission is set'); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-callback-explicit-domain-DENY-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-callback-explicit-domain-DENY-expected.txt index 49aa04f8..8747cd9 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-callback-explicit-domain-DENY-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-callback-explicit-domain-DENY-expected.txt
@@ -1,4 +1,4 @@ -Test that a child frame can't define a function and the use it to access parent properties after document.domain write blocks the access. +Test that a child frame can't define a function and the use it to access parent properties after document.domain write blocks the access.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/powerfulFeatureRestrictions/webshare-on-insecure-origin.html b/third_party/WebKit/LayoutTests/http/tests/security/powerfulFeatureRestrictions/webshare-on-insecure-origin.html deleted file mode 100644 index 7265711..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/security/powerfulFeatureRestrictions/webshare-on-insecure-origin.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/resources/get-host-info.js"></script> -<script> -if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) { - window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.pathname; -} else { - test(() => { - assert_false('share' in navigator, 'navigator has attribute \'share\'.'); - }, 'navigator.share should be undefined in non-secure context'); -} -</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/window-named-valueOf-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/window-named-valueOf-expected.txt index 61813406..94d4e08 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/window-named-valueOf-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/window-named-valueOf-expected.txt
@@ -1 +1 @@ -This passes if it doesn't alert the contents of innocent-victim. +This passes if it doesn't alert the contents of innocent-victim.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-frame-name-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-frame-name-expected.txt index 2bf1b9b9..f0a48500 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-frame-name-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-frame-name-expected.txt
@@ -1,2 +1,2 @@ CONSOLE ERROR: line 2: Uncaught SecurityError: Blocked a frame with origin "http://localhost:8000" from accessing a frame with origin "http://127.0.0.1:8000". Protocols, domains, and ports must match. - This test passes if it doesn't alert fail. + This test passes if it doesn't alert fail.
diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/delayed-handshake_wsh.py b/third_party/WebKit/LayoutTests/http/tests/websocket/delayed-handshake_wsh.py index 51a6290..1f0cff5 100644 --- a/third_party/WebKit/LayoutTests/http/tests/websocket/delayed-handshake_wsh.py +++ b/third_party/WebKit/LayoutTests/http/tests/websocket/delayed-handshake_wsh.py
@@ -6,8 +6,8 @@ def web_socket_do_extra_handshake(request): - time.sleep(1) # Wait for 1 second and then always accept. + time.sleep(1) # Wait for 1 second and then always accept. def web_socket_transfer_data(request): - pass # do nothing + pass # do nothing
diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/interleaved-fragments_wsh.py b/third_party/WebKit/LayoutTests/http/tests/websocket/interleaved-fragments_wsh.py index a5daeca..0865ff4 100644 --- a/third_party/WebKit/LayoutTests/http/tests/websocket/interleaved-fragments_wsh.py +++ b/third_party/WebKit/LayoutTests/http/tests/websocket/interleaved-fragments_wsh.py
@@ -9,4 +9,4 @@ def web_socket_transfer_data(request): # A new frame is arrived before the previous fragmented frame has finished. request.connection.write(stream.create_text_frame('This message ', opcode=common.OPCODE_TEXT, fin=0)) - request.connection.write(stream.create_text_frame('should be ignored.', opcode=common.OPCODE_TEXT, fin=1)) # Not OPCODE_CONTINUATION. + request.connection.write(stream.create_text_frame('should be ignored.', opcode=common.OPCODE_TEXT, fin=1)) # Not OPCODE_CONTINUATION.
diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/permessage-deflate-split-frames_wsh.py b/third_party/WebKit/LayoutTests/http/tests/websocket/permessage-deflate-split-frames_wsh.py index 5e13ead8..38070a0 100644 --- a/third_party/WebKit/LayoutTests/http/tests/websocket/permessage-deflate-split-frames_wsh.py +++ b/third_party/WebKit/LayoutTests/http/tests/websocket/permessage-deflate-split-frames_wsh.py
@@ -32,11 +32,11 @@ stripped = payload[:-4] header = create_header(common.OPCODE_TEXT, len(payload), - fin=0, rsv1=1, rsv2=0, rsv3=0, mask=False) + fin=0, rsv1=1, rsv2=0, rsv3=0, mask=False) request.ws_stream._write(header + payload) header = create_header(common.OPCODE_CONTINUATION, len(stripped), - fin=1, rsv1=0, rsv2=0, rsv3=0, mask=False) + fin=1, rsv1=0, rsv2=0, rsv3=0, mask=False) request.ws_stream._write(header + stripped)
diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/workers/resources/simple_wsh.py b/third_party/WebKit/LayoutTests/http/tests/websocket/workers/resources/simple_wsh.py index fc0271c..94fd512 100644 --- a/third_party/WebKit/LayoutTests/http/tests/websocket/workers/resources/simple_wsh.py +++ b/third_party/WebKit/LayoutTests/http/tests/websocket/workers/resources/simple_wsh.py
@@ -31,7 +31,7 @@ def web_socket_do_extra_handshake(request): - pass # Always accept. + pass # Always accept. def web_socket_transfer_data(request):
diff --git a/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt b/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt index 539d34f9..678a90d 100644 --- a/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt
@@ -60,9 +60,10 @@ CONSOLE MESSAGE: line 147: method constructor CONSOLE MESSAGE: line 147: method toString CONSOLE MESSAGE: line 147: interface CSSTransformComponent +CONSOLE MESSAGE: line 147: getter is2D CONSOLE MESSAGE: line 147: method constructor -CONSOLE MESSAGE: line 147: method is2D CONSOLE MESSAGE: line 147: method toString +CONSOLE MESSAGE: line 147: setter is2D CONSOLE MESSAGE: line 147: interface CSSTransformValue : CSSStyleValue CONSOLE MESSAGE: line 147: getter is2D CONSOLE MESSAGE: line 147: getter length
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot-expected.txt index 8b17141..612b2fe 100644 --- a/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot-expected.txt
@@ -11,7 +11,8 @@ ], "layoutNodeIndex": 0, "documentURL": "<string>", - "baseURL": "<string>" + "baseURL": "<string>", + "contentLanguage": "de" }, { "nodeType": 1, @@ -85,7 +86,9 @@ "childNodeIndexes": [ 10, 11, - 58 + 61, + 62, + 63 ], "attributes": [ { @@ -117,7 +120,9 @@ 33, 47, 48, - 57 + 57, + 58, + 60 ], "attributes": [ { @@ -558,10 +563,63 @@ { "nodeType": 3, "nodeName": "#text", + "nodeValue": "\n ", + "backendNodeId": "<number>" + }, + { + "nodeType": 1, + "nodeName": "A", + "nodeValue": "", + "backendNodeId": "<number>", + "childNodeIndexes": [ + 59 + ], + "attributes": [ + { + "name": "href", + "value": "https://www.google.com/" + } + ], + "layoutNodeIndex": 29, + "isClickable": true + }, + { + "nodeType": 3, + "nodeName": "#text", + "nodeValue": "Click ME!", + "backendNodeId": "<number>", + "layoutNodeIndex": 30 + }, + { + "nodeType": 3, + "nodeName": "#text", + "nodeValue": "\n", + "backendNodeId": "<number>", + "layoutNodeIndex": 31 + }, + { + "nodeType": 3, + "nodeName": "#text", "nodeValue": "\n", "backendNodeId": "<number>" }, { + "nodeType": 1, + "nodeName": "META", + "nodeValue": "", + "backendNodeId": "<number>", + "attributes": [ + { + "name": "http-equiv", + "value": "content-language" + }, + { + "name": "content", + "value": "de" + } + ] + }, + { "nodeType": 3, "nodeName": "#text", "nodeValue": "\n\n\n", @@ -584,7 +642,7 @@ "x": 0, "y": 0, "width": 785, - "height": 911 + "height": 935 }, "styleIndex": 0 }, @@ -594,7 +652,7 @@ "x": 8, "y": 8, "width": 769, - "height": 882 + "height": 919 }, "styleIndex": 1 }, @@ -604,7 +662,7 @@ "x": 8, "y": 8, "width": 769, - "height": 882 + "height": 919 }, "styleIndex": 1 }, @@ -1270,6 +1328,50 @@ } ], "styleIndex": 16 + }, + { + "domNodeIndex": 58, + "boundingBox": { + "x": 8, + "y": 910, + "width": 144, + "height": 17 + }, + "styleIndex": 17 + }, + { + "domNodeIndex": 59, + "boundingBox": { + "x": 8, + "y": 910, + "width": 144, + "height": 17 + }, + "layoutText": "Click ME!", + "inlineTextNodes": [ + { + "boundingBox": { + "x": 8, + "y": 910.875, + "width": 144, + "height": 16 + }, + "startCharacterIndex": 0, + "numCharacters": 9 + } + ], + "styleIndex": 17 + }, + { + "domNodeIndex": 60, + "boundingBox": { + "x": 0, + "y": 0, + "width": 0, + "height": 0 + }, + "layoutText": "\n", + "styleIndex": 3 } ], "computedStyles": [ @@ -1281,11 +1383,11 @@ }, { "name": "transform-origin", - "value": "392.5px 455.438px" + "value": "392.5px 467.438px" }, { "name": "height", - "value": "910.875px" + "value": "934.875px" }, { "name": "width", @@ -1313,11 +1415,11 @@ }, { "name": "transform-origin", - "value": "384.5px 440.719px" + "value": "384.5px 459.438px" }, { "name": "height", - "value": "881.438px" + "value": "918.875px" }, { "name": "width", @@ -1816,6 +1918,38 @@ "value": "rgb(255, 0, 0)" } ] + }, + { + "properties": [ + { + "name": "transform", + "value": "none" + }, + { + "name": "transform-origin", + "value": "0px 0px" + }, + { + "name": "height", + "value": "auto" + }, + { + "name": "width", + "value": "auto" + }, + { + "name": "display", + "value": "inline" + }, + { + "name": "outline-color", + "value": "rgb(0, 0, 238)" + }, + { + "name": "color", + "value": "rgb(0, 0, 238)" + } + ] } ] }
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/resources/dom-snapshot.html b/third_party/WebKit/LayoutTests/inspector-protocol/resources/dom-snapshot.html index cf98332..e74560c 100644 --- a/third_party/WebKit/LayoutTests/inspector-protocol/resources/dom-snapshot.html +++ b/third_party/WebKit/LayoutTests/inspector-protocol/resources/dom-snapshot.html
@@ -33,6 +33,8 @@ <div style="transform: rotateZ(90deg); width: 200px">Rotated text!</div> <iframe src='./simple-iframe.html' width="400" height="200"></iframe> <div id="shadow-host"></div> + <a href="https://www.google.com/">Click ME!</a> </div> +<meta http-equiv="content-language" content="de"> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/elements-hide-html-comments-expected.txt b/third_party/WebKit/LayoutTests/inspector/elements/elements-hide-html-comments-expected.txt index a9f31629..538878f 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/elements-hide-html-comments-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/elements/elements-hide-html-comments-expected.txt
@@ -1,5 +1,4 @@ Verifies show/hide HTML comments setting. - HTML comments shown: <!-- comment 1 --> - <html>
diff --git a/third_party/WebKit/LayoutTests/intersection-observer/resources/cross-origin-subframe.html b/third_party/WebKit/LayoutTests/intersection-observer/resources/cross-origin-subframe.html index 0cc117cb..b7f7821 100644 --- a/third_party/WebKit/LayoutTests/intersection-observer/resources/cross-origin-subframe.html +++ b/third_party/WebKit/LayoutTests/intersection-observer/resources/cross-origin-subframe.html
@@ -31,12 +31,7 @@ } function coordinatesToClientRectJson(top, right, bottom, left) { - return { - top: top, - right: right, - bottom: bottom, - left: left - }; + return [left, right, top, bottom]; } // Note that we never use RAF in this code, because this frame might get render-throttled. @@ -53,7 +48,7 @@ entries = entries.concat(observer.takeRecords()); nextStep = step1; var expected = [{ - boundingClientRect: coordinatesToClientRectJson(8, 208, 108, 308), + boundingClientRect: coordinatesToClientRectJson(208, 108, 308, 8), intersectionRect: coordinatesToClientRectJson(0, 0, 0, 0), rootBounds: "null", target: target.id
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/absolute-layer-specified-left-or-right-auto-width-moved-vertically-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/absolute-layer-specified-left-or-right-auto-width-moved-vertically-expected.txt index f6650db6..9e8b3b77 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/absolute-layer-specified-left-or-right-auto-width-moved-vertically-expected.txt +++ b/third_party/WebKit/LayoutTests/paint/invalidation/absolute-layer-specified-left-or-right-auto-width-moved-vertically-expected.txt
@@ -1,2 +1,2 @@ -There should be no repaint when the divs are moved vertically. Left Right +There should be no repaint when the divs are moved vertically. LeftRight SUCCESS
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/absolute-position-moved-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/absolute-position-moved-expected.txt index 137508aa..a57d8a8 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/absolute-position-moved-expected.txt +++ b/third_party/WebKit/LayoutTests/paint/invalidation/absolute-position-moved-expected.txt
@@ -8,7 +8,7 @@ "paintInvalidations": [ { "object": "LayoutBlockFlow (positioned) DIV id='absoluteDiv' class='absolute green'", - "rect": [108, 5100, 100, 100], + "rect": [108, 1100, 100, 100], "reason": "disappeared" }, {
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/absolute-position-moved.html b/third_party/WebKit/LayoutTests/paint/invalidation/absolute-position-moved.html index bb9b6e3..0f56e80 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/absolute-position-moved.html +++ b/third_party/WebKit/LayoutTests/paint/invalidation/absolute-position-moved.html
@@ -15,6 +15,6 @@ </head> <body style="height:2000px;" onload="runRepaintAndPixelTest()"> <!-- You should see 1 green rectangle in the output and no red. --> - <div style="top: 5000px;" class="fixed red"><div id="absoluteDiv" style="top:100px; left:100px;" class="absolute green"></div></div> + <div style="top: 1000px;" class="fixed red"><div id="absoluteDiv" style="top:100px; left:100px;" class="absolute green"></div></div> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/background-misaligned-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/background-misaligned-expected.html index de80ee65..b9f82cb 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/background-misaligned-expected.html +++ b/third_party/WebKit/LayoutTests/paint/invalidation/background-misaligned-expected.html
@@ -3,7 +3,7 @@ width: 267px; height: 270px; border: solid black; - background-image: url(../backgrounds/size/resources/bikes.bmp); + background-image: url(../../fast/backgrounds/size/resources/bikes.bmp); -webkit-background-size: 500% 500%; position: relative; ">
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/background-misaligned.html b/third_party/WebKit/LayoutTests/paint/invalidation/background-misaligned.html index e325b20..e6177aec 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/background-misaligned.html +++ b/third_party/WebKit/LayoutTests/paint/invalidation/background-misaligned.html
@@ -10,7 +10,7 @@ width: 267px; height: 270px; border: solid black; - background-image: url(../../backgrounds/size/resources/bikes.bmp); + background-image: url(../../fast/backgrounds/size/resources/bikes.bmp); -webkit-background-size: 500% 500%; position: relative; "> @@ -20,6 +20,7 @@ position: absolute; bottom: 0; right: 0; + background: red; "></div> </div> </body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/border-image-outset-add-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/border-image-outset-add-repaint-expected.html index 608c15d6..1778e1dc 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/border-image-outset-add-repaint-expected.html +++ b/third_party/WebKit/LayoutTests/paint/invalidation/border-image-outset-add-repaint-expected.html
@@ -5,7 +5,7 @@ width: 75px; height: 75px; display: inline-block; - border-image-source: url("../borders/resources/border-image.png"); + border-image-source: url("../../fast/borders/resources/border-image.png"); border-image-slice: 21 30 30 21 fill; border-image-width: 5; }
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/border-image-outset-add-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/border-image-outset-add-repaint.html index d571f52..34db278a 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/border-image-outset-add-repaint.html +++ b/third_party/WebKit/LayoutTests/paint/invalidation/border-image-outset-add-repaint.html
@@ -5,7 +5,7 @@ width: 75px; height: 75px; display: inline-block; - border-image-source: url("../../borders/resources/border-image.png"); + border-image-source: url("../../fast/borders/resources/border-image.png"); border-image-slice: 21 30 30 21 fill; border-image-width: 1; }
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/border-image-outset-change-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/border-image-outset-change-repaint-expected.html index 3ac6cfa..a243b645 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/border-image-outset-change-repaint-expected.html +++ b/third_party/WebKit/LayoutTests/paint/invalidation/border-image-outset-change-repaint-expected.html
@@ -5,7 +5,7 @@ width: 75px; height: 75px; display: inline-block; - border-image-source: url("../borders/resources/border-image.png"); + border-image-source: url("../../fast/borders/resources/border-image.png"); border-image-slice: 21 30 30 21 fill; border-image-width: 1; border-image-outset: 5;
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/border-image-outset-change-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/border-image-outset-change-repaint.html index c6ae03b..c25103d1 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/border-image-outset-change-repaint.html +++ b/third_party/WebKit/LayoutTests/paint/invalidation/border-image-outset-change-repaint.html
@@ -5,7 +5,7 @@ width: 75px; height: 75px; display: inline-block; - border-image-source: url("../../borders/resources/border-image.png"); + border-image-source: url("../../fast/borders/resources/border-image.png"); border-image-slice: 21 30 30 21 fill; border-image-width: 1; border-image-outset: 1;
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/fixed-position-layer-moved-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/fixed-position-layer-moved-expected.txt index f434e00b2..b7fe820 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/fixed-position-layer-moved-expected.txt +++ b/third_party/WebKit/LayoutTests/paint/invalidation/fixed-position-layer-moved-expected.txt
@@ -1,2 +1,2 @@ -There should be no repaint when the divs are moved. A B +There should be no repaint when the divs are moved. AB SUCCESS
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/flexbox/repaint-on-layout-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/flexbox/repaint-on-layout-expected.txt index c1f99c7..1e8fbf7 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/flexbox/repaint-on-layout-expected.txt +++ b/third_party/WebKit/LayoutTests/paint/invalidation/flexbox/repaint-on-layout-expected.txt
@@ -9,7 +9,7 @@ { "object": "LayoutBlockFlow (floating) DIV class='state'", "rect": [712, 8, 80, 20], - "reason": "geometry" + "reason": "style change" }, { "object": "LayoutBlockFlow DIV id='badge'", @@ -25,12 +25,12 @@ "reason": "disappeared" }, { - "object": "LayoutBlockFlow (floating) DIV class='state'", - "reason": "geometry" + "object": "LayoutText #text", + "reason": "disappeared" }, { - "object": "LayoutText #text", - "reason": "geometry" + "object": "LayoutBlockFlow (floating) DIV class='state'", + "reason": "style change" } ] }
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/remove-inline-block-descendant-of-flex-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/remove-inline-block-descendant-of-flex-expected.txt index d8f8c8ee..2eb1f91 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/remove-inline-block-descendant-of-flex-expected.txt +++ b/third_party/WebKit/LayoutTests/paint/invalidation/remove-inline-block-descendant-of-flex-expected.txt
@@ -39,6 +39,10 @@ "reason": "disappeared" }, { + "object": "LayoutText #text", + "reason": "disappeared" + }, + { "object": "LayoutBlockFlow DIV", "reason": "geometry" },
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/repaint-svg-after-style-change-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/repaint-svg-after-style-change-expected.txt deleted file mode 100644 index 85b3b0a..0000000 --- a/third_party/WebKit/LayoutTests/paint/invalidation/repaint-svg-after-style-change-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x221 - LayoutBlockFlow {HTML} at (0,0) size 800x221 - LayoutBlockFlow {BODY} at (8,8) size 784x205 - LayoutSVGRoot {svg} at (0,0) size 201x201 - LayoutSVGContainer {g} at (0,0) size 200x200 - LayoutSVGPath {path} at (0,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [data="M 0 0 L 0 200 L 200 200 L 200 0 Z"] - LayoutSVGPath {path} at (0,0) size 200x200 [fill={[type=SOLID] [color=#008000]}] [data="M 0 0 L 0 200 L 200 200 L 200 0 Z"] - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/animations/rotate-transform-equivalent-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/animations/rotate-transform-equivalent-expected.txt index a5e89f4..ae6ad4e 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/animations/rotate-transform-equivalent-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/animations/rotate-transform-equivalent-expected.txt
@@ -5,10 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 195x19 text run at (0,0) width 195: "There should be no red visible." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 106x106 LayoutBlockFlow (positioned) {DIV} at (8,28) size 106x106 [color=#FF0000] [border: (3px solid #FF0000)] LayoutText {#text} at (3,5) size 56x114
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/geometry/clipping-foreground-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/compositing/geometry/clipping-foreground-expected.txt index 146a9d5..8ea54ac1 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/compositing/geometry/clipping-foreground-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/geometry/clipping-foreground-expected.txt
@@ -15,7 +15,6 @@ LayoutBlockFlow (positioned) zI: -1 {DIV} at (-40,-40) size 150x150 [color=#808080] [bgcolor=#C86464] [border: (2px solid #000000)] LayoutText zI: -1 {#text} at (22,22) size 106x40 text run at (22,22) width 106: "Behind" - LayoutText zI: -1 {#text} at (0,0) size 0x0 layer at (50,303) size 100x100 LayoutBlockFlow (positioned) {DIV} at (22,82) size 100x100 [bgcolor=#008000] [border: (2px solid #000000)] LayoutText {#text} at (22,22) size 55x41 @@ -26,8 +25,6 @@ LayoutText {#text} at (30,30) size 126x81 text run at (30,30) width 59: "Box" text run at (30,71) width 126: "contents" - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (158,351) size 150x150 LayoutBlockFlow (positioned) zI: 1 {DIV} at (90,90) size 150x150 [color=#808080] [bgcolor=#C8C880] [border: (2px solid #000000)] LayoutText zI: 1 {#text} at (22,22) size 86x81 @@ -38,7 +35,6 @@ LayoutBlockFlow (positioned) zI: -1 {DIV} at (-40,-40) size 150x150 [color=#808080] [bgcolor=#C86464] [border: (2px solid #000000)] LayoutText zI: -1 {#text} at (22,22) size 106x40 text run at (22,22) width 106: "Behind" - LayoutText zI: -1 {#text} at (0,0) size 0x0 layer at (374,146) size 100x100 backgroundClip at (402,114) size 180x180 clip at (402,114) size 180x180 LayoutBlockFlow (positioned) {DIV} at (22,82) size 100x100 [bgcolor=#008000] [border: (2px solid #000000)] LayoutText {#text} at (22,22) size 55x41 @@ -49,8 +45,6 @@ LayoutText {#text} at (30,30) size 126x81 text run at (30,30) width 59: "Box" text run at (30,71) width 126: "contents" - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (482,194) size 150x150 backgroundClip at (402,114) size 180x180 clip at (402,114) size 180x180 LayoutBlockFlow (positioned) zI: 1 {DIV} at (90,90) size 150x150 [color=#808080] [bgcolor=#C8C880] [border: (2px solid #000000)] LayoutText zI: 1 {#text} at (22,22) size 86x81
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/iframes/composited-iframe-alignment-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/compositing/iframes/composited-iframe-alignment-expected.txt index 43344ce..d40855dc 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/compositing/iframes/composited-iframe-alignment-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/iframes/composited-iframe-alignment-expected.txt
@@ -10,7 +10,6 @@ text run at (384,20) width 89: "with no gaps. " LayoutBR {BR} at (0,0) size 0x0 LayoutBR {BR} at (0,40) size 0x19 - LayoutText {#text} at (0,0) size 0x0 layer at (100,100) size 440x340 LayoutIFrame (positioned) {IFRAME} at (100,100) size 440x340 [border: (20px solid #000000)] layer at (0,0) size 400x300
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/clip-parent-reset-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/clip-parent-reset-expected.txt index 7995f65..a92c8bdc 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/clip-parent-reset-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/clip-parent-reset-expected.txt
@@ -6,8 +6,6 @@ LayoutBlockFlow (anonymous) at (0,150) size 784x20 LayoutText {#text} at (0,0) size 624x19 text run at (0,0) width 624: "This test verifies the clip parent of a layer gets correctly reset when it gained a non-composited clip." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 150x150 transparent LayoutBlockFlow {DIV} at (0,0) size 150x150 [bgcolor=#FF0000] layer at (8,8) size 100x100 scrollWidth 200 scrollHeight 200
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt deleted file mode 100644 index dded8e3..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -PASS repainted when expected -FAIL did not repaint when expected -PASS repainted when expected -PASS did not repaint as expected -FAIL did not repaint when expected -
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/video-frame-size-change-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/compositing/video-frame-size-change-expected.txt index 8457da1..a0940e4 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/compositing/video-frame-size-change-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/video-frame-size-change-expected.txt
@@ -10,7 +10,6 @@ LayoutText {#text} at (320,165) size 4x19 text run at (320,165) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,52) size 320x180 LayoutVideo {VIDEO} at (0,0) size 320x180 layer at (332,52) size 320x180
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt deleted file mode 100644 index 04b8f1e..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x261 - LayoutBlockFlow {HTML} at (0,0) size 800x261 - LayoutBlockFlow {BODY} at (8,8) size 784x245 - LayoutText {#text} at (240,225) size 4x19 - text run at (240,225) width 4: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (28,28) size 200x200 - LayoutHTMLCanvas {CANVAS} at (20,20) size 200x200 [bgcolor=#00008000] -layer at (272,28) size 200x200 - LayoutHTMLCanvas {CANVAS} at (264,20) size 200x200 [bgcolor=#00008000]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/css1/classification/display-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/css1/classification/display-expected.txt index f511b8e..049d050d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/css1/classification/display-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/css1/classification/display-expected.txt
@@ -56,7 +56,6 @@ LayoutBlockFlow {P} at (0,371) size 769x20 LayoutText {#text} at (0,0) size 247x19 text run at (0,0) width 247: "There should be no text after the colon:" - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,407) size 769x60 LayoutBlockFlow (anonymous) at (0,0) size 769x20 LayoutText {#text} at (0,0) size 112x19 @@ -117,7 +116,6 @@ LayoutBlockFlow {P} at (4,228) size 747x20 LayoutText {#text} at (0,0) size 247x19 text run at (0,0) width 247: "There should be no text after the colon:" - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (4,264) size 747x60 LayoutBlockFlow (anonymous) at (0,0) size 747x20 LayoutText {#text} at (0,0) size 112x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/css2.1/t090501-c414-flt-ln-03-d-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/css2.1/t090501-c414-flt-ln-03-d-expected.txt index 676193d..32438c6 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/css2.1/t090501-c414-flt-ln-03-d-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/css2.1/t090501-c414-flt-ln-03-d-expected.txt
@@ -23,7 +23,6 @@ LayoutBlockFlow (floating) {P} at (21,21) size 150x58 [color=#FFFFFF] [bgcolor=#008080] [border: (3px solid #00FFFF)] LayoutText {#text} at (19,19) size 48x19 text run at (19,19) width 48: "AAAA" - LayoutText {#text} at (0,0) size 0x0 LayoutInline {SPAN} at (0,0) size 17x25 [color=#FFFFFF] [bgcolor=#800080] [border: (3px solid #FF00FF)] LayoutText {#text} at (512,21) size 11x19 text run at (512,21) width 11: "B"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/css2.1/t1204-root-e-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/css2.1/t1204-root-e-expected.txt index 9bd19a4..f67fa8c 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/css2.1/t1204-root-e-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/css2.1/t1204-root-e-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow (anonymous) at (0,0) size 800x0 LayoutInline {<pseudo:before>} at (0,0) size 0x0 LayoutTextFragment (anonymous) at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {BODY} at (8,16) size 784x76 LayoutBlockFlow {P} at (0,0) size 784x20 LayoutText {#text} at (0,0) size 216x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/css2.1/t1205-c561-list-displ-00-b-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/css2.1/t1205-c561-list-displ-00-b-expected.txt index c91ec866..c2acb10e 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/css2.1/t1205-c561-list-displ-00-b-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/css2.1/t1205-c561-list-displ-00-b-expected.txt
@@ -28,7 +28,6 @@ LayoutBlockFlow {DIV} at (0,116) size 784x20 [color=#000080] LayoutText {#text} at (0,0) size 168x19 text run at (0,0) width 168: "5. This should be line five." - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,136) size 784x60 [color=#000080] LayoutBlockFlow (anonymous) at (0,0) size 784x20 LayoutText {#text} at (0,0) size 162x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/css3/filters/regions-expanding-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/css3/filters/regions-expanding-expected.txt deleted file mode 100644 index 7888b65..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/css3/filters/regions-expanding-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x600 - LayoutBlockFlow {HTML} at (0,0) size 800x600 - LayoutBlockFlow {BODY} at (8,8) size 784x584 - LayoutText {#text} at (160,75) size 4x19 - text run at (160,75) width 4: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (324,75) size 4x19 - text run at (324,75) width 4: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,8) size 160x90 - LayoutImage {IMG} at (0,0) size 160x90 -layer at (172,8) size 160x90 - LayoutImage {IMG} at (164,0) size 160x90 -layer at (336,8) size 160x90 - LayoutImage {IMG} at (328,0) size 160x90
diff --git a/third_party/WebKit/LayoutTests/platform/linux/css3/selectors3/xhtml/css3-modsel-d3-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/css3/selectors3/xhtml/css3-modsel-d3-expected.txt index 2e665fbf..b373b23e 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/css3/selectors3/xhtml/css3-modsel-d3-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/css3/selectors3/xhtml/css3-modsel-d3-expected.txt
@@ -10,11 +10,8 @@ LayoutBlockFlow (anonymous) at (0,36) size 784x0 LayoutInline {stub} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutInline {t} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutInline {t} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {t} at (0,36) size 784x32 [bgcolor=#00FF00]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/css3/selectors3/xml/css3-modsel-d3-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/css3/selectors3/xml/css3-modsel-d3-expected.txt index 427cb60..a126a05 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/css3/selectors3/xml/css3-modsel-d3-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/css3/selectors3/xml/css3-modsel-d3-expected.txt
@@ -9,11 +9,8 @@ LayoutBlockFlow (anonymous) at (0,36) size 800x0 LayoutInline {stub} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutInline {t} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutInline {t} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {t} at (0,36) size 800x32 [bgcolor=#00FF00]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-001-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-001-expected.txt index b21e114..2f94d06 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-001-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-001-expected.txt
@@ -11,7 +11,6 @@ text run at (0,0) width 432: "The shape of the caret, and whether it flashes, are not part of the test." LayoutBlockFlow (anonymous) at (0,72) size 784x119 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,88) size 412x114 clip at (9,89) size 410x112 LayoutTextControl {TEXTAREA} at (0,0) size 412x114 [color=#FFFFFF] [bgcolor=#000000] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (11,11) size 390x46
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-003-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-003-expected.txt index d42f991..416974b 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-003-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-003-expected.txt
@@ -12,7 +12,6 @@ text run at (0,0) width 432: "The shape of the caret, and whether it flashes, are not part of the test." LayoutBlockFlow (anonymous) at (0,72) size 784x119 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,88) size 412x114 clip at (9,89) size 410x112 LayoutTextControl {TEXTAREA} at (0,0) size 412x114 [color=#00FF00] [bgcolor=#000000] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (11,11) size 390x46
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-004-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-004-expected.txt index 29747c4..35cfd34 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-004-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-004-expected.txt
@@ -13,7 +13,6 @@ text run at (0,0) width 432: "The shape of the caret, and whether it flashes, are not part of the test." LayoutBlockFlow (anonymous) at (0,92) size 784x119 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,108) size 412x114 clip at (9,109) size 410x112 LayoutTextControl {TEXTAREA} at (0,0) size 412x114 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (11,11) size 390x46
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-005-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-005-expected.txt index bf7fa29..17248c5 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-005-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-005-expected.txt
@@ -13,7 +13,6 @@ text run at (0,0) width 432: "The shape of the caret, and whether it flashes, are not part of the test." LayoutBlockFlow (anonymous) at (0,92) size 784x119 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,108) size 412x114 clip at (9,109) size 410x112 LayoutTextControl {TEXTAREA} at (0,0) size 412x114 [color=#FFFFFF] [bgcolor=#000000] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (11,11) size 390x46
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-010-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-010-expected.txt index 6350cd3..fcb99b4 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-010-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-010-expected.txt
@@ -12,7 +12,6 @@ LayoutBlockFlow (anonymous) at (0,72) size 784x82 LayoutTextControl {INPUT} at (0,0) size 504x82 [color=#FFFFFF] [bgcolor=#000000] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (20,100) size 480x58 LayoutBlockFlow {DIV} at (12,12) size 480x58 caret: position 0 of child 0 {DIV} of {#document-fragment} of child 5 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-014-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-014-expected.txt index 88acb89..b6298d2 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-014-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-014-expected.txt
@@ -14,5 +14,4 @@ LayoutText {#text} at (10,1) size 80x55 text run at (10,1) width 80: "link" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 caret: position 0 of child 0 {#text} of child 5 {A} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-015-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-015-expected.txt index 8254888..fa01594 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-015-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-color-015-expected.txt
@@ -18,5 +18,4 @@ LayoutText {#text} at (10,1) size 80x55 text run at (10,1) width 80: "link" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 caret: position 0 of child 0 {#text} of child 8 {A} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-position-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-position-expected.txt index 8b2387f1..7197e3f0 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-position-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/caret/caret-position-expected.txt
@@ -7,7 +7,6 @@ text run at (0,1) width 313: "This tests if the caret position is aligned correctly. " LayoutTextControl {INPUT} at (312.95,0) size 205x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (324,11) size 200x16 LayoutBlockFlow {DIV} at (3,3) size 200x16 caret: position 0 of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/input/caret-at-the-edge-of-input-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/input/caret-at-the-edge-of-input-expected.txt index 4f17c1fed..5b09a13 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/input/caret-at-the-edge-of-input-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/input/caret-at-the-edge-of-input-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow (anonymous) at (0,20) size 784x22 LayoutTextControl {INPUT} at (0,0) size 94x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,31) size 90x16 scrollWidth 295 LayoutBlockFlow {DIV} at (2,3) size 90x16 LayoutText {#text} at (0,0) size 294x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/input/reveal-caret-of-multiline-input-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/input/reveal-caret-of-multiline-input-expected.txt index 56a804e..5ff1611 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/input/reveal-caret-of-multiline-input-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/input/reveal-caret-of-multiline-input-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 595: "When the caret is scrolled out, on starting typing it must be brought to the center of the control." LayoutBlockFlow (anonymous) at (0,20) size 784x171 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 101x166 clip at (9,29) size 84x164 scrollY 120.00 scrollHeight 516 LayoutTextControl {TEXTAREA} at (0,0) size 101x166 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 80x512
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/inserting/4960120-1-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/inserting/4960120-1-expected.txt index 0ba26105..0efda62d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/inserting/4960120-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/inserting/4960120-1-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 507: "This tests for a bug where the first newline entered into a text area would be lost." LayoutBlockFlow (anonymous) at (0,36) size 784x36 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,44) size 179x36 clip at (9,45) size 177x34 LayoutTextControl {TEXTAREA} at (0,0) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 175x32
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/drop-text-without-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/drop-text-without-selection-expected.txt index 1e2efa4..0bf88688 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/drop-text-without-selection-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/drop-text-without-selection-expected.txt
@@ -31,7 +31,6 @@ LayoutText {#text} at (158,1) size 162x19 text run at (158,1) width 162: "drop me into the text field" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,100) size 784x2 clip at (0,0) size 0x0 LayoutBlockFlow {HR} at (0,92) size 784x2 [border: (1px inset #EEEEEE)] layer at (10,113) size 150x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/3690719-expected.png b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/3690719-expected.png deleted file mode 100644 index 3723517..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/3690719-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/3690719-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/3690719-expected.txt deleted file mode 100644 index 93c842a..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/3690719-expected.txt +++ /dev/null
@@ -1,143 +0,0 @@ -EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification -EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x600 - LayoutBlockFlow {HTML} at (0,0) size 800x600 - LayoutBlockFlow {BODY} at (8,3) size 784x581 [bgcolor=#FFFFFF] - LayoutBlockFlow {CENTER} at (0,0) size 784x272 - LayoutTable {TABLE} at (0,0) size 784x20 - LayoutTableSection {TBODY} at (0,0) size 784x20 - LayoutTableRow {TR} at (0,0) size 784x16 - LayoutTableCell {TD} at (0,0) size 784x16 [r=0 c=0 rs=1 cs=1] - LayoutInline {FONT} at (0,0) size 104x15 - LayoutInline {A} at (0,0) size 104x15 [color=#0000CC] - LayoutText {#text} at (680,0) size 104x15 - text run at (680,0) width 104: "Personalized Home" - LayoutTableRow {TR} at (0,16) size 784x4 - LayoutTableCell {TD} at (0,17) size 784x1 [r=1 c=0 rs=1 cs=1] - LayoutImage {IMG} at (0,0) size 1x1 - LayoutBlockFlow (anonymous) at (0,20) size 784x40 - LayoutBR {BR} at (392,0) size 0x19 - LayoutBR {BR} at (392,20) size 0x19 - LayoutBlockFlow {DIV} at (0,60) size 784x108 [border: (2px solid #AAAAFF)] - LayoutTable {TABLE} at (215.50,2) size 353x24 - LayoutTableSection {TBODY} at (0,0) size 353x24 - LayoutTableRow {TR} at (0,0) size 353x24 - LayoutTableCell {TD} at (0,0) size 353x24 [r=0 c=0 rs=1 cs=1] - LayoutInline {FONT} at (0,0) size 345x15 - LayoutInline {B} at (0,0) size 26x15 - LayoutText {#text} at (4,4) size 26x15 - text run at (4,4) width 26: "Web" - LayoutText {#text} at (29,4) size 13x15 - text run at (29,4) width 13: " " - LayoutInline {A} at (0,0) size 39x15 [color=#0000CC] - LayoutText {#text} at (41,4) size 39x15 - text run at (41,4) width 39: "Images" - LayoutText {#text} at (79,4) size 13x15 - text run at (79,4) width 13: " " - LayoutInline {A} at (0,0) size 40x15 [color=#0000CC] - LayoutText {#text} at (91,4) size 40x15 - text run at (91,4) width 40: "Groups" - LayoutText {#text} at (130,4) size 13x15 - text run at (130,4) width 13: " " - LayoutInline {A} at (0,0) size 30x15 [color=#0000CC] - LayoutText {#text} at (142,4) size 30x15 - text run at (142,4) width 30: "News" - LayoutText {#text} at (171,4) size 13x15 - text run at (171,4) width 13: " " - LayoutInline {A} at (0,0) size 43x15 [color=#0000CC] - LayoutText {#text} at (183,4) size 43x15 - text run at (183,4) width 43: "Froogle" - LayoutText {#text} at (225,4) size 13x15 - text run at (225,4) width 13: " " - LayoutInline {A} at (0,0) size 32x15 [color=#0000CC] - LayoutText {#text} at (237,4) size 32x15 - text run at (237,4) width 32: "Local" - LayoutInline {SUP} at (0,0) size 1x14 - LayoutInline {A} at (0,0) size 29x15 - LayoutInline {FONT} at (0,0) size 29x15 [color=#FF0000] - LayoutText {#text} at (268,4) size 29x15 - text run at (268,4) width 29: "New!" - LayoutText {#text} at (296,4) size 13x15 - text run at (296,4) width 13: " " - LayoutInline {B} at (0,0) size 41x15 - LayoutInline {A} at (0,0) size 41x15 [color=#0000CC] - LayoutText {#text} at (308,4) size 41x15 - text run at (308,4) width 41: "more \x{BB}" - LayoutTable {TABLE} at (28,26) size 728x44 - LayoutTableSection {TBODY} at (0,0) size 728x44 - LayoutTableRow {TR} at (0,0) size 728x44 - LayoutTableCell {TD} at (0,12) size 182x20 [r=0 c=0 rs=1 cs=1] - LayoutText {#text} at (0,0) size 4x19 - text run at (0,0) width 4: " " - LayoutTableCell {TD} at (182,0) size 364x44 [r=0 c=1 rs=1 cs=1] - LayoutTextControl {INPUT} at (0,0) size 364x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] - LayoutBR {BR} at (364,16) size 0x0 - LayoutButton {INPUT} at (72,22) size 102x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutBlockFlow (anonymous) at (8,3) size 86x16 - LayoutText {#text} at (0,0) size 86x16 - text run at (0,0) width 86: "Google Search" - LayoutButton {INPUT} at (174,22) size 118x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutBlockFlow (anonymous) at (8,3) size 102x16 - LayoutText {#text} at (0,0) size 102x16 - text run at (0,0) width 102: "I'm Feeling Lucky" - LayoutTableCell {TD} at (546,0) size 182x36 [r=0 c=2 rs=1 cs=1] - LayoutInline {FONT} at (0,0) size 74x36 - LayoutText {#text} at (0,0) size 6x12 - text run at (0,0) width 6: " " - LayoutInline {A} at (0,0) size 68x12 [color=#0000CC] - LayoutText {#text} at (6,0) size 68x12 - text run at (6,0) width 68: "Advanced Search" - LayoutBR {BR} at (74,10) size 0x0 - LayoutText {#text} at (0,12) size 6x12 - text run at (0,12) width 6: " " - LayoutInline {A} at (0,0) size 44x12 [color=#0000CC] - LayoutText {#text} at (6,12) size 44x12 - text run at (6,12) width 44: "Preferences" - LayoutBR {BR} at (50,22) size 0x0 - LayoutText {#text} at (0,24) size 6x12 - text run at (0,24) width 6: " " - LayoutInline {A} at (0,0) size 64x12 [color=#0000CC] - LayoutText {#text} at (6,24) size 64x12 - text run at (6,24) width 64: "Language Tools" - LayoutBlockFlow (anonymous) at (2,70) size 780x36 - LayoutBR {BR} at (390,0) size 0x19 - LayoutInline {FONT} at (0,0) size 148x15 - LayoutInline {FONT} at (0,0) size 28x15 [color=#FF0000] - LayoutText {#text} at (316,20) size 28x15 - text run at (316,20) width 28: "New!" - LayoutText {#text} at (344,20) size 3x15 - text run at (344,20) width 3: " " - LayoutInline {A} at (0,0) size 114x15 [color=#0000CC] - LayoutText {#text} at (347,20) size 114x15 - text run at (347,20) width 114: "Personalize this page" - LayoutText {#text} at (461,20) size 3x15 - text run at (461,20) width 3: "." - LayoutText {#text} at (0,0) size 0x0 - LayoutBlockFlow (anonymous) at (0,168) size 784x76 - LayoutBR {BR} at (392,0) size 0x19 - LayoutBR {BR} at (392,20) size 0x19 - LayoutBR {BR} at (392,40) size 0x19 - LayoutInline {FONT} at (0,0) size 318x15 - LayoutInline {A} at (0,0) size 118x15 [color=#0000CC] - LayoutText {#text} at (233,60) size 118x15 - text run at (233,60) width 118: "Advertising Programs" - LayoutText {#text} at (350,60) size 11x15 - text run at (350,60) width 11: " - " - LayoutInline {A} at (0,0) size 104x15 [color=#0000CC] - LayoutText {#text} at (360,60) size 104x15 - text run at (360,60) width 104: "Business Solutions" - LayoutText {#text} at (463,60) size 11x15 - text run at (463,60) width 11: " - " - LayoutInline {A} at (0,0) size 78x15 [color=#0000CC] - LayoutText {#text} at (473,60) size 78x15 - text run at (473,60) width 78: "About Google" - LayoutBlockFlow {P} at (0,260) size 784x12 - LayoutInline {FONT} at (0,0) size 60x12 - LayoutText {#text} at (362,0) size 60x12 - text run at (362,0) width 60: "\x{A9}2005 Google" -layer at (220,92) size 360x16 - LayoutBlockFlow {DIV} at (2,3) size 360x16 -selection start: position 0 of child 1 {TABLE} of child 4 {DIV} of child 0 {CENTER} of body -selection end: position 1 of child 3 {#text} of child 4 {FONT} of child 4 {DIV} of child 0 {CENTER} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/4960137-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/4960137-expected.txt index ef7707c6..d146118 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/4960137-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/4960137-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 658: "This tests for an ASSERTion failure when setting the main frame's selection inside a node in a subframe." LayoutBlockFlow (anonymous) at (0,36) size 784x154 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,44) size 304x154 LayoutIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #EEEEEE)] layer at (0,0) size 300x150
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/4975120-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/4975120-expected.txt index 16cdd58..8c5ceff4 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/4975120-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/4975120-expected.txt
@@ -11,7 +11,6 @@ LayoutTextControl {INPUT} at (0,0) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutBR {BR} at (154,16) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,67) size 150x16 LayoutBlockFlow {DIV} at (2,3) size 150x16 LayoutText {#text} at (0,0) size 18x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/5354455-2-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/5354455-2-expected.txt index ca303b6..0706456 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/5354455-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/5354455-2-expected.txt
@@ -19,5 +19,4 @@ text run at (529,20) width 70: "Right click" text run at (0,40) width 543: "on the empty space outside and to the right of the black border, the selection should be" text run at (0,60) width 59: "removed." - LayoutText {#text} at (0,0) size 0x0 caret: position 0 of child 0 {#text} of child 1 {H1} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/drag-in-iframe-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/drag-in-iframe-expected.txt index d486c41..53d462fc 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/drag-in-iframe-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/drag-in-iframe-expected.txt
@@ -11,7 +11,6 @@ text run at (0,20) width 156: "appears inside the frame." LayoutBlockFlow (anonymous) at (0,56) size 784x152 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,64) size 302x152 LayoutIFrame {IFRAME} at (0,0) size 302x152 [border: (1px solid #000000)] layer at (0,0) size 300x150
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/expanding-selections2-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/expanding-selections2-expected.txt index 5c9e3db..18ba8b9 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/expanding-selections2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/expanding-selections2-expected.txt
@@ -18,5 +18,4 @@ LayoutBlockFlow (anonymous) at (0,76) size 784x20 LayoutText {#text} at (0,0) size 242x19 text run at (0,0) width 242: "This text is outside the editable region." - LayoutText {#text} at (0,0) size 0x0 caret: position 1 of child 0 {#text} of child 1 {SPAN} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/focus-body-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/focus-body-expected.txt index 16a99f8..796d6d4 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/focus-body-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/focus-body-expected.txt
@@ -7,5 +7,4 @@ LayoutText {#text} at (0,0) size 437x19 text run at (0,0) width 219: "This test focuses an editable body. " text run at (218,0) width 219: "Its contents should not be selected." - LayoutText {#text} at (0,0) size 0x0 caret: position 0 of child 0 {#text} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/mixed-editability-1-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/mixed-editability-1-expected.txt index cf1c70d..0a5a2d6 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/mixed-editability-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/mixed-editability-1-expected.txt
@@ -13,6 +13,5 @@ text run at (484,0) width 296: "To run this test manually, double click between" text run at (779,0) width 5: " " text run at (0,20) width 351: "the first two letters of the first word of the first sentence." - LayoutText {#text} at (0,0) size 0x0 selection start: position 0 of child 0 {#text} of child 0 {SPAN} of body selection end: position 2 of child 0 {#text} of child 0 {SPAN} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/move-by-sentence-001-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/move-by-sentence-001-expected.txt index 61ec399..e864c42 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/move-by-sentence-001-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/move-by-sentence-001-expected.txt
@@ -27,5 +27,4 @@ LayoutText {#text} at (28,14) size 240x26 text run at (28,14) width 240: "This is some linked text" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 caret: position 1 of child 0 {#text} of child 1 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/node-removal-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/node-removal-2-expected.png deleted file mode 100644 index b0f83f7..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/node-removal-2-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/node-removal-2-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/node-removal-2-expected.txt deleted file mode 100644 index 7da77e4..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/node-removal-2-expected.txt +++ /dev/null
@@ -1,26 +0,0 @@ -EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification -EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x600 - LayoutBlockFlow {HTML} at (0,0) size 800x600 - LayoutBlockFlow {BODY} at (8,8) size 784x584 - LayoutBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 747x39 - text run at (0,0) width 678: "This tests behavior when a node that serves as the start or end of a selection is removed from the document. " - text run at (678,0) width 69: "Ideally, we" - text run at (0,20) width 649: "would just adjust the selection when an endpoint is removed, for now, we just blow away the selection." - LayoutBlockFlow {P} at (0,56) size 784x40 - LayoutText {#text} at (0,0) size 771x39 - text run at (0,0) width 475: "This test creates a selection that ends inside of a node that will be removed. " - text run at (475,0) width 172: "Then the node is removed. " - text run at (647,0) width 124: "Then a Select All is" - text run at (0,20) width 64: "executed. " - text run at (64,20) width 253: "The entire document should be selected." - LayoutBlockFlow {DIV} at (0,112) size 784x20 - LayoutText {#text} at (0,0) size 35x19 - text run at (0,0) width 35: "hello " - LayoutText {#text} at (35,0) size 42x19 - text run at (35,0) width 42: "world!" -selection start: position 0 of child 0 {#text} of child 1 {P} of body -selection end: position 7 of child 1 {#text} of child 5 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/selection-actions-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/selection-actions-expected.txt index 74112022..f6a353dd3 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/editing/selection/selection-actions-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/editing/selection/selection-actions-expected.txt
@@ -32,6 +32,5 @@ LayoutBR {BR} at (63,135) size 0x0 LayoutText {#text} at (0,140) size 124x19 text run at (0,140) width 124: "This is a paragraph." - LayoutText {#text} at (0,0) size 0x0 selection start: position 11 of child 2 {#text} of body selection end: position 1 of child 7 {BR} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/external/wpt/url/url-setters-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/external/wpt/url/url-setters-expected.txt index 96b43a3..b282b6c 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/external/wpt/url/url-setters-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/external/wpt/url/url-setters-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 571 tests; 272 PASS, 299 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 574 tests; 275 PASS, 299 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS URL: Setting <a://example.net>.protocol = '' The empty string is not a valid scheme. Setter leaves the URL unchanged. PASS <a>: Setting <a://example.net>.protocol = '' The empty string is not a valid scheme. Setter leaves the URL unchanged. @@ -85,6 +85,9 @@ PASS URL: Setting <data:text/html,<p>Test>.protocol = 'view-source+data:foo : bar' Stuff after the first ':' is ignored PASS <a>: Setting <data:text/html,<p>Test>.protocol = 'view-source+data:foo : bar' Stuff after the first ':' is ignored PASS <area>: Setting <data:text/html,<p>Test>.protocol = 'view-source+data:foo : bar' Stuff after the first ':' is ignored +PASS URL: Setting <http://foo.com:443/>.protocol = 'https' Port is set to null if it is the default for new scheme. +PASS <a>: Setting <http://foo.com:443/>.protocol = 'https' Port is set to null if it is the default for new scheme. +PASS <area>: Setting <http://foo.com:443/>.protocol = 'https' Port is set to null if it is the default for new scheme. PASS URL: Setting <file:///home/you/index.html>.username = 'me' No host means no username PASS <a>: Setting <file:///home/you/index.html>.username = 'me' No host means no username PASS <area>: Setting <file:///home/you/index.html>.username = 'me' No host means no username
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/canvas-ellipse-connecting-line-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/canvas-ellipse-connecting-line-expected.txt deleted file mode 100644 index be08368..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/canvas-ellipse-connecting-line-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x321 - LayoutBlockFlow {HTML} at (0,0) size 800x321 - LayoutBlockFlow {BODY} at (8,8) size 784x305 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,8) size 300x300 - LayoutHTMLCanvas {CANVAS} at (0,0) size 300x300
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/canvas-shadow-source-in-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/canvas-shadow-source-in-expected.txt index 01c88f98..c370adf 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/canvas-shadow-source-in-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/canvas-shadow-source-in-expected.txt
@@ -13,8 +13,6 @@ text run at (0,0) width 69: "Test Image" LayoutBlockFlow (anonymous) at (0,247) size 784x207 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 202x202 LayoutHTMLCanvas {CANVAS} at (0,0) size 202x202 [border: (1px solid #999999)] layer at (8,255) size 202x202
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/nested-tables-with-before-after-content-crash-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/nested-tables-with-before-after-content-crash-expected.png deleted file mode 100644 index 8bb2b2d3..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/nested-tables-with-before-after-content-crash-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/table-before-after-child-add-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/table-before-after-child-add-expected.txt index e64b7e8..ba38caf 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/table-before-after-child-add-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/table-before-after-child-add-expected.txt
@@ -24,4 +24,3 @@ LayoutBlockFlow (anonymous) at (0,96) size 784x20 LayoutText {#text} at (0,0) size 77x19 text run at (0,0) width 77: "CONTENT" - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/table-cell-before-after-child-add-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/table-cell-before-after-child-add-expected.txt index 5ecd0e8..392e075 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/table-cell-before-after-child-add-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/table-cell-before-after-child-add-expected.txt
@@ -22,4 +22,3 @@ LayoutBlockFlow (anonymous) at (0,56) size 784x20 LayoutText {#text} at (0,0) size 77x19 text run at (0,0) width 77: "CONTENT" - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/table-row-before-after-child-add-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/table-row-before-after-child-add-expected.txt index 4fc959d..938e08fd 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/table-row-before-after-child-add-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/table-row-before-after-child-add-expected.txt
@@ -24,4 +24,3 @@ LayoutBlockFlow (anonymous) at (0,96) size 784x20 LayoutText {#text} at (0,0) size 77x19 text run at (0,0) width 77: "CONTENT" - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/table-table-before-after-child-add-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/table-table-before-after-child-add-expected.txt index b0c4d96f..1eee016 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/table-table-before-after-child-add-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css-generated-content/table-table-before-after-child-add-expected.txt
@@ -28,4 +28,3 @@ LayoutBlockFlow (anonymous) at (0,96) size 784x20 LayoutText {#text} at (0,0) size 77x19 text run at (0,0) width 77: "CONTENT" - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/ZeroOpacityLayers-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css/ZeroOpacityLayers-expected.txt index 734a8ad..af1d44e 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/ZeroOpacityLayers-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/ZeroOpacityLayers-expected.txt
@@ -11,7 +11,6 @@ LayoutBlockFlow (positioned) {DIV} at (10,10) size 160x160 [bgcolor=#FF0000] LayoutText {#text} at (0,0) size 150x19 text run at (0,0) width 150: "Should not see this text." - LayoutText {#text} at (0,0) size 0x0 layer at (40,40) size 140x140 LayoutBlockFlow (positioned) {DIV} at (10,10) size 140x140 [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 119x39
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/ZeroOpacityLayers2-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css/ZeroOpacityLayers2-expected.txt index 3bf05a7..b18df7f 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/ZeroOpacityLayers2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/ZeroOpacityLayers2-expected.txt
@@ -11,7 +11,6 @@ LayoutBlockFlow (positioned) {DIV} at (10,10) size 160x160 [bgcolor=#FF0000] LayoutText {#text} at (0,0) size 150x19 text run at (0,0) width 150: "Should not see this text." - LayoutText {#text} at (0,0) size 0x0 layer at (40,40) size 140x140 transparent LayoutBlockFlow (positioned) {DIV} at (10,10) size 140x140 [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 119x39
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/font-face-opentype-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css/font-face-opentype-expected.txt index 195e762d..5e45828 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/font-face-opentype-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/font-face-opentype-expected.txt
@@ -28,7 +28,6 @@ LayoutText {#text} at (0,16) size 736x16 text run at (0,16) width 736: "PQRSTUVWXYZ[\\]^_`abcdefghijklmnoqrstuvwxyz{|}~" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,160) size 784x40 LayoutText {#text} at (0,0) size 744x39 text run at (0,0) width 744: "Check if glyphs not in Ahem.otf can be rendered using a fallback font. If the test passes, you should see a single-quote" @@ -38,5 +37,3 @@ LayoutText {#text} at (0,2) size 3x16 text run at (0,2) width 3: "'" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/font-face-synthetic-bold-italic-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css/font-face-synthetic-bold-italic-expected.txt index 11731e5..8fbeb27 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/font-face-synthetic-bold-italic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/font-face-synthetic-bold-italic-expected.txt
@@ -59,4 +59,3 @@ LayoutInline {STRONG} at (0,0) size 0x0 LayoutInline {I} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/font-face-weight-matching-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css/font-face-weight-matching-expected.txt index 21f39c5..824c4a7 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/font-face-weight-matching-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/font-face-weight-matching-expected.txt
@@ -55,7 +55,6 @@ text run at (100,2) width 16: "A" LayoutText {#text} at (116,0) size 4x19 text run at (116,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutInline {SPAN} at (0,0) size 16x16 LayoutText {#text} at (120,2) size 16x16 text run at (120,2) width 16: "A" @@ -66,7 +65,6 @@ text run at (140,2) width 16: "A" LayoutText {#text} at (156,0) size 4x19 text run at (156,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutInline {SPAN} at (0,0) size 16x16 LayoutText {#text} at (160,2) size 16x16 text run at (160,2) width 16: "A" @@ -77,7 +75,6 @@ text run at (180,2) width 16: "A" LayoutText {#text} at (196,0) size 4x19 text run at (196,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutInline {SPAN} at (0,0) size 16x16 LayoutText {#text} at (200,2) size 16x16 text run at (200,2) width 16: "A" @@ -88,7 +85,6 @@ text run at (220,2) width 16: "A" LayoutText {#text} at (236,0) size 4x19 text run at (236,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutInline {SPAN} at (0,0) size 16x16 LayoutText {#text} at (240,2) size 16x16 text run at (240,2) width 16: "A" @@ -98,4 +94,3 @@ LayoutText {#text} at (260,2) size 16x16 text run at (260,2) width 16: "A" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/h1-in-section-elements-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css/h1-in-section-elements-expected.txt index 5721458f..aa11940e 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/h1-in-section-elements-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/h1-in-section-elements-expected.txt
@@ -6,7 +6,6 @@ LayoutBlockFlow {P} at (0,0) size 784x20 LayoutText {#text} at (0,0) size 439x19 text run at (0,0) width 439: "For each of pairs, the first one and the second one should be identical." - LayoutText {#text} at (0,0) size 0x0 LayoutTable (floating) {TABLE} at (0,36) size 152x365 LayoutTableSection {TBODY} at (0,0) size 152x365 LayoutTableRow {TR} at (0,2) size 152x75
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/ignore-empty-focus-ring-rects-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css/ignore-empty-focus-ring-rects-expected.txt index 1c58bda..2c69705 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/ignore-empty-focus-ring-rects-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/ignore-empty-focus-ring-rects-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x20 LayoutText {#text} at (0,0) size 748x19 text run at (0,0) width 748: "Should ignore empty rects when drawing focus ring. Passes if there is only a single focus ring around the green square." - LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 100x150 LayoutBlockFlow (positioned) {DIV} at (8,28) size 100x150 LayoutBlockFlow (anonymous) at (0,0) size 100x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/invalidation-errors-2-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css/invalidation-errors-2-expected.txt index 75e85f7..b6a2b8d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/invalidation-errors-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/invalidation-errors-2-expected.txt
@@ -12,7 +12,6 @@ LayoutBlockFlow (anonymous) at (0,36) size 784x0 LayoutInline {DIV} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 layer at (8,44) size 200x200 LayoutBlockFlow (floating) {DIV} at (0,0) size 200x200 [color=#FFFFFF] [bgcolor=#006400]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/invalidation-errors-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css/invalidation-errors-expected.txt index 75e85f7..b6a2b8d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/invalidation-errors-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/invalidation-errors-expected.txt
@@ -12,7 +12,6 @@ LayoutBlockFlow (anonymous) at (0,36) size 784x0 LayoutInline {DIV} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 layer at (8,44) size 200x200 LayoutBlockFlow (floating) {DIV} at (0,0) size 200x200 [color=#FFFFFF] [bgcolor=#006400]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/nested-floating-relative-position-percentages-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css/nested-floating-relative-position-percentages-expected.txt index 6988856a..a209a4a3 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/nested-floating-relative-position-percentages-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/nested-floating-relative-position-percentages-expected.txt
@@ -9,9 +9,6 @@ layer at (400,28) size 630x420 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 LayoutBlockFlow (relative positioned) (floating) {DIV} at (0,20) size 630x420 LayoutBR {BR} at (630,0) size 0x19 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (90,33) size 200x200 LayoutBlockFlow (relative positioned) (floating) {DIV} at (5,5) size 200x200 [bgcolor=#000000] LayoutImage {IMG} at (0,0) size 200x200
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/dom/inner-text-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/dom/inner-text-expected.txt index 3c938fca..f9cb233 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/dom/inner-text-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/dom/inner-text-expected.txt
@@ -8,4 +8,3 @@ LayoutInline {SPAN} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 221x19 text run at (0,0) width 221: " This text should only appear once." - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/011-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/011-expected.txt index 195a8a7a..c5de436 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/011-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/011-expected.txt
@@ -28,4 +28,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (16,15) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt deleted file mode 100644 index 97c96f9..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x600 - LayoutBlockFlow {HTML} at (0,0) size 800x600 - LayoutBlockFlow {BODY} at (8,8) size 784x584 - LayoutImage (floating) {IMG} at (0,0) size 100x100 - LayoutBlockFlow {DIV} at (0,0) size 784x100 - LayoutBR {BR} at (100,0) size 0x19 - LayoutImage (floating) {IMG} at (0,100) size 100x100 - LayoutText {#text} at (0,0) size 0x0 - LayoutImage (floating) {IMG} at (100,100) size 100x100 [bgcolor=#0000FF]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt index 38b9a60..3eb05646 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt
@@ -23,7 +23,6 @@ LayoutBR {BR} at (259,15) size 0x0 LayoutBR {BR} at (0,20) size 0x19 LayoutBlockFlow (floating) {DIV} at (0,40) size 100x100 [bgcolor=#008000] - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,40) size 150x40 LayoutText {#text} at (100,0) size 46x39 text run at (100,0) width 46: "a green"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/link-href-change-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/link-href-change-expected.txt index 4aea0fa..86a7bda 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/link-href-change-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/link-href-change-expected.txt
@@ -7,4 +7,3 @@ LayoutText {#text} at (15,0) size 336x19 text run at (15,0) width 336: "This should have a 10px solid black border around it." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/outerHTML-img-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/outerHTML-img-expected.txt index 9f24058d..2e6ffd2 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/outerHTML-img-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/outerHTML-img-expected.txt
@@ -17,4 +17,3 @@ LayoutBlockFlow (anonymous) at (0,72) size 784x64 LayoutImage {IMG} at (0,0) size 52x64 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/window-resize-scrollbars-test-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/window-resize-scrollbars-test-expected.txt index d481d63..19f18fec 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/window-resize-scrollbars-test-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/window-resize-scrollbars-test-expected.txt
@@ -5,4 +5,3 @@ LayoutBlockFlow {BODY} at (8,8) size 752x560 LayoutText {#text} at (0,0) size 484x19 text run at (0,0) width 484: "This window should not have scroll bars. If it has scroll bars, try to use them." - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/window-scrollbars-test-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/window-scrollbars-test-expected.txt index 8946ee4f..7846258 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/window-scrollbars-test-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/dynamic/window-scrollbars-test-expected.txt
@@ -5,4 +5,3 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 260x19 text run at (0,0) width 260: "This window should not have scroll bars." - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/events/context-no-deselect-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/events/context-no-deselect-expected.txt index d326657..7e879ac2 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/events/context-no-deselect-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/events/context-no-deselect-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutTextControl {INPUT} at (0,0) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,11) size 150x16 LayoutBlockFlow {DIV} at (2,3) size 150x16 LayoutText {#text} at (0,0) size 104x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/button/button-align-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/button/button-align-expected.txt index 2266e36..5dcd6b1 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/button/button-align-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/button/button-align-expected.txt
@@ -33,7 +33,6 @@ LayoutText {#text} at (46,0) size 192x16 text run at (46,0) width 192: "This is should be center justified." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,124) size 784x22 LayoutButton {BUTTON} at (0,0) size 300x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] LayoutBlockFlow (anonymous) at (8,3) size 284x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/form-added-to-table-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/form-added-to-table-expected.png deleted file mode 100644 index 298bc71..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/form-added-to-table-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/form-added-to-table-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/form-added-to-table-expected.txt deleted file mode 100644 index 67fd7a3..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/form-added-to-table-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x600 - LayoutBlockFlow {HTML} at (0,0) size 800x600 - LayoutBlockFlow {BODY} at (8,8) size 784x584 - LayoutTable {TABLE} at (0,0) size 226x26 - LayoutTableSection {TBODY} at (0,0) size 226x26 - LayoutTableRow {TR} at (0,2) size 226x22 - LayoutTableCell {TD} at (2,2) size 222x22 [r=0 c=0 rs=1 cs=1] - LayoutText {#text} at (1,1) size 220x19 - text run at (1,1) width 220: "This test passes if it does not crash." -selection start: position 0 of child 0 {#text} of child 0 {TD} of child 0 {TR} of child 0 {TBODY} of child 1 {TABLE} of body -selection end: position 1 of child 1 {TABLE} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/indeterminate-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/indeterminate-expected.txt index cbf5486..cce56b3b 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/indeterminate-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/indeterminate-expected.txt
@@ -5,6 +5,5 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (20,1) size 491x19 text run at (20,1) width 491: " This checkbox should look 50% transparent and should be in the mixed state." - LayoutText {#text} at (0,0) size 0x0 layer at (12,11) size 13x13 transparent LayoutBlockFlow {INPUT} at (4,3) size 13x13
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/number/number-appearance-datalist-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/number/number-appearance-datalist-expected.txt index 05b1068..a3eda7be 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/number/number-appearance-datalist-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/number/number-appearance-datalist-expected.txt
@@ -27,7 +27,6 @@ LayoutFlexibleBox {DIV} at (2,3) size 150x16 LayoutBlockFlow {DIV} at (0,0) size 117.14x16 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,11) size 117x16 LayoutBlockFlow {DIV} at (0,0) size 117.14x16 layer at (168,11) size 117x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/number/number-appearance-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/number/number-appearance-rtl-expected.txt index 9ce08b6..27e462e 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/number/number-appearance-rtl-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/number/number-appearance-rtl-expected.txt
@@ -24,7 +24,6 @@ LayoutBlockFlow {DIV} at (15,0) size 135x16 LayoutBlockFlow {DIV} at (0,0) size 15x16 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,152) size 784x22 LayoutTextControl {INPUT} at (0,0) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutFlexibleBox {DIV} at (2,3) size 150x16 @@ -35,7 +34,6 @@ LayoutFlexibleBox {DIV} at (2,3) size 150x16 LayoutBlockFlow {DIV} at (0,0) size 135x16 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,228) size 784x22 LayoutTextControl {INPUT} at (0,0) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutFlexibleBox {DIV} at (2,3) size 150x16 @@ -46,7 +44,6 @@ LayoutFlexibleBox {DIV} at (2,3) size 150x16 LayoutBlockFlow {DIV} at (15,0) size 135x16 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (655,19) size 135x16 LayoutBlockFlow {DIV} at (0,0) size 135x16 LayoutText {#text} at (128,0) size 7x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/preserveFormDuringResidualStyle-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/preserveFormDuringResidualStyle-expected.txt index 744fa4ce..79376bb 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/preserveFormDuringResidualStyle-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/preserveFormDuringResidualStyle-expected.txt
@@ -17,7 +17,6 @@ LayoutTableCell {TD} at (2,2) size 19x21 [r=0 c=0 rs=1 cs=1] LayoutImage {INPUT} at (1,1) size 17x19 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow (anonymous) at (0,25) size 784x0 LayoutInline {FONT} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/search/search-appearance-basic-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/search/search-appearance-basic-expected.txt index 29bb091..6f41f54 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/search/search-appearance-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/search/search-appearance-basic-expected.txt
@@ -96,7 +96,6 @@ LayoutFlexibleBox {DIV} at (18,4) size 130x13 LayoutBlockFlow {DIV} at (0,0) size 118x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (15,15) size 137x16 LayoutBlockFlow {DIV} at (0,0) size 137x16 LayoutText {#text} at (0,0) size 18x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/search/search-cancel-button-style-sharing-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/search/search-cancel-button-style-sharing-expected.txt index f6dca7c..607ca3cf 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/search/search-cancel-button-style-sharing-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/search/search-cancel-button-style-sharing-expected.txt
@@ -17,7 +17,6 @@ LayoutBlockFlow {DIV} at (0,0) size 137x16 LayoutBlockFlow {DIV} at (138,3.50) size 9x9 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,47) size 137x16 LayoutBlockFlow {DIV} at (0,0) size 137x16 layer at (171,47) size 137x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/listbox-appearance-basic-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/listbox-appearance-basic-expected.txt index 12b84a2..bceed53a 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/listbox-appearance-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/listbox-appearance-basic-expected.txt
@@ -7,7 +7,6 @@ text run at (47,59) width 4: " " LayoutText {#text} at (130,59) size 4x19 text run at (130,59) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (181,59) size 4x19 text run at (181,59) width 4: " " LayoutText {#text} at (251,59) size 4x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/listbox-with-display-none-option-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/listbox-with-display-none-option-expected.txt index d256cc5..5a3a7f1 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/listbox-with-display-none-option-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/listbox-with-display-none-option-expected.txt
@@ -18,7 +18,6 @@ LayoutText {#text} at (320,119) size 4x19 text run at (320,119) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,69) size 58x121 clip at (9,70) size 41x119 LayoutListBox {SELECT} at (0,17) size 58x121 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {OPTION} at (1,1) size 41x17
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/menulist-deselect-update-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/menulist-deselect-update-expected.txt index 89c5a80..deb8b0d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/menulist-deselect-update-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/menulist-deselect-update-expected.txt
@@ -10,4 +10,3 @@ LayoutText (anonymous) at (4,1) size 35x16 text run at (4,1) width 35: "PASS" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-align-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-align-expected.txt index 558c18c9..15cdca4 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-align-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-align-expected.txt
@@ -40,7 +40,6 @@ LayoutText (anonymous) at (4,1) size 174x16 text run at (4,1) width 174: "This is should be left justified." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,136) size 784x20 LayoutMenuList {SELECT} at (0,0) size 300x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] LayoutBlockFlow (anonymous) at (1,1) size 298x18
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-autofilled-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-autofilled-expected.txt index a42afcf..17db2f9 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-autofilled-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-autofilled-expected.txt
@@ -12,4 +12,3 @@ LayoutText (anonymous) at (4,1) size 23x18 text run at (4,1) width 23: "CA" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-change-listbox-size-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-change-listbox-size-expected.txt index 2d402356..38e1717 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-change-listbox-size-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-change-listbox-size-expected.txt
@@ -21,7 +21,6 @@ text run at (0,0) width 316: "This list box should be tall enough to fit 6 options." LayoutBlockFlow (anonymous) at (0,92) size 784x104 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,100) size 54x104 clip at (9,101) size 37x102 LayoutListBox {SELECT} at (0,0) size 54x104 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {OPTION} at (1,1) size 37x17
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-empty-option-height-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-empty-option-height-expected.txt index c0f555c..13be07ed 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-empty-option-height-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-empty-option-height-expected.txt
@@ -8,4 +8,3 @@ LayoutText (anonymous) at (0,0) size 4x16 text run at (0,0) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-initial-position-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-initial-position-expected.txt index 70291bd..91b2145f 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-initial-position-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-initial-position-expected.txt
@@ -15,8 +15,7 @@ LayoutBR {BR} at (161,106) size 0x0 LayoutText {#text} at (155,162) size 4x19 text run at (155,162) width 4: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (159,177) size 0x0 LayoutText {#text} at (0,182) size 211x19 text run at (0,182) width 211: "dynamic insert of selected option:" LayoutBR {BR} at (211,197) size 0x0 @@ -42,8 +41,7 @@ text run at (4,1) width 134: "this should be selected" LayoutText {#text} at (156,333) size 4x19 text run at (156,333) width 4: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (160,348) size 0x0 LayoutText {#text} at (0,353) size 211x19 text run at (0,353) width 211: "dynamic insert of selected option:" LayoutBR {BR} at (211,368) size 0x0 @@ -57,7 +55,6 @@ text run at (0,0) width 191: "Display 'none' to 'inline-block'" LayoutBlockFlow (anonymous) at (0,445) size 784x70 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 155x70 clip at (9,29) size 138x68 scrollY 119.00 scrollHeight 238 LayoutListBox {SELECT} at (0,20) size 155x70 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {OPTION} at (1,1) size 138x17
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-item-background-clip-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-item-background-clip-expected.txt index 30971c3b..dc81437 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-item-background-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-item-background-clip-expected.txt
@@ -18,7 +18,6 @@ text run at (158,20) width 4: "." LayoutBlockFlow (anonymous) at (0,56) size 784x68 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,64) size 60x68 clip at (11,67) size 39x62 scrollHeight 74 LayoutListBox {SELECT} at (0,0.25) size 60x67.75 [bgcolor=#FFFFFF] [border: (3px solid #0000FF)] LayoutBlockFlow {OPTION} at (6,6) size 33x17
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt index f9c613a..20f9997a 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x87 LayoutBlockFlow {BODY} at (8,8) size 784x71 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 372x70 clip at (9,9) size 355x68 LayoutListBox {SELECT} at (0,0) size 371.77x70 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {OPTION} at (1,1) size 354.77x17 [color=#FFFFCC] [bgcolor=#0000FF]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-appearance-preventDefault-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-appearance-preventDefault-expected.txt index 26b2945..468ca8d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-appearance-preventDefault-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-appearance-preventDefault-expected.txt
@@ -6,8 +6,6 @@ LayoutBR {BR} at (0,0) size 0x19 LayoutText {#text} at (0,20) size 666x19 text run at (0,20) width 666: "This tests that preventDefault called onmousedown will prevent a caret from being placed in the text field." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,50) size 154x22 clip at (12,52) size 150x18 LayoutTextControl (positioned) {INPUT} at (10,50) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] layer at (12,53) size 150x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-no-renderer-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-no-renderer-expected.txt index e9c8d20..94db64d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-no-renderer-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-no-renderer-expected.txt
@@ -5,4 +5,3 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 579x19 text run at (0,0) width 579: "This test makes sure we don't crash when calling focus() on an element that has no renderer." - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-placeholder-visibility-1-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-placeholder-visibility-1-expected.txt index cafab5c..ef81cbe 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-placeholder-visibility-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-placeholder-visibility-1-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow {DIV} at (0,36) size 784x22 LayoutTextControl {INPUT} at (0,0) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,47) size 150x16 LayoutBlockFlow {DIV} at (2,3) size 150x16 [color=#757575] LayoutText {#text} at (0,0) size 68x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-placeholder-visibility-3-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-placeholder-visibility-3-expected.txt index 0f0bdaf..a712e15 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-placeholder-visibility-3-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-placeholder-visibility-3-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow {DIV} at (0,36) size 784x22 LayoutTextControl {INPUT} at (0,0) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,47) size 150x16 LayoutBlockFlow {DIV} at (2,3) size 150x16 [color=#757575] LayoutText {#text} at (0,0) size 68x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-tab-shows-caret-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-tab-shows-caret-expected.txt index ddafab6..3a754df 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-tab-shows-caret-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/input-tab-shows-caret-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x22 LayoutTextControl {INPUT} at (0,0) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,11) size 150x16 LayoutBlockFlow {DIV} at (2,3) size 150x16 caret: position 0 of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/text-appearance-datalist-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/text-appearance-datalist-expected.txt index 12b06a4..3a108249 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/text-appearance-datalist-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/text-appearance-datalist-expected.txt
@@ -25,7 +25,6 @@ LayoutFlexibleBox {DIV} at (2,3) size 150x16 LayoutBlockFlow {DIV} at (0,0) size 132.14x16 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,11) size 132x16 LayoutBlockFlow {DIV} at (0,0) size 132.14x16 layer at (168,11) size 132x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/textfield-overflow-by-value-update-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/textfield-overflow-by-value-update-expected.txt deleted file mode 100644 index 0f6b1fa..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/textfield-overflow-by-value-update-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x36 - LayoutBlockFlow {HTML} at (0,0) size 800x36 - LayoutBlockFlow {BODY} at (8,8) size 784x20 - LayoutTextControl {INPUT} at (0,4) size 100x2 [bgcolor=#FFFFFF] - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,-5) size 100x37 backgroundClip at (8,0) size 100x32 clip at (8,0) size 100x32 - LayoutBlockFlow {DIV} at (0,-17.50) size 100x37 - LayoutText {#text} at (0,0) size 67x36 - text run at (0,0) width 67: "FAIL"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/textfield-overflow-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/textfield-overflow-expected.txt index ac23334..441e9d35 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/textfield-overflow-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/textfield-overflow-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutTextControl {INPUT} at (0,0) size 154x10 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,5) size 150x16 LayoutBlockFlow {DIV} at (2,-3) size 150x16 caret: position 0 of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-align-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-align-expected.txt index 9f2a0ed..c530d8ab 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-align-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-align-expected.txt
@@ -17,7 +17,6 @@ text run at (419,103) width 4: " " LayoutBR {BR} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,195) size 784x36 layer at (8,44) size 419x36 clip at (9,45) size 417x34 LayoutTextControl {TEXTAREA} at (0,0) size 419x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt index b0781996..b8b1ba1 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 382: "Focus field with a placeholder, then type, then delete all text." LayoutBlockFlow {DIV} at (0,36) size 784x36 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,44) size 179x36 clip at (9,45) size 177x34 LayoutTextControl {TEXTAREA} at (0,0) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 175x16 [color=#757575]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt index bb0f74b..293f064 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 390: "Focus field with a placeholder, then type, then clear the value." LayoutBlockFlow {DIV} at (0,36) size 784x36 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,44) size 179x36 clip at (9,45) size 177x34 LayoutTextControl {TEXTAREA} at (0,0) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 175x16 [color=#757575]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/crash-on-zero-radius-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/crash-on-zero-radius-expected.png index 2f573ed1..a3878b0 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/crash-on-zero-radius-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/crash-on-zero-radius-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/css3-degenerate-color-stops-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/css3-degenerate-color-stops-expected.png index 23f3970..0c7a95f 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/css3-degenerate-color-stops-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/css3-degenerate-color-stops-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/css3-radial-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/css3-radial-gradients-expected.png deleted file mode 100644 index 781f8d5a..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/css3-radial-gradients-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/css3-repeating-radial-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/css3-repeating-radial-gradients-expected.png deleted file mode 100644 index e32e1d9..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/css3-repeating-radial-gradients-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/generated-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/generated-gradients-expected.png index b37d8745..5d99f8b 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/generated-gradients-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/generated-gradients-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/radial-centered-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/radial-centered-expected.png index e36aa7c..0c053e66 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/radial-centered-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/radial-centered-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/simple-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/simple-gradients-expected.png index 02ce4a7..60ce8ab 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/simple-gradients-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/simple-gradients-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/unprefixed-radial-gradients-color-hints-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/unprefixed-radial-gradients-color-hints-expected.png deleted file mode 100644 index 9c2fe0c..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/unprefixed-radial-gradients-color-hints-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/unprefixed-radial-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/unprefixed-radial-gradients-expected.png deleted file mode 100644 index 781f8d5a..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/unprefixed-radial-gradients-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/unprefixed-repeating-gradient-color-hint-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/unprefixed-repeating-gradient-color-hint-expected.png index a2e501b..e4438714 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/unprefixed-repeating-gradient-color-hint-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/unprefixed-repeating-gradient-color-hint-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/unprefixed-repeating-radial-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/unprefixed-repeating-radial-gradients-expected.png deleted file mode 100644 index e32e1d9..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/unprefixed-repeating-radial-gradients-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/invalid/014-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/invalid/014-expected.txt index 8fca5394..f896f66 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/invalid/014-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/invalid/014-expected.txt
@@ -7,7 +7,6 @@ LayoutText {#text} at (0,0) size 599x19 text run at (0,0) width 282: "Random tests of some bizarre combinations. " text run at (282,0) width 317: "H2 should allow a form inside it, but p should not." - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {FORM} at (0,20) size 784x20 LayoutMenuList {SELECT} at (0,0) size 31x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] LayoutBlockFlow (anonymous) at (1,1) size 29x18
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/layers/inline-dirty-z-order-lists-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/layers/inline-dirty-z-order-lists-expected.txt index c3aa658..39230eb 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/layers/inline-dirty-z-order-lists-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/layers/inline-dirty-z-order-lists-expected.txt
@@ -21,9 +21,6 @@ text run at (449,0) width 286: "layer\x{2019}s and its stacking context\x{2019}s z-index lists." LayoutBlockFlow (anonymous) at (0,92) size 784x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,100) size 0x0 LayoutInline (relative positioned) {SPAN} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/layers/layer-visibility-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/layers/layer-visibility-expected.txt index 05875d1..bbe0fd6 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/layers/layer-visibility-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/layers/layer-visibility-expected.txt
@@ -51,7 +51,6 @@ LayoutText {#text} at (0,0) size 107x39 text run at (0,0) width 107: "3 green box with" text run at (0,20) width 57: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (278,50) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x24 [border: (2px solid #008000)] @@ -62,7 +61,6 @@ LayoutText {#text} at (0,0) size 107x39 text run at (0,0) width 107: "4 green box with" text run at (0,20) width 57: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (412,50) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] layer at (414,52) size 126x30 @@ -74,7 +72,6 @@ LayoutText {#text} at (0,0) size 107x39 text run at (0,0) width 107: "5 green box with" text run at (0,20) width 57: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (546,50) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x28 [border: (2px solid #FF0000)] @@ -86,7 +83,6 @@ LayoutText {#text} at (0,0) size 107x39 text run at (0,0) width 107: "6 green box with" text run at (0,20) width 57: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (10,154) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] hidden layer at (12,156) size 126x30 @@ -99,7 +95,6 @@ LayoutText {#text} at (0,0) size 107x39 text run at (0,0) width 107: "7 green box with" text run at (0,20) width 57: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (144,154) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] hidden layer at (146,156) size 126x30 @@ -113,7 +108,6 @@ LayoutText {#text} at (0,0) size 122x39 text run at (0,0) width 122: "8 double green box" text run at (0,20) width 89: "with word ok:" - LayoutText {#text} at (0,0) size 0x0 layer at (278,154) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #008000)] hidden layer at (280,156) size 126x30 @@ -127,7 +121,6 @@ LayoutText {#text} at (0,0) size 107x39 text run at (0,0) width 107: "9 green box with" text run at (0,20) width 57: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (412,154) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] hidden layer at (414,156) size 126x30 @@ -140,7 +133,6 @@ LayoutBlockFlow (relative positioned) {DIV} at (2,2) size 130x20 LayoutText {#text} at (0,0) size 87x19 text run at (0,0) width 87: "10 green box:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (546,134) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,20) size 130x34 [border: (2px solid #FF0000)] layer at (548,136) size 126x30 @@ -154,7 +146,6 @@ LayoutText {#text} at (0,0) size 115x39 text run at (0,0) width 115: "11 green box with" text run at (0,20) width 57: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (10,258) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x28 [border: (2px solid #FF0000)] @@ -166,7 +157,6 @@ LayoutText {#text} at (0,0) size 115x39 text run at (0,0) width 115: "12 green box with" text run at (0,20) width 57: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (144,258) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x28 [border: (2px solid #FF0000)] @@ -177,7 +167,6 @@ LayoutBlockFlow (relative positioned) {DIV} at (2,2) size 130x20 LayoutText {#text} at (0,0) size 87x19 text run at (0,0) width 87: "13 green box:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (278,238) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,20) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x28 [border: (2px solid #008000)] @@ -189,7 +178,6 @@ LayoutText {#text} at (0,0) size 115x39 text run at (0,0) width 115: "14 green box with" text run at (0,20) width 57: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (412,258) size 130x30 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x30 LayoutBlockFlow {DIV} at (0,0) size 130x24 [border: (2px solid #008000)] @@ -200,7 +188,6 @@ LayoutText {#text} at (0,0) size 115x39 text run at (0,0) width 115: "15 green box with" text run at (0,20) width 57: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (546,258) size 130x30 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x30 layer at (546,258) size 130x30 @@ -212,7 +199,6 @@ LayoutText {#text} at (0,0) size 115x39 text run at (0,0) width 115: "16 green box with" text run at (0,20) width 57: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (10,362) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x52 [border: (2px solid #FF0000)] @@ -227,7 +213,6 @@ LayoutText {#text} at (0,0) size 115x39 text run at (0,0) width 115: "17 green box with" text run at (0,20) width 57: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (144,362) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x52 [border: (2px solid #FF0000)] @@ -242,7 +227,6 @@ LayoutText {#text} at (0,0) size 115x39 text run at (0,0) width 115: "18 green box with" text run at (0,20) width 57: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (278,362) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x52 [border: (2px solid #FF0000)] @@ -257,7 +241,6 @@ LayoutText {#text} at (0,0) size 115x39 text run at (0,0) width 115: "19 green box with" text run at (0,20) width 57: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (412,362) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x28 [border: (2px solid #FF0000)] @@ -272,7 +255,6 @@ LayoutBlockFlow (relative positioned) {DIV} at (2,2) size 130x20 LayoutText {#text} at (0,0) size 87x19 text run at (0,0) width 87: "20 green box:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (546,342) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,20) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x52 [border: (2px solid #008000)] @@ -287,7 +269,6 @@ LayoutText {#text} at (0,0) size 124x39 text run at (0,0) width 124: "21 two green boxes" text run at (0,20) width 89: "with word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (10,466) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x28 [border: (2px solid #FF0000)] @@ -303,7 +284,6 @@ LayoutText {#text} at (0,0) size 115x39 text run at (0,0) width 115: "22 green box with" text run at (0,20) width 57: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (144,466) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] layer at (146,468) size 126x30 @@ -315,7 +295,6 @@ LayoutText {#text} at (0,0) size 115x39 text run at (0,0) width 115: "23 green box with" text run at (0,20) width 57: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (278,466) size 130x34 LayoutBlockFlow (positioned) zI: 1 {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] hidden layer at (280,468) size 126x30
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/layers/layer-visibility-sublayer-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/layers/layer-visibility-sublayer-expected.txt index 681cc674..6de0cb51 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/layers/layer-visibility-sublayer-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/layers/layer-visibility-sublayer-expected.txt
@@ -9,22 +9,19 @@ LayoutBR {BR} at (0,60) size 0x19 LayoutText {#text} at (0,80) size 180x19 text run at (0,80) width 180: "24 green box with word ok: " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (180,95) size 0x0 LayoutBR {BR} at (0,100) size 0x19 LayoutBR {BR} at (0,120) size 0x19 LayoutBR {BR} at (0,140) size 0x19 LayoutText {#text} at (0,160) size 180x19 text run at (0,160) width 180: "25 green box with word ok: " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (180,175) size 0x0 LayoutBR {BR} at (0,180) size 0x19 LayoutBR {BR} at (0,200) size 0x19 LayoutBR {BR} at (0,220) size 0x19 LayoutText {#text} at (0,240) size 180x19 text run at (0,240) width 180: "26 green box with word ok: " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (180,255) size 0x0 LayoutBR {BR} at (0,260) size 0x19 LayoutBR {BR} at (0,280) size 0x19 LayoutBR {BR} at (0,300) size 0x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/layers/remove-layer-with-nested-stacking-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/layers/remove-layer-with-nested-stacking-expected.txt index 28e72dff..1a184b13 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/layers/remove-layer-with-nested-stacking-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/layers/remove-layer-with-nested-stacking-expected.txt
@@ -10,8 +10,6 @@ LayoutBlockFlow (anonymous) at (0,70) size 784x100 LayoutBlockFlow (anonymous) at (0,170) size 784x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,78) size 100x100 LayoutBlockFlow {DIV} at (0,0) size 100x100 LayoutText {#text} at (0,0) size 0x0 @@ -24,4 +22,3 @@ LayoutBlockFlow {SPAN} at (0,0) size 100x50 [bgcolor=#008000] layer at (8,178) size 0x0 transparent LayoutInline {SPAN} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/layers/remove-only-this-layer-update-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/layers/remove-only-this-layer-update-expected.txt index e1ee0f99..1811183 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/layers/remove-only-this-layer-update-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/layers/remove-only-this-layer-update-expected.txt
@@ -10,7 +10,6 @@ text run at (491,0) width 235: "There should be no red on this page. " text run at (725,0) width 54: "This is a" text run at (0,20) width 383: "test case for https://bugs.webkit.org/show_bug.cgi?id=25252" - LayoutText {#text} at (0,0) size 0x0 layer at (100,100) size 100x100 LayoutBlockFlow (positioned) {DIV} at (100,100) size 100x100 [bgcolor=#FF0000] LayoutText {#text} at (0,0) size 35x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/parser/title-error-test-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/parser/title-error-test-expected.txt index acaeef0..92cdd68 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/parser/title-error-test-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/parser/title-error-test-expected.txt
@@ -6,7 +6,6 @@ LayoutBlockFlow (anonymous) at (0,0) size 784x0 LayoutInline {TIMER:TIME} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow (anonymous) at (0,0) size 784x20 LayoutBlockFlow {P} at (0,0) size 784x20 LayoutInline {SPAN} at (0,0) size 75x19 [color=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/parser/xhtml-alternate-entities-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/parser/xhtml-alternate-entities-expected.txt index 398e948..beec058 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/parser/xhtml-alternate-entities-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/parser/xhtml-alternate-entities-expected.txt
@@ -17,7 +17,6 @@ LayoutInline {h1} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutInline {p} at (0,0) size 488x19 LayoutInline {font} at (0,0) size 488x19 LayoutText {#text} at (0,0) size 488x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/reflections/transparent-reflected-sublayers-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/reflections/transparent-reflected-sublayers-expected.txt index ed458ef..6e9d320 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/reflections/transparent-reflected-sublayers-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/reflections/transparent-reflected-sublayers-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 367x19 text run at (0,0) width 367: "You should see four green squares in a vertical line below." - LayoutText {#text} at (0,0) size 0x0 layer at (8,160) size 100x100 transparent LayoutBlockFlow (positioned) {DIV} at (8,160) size 100x100 [bgcolor=#008000] layer at (8,400) size 100x100
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/ruby/ruby-text-before-after-content-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/ruby/ruby-text-before-after-content-expected.txt index 960e282..3e3aa589 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/ruby/ruby-text-before-after-content-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/ruby/ruby-text-before-after-content-expected.txt
@@ -22,4 +22,3 @@ LayoutText {#text} at (0,0) size 21x36 text run at (0,0) width 21: "B" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt index f9c613a..20f9997a 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x87 LayoutBlockFlow {BODY} at (8,8) size 784x71 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 372x70 clip at (9,9) size 355x68 LayoutListBox {SELECT} at (0,0) size 371.77x70 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {OPTION} at (1,1) size 354.77x17 [color=#FFFFCC] [bgcolor=#0000FF]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/html/details_summary/details-open2-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/html/details_summary/details-open2-expected.txt index 9c3260d..aaeecabe 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/html/details_summary/details-open2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/html/details_summary/details-open2-expected.txt
@@ -11,6 +11,5 @@ LayoutBlockFlow {DIV} at (0,20) size 784x22 LayoutTextControl {INPUT} at (0,0) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,31) size 150x16 LayoutBlockFlow {DIV} at (2,3) size 150x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/html/details_summary/details-replace-text-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/html/details_summary/details-replace-text-expected.txt index 240bf4f..270f6e35 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/html/details_summary/details-replace-text-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/html/details_summary/details-replace-text-expected.txt
@@ -14,7 +14,6 @@ text run at (0,0) width 64: "Details1" LayoutText {#text} at (64,0) size 4x19 text run at (64,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {SPAN} at (68,3) size 64x16 LayoutText {#text} at (0,0) size 64x16 text run at (0,0) width 64: "Details2"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/html/tabular_data/col_width_resizing_table-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/html/tabular_data/col_width_resizing_table-expected.txt index fcb15aa..69fe92d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/html/tabular_data/col_width_resizing_table-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/html/tabular_data/col_width_resizing_table-expected.txt
@@ -35,4 +35,3 @@ LayoutText {#text} at (0,0) size 380x16 text run at (0,0) width 380: "Click me to test manually. The first column should grow to 500px." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/http/tests/misc/location-replace-crossdomain-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/http/tests/misc/location-replace-crossdomain-expected.txt index fd187175..66c4848 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/http/tests/misc/location-replace-crossdomain-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/http/tests/misc/location-replace-crossdomain-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x600 LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 304x154 LayoutIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #EEEEEE)] layer at (0,0) size 300x150
diff --git a/third_party/WebKit/LayoutTests/platform/linux/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt index 16311f5..cba0ad45 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt
@@ -14,7 +14,6 @@ LayoutBlockFlow {P} at (0.50,126.50) size 135x9 LayoutText {#text} at (0,-2) size 12x12 text run at (0,-2) width 12: " " - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0.50,189.50) size 135x9 LayoutTable (anonymous) at (0.50,252.50) size 135x44 LayoutTableSection (anonymous) at (0,0) size 135x44
diff --git a/third_party/WebKit/LayoutTests/platform/linux/http/tests/misc/slow-loading-image-in-pattern-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/http/tests/misc/slow-loading-image-in-pattern-expected.txt index 7c6e87f..a25991d6 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/http/tests/misc/slow-loading-image-in-pattern-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/http/tests/misc/slow-loading-image-in-pattern-expected.txt
@@ -8,7 +8,6 @@ LayoutBR {BR} at (627,0) size 0x19 LayoutText {#text} at (0,20) size 562x19 text run at (0,20) width 562: "You should see a 400x300 rect containing a tiled rendering of the Acid3 reference image." - LayoutText {#text} at (0,0) size 0x0 layer at (10,50) size 406x306 clip at (13,53) size 400x300 LayoutSVGRoot (positioned) {svg} at (10,50) size 406x306 LayoutSVGHiddenContainer {defs} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/http/tests/security/contentSecurityPolicy/object-src-param-code-blocked-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/http/tests/security/contentSecurityPolicy/object-src-param-code-blocked-expected.txt deleted file mode 100644 index 6ac9d59..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/http/tests/security/contentSecurityPolicy/object-src-param-code-blocked-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE ERROR: Refused to load plugin data from 'http://127.0.0.1:8080/plugins/resources/mock-plugin.pl?code' because it violates the following Content Security Policy directive: "object-src http://localhost:8080". - -CONSOLE MESSAGE: line 16: PASS: Error occurred, so load was correctly blocked. -This test passes if there is a console message saying the plugin was blocked.
diff --git a/third_party/WebKit/LayoutTests/platform/linux/http/tests/security/contentSecurityPolicy/object-src-param-movie-blocked-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/http/tests/security/contentSecurityPolicy/object-src-param-movie-blocked-expected.txt deleted file mode 100644 index d90778f..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/http/tests/security/contentSecurityPolicy/object-src-param-movie-blocked-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE ERROR: Refused to load plugin data from 'http://127.0.0.1:8080/plugins/resources/mock-plugin.pl?movie' because it violates the following Content Security Policy directive: "object-src http://localhost:8080". - -CONSOLE MESSAGE: line 16: PASS: Error occurred, so load was correctly blocked. -This test passes if there is a console message saying the plugin was blocked.
diff --git a/third_party/WebKit/LayoutTests/platform/linux/http/tests/security/contentSecurityPolicy/object-src-param-src-blocked-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/http/tests/security/contentSecurityPolicy/object-src-param-src-blocked-expected.txt deleted file mode 100644 index c249a48a..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/http/tests/security/contentSecurityPolicy/object-src-param-src-blocked-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE ERROR: Refused to load plugin data from 'http://127.0.0.1:8080/plugins/resources/mock-plugin.pl?src' because it violates the following Content Security Policy directive: "object-src http://localhost:8080". - -CONSOLE MESSAGE: line 16: PASS: Error occurred, so load was correctly blocked. -This test passes if there is a console message saying the plugin was blocked.
diff --git a/third_party/WebKit/LayoutTests/platform/linux/http/tests/security/contentSecurityPolicy/object-src-param-url-blocked-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/http/tests/security/contentSecurityPolicy/object-src-param-url-blocked-expected.txt deleted file mode 100644 index ee2140a..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/http/tests/security/contentSecurityPolicy/object-src-param-url-blocked-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE ERROR: Refused to load plugin data from 'http://127.0.0.1:8080/plugins/resources/mock-plugin.pl?url' because it violates the following Content Security Policy directive: "object-src http://localhost:8080". - -CONSOLE MESSAGE: line 16: PASS: Error occurred, so load was correctly blocked. -This test passes if there is a console message saying the plugin was blocked.
diff --git a/third_party/WebKit/LayoutTests/platform/linux/http/tests/security/cross-frame-access-callback-explicit-domain-ALLOW-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/http/tests/security/cross-frame-access-callback-explicit-domain-ALLOW-expected.txt deleted file mode 100644 index 3685219e..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/http/tests/security/cross-frame-access-callback-explicit-domain-ALLOW-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -The child frame will get a function from the parent frame, set the document.domain property and then try to use the function. The function should still be able to access parent frame properties. - -PASS: canGet('window.location.href') should be 'true' and is. -PASS: window.thisIsTopFrame should be 'true' and is. -
diff --git a/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-circle-focus-ring-expected.txt index 434cbad..d69ad1f8 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-circle-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-circle-focus-ring-expected.txt
@@ -15,4 +15,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (0,0) size 128x128 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-focus-ring-in-positioned-container-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-focus-ring-in-positioned-container-expected.txt index c1b7b2a..b61a818 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-focus-ring-in-positioned-container-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-focus-ring-in-positioned-container-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x20 LayoutText {#text} at (0,0) size 551x19 text run at (0,0) width 551: "Tests that we paint area outline properly when the image is inside positioned containers." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (20,50) size 0x0 LayoutBlockFlow (positioned) {DIV} at (20,50) size 0x0 layer at (30,60) size 50x55
diff --git a/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-focus-ring-with-paint-root-offset-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-focus-ring-with-paint-root-offset-expected.txt index 68ef0c1..3877147 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-focus-ring-with-paint-root-offset-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-focus-ring-with-paint-root-offset-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x20 LayoutText {#text} at (0,0) size 437x19 text run at (0,0) width 437: "Tests that we paint area outline properly when the paintroot is shifted." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (5,50) size 50x55 LayoutBlockFlow (positioned) {DIV} at (5,50) size 50x55 LayoutImage {IMG} at (0,0) size 50x50
diff --git a/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-focus-ring-with-scale-transform-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-focus-ring-with-scale-transform-expected.txt index f3cd292..8e4a1697 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-focus-ring-with-scale-transform-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-focus-ring-with-scale-transform-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x20 LayoutText {#text} at (0,0) size 487x19 text run at (0,0) width 487: "Tests that we paint area outline properly when the image's container is scaled." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (100,100) size 100x100 LayoutBlockFlow (positioned) {DIV} at (100,100) size 100x100 LayoutImage {IMG} at (0,0) size 50x50
diff --git a/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-overflowing-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-overflowing-circle-focus-ring-expected.txt index 9ee6275..493a04d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-overflowing-circle-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-overflowing-circle-focus-ring-expected.txt
@@ -16,4 +16,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (0,0) size 128x128 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-overflowing-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-overflowing-polygon-focus-ring-expected.txt index e580c89..8e775e6 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-overflowing-polygon-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-overflowing-polygon-focus-ring-expected.txt
@@ -16,4 +16,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (0,0) size 128x128 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-polygon-focus-ring-expected.txt index 0643547..12e3e1fb 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-polygon-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/images/imagemap-polygon-focus-ring-expected.txt
@@ -15,4 +15,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (0,0) size 128x128 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/block-selection-gap-stale-cache-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/block-selection-gap-stale-cache-expected.txt deleted file mode 100644 index 3be4717..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/block-selection-gap-stale-cache-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x600 - LayoutBlockFlow {HTML} at (0,0) size 800x600 - LayoutBlockFlow {BODY} at (8,8) size 784x584 - LayoutBlockFlow {DIV} at (0,0) size 784x100 - LayoutBlockFlow {DIV} at (0,0) size 100x100 - LayoutBR {BR} at (100,100) size 0x0 - LayoutBlockFlow (anonymous) at (0,100) size 784x20 - LayoutText {#text} at (0,0) size 4x19 - text run at (0,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/details-open-repaint-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/details-open-repaint-expected.txt index 30b4275c..39b99f249 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/details-open-repaint-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/details-open-repaint-expected.txt
@@ -61,10 +61,6 @@ { "object": "LayoutText #text", "reason": "appeared" - }, - { - "object": "LayoutText #text", - "reason": "appeared" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt index 13c91be..d4ff02d1 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow (anonymous) at (0,22) size 784x20 LayoutText {#text} at (0,0) size 4x19 text run at (0,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,42) size 784x0 layer at (10,11) size 150x16 LayoutBlockFlow {DIV} at (2,3) size 150x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/repaint-svg-after-style-change-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/repaint-svg-after-style-change-expected.txt deleted file mode 100644 index 005a4dd..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/repaint-svg-after-style-change-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x222 - LayoutBlockFlow {HTML} at (0,0) size 800x222 - LayoutBlockFlow {BODY} at (8,8) size 784x206 - LayoutSVGRoot {svg} at (0,0) size 201x201 - LayoutSVGContainer {g} at (0,0) size 200x200 - LayoutSVGPath {path} at (0,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [data="M 0 0 L 0 200 L 200 200 L 200 0 Z"] - LayoutSVGPath {path} at (0,0) size 200x200 [fill={[type=SOLID] [color=#008000]}] [data="M 0 0 L 0 200 L 200 200 L 200 0 Z"] - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/paint/selection/text-selection-inline-block-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/paint/selection/text-selection-inline-block-expected.txt index 717b491..4581e60 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/paint/selection/text-selection-inline-block-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/paint/selection/text-selection-inline-block-expected.txt
@@ -8,6 +8,5 @@ text run at (0,1) width 24: "x" LayoutText {#text} at (24,1) size 24x55 text run at (24,1) width 24: "y" - LayoutText {#text} at (0,0) size 0x0 selection start: position 0 of child 0 {#text} of child 0 {DIV} of body selection end: position 1 of child 1 {#text} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt index b0717317..26ea4478 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt
@@ -12,6 +12,5 @@ text run at (0,1) width 96: "text" text run at (96,1) width 93 RTL: "\x{645}\x{62A}\x{646}:" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 selection start: position 5 of child 0 {#text} of child 2 {SPAN} of body selection end: position 13 of child 0 {#text} of child 2 {SPAN} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/plugins/webview-plugin-type-change-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/plugins/webview-plugin-type-change-expected.txt deleted file mode 100644 index de8a322..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/plugins/webview-plugin-type-change-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE MESSAGE: Blink Test Plugin: initializing -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x173 - LayoutBlockFlow {HTML} at (0,0) size 800x173 - LayoutBlockFlow {BODY} at (8,8) size 784x157 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,8) size 152x152 - LayoutEmbeddedObject {EMBED} at (0,0) size 152x152 [border: (1px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/animate-elem-24-t-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/animate-elem-24-t-expected.txt index 9c1851e4..951f943 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/animate-elem-24-t-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/animate-elem-24-t-expected.txt
@@ -28,9 +28,6 @@ LayoutSVGText {text} at (0,-17) size 77x22 [transform={m=((0.87,-0.50)(0.50,0.87)) t=(0.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (0,-17) size 77x22 chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 11 width 77.00: "It's alive!" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGText {text} at (10,304) size 264x46 contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,304) size 264x46 chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 16 width 264.00: "$Revision: 1.7 $"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/animate-elem-77-t-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/animate-elem-77-t-expected.txt index 9751406..ed81ad9 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/animate-elem-77-t-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/animate-elem-77-t-expected.txt
@@ -79,7 +79,6 @@ LayoutSVGText {text} at (10,3) size 15x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,3) size 15x22 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 14.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (10,3) size 15x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(140.00,0.00)}] LayoutSVGText {text} at (10,3) size 15x22 contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,3) size 15x22 @@ -124,18 +123,14 @@ LayoutSVGText {text} at (-4,3) size 15x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(40.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (-4,3) size 15x22 chunk 1 (end anchor) text run 1 at (-4.00,20.00) startOffset 0 endOffset 1 width 14.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (146,3) size 15x22 LayoutSVGText {text} at (106,3) size 15x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(40.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (106,3) size 15x22 chunk 1 (end anchor) text run 1 at (106.00,20.00) startOffset 0 endOffset 1 width 14.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {a} at (256,3) size 15x22 LayoutSVGText {text} at (216,3) size 15x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(40.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (216,3) size 15x22 chunk 1 (end anchor) text run 1 at (216.00,20.00) startOffset 0 endOffset 1 width 14.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (10,-7) size 272x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,70.00)}] LayoutSVGHiddenContainer {defs} at (10,-7) size 52x34 LayoutSVGContainer {g} at (10,-7) size 52x34 @@ -172,18 +167,14 @@ LayoutSVGText {text} at (10,-7) size 22x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,-7) size 22x34 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 22.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (150,-7) size 22x34 LayoutSVGText {text} at (120,-7) size 22x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (120,-7) size 22x34 chunk 1 text run 1 at (120.00,20.00) startOffset 0 endOffset 1 width 22.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {a} at (260,-7) size 22x34 LayoutSVGText {text} at (230,-7) size 22x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (230,-7) size 22x34 chunk 1 text run 1 at (230.00,20.00) startOffset 0 endOffset 1 width 22.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (9,-8) size 273x35 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,105.00)}] LayoutSVGHiddenContainer {defs} at (9,-8) size 53x35 LayoutSVGContainer {g} at (9,-8) size 53x35 @@ -220,18 +211,14 @@ LayoutSVGText {text} at (10,-7) size 22x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,-7) size 22x34 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 22.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (40,-7) size 22x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(110.00,0.00)}] LayoutSVGText {text} at (10,-7) size 22x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,-7) size 22x34 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 22.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {a} at (40,-7) size 22x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(220.00,0.00)}] LayoutSVGText {text} at (10,-7) size 22x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,-7) size 22x34 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 22.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (10,3) size 262x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,140.00)}] LayoutSVGHiddenContainer {defs} at (10,3) size 42x22 LayoutSVGContainer {g} at (10,3) size 42x22 @@ -268,18 +255,14 @@ LayoutSVGText {text} at (9,3) size 13x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (9,3) size 13x22 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 12.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (39,3) size 13x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(110.00,0.00)}] LayoutSVGText {text} at (9,3) size 13x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (9,3) size 13x22 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 12.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (39,3) size 13x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(220.00,0.00)}] LayoutSVGText {text} at (9,3) size 13x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (9,3) size 13x22 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 12.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (10,2) size 265x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,175.00)}] LayoutSVGHiddenContainer {defs} at (10,2) size 45x23 LayoutSVGContainer {g} at (10,2) size 45x23 @@ -316,15 +299,11 @@ LayoutSVGText {text} at (10,2) size 15x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,2) size 15x23 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 14.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (40,2) size 15x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(110.00,0.00)}] LayoutSVGText {text} at (10,2) size 15x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,2) size 15x23 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 14.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (40,2) size 15x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(220.00,0.00)}] LayoutSVGText {text} at (10,2) size 15x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,2) size 15x23 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 14.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/pservers-grad-13-b-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/pservers-grad-13-b-expected.png index 9a2790d..dea00e7 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/pservers-grad-13-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/pservers-grad-13-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/as-background-image/svg-as-background-3-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/as-background-image/svg-as-background-3-expected.png index a258cbe7..2745167 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/as-background-image/svg-as-background-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/as-background-image/svg-as-background-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/as-background-image/svg-as-background-with-relative-size-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/as-background-image/svg-as-background-with-relative-size-expected.png new file mode 100644 index 0000000..16870d12 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/as-background-image/svg-as-background-with-relative-size-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/batik/text/xmlSpace-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/batik/text/xmlSpace-expected.txt index 52ad5912..2c813d1 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/batik/text/xmlSpace-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/batik/text/xmlSpace-expected.txt
@@ -258,7 +258,6 @@ LayoutSVGInlineText {#text} at (236,358) size 34x22 chunk 1 text run 1 at (236.00,375.00) startOffset 0 endOffset 2 width 19.00: "X " chunk 1 text run 1 at (255.00,375.00) startOffset 0 endOffset 1 width 14.00: "X" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGText {text} at (345,359) size 80x17.59 contains 1 chunk(s) LayoutSVGInlineText {#text} at (345,359) size 80x8 chunk 1 text run 1 at (345.00,365.00) startOffset 0 endOffset 16 width 80.00: "unknown element "
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/canvas/canvas-draw-image-globalalpha-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/canvas/canvas-draw-image-globalalpha-expected.txt deleted file mode 100644 index 8d105e04..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/canvas/canvas-draw-image-globalalpha-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x121 - LayoutBlockFlow {HTML} at (0,0) size 800x121 - LayoutBlockFlow {BODY} at (8,8) size 784x105 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,8) size 100x100 - LayoutHTMLCanvas {CANVAS} at (0,0) size 100x100
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt index 268be66..2c6face 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt
@@ -10,5 +10,4 @@ LayoutSVGInlineText {#text} at (271,2085) size 259x19 chunk 1 (middle anchor) text run 1 at (271.00,2100.00) startOffset 0 endOffset 46 width 258.00: "The test passes if the circle sits in the rect" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 scrolled to 0,1700
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/image-rescale-clip-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/image-rescale-clip-expected.txt index 064a617..97c2800 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/image-rescale-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/image-rescale-clip-expected.txt
@@ -12,6 +12,5 @@ layer at (8,8) size 160x105 backgroundClip at (8,8) size 150x15 clip at (8,8) size 150x15 LayoutBlockFlow (positioned) {DIV} at (8,8) size 160x105 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (13,13) size 160x105 backgroundClip at (8,8) size 150x15 clip at (8,8) size 150x15 LayoutImage (relative positioned) {IMG} at (0,0) size 160x105
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/mouse-move-on-svg-container-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/mouse-move-on-svg-container-expected.txt index 99f1025..e9eed6c 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/mouse-move-on-svg-container-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/mouse-move-on-svg-container-expected.txt
@@ -10,6 +10,5 @@ LayoutSVGInlineText {#text} at (48.50,35) size 304x19 chunk 1 (middle anchor) text run 1 at (48.50,50.00) startOffset 0 endOffset 49 width 303.00: "The circle should stay in the bottom-right corner" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 selection start: position 0 of child 0 {#text} of child 3 {text} of child 1 {svg} of body selection end: position 24 of child 0 {#text} of child 3 {text} of child 1 {svg} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/mouse-move-on-svg-root-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/mouse-move-on-svg-root-expected.txt index aec0b42b8..7efce056 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/mouse-move-on-svg-root-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/mouse-move-on-svg-root-expected.txt
@@ -9,5 +9,4 @@ LayoutSVGInlineText {#text} at (93,35) size 214x19 chunk 1 (middle anchor) text run 1 at (93.00,50.00) startOffset 0 endOffset 34 width 214.00: "The circle should be in the middle" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 caret: position 16 of child 0 {#text} of child 3 {text} of child 1 {svg} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/object-no-size-attributes-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/object-no-size-attributes-expected.txt deleted file mode 100644 index fac6cf1e..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/object-no-size-attributes-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x121 - LayoutBlockFlow {html} at (0,0) size 800x121 - LayoutBlockFlow {body} at (8,8) size 784x105 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,8) size 100x100 - LayoutEmbeddedObject {object} at (0,0) size 100x100 [bgcolor=#FF0000] - layer at (0,0) size 100x100 - LayoutView at (0,0) size 100x100 - layer at (0,0) size 100x100 - LayoutSVGRoot {svg} at (0,0) size 100x100 - LayoutSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/hixie/mixed/003-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/hixie/mixed/003-expected.txt index 4b4ecba..6b08228 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/hixie/mixed/003-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/hixie/mixed/003-expected.txt
@@ -12,7 +12,6 @@ LayoutSVGRoot {svg} at (0,0) size 200x200 LayoutSVGEllipse {circle} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [cx=50.00] [cy=50.00] [r=50.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,19) size 330x16 LayoutBlockFlow {div} at (2,3) size 330x16 LayoutText {#text} at (0,0) size 137x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/bbox-with-glyph-overflow-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/text/bbox-with-glyph-overflow-expected.txt index dcede36e..6faab0a6 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/bbox-with-glyph-overflow-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/bbox-with-glyph-overflow-expected.txt
@@ -53,4 +53,3 @@ LayoutSVGRect {rect} at (37.44,299.50) size 302.50x100.98 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=37.44] [y=299.50] [width=302.50] [height=100.98] LayoutSVGRect {rect} at (50,419) size 136x71 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=50.00] [y=419.00] [width=136.00] [height=71.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/bbox-with-glyph-overflow-on-path-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/text/bbox-with-glyph-overflow-on-path-expected.txt index 102351dd..e2df413 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/bbox-with-glyph-overflow-on-path-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/bbox-with-glyph-overflow-on-path-expected.txt
@@ -110,4 +110,3 @@ LayoutSVGRect {rect} at (38.05,204.25) size 356.98x152.33 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=38.05] [y=204.25] [width=356.98] [height=152.33] LayoutSVGRect {rect} at (50,394) size 136x71 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=50.00] [y=394.00] [width=136.00] [height=71.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/bbox-with-glyph-overflow-zoomed-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/text/bbox-with-glyph-overflow-zoomed-expected.txt index 1cc60008..003bf41 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/bbox-with-glyph-overflow-zoomed-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/bbox-with-glyph-overflow-zoomed-expected.txt
@@ -50,4 +50,3 @@ LayoutSVGRect {rect} at (17.77,28.34) size 67.22x27.22 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=17.77] [y=28.34] [width=67.22] [height=27.22] LayoutSVGRect {rect} at (20,61.67) size 32.77x16.66 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=20.00] [y=61.67] [width=32.77] [height=16.66] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/combining-character-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/text/combining-character-queries-expected.txt index f25e965..ab475c2 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/combining-character-queries-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/combining-character-queries-expected.txt
@@ -503,5 +503,3 @@ chunk 1 text run 1 at (360.00,350.00) startOffset 0 endOffset 1 width 26.00 RTL: "\x{FDB0}" chunk 1 text run 1 at (386.00,350.00) startOffset 0 endOffset 2 width 8.00: "i\x{333}" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/ligature-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/text/ligature-queries-expected.txt index 4a5f282..9592fd4a 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/ligature-queries-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/ligature-queries-expected.txt
@@ -490,5 +490,3 @@ chunk 1 text run 23 at (486.44,438.78) startOffset 22 endOffset 23 width 25.00: "f" LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/surrogate-pair-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/text/surrogate-pair-queries-expected.txt index 1a2c22f..e02c9163 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/surrogate-pair-queries-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/surrogate-pair-queries-expected.txt
@@ -336,5 +336,3 @@ LayoutSVGInlineText {#text} at (372,318) size 78x40 chunk 1 text run 1 at (372.00,350.00) startOffset 0 endOffset 7 width 78.00 RTL override: "\x{D83C}\x{DFB6}\x{D801}\x{DC37}\x{30C}\x{D83C}\x{DFB6}" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-clip-path-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-clip-path-expected.txt deleted file mode 100644 index 78b66fa..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-clip-path-expected.txt +++ /dev/null
@@ -1,43 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x249 - LayoutBlockFlow {HTML} at (0,0) size 800x249.16 - LayoutBlockFlow {BODY} at (16.58,16.58) size 766.84x216 - LayoutSVGRoot {svg} at (0,0) size 207.36x207.36 - LayoutSVGHiddenContainer {defs} at (0,0) size 0x0 - LayoutSVGResourceClipper {clipPath} [id="clip1"] [clipPathUnits=userSpaceOnUse] - LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00] - LayoutSVGResourceClipper {clipPath} [id="clip2"] [clipPathUnits=userSpaceOnUse] - LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00] - LayoutSVGRect {rect} at (50,50) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=50.00] [y=50.00] [width=50.00] [height=50.00] - LayoutSVGResourceClipper {clipPath} [id="clip3"] [clipPathUnits=objectBoundingBox] - LayoutSVGRect {rect} at (0,0) size 0.50x0.50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=0.50] [height=0.50] - LayoutSVGResourceClipper {clipPath} [id="clip4"] [clipPathUnits=objectBoundingBox] - LayoutSVGRect {rect} at (0,0) size 0.50x0.50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=0.50] [height=0.50] - LayoutSVGRect {rect} at (0.50,0.50) size 0.50x0.50 [fill={[type=SOLID] [color=#000000]}] [x=0.50] [y=0.50] [width=0.50] [height=0.50] - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (0,0) size 415x415 - LayoutBlockFlow (positioned) {DIV} at (0,0) size 414.72x414.72 [bgcolor=#000000] -layer at (0,0) size 207x207 - LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000] -layer at (0,0) size 207x207 - LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000] -layer at (0,0) size 207x207 - LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000] -layer at (0,0) size 207x207 - LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000] -layer at (0,0) size 207x207 - LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000] -layer at (0,0) size 207x207 - LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-hixie-mixed-008-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-hixie-mixed-008-expected.txt index 77b9abe..4a84a213 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-hixie-mixed-008-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-hixie-mixed-008-expected.txt
@@ -15,6 +15,3 @@ LayoutText {#text} at (139,1) size 122x57 text run at (139,1) width 122: "TEST" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-hixie-rendering-model-004-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-hixie-rendering-model-004-expected.txt index 49d9de5..460916ce 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-hixie-rendering-model-004-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-hixie-rendering-model-004-expected.txt
@@ -11,6 +11,3 @@ LayoutSVGRoot {svg} at (0,0) size 144x144 LayoutSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#000080]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt index 78caf838..be92086 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt
@@ -14,7 +14,6 @@ LayoutBlockFlow {P} at (0.58,129.38) size 138.88x9.25 LayoutText {#text} at (0,-2) size 12x12 text run at (0,-2) width 12: " " - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0.58,194.17) size 138.88x9.25 LayoutTable (anonymous) at (0.58,258.97) size 138x45 LayoutTableSection (anonymous) at (0,0) size 138x45
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt index 51ec927..b2c60c0e 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt
@@ -8,9 +8,6 @@ LayoutBR {BR} at (351,338) size 1x14 LayoutText {#text} at (0,352) size 234x14 text run at (0,352) width 234: "The image of Tux should fill the entire red square." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (6,6) size 349x349 LayoutEmbeddedObject {OBJECT} at (0,0) size 348.59x348.59 [border: (0.69px solid #FF0000)] layer at (0,0) size 347x347
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/text/zoom-hixie-mixed-008-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/text/zoom-hixie-mixed-008-expected.txt index f17e487..4653a24 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/text/zoom-hixie-mixed-008-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/text/zoom-hixie-mixed-008-expected.txt
@@ -15,6 +15,3 @@ LayoutText {#text} at (114,1) size 172x81 text run at (114,1) width 172: "TEST" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/text/zoom-hixie-rendering-model-004-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/text/zoom-hixie-rendering-model-004-expected.txt index e9da97a..12d02758 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/text/zoom-hixie-rendering-model-004-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/text/zoom-hixie-rendering-model-004-expected.txt
@@ -11,6 +11,3 @@ LayoutSVGRoot {svg} at (0,0) size 100x100 LayoutSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#000080]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt index 77c88065..617d6bd 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt
@@ -11,7 +11,6 @@ text run at (489,228) width 4: " " LayoutBlockFlow {DIV} at (513,21) size 202x202 [border: (1px solid #000000)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (30,500) size 312x100 LayoutBlockFlow (positioned) {DIV} at (30,500) size 312.25x100 LayoutInline {SPAN} at (0,0) size 313x19 [color=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt index 92d914a..c83f2b9 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (0,0) size 785x600 [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (21,21) size 402x402 [border: (1px solid #000000)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (42,42) size 340x340 LayoutBlockFlow {DIV} at (21,21) size 340x340 [bgcolor=#DDDDDD] [border: (1px solid #000000)] layer at (63,63) size 300x300
diff --git a/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt index 6fa576f..bb38ea1e 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt
@@ -15,7 +15,6 @@ text run at (243,475) width 4: " " LayoutBlockFlow {DIV} at (267,268) size 202x202 [border: (1px solid #000000)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (30,500) size 496x180 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600 LayoutBlockFlow (positioned) {DIV} at (30,500) size 495.81x180 LayoutInline {SPAN} at (0,0) size 297x19 [color=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/transforms/bounding-rect-zoom-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/transforms/bounding-rect-zoom-expected.txt index 727b4ad2..9bce5d7 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/transforms/bounding-rect-zoom-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/transforms/bounding-rect-zoom-expected.txt
@@ -15,15 +15,9 @@ LayoutTableCell {TD} at (1,1) size 181x17 [r=0 c=0 rs=1 cs=1] LayoutText {#text} at (0,0) size 145x16 text run at (0,0) width 145: "getClientBoundingRect():" - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutTableCell {TD} at (183,1) size 601x17 [r=0 c=1 rs=1 cs=1] LayoutText {#text} at (0,0) size 95x16 text run at (0,0) width 95: "getClientRects():" - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (90,90) size 90x90 LayoutBlockFlow (positioned) {DIV} at (90,90) size 90x90 [bgcolor=#FF0000] layer at (90,90) size 90x90
diff --git a/third_party/WebKit/LayoutTests/platform/linux/transforms/identity-matrix-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/transforms/identity-matrix-expected.txt index 372746a..4c81219 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/transforms/identity-matrix-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/transforms/identity-matrix-expected.txt
@@ -7,7 +7,5 @@ text run at (0,0) width 250: "The following divs should be identical: " LayoutBR {BR} at (0,0) size 0x0 LayoutBlockFlow (floating) {DIV} at (5,25) size 110x110 [bgcolor=#87CEEB] [border: (5px solid #000000)] - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (133,33) size 110x110 LayoutBlockFlow (floating) {DIV} at (125,25) size 110x110 [bgcolor=#87CEEB] [border: (5px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/compositing/geometry/clipping-foreground-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/compositing/geometry/clipping-foreground-expected.txt new file mode 100644 index 0000000..8ea54ac1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/compositing/geometry/clipping-foreground-expected.txt
@@ -0,0 +1,52 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 436x19 + text run at (0,0) width 436: "The layering of the boxes should not be affected by overflow:hidden." + LayoutBlockFlow (anonymous) at (0,36) size 784x477 + LayoutText {#text} at (320,305) size 4x19 + text run at (320,305) width 4: " " + LayoutText {#text} at (0,0) size 0x0 +layer at (68,261) size 200x200 layerType: background only +layer at (28,221) size 150x150 + LayoutBlockFlow (positioned) zI: -1 {DIV} at (-40,-40) size 150x150 [color=#808080] [bgcolor=#C86464] [border: (2px solid #000000)] + LayoutText zI: -1 {#text} at (22,22) size 106x40 + text run at (22,22) width 106: "Behind" +layer at (50,303) size 100x100 + LayoutBlockFlow (positioned) {DIV} at (22,82) size 100x100 [bgcolor=#008000] [border: (2px solid #000000)] + LayoutText {#text} at (22,22) size 55x41 + text run at (22,22) width 55: "Behind" + text run at (22,43) width 53: "behind" +layer at (68,261) size 200x200 layerType: foreground only + LayoutBlockFlow (relative positioned) {DIV} at (60,217) size 200x200 [color=#0000FF] [bgcolor=#FFFFFFCC] [border: (10px solid #000000)] + LayoutText {#text} at (30,30) size 126x81 + text run at (30,30) width 59: "Box" + text run at (30,71) width 126: "contents" +layer at (158,351) size 150x150 + LayoutBlockFlow (positioned) zI: 1 {DIV} at (90,90) size 150x150 [color=#808080] [bgcolor=#C8C880] [border: (2px solid #000000)] + LayoutText zI: 1 {#text} at (22,22) size 86x81 + text run at (22,22) width 33: "In" + text run at (22,63) width 86: "Front" +layer at (392,104) size 200x200 clip at (402,114) size 180x180 scrollWidth 230 scrollHeight 230 layerType: background only +layer at (352,64) size 150x150 backgroundClip at (402,114) size 180x180 clip at (402,114) size 180x180 + LayoutBlockFlow (positioned) zI: -1 {DIV} at (-40,-40) size 150x150 [color=#808080] [bgcolor=#C86464] [border: (2px solid #000000)] + LayoutText zI: -1 {#text} at (22,22) size 106x40 + text run at (22,22) width 106: "Behind" +layer at (374,146) size 100x100 backgroundClip at (402,114) size 180x180 clip at (402,114) size 180x180 + LayoutBlockFlow (positioned) {DIV} at (22,82) size 100x100 [bgcolor=#008000] [border: (2px solid #000000)] + LayoutText {#text} at (22,22) size 55x41 + text run at (22,22) width 55: "Behind" + text run at (22,43) width 53: "behind" +layer at (392,104) size 200x200 clip at (402,114) size 180x180 scrollWidth 230 scrollHeight 230 layerType: foreground only + LayoutBlockFlow (relative positioned) {DIV} at (384,60) size 200x200 [color=#0000FF] [bgcolor=#FFFFFFCC] [border: (10px solid #000000)] + LayoutText {#text} at (30,30) size 126x81 + text run at (30,30) width 59: "Box" + text run at (30,71) width 126: "contents" +layer at (482,194) size 150x150 backgroundClip at (402,114) size 180x180 clip at (402,114) size 180x180 + LayoutBlockFlow (positioned) zI: 1 {DIV} at (90,90) size 150x150 [color=#808080] [bgcolor=#C8C880] [border: (2px solid #000000)] + LayoutText zI: 1 {#text} at (22,22) size 86x81 + text run at (22,22) width 33: "In" + text run at (22,63) width 86: "Front"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/compositing/iframes/composited-iframe-alignment-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/compositing/iframes/composited-iframe-alignment-expected.txt new file mode 100644 index 0000000..d40855dc --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/compositing/iframes/composited-iframe-alignment-expected.txt
@@ -0,0 +1,21 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x76 + LayoutBlockFlow {HTML} at (0,0) size 800x76 + LayoutBlockFlow {BODY} at (8,8) size 784x60 + LayoutText {#text} at (0,0) size 770x39 + text run at (0,0) width 594: "Simple test of composited iframe content. There should be a blue box with a gray background " + text run at (594,0) width 176: "inside the black border. The" + text run at (0,20) width 384: "gray background should fit perfectly within the block border " + text run at (384,20) width 89: "with no gaps. " + LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (0,40) size 0x19 +layer at (100,100) size 440x340 + LayoutIFrame (positioned) {IFRAME} at (100,100) size 440x340 [border: (20px solid #000000)] + layer at (0,0) size 400x300 + LayoutView at (0,0) size 400x300 + layer at (0,0) size 400x230 + LayoutBlockFlow {HTML} at (0,0) size 400x230 + LayoutBlockFlow {BODY} at (8,10) size 384x210 [bgcolor=#C0C0C0] + layer at (18,10) size 210x210 + LayoutBlockFlow {DIV} at (10,0) size 210x210 [bgcolor=#0000FF]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/compositing/overflow/clip-parent-reset-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/compositing/overflow/clip-parent-reset-expected.txt new file mode 100644 index 0000000..a92c8bdc --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/compositing/overflow/clip-parent-reset-expected.txt
@@ -0,0 +1,14 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x186 + LayoutBlockFlow {HTML} at (0,0) size 800x186 + LayoutBlockFlow {BODY} at (8,8) size 784x170 + LayoutBlockFlow (anonymous) at (0,150) size 784x20 + LayoutText {#text} at (0,0) size 624x19 + text run at (0,0) width 624: "This test verifies the clip parent of a layer gets correctly reset when it gained a non-composited clip." +layer at (8,8) size 150x150 transparent + LayoutBlockFlow {DIV} at (0,0) size 150x150 [bgcolor=#FF0000] +layer at (8,8) size 100x100 scrollWidth 200 scrollHeight 200 + LayoutBlockFlow {DIV} at (0,0) size 100x100 +layer at (8,8) size 200x200 backgroundClip at (8,8) size 100x100 clip at (8,8) size 100x100 + LayoutBlockFlow {DIV} at (0,0) size 200x200 [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/compositing/video-frame-size-change-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/compositing/video-frame-size-change-expected.txt new file mode 100644 index 0000000..a0940e4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/compositing/video-frame-size-change-expected.txt
@@ -0,0 +1,26 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x245 + LayoutBlockFlow {HTML} at (0,0) size 800x245 + LayoutBlockFlow {BODY} at (8,16) size 784x221 + LayoutBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 483x19 + text run at (0,0) width 483: "Tests decoding and rendering a video element that has a changing resolution." + LayoutBlockFlow (anonymous) at (0,36) size 784x185 + LayoutText {#text} at (320,165) size 4x19 + text run at (320,165) width 4: " " + LayoutText {#text} at (0,0) size 0x0 +layer at (8,52) size 320x180 + LayoutVideo {VIDEO} at (0,0) size 320x180 +layer at (332,52) size 320x180 + LayoutVideo {VIDEO} at (324,0) size 320x180 +layer at (8,52) size 320x180 + LayoutFlexibleBox (relative positioned) {DIV} at (0,0) size 320x180 + LayoutBlockFlow {DIV} at (0,148) size 320x32 +layer at (8,52) size 320x138 + LayoutFlexibleBox (relative positioned) {DIV} at (0,0) size 320x138 +layer at (332,52) size 320x180 + LayoutFlexibleBox (relative positioned) {DIV} at (0,0) size 320x180 + LayoutBlockFlow {DIV} at (0,148) size 320x32 +layer at (332,52) size 320x138 + LayoutFlexibleBox (relative positioned) {DIV} at (0,0) size 320x138
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/details-open-repaint-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/details-open-repaint-expected.txt index 30b4275c..39b99f249 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/details-open-repaint-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/details-open-repaint-expected.txt
@@ -61,10 +61,6 @@ { "object": "LayoutText #text", "reason": "appeared" - }, - { - "object": "LayoutText #text", - "reason": "appeared" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt new file mode 100644 index 0000000..d4ff02d1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt
@@ -0,0 +1,15 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {DIV} at (0,0) size 784x22 + LayoutTextControl {INPUT} at (0,0) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] + LayoutText {#text} at (0,0) size 0x0 + LayoutBlockFlow (anonymous) at (0,22) size 784x20 + LayoutText {#text} at (0,0) size 4x19 + text run at (0,0) width 4: " " + LayoutBlockFlow {DIV} at (0,42) size 784x0 +layer at (10,11) size 150x16 + LayoutBlockFlow {DIV} at (2,3) size 150x16 +caret: position 0 of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of child 1 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/selection/text-selection-inline-block-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/selection/text-selection-inline-block-expected.txt new file mode 100644 index 0000000..4581e60 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/selection/text-selection-inline-block-expected.txt
@@ -0,0 +1,12 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x73 + LayoutBlockFlow {HTML} at (0,0) size 800x73 + LayoutBlockFlow {BODY} at (8,8) size 784x57 + LayoutBlockFlow {DIV} at (0,0) size 24x57 + LayoutText {#text} at (0,1) size 24x55 + text run at (0,1) width 24: "x" + LayoutText {#text} at (24,1) size 24x55 + text run at (24,1) width 24: "y" +selection start: position 0 of child 0 {#text} of child 0 {DIV} of body +selection end: position 1 of child 1 {#text} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt index b0717317..26ea4478 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt
@@ -12,6 +12,5 @@ text run at (0,1) width 96: "text" text run at (96,1) width 93 RTL: "\x{645}\x{62A}\x{646}:" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 selection start: position 5 of child 0 {#text} of child 2 {SPAN} of body selection end: position 13 of child 0 {#text} of child 2 {SPAN} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-connecting-line-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-connecting-line-expected.txt deleted file mode 100644 index be08368..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-connecting-line-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x321 - LayoutBlockFlow {HTML} at (0,0) size 800x321 - LayoutBlockFlow {BODY} at (8,8) size 784x305 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,8) size 300x300 - LayoutHTMLCanvas {CANVAS} at (0,0) size 300x300
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/canvas-shadow-source-in-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/canvas-shadow-source-in-expected.txt index 01c88f98..c370adf 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/canvas-shadow-source-in-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/canvas-shadow-source-in-expected.txt
@@ -13,8 +13,6 @@ text run at (0,0) width 69: "Test Image" LayoutBlockFlow (anonymous) at (0,247) size 784x207 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 202x202 LayoutHTMLCanvas {CANVAS} at (0,0) size 202x202 [border: (1px solid #999999)] layer at (8,255) size 202x202
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-circle-focus-ring-expected.txt new file mode 100644 index 0000000..d69ad1f8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-circle-focus-ring-expected.txt
@@ -0,0 +1,17 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 763x39 + text run at (0,0) width 763: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,20) width 760: "shape=\"circle\">. This test PASSED if a circular-shaped focus ring is drawn around the <area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,56) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-focus-ring-in-positioned-container-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-focus-ring-in-positioned-container-expected.txt new file mode 100644 index 0000000..b61a818 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-focus-ring-in-positioned-container-expected.txt
@@ -0,0 +1,16 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x36 + LayoutBlockFlow {HTML} at (0,0) size 800x36 + LayoutBlockFlow {BODY} at (8,8) size 784x20 + LayoutText {#text} at (0,0) size 551x19 + text run at (0,0) width 551: "Tests that we paint area outline properly when the image is inside positioned containers." +layer at (20,50) size 0x0 + LayoutBlockFlow (positioned) {DIV} at (20,50) size 0x0 +layer at (30,60) size 50x55 + LayoutBlockFlow (positioned) {DIV} at (10,10) size 50x55 + LayoutImage {IMG} at (0,0) size 50x50 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-focus-ring-with-paint-root-offset-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-focus-ring-with-paint-root-offset-expected.txt new file mode 100644 index 0000000..3877147 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-focus-ring-with-paint-root-offset-expected.txt
@@ -0,0 +1,14 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x36 + LayoutBlockFlow {HTML} at (0,0) size 800x36 + LayoutBlockFlow {BODY} at (8,8) size 784x20 + LayoutText {#text} at (0,0) size 437x19 + text run at (0,0) width 437: "Tests that we paint area outline properly when the paintroot is shifted." +layer at (5,50) size 50x55 + LayoutBlockFlow (positioned) {DIV} at (5,50) size 50x55 + LayoutImage {IMG} at (0,0) size 50x50 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-focus-ring-with-scale-transform-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-focus-ring-with-scale-transform-expected.txt new file mode 100644 index 0000000..8e4a1697 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-focus-ring-with-scale-transform-expected.txt
@@ -0,0 +1,14 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x36 + LayoutBlockFlow {HTML} at (0,0) size 800x36 + LayoutBlockFlow {BODY} at (8,8) size 784x20 + LayoutText {#text} at (0,0) size 487x19 + text run at (0,0) width 487: "Tests that we paint area outline properly when the image's container is scaled." +layer at (100,100) size 100x100 + LayoutBlockFlow (positioned) {DIV} at (100,100) size 100x100 + LayoutImage {IMG} at (0,0) size 50x50 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-overflowing-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-overflowing-circle-focus-ring-expected.txt new file mode 100644 index 0000000..493a04d --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-overflowing-circle-focus-ring-expected.txt
@@ -0,0 +1,18 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x60 + LayoutText {#text} at (0,0) size 763x59 + text run at (0,0) width 763: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,20) width 743: "shape=\"circle\"> that overflows the img element. This test PASSED if a half-circule-shaped focus ring is drawn for the" + text run at (0,40) width 209: "<area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,76) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-overflowing-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-overflowing-polygon-focus-ring-expected.txt new file mode 100644 index 0000000..8e775e6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-overflowing-polygon-focus-ring-expected.txt
@@ -0,0 +1,18 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x60 + LayoutText {#text} at (0,0) size 782x59 + text run at (0,0) width 763: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,20) width 782: "shape=\"polygon\"> that is overflowing the bounds for the img element. This test PASSED if a clipped star-shaped focus ring" + text run at (0,40) width 338: "is drawn around the <area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,76) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-polygon-focus-ring-expected.txt new file mode 100644 index 0000000..12e3e1fb --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/exotic-color-space/images/imagemap-polygon-focus-ring-expected.txt
@@ -0,0 +1,17 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 763x39 + text run at (0,0) width 763: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,20) width 763: "shape=\"polygon\">. This test PASSED if a cross-shaped focus ring is drawn around the <area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,56) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-circle-focus-ring-expected.txt index 434cbad..d69ad1f8 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-circle-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-circle-focus-ring-expected.txt
@@ -15,4 +15,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (0,0) size 128x128 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-focus-ring-in-positioned-container-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-focus-ring-in-positioned-container-expected.txt index c1b7b2a..b61a818 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-focus-ring-in-positioned-container-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-focus-ring-in-positioned-container-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x20 LayoutText {#text} at (0,0) size 551x19 text run at (0,0) width 551: "Tests that we paint area outline properly when the image is inside positioned containers." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (20,50) size 0x0 LayoutBlockFlow (positioned) {DIV} at (20,50) size 0x0 layer at (30,60) size 50x55
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-focus-ring-with-paint-root-offset-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-focus-ring-with-paint-root-offset-expected.txt index 68ef0c1..3877147 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-focus-ring-with-paint-root-offset-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-focus-ring-with-paint-root-offset-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x20 LayoutText {#text} at (0,0) size 437x19 text run at (0,0) width 437: "Tests that we paint area outline properly when the paintroot is shifted." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (5,50) size 50x55 LayoutBlockFlow (positioned) {DIV} at (5,50) size 50x55 LayoutImage {IMG} at (0,0) size 50x50
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-focus-ring-with-scale-transform-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-focus-ring-with-scale-transform-expected.txt index f3cd292..8e4a1697 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-focus-ring-with-scale-transform-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-focus-ring-with-scale-transform-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x20 LayoutText {#text} at (0,0) size 487x19 text run at (0,0) width 487: "Tests that we paint area outline properly when the image's container is scaled." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (100,100) size 100x100 LayoutBlockFlow (positioned) {DIV} at (100,100) size 100x100 LayoutImage {IMG} at (0,0) size 50x50
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-overflowing-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-overflowing-circle-focus-ring-expected.txt index 9ee6275..493a04d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-overflowing-circle-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-overflowing-circle-focus-ring-expected.txt
@@ -16,4 +16,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (0,0) size 128x128 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-overflowing-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-overflowing-polygon-focus-ring-expected.txt index e580c89..8e775e6 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-overflowing-polygon-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-overflowing-polygon-focus-ring-expected.txt
@@ -16,4 +16,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (0,0) size 128x128 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-polygon-focus-ring-expected.txt index 0643547..12e3e1fb 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-polygon-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/imagemap-polygon-focus-ring-expected.txt
@@ -15,4 +15,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (0,0) size 128x128 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/canvas-ellipse-connecting-line-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/canvas-ellipse-connecting-line-expected.txt deleted file mode 100644 index be08368..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/canvas-ellipse-connecting-line-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x321 - LayoutBlockFlow {HTML} at (0,0) size 800x321 - LayoutBlockFlow {BODY} at (8,8) size 784x305 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,8) size 300x300 - LayoutHTMLCanvas {CANVAS} at (0,0) size 300x300
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/canvas-shadow-source-in-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/canvas-shadow-source-in-expected.txt index 01c88f98..c370adf 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/canvas-shadow-source-in-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/canvas-shadow-source-in-expected.txt
@@ -13,8 +13,6 @@ text run at (0,0) width 69: "Test Image" LayoutBlockFlow (anonymous) at (0,247) size 784x207 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 202x202 LayoutHTMLCanvas {CANVAS} at (0,0) size 202x202 [border: (1px solid #999999)] layer at (8,255) size 202x202
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/css1/classification/display-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/css1/classification/display-expected.txt index f511b8e..049d050d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/css1/classification/display-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/css1/classification/display-expected.txt
@@ -56,7 +56,6 @@ LayoutBlockFlow {P} at (0,371) size 769x20 LayoutText {#text} at (0,0) size 247x19 text run at (0,0) width 247: "There should be no text after the colon:" - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,407) size 769x60 LayoutBlockFlow (anonymous) at (0,0) size 769x20 LayoutText {#text} at (0,0) size 112x19 @@ -117,7 +116,6 @@ LayoutBlockFlow {P} at (4,228) size 747x20 LayoutText {#text} at (0,0) size 247x19 text run at (0,0) width 247: "There should be no text after the colon:" - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (4,264) size 747x60 LayoutBlockFlow (anonymous) at (0,0) size 747x20 LayoutText {#text} at (0,0) size 112x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/misc/location-replace-crossdomain-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/misc/location-replace-crossdomain-expected.txt new file mode 100644 index 0000000..66c4848 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/misc/location-replace-crossdomain-expected.txt
@@ -0,0 +1,15 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,8) size 304x154 + LayoutIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #EEEEEE)] + layer at (0,0) size 300x150 + LayoutView at (0,0) size 300x150 + layer at (0,0) size 300x150 + LayoutBlockFlow {HTML} at (0,0) size 300x150 + LayoutBlockFlow {BODY} at (8,8) size 284x134 + LayoutText {#text} at (0,0) size 71x19 + text run at (0,0) width 71: "SUCCESS"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt new file mode 100644 index 0000000..cba0ad45 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt
@@ -0,0 +1,66 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x462 + LayoutBlockFlow {HTML} at (0,0) size 800x461.50 + LayoutBlockFlow {BODY} at (4,4) size 136x449 [border: (0.50px dashed #C0C0C0)] + LayoutBlockFlow {P} at (0.50,9.50) size 135x27 + LayoutText {#text} at (0,-2) size 135x30 + text run at (0,-2) width 135: "The following six blue boxes must" + text run at (0,7) width 126: "be of the same width. There must" + text run at (0,16) width 37: "be no red." + LayoutBlockFlow {P} at (9.50,45.50) size 117x27 [bgcolor=#008000] [border: (9px solid #0000FF)] + LayoutText {#text} at (9,7) size 2x12 + text run at (9,7) width 2: " " + LayoutBlockFlow {P} at (0.50,126.50) size 135x9 + LayoutText {#text} at (0,-2) size 12x12 + text run at (0,-2) width 12: " " + LayoutBlockFlow {P} at (0.50,189.50) size 135x9 + LayoutTable (anonymous) at (0.50,252.50) size 135x44 + LayoutTableSection (anonymous) at (0,0) size 135x44 + LayoutTableRow (anonymous) at (0,0) size 135x44 + LayoutTableCell {P} at (0,0) size 135x44 [r=0 c=0 rs=1 cs=1] + LayoutTable {TABLE} at (0.50,350.50) size 135x44 + LayoutTableSection {TBODY} at (0,0) size 135x44 + LayoutTableRow {TR} at (0,0) size 135x44 + LayoutTableCell {TD} at (0,0) size 135x44 [r=0 c=0 rs=1 cs=1] + LayoutBlockFlow (floating) {P} at (0.50,448.50) size 135x9 +layer at (14,131) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,194) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,257) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,355) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,453) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/misc/slow-loading-image-in-pattern-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/misc/slow-loading-image-in-pattern-expected.txt new file mode 100644 index 0000000..a25991d6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/misc/slow-loading-image-in-pattern-expected.txt
@@ -0,0 +1,16 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x56 + LayoutBlockFlow {HTML} at (0,0) size 800x56 + LayoutBlockFlow {BODY} at (8,8) size 784x40 + LayoutText {#text} at (0,0) size 627x19 + text run at (0,0) width 627: "This tests slow loading png images referenced from a image element inside a SVG pattern resource." + LayoutBR {BR} at (627,0) size 0x19 + LayoutText {#text} at (0,20) size 562x19 + text run at (0,20) width 562: "You should see a 400x300 rect containing a tiled rendering of the Acid3 reference image." +layer at (10,50) size 406x306 clip at (13,53) size 400x300 + LayoutSVGRoot (positioned) {svg} at (10,50) size 406x306 + LayoutSVGHiddenContainer {defs} at (0,0) size 0x0 + LayoutSVGResourcePattern {pattern} [id="pattern"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse] + LayoutSVGImage {image} at (0,0) size 800x600 + LayoutSVGRect {rect} at (0,0) size 400x300 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=0.00] [width=400.00] [height=300.00]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/off-main-thread-fetch/http/tests/misc/location-replace-crossdomain-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/off-main-thread-fetch/http/tests/misc/location-replace-crossdomain-expected.txt new file mode 100644 index 0000000..66c4848 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/off-main-thread-fetch/http/tests/misc/location-replace-crossdomain-expected.txt
@@ -0,0 +1,15 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,8) size 304x154 + LayoutIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #EEEEEE)] + layer at (0,0) size 300x150 + LayoutView at (0,0) size 300x150 + layer at (0,0) size 300x150 + LayoutBlockFlow {HTML} at (0,0) size 300x150 + LayoutBlockFlow {BODY} at (8,8) size 284x134 + LayoutText {#text} at (0,0) size 71x19 + text run at (0,0) width 71: "SUCCESS"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/off-main-thread-fetch/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/off-main-thread-fetch/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt new file mode 100644 index 0000000..cba0ad45 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/off-main-thread-fetch/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt
@@ -0,0 +1,66 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x462 + LayoutBlockFlow {HTML} at (0,0) size 800x461.50 + LayoutBlockFlow {BODY} at (4,4) size 136x449 [border: (0.50px dashed #C0C0C0)] + LayoutBlockFlow {P} at (0.50,9.50) size 135x27 + LayoutText {#text} at (0,-2) size 135x30 + text run at (0,-2) width 135: "The following six blue boxes must" + text run at (0,7) width 126: "be of the same width. There must" + text run at (0,16) width 37: "be no red." + LayoutBlockFlow {P} at (9.50,45.50) size 117x27 [bgcolor=#008000] [border: (9px solid #0000FF)] + LayoutText {#text} at (9,7) size 2x12 + text run at (9,7) width 2: " " + LayoutBlockFlow {P} at (0.50,126.50) size 135x9 + LayoutText {#text} at (0,-2) size 12x12 + text run at (0,-2) width 12: " " + LayoutBlockFlow {P} at (0.50,189.50) size 135x9 + LayoutTable (anonymous) at (0.50,252.50) size 135x44 + LayoutTableSection (anonymous) at (0,0) size 135x44 + LayoutTableRow (anonymous) at (0,0) size 135x44 + LayoutTableCell {P} at (0,0) size 135x44 [r=0 c=0 rs=1 cs=1] + LayoutTable {TABLE} at (0.50,350.50) size 135x44 + LayoutTableSection {TBODY} at (0,0) size 135x44 + LayoutTableRow {TR} at (0,0) size 135x44 + LayoutTableCell {TD} at (0,0) size 135x44 [r=0 c=0 rs=1 cs=1] + LayoutBlockFlow (floating) {P} at (0.50,448.50) size 135x9 +layer at (14,131) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,194) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,257) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,355) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,453) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/off-main-thread-fetch/http/tests/misc/slow-loading-image-in-pattern-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/off-main-thread-fetch/http/tests/misc/slow-loading-image-in-pattern-expected.txt new file mode 100644 index 0000000..a25991d6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/off-main-thread-fetch/http/tests/misc/slow-loading-image-in-pattern-expected.txt
@@ -0,0 +1,16 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x56 + LayoutBlockFlow {HTML} at (0,0) size 800x56 + LayoutBlockFlow {BODY} at (8,8) size 784x40 + LayoutText {#text} at (0,0) size 627x19 + text run at (0,0) width 627: "This tests slow loading png images referenced from a image element inside a SVG pattern resource." + LayoutBR {BR} at (627,0) size 0x19 + LayoutText {#text} at (0,20) size 562x19 + text run at (0,20) width 562: "You should see a 400x300 rect containing a tiled rendering of the Acid3 reference image." +layer at (10,50) size 406x306 clip at (13,53) size 400x300 + LayoutSVGRoot (positioned) {svg} at (10,50) size 406x306 + LayoutSVGHiddenContainer {defs} at (0,0) size 0x0 + LayoutSVGResourcePattern {pattern} [id="pattern"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse] + LayoutSVGImage {image} at (0,0) size 800x600 + LayoutSVGRect {rect} at (0,0) size 400x300 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=0.00] [width=400.00] [height=300.00]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-parent-reset-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-parent-reset-expected.txt index 7995f65..a92c8bdc 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-parent-reset-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-parent-reset-expected.txt
@@ -6,8 +6,6 @@ LayoutBlockFlow (anonymous) at (0,150) size 784x20 LayoutText {#text} at (0,0) size 624x19 text run at (0,0) width 624: "This test verifies the clip parent of a layer gets correctly reset when it gained a non-composited clip." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 150x150 transparent LayoutBlockFlow {DIV} at (0,0) size 150x150 [bgcolor=#FF0000] layer at (8,8) size 100x100 scrollWidth 200 scrollHeight 200
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/animations/rotate-transform-equivalent-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/animations/rotate-transform-equivalent-expected.txt index a5e89f4..ae6ad4e 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/animations/rotate-transform-equivalent-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/animations/rotate-transform-equivalent-expected.txt
@@ -5,10 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 195x19 text run at (0,0) width 195: "There should be no red visible." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 106x106 LayoutBlockFlow (positioned) {DIV} at (8,28) size 106x106 [color=#FF0000] [border: (3px solid #FF0000)] LayoutText {#text} at (3,5) size 56x114
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt deleted file mode 100644 index 04b8f1e..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x261 - LayoutBlockFlow {HTML} at (0,0) size 800x261 - LayoutBlockFlow {BODY} at (8,8) size 784x245 - LayoutText {#text} at (240,225) size 4x19 - text run at (240,225) width 4: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (28,28) size 200x200 - LayoutHTMLCanvas {CANVAS} at (20,20) size 200x200 [bgcolor=#00008000] -layer at (272,28) size 200x200 - LayoutHTMLCanvas {CANVAS} at (264,20) size 200x200 [bgcolor=#00008000]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt deleted file mode 100644 index dded8e3..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -PASS repainted when expected -FAIL did not repaint when expected -PASS repainted when expected -PASS did not repaint as expected -FAIL did not repaint when expected -
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/editing/input/caret-at-the-edge-of-input-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/editing/input/caret-at-the-edge-of-input-expected.txt index fd2f942..1d7e2f7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/editing/input/caret-at-the-edge-of-input-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/editing/input/caret-at-the-edge-of-input-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow (anonymous) at (0,18) size 784x19 LayoutTextControl {INPUT} at (0,0) size 71x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,29) size 65x13 scrollX 36.00 scrollWidth 262 LayoutBlockFlow {DIV} at (3,3) size 65x13 LayoutText {#text} at (0,0) size 262x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/editing/input/reveal-caret-of-multiline-input-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/editing/input/reveal-caret-of-multiline-input-expected.txt index 19af885..faab41b 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/editing/input/reveal-caret-of-multiline-input-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/editing/input/reveal-caret-of-multiline-input-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 610: "When the caret is scrolled out, on starting typing it must be brought to the center of the control." LayoutBlockFlow (anonymous) at (0,18) size 784x140 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,26) size 81x136 clip at (9,27) size 64x134 scrollY 98.00 scrollHeight 420 LayoutTextControl {TEXTAREA} at (0,0) size 81x136 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (3,3) size 60x416
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/editing/pasteboard/drop-text-without-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/editing/pasteboard/drop-text-without-selection-expected.txt index e00bdca..b89fab2 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/editing/pasteboard/drop-text-without-selection-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/editing/pasteboard/drop-text-without-selection-expected.txt
@@ -31,7 +31,6 @@ LayoutText {#text} at (135,0) size 166x18 text run at (135,0) width 166: "drop me into the text field" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,94) size 784x2 clip at (0,0) size 0x0 LayoutBlockFlow {HR} at (0,86) size 784x2 [border: (1px inset #EEEEEE)] layer at (11,107) size 125x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/dynamic/008-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/dynamic/008-expected.txt index 3c9d53b..9600673 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/dynamic/008-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/dynamic/008-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x672 LayoutBlockFlow {BODY} at (8,8) size 784x656 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 261x656 backgroundClip at (8,8) size 261x592 clip at (9,9) size 259x591 LayoutTextControl {TEXTAREA} at (0,0) size 261x656 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (3,3) size 255x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/button/button-align-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/button/button-align-expected.txt index fe626e9..55a69da8 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/button/button-align-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/button/button-align-expected.txt
@@ -33,7 +33,6 @@ LayoutText {#text} at (60,0) size 164x13 text run at (60,0) width 164: "This is should be center justified." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,109) size 784x18 LayoutButton {BUTTON} at (0,0) size 300x18 [bgcolor=#C0C0C0] [border: none (2px outset #C0C0C0) none (2px outset #C0C0C0)] LayoutBlockFlow (anonymous) at (8,2) size 284x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/indeterminate-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/indeterminate-expected.txt index 63005edf..caa3e0a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/indeterminate-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/indeterminate-expected.txt
@@ -5,6 +5,5 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (17,0) size 501x18 text run at (17,0) width 501: " This checkbox should look 50% transparent and should be in the mixed state." - LayoutText {#text} at (0,0) size 0x0 layer at (11,12) size 12x12 transparent LayoutBlockFlow {INPUT} at (2.88,4) size 12x12
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/number/number-appearance-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/number/number-appearance-rtl-expected.txt index 7a50929..55a235bb 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/number/number-appearance-rtl-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/number/number-appearance-rtl-expected.txt
@@ -24,7 +24,6 @@ LayoutBlockFlow {DIV} at (13,1) size 112x13 LayoutBlockFlow {DIV} at (0,0) size 13x15 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,140) size 784x19 LayoutTextControl {INPUT} at (0,0) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutFlexibleBox {DIV} at (3,2) size 125x15 @@ -35,7 +34,6 @@ LayoutFlexibleBox {DIV} at (3,2) size 125x15 LayoutBlockFlow {DIV} at (0,1) size 112x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,210) size 784x19 LayoutTextControl {INPUT} at (0,0) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutFlexibleBox {DIV} at (3,2) size 125x15 @@ -46,7 +44,6 @@ LayoutFlexibleBox {DIV} at (3,2) size 125x15 LayoutBlockFlow {DIV} at (13,1) size 112x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (677,19) size 112x13 LayoutBlockFlow {DIV} at (0,0) size 112x13 LayoutText {#text} at (105,0) size 7x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/search/search-appearance-basic-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/search/search-appearance-basic-expected.txt index c3ea2cd..03cd5aa 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/search/search-appearance-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/search/search-appearance-basic-expected.txt
@@ -96,7 +96,6 @@ LayoutFlexibleBox {DIV} at (18,4) size 144x13 LayoutBlockFlow {DIV} at (0,0) size 132x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (16,15) size 113x13 LayoutBlockFlow {DIV} at (0,0) size 113x13 LayoutText {#text} at (0,0) size 17x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/search/search-cancel-button-style-sharing-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/search/search-cancel-button-style-sharing-expected.txt index 3ce87a4..0498f56b 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/search/search-cancel-button-style-sharing-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/search/search-cancel-button-style-sharing-expected.txt
@@ -17,7 +17,6 @@ LayoutBlockFlow {DIV} at (0,0) size 113x13 LayoutBlockFlow {DIV} at (114,1) size 11x11 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (12,45) size 113x13 LayoutBlockFlow {DIV} at (0,0) size 113x13 layer at (149,45) size 113x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/listbox-appearance-basic-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/listbox-appearance-basic-expected.txt index 5df8284..40190ea7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/listbox-appearance-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/listbox-appearance-basic-expected.txt
@@ -7,7 +7,6 @@ text run at (41,49) width 5: " " LayoutText {#text} at (113,49) size 5x18 text run at (113,49) width 5: " " - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (159,49) size 5x18 text run at (159,49) width 5: " " LayoutText {#text} at (218,49) size 5x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/listbox-with-display-none-option-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/listbox-with-display-none-option-expected.txt index c12a75f..3285adb6 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/listbox-with-display-none-option-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/listbox-with-display-none-option-expected.txt
@@ -18,7 +18,6 @@ LayoutText {#text} at (273,97) size 5x18 text run at (273,97) width 5: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,64) size 48x101 clip at (9,65) size 35x99 LayoutListBox {SELECT} at (0,13.69) size 48.06x101.31 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 35.06x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/menulist-deselect-update-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/menulist-deselect-update-expected.txt index 00e93eda..ce4b59c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/menulist-deselect-update-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/menulist-deselect-update-expected.txt
@@ -10,4 +10,3 @@ LayoutText (anonymous) at (8,2) size 29x13 text run at (8,2) width 29: "PASS" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-align-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-align-expected.txt index 26258db..c05fc8b 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-align-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-align-expected.txt
@@ -40,7 +40,6 @@ LayoutText (anonymous) at (8,2) size 148x13 text run at (8,2) width 148: "This is should be left justified." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,128) size 784x18 LayoutMenuList {SELECT} at (0,0) size 300x18 [bgcolor=#F8F8F8] LayoutBlockFlow (anonymous) at (0,0) size 300x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-autofilled-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-autofilled-expected.txt index 2d41fa032..6214084 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-autofilled-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-autofilled-expected.txt
@@ -12,4 +12,3 @@ LayoutText (anonymous) at (8,1) size 23x18 text run at (8,1) width 23: "CA" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-change-listbox-size-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-change-listbox-size-expected.txt index ae7f9c6..3751575 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-change-listbox-size-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-change-listbox-size-expected.txt
@@ -21,7 +21,6 @@ text run at (0,0) width 323: "This list box should be tall enough to fit 6 options." LayoutBlockFlow (anonymous) at (0,86) size 784x87 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,94) size 45x87 clip at (9,95) size 32x85 LayoutListBox {SELECT} at (0,-0.13) size 45.17x87.13 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 32.17x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-empty-option-height-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-empty-option-height-expected.txt index 8d0ec6b8..50115a1b 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-empty-option-height-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-empty-option-height-expected.txt
@@ -8,4 +8,3 @@ LayoutText (anonymous) at (0,0) size 4x13 text run at (0,0) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-initial-position-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-initial-position-expected.txt index 73d65c36..93c75fa 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-initial-position-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-initial-position-expected.txt
@@ -15,8 +15,7 @@ LayoutBR {BR} at (164,91) size 1x0 LayoutText {#text} at (132,136) size 5x18 text run at (132,136) width 5: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (136,150) size 1x0 LayoutText {#text} at (0,154) size 217x18 text run at (0,154) width 217: "dynamic insert of selected option:" LayoutBR {BR} at (216,168) size 1x0 @@ -42,8 +41,7 @@ text run at (8,2) width 116: "this should be selected" LayoutText {#text} at (147,286) size 4x18 text run at (147,286) width 4: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (151,300) size 0x0 LayoutText {#text} at (0,305) size 217x18 text run at (0,305) width 217: "dynamic insert of selected option:" LayoutBR {BR} at (216,319) size 1x0 @@ -57,7 +55,6 @@ text run at (0,0) width 195: "Display 'none' to 'inline-block'" LayoutBlockFlow (anonymous) at (0,391) size 784x59 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,26) size 133x59 clip at (9,27) size 120x57 scrollY 99.00 scrollHeight 199 LayoutListBox {SELECT} at (0,18.25) size 132.55x58.75 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 119.55x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-item-background-clip-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-item-background-clip-expected.txt index 93dafff..52a96b42 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-item-background-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-item-background-clip-expected.txt
@@ -18,7 +18,6 @@ text run at (162,18) width 5: "." LayoutBlockFlow (anonymous) at (0,52) size 784x60 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,60) size 52x59 clip at (11,63) size 35x53 scrollHeight 62 LayoutListBox {SELECT} at (0,-0.50) size 52.27x59.50 [bgcolor=#FFFFFF] [border: (3px solid #0000FF)] LayoutBlockFlow {OPTION} at (6,6) size 29.27x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt index 37b5a85..bd7ace2 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x75 LayoutBlockFlow {BODY} at (8,8) size 784x59 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 332x59 clip at (9,9) size 319x57 LayoutListBox {SELECT} at (0,0.25) size 331.80x58.75 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 318.80x14.19 [color=#FFFFFF] [bgcolor=#0069D9]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/input-appearance-preventDefault-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/input-appearance-preventDefault-expected.txt index 33bbe59..991b2c0 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/input-appearance-preventDefault-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/input-appearance-preventDefault-expected.txt
@@ -6,8 +6,6 @@ LayoutBR {BR} at (0,0) size 0x18 LayoutText {#text} at (0,18) size 681x18 text run at (0,18) width 681: "This tests that preventDefault called onmousedown will prevent a caret from being placed in the text field." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,50) size 131x19 clip at (12,52) size 127x15 LayoutTextControl (positioned) {INPUT} at (10,50) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] layer at (13,53) size 125x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/input-placeholder-visibility-1-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/input-placeholder-visibility-1-expected.txt index f581557..42b44ee7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/input-placeholder-visibility-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/input-placeholder-visibility-1-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow {DIV} at (0,34) size 784x19 LayoutTextControl {INPUT} at (0,0) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,45) size 125x13 LayoutBlockFlow {DIV} at (3,3) size 125x13 [color=#757575] LayoutText {#text} at (0,0) size 60x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/input-placeholder-visibility-3-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/input-placeholder-visibility-3-expected.txt index 604b1b61..6cef66e 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/input-placeholder-visibility-3-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/input-placeholder-visibility-3-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow {DIV} at (0,34) size 784x19 LayoutTextControl {INPUT} at (0,0) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,45) size 125x13 LayoutBlockFlow {DIV} at (3,3) size 125x13 [color=#757575] LayoutText {#text} at (0,0) size 60x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/textfield-overflow-by-value-update-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/textfield-overflow-by-value-update-expected.txt index 551106e..98194d6e 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/textfield-overflow-by-value-update-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/textfield-overflow-by-value-update-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x18 LayoutTextControl {INPUT} at (0,1) size 102x2 [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (9,-9) size 100x38 backgroundClip at (9,0) size 100x29 clip at (9,0) size 100x29 LayoutBlockFlow {DIV} at (1,-18) size 100x38 LayoutText {#text} at (0,0) size 65x38
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-align-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-align-expected.txt index 6611638..3e5dfb2 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-align-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-align-expected.txt
@@ -17,7 +17,6 @@ text run at (321,90) width 4: " " LayoutBR {BR} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,174) size 784x32 layer at (8,42) size 321x32 clip at (9,43) size 319x30 LayoutTextControl {TEXTAREA} at (0,0) size 321x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt index 82f5dd2..6518a04 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 390: "Focus field with a placeholder, then type, then delete all text." LayoutBlockFlow {DIV} at (0,34) size 784x32 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,42) size 141x32 clip at (9,43) size 139x30 LayoutTextControl {TEXTAREA} at (0,0) size 141x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (3,3) size 135x13 [color=#757575]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt index 51afc42..b1cffb1 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 397: "Focus field with a placeholder, then type, then clear the value." LayoutBlockFlow {DIV} at (0,34) size 784x32 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,42) size 141x32 clip at (9,43) size 139x30 LayoutTextControl {TEXTAREA} at (0,0) size 141x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (3,3) size 135x13 [color=#757575]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt index 37b5a85..bd7ace2 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x75 LayoutBlockFlow {BODY} at (8,8) size 784x59 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 332x59 clip at (9,9) size 319x57 LayoutListBox {SELECT} at (0,0.25) size 331.80x58.75 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 318.80x14.19 [color=#FFFFFF] [bgcolor=#0069D9]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/html/details_summary/details-replace-text-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/html/details_summary/details-replace-text-expected.txt index 4802ef7..5ad0318 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/html/details_summary/details-replace-text-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/html/details_summary/details-replace-text-expected.txt
@@ -14,7 +14,6 @@ text run at (0,0) width 63: "Details1" LayoutText {#text} at (62,0) size 5x18 text run at (62,0) width 5: " " - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {SPAN} at (66.42,2) size 62.42x15 LayoutText {#text} at (0,0) size 63x15 text run at (0,0) width 63: "Details2"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/html/tabular_data/col_width_resizing_table-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/html/tabular_data/col_width_resizing_table-expected.txt index 4ea67c8..1c8a00c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/html/tabular_data/col_width_resizing_table-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/html/tabular_data/col_width_resizing_table-expected.txt
@@ -35,4 +35,3 @@ LayoutText {#text} at (0,0) size 327x13 text run at (0,0) width 327: "Click me to test manually. The first column should grow to 500px." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/hixie/mixed/003-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/hixie/mixed/003-expected.txt index 48ce822..be72248 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/hixie/mixed/003-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/hixie/mixed/003-expected.txt
@@ -12,7 +12,6 @@ LayoutSVGRoot {svg} at (0,0) size 200x200 LayoutSVGEllipse {circle} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [cx=50.00] [cy=50.00] [r=50.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,19) size 305x13 LayoutBlockFlow {div} at (3,3) size 305x13 LayoutText {#text} at (0,0) size 113x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/text/combining-character-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/text/combining-character-queries-expected.txt index 13d3818..cf39cc9 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/text/combining-character-queries-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/text/combining-character-queries-expected.txt
@@ -503,5 +503,3 @@ chunk 1 text run 1 at (359.72,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}" chunk 1 text run 1 at (408.79,350.00) startOffset 0 endOffset 2 width 15.76: "i\x{333}" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/input/caret-at-the-edge-of-input-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/input/caret-at-the-edge-of-input-expected.txt index 15ffce9..306fdeb 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/input/caret-at-the-edge-of-input-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/input/caret-at-the-edge-of-input-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow (anonymous) at (0,18) size 784x19 LayoutTextControl {INPUT} at (0,0) size 71x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,29) size 65x13 scrollX 35.00 scrollWidth 280 LayoutBlockFlow {DIV} at (3,3) size 65x13 LayoutText {#text} at (0,0) size 279x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/input/reveal-caret-of-multiline-input-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/input/reveal-caret-of-multiline-input-expected.txt index 8d0af1a..aae8b13d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/input/reveal-caret-of-multiline-input-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/input/reveal-caret-of-multiline-input-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 610: "When the caret is scrolled out, on starting typing it must be brought to the center of the control." LayoutBlockFlow (anonymous) at (0,18) size 784x140 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,26) size 81x136 clip at (9,27) size 64x134 scrollY 98.00 scrollHeight 420 LayoutTextControl {TEXTAREA} at (0,0) size 81x136 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (3,3) size 60x416
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/pasteboard/drop-text-without-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/pasteboard/drop-text-without-selection-expected.txt index d6b8a95..abdad5d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/pasteboard/drop-text-without-selection-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/pasteboard/drop-text-without-selection-expected.txt
@@ -31,7 +31,6 @@ LayoutText {#text} at (135,0) size 166x18 text run at (135,0) width 166: "drop me into the text field" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,94) size 784x2 clip at (0,0) size 0x0 LayoutBlockFlow {HR} at (0,86) size 784x2 [border: (1px inset #EEEEEE)] layer at (11,107) size 125x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/selection/4975120-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/selection/4975120-expected.txt new file mode 100644 index 0000000..788df16c --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/selection/4975120-expected.txt
@@ -0,0 +1,28 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x54 + LayoutText {#text} at (0,0) size 770x54 + text run at (0,0) width 768: "This tests for a bug that caused the parent of an active frame to paint as though it were active when its window becomes" + text run at (0,18) width 31: "key. " + text run at (30,18) width 740: "To run manually, make another window active and then make this window active. Only the subframe should appear" + text run at (0,36) width 43: "active." + LayoutBlockFlow (anonymous) at (0,70) size 784x173 + LayoutTextControl {INPUT} at (0,0) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] + LayoutBR {BR} at (131,14) size 0x0 + LayoutText {#text} at (0,0) size 0x0 +layer at (11,81) size 125x13 + LayoutBlockFlow {DIV} at (3,3) size 125x13 + LayoutText {#text} at (0,0) size 17x13 + text run at (0,0) width 17: "foo" +layer at (8,97) size 304x154 + LayoutIFrame {IFRAME} at (0,19) size 304x154 [border: (2px inset #EEEEEE)] + layer at (0,0) size 300x150 + LayoutView at (0,0) size 300x150 + layer at (0,0) size 300x150 + LayoutBlockFlow {HTML} at (0,0) size 300x150 + LayoutBlockFlow {BODY} at (8,8) size 284x134 [bgcolor=#FFFFE0] +selection start: position 0 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 3 {INPUT} of body +selection end: position 3 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 3 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/selection/move-by-sentence-001-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/selection/move-by-sentence-001-expected.txt new file mode 100644 index 0000000..faeebcd --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/selection/move-by-sentence-001-expected.txt
@@ -0,0 +1,30 @@ +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)] + LayoutText {#text} at (14,14) size 15x28 + text run at (14,14) width 15: "\x{2022} " + LayoutInline {B} at (0,0) size 241x28 + LayoutText {#text} at (28,14) size 241x28 + text run at (28,14) width 241: "This is some linked text" + LayoutText {#text} at (0,0) size 0x0 +caret: position 1 of child 0 {#text} of child 1 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/search/search-appearance-basic-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/search/search-appearance-basic-expected.txt index 988221b..e41815b 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/search/search-appearance-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/search/search-appearance-basic-expected.txt
@@ -96,7 +96,6 @@ LayoutFlexibleBox {DIV} at (18,4) size 144x13 LayoutBlockFlow {DIV} at (0,0) size 132x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (16,15) size 113x13 LayoutBlockFlow {DIV} at (0,0) size 113x13 LayoutText {#text} at (0,0) size 17x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/listbox-appearance-basic-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/listbox-appearance-basic-expected.txt index bc1aa80..bd2d605 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/listbox-appearance-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/listbox-appearance-basic-expected.txt
@@ -7,7 +7,6 @@ text run at (41,49) width 5: " " LayoutText {#text} at (115,49) size 5x18 text run at (115,49) width 5: " " - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (161,49) size 5x18 text run at (161,49) width 5: " " LayoutText {#text} at (222,49) size 5x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/listbox-with-display-none-option-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/listbox-with-display-none-option-expected.txt index 25252c9..32f82db 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/listbox-with-display-none-option-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/listbox-with-display-none-option-expected.txt
@@ -18,7 +18,6 @@ LayoutText {#text} at (291,97) size 5x18 text run at (291,97) width 5: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,64) size 49x101 clip at (9,65) size 36x99 LayoutListBox {SELECT} at (0,13.69) size 48.64x101.31 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 35.64x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/menulist-deselect-update-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/menulist-deselect-update-expected.txt index c0ae427..f1c655d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/menulist-deselect-update-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/menulist-deselect-update-expected.txt
@@ -10,4 +10,3 @@ LayoutText (anonymous) at (8,2) size 28x13 text run at (8,2) width 28: "PASS" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-autofilled-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-autofilled-expected.txt index 365b23c..75a17e37 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-autofilled-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-autofilled-expected.txt
@@ -12,4 +12,3 @@ LayoutText (anonymous) at (8,1) size 22x18 text run at (8,1) width 22: "CA" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-change-listbox-size-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-change-listbox-size-expected.txt index 59b9c2a..b3b36d17 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-change-listbox-size-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-change-listbox-size-expected.txt
@@ -21,7 +21,6 @@ text run at (0,0) width 323: "This list box should be tall enough to fit 6 options." LayoutBlockFlow (anonymous) at (0,86) size 784x87 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,94) size 47x87 clip at (9,95) size 34x85 LayoutListBox {SELECT} at (0,-0.13) size 47.11x87.13 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 34.11x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-initial-position-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-initial-position-expected.txt index 569a8e6..c6672c4 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-initial-position-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-initial-position-expected.txt
@@ -15,8 +15,7 @@ LayoutBR {BR} at (164,91) size 1x0 LayoutText {#text} at (137,136) size 5x18 text run at (137,136) width 5: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (141,150) size 1x0 LayoutText {#text} at (0,154) size 217x18 text run at (0,154) width 217: "dynamic insert of selected option:" LayoutBR {BR} at (216,168) size 1x0 @@ -42,8 +41,7 @@ text run at (8,2) width 121: "this should be selected" LayoutText {#text} at (152,286) size 4x18 text run at (152,286) width 4: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (156,300) size 0x0 LayoutText {#text} at (0,305) size 217x18 text run at (0,305) width 217: "dynamic insert of selected option:" LayoutBR {BR} at (216,319) size 1x0 @@ -57,7 +55,6 @@ text run at (0,0) width 195: "Display 'none' to 'inline-block'" LayoutBlockFlow (anonymous) at (0,391) size 784x59 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,26) size 137x59 clip at (9,27) size 124x57 scrollY 99.00 scrollHeight 199 LayoutListBox {SELECT} at (0,18.25) size 137.41x58.75 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 124.41x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-item-background-clip-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-item-background-clip-expected.txt index 16ccc157..c3d3ff9f 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-item-background-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-item-background-clip-expected.txt
@@ -18,7 +18,6 @@ text run at (162,18) width 5: "." LayoutBlockFlow (anonymous) at (0,52) size 784x60 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,60) size 54x59 clip at (11,63) size 37x53 scrollHeight 62 LayoutListBox {SELECT} at (0,-0.50) size 54.13x59.50 [bgcolor=#FFFFFF] [border: (3px solid #0000FF)] LayoutBlockFlow {OPTION} at (6,6) size 31.13x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt index 57963a0c..29b3edf1 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x75 LayoutBlockFlow {BODY} at (8,8) size 784x59 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 352x59 clip at (9,9) size 339x57 LayoutListBox {SELECT} at (0,0.25) size 352x58.75 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 339x14.19 [color=#FFFFFF] [bgcolor=#0069D9]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/text/textfield-overflow-by-value-update-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/text/textfield-overflow-by-value-update-expected.txt index c4596b9..5833f3a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/text/textfield-overflow-by-value-update-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/text/textfield-overflow-by-value-update-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x18 LayoutTextControl {INPUT} at (0,1) size 102x2 [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (9,-9) size 100x38 backgroundClip at (9,0) size 100x29 clip at (9,0) size 100x29 LayoutBlockFlow {DIV} at (1,-18) size 100x38 LayoutText {#text} at (0,0) size 60x38
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt index 57963a0c..29b3edf1 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x75 LayoutBlockFlow {BODY} at (8,8) size 784x59 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 352x59 clip at (9,9) size 339x57 LayoutListBox {SELECT} at (0,0.25) size 352x58.75 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 339x14.19 [color=#FFFFFF] [bgcolor=#0069D9]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/html/tabular_data/col_width_resizing_table-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/html/tabular_data/col_width_resizing_table-expected.txt index 3b2e158..9f76815aa 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/html/tabular_data/col_width_resizing_table-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/html/tabular_data/col_width_resizing_table-expected.txt
@@ -35,4 +35,3 @@ LayoutText {#text} at (0,0) size 340x13 text run at (0,0) width 340: "Click me to test manually. The first column should grow to 500px." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/svg/hixie/mixed/003-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/svg/hixie/mixed/003-expected.txt index 61b5260b..1e32f73 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/svg/hixie/mixed/003-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/svg/hixie/mixed/003-expected.txt
@@ -12,7 +12,6 @@ LayoutSVGRoot {svg} at (0,0) size 200x200 LayoutSVGEllipse {circle} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [cx=50.00] [cy=50.00] [r=50.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,19) size 305x13 LayoutBlockFlow {div} at (3,3) size 305x13 LayoutText {#text} at (0,0) size 115x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/accessibility/element-role-mapping-focusable-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/accessibility/element-role-mapping-focusable-expected.txt index 02d3d703..87aa9786 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/accessibility/element-role-mapping-focusable-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/accessibility/element-role-mapping-focusable-expected.txt
@@ -1,6 +1,6 @@ Visit Chromium Click the text! Button Copyright 2015. - I have a checkbox Radio Button + I have a checkbox Radio Button I have a menuItem Menu ItemRadio Birthday: Birthday(date and time): Birthday(datetime-local): Birthday (month and year): Select a week: Select a file: Min-Max: Color: Select a time: 0 100 + =
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt deleted file mode 100644 index dded8e3..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -PASS repainted when expected -FAIL did not repaint when expected -PASS repainted when expected -PASS did not repaint as expected -FAIL did not repaint when expected -
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/input/caret-at-the-edge-of-input-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/input/caret-at-the-edge-of-input-expected.txt index 36f21ece7..64c02b9 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/input/caret-at-the-edge-of-input-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/input/caret-at-the-edge-of-input-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow (anonymous) at (0,18) size 784x19 LayoutTextControl {INPUT} at (0,0) size 73x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,29) size 67x13 scrollX 37.00 scrollWidth 293 LayoutBlockFlow {DIV} at (3,3) size 67x13 LayoutText {#text} at (0,0) size 293x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/input/reveal-caret-of-multiline-input-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/input/reveal-caret-of-multiline-input-expected.txt index 58467c8f..43bf874c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/input/reveal-caret-of-multiline-input-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/input/reveal-caret-of-multiline-input-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 610: "When the caret is scrolled out, on starting typing it must be brought to the center of the control." LayoutBlockFlow (anonymous) at (0,18) size 784x140 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,26) size 91x136 clip at (9,27) size 74x134 scrollY 98.00 scrollHeight 420 LayoutTextControl {TEXTAREA} at (0,0) size 91x136 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (3,3) size 70x416
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/inserting/4960120-1-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/inserting/4960120-1-expected.txt index 51cc2a81..2d56d334 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/inserting/4960120-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/inserting/4960120-1-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 517: "This tests for a bug where the first newline entered into a text area would be lost." LayoutBlockFlow (anonymous) at (0,34) size 784x32 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,42) size 161x32 clip at (9,43) size 159x30 LayoutTextControl {TEXTAREA} at (0,0) size 161x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (3,3) size 155x26
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/pasteboard/drop-text-without-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/pasteboard/drop-text-without-selection-expected.txt index cfcdd7f6..69b2927 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/pasteboard/drop-text-without-selection-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/pasteboard/drop-text-without-selection-expected.txt
@@ -31,7 +31,6 @@ LayoutText {#text} at (127,0) size 166x18 text run at (127,0) width 166: "drop me into the text field" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,94) size 784x2 clip at (0,0) size 0x0 LayoutBlockFlow {HR} at (0,86) size 784x2 [border: (1px inset #EEEEEE)] layer at (11,107) size 117x13 scrollWidth 119
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/selection/4975120-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/selection/4975120-expected.txt index 98590cd..0a8e8257 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/selection/4975120-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/selection/4975120-expected.txt
@@ -13,7 +13,6 @@ LayoutTextControl {INPUT} at (0,0) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutBR {BR} at (123,14) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,81) size 117x13 LayoutBlockFlow {DIV} at (3,3) size 117x13 LayoutText {#text} at (0,0) size 18x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/dynamic/008-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/dynamic/008-expected.txt index b44bdf13..08064fd 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/dynamic/008-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/dynamic/008-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x672 LayoutBlockFlow {BODY} at (8,8) size 784x656 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 301x656 backgroundClip at (8,8) size 301x592 clip at (9,9) size 299x591 LayoutTextControl {TEXTAREA} at (0,0) size 301x656 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (3,3) size 295x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/events/context-no-deselect-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/events/context-no-deselect-expected.txt index a3130b7..4764679 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/events/context-no-deselect-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/events/context-no-deselect-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutTextControl {INPUT} at (0,0) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,11) size 117x13 LayoutBlockFlow {DIV} at (3,3) size 117x13 LayoutText {#text} at (0,0) size 95x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/button/button-align-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/button/button-align-expected.txt index 90b72fa..feed79ab6 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/button/button-align-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/button/button-align-expected.txt
@@ -33,7 +33,6 @@ LayoutText {#text} at (53,0) size 178x13 text run at (53,0) width 178: "This is should be center justified." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,109) size 784x18 LayoutButton {BUTTON} at (0,0) size 300x18 [bgcolor=#C0C0C0] [border: none (2px outset #C0C0C0) none (2px outset #C0C0C0)] LayoutBlockFlow (anonymous) at (8,2) size 284x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/indeterminate-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/indeterminate-expected.txt index 3f792e0..542e9324 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/indeterminate-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/indeterminate-expected.txt
@@ -5,6 +5,5 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (17,0) size 501x18 text run at (17,0) width 501: " This checkbox should look 50% transparent and should be in the mixed state." - LayoutText {#text} at (0,0) size 0x0 layer at (11,12) size 12x12 transparent LayoutBlockFlow {INPUT} at (2.91,4) size 12x12
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/number/number-appearance-datalist-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/number/number-appearance-datalist-expected.txt index 315908e..3ff71cd 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/number/number-appearance-datalist-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/number/number-appearance-datalist-expected.txt
@@ -27,7 +27,6 @@ LayoutFlexibleBox {DIV} at (3,2) size 117x15 LayoutBlockFlow {DIV} at (0,1) size 89.28x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,11) size 89x13 LayoutBlockFlow {DIV} at (0,0) size 89.28x13 layer at (138,11) size 89x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/number/number-appearance-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/number/number-appearance-rtl-expected.txt index f7cb3c1..0b87566 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/number/number-appearance-rtl-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/number/number-appearance-rtl-expected.txt
@@ -24,7 +24,6 @@ LayoutBlockFlow {DIV} at (13,1) size 104x13 LayoutBlockFlow {DIV} at (0,0) size 13x15 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,140) size 784x19 LayoutTextControl {INPUT} at (0,0) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutFlexibleBox {DIV} at (3,2) size 117x15 @@ -35,7 +34,6 @@ LayoutFlexibleBox {DIV} at (3,2) size 117x15 LayoutBlockFlow {DIV} at (0,1) size 104x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,210) size 784x19 LayoutTextControl {INPUT} at (0,0) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutFlexibleBox {DIV} at (3,2) size 117x15 @@ -46,7 +44,6 @@ LayoutFlexibleBox {DIV} at (3,2) size 117x15 LayoutBlockFlow {DIV} at (13,1) size 104x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (685,19) size 104x13 LayoutBlockFlow {DIV} at (0,0) size 104x13 LayoutText {#text} at (97,0) size 7x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/search/search-appearance-basic-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/search/search-appearance-basic-expected.txt index 46c752a..185261db 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/search/search-appearance-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/search/search-appearance-basic-expected.txt
@@ -96,7 +96,6 @@ LayoutFlexibleBox {DIV} at (18,4) size 144x13 LayoutBlockFlow {DIV} at (0,0) size 132x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (16,15) size 105x13 LayoutBlockFlow {DIV} at (0,0) size 105x13 LayoutText {#text} at (0,0) size 18x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/search/search-cancel-button-style-sharing-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/search/search-cancel-button-style-sharing-expected.txt index 020ebeb..403e698 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/search/search-cancel-button-style-sharing-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/search/search-cancel-button-style-sharing-expected.txt
@@ -17,7 +17,6 @@ LayoutBlockFlow {DIV} at (0,0) size 105x13 LayoutBlockFlow {DIV} at (106,1) size 11x11 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (12,45) size 105x13 LayoutBlockFlow {DIV} at (0,0) size 105x13 layer at (141,45) size 105x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/listbox-appearance-basic-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/listbox-appearance-basic-expected.txt index 63353e51..0876c533 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/listbox-appearance-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/listbox-appearance-basic-expected.txt
@@ -7,7 +7,6 @@ text run at (42,49) width 5: " " LayoutText {#text} at (117,49) size 5x18 text run at (117,49) width 5: " " - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (164,49) size 5x18 text run at (164,49) width 5: " " LayoutText {#text} at (226,49) size 5x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/listbox-with-display-none-option-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/listbox-with-display-none-option-expected.txt index 9e5754e..32e26df 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/listbox-with-display-none-option-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/listbox-with-display-none-option-expected.txt
@@ -18,7 +18,6 @@ LayoutText {#text} at (283,97) size 5x18 text run at (283,97) width 5: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,64) size 48x101 clip at (9,65) size 35x99 LayoutListBox {SELECT} at (0,13.69) size 47.70x101.31 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 34.70x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/menulist-deselect-update-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/menulist-deselect-update-expected.txt index dd3e5f6..932f710 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/menulist-deselect-update-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/menulist-deselect-update-expected.txt
@@ -10,4 +10,3 @@ LayoutText (anonymous) at (8,2) size 26x13 text run at (8,2) width 26: "PASS" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-align-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-align-expected.txt index 2cb3116e..72d409a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-align-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-align-expected.txt
@@ -40,7 +40,6 @@ LayoutText (anonymous) at (8,2) size 163x13 text run at (8,2) width 163: "This is should be left justified." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,128) size 784x18 LayoutMenuList {SELECT} at (0,0) size 300x18 [bgcolor=#F8F8F8] LayoutBlockFlow (anonymous) at (0,0) size 300x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-change-listbox-size-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-change-listbox-size-expected.txt index ed9b79be..023cce0 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-change-listbox-size-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-change-listbox-size-expected.txt
@@ -21,7 +21,6 @@ text run at (0,0) width 323: "This list box should be tall enough to fit 6 options." LayoutBlockFlow (anonymous) at (0,86) size 784x87 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,94) size 48x87 clip at (9,95) size 35x85 LayoutListBox {SELECT} at (0,-0.13) size 47.55x87.13 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 34.55x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-empty-option-height-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-empty-option-height-expected.txt index 7e0fafa..30e73c2 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-empty-option-height-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-empty-option-height-expected.txt
@@ -8,4 +8,3 @@ LayoutText (anonymous) at (0,0) size 4x13 text run at (0,0) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-initial-position-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-initial-position-expected.txt index 8774e74..42f9055 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-initial-position-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-initial-position-expected.txt
@@ -15,8 +15,7 @@ LayoutBR {BR} at (164,91) size 1x0 LayoutText {#text} at (140,136) size 5x18 text run at (140,136) width 5: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (144,150) size 1x0 LayoutText {#text} at (0,154) size 217x18 text run at (0,154) width 217: "dynamic insert of selected option:" LayoutBR {BR} at (216,168) size 1x0 @@ -42,8 +41,7 @@ text run at (8,2) width 124: "this should be selected" LayoutText {#text} at (155,286) size 4x18 text run at (155,286) width 4: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (159,300) size 0x0 LayoutText {#text} at (0,305) size 217x18 text run at (0,305) width 217: "dynamic insert of selected option:" LayoutBR {BR} at (216,319) size 1x0 @@ -57,7 +55,6 @@ text run at (0,0) width 195: "Display 'none' to 'inline-block'" LayoutBlockFlow (anonymous) at (0,391) size 784x59 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,26) size 140x59 clip at (9,27) size 127x57 scrollY 99.00 scrollHeight 199 LayoutListBox {SELECT} at (0,18.25) size 140.19x58.75 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 127.19x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-item-background-clip-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-item-background-clip-expected.txt index 652aa6b..f6d2867 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-item-background-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-item-background-clip-expected.txt
@@ -18,7 +18,6 @@ text run at (162,18) width 5: "." LayoutBlockFlow (anonymous) at (0,52) size 784x60 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,60) size 55x59 clip at (11,63) size 38x53 scrollHeight 62 LayoutListBox {SELECT} at (0,-0.50) size 54.70x59.50 [bgcolor=#FFFFFF] [border: (3px solid #0000FF)] LayoutBlockFlow {OPTION} at (6,6) size 31.70x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt index f089c6a9..781d54a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x75 LayoutBlockFlow {BODY} at (8,8) size 784x59 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 376x59 clip at (9,9) size 363x57 LayoutListBox {SELECT} at (0,0.25) size 375.70x58.75 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 362.70x14.19 [color=#FFFFFF] [bgcolor=#3875D7]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/input-appearance-preventDefault-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/input-appearance-preventDefault-expected.txt index 59cbfff4..f7308ef 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/input-appearance-preventDefault-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/input-appearance-preventDefault-expected.txt
@@ -6,8 +6,6 @@ LayoutBR {BR} at (0,0) size 0x18 LayoutText {#text} at (0,18) size 681x18 text run at (0,18) width 681: "This tests that preventDefault called onmousedown will prevent a caret from being placed in the text field." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,50) size 123x19 clip at (12,52) size 119x15 LayoutTextControl (positioned) {INPUT} at (10,50) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] layer at (13,53) size 117x13 scrollWidth 129
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/input-placeholder-visibility-1-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/input-placeholder-visibility-1-expected.txt index 4228b66..b74a92c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/input-placeholder-visibility-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/input-placeholder-visibility-1-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow {DIV} at (0,34) size 784x19 LayoutTextControl {INPUT} at (0,0) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,45) size 117x13 LayoutBlockFlow {DIV} at (3,3) size 117x13 [color=#757575] LayoutText {#text} at (0,0) size 62x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/input-placeholder-visibility-3-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/input-placeholder-visibility-3-expected.txt index 9360e9e..aebecba 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/input-placeholder-visibility-3-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/input-placeholder-visibility-3-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow {DIV} at (0,34) size 784x19 LayoutTextControl {INPUT} at (0,0) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,45) size 117x13 LayoutBlockFlow {DIV} at (3,3) size 117x13 [color=#757575] LayoutText {#text} at (0,0) size 62x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/input-tab-shows-caret-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/input-tab-shows-caret-expected.txt index 66f55d0..9aaac6d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/input-tab-shows-caret-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/input-tab-shows-caret-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x19 LayoutTextControl {INPUT} at (0,0) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,11) size 117x13 LayoutBlockFlow {DIV} at (3,3) size 117x13 caret: position 0 of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/text-appearance-datalist-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/text-appearance-datalist-expected.txt index 6c1491d5..111e8ec 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/text-appearance-datalist-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/text-appearance-datalist-expected.txt
@@ -25,7 +25,6 @@ LayoutFlexibleBox {DIV} at (3,3) size 117x13 LayoutBlockFlow {DIV} at (0,0) size 102.28x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,11) size 102x13 LayoutBlockFlow {DIV} at (0,0) size 102.28x13 layer at (138,11) size 102x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/textfield-overflow-by-value-update-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/textfield-overflow-by-value-update-expected.txt index 2c974eb2..418f3e7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/textfield-overflow-by-value-update-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/textfield-overflow-by-value-update-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x18 LayoutTextControl {INPUT} at (0,1) size 102x2 [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (9,-9) size 100x38 backgroundClip at (9,0) size 100x29 clip at (9,0) size 100x29 LayoutBlockFlow {DIV} at (1,-18) size 100x38 LayoutText {#text} at (0,0) size 66x38
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/textfield-overflow-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/textfield-overflow-expected.txt index 6e7e064e..71e956d1 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/textfield-overflow-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/textfield-overflow-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutTextControl {INPUT} at (0,0) size 123x10 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,7) size 117x13 LayoutBlockFlow {DIV} at (3,-1.50) size 117x13 caret: position 0 of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-align-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-align-expected.txt index aed3d98fa..9bf1e783 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-align-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-align-expected.txt
@@ -17,7 +17,6 @@ text run at (371,90) width 4: " " LayoutBR {BR} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,174) size 784x32 layer at (8,42) size 371x32 clip at (9,43) size 369x30 LayoutTextControl {TEXTAREA} at (0,0) size 371x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt index 09c9567d..e4448dd 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 390: "Focus field with a placeholder, then type, then delete all text." LayoutBlockFlow {DIV} at (0,34) size 784x32 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,42) size 161x32 clip at (9,43) size 159x30 LayoutTextControl {TEXTAREA} at (0,0) size 161x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (3,3) size 155x13 [color=#757575]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt index d371cc9..03dc838 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 397: "Focus field with a placeholder, then type, then clear the value." LayoutBlockFlow {DIV} at (0,34) size 784x32 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,42) size 161x32 clip at (9,43) size 159x30 LayoutTextControl {TEXTAREA} at (0,0) size 161x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (3,3) size 155x13 [color=#757575]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt index f089c6a9..781d54a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x75 LayoutBlockFlow {BODY} at (8,8) size 784x59 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 376x59 clip at (9,9) size 363x57 LayoutListBox {SELECT} at (0,0.25) size 375.70x58.75 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 362.70x14.19 [color=#FFFFFF] [bgcolor=#3875D7]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/html/details_summary/details-open2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/html/details_summary/details-open2-expected.txt index de40f303..901b4796 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/html/details_summary/details-open2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/html/details_summary/details-open2-expected.txt
@@ -11,6 +11,5 @@ LayoutBlockFlow {DIV} at (0,18) size 784x19 LayoutTextControl {INPUT} at (0,0) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,29) size 117x13 LayoutBlockFlow {DIV} at (3,3) size 117x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/html/details_summary/details-replace-text-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/html/details_summary/details-replace-text-expected.txt index 71e2b92..78dba4c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/html/details_summary/details-replace-text-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/html/details_summary/details-replace-text-expected.txt
@@ -14,7 +14,6 @@ text run at (0,0) width 63: "Details1" LayoutText {#text} at (62,0) size 5x18 text run at (62,0) width 5: " " - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {SPAN} at (66.42,2) size 62.42x15 LayoutText {#text} at (0,0) size 63x15 text run at (0,0) width 63: "Details2"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/html/tabular_data/col_width_resizing_table-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/html/tabular_data/col_width_resizing_table-expected.txt index 8519691..be2b8c2 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/html/tabular_data/col_width_resizing_table-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/html/tabular_data/col_width_resizing_table-expected.txt
@@ -35,4 +35,3 @@ LayoutText {#text} at (0,0) size 356x13 text run at (0,0) width 356: "Click me to test manually. The first column should grow to 500px." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/details-open-repaint-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/details-open-repaint-expected.txt index 1659fba..530071a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/details-open-repaint-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/details-open-repaint-expected.txt
@@ -61,10 +61,6 @@ { "object": "LayoutText #text", "reason": "appeared" - }, - { - "object": "LayoutText #text", - "reason": "appeared" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt index f8f11fe..5584eca 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow (anonymous) at (0,19) size 784x18 LayoutText {#text} at (0,0) size 4x18 text run at (0,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,37) size 784x0 layer at (11,11) size 117x13 LayoutBlockFlow {DIV} at (3,3) size 117x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/hixie/mixed/003-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/hixie/mixed/003-expected.txt index b5232278..9b78bd66 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/hixie/mixed/003-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/hixie/mixed/003-expected.txt
@@ -12,7 +12,6 @@ LayoutSVGRoot {svg} at (0,0) size 200x200 LayoutSVGEllipse {circle} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [cx=50.00] [cy=50.00] [r=50.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,19) size 267x13 LayoutBlockFlow {div} at (3,3) size 267x13 LayoutText {#text} at (0,0) size 115x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/combining-character-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/combining-character-queries-expected.txt index eee0dd1..cdae611 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/combining-character-queries-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/combining-character-queries-expected.txt
@@ -503,5 +503,3 @@ chunk 1 text run 1 at (359.72,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}" chunk 1 text run 1 at (408.79,350.00) startOffset 0 endOffset 2 width 7.78: "i\x{333}" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/ligature-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/ligature-queries-expected.txt index 339f371..d985af9 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/ligature-queries-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/ligature-queries-expected.txt
@@ -500,5 +500,3 @@ chunk 1 text run 33 at (458.33,416.13) startOffset 32 endOffset 33 width 14.79: "i" LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/surrogate-pair-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/surrogate-pair-queries-expected.txt index 62fc498d..6f01d0f9 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/surrogate-pair-queries-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/surrogate-pair-queries-expected.txt
@@ -336,5 +336,3 @@ LayoutSVGInlineText {#text} at (357.33,318) size 92.66x40 chunk 1 text run 1 at (357.34,350.00) startOffset 0 endOffset 7 width 92.66 RTL override: "\x{D83C}\x{DFB6}\x{D801}\x{DC37}\x{30C}\x{D83C}\x{DFB6}" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/disable-spinvalidation/paint/invalidation/details-open-repaint-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/disable-spinvalidation/paint/invalidation/details-open-repaint-expected.txt index 1659fba..530071a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/disable-spinvalidation/paint/invalidation/details-open-repaint-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/disable-spinvalidation/paint/invalidation/details-open-repaint-expected.txt
@@ -61,10 +61,6 @@ { "object": "LayoutText #text", "reason": "appeared" - }, - { - "object": "LayoutText #text", - "reason": "appeared" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/disable-spinvalidation/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/disable-spinvalidation/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt new file mode 100644 index 0000000..5584eca --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/disable-spinvalidation/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt
@@ -0,0 +1,15 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {DIV} at (0,0) size 784x19 + LayoutTextControl {INPUT} at (0,0) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] + LayoutText {#text} at (0,0) size 0x0 + LayoutBlockFlow (anonymous) at (0,19) size 784x18 + LayoutText {#text} at (0,0) size 4x18 + text run at (0,0) width 4: " " + LayoutBlockFlow {DIV} at (0,37) size 784x0 +layer at (11,11) size 117x13 + LayoutBlockFlow {DIV} at (3,3) size 117x13 +caret: position 0 of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of child 1 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt deleted file mode 100644 index dded8e3..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -PASS repainted when expected -FAIL did not repaint when expected -PASS repainted when expected -PASS did not repaint as expected -FAIL did not repaint when expected -
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/editing/input/caret-at-the-edge-of-input-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/editing/input/caret-at-the-edge-of-input-expected.txt index 15ffce9..306fdeb 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/editing/input/caret-at-the-edge-of-input-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/editing/input/caret-at-the-edge-of-input-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow (anonymous) at (0,18) size 784x19 LayoutTextControl {INPUT} at (0,0) size 71x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,29) size 65x13 scrollX 35.00 scrollWidth 280 LayoutBlockFlow {DIV} at (3,3) size 65x13 LayoutText {#text} at (0,0) size 279x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/editing/input/reveal-caret-of-multiline-input-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/editing/input/reveal-caret-of-multiline-input-expected.txt index 8d0af1a..aae8b13d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/editing/input/reveal-caret-of-multiline-input-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/editing/input/reveal-caret-of-multiline-input-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 610: "When the caret is scrolled out, on starting typing it must be brought to the center of the control." LayoutBlockFlow (anonymous) at (0,18) size 784x140 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,26) size 81x136 clip at (9,27) size 64x134 scrollY 98.00 scrollHeight 420 LayoutTextControl {TEXTAREA} at (0,0) size 81x136 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (3,3) size 60x416
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/editing/pasteboard/drop-text-without-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/editing/pasteboard/drop-text-without-selection-expected.txt index d6b8a95..abdad5d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/editing/pasteboard/drop-text-without-selection-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/editing/pasteboard/drop-text-without-selection-expected.txt
@@ -31,7 +31,6 @@ LayoutText {#text} at (135,0) size 166x18 text run at (135,0) width 166: "drop me into the text field" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,94) size 784x2 clip at (0,0) size 0x0 LayoutBlockFlow {HR} at (0,86) size 784x2 [border: (1px inset #EEEEEE)] layer at (11,107) size 125x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/editing/selection/4975120-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/editing/selection/4975120-expected.txt new file mode 100644 index 0000000..788df16c --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/editing/selection/4975120-expected.txt
@@ -0,0 +1,28 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x54 + LayoutText {#text} at (0,0) size 770x54 + text run at (0,0) width 768: "This tests for a bug that caused the parent of an active frame to paint as though it were active when its window becomes" + text run at (0,18) width 31: "key. " + text run at (30,18) width 740: "To run manually, make another window active and then make this window active. Only the subframe should appear" + text run at (0,36) width 43: "active." + LayoutBlockFlow (anonymous) at (0,70) size 784x173 + LayoutTextControl {INPUT} at (0,0) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] + LayoutBR {BR} at (131,14) size 0x0 + LayoutText {#text} at (0,0) size 0x0 +layer at (11,81) size 125x13 + LayoutBlockFlow {DIV} at (3,3) size 125x13 + LayoutText {#text} at (0,0) size 17x13 + text run at (0,0) width 17: "foo" +layer at (8,97) size 304x154 + LayoutIFrame {IFRAME} at (0,19) size 304x154 [border: (2px inset #EEEEEE)] + layer at (0,0) size 300x150 + LayoutView at (0,0) size 300x150 + layer at (0,0) size 300x150 + LayoutBlockFlow {HTML} at (0,0) size 300x150 + LayoutBlockFlow {BODY} at (8,8) size 284x134 [bgcolor=#FFFFE0] +selection start: position 0 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 3 {INPUT} of body +selection end: position 3 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 3 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/editing/selection/move-by-sentence-001-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/editing/selection/move-by-sentence-001-expected.txt new file mode 100644 index 0000000..faeebcd --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/editing/selection/move-by-sentence-001-expected.txt
@@ -0,0 +1,30 @@ +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)] + LayoutText {#text} at (14,14) size 15x28 + text run at (14,14) width 15: "\x{2022} " + LayoutInline {B} at (0,0) size 241x28 + LayoutText {#text} at (28,14) size 241x28 + text run at (28,14) width 241: "This is some linked text" + LayoutText {#text} at (0,0) size 0x0 +caret: position 1 of child 0 {#text} of child 1 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/search/search-appearance-basic-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/search/search-appearance-basic-expected.txt index 988221b..e41815b 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/search/search-appearance-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/search/search-appearance-basic-expected.txt
@@ -96,7 +96,6 @@ LayoutFlexibleBox {DIV} at (18,4) size 144x13 LayoutBlockFlow {DIV} at (0,0) size 132x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (16,15) size 113x13 LayoutBlockFlow {DIV} at (0,0) size 113x13 LayoutText {#text} at (0,0) size 17x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/listbox-appearance-basic-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/listbox-appearance-basic-expected.txt index bc1aa80..bd2d605 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/listbox-appearance-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/listbox-appearance-basic-expected.txt
@@ -7,7 +7,6 @@ text run at (41,49) width 5: " " LayoutText {#text} at (115,49) size 5x18 text run at (115,49) width 5: " " - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (161,49) size 5x18 text run at (161,49) width 5: " " LayoutText {#text} at (222,49) size 5x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/listbox-with-display-none-option-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/listbox-with-display-none-option-expected.txt index 25252c9..32f82db 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/listbox-with-display-none-option-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/listbox-with-display-none-option-expected.txt
@@ -18,7 +18,6 @@ LayoutText {#text} at (291,97) size 5x18 text run at (291,97) width 5: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,64) size 49x101 clip at (9,65) size 36x99 LayoutListBox {SELECT} at (0,13.69) size 48.64x101.31 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 35.64x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/menulist-deselect-update-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/menulist-deselect-update-expected.txt index c0ae427..f1c655d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/menulist-deselect-update-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/menulist-deselect-update-expected.txt
@@ -10,4 +10,3 @@ LayoutText (anonymous) at (8,2) size 28x13 text run at (8,2) width 28: "PASS" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-autofilled-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-autofilled-expected.txt index 365b23c..75a17e37 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-autofilled-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-autofilled-expected.txt
@@ -12,4 +12,3 @@ LayoutText (anonymous) at (8,1) size 22x18 text run at (8,1) width 22: "CA" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-change-listbox-size-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-change-listbox-size-expected.txt index 59b9c2a..b3b36d17 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-change-listbox-size-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-change-listbox-size-expected.txt
@@ -21,7 +21,6 @@ text run at (0,0) width 323: "This list box should be tall enough to fit 6 options." LayoutBlockFlow (anonymous) at (0,86) size 784x87 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,94) size 47x87 clip at (9,95) size 34x85 LayoutListBox {SELECT} at (0,-0.13) size 47.11x87.13 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 34.11x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-initial-position-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-initial-position-expected.txt index 569a8e6..c6672c4 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-initial-position-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-initial-position-expected.txt
@@ -15,8 +15,7 @@ LayoutBR {BR} at (164,91) size 1x0 LayoutText {#text} at (137,136) size 5x18 text run at (137,136) width 5: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (141,150) size 1x0 LayoutText {#text} at (0,154) size 217x18 text run at (0,154) width 217: "dynamic insert of selected option:" LayoutBR {BR} at (216,168) size 1x0 @@ -42,8 +41,7 @@ text run at (8,2) width 121: "this should be selected" LayoutText {#text} at (152,286) size 4x18 text run at (152,286) width 4: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (156,300) size 0x0 LayoutText {#text} at (0,305) size 217x18 text run at (0,305) width 217: "dynamic insert of selected option:" LayoutBR {BR} at (216,319) size 1x0 @@ -57,7 +55,6 @@ text run at (0,0) width 195: "Display 'none' to 'inline-block'" LayoutBlockFlow (anonymous) at (0,391) size 784x59 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,26) size 137x59 clip at (9,27) size 124x57 scrollY 99.00 scrollHeight 199 LayoutListBox {SELECT} at (0,18.25) size 137.41x58.75 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 124.41x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-item-background-clip-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-item-background-clip-expected.txt index 16ccc157..c3d3ff9f 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-item-background-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-item-background-clip-expected.txt
@@ -18,7 +18,6 @@ text run at (162,18) width 5: "." LayoutBlockFlow (anonymous) at (0,52) size 784x60 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,60) size 54x59 clip at (11,63) size 37x53 scrollHeight 62 LayoutListBox {SELECT} at (0,-0.50) size 54.13x59.50 [bgcolor=#FFFFFF] [border: (3px solid #0000FF)] LayoutBlockFlow {OPTION} at (6,6) size 31.13x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt index 57963a0c..29b3edf1 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x75 LayoutBlockFlow {BODY} at (8,8) size 784x59 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 352x59 clip at (9,9) size 339x57 LayoutListBox {SELECT} at (0,0.25) size 352x58.75 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 339x14.19 [color=#FFFFFF] [bgcolor=#0069D9]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/text/textfield-overflow-by-value-update-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/text/textfield-overflow-by-value-update-expected.txt index c4596b9..5833f3a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/text/textfield-overflow-by-value-update-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/text/textfield-overflow-by-value-update-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x18 LayoutTextControl {INPUT} at (0,1) size 102x2 [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (9,-9) size 100x38 backgroundClip at (9,0) size 100x29 clip at (9,0) size 100x29 LayoutBlockFlow {DIV} at (1,-18) size 100x38 LayoutText {#text} at (0,0) size 60x38
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt index 57963a0c..29b3edf1 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x75 LayoutBlockFlow {BODY} at (8,8) size 784x59 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 352x59 clip at (9,9) size 339x57 LayoutListBox {SELECT} at (0,0.25) size 352x58.75 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 339x14.19 [color=#FFFFFF] [bgcolor=#0069D9]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/html/tabular_data/col_width_resizing_table-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/html/tabular_data/col_width_resizing_table-expected.txt index 3b2e158..9f76815aa 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/html/tabular_data/col_width_resizing_table-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/html/tabular_data/col_width_resizing_table-expected.txt
@@ -35,4 +35,3 @@ LayoutText {#text} at (0,0) size 340x13 text run at (0,0) width 340: "Click me to test manually. The first column should grow to 500px." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/svg/hixie/mixed/003-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/svg/hixie/mixed/003-expected.txt index 61b5260b..1e32f73 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/svg/hixie/mixed/003-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/svg/hixie/mixed/003-expected.txt
@@ -12,7 +12,6 @@ LayoutSVGRoot {svg} at (0,0) size 200x200 LayoutSVGEllipse {circle} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [cx=50.00] [cy=50.00] [r=50.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,19) size 305x13 LayoutBlockFlow {div} at (3,3) size 305x13 LayoutText {#text} at (0,0) size 115x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac/animations/rotate-transform-equivalent-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/animations/rotate-transform-equivalent-expected.txt index 2e1c9e15..a54c456 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/animations/rotate-transform-equivalent-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/animations/rotate-transform-equivalent-expected.txt
@@ -5,10 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 199x18 text run at (0,0) width 199: "There should be no red visible." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,26) size 106x106 LayoutBlockFlow (positioned) {DIV} at (8,26) size 106x106 [color=#FF0000] [border: (3px solid #FF0000)] LayoutText {#text} at (3,3) size 56x115
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/geometry/clipping-foreground-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/geometry/clipping-foreground-expected.txt index 7ce5c3ef..6b2679d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/compositing/geometry/clipping-foreground-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/geometry/clipping-foreground-expected.txt
@@ -15,7 +15,6 @@ LayoutBlockFlow (positioned) zI: -1 {DIV} at (-40,-40) size 150x150 [color=#808080] [bgcolor=#C86464] [border: (2px solid #000000)] LayoutText zI: -1 {#text} at (22,22) size 108x40 text run at (22,22) width 108: "Behind" - LayoutText zI: -1 {#text} at (0,0) size 0x0 layer at (50,303) size 100x100 LayoutBlockFlow (positioned) {DIV} at (22,82) size 100x100 [bgcolor=#008000] [border: (2px solid #000000)] LayoutText {#text} at (22,22) size 54x40 @@ -26,8 +25,6 @@ LayoutText {#text} at (30,30) size 126x80 text run at (30,30) width 59: "Box" text run at (30,70) width 126: "contents" - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (158,351) size 150x150 LayoutBlockFlow (positioned) zI: 1 {DIV} at (90,90) size 150x150 [color=#808080] [bgcolor=#C8C880] [border: (2px solid #000000)] LayoutText zI: 1 {#text} at (22,22) size 86x80 @@ -38,7 +35,6 @@ LayoutBlockFlow (positioned) zI: -1 {DIV} at (-40,-40) size 150x150 [color=#808080] [bgcolor=#C86464] [border: (2px solid #000000)] LayoutText zI: -1 {#text} at (22,22) size 108x40 text run at (22,22) width 108: "Behind" - LayoutText zI: -1 {#text} at (0,0) size 0x0 layer at (374,144) size 100x100 backgroundClip at (402,112) size 180x180 clip at (402,112) size 180x180 LayoutBlockFlow (positioned) {DIV} at (22,82) size 100x100 [bgcolor=#008000] [border: (2px solid #000000)] LayoutText {#text} at (22,22) size 54x40 @@ -49,8 +45,6 @@ LayoutText {#text} at (30,30) size 126x80 text run at (30,30) width 59: "Box" text run at (30,70) width 126: "contents" - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (482,192) size 150x150 backgroundClip at (402,112) size 180x180 clip at (402,112) size 180x180 LayoutBlockFlow (positioned) zI: 1 {DIV} at (90,90) size 150x150 [color=#808080] [bgcolor=#C8C880] [border: (2px solid #000000)] LayoutText zI: 1 {#text} at (22,22) size 86x80
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/iframes/composited-iframe-alignment-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/iframes/composited-iframe-alignment-expected.txt index 7326b6f..95dd0d19 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/compositing/iframes/composited-iframe-alignment-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/iframes/composited-iframe-alignment-expected.txt
@@ -10,7 +10,6 @@ text run at (390,18) width 91: "with no gaps. " LayoutBR {BR} at (0,0) size 0x0 LayoutBR {BR} at (0,36) size 0x18 - LayoutText {#text} at (0,0) size 0x0 layer at (100,100) size 440x340 LayoutIFrame (positioned) {IFRAME} at (100,100) size 440x340 [border: (20px solid #000000)] layer at (0,0) size 400x300
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/clip-parent-reset-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/clip-parent-reset-expected.txt index bb9be8e..d55ca74 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/clip-parent-reset-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/clip-parent-reset-expected.txt
@@ -6,8 +6,6 @@ LayoutBlockFlow (anonymous) at (0,150) size 784x18 LayoutText {#text} at (0,0) size 639x18 text run at (0,0) width 639: "This test verifies the clip parent of a layer gets correctly reset when it gained a non-composited clip." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 150x150 transparent LayoutBlockFlow {DIV} at (0,0) size 150x150 [bgcolor=#FF0000] layer at (8,8) size 100x100 scrollWidth 200 scrollHeight 200
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt deleted file mode 100644 index dded8e3..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -PASS repainted when expected -FAIL did not repaint when expected -PASS repainted when expected -PASS did not repaint as expected -FAIL did not repaint when expected -
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/video-frame-size-change-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/video-frame-size-change-expected.txt index 3b6f714..db2f0421 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/compositing/video-frame-size-change-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/video-frame-size-change-expected.txt
@@ -10,7 +10,6 @@ LayoutText {#text} at (320,166) size 4x18 text run at (320,166) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,50) size 320x180 LayoutVideo {VIDEO} at (0,0) size 320x180 layer at (332,50) size 320x180
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt index 01dba85..e636f6a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt
@@ -6,7 +6,6 @@ LayoutText {#text} at (240,226) size 4x18 text run at (240,226) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (28,28) size 200x200 LayoutHTMLCanvas {CANVAS} at (20,20) size 200x200 [bgcolor=#00008000] layer at (272,28) size 200x200
diff --git a/third_party/WebKit/LayoutTests/platform/mac/css1/classification/display-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/css1/classification/display-expected.txt index b483dc3..8a2b75f 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/css1/classification/display-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/css1/classification/display-expected.txt
@@ -56,7 +56,6 @@ LayoutBlockFlow {P} at (0,348) size 769x18 LayoutText {#text} at (0,0) size 252x18 text run at (0,0) width 252: "There should be no text after the colon:" - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,382) size 769x54 LayoutBlockFlow (anonymous) at (0,0) size 769x18 LayoutText {#text} at (0,0) size 116x18 @@ -117,7 +116,6 @@ LayoutBlockFlow {P} at (4,212) size 747x18 LayoutText {#text} at (0,0) size 252x18 text run at (0,0) width 252: "There should be no text after the colon:" - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (4,246) size 747x54 LayoutBlockFlow (anonymous) at (0,0) size 747x18 LayoutText {#text} at (0,0) size 116x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/css2.1/t090501-c414-flt-ln-03-d-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/css2.1/t090501-c414-flt-ln-03-d-expected.txt index a56cc70..71553d9 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/css2.1/t090501-c414-flt-ln-03-d-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/css2.1/t090501-c414-flt-ln-03-d-expected.txt
@@ -23,7 +23,6 @@ LayoutBlockFlow (floating) {P} at (21,21) size 150x58 [color=#FFFFFF] [bgcolor=#008080] [border: (3px solid #00FFFF)] LayoutText {#text} at (19,20) size 47x18 text run at (19,20) width 47: "AAAA" - LayoutText {#text} at (0,0) size 0x0 LayoutInline {SPAN} at (0,0) size 17x24 [color=#FFFFFF] [bgcolor=#800080] [border: (3px solid #FF00FF)] LayoutText {#text} at (519,22) size 11x18 text run at (519,22) width 11: "B"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/css2.1/t1204-root-e-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/css2.1/t1204-root-e-expected.txt index 3df8822..d5023b12 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/css2.1/t1204-root-e-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/css2.1/t1204-root-e-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow (anonymous) at (0,0) size 800x0 LayoutInline {<pseudo:before>} at (0,0) size 0x0 LayoutTextFragment (anonymous) at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {BODY} at (8,16) size 784x70 LayoutBlockFlow {P} at (0,0) size 784x18 LayoutText {#text} at (0,0) size 221x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/css2.1/t1205-c561-list-displ-00-b-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/css2.1/t1205-c561-list-displ-00-b-expected.txt index a262761c..ff19eff 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/css2.1/t1205-c561-list-displ-00-b-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/css2.1/t1205-c561-list-displ-00-b-expected.txt
@@ -28,7 +28,6 @@ LayoutBlockFlow {DIV} at (0,106) size 784x18 [color=#000080] LayoutText {#text} at (0,0) size 171x18 text run at (0,0) width 171: "5. This should be line five." - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,124) size 784x54 [color=#000080] LayoutBlockFlow (anonymous) at (0,0) size 784x18 LayoutText {#text} at (0,0) size 165x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/css3/filters/regions-expanding-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/css3/filters/regions-expanding-expected.txt index 005607e..76b74f9 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/css3/filters/regions-expanding-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/css3/filters/regions-expanding-expected.txt
@@ -5,11 +5,9 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (160,76) size 4x18 text run at (160,76) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (324,76) size 4x18 text run at (324,76) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 160x90 LayoutImage {IMG} at (0,0) size 160x90 layer at (172,8) size 160x90
diff --git a/third_party/WebKit/LayoutTests/platform/mac/css3/selectors3/xhtml/css3-modsel-d3-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/css3/selectors3/xhtml/css3-modsel-d3-expected.txt index a13d7cad..d40e000 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/css3/selectors3/xhtml/css3-modsel-d3-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/css3/selectors3/xhtml/css3-modsel-d3-expected.txt
@@ -10,11 +10,8 @@ LayoutBlockFlow (anonymous) at (0,34) size 784x0 LayoutInline {stub} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutInline {t} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutInline {t} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {t} at (0,34) size 784x32 [bgcolor=#00FF00]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/css3/selectors3/xml/css3-modsel-d3-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/css3/selectors3/xml/css3-modsel-d3-expected.txt index cdca94f1..20fd76f4 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/css3/selectors3/xml/css3-modsel-d3-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/css3/selectors3/xml/css3-modsel-d3-expected.txt
@@ -9,11 +9,8 @@ LayoutBlockFlow (anonymous) at (0,34) size 800x0 LayoutInline {stub} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutInline {t} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutInline {t} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {t} at (0,34) size 800x32 [bgcolor=#00FF00]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-001-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-001-expected.txt index c337412d..70a1a96 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-001-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-001-expected.txt
@@ -11,7 +11,6 @@ text run at (0,0) width 441: "The shape of the caret, and whether it flashes, are not part of the test." LayoutBlockFlow (anonymous) at (0,68) size 784x138 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,84) size 502x134 clip at (9,85) size 500x132 LayoutTextControl {TEXTAREA} at (0,0) size 502x134 [color=#FFFFFF] [bgcolor=#000000] [border: (1px solid #FFFFFF)] LayoutBlockFlow {DIV} at (11,11) size 480x56
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-003-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-003-expected.txt index 742cf5f5..627b69d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-003-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-003-expected.txt
@@ -12,7 +12,6 @@ text run at (0,0) width 441: "The shape of the caret, and whether it flashes, are not part of the test." LayoutBlockFlow (anonymous) at (0,68) size 784x138 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,84) size 502x134 clip at (9,85) size 500x132 LayoutTextControl {TEXTAREA} at (0,0) size 502x134 [color=#00FF00] [bgcolor=#000000] [border: (1px solid #00FF00)] LayoutBlockFlow {DIV} at (11,11) size 480x56
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-004-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-004-expected.txt index 869a8347..e044a506 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-004-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-004-expected.txt
@@ -13,7 +13,6 @@ text run at (0,0) width 441: "The shape of the caret, and whether it flashes, are not part of the test." LayoutBlockFlow (anonymous) at (0,86) size 784x138 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,102) size 502x134 clip at (9,103) size 500x132 LayoutTextControl {TEXTAREA} at (0,0) size 502x134 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (11,11) size 480x56
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-005-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-005-expected.txt index f0a56db..7532d70c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-005-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-005-expected.txt
@@ -13,7 +13,6 @@ text run at (0,0) width 441: "The shape of the caret, and whether it flashes, are not part of the test." LayoutBlockFlow (anonymous) at (0,86) size 784x138 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,102) size 502x134 clip at (9,103) size 500x132 LayoutTextControl {TEXTAREA} at (0,0) size 502x134 [color=#FFFFFF] [bgcolor=#000000] [border: (1px solid #FFFFFF)] LayoutBlockFlow {DIV} at (11,11) size 480x56
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-010-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-010-expected.txt index 89e2ef2..6c7b1af 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-010-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-010-expected.txt
@@ -12,7 +12,6 @@ LayoutBlockFlow (anonymous) at (0,68) size 784x80 LayoutTextControl {INPUT} at (0,0) size 504x80 [color=#FFFFFF] [bgcolor=#000000] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (20,96) size 480x56 LayoutBlockFlow {DIV} at (12,12) size 480x56 caret: position 0 of child 0 {DIV} of {#document-fragment} of child 5 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-014-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-014-expected.txt index 1f50612..27989f8 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-014-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-014-expected.txt
@@ -14,5 +14,4 @@ LayoutText {#text} at (10,0) size 81x55 text run at (10,0) width 81: "link" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 caret: position 0 of child 0 {#text} of child 5 {A} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-015-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-015-expected.txt index 41e86c99..ae7afb39 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-015-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-color-015-expected.txt
@@ -18,5 +18,4 @@ LayoutText {#text} at (10,0) size 81x55 text run at (10,0) width 81: "link" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 caret: position 0 of child 0 {#text} of child 8 {A} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-position-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-position-expected.txt index efd0a6e6..357958db 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-position-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/caret/caret-position-expected.txt
@@ -7,7 +7,6 @@ text run at (0,0) width 323: "This tests if the caret position is aligned correctly. " LayoutTextControl {INPUT} at (322.42,0) size 205x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (333,11) size 200x13 LayoutBlockFlow {DIV} at (3,3) size 200x13 caret: position 0 of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/input/caret-at-the-edge-of-input-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/input/caret-at-the-edge-of-input-expected.txt index 75cbe3d..865d453 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/input/caret-at-the-edge-of-input-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/input/caret-at-the-edge-of-input-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow (anonymous) at (0,18) size 784x19 LayoutTextControl {INPUT} at (0,0) size 71x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,29) size 65x13 scrollX 35.00 scrollWidth 280 LayoutBlockFlow {DIV} at (3,3) size 65x13 LayoutText {#text} at (0,0) size 280x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/input/reveal-caret-of-multiline-input-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/input/reveal-caret-of-multiline-input-expected.txt index 213721f..28a68fd0 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/input/reveal-caret-of-multiline-input-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/input/reveal-caret-of-multiline-input-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 610: "When the caret is scrolled out, on starting typing it must be brought to the center of the control." LayoutBlockFlow (anonymous) at (0,18) size 784x140 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,26) size 81x136 clip at (9,27) size 64x134 scrollY 98.00 scrollHeight 420 LayoutTextControl {TEXTAREA} at (0,0) size 81x136 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (3,3) size 60x416
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/inserting/4960120-1-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/inserting/4960120-1-expected.txt index 0ab9438..4469771 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/inserting/4960120-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/inserting/4960120-1-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 517: "This tests for a bug where the first newline entered into a text area would be lost." LayoutBlockFlow (anonymous) at (0,34) size 784x32 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,42) size 141x32 clip at (9,43) size 139x30 LayoutTextControl {TEXTAREA} at (0,0) size 141x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (3,3) size 135x26
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/pasteboard/drop-text-without-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/pasteboard/drop-text-without-selection-expected.txt index 953000e8..e3a15d7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/pasteboard/drop-text-without-selection-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/pasteboard/drop-text-without-selection-expected.txt
@@ -31,7 +31,6 @@ LayoutText {#text} at (135,0) size 166x18 text run at (135,0) width 166: "drop me into the text field" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,94) size 784x2 clip at (0,0) size 0x0 LayoutBlockFlow {HR} at (0,86) size 784x2 [border: (1px inset #EEEEEE)] layer at (11,107) size 125x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/3690719-expected.png b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/3690719-expected.png deleted file mode 100644 index d4d431b..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/3690719-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/3690719-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/3690719-expected.txt deleted file mode 100644 index 945b2066..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/3690719-expected.txt +++ /dev/null
@@ -1,143 +0,0 @@ -EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification -EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x600 - LayoutBlockFlow {HTML} at (0,0) size 800x600 - LayoutBlockFlow {BODY} at (8,3) size 784x581 [bgcolor=#FFFFFF] - LayoutBlockFlow {CENTER} at (0,0) size 784x252 - LayoutTable {TABLE} at (0,0) size 784x19 - LayoutTableSection {TBODY} at (0,0) size 784x19 - LayoutTableRow {TR} at (0,0) size 784x15 - LayoutTableCell {TD} at (0,0) size 784x15 [r=0 c=0 rs=1 cs=1] - LayoutInline {FONT} at (0,0) size 102x15 - LayoutInline {A} at (0,0) size 102x15 [color=#0000CC] - LayoutText {#text} at (682,0) size 102x15 - text run at (682,0) width 102: "Personalized Home" - LayoutTableRow {TR} at (0,15) size 784x4 - LayoutTableCell {TD} at (0,16) size 784x1 [r=1 c=0 rs=1 cs=1] - LayoutImage {IMG} at (0,0) size 1x1 - LayoutBlockFlow (anonymous) at (0,19) size 784x36 - LayoutBR {BR} at (392,0) size 0x18 - LayoutBR {BR} at (392,18) size 0x18 - LayoutBlockFlow {DIV} at (0,55) size 784x99 [border: (2px solid #AAAAFF)] - LayoutTable {TABLE} at (214.50,2) size 355x23 - LayoutTableSection {TBODY} at (0,0) size 355x23 - LayoutTableRow {TR} at (0,0) size 355x23 - LayoutTableCell {TD} at (0,0) size 355x23 [r=0 c=0 rs=1 cs=1] - LayoutInline {FONT} at (0,0) size 346x15 - LayoutInline {B} at (0,0) size 26x15 - LayoutText {#text} at (4,4) size 26x15 - text run at (4,4) width 26: "Web" - LayoutText {#text} at (29,4) size 14x15 - text run at (29,4) width 14: " " - LayoutInline {A} at (0,0) size 38x15 [color=#0000CC] - LayoutText {#text} at (42,4) size 38x15 - text run at (42,4) width 38: "Images" - LayoutText {#text} at (79,4) size 14x15 - text run at (79,4) width 14: " " - LayoutInline {A} at (0,0) size 40x15 [color=#0000CC] - LayoutText {#text} at (92,4) size 40x15 - text run at (92,4) width 40: "Groups" - LayoutText {#text} at (131,4) size 14x15 - text run at (131,4) width 14: " " - LayoutInline {A} at (0,0) size 30x15 [color=#0000CC] - LayoutText {#text} at (144,4) size 30x15 - text run at (144,4) width 30: "News" - LayoutText {#text} at (173,4) size 14x15 - text run at (173,4) width 14: " " - LayoutInline {A} at (0,0) size 42x15 [color=#0000CC] - LayoutText {#text} at (186,4) size 42x15 - text run at (186,4) width 42: "Froogle" - LayoutText {#text} at (227,4) size 14x15 - text run at (227,4) width 14: " " - LayoutInline {A} at (0,0) size 30x15 [color=#0000CC] - LayoutText {#text} at (240,4) size 30x15 - text run at (240,4) width 30: "Local" - LayoutInline {SUP} at (0,0) size 1x13 - LayoutInline {A} at (0,0) size 30x15 - LayoutInline {FONT} at (0,0) size 30x15 [color=#FF0000] - LayoutText {#text} at (269,4) size 30x15 - text run at (269,4) width 30: "New!" - LayoutText {#text} at (298,4) size 14x15 - text run at (298,4) width 14: " " - LayoutInline {B} at (0,0) size 39x15 - LayoutInline {A} at (0,0) size 39x15 [color=#0000CC] - LayoutText {#text} at (311,4) size 39x15 - text run at (311,4) width 39: "more \x{BB}" - LayoutTable {TABLE} at (51,25) size 682x39 - LayoutTableSection {TBODY} at (0,0) size 682x39 - LayoutTableRow {TR} at (0,0) size 682x39 - LayoutTableCell {TD} at (0,10) size 170x18 [r=0 c=0 rs=1 cs=1] - LayoutText {#text} at (0,0) size 4x18 - text run at (0,0) width 4: " " - LayoutTableCell {TD} at (170,1) size 342x37 [r=0 c=1 rs=1 cs=1] - LayoutTextControl {INPUT} at (0.50,0) size 341x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] - LayoutBR {BR} at (341,14) size 1x0 - LayoutButton {INPUT} at (72.05,19) size 92.16x18 [bgcolor=#C0C0C0] - LayoutBlockFlow (anonymous) at (8,2) size 76.16x13 - LayoutText {#text} at (0,0) size 77x13 - text run at (0,0) width 77: "Google Search" - LayoutButton {INPUT} at (164.20,19) size 105.75x18 [bgcolor=#C0C0C0] - LayoutBlockFlow (anonymous) at (8,2) size 89.75x13 - LayoutText {#text} at (0,0) size 90x13 - text run at (0,0) width 90: "I'm Feeling Lucky" - LayoutTableCell {TD} at (512,0) size 170x39 [r=0 c=2 rs=1 cs=1] - LayoutInline {FONT} at (0,0) size 76x39 - LayoutText {#text} at (0,0) size 5x13 - text run at (0,0) width 5: " " - LayoutInline {A} at (0,0) size 71x13 [color=#0000CC] - LayoutText {#text} at (5,0) size 71x13 - text run at (5,0) width 71: "Advanced Search" - LayoutBR {BR} at (75,10) size 1x0 - LayoutText {#text} at (0,13) size 5x13 - text run at (0,13) width 5: " " - LayoutInline {A} at (0,0) size 47x13 [color=#0000CC] - LayoutText {#text} at (5,13) size 47x13 - text run at (5,13) width 47: "Preferences" - LayoutBR {BR} at (51,23) size 1x0 - LayoutText {#text} at (0,26) size 5x13 - text run at (0,26) width 5: " " - LayoutInline {A} at (0,0) size 64x13 [color=#0000CC] - LayoutText {#text} at (5,26) size 64x13 - text run at (5,26) width 64: "Language Tools" - LayoutBlockFlow (anonymous) at (2,64) size 780x33 - LayoutBR {BR} at (390,0) size 0x18 - LayoutInline {FONT} at (0,0) size 146x15 - LayoutInline {FONT} at (0,0) size 30x15 [color=#FF0000] - LayoutText {#text} at (317,18) size 30x15 - text run at (317,18) width 30: "New!" - LayoutText {#text} at (346,18) size 4x15 - text run at (346,18) width 4: " " - LayoutInline {A} at (0,0) size 111x15 [color=#0000CC] - LayoutText {#text} at (349,18) size 111x15 - text run at (349,18) width 111: "Personalize this page" - LayoutText {#text} at (459,18) size 4x15 - text run at (459,18) width 4: "." - LayoutText {#text} at (0,0) size 0x0 - LayoutBlockFlow (anonymous) at (0,154) size 784x69 - LayoutBR {BR} at (392,0) size 0x18 - LayoutBR {BR} at (392,18) size 0x18 - LayoutBR {BR} at (392,36) size 0x18 - LayoutInline {FONT} at (0,0) size 310x15 - LayoutInline {A} at (0,0) size 116x15 [color=#0000CC] - LayoutText {#text} at (237,54) size 116x15 - text run at (237,54) width 116: "Advertising Programs" - LayoutText {#text} at (352,54) size 11x15 - text run at (352,54) width 11: " - " - LayoutInline {A} at (0,0) size 100x15 [color=#0000CC] - LayoutText {#text} at (362,54) size 100x15 - text run at (362,54) width 100: "Business Solutions" - LayoutText {#text} at (461,54) size 12x15 - text run at (461,54) width 12: " - " - LayoutInline {A} at (0,0) size 75x15 [color=#0000CC] - LayoutText {#text} at (472,54) size 75x15 - text run at (472,54) width 75: "About Google" - LayoutBlockFlow {P} at (0,239) size 784x13 - LayoutInline {FONT} at (0,0) size 60x13 - LayoutText {#text} at (362,0) size 60x13 - text run at (362,0) width 60: "\x{A9}2005 Google" -layer at (233,87) size 335x13 - LayoutBlockFlow {DIV} at (3,3) size 335x13 -selection start: position 0 of child 1 {TABLE} of child 4 {DIV} of child 0 {CENTER} of body -selection end: position 1 of child 3 {#text} of child 4 {FONT} of child 4 {DIV} of child 0 {CENTER} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/4960137-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/4960137-expected.txt index 9906b1d..e839e9e 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/4960137-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/4960137-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 671: "This tests for an ASSERTion failure when setting the main frame's selection inside a node in a subframe." LayoutBlockFlow (anonymous) at (0,34) size 784x154 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,42) size 304x154 LayoutIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #EEEEEE)] layer at (0,0) size 300x150
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/5354455-2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/5354455-2-expected.txt index c326fb5..9824080 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/5354455-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/5354455-2-expected.txt
@@ -19,5 +19,4 @@ text run at (562,18) width 37: "Right" text run at (0,36) width 589: "click on the empty space outside and to the right of the black border, the selection should be" text run at (0,54) width 60: "removed." - LayoutText {#text} at (0,0) size 0x0 caret: position 0 of child 0 {#text} of child 1 {H1} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/drag-in-iframe-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/drag-in-iframe-expected.txt index def720a..93039e23 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/drag-in-iframe-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/drag-in-iframe-expected.txt
@@ -11,7 +11,6 @@ text run at (0,18) width 160: "appears inside the frame." LayoutBlockFlow (anonymous) at (0,52) size 784x152 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,60) size 302x152 LayoutIFrame {IFRAME} at (0,0) size 302x152 [border: (1px solid #000000)] layer at (0,0) size 300x150
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/expanding-selections2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/expanding-selections2-expected.txt index a41ce5a..77220d8 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/expanding-selections2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/expanding-selections2-expected.txt
@@ -18,5 +18,4 @@ LayoutBlockFlow (anonymous) at (0,70) size 784x18 LayoutText {#text} at (0,0) size 249x18 text run at (0,0) width 249: "This text is outside the editable region." - LayoutText {#text} at (0,0) size 0x0 caret: position 1 of child 0 {#text} of child 1 {SPAN} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/focus-body-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/focus-body-expected.txt index 704223f5..6901089 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/focus-body-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/focus-body-expected.txt
@@ -7,5 +7,4 @@ LayoutText {#text} at (0,0) size 447x18 text run at (0,0) width 224: "This test focuses an editable body. " text run at (223,0) width 224: "Its contents should not be selected." - LayoutText {#text} at (0,0) size 0x0 caret: position 0 of child 0 {#text} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/mixed-editability-1-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/mixed-editability-1-expected.txt index 6b982a7..1109d25 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/mixed-editability-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/mixed-editability-1-expected.txt
@@ -13,6 +13,5 @@ text run at (494,0) width 245: "To run this test manually, double click" text run at (738,0) width 5: " " text run at (0,18) width 417: "between the first two letters of the first word of the first sentence." - LayoutText {#text} at (0,0) size 0x0 selection start: position 0 of child 0 {#text} of child 0 {SPAN} of body selection end: position 2 of child 0 {#text} of child 0 {SPAN} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/node-removal-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/node-removal-2-expected.png deleted file mode 100644 index 26f0a11..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/node-removal-2-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/node-removal-2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/node-removal-2-expected.txt deleted file mode 100644 index 2295928..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/node-removal-2-expected.txt +++ /dev/null
@@ -1,26 +0,0 @@ -EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification -EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x600 - LayoutBlockFlow {HTML} at (0,0) size 800x600 - LayoutBlockFlow {BODY} at (8,8) size 784x584 - LayoutBlockFlow {P} at (0,0) size 784x36 - LayoutText {#text} at (0,0) size 763x36 - text run at (0,0) width 693: "This tests behavior when a node that serves as the start or end of a selection is removed from the document. " - text run at (692,0) width 71: "Ideally, we" - text run at (0,18) width 660: "would just adjust the selection when an endpoint is removed, for now, we just blow away the selection." - LayoutBlockFlow {P} at (0,52) size 784x36 - LayoutText {#text} at (0,0) size 772x36 - text run at (0,0) width 487: "This test creates a selection that ends inside of a node that will be removed. " - text run at (486,0) width 175: "Then the node is removed. " - text run at (660,0) width 112: "Then a Select All" - text run at (0,18) width 80: "is executed. " - text run at (79,18) width 259: "The entire document should be selected." - LayoutBlockFlow {DIV} at (0,104) size 784x18 - LayoutText {#text} at (0,0) size 36x18 - text run at (0,0) width 36: "hello " - LayoutText {#text} at (35,0) size 44x18 - text run at (35,0) width 44: "world!" -selection start: position 0 of child 0 {#text} of child 1 {P} of body -selection end: position 7 of child 1 {#text} of child 5 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/selection-actions-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/selection-actions-expected.txt index 4496763..a061eff6 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/editing/selection/selection-actions-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/editing/selection/selection-actions-expected.txt
@@ -32,6 +32,5 @@ LayoutBR {BR} at (64,122) size 1x0 LayoutText {#text} at (0,126) size 127x18 text run at (0,126) width 127: "This is a paragraph." - LayoutText {#text} at (0,0) size 0x0 selection start: position 11 of child 2 {#text} of body selection end: position 1 of child 7 {BR} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/external/wpt/url/url-setters-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/external/wpt/url/url-setters-expected.txt index 96b43a3..b282b6c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/external/wpt/url/url-setters-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/external/wpt/url/url-setters-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 571 tests; 272 PASS, 299 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 574 tests; 275 PASS, 299 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS URL: Setting <a://example.net>.protocol = '' The empty string is not a valid scheme. Setter leaves the URL unchanged. PASS <a>: Setting <a://example.net>.protocol = '' The empty string is not a valid scheme. Setter leaves the URL unchanged. @@ -85,6 +85,9 @@ PASS URL: Setting <data:text/html,<p>Test>.protocol = 'view-source+data:foo : bar' Stuff after the first ':' is ignored PASS <a>: Setting <data:text/html,<p>Test>.protocol = 'view-source+data:foo : bar' Stuff after the first ':' is ignored PASS <area>: Setting <data:text/html,<p>Test>.protocol = 'view-source+data:foo : bar' Stuff after the first ':' is ignored +PASS URL: Setting <http://foo.com:443/>.protocol = 'https' Port is set to null if it is the default for new scheme. +PASS <a>: Setting <http://foo.com:443/>.protocol = 'https' Port is set to null if it is the default for new scheme. +PASS <area>: Setting <http://foo.com:443/>.protocol = 'https' Port is set to null if it is the default for new scheme. PASS URL: Setting <file:///home/you/index.html>.username = 'me' No host means no username PASS <a>: Setting <file:///home/you/index.html>.username = 'me' No host means no username PASS <area>: Setting <file:///home/you/index.html>.username = 'me' No host means no username
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/canvas-ellipse-connecting-line-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/canvas-ellipse-connecting-line-expected.txt new file mode 100644 index 0000000..0dec203 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/canvas-ellipse-connecting-line-expected.txt
@@ -0,0 +1,8 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x320 + LayoutBlockFlow {HTML} at (0,0) size 800x320 + LayoutBlockFlow {BODY} at (8,8) size 784x304 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,8) size 300x300 + LayoutHTMLCanvas {CANVAS} at (0,0) size 300x300
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/canvas-shadow-source-in-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/canvas-shadow-source-in-expected.txt index 74c840a..7b9924a3 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/canvas-shadow-source-in-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/canvas-shadow-source-in-expected.txt
@@ -13,8 +13,6 @@ text run at (0,0) width 71: "Test Image" LayoutBlockFlow (anonymous) at (0,242) size 784x206 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,26) size 202x202 LayoutHTMLCanvas {CANVAS} at (0,0) size 202x202 [border: (1px solid #999999)] layer at (8,250) size 202x202
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css-generated-content/table-before-after-child-add-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/css-generated-content/table-before-after-child-add-expected.txt index bf06fc64a..f038349 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/css-generated-content/table-before-after-child-add-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css-generated-content/table-before-after-child-add-expected.txt
@@ -24,4 +24,3 @@ LayoutBlockFlow (anonymous) at (0,88) size 784x18 LayoutText {#text} at (0,0) size 75x18 text run at (0,0) width 75: "CONTENT" - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css-generated-content/table-cell-before-after-child-add-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/css-generated-content/table-cell-before-after-child-add-expected.txt index fa3b2133..9599f11a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/css-generated-content/table-cell-before-after-child-add-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css-generated-content/table-cell-before-after-child-add-expected.txt
@@ -22,4 +22,3 @@ LayoutBlockFlow (anonymous) at (0,52) size 784x18 LayoutText {#text} at (0,0) size 75x18 text run at (0,0) width 75: "CONTENT" - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css-generated-content/table-row-before-after-child-add-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/css-generated-content/table-row-before-after-child-add-expected.txt index d0c12f8b..70fca0b 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/css-generated-content/table-row-before-after-child-add-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css-generated-content/table-row-before-after-child-add-expected.txt
@@ -24,4 +24,3 @@ LayoutBlockFlow (anonymous) at (0,88) size 784x18 LayoutText {#text} at (0,0) size 75x18 text run at (0,0) width 75: "CONTENT" - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css-generated-content/table-table-before-after-child-add-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/css-generated-content/table-table-before-after-child-add-expected.txt index 3a6831a6..a143ef0 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/css-generated-content/table-table-before-after-child-add-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css-generated-content/table-table-before-after-child-add-expected.txt
@@ -28,4 +28,3 @@ LayoutBlockFlow (anonymous) at (0,88) size 784x18 LayoutText {#text} at (0,0) size 75x18 text run at (0,0) width 75: "CONTENT" - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css/ZeroOpacityLayers-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/css/ZeroOpacityLayers-expected.txt index b75f749..a63127a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/css/ZeroOpacityLayers-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css/ZeroOpacityLayers-expected.txt
@@ -11,7 +11,6 @@ LayoutBlockFlow (positioned) {DIV} at (10,10) size 160x160 [bgcolor=#FF0000] LayoutText {#text} at (0,0) size 154x18 text run at (0,0) width 154: "Should not see this text." - LayoutText {#text} at (0,0) size 0x0 layer at (40,40) size 140x140 LayoutBlockFlow (positioned) {DIV} at (10,10) size 140x140 [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 122x36
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css/ZeroOpacityLayers2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/css/ZeroOpacityLayers2-expected.txt index cea1683..a12c857 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/css/ZeroOpacityLayers2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css/ZeroOpacityLayers2-expected.txt
@@ -11,7 +11,6 @@ LayoutBlockFlow (positioned) {DIV} at (10,10) size 160x160 [bgcolor=#FF0000] LayoutText {#text} at (0,0) size 154x18 text run at (0,0) width 154: "Should not see this text." - LayoutText {#text} at (0,0) size 0x0 layer at (40,40) size 140x140 transparent LayoutBlockFlow (positioned) {DIV} at (10,10) size 140x140 [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 122x36
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css/font-face-opentype-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/css/font-face-opentype-expected.txt index acec54b..0d31ab3 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/css/font-face-opentype-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css/font-face-opentype-expected.txt
@@ -28,7 +28,6 @@ LayoutText {#text} at (0,16) size 736x16 text run at (0,16) width 736: "PQRSTUVWXYZ[\\]^_`abcdefghijklmnoqrstuvwxyz{|}~" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,152) size 784x36 LayoutText {#text} at (0,0) size 759x36 text run at (0,0) width 759: "Check if glyphs not in Ahem.otf can be rendered using a fallback font. If the test passes, you should see a single-quote" @@ -38,5 +37,3 @@ LayoutText {#text} at (0,1) size 3x16 text run at (0,1) width 3: "'" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css/font-face-synthetic-bold-italic-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/css/font-face-synthetic-bold-italic-expected.txt index 2fb973e9..22abdd8d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/css/font-face-synthetic-bold-italic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css/font-face-synthetic-bold-italic-expected.txt
@@ -59,4 +59,3 @@ LayoutInline {STRONG} at (0,0) size 0x0 LayoutInline {I} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css/font-face-weight-matching-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/css/font-face-weight-matching-expected.txt index a55d73a9..32034cb 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/css/font-face-weight-matching-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css/font-face-weight-matching-expected.txt
@@ -55,7 +55,6 @@ text run at (100,1) width 16: "A" LayoutText {#text} at (116,0) size 4x18 text run at (116,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutInline {SPAN} at (0,0) size 16x16 LayoutText {#text} at (120,1) size 16x16 text run at (120,1) width 16: "A" @@ -66,7 +65,6 @@ text run at (140,1) width 16: "A" LayoutText {#text} at (156,0) size 4x18 text run at (156,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutInline {SPAN} at (0,0) size 16x16 LayoutText {#text} at (160,1) size 16x16 text run at (160,1) width 16: "A" @@ -77,7 +75,6 @@ text run at (180,1) width 16: "A" LayoutText {#text} at (196,0) size 4x18 text run at (196,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutInline {SPAN} at (0,0) size 16x16 LayoutText {#text} at (200,1) size 16x16 text run at (200,1) width 16: "A" @@ -88,7 +85,6 @@ text run at (220,1) width 16: "A" LayoutText {#text} at (236,0) size 4x18 text run at (236,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutInline {SPAN} at (0,0) size 16x16 LayoutText {#text} at (240,1) size 16x16 text run at (240,1) width 16: "A" @@ -98,4 +94,3 @@ LayoutText {#text} at (260,1) size 16x16 text run at (260,1) width 16: "A" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css/h1-in-section-elements-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/css/h1-in-section-elements-expected.txt index 145569a..524ff1e4 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/css/h1-in-section-elements-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css/h1-in-section-elements-expected.txt
@@ -6,7 +6,6 @@ LayoutBlockFlow {P} at (0,0) size 784x18 LayoutText {#text} at (0,0) size 447x18 text run at (0,0) width 447: "For each of pairs, the first one and the second one should be identical." - LayoutText {#text} at (0,0) size 0x0 LayoutTable (floating) {TABLE} at (0,34) size 150x362 LayoutTableSection {TBODY} at (0,0) size 150x362 LayoutTableRow {TR} at (0,2) size 150x76
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css/ignore-empty-focus-ring-rects-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/css/ignore-empty-focus-ring-rects-expected.txt index b09f776..0006270e5 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/css/ignore-empty-focus-ring-rects-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css/ignore-empty-focus-ring-rects-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x18 LayoutText {#text} at (0,0) size 762x18 text run at (0,0) width 762: "Should ignore empty rects when drawing focus ring. Passes if there is only a single focus ring around the green square." - LayoutText {#text} at (0,0) size 0x0 layer at (8,26) size 100x150 LayoutBlockFlow (positioned) {DIV} at (8,26) size 100x150 LayoutBlockFlow (anonymous) at (0,0) size 100x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css/invalidation-errors-2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/css/invalidation-errors-2-expected.txt index 27b63e2..d2ea8e7f 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/css/invalidation-errors-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css/invalidation-errors-2-expected.txt
@@ -12,7 +12,6 @@ LayoutBlockFlow (anonymous) at (0,34) size 784x0 LayoutInline {DIV} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 layer at (8,42) size 200x200 LayoutBlockFlow (floating) {DIV} at (0,0) size 200x200 [color=#FFFFFF] [bgcolor=#006400]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css/invalidation-errors-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/css/invalidation-errors-expected.txt index 27b63e2..d2ea8e7f 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/css/invalidation-errors-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css/invalidation-errors-expected.txt
@@ -12,7 +12,6 @@ LayoutBlockFlow (anonymous) at (0,34) size 784x0 LayoutInline {DIV} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 layer at (8,42) size 200x200 LayoutBlockFlow (floating) {DIV} at (0,0) size 200x200 [color=#FFFFFF] [bgcolor=#006400]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css/nested-floating-relative-position-percentages-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/css/nested-floating-relative-position-percentages-expected.txt index 7cad254..ec6cbe0 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/css/nested-floating-relative-position-percentages-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css/nested-floating-relative-position-percentages-expected.txt
@@ -9,9 +9,6 @@ layer at (400,26) size 630x420 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 LayoutBlockFlow (relative positioned) (floating) {DIV} at (0,18) size 630x420 LayoutBR {BR} at (630,0) size 0x18 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (90,31) size 200x200 LayoutBlockFlow (relative positioned) (floating) {DIV} at (5,5) size 200x200 [bgcolor=#000000] LayoutImage {IMG} at (0,0) size 200x200
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/dom/inner-text-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/dom/inner-text-expected.txt index 46b0583c..921018b 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/dom/inner-text-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/dom/inner-text-expected.txt
@@ -8,4 +8,3 @@ LayoutInline {SPAN} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 225x18 text run at (0,0) width 225: " This text should only appear once." - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/008-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/008-expected.txt index f8a7772..8320964 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/008-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/008-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x672 LayoutBlockFlow {BODY} at (8,8) size 784x656 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 261x656 backgroundClip at (8,8) size 261x592 clip at (9,9) size 259x591 LayoutTextControl {TEXTAREA} at (0,0) size 261x656 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (3,3) size 255x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/011-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/011-expected.txt index 10a8d2a..e56bd4d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/011-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/011-expected.txt
@@ -28,4 +28,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (16,14) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt index 78ca752..94c9638 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt
@@ -7,5 +7,4 @@ LayoutBlockFlow {DIV} at (0,0) size 784x100 LayoutBR {BR} at (100,0) size 0x18 LayoutImage (floating) {IMG} at (0,100) size 100x100 - LayoutText {#text} at (0,0) size 0x0 LayoutImage (floating) {IMG} at (100,100) size 100x100 [bgcolor=#0000FF]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt index dd27513..9da6e70e 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt
@@ -23,7 +23,6 @@ LayoutBR {BR} at (262,14) size 1x0 LayoutBR {BR} at (0,18) size 0x18 LayoutBlockFlow (floating) {DIV} at (0,36) size 100x100 [bgcolor=#008000] - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,36) size 150x36 LayoutText {#text} at (100,0) size 47x36 text run at (100,0) width 47: "a green"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/link-href-change-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/link-href-change-expected.txt index 519b3bfe..a45b7878 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/link-href-change-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/link-href-change-expected.txt
@@ -7,4 +7,3 @@ LayoutText {#text} at (15,0) size 342x18 text run at (15,0) width 342: "This should have a 10px solid black border around it." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/outerHTML-img-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/outerHTML-img-expected.txt index 1b4ee8f..e39ab895 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/outerHTML-img-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/outerHTML-img-expected.txt
@@ -17,4 +17,3 @@ LayoutBlockFlow (anonymous) at (0,68) size 784x64 LayoutImage {IMG} at (0,0) size 52x64 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.txt index 4e5ce6c..61cd97283 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.txt
@@ -5,4 +5,3 @@ LayoutBlockFlow {BODY} at (8,8) size 752x560 LayoutText {#text} at (0,0) size 495x18 text run at (0,0) width 495: "This window should not have scroll bars. If it has scroll bars, try to use them." - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/window-scrollbars-test-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/window-scrollbars-test-expected.txt index 83f31315..0dab52f 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/window-scrollbars-test-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/dynamic/window-scrollbars-test-expected.txt
@@ -5,4 +5,3 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 264x18 text run at (0,0) width 264: "This window should not have scroll bars." - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/events/context-no-deselect-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/events/context-no-deselect-expected.txt index e15e625..0dc9cef 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/events/context-no-deselect-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/events/context-no-deselect-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutTextControl {INPUT} at (0,0) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,11) size 125x13 LayoutBlockFlow {DIV} at (3,3) size 125x13 LayoutText {#text} at (0,0) size 92x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/button/button-align-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/button/button-align-expected.txt index 4f5fa991..cd1aab1 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/button/button-align-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/button/button-align-expected.txt
@@ -33,7 +33,6 @@ LayoutText {#text} at (56,0) size 172x13 text run at (56,0) width 172: "This is should be center justified." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,109) size 784x18 LayoutButton {BUTTON} at (0,0) size 300x18 [bgcolor=#C0C0C0] [border: none (2px outset #C0C0C0) none (2px outset #C0C0C0)] LayoutBlockFlow (anonymous) at (8,2) size 284x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/cursor-at-editable-content-boundary-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/cursor-at-editable-content-boundary-expected.txt index 3a45de5e..b8c425b 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/cursor-at-editable-content-boundary-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/cursor-at-editable-content-boundary-expected.txt
@@ -1,9 +1,7 @@ autowrap text area with dir=rtl. nowrap text area with dir=rtl. - autowrap text area with dir=ltr. - vertical text. FAIL test id: textarea_rtl_no_wrap (text width: 107 != caretRange: 106), which means moving caret in the text, caret might be invisible or overlap with element.
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/form-added-to-table-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/form-added-to-table-expected.png deleted file mode 100644 index 9ff3a61..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/form-added-to-table-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/form-added-to-table-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/form-added-to-table-expected.txt deleted file mode 100644 index d350b09c..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/form-added-to-table-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x600 - LayoutBlockFlow {HTML} at (0,0) size 800x600 - LayoutBlockFlow {BODY} at (8,8) size 784x584 - LayoutTable {TABLE} at (0,0) size 232x24 - LayoutTableSection {TBODY} at (0,0) size 232x24 - LayoutTableRow {TR} at (0,2) size 232x20 - LayoutTableCell {TD} at (2,2) size 228x20 [r=0 c=0 rs=1 cs=1] - LayoutText {#text} at (1,1) size 226x18 - text run at (1,1) width 226: "This test passes if it does not crash." -selection start: position 0 of child 0 {#text} of child 0 {TD} of child 0 {TR} of child 0 {TBODY} of child 1 {TABLE} of body -selection end: position 1 of child 1 {TABLE} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/indeterminate-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/indeterminate-expected.txt index ed8ce59..fde2cbe5 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/indeterminate-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/indeterminate-expected.txt
@@ -5,6 +5,5 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (17,0) size 501x18 text run at (17,0) width 501: " This checkbox should look 50% transparent and should be in the mixed state." - LayoutText {#text} at (0,0) size 0x0 layer at (11,12) size 12x12 transparent LayoutBlockFlow {INPUT} at (2.89,4) size 12x12
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/number/number-appearance-datalist-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/number/number-appearance-datalist-expected.txt index c52d3f81..75c100e 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/number/number-appearance-datalist-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/number/number-appearance-datalist-expected.txt
@@ -27,7 +27,6 @@ LayoutFlexibleBox {DIV} at (3,2) size 125x15 LayoutBlockFlow {DIV} at (0,1) size 97.28x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,11) size 97x13 LayoutBlockFlow {DIV} at (0,0) size 97.28x13 layer at (146,11) size 97x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/number/number-appearance-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/number/number-appearance-rtl-expected.txt index 67f93c1..2d09cf7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/number/number-appearance-rtl-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/number/number-appearance-rtl-expected.txt
@@ -24,7 +24,6 @@ LayoutBlockFlow {DIV} at (13,1) size 112x13 LayoutBlockFlow {DIV} at (0,0) size 13x15 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,140) size 784x19 LayoutTextControl {INPUT} at (0,0) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutFlexibleBox {DIV} at (3,2) size 125x15 @@ -35,7 +34,6 @@ LayoutFlexibleBox {DIV} at (3,2) size 125x15 LayoutBlockFlow {DIV} at (0,1) size 112x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,210) size 784x19 LayoutTextControl {INPUT} at (0,0) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutFlexibleBox {DIV} at (3,2) size 125x15 @@ -46,7 +44,6 @@ LayoutFlexibleBox {DIV} at (3,2) size 125x15 LayoutBlockFlow {DIV} at (13,1) size 112x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (677,19) size 112x13 LayoutBlockFlow {DIV} at (0,0) size 112x13 LayoutText {#text} at (106,0) size 6x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.txt index 6add4f8..ff185a1 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.txt
@@ -17,7 +17,6 @@ LayoutTableCell {TD} at (2,2) size 19x21 [r=0 c=0 rs=1 cs=1] LayoutImage {INPUT} at (1,1) size 17x19 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow (anonymous) at (0,25) size 784x0 LayoutInline {FONT} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/search/search-appearance-basic-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/search/search-appearance-basic-expected.txt index ee75de1e..112d82b 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/search/search-appearance-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/search/search-appearance-basic-expected.txt
@@ -96,7 +96,6 @@ LayoutFlexibleBox {DIV} at (18,4) size 144x13 LayoutBlockFlow {DIV} at (0,0) size 132x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (16,15) size 113x13 LayoutBlockFlow {DIV} at (0,0) size 113x13 LayoutText {#text} at (0,0) size 17x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/search/search-cancel-button-style-sharing-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/search/search-cancel-button-style-sharing-expected.txt index 7a428fc1..3cc0aa63 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/search/search-cancel-button-style-sharing-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/search/search-cancel-button-style-sharing-expected.txt
@@ -17,7 +17,6 @@ LayoutBlockFlow {DIV} at (0,0) size 113x13 LayoutBlockFlow {DIV} at (114,1) size 11x11 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (12,45) size 113x13 LayoutBlockFlow {DIV} at (0,0) size 113x13 layer at (149,45) size 113x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/listbox-appearance-basic-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/listbox-appearance-basic-expected.txt index 9d6fa22d..7b4364e 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/listbox-appearance-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/listbox-appearance-basic-expected.txt
@@ -7,7 +7,6 @@ text run at (41,49) width 5: " " LayoutText {#text} at (116,49) size 5x18 text run at (116,49) width 5: " " - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (162,49) size 5x18 text run at (162,49) width 5: " " LayoutText {#text} at (222,49) size 5x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/listbox-with-display-none-option-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/listbox-with-display-none-option-expected.txt index a9504b8..7bc63379 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/listbox-with-display-none-option-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/listbox-with-display-none-option-expected.txt
@@ -18,7 +18,6 @@ LayoutText {#text} at (293,97) size 5x18 text run at (293,97) width 5: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,64) size 49x101 clip at (9,65) size 36x99 LayoutListBox {SELECT} at (0,13.69) size 48.97x101.31 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 35.97x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/menulist-deselect-update-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/menulist-deselect-update-expected.txt index 00e93eda..ce4b59c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/menulist-deselect-update-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/menulist-deselect-update-expected.txt
@@ -10,4 +10,3 @@ LayoutText (anonymous) at (8,2) size 29x13 text run at (8,2) width 29: "PASS" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-align-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-align-expected.txt index 0681454d..a25006f5 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-align-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-align-expected.txt
@@ -40,7 +40,6 @@ LayoutText (anonymous) at (8,2) size 156x13 text run at (8,2) width 156: "This is should be left justified." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,128) size 784x18 LayoutMenuList {SELECT} at (0,0) size 300x18 [bgcolor=#F8F8F8] LayoutBlockFlow (anonymous) at (0,0) size 300x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-autofilled-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-autofilled-expected.txt index 2d41fa032..6214084 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-autofilled-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-autofilled-expected.txt
@@ -12,4 +12,3 @@ LayoutText (anonymous) at (8,1) size 23x18 text run at (8,1) width 23: "CA" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-change-listbox-size-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-change-listbox-size-expected.txt index 44341bd..e485a81 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-change-listbox-size-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-change-listbox-size-expected.txt
@@ -21,7 +21,6 @@ text run at (0,0) width 323: "This list box should be tall enough to fit 6 options." LayoutBlockFlow (anonymous) at (0,86) size 784x87 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,94) size 47x87 clip at (9,95) size 34x85 LayoutListBox {SELECT} at (0,-0.13) size 47.27x87.13 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 34.27x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-empty-option-height-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-empty-option-height-expected.txt index 19e5e28..a771816 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-empty-option-height-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-empty-option-height-expected.txt
@@ -8,4 +8,3 @@ LayoutText (anonymous) at (0,0) size 4x13 text run at (0,0) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-initial-position-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-initial-position-expected.txt index 834660a..33e76ba1 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-initial-position-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-initial-position-expected.txt
@@ -15,8 +15,7 @@ LayoutBR {BR} at (164,91) size 1x0 LayoutText {#text} at (137,136) size 5x18 text run at (137,136) width 5: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (141,150) size 1x0 LayoutText {#text} at (0,154) size 217x18 text run at (0,154) width 217: "dynamic insert of selected option:" LayoutBR {BR} at (216,168) size 1x0 @@ -42,8 +41,7 @@ text run at (8,2) width 121: "this should be selected" LayoutText {#text} at (152,286) size 4x18 text run at (152,286) width 4: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (156,300) size 0x0 LayoutText {#text} at (0,305) size 217x18 text run at (0,305) width 217: "dynamic insert of selected option:" LayoutBR {BR} at (216,319) size 1x0 @@ -57,7 +55,6 @@ text run at (0,0) width 195: "Display 'none' to 'inline-block'" LayoutBlockFlow (anonymous) at (0,391) size 784x59 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,26) size 137x59 clip at (9,27) size 124x57 scrollY 99.00 scrollHeight 199 LayoutListBox {SELECT} at (0,18.25) size 137.39x58.75 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 124.39x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-item-background-clip-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-item-background-clip-expected.txt index 7e4bc0b..da5caf6 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-item-background-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-item-background-clip-expected.txt
@@ -18,7 +18,6 @@ text run at (162,18) width 5: "." LayoutBlockFlow (anonymous) at (0,52) size 784x60 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,60) size 54x59 clip at (11,63) size 37x53 scrollHeight 62 LayoutListBox {SELECT} at (0,-0.50) size 54.30x59.50 [bgcolor=#FFFFFF] [border: (3px solid #0000FF)] LayoutBlockFlow {OPTION} at (6,6) size 31.30x14.19
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt index 9f557be..a689fe1 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x75 LayoutBlockFlow {BODY} at (8,8) size 784x59 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 354x59 clip at (9,9) size 341x57 LayoutListBox {SELECT} at (0,0.25) size 353.50x58.75 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 340.50x14.19 [color=#FFFFFF] [bgcolor=#0069D9]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-appearance-preventDefault-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-appearance-preventDefault-expected.txt index eb3d9f7c..ddc88b03 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-appearance-preventDefault-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-appearance-preventDefault-expected.txt
@@ -6,8 +6,6 @@ LayoutBR {BR} at (0,0) size 0x18 LayoutText {#text} at (0,18) size 681x18 text run at (0,18) width 681: "This tests that preventDefault called onmousedown will prevent a caret from being placed in the text field." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,50) size 131x19 clip at (12,52) size 127x15 LayoutTextControl (positioned) {INPUT} at (10,50) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] layer at (13,53) size 125x13 scrollWidth 126
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-no-renderer-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-no-renderer-expected.txt index c7b58ba7..5c4154a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-no-renderer-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-no-renderer-expected.txt
@@ -5,4 +5,3 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 589x18 text run at (0,0) width 589: "This test makes sure we don't crash when calling focus() on an element that has no renderer." - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-placeholder-visibility-1-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-placeholder-visibility-1-expected.txt index e5fef261..5200110 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-placeholder-visibility-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-placeholder-visibility-1-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow {DIV} at (0,34) size 784x19 LayoutTextControl {INPUT} at (0,0) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,45) size 125x13 LayoutBlockFlow {DIV} at (3,3) size 125x13 [color=#757575] LayoutText {#text} at (0,0) size 62x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-placeholder-visibility-3-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-placeholder-visibility-3-expected.txt index b400843..8dfe427 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-placeholder-visibility-3-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-placeholder-visibility-3-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow {DIV} at (0,34) size 784x19 LayoutTextControl {INPUT} at (0,0) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,45) size 125x13 LayoutBlockFlow {DIV} at (3,3) size 125x13 [color=#757575] LayoutText {#text} at (0,0) size 62x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-tab-shows-caret-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-tab-shows-caret-expected.txt index dde8e8b..681cc13 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-tab-shows-caret-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/input-tab-shows-caret-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x19 LayoutTextControl {INPUT} at (0,0) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,11) size 125x13 LayoutBlockFlow {DIV} at (3,3) size 125x13 caret: position 0 of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/text-appearance-datalist-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/text-appearance-datalist-expected.txt index 20cd5b1f..9ff3981 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/text-appearance-datalist-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/text-appearance-datalist-expected.txt
@@ -25,7 +25,6 @@ LayoutFlexibleBox {DIV} at (3,3) size 125x13 LayoutBlockFlow {DIV} at (0,0) size 110.28x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,11) size 110x13 LayoutBlockFlow {DIV} at (0,0) size 110.28x13 layer at (146,11) size 110x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/textfield-overflow-by-value-update-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/textfield-overflow-by-value-update-expected.txt index deeb03a..5c858d8 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/textfield-overflow-by-value-update-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/textfield-overflow-by-value-update-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x18 LayoutTextControl {INPUT} at (0,1) size 102x2 [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (9,-9) size 100x38 backgroundClip at (9,0) size 100x29 clip at (9,0) size 100x29 LayoutBlockFlow {DIV} at (1,-18) size 100x38 LayoutText {#text} at (0,0) size 62x38
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/textfield-overflow-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/textfield-overflow-expected.txt index 47a1e1cb..8aeae79 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/textfield-overflow-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/textfield-overflow-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutTextControl {INPUT} at (0,0) size 131x10 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,7) size 125x13 LayoutBlockFlow {DIV} at (3,-1.50) size 125x13 caret: position 0 of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-align-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-align-expected.txt index 0b99cea..c3a3566 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-align-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-align-expected.txt
@@ -17,7 +17,6 @@ text run at (321,90) width 4: " " LayoutBR {BR} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,174) size 784x32 layer at (8,42) size 321x32 clip at (9,43) size 319x30 LayoutTextControl {TEXTAREA} at (0,0) size 321x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt index db5b2de..a2fff21 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 390: "Focus field with a placeholder, then type, then delete all text." LayoutBlockFlow {DIV} at (0,34) size 784x32 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,42) size 141x32 clip at (9,43) size 139x30 LayoutTextControl {TEXTAREA} at (0,0) size 141x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (3,3) size 135x13 [color=#757575]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt index 88a7b57..0e305d4 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 397: "Focus field with a placeholder, then type, then clear the value." LayoutBlockFlow {DIV} at (0,34) size 784x32 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,42) size 141x32 clip at (9,43) size 139x30 LayoutTextControl {TEXTAREA} at (0,0) size 141x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (3,3) size 135x13 [color=#757575]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/crash-on-zero-radius-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/crash-on-zero-radius-expected.png index 2f895ed2..5e88016a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/crash-on-zero-radius-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/crash-on-zero-radius-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/css3-degenerate-color-stops-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/css3-degenerate-color-stops-expected.png new file mode 100644 index 0000000..20d0584 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/css3-degenerate-color-stops-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/css3-radial-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/css3-radial-gradients-expected.png new file mode 100644 index 0000000..81e87655 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/css3-radial-gradients-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/css3-repeating-radial-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/css3-repeating-radial-gradients-expected.png new file mode 100644 index 0000000..ff652363 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/css3-repeating-radial-gradients-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/generated-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/generated-gradients-expected.png index c753512..d9d2e02d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/generated-gradients-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/generated-gradients-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/radial-centered-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/radial-centered-expected.png index 12b802bc..a80e9eef 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/radial-centered-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/radial-centered-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/simple-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/simple-gradients-expected.png index 1910841..3563ef2 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/simple-gradients-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/simple-gradients-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/unprefixed-radial-gradients-color-hints-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/unprefixed-radial-gradients-color-hints-expected.png new file mode 100644 index 0000000..229d4aac --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/unprefixed-radial-gradients-color-hints-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/unprefixed-radial-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/unprefixed-radial-gradients-expected.png new file mode 100644 index 0000000..81e87655 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/unprefixed-radial-gradients-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/unprefixed-repeating-gradient-color-hint-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/unprefixed-repeating-gradient-color-hint-expected.png new file mode 100644 index 0000000..7a71668 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/unprefixed-repeating-gradient-color-hint-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/unprefixed-repeating-radial-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/unprefixed-repeating-radial-gradients-expected.png new file mode 100644 index 0000000..ff652363 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/unprefixed-repeating-radial-gradients-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/invalid/014-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/invalid/014-expected.txt index 6dbefd2..8437da3 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/invalid/014-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/invalid/014-expected.txt
@@ -7,7 +7,6 @@ LayoutText {#text} at (0,0) size 612x18 text run at (0,0) width 289: "Random tests of some bizarre combinations. " text run at (288,0) width 324: "H2 should allow a form inside it, but p should not." - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {FORM} at (0,18) size 784x18 LayoutMenuList {SELECT} at (0,0) size 39x18 [bgcolor=#F8F8F8] LayoutBlockFlow (anonymous) at (0,0) size 39x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/layers/inline-dirty-z-order-lists-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/layers/inline-dirty-z-order-lists-expected.txt index 5f461975..a1399ee 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/layers/inline-dirty-z-order-lists-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/layers/inline-dirty-z-order-lists-expected.txt
@@ -21,9 +21,6 @@ text run at (461,0) width 295: "layer\x{2019}s and its stacking context\x{2019}s z-index lists." LayoutBlockFlow (anonymous) at (0,86) size 784x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,94) size 0x0 LayoutInline (relative positioned) {SPAN} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/layers/layer-visibility-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/layers/layer-visibility-expected.txt index 3a8998d..12c3bdf 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/layers/layer-visibility-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/layers/layer-visibility-expected.txt
@@ -51,7 +51,6 @@ LayoutText {#text} at (0,0) size 108x36 text run at (0,0) width 108: "3 green box with" text run at (0,18) width 58: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (278,46) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x22 [border: (2px solid #008000)] @@ -62,7 +61,6 @@ LayoutText {#text} at (0,0) size 108x36 text run at (0,0) width 108: "4 green box with" text run at (0,18) width 58: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (412,46) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x34 [border: (2px solid #FF0000)] layer at (414,48) size 126x30 @@ -74,7 +72,6 @@ LayoutText {#text} at (0,0) size 108x36 text run at (0,0) width 108: "5 green box with" text run at (0,18) width 58: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (546,46) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x26 [border: (2px solid #FF0000)] @@ -86,7 +83,6 @@ LayoutText {#text} at (0,0) size 108x36 text run at (0,0) width 108: "6 green box with" text run at (0,18) width 58: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (10,150) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x34 [border: (2px solid #FF0000)] hidden layer at (12,152) size 126x30 @@ -99,7 +95,6 @@ LayoutText {#text} at (0,0) size 108x36 text run at (0,0) width 108: "7 green box with" text run at (0,18) width 58: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (144,150) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x34 [border: (2px solid #FF0000)] hidden layer at (146,152) size 126x30 @@ -113,7 +108,6 @@ LayoutText {#text} at (0,0) size 124x36 text run at (0,0) width 124: "8 double green box" text run at (0,18) width 90: "with word ok:" - LayoutText {#text} at (0,0) size 0x0 layer at (278,150) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x34 [border: (2px solid #008000)] hidden layer at (280,152) size 126x30 @@ -127,7 +121,6 @@ LayoutText {#text} at (0,0) size 108x36 text run at (0,0) width 108: "9 green box with" text run at (0,18) width 58: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (412,150) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x34 [border: (2px solid #FF0000)] hidden layer at (414,152) size 126x30 @@ -140,7 +133,6 @@ LayoutBlockFlow (relative positioned) {DIV} at (2,2) size 130x18 LayoutText {#text} at (0,0) size 88x18 text run at (0,0) width 88: "10 green box:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (546,132) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,18) size 130x34 [border: (2px solid #FF0000)] layer at (548,134) size 126x30 @@ -154,7 +146,6 @@ LayoutText {#text} at (0,0) size 116x36 text run at (0,0) width 116: "11 green box with" text run at (0,18) width 58: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (10,254) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x26 [border: (2px solid #FF0000)] @@ -166,7 +157,6 @@ LayoutText {#text} at (0,0) size 116x36 text run at (0,0) width 116: "12 green box with" text run at (0,18) width 58: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (144,254) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x26 [border: (2px solid #FF0000)] @@ -177,7 +167,6 @@ LayoutBlockFlow (relative positioned) {DIV} at (2,2) size 130x18 LayoutText {#text} at (0,0) size 88x18 text run at (0,0) width 88: "13 green box:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (278,236) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,18) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x26 [border: (2px solid #008000)] @@ -189,7 +178,6 @@ LayoutText {#text} at (0,0) size 116x36 text run at (0,0) width 116: "14 green box with" text run at (0,18) width 58: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (412,254) size 130x30 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x30 LayoutBlockFlow {DIV} at (0,0) size 130x22 [border: (2px solid #008000)] @@ -200,7 +188,6 @@ LayoutText {#text} at (0,0) size 116x36 text run at (0,0) width 116: "15 green box with" text run at (0,18) width 58: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (546,254) size 130x30 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x30 layer at (546,254) size 130x30 @@ -212,7 +199,6 @@ LayoutText {#text} at (0,0) size 116x36 text run at (0,0) width 116: "16 green box with" text run at (0,18) width 58: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (10,358) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x48 [border: (2px solid #FF0000)] @@ -227,7 +213,6 @@ LayoutText {#text} at (0,0) size 116x36 text run at (0,0) width 116: "17 green box with" text run at (0,18) width 58: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (144,358) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x48 [border: (2px solid #FF0000)] @@ -242,7 +227,6 @@ LayoutText {#text} at (0,0) size 116x36 text run at (0,0) width 116: "18 green box with" text run at (0,18) width 58: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (278,358) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x48 [border: (2px solid #FF0000)] @@ -257,7 +241,6 @@ LayoutText {#text} at (0,0) size 116x36 text run at (0,0) width 116: "19 green box with" text run at (0,18) width 58: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (412,358) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x26 [border: (2px solid #FF0000)] @@ -272,7 +255,6 @@ LayoutBlockFlow (relative positioned) {DIV} at (2,2) size 130x18 LayoutText {#text} at (0,0) size 88x18 text run at (0,0) width 88: "20 green box:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (546,340) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,18) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x48 [border: (2px solid #008000)] @@ -287,7 +269,6 @@ LayoutText {#text} at (0,0) size 125x36 text run at (0,0) width 125: "21 two green boxes" text run at (0,18) width 90: "with word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (10,462) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x26 [border: (2px solid #FF0000)] @@ -303,7 +284,6 @@ LayoutText {#text} at (0,0) size 116x36 text run at (0,0) width 116: "22 green box with" text run at (0,18) width 58: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (144,462) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,36) size 130x34 [border: (2px solid #FF0000)] layer at (146,464) size 126x30 @@ -315,7 +295,6 @@ LayoutText {#text} at (0,0) size 116x36 text run at (0,0) width 116: "23 green box with" text run at (0,18) width 58: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (278,462) size 130x34 LayoutBlockFlow (positioned) zI: 1 {DIV} at (0,36) size 130x34 [border: (2px solid #FF0000)] hidden layer at (280,464) size 126x30
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/layers/layer-visibility-sublayer-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/layers/layer-visibility-sublayer-expected.txt index 35085f2..4741b80 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/layers/layer-visibility-sublayer-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/layers/layer-visibility-sublayer-expected.txt
@@ -9,22 +9,19 @@ LayoutBR {BR} at (0,54) size 0x18 LayoutText {#text} at (0,72) size 182x18 text run at (0,72) width 182: "24 green box with word ok: " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (181,86) size 1x0 LayoutBR {BR} at (0,90) size 0x18 LayoutBR {BR} at (0,108) size 0x18 LayoutBR {BR} at (0,126) size 0x18 LayoutText {#text} at (0,144) size 182x18 text run at (0,144) width 182: "25 green box with word ok: " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (181,158) size 1x0 LayoutBR {BR} at (0,162) size 0x18 LayoutBR {BR} at (0,180) size 0x18 LayoutBR {BR} at (0,198) size 0x18 LayoutText {#text} at (0,216) size 182x18 text run at (0,216) width 182: "26 green box with word ok: " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (181,230) size 1x0 LayoutBR {BR} at (0,234) size 0x18 LayoutBR {BR} at (0,252) size 0x18 LayoutBR {BR} at (0,270) size 0x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/layers/remove-layer-with-nested-stacking-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/layers/remove-layer-with-nested-stacking-expected.txt index 78aed6b..9f7ec9f 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/layers/remove-layer-with-nested-stacking-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/layers/remove-layer-with-nested-stacking-expected.txt
@@ -10,8 +10,6 @@ LayoutBlockFlow (anonymous) at (0,68) size 784x100 LayoutBlockFlow (anonymous) at (0,168) size 784x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,76) size 100x100 LayoutBlockFlow {DIV} at (0,0) size 100x100 LayoutText {#text} at (0,0) size 0x0 @@ -24,4 +22,3 @@ LayoutBlockFlow {SPAN} at (0,0) size 100x50 [bgcolor=#008000] layer at (8,176) size 0x0 transparent LayoutInline {SPAN} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/layers/remove-only-this-layer-update-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/layers/remove-only-this-layer-update-expected.txt index c85e2a94..8febc25 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/layers/remove-only-this-layer-update-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/layers/remove-only-this-layer-update-expected.txt
@@ -10,7 +10,6 @@ text run at (495,0) width 237: "There should be no red on this page. " text run at (731,0) width 56: "This is a" text run at (0,18) width 391: "test case for https://bugs.webkit.org/show_bug.cgi?id=25252" - LayoutText {#text} at (0,0) size 0x0 layer at (100,100) size 100x100 LayoutBlockFlow (positioned) {DIV} at (100,100) size 100x100 [bgcolor=#FF0000] LayoutText {#text} at (0,0) size 35x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/parser/title-error-test-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/parser/title-error-test-expected.txt index f1c8a38..eaef35d6 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/parser/title-error-test-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/parser/title-error-test-expected.txt
@@ -6,7 +6,6 @@ LayoutBlockFlow (anonymous) at (0,0) size 784x0 LayoutInline {TIMER:TIME} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow (anonymous) at (0,0) size 784x18 LayoutBlockFlow {P} at (0,0) size 784x18 LayoutInline {SPAN} at (0,0) size 74x18 [color=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/parser/xhtml-alternate-entities-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/parser/xhtml-alternate-entities-expected.txt index bde2d3b..74a1e4f 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/parser/xhtml-alternate-entities-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/parser/xhtml-alternate-entities-expected.txt
@@ -17,7 +17,6 @@ LayoutInline {h1} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutInline {p} at (0,0) size 495x18 LayoutInline {font} at (0,0) size 495x18 LayoutText {#text} at (0,0) size 495x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/reflections/transparent-reflected-sublayers-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/reflections/transparent-reflected-sublayers-expected.txt index eb39f2ea..7895355 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/reflections/transparent-reflected-sublayers-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/reflections/transparent-reflected-sublayers-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 373x18 text run at (0,0) width 373: "You should see four green squares in a vertical line below." - LayoutText {#text} at (0,0) size 0x0 layer at (8,160) size 100x100 transparent LayoutBlockFlow (positioned) {DIV} at (8,160) size 100x100 [bgcolor=#008000] layer at (8,400) size 100x100
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/ruby/ruby-text-before-after-content-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/ruby/ruby-text-before-after-content-expected.txt index 529f48f..6fa6e11 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/ruby/ruby-text-before-after-content-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/ruby/ruby-text-before-after-content-expected.txt
@@ -22,4 +22,3 @@ LayoutText {#text} at (0,0) size 22x37 text run at (0,0) width 22: "B" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt index 9f557be..a689fe1 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x75 LayoutBlockFlow {BODY} at (8,8) size 784x59 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 354x59 clip at (9,9) size 341x57 LayoutListBox {SELECT} at (0,0.25) size 353.50x58.75 [bgcolor=#FFFFFF] [border: (1px solid #999999)] LayoutBlockFlow {OPTION} at (1,1) size 340.50x14.19 [color=#FFFFFF] [bgcolor=#0069D9]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/html/details_summary/details-open2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/html/details_summary/details-open2-expected.txt index e0c0e85..ca6842d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/html/details_summary/details-open2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/html/details_summary/details-open2-expected.txt
@@ -11,6 +11,5 @@ LayoutBlockFlow {DIV} at (0,18) size 784x19 LayoutTextControl {INPUT} at (0,0) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,29) size 125x13 LayoutBlockFlow {DIV} at (3,3) size 125x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac/html/details_summary/details-replace-text-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/html/details_summary/details-replace-text-expected.txt index 43ae648..f177381 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/html/details_summary/details-replace-text-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/html/details_summary/details-replace-text-expected.txt
@@ -14,7 +14,6 @@ text run at (0,0) width 63: "Details1" LayoutText {#text} at (62,0) size 5x18 text run at (62,0) width 5: " " - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {SPAN} at (66.42,2) size 62.42x15 LayoutText {#text} at (0,0) size 63x15 text run at (0,0) width 63: "Details2"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/html/tabular_data/col_width_resizing_table-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/html/tabular_data/col_width_resizing_table-expected.txt index 46b07b8..c95cf87 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/html/tabular_data/col_width_resizing_table-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/html/tabular_data/col_width_resizing_table-expected.txt
@@ -35,4 +35,3 @@ LayoutText {#text} at (0,0) size 342x13 text run at (0,0) width 342: "Click me to test manually. The first column should grow to 500px." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/http/tests/misc/location-replace-crossdomain-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/http/tests/misc/location-replace-crossdomain-expected.txt index 784fb66bf..d20b4ab5 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/http/tests/misc/location-replace-crossdomain-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/http/tests/misc/location-replace-crossdomain-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x600 LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 304x154 LayoutIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #EEEEEE)] layer at (0,0) size 300x150
diff --git a/third_party/WebKit/LayoutTests/platform/mac/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt index a460948..0cca0f09 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt
@@ -14,7 +14,6 @@ LayoutBlockFlow {P} at (0.50,126.50) size 135x9 LayoutText {#text} at (0,-1) size 14x10 text run at (0,-1) width 14: " " - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0.50,189.50) size 135x9 LayoutTable (anonymous) at (0.50,252.50) size 135x45 LayoutTableSection (anonymous) at (0,0) size 135x45
diff --git a/third_party/WebKit/LayoutTests/platform/mac/http/tests/misc/slow-loading-image-in-pattern-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/http/tests/misc/slow-loading-image-in-pattern-expected.txt index 0e417909..d01cd23 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/http/tests/misc/slow-loading-image-in-pattern-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/http/tests/misc/slow-loading-image-in-pattern-expected.txt
@@ -8,7 +8,6 @@ LayoutBR {BR} at (639,0) size 1x18 LayoutText {#text} at (0,18) size 572x18 text run at (0,18) width 572: "You should see a 400x300 rect containing a tiled rendering of the Acid3 reference image." - LayoutText {#text} at (0,0) size 0x0 layer at (10,50) size 406x306 clip at (13,53) size 400x300 LayoutSVGRoot (positioned) {svg} at (10,50) size 406x306 LayoutSVGHiddenContainer {defs} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-circle-focus-ring-expected.txt index 7b0c6518..33ea9f0 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-circle-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-circle-focus-ring-expected.txt
@@ -15,4 +15,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (0,0) size 128x128 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-focus-ring-in-positioned-container-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-focus-ring-in-positioned-container-expected.txt index 3ba5197..2eb3a50 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-focus-ring-in-positioned-container-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-focus-ring-in-positioned-container-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x18 LayoutText {#text} at (0,0) size 564x18 text run at (0,0) width 564: "Tests that we paint area outline properly when the image is inside positioned containers." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (20,50) size 0x0 LayoutBlockFlow (positioned) {DIV} at (20,50) size 0x0 layer at (30,60) size 50x54
diff --git a/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-focus-ring-with-paint-root-offset-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-focus-ring-with-paint-root-offset-expected.txt index 0839108..af52d98 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-focus-ring-with-paint-root-offset-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-focus-ring-with-paint-root-offset-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x18 LayoutText {#text} at (0,0) size 447x18 text run at (0,0) width 447: "Tests that we paint area outline properly when the paintroot is shifted." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (5,50) size 50x54 LayoutBlockFlow (positioned) {DIV} at (5,50) size 50x54 LayoutImage {IMG} at (0,0) size 50x50
diff --git a/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-focus-ring-with-scale-transform-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-focus-ring-with-scale-transform-expected.txt index ef870b0..0342978 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-focus-ring-with-scale-transform-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-focus-ring-with-scale-transform-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x18 LayoutText {#text} at (0,0) size 498x18 text run at (0,0) width 498: "Tests that we paint area outline properly when the image's container is scaled." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (100,100) size 100x100 LayoutBlockFlow (positioned) {DIV} at (100,100) size 100x100 LayoutImage {IMG} at (0,0) size 50x50
diff --git a/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-overflowing-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-overflowing-circle-focus-ring-expected.txt index de97e484..f81d1c78 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-overflowing-circle-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-overflowing-circle-focus-ring-expected.txt
@@ -16,4 +16,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (0,0) size 128x128 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-overflowing-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-overflowing-polygon-focus-ring-expected.txt index c5bf1a2..0ef44758 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-overflowing-polygon-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-overflowing-polygon-focus-ring-expected.txt
@@ -16,4 +16,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (0,0) size 128x128 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-polygon-focus-ring-expected.txt index 70f6bb03..6f3cb4f 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-polygon-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/images/imagemap-polygon-focus-ring-expected.txt
@@ -15,4 +15,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (0,0) size 128x128 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/block-selection-gap-stale-cache-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/block-selection-gap-stale-cache-expected.txt index a6dbeb5..6e335035 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/block-selection-gap-stale-cache-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/block-selection-gap-stale-cache-expected.txt
@@ -9,4 +9,3 @@ LayoutBlockFlow (anonymous) at (0,100) size 784x18 LayoutText {#text} at (0,0) size 4x18 text run at (0,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt index d5614f6..3ed5b0bd 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt
@@ -106,10 +106,6 @@ { "object": "LayoutText #text", "reason": "geometry" - }, - { - "object": "LayoutText #text", - "reason": "geometry" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/details-open-repaint-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/details-open-repaint-expected.txt index 453a2637..7a1cade 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/details-open-repaint-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/details-open-repaint-expected.txt
@@ -61,10 +61,6 @@ { "object": "LayoutText #text", "reason": "appeared" - }, - { - "object": "LayoutText #text", - "reason": "appeared" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt index a2ad821..aa99299 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow (anonymous) at (0,19) size 784x18 LayoutText {#text} at (0,0) size 4x18 text run at (0,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,37) size 784x0 layer at (11,11) size 125x13 LayoutBlockFlow {DIV} at (3,3) size 125x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/repaint-svg-after-style-change-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/repaint-svg-after-style-change-expected.txt new file mode 100644 index 0000000..633dffb --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/repaint-svg-after-style-change-expected.txt
@@ -0,0 +1,10 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x221 + LayoutBlockFlow {HTML} at (0,0) size 800x221 + LayoutBlockFlow {BODY} at (8,8) size 784x205 + LayoutSVGRoot {svg} at (0,0) size 201x201 + LayoutSVGContainer {g} at (0,0) size 200x200 + LayoutSVGPath {path} at (0,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [data="M 0 0 L 0 200 L 200 200 L 200 0 Z"] + LayoutSVGPath {path} at (0,0) size 200x200 [fill={[type=SOLID] [color=#008000]}] [data="M 0 0 L 0 200 L 200 200 L 200 0 Z"] + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/text-in-relative-positioned-inline-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/text-in-relative-positioned-inline-expected.txt index 803a993..a9312aa 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/text-in-relative-positioned-inline-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/text-in-relative-positioned-inline-expected.txt
@@ -9,7 +9,7 @@ { "object": "LayoutBlockFlow DIV", "rect": [108, 8, 684, 100], - "reason": "geometry" + "reason": "style change" }, { "object": "LayoutText #text", @@ -34,8 +34,12 @@ "reason": "disappeared" }, { + "object": "LayoutText #text", + "reason": "disappeared" + }, + { "object": "LayoutBlockFlow DIV", - "reason": "geometry" + "reason": "style change" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-inline-block-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-inline-block-expected.txt index ac955b91..0b7003a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-inline-block-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-inline-block-expected.txt
@@ -8,6 +8,5 @@ text run at (0,0) width 24: "x" LayoutText {#text} at (24,0) size 24x55 text run at (24,0) width 24: "y" - LayoutText {#text} at (0,0) size 0x0 selection start: position 0 of child 0 {#text} of child 0 {DIV} of body selection end: position 1 of child 1 {#text} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt index 32c5a47..cffbb62 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt
@@ -12,6 +12,5 @@ text run at (0,3) width 96: "text" text run at (95,3) width 94 RTL: "\x{645}\x{62A}\x{646}:" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 selection start: position 5 of child 0 {#text} of child 2 {SPAN} of body selection end: position 13 of child 0 {#text} of child 2 {SPAN} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/plugins/webview-plugin-type-change-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/plugins/webview-plugin-type-change-expected.txt new file mode 100644 index 0000000..13107bb --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/plugins/webview-plugin-type-change-expected.txt
@@ -0,0 +1,9 @@ +CONSOLE MESSAGE: Blink Test Plugin: initializing +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x172 + LayoutBlockFlow {HTML} at (0,0) size 800x172 + LayoutBlockFlow {BODY} at (8,8) size 784x156 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,8) size 152x152 + LayoutEmbeddedObject {EMBED} at (0,0) size 152x152 [border: (1px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/animate-elem-24-t-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/animate-elem-24-t-expected.txt index 9cc4308..8d31672 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/animate-elem-24-t-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/animate-elem-24-t-expected.txt
@@ -28,9 +28,6 @@ LayoutSVGText {text} at (0,-18) size 74.13x23 [transform={m=((0.87,-0.50)(0.50,0.87)) t=(0.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (0,-18) size 74.13x23 chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 11 width 74.13: "It's alive!" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGText {text} at (10,304) size 263.33x46 contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,304) size 263.33x46 chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 16 width 263.34: "$Revision: 1.7 $"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/animate-elem-77-t-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/animate-elem-77-t-expected.txt index 8f8aa327..a33b539 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/animate-elem-77-t-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/animate-elem-77-t-expected.txt
@@ -79,7 +79,6 @@ LayoutSVGText {text} at (10,2) size 14.44x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,2) size 14.44x23 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 14.44: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (10,2) size 14.44x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(140.00,0.00)}] LayoutSVGText {text} at (10,2) size 14.44x23 contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,2) size 14.44x23 @@ -124,18 +123,14 @@ LayoutSVGText {text} at (-4.44,2) size 14.44x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(40.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (-4.44,2) size 14.44x23 chunk 1 (end anchor) text run 1 at (-4.44,20.00) startOffset 0 endOffset 1 width 14.44: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (145.55,2) size 14.44x23 LayoutSVGText {text} at (105.55,2) size 14.44x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(40.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (105.55,2) size 14.44x23 chunk 1 (end anchor) text run 1 at (105.56,20.00) startOffset 0 endOffset 1 width 14.44: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {a} at (255.55,2) size 14.44x23 LayoutSVGText {text} at (215.55,2) size 14.44x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(40.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (215.55,2) size 14.44x23 chunk 1 (end anchor) text run 1 at (215.56,20.00) startOffset 0 endOffset 1 width 14.44: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (10,-8) size 271.66x36 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,70.00)}] LayoutSVGHiddenContainer {defs} at (10,-8) size 51.66x36 LayoutSVGContainer {g} at (10,-8) size 51.66x36 @@ -172,18 +167,14 @@ LayoutSVGText {text} at (10,-8) size 21.66x36 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,-8) size 21.66x36 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 21.67: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (150,-8) size 21.66x36 LayoutSVGText {text} at (120,-8) size 21.66x36 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (120,-8) size 21.66x36 chunk 1 text run 1 at (120.00,20.00) startOffset 0 endOffset 1 width 21.67: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {a} at (260,-8) size 21.66x36 LayoutSVGText {text} at (230,-8) size 21.66x36 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (230,-8) size 21.66x36 chunk 1 text run 1 at (230.00,20.00) startOffset 0 endOffset 1 width 21.67: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (10,-8) size 271.66x36 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,105.00)}] LayoutSVGHiddenContainer {defs} at (10,-8) size 51.66x36 LayoutSVGContainer {g} at (10,-8) size 51.66x36 @@ -220,18 +211,14 @@ LayoutSVGText {text} at (10,-8) size 21.66x36 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,-8) size 21.66x36 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 21.67: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (40,-8) size 21.66x36 [transform={m=((1.00,0.00)(0.00,1.00)) t=(110.00,0.00)}] LayoutSVGText {text} at (10,-8) size 21.66x36 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,-8) size 21.66x36 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 21.67: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {a} at (40,-8) size 21.66x36 [transform={m=((1.00,0.00)(0.00,1.00)) t=(220.00,0.00)}] LayoutSVGText {text} at (10,-8) size 21.66x36 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,-8) size 21.66x36 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 21.67: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (10,2) size 262.20x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,140.00)}] LayoutSVGHiddenContainer {defs} at (10,2) size 42.20x23 LayoutSVGContainer {g} at (10,2) size 42.20x23 @@ -268,18 +255,14 @@ LayoutSVGText {text} at (9.45,2) size 12.75x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (9.45,2) size 12.75x23 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 12.22: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (39.45,2) size 12.75x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(110.00,0.00)}] LayoutSVGText {text} at (9.45,2) size 12.75x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (9.45,2) size 12.75x23 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 12.22: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (39.45,2) size 12.75x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(220.00,0.00)}] LayoutSVGText {text} at (9.45,2) size 12.75x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (9.45,2) size 12.75x23 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 12.22: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (10,2) size 264.44x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,175.00)}] LayoutSVGHiddenContainer {defs} at (10,2) size 44.44x23 LayoutSVGContainer {g} at (10,2) size 44.44x23 @@ -316,15 +299,11 @@ LayoutSVGText {text} at (10,2) size 14.44x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,2) size 14.44x23 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 14.44: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (40,2) size 14.44x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(110.00,0.00)}] LayoutSVGText {text} at (10,2) size 14.44x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,2) size 14.44x23 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 14.44: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (40,2) size 14.44x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(220.00,0.00)}] LayoutSVGText {text} at (10,2) size 14.44x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,2) size 14.44x23 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 14.44: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-13-b-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-13-b-expected.png index 0b6fe57a..fbed03a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-13-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-13-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-3-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-3-expected.png index ed7d1e6..6e5b33c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-with-relative-size-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-with-relative-size-expected.png new file mode 100644 index 0000000..16870d12 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-with-relative-size-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/batik/text/xmlSpace-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/batik/text/xmlSpace-expected.txt index c5f91cc..22d3daa 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/batik/text/xmlSpace-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/batik/text/xmlSpace-expected.txt
@@ -258,7 +258,6 @@ LayoutSVGInlineText {#text} at (236,357) size 33.88x23 chunk 1 text run 1 at (236.00,375.00) startOffset 0 endOffset 2 width 19.44: "X " chunk 1 text run 1 at (255.44,375.00) startOffset 0 endOffset 1 width 14.44: "X" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGText {text} at (345,358) size 76.81x18.59 contains 1 chunk(s) LayoutSVGInlineText {#text} at (345,358) size 76.81x9 chunk 1 text run 1 at (345.00,365.00) startOffset 0 endOffset 16 width 76.81: "unknown element "
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/canvas/canvas-draw-image-globalalpha-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/canvas/canvas-draw-image-globalalpha-expected.txt new file mode 100644 index 0000000..602fdbd --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/canvas/canvas-draw-image-globalalpha-expected.txt
@@ -0,0 +1,8 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x120 + LayoutBlockFlow {HTML} at (0,0) size 800x120 + LayoutBlockFlow {BODY} at (8,8) size 784x104 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,8) size 100x100 + LayoutHTMLCanvas {CANVAS} at (0,0) size 100x100
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt index 64a26498..8548c8d6 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt
@@ -10,5 +10,4 @@ LayoutSVGInlineText {#text} at (266.92,2086) size 266.14x18 chunk 1 (middle anchor) text run 1 at (266.93,2100.00) startOffset 0 endOffset 46 width 266.13: "The test passes if the circle sits in the rect" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 scrolled to 0,1700
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/image-rescale-clip-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/image-rescale-clip-expected.txt index f729ca547..ca16fe3 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/image-rescale-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/image-rescale-clip-expected.txt
@@ -12,6 +12,5 @@ layer at (8,8) size 160x105 backgroundClip at (8,8) size 150x15 clip at (8,8) size 150x15 LayoutBlockFlow (positioned) {DIV} at (8,8) size 160x105 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (13,13) size 160x105 backgroundClip at (8,8) size 150x15 clip at (8,8) size 150x15 LayoutImage (relative positioned) {IMG} at (0,0) size 160x105
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-expected.txt index ce112a27..e2df2344 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-expected.txt
@@ -10,6 +10,5 @@ LayoutSVGInlineText {#text} at (44.70,36) size 310.63x18 chunk 1 (middle anchor) text run 1 at (44.71,50.00) startOffset 0 endOffset 49 width 310.58: "The circle should stay in the bottom-right corner" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 selection start: position 0 of child 0 {#text} of child 3 {text} of child 1 {svg} of body selection end: position 24 of child 0 {#text} of child 3 {text} of child 1 {svg} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-expected.txt index 16e3871..3b071756 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-expected.txt
@@ -9,5 +9,4 @@ LayoutSVGInlineText {#text} at (90.69,36) size 218.59x18 chunk 1 (middle anchor) text run 1 at (90.70,50.00) startOffset 0 endOffset 34 width 218.60: "The circle should be in the middle" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 caret: position 16 of child 0 {#text} of child 3 {text} of child 1 {svg} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/object-no-size-attributes-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/object-no-size-attributes-expected.txt new file mode 100644 index 0000000..723c3595 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/object-no-size-attributes-expected.txt
@@ -0,0 +1,13 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x120 + LayoutBlockFlow {html} at (0,0) size 800x120 + LayoutBlockFlow {body} at (8,8) size 784x104 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,8) size 100x100 + LayoutEmbeddedObject {object} at (0,0) size 100x100 [bgcolor=#FF0000] + layer at (0,0) size 100x100 + LayoutView at (0,0) size 100x100 + layer at (0,0) size 100x100 + LayoutSVGRoot {svg} at (0,0) size 100x100 + LayoutSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/radial-gradient-with-outstanding-focalPoint-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/radial-gradient-with-outstanding-focalPoint-expected.png deleted file mode 100644 index 5ff77bb..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/radial-gradient-with-outstanding-focalPoint-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDropShadowElement-dom-shadow-color-attr-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDropShadowElement-dom-shadow-color-attr-expected.png new file mode 100644 index 0000000..360e308 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDropShadowElement-dom-shadow-color-attr-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDropShadowElement-dom-shadow-opacity-attr-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDropShadowElement-dom-shadow-opacity-attr-expected.png new file mode 100644 index 0000000..61c5d8ab --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDropShadowElement-dom-shadow-opacity-attr-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDropShadowElement-svgdom-shadow-color-prop-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDropShadowElement-svgdom-shadow-color-prop-expected.png new file mode 100644 index 0000000..360e308 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDropShadowElement-svgdom-shadow-color-prop-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDropShadowElement-svgdom-shadow-opacity-prop-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDropShadowElement-svgdom-shadow-opacity-prop-expected.png new file mode 100644 index 0000000..61c5d8ab --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDropShadowElement-svgdom-shadow-opacity-prop-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/filters/feBlend-all-modes-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/filters/feBlend-all-modes-expected.png index a6a4649..3b8b1eb 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/filters/feBlend-all-modes-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/filters/feBlend-all-modes-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/filters/feDropShadow-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/filters/feDropShadow-expected.png index ba0a4b6..c0cbaa7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/filters/feDropShadow-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/filters/feDropShadow-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/hixie/mixed/003-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/hixie/mixed/003-expected.txt index 286e3a1..da6fa1c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/hixie/mixed/003-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/hixie/mixed/003-expected.txt
@@ -12,7 +12,6 @@ LayoutSVGRoot {svg} at (0,0) size 200x200 LayoutSVGEllipse {circle} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [cx=50.00] [cy=50.00] [r=50.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,19) size 305x13 LayoutBlockFlow {div} at (3,3) size 305x13 LayoutText {#text} at (0,0) size 116x13
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/bbox-with-glyph-overflow-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/text/bbox-with-glyph-overflow-expected.txt index 2895dcc..3f9d8713 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/bbox-with-glyph-overflow-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/bbox-with-glyph-overflow-expected.txt
@@ -53,4 +53,3 @@ LayoutSVGRect {rect} at (38.55,299.53) size 297.11x100.92 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=38.55] [y=299.53] [width=297.11] [height=100.92] LayoutSVGRect {rect} at (49.16,419) size 105.80x79 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=49.16] [y=419.00] [width=105.80] [height=79.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/bbox-with-glyph-overflow-on-path-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/text/bbox-with-glyph-overflow-on-path-expected.txt index 03393b1..5dd9ff2d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/bbox-with-glyph-overflow-on-path-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/bbox-with-glyph-overflow-on-path-expected.txt
@@ -110,4 +110,3 @@ LayoutSVGRect {rect} at (39.27,203.72) size 350.92x152.34 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=39.27] [y=203.72] [width=350.92] [height=152.34] LayoutSVGRect {rect} at (49.16,394) size 105.81x79 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=49.16] [y=394.00] [width=105.81] [height=79.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/bbox-with-glyph-overflow-zoomed-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/text/bbox-with-glyph-overflow-zoomed-expected.txt index 7eee6c2..7b11891 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/bbox-with-glyph-overflow-zoomed-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/bbox-with-glyph-overflow-zoomed-expected.txt
@@ -50,4 +50,3 @@ LayoutSVGRect {rect} at (18.20,28.89) size 65.27x27.22 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=18.20] [y=28.89] [width=65.27] [height=27.22] LayoutSVGRect {rect} at (19.80,61.67) size 25.38x18.88 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=19.80] [y=61.67] [width=25.38] [height=18.88] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/combining-character-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/text/combining-character-queries-expected.txt index 7dfb65ad..ef2b555 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/combining-character-queries-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/combining-character-queries-expected.txt
@@ -503,5 +503,3 @@ chunk 1 text run 1 at (360.05,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}" chunk 1 text run 1 at (409.12,350.00) startOffset 0 endOffset 2 width 15.76: "i\x{333}" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/ligature-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/text/ligature-queries-expected.txt index 84c9cb93..57d404c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/ligature-queries-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/ligature-queries-expected.txt
@@ -500,5 +500,3 @@ chunk 1 text run 33 at (458.33,416.13) startOffset 32 endOffset 33 width 14.79: "i" LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/surrogate-pair-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/text/surrogate-pair-queries-expected.txt index 203472a..3c26168 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/surrogate-pair-queries-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/surrogate-pair-queries-expected.txt
@@ -336,5 +336,3 @@ LayoutSVGInlineText {#text} at (357.33,318) size 92.66x40 chunk 1 text run 1 at (357.34,350.00) startOffset 0 endOffset 7 width 92.66 RTL override: "\x{D83C}\x{DFB6}\x{D801}\x{DC37}\x{30C}\x{D83C}\x{DFB6}" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-background-images-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-background-images-expected.txt index 30513273..e5f4062 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-background-images-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-background-images-expected.txt
@@ -14,6 +14,3 @@ text run at (462,145) width 4: " " LayoutImage {IMG} at (476.75,11.56) size 129.63x129.63 [border: (1.16px solid #000000)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-clip-path-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-clip-path-expected.txt new file mode 100644 index 0000000..73a64a4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-clip-path-expected.txt
@@ -0,0 +1,32 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x248 + LayoutBlockFlow {HTML} at (0,0) size 800x248.16 + LayoutBlockFlow {BODY} at (16.58,16.58) size 766.84x215 + LayoutSVGRoot {svg} at (0,0) size 207.36x207.36 + LayoutSVGHiddenContainer {defs} at (0,0) size 0x0 + LayoutSVGResourceClipper {clipPath} [id="clip1"] [clipPathUnits=userSpaceOnUse] + LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00] + LayoutSVGResourceClipper {clipPath} [id="clip2"] [clipPathUnits=userSpaceOnUse] + LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00] + LayoutSVGRect {rect} at (50,50) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=50.00] [y=50.00] [width=50.00] [height=50.00] + LayoutSVGResourceClipper {clipPath} [id="clip3"] [clipPathUnits=objectBoundingBox] + LayoutSVGRect {rect} at (0,0) size 0.50x0.50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=0.50] [height=0.50] + LayoutSVGResourceClipper {clipPath} [id="clip4"] [clipPathUnits=objectBoundingBox] + LayoutSVGRect {rect} at (0,0) size 0.50x0.50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=0.50] [height=0.50] + LayoutSVGRect {rect} at (0.50,0.50) size 0.50x0.50 [fill={[type=SOLID] [color=#000000]}] [x=0.50] [y=0.50] [width=0.50] [height=0.50] + LayoutText {#text} at (0,0) size 0x0 +layer at (0,0) size 415x415 + LayoutBlockFlow (positioned) {DIV} at (0,0) size 414.72x414.72 [bgcolor=#000000] +layer at (0,0) size 207x207 + LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000] +layer at (0,0) size 207x207 + LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000] +layer at (0,0) size 207x207 + LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000] +layer at (0,0) size 207x207 + LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000] +layer at (0,0) size 207x207 + LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000] +layer at (0,0) size 207x207 + LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-hixie-mixed-008-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-hixie-mixed-008-expected.txt index 66b243e..e45fbb5 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-hixie-mixed-008-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-hixie-mixed-008-expected.txt
@@ -15,6 +15,3 @@ LayoutText {#text} at (140,0) size 120x59 text run at (140,0) width 120: "TEST" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-hixie-rendering-model-004-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-hixie-rendering-model-004-expected.txt index 618dad4..70629a2 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-hixie-rendering-model-004-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-hixie-rendering-model-004-expected.txt
@@ -11,6 +11,3 @@ LayoutSVGRoot {svg} at (0,0) size 144x144 LayoutSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#000080]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt index 01a4bcb..1547f0e 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt
@@ -14,7 +14,6 @@ LayoutBlockFlow {P} at (0.58,129.38) size 138.88x9.25 LayoutText {#text} at (0,-1) size 14x10 text run at (0,-1) width 14: " " - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0.58,194.17) size 138.88x9.25 LayoutTable (anonymous) at (0.58,258.97) size 138x46 LayoutTableSection (anonymous) at (0,0) size 138x46
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt index 3a5d8d96..e7bb716 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt
@@ -6,10 +6,6 @@ LayoutText {#text} at (159,150) size 4x13 text run at (159,150) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (6,6) size 160x160 LayoutEmbeddedObject {OBJECT} at (0,0) size 159.67x159.67 [border: (1.38px dashed #800000)] layer at (0,0) size 153x153
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt index 624c610..6e89264c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt
@@ -8,9 +8,6 @@ LayoutBR {BR} at (351,339) size 1x13 LayoutText {#text} at (0,352) size 223x13 text run at (0,352) width 223: "The image of Tux should fill the entire red square." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (6,6) size 349x349 LayoutEmbeddedObject {OBJECT} at (0,0) size 348.59x348.59 [border: (0.69px solid #FF0000)] layer at (0,0) size 347x347
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/text/zoom-hixie-mixed-008-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/text/zoom-hixie-mixed-008-expected.txt index 1d10bb3b..6e8d2a72 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/text/zoom-hixie-mixed-008-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/text/zoom-hixie-mixed-008-expected.txt
@@ -15,6 +15,3 @@ LayoutText {#text} at (114,0) size 172x83 text run at (114,0) width 172: "TEST" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/text/zoom-hixie-rendering-model-004-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/text/zoom-hixie-rendering-model-004-expected.txt index 65ccf6f..418efbe 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/text/zoom-hixie-rendering-model-004-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/text/zoom-hixie-rendering-model-004-expected.txt
@@ -11,6 +11,3 @@ LayoutSVGRoot {svg} at (0,0) size 100x100 LayoutSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#000080]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt index 1c60b5d..75143c8 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt
@@ -11,7 +11,6 @@ text run at (489,229) width 4: " " LayoutBlockFlow {DIV} at (513,21) size 202x202 [border: (1px solid #000000)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (30,500) size 317x90 LayoutBlockFlow (positioned) {DIV} at (30,500) size 317.33x90 LayoutInline {SPAN} at (0,0) size 318x18 [color=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt index 8b0d2a0..85046156 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (0,0) size 785x600 [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (21,21) size 402x402 [border: (1px solid #000000)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (42,42) size 340x340 LayoutBlockFlow {DIV} at (21,21) size 340x340 [bgcolor=#DDDDDD] [border: (1px solid #000000)] layer at (63,63) size 300x300
diff --git a/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt index 06f14e0..e3f8c2e 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt
@@ -15,7 +15,6 @@ text run at (243,475) width 4: " " LayoutBlockFlow {DIV} at (267,267) size 202x202 [border: (1px solid #000000)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (30,500) size 341x162 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600 LayoutBlockFlow (positioned) {DIV} at (30,500) size 341.33x162 LayoutInline {SPAN} at (0,0) size 302x18 [color=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/transforms/bounding-rect-zoom-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/transforms/bounding-rect-zoom-expected.txt index 9962e64..6ccc680e 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/transforms/bounding-rect-zoom-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/transforms/bounding-rect-zoom-expected.txt
@@ -15,15 +15,9 @@ LayoutTableCell {TD} at (1,1) size 181x17 [r=0 c=0 rs=1 cs=1] LayoutText {#text} at (0,0) size 150x17 text run at (0,0) width 150: "getClientBoundingRect():" - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutTableCell {TD} at (183,1) size 601x17 [r=0 c=1 rs=1 cs=1] LayoutText {#text} at (0,0) size 99x17 text run at (0,0) width 99: "getClientRects():" - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (90,90) size 90x90 LayoutBlockFlow (positioned) {DIV} at (90,90) size 90x90 [bgcolor=#FF0000] layer at (90,90) size 90x90
diff --git a/third_party/WebKit/LayoutTests/platform/mac/transforms/identity-matrix-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/transforms/identity-matrix-expected.txt index 1f04ddf..b19c1c62 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/transforms/identity-matrix-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/transforms/identity-matrix-expected.txt
@@ -7,7 +7,5 @@ text run at (0,0) width 256: "The following divs should be identical: " LayoutBR {BR} at (0,0) size 0x0 LayoutBlockFlow (floating) {DIV} at (5,23) size 110x110 [bgcolor=#87CEEB] [border: (5px solid #000000)] - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (133,31) size 110x110 LayoutBlockFlow (floating) {DIV} at (125,23) size 110x110 [bgcolor=#87CEEB] [border: (5px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/compositing/geometry/clipping-foreground-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/compositing/geometry/clipping-foreground-expected.txt new file mode 100644 index 0000000..6b2679d --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/compositing/geometry/clipping-foreground-expected.txt
@@ -0,0 +1,52 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x18 + LayoutText {#text} at (0,0) size 442x18 + text run at (0,0) width 442: "The layering of the boxes should not be affected by overflow:hidden." + LayoutBlockFlow (anonymous) at (0,34) size 784x479 + LayoutText {#text} at (320,306) size 4x18 + text run at (320,306) width 4: " " + LayoutText {#text} at (0,0) size 0x0 +layer at (68,261) size 200x200 layerType: background only +layer at (28,221) size 150x150 + LayoutBlockFlow (positioned) zI: -1 {DIV} at (-40,-40) size 150x150 [color=#808080] [bgcolor=#C86464] [border: (2px solid #000000)] + LayoutText zI: -1 {#text} at (22,22) size 108x40 + text run at (22,22) width 108: "Behind" +layer at (50,303) size 100x100 + LayoutBlockFlow (positioned) {DIV} at (22,82) size 100x100 [bgcolor=#008000] [border: (2px solid #000000)] + LayoutText {#text} at (22,22) size 54x40 + text run at (22,22) width 54: "Behind" + text run at (22,42) width 52: "behind" +layer at (68,261) size 200x200 layerType: foreground only + LayoutBlockFlow (relative positioned) {DIV} at (60,219) size 200x200 [color=#0000FF] [bgcolor=#FFFFFFCC] [border: (10px solid #000000)] + LayoutText {#text} at (30,30) size 126x80 + text run at (30,30) width 59: "Box" + text run at (30,70) width 126: "contents" +layer at (158,351) size 150x150 + LayoutBlockFlow (positioned) zI: 1 {DIV} at (90,90) size 150x150 [color=#808080] [bgcolor=#C8C880] [border: (2px solid #000000)] + LayoutText zI: 1 {#text} at (22,22) size 86x80 + text run at (22,22) width 34: "In" + text run at (22,62) width 86: "Front" +layer at (392,102) size 200x200 clip at (402,112) size 180x180 scrollWidth 230 scrollHeight 230 layerType: background only +layer at (352,62) size 150x150 backgroundClip at (402,112) size 180x180 clip at (402,112) size 180x180 + LayoutBlockFlow (positioned) zI: -1 {DIV} at (-40,-40) size 150x150 [color=#808080] [bgcolor=#C86464] [border: (2px solid #000000)] + LayoutText zI: -1 {#text} at (22,22) size 108x40 + text run at (22,22) width 108: "Behind" +layer at (374,144) size 100x100 backgroundClip at (402,112) size 180x180 clip at (402,112) size 180x180 + LayoutBlockFlow (positioned) {DIV} at (22,82) size 100x100 [bgcolor=#008000] [border: (2px solid #000000)] + LayoutText {#text} at (22,22) size 54x40 + text run at (22,22) width 54: "Behind" + text run at (22,42) width 52: "behind" +layer at (392,102) size 200x200 clip at (402,112) size 180x180 scrollWidth 230 scrollHeight 230 layerType: foreground only + LayoutBlockFlow (relative positioned) {DIV} at (384,60) size 200x200 [color=#0000FF] [bgcolor=#FFFFFFCC] [border: (10px solid #000000)] + LayoutText {#text} at (30,30) size 126x80 + text run at (30,30) width 59: "Box" + text run at (30,70) width 126: "contents" +layer at (482,192) size 150x150 backgroundClip at (402,112) size 180x180 clip at (402,112) size 180x180 + LayoutBlockFlow (positioned) zI: 1 {DIV} at (90,90) size 150x150 [color=#808080] [bgcolor=#C8C880] [border: (2px solid #000000)] + LayoutText zI: 1 {#text} at (22,22) size 86x80 + text run at (22,22) width 34: "In" + text run at (22,62) width 86: "Front"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/compositing/iframes/composited-iframe-alignment-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/compositing/iframes/composited-iframe-alignment-expected.txt new file mode 100644 index 0000000..95dd0d19 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/compositing/iframes/composited-iframe-alignment-expected.txt
@@ -0,0 +1,21 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x70 + LayoutBlockFlow {HTML} at (0,0) size 800x70 + LayoutBlockFlow {BODY} at (8,8) size 784x54 + LayoutText {#text} at (0,0) size 783x36 + text run at (0,0) width 605: "Simple test of composited iframe content. There should be a blue box with a gray background " + text run at (604,0) width 179: "inside the black border. The" + text run at (0,18) width 391: "gray background should fit perfectly within the block border " + text run at (390,18) width 91: "with no gaps. " + LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (0,36) size 0x18 +layer at (100,100) size 440x340 + LayoutIFrame (positioned) {IFRAME} at (100,100) size 440x340 [border: (20px solid #000000)] + layer at (0,0) size 400x300 + LayoutView at (0,0) size 400x300 + layer at (0,0) size 400x230 + LayoutBlockFlow {HTML} at (0,0) size 400x230 + LayoutBlockFlow {BODY} at (8,10) size 384x210 [bgcolor=#C0C0C0] + layer at (18,10) size 210x210 + LayoutBlockFlow {DIV} at (10,0) size 210x210 [bgcolor=#0000FF]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/compositing/overflow/clip-parent-reset-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/compositing/overflow/clip-parent-reset-expected.txt new file mode 100644 index 0000000..d55ca74 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/compositing/overflow/clip-parent-reset-expected.txt
@@ -0,0 +1,14 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x184 + LayoutBlockFlow {HTML} at (0,0) size 800x184 + LayoutBlockFlow {BODY} at (8,8) size 784x168 + LayoutBlockFlow (anonymous) at (0,150) size 784x18 + LayoutText {#text} at (0,0) size 639x18 + text run at (0,0) width 639: "This test verifies the clip parent of a layer gets correctly reset when it gained a non-composited clip." +layer at (8,8) size 150x150 transparent + LayoutBlockFlow {DIV} at (0,0) size 150x150 [bgcolor=#FF0000] +layer at (8,8) size 100x100 scrollWidth 200 scrollHeight 200 + LayoutBlockFlow {DIV} at (0,0) size 100x100 +layer at (8,8) size 200x200 backgroundClip at (8,8) size 100x100 clip at (8,8) size 100x100 + LayoutBlockFlow {DIV} at (0,0) size 200x200 [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/compositing/video-frame-size-change-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/compositing/video-frame-size-change-expected.txt new file mode 100644 index 0000000..db2f0421 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/compositing/video-frame-size-change-expected.txt
@@ -0,0 +1,26 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x242 + LayoutBlockFlow {HTML} at (0,0) size 800x242 + LayoutBlockFlow {BODY} at (8,16) size 784x218 + LayoutBlockFlow {P} at (0,0) size 784x18 + LayoutText {#text} at (0,0) size 493x18 + text run at (0,0) width 493: "Tests decoding and rendering a video element that has a changing resolution." + LayoutBlockFlow (anonymous) at (0,34) size 784x184 + LayoutText {#text} at (320,166) size 4x18 + text run at (320,166) width 4: " " + LayoutText {#text} at (0,0) size 0x0 +layer at (8,50) size 320x180 + LayoutVideo {VIDEO} at (0,0) size 320x180 +layer at (332,50) size 320x180 + LayoutVideo {VIDEO} at (324,0) size 320x180 +layer at (8,50) size 320x180 + LayoutFlexibleBox (relative positioned) {DIV} at (0,0) size 320x180 + LayoutBlockFlow {DIV} at (0,148) size 320x32 +layer at (8,50) size 320x138 + LayoutFlexibleBox (relative positioned) {DIV} at (0,0) size 320x138 +layer at (332,50) size 320x180 + LayoutFlexibleBox (relative positioned) {DIV} at (0,0) size 320x180 + LayoutBlockFlow {DIV} at (0,148) size 320x32 +layer at (332,50) size 320x138 + LayoutFlexibleBox (relative positioned) {DIV} at (0,0) size 320x138
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt new file mode 100644 index 0000000..e636f6a --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt
@@ -0,0 +1,12 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x260 + LayoutBlockFlow {HTML} at (0,0) size 800x260 + LayoutBlockFlow {BODY} at (8,8) size 784x244 + LayoutText {#text} at (240,226) size 4x18 + text run at (240,226) width 4: " " + LayoutText {#text} at (0,0) size 0x0 +layer at (28,28) size 200x200 + LayoutHTMLCanvas {CANVAS} at (20,20) size 200x200 [bgcolor=#00008000] +layer at (272,28) size 200x200 + LayoutHTMLCanvas {CANVAS} at (264,20) size 200x200 [bgcolor=#00008000]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/block-selection-gap-stale-cache-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/block-selection-gap-stale-cache-expected.txt new file mode 100644 index 0000000..6e335035 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/block-selection-gap-stale-cache-expected.txt
@@ -0,0 +1,11 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {DIV} at (0,0) size 784x100 + LayoutBlockFlow {DIV} at (0,0) size 100x100 + LayoutBR {BR} at (100,100) size 0x0 + LayoutBlockFlow (anonymous) at (0,100) size 784x18 + LayoutText {#text} at (0,0) size 4x18 + text run at (0,0) width 4: " "
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt index d5614f6..3ed5b0bd 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt
@@ -106,10 +106,6 @@ { "object": "LayoutText #text", "reason": "geometry" - }, - { - "object": "LayoutText #text", - "reason": "geometry" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/details-open-repaint-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/details-open-repaint-expected.txt index 453a2637..7a1cade 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/details-open-repaint-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/details-open-repaint-expected.txt
@@ -61,10 +61,6 @@ { "object": "LayoutText #text", "reason": "appeared" - }, - { - "object": "LayoutText #text", - "reason": "appeared" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt new file mode 100644 index 0000000..aa99299 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt
@@ -0,0 +1,15 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {DIV} at (0,0) size 784x19 + LayoutTextControl {INPUT} at (0,0) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] + LayoutText {#text} at (0,0) size 0x0 + LayoutBlockFlow (anonymous) at (0,19) size 784x18 + LayoutText {#text} at (0,0) size 4x18 + text run at (0,0) width 4: " " + LayoutBlockFlow {DIV} at (0,37) size 784x0 +layer at (11,11) size 125x13 + LayoutBlockFlow {DIV} at (3,3) size 125x13 +caret: position 0 of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of child 1 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/repaint-svg-after-style-change-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/repaint-svg-after-style-change-expected.txt new file mode 100644 index 0000000..633dffb --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/repaint-svg-after-style-change-expected.txt
@@ -0,0 +1,10 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x221 + LayoutBlockFlow {HTML} at (0,0) size 800x221 + LayoutBlockFlow {BODY} at (8,8) size 784x205 + LayoutSVGRoot {svg} at (0,0) size 201x201 + LayoutSVGContainer {g} at (0,0) size 200x200 + LayoutSVGPath {path} at (0,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [data="M 0 0 L 0 200 L 200 200 L 200 0 Z"] + LayoutSVGPath {path} at (0,0) size 200x200 [fill={[type=SOLID] [color=#008000]}] [data="M 0 0 L 0 200 L 200 200 L 200 0 Z"] + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/text-in-relative-positioned-inline-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/text-in-relative-positioned-inline-expected.txt index 803a993..a9312aa 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/text-in-relative-positioned-inline-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/text-in-relative-positioned-inline-expected.txt
@@ -9,7 +9,7 @@ { "object": "LayoutBlockFlow DIV", "rect": [108, 8, 684, 100], - "reason": "geometry" + "reason": "style change" }, { "object": "LayoutText #text", @@ -34,8 +34,12 @@ "reason": "disappeared" }, { + "object": "LayoutText #text", + "reason": "disappeared" + }, + { "object": "LayoutBlockFlow DIV", - "reason": "geometry" + "reason": "style change" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/selection/text-selection-inline-block-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/selection/text-selection-inline-block-expected.txt index ac955b91..0b7003a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/selection/text-selection-inline-block-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/selection/text-selection-inline-block-expected.txt
@@ -8,6 +8,5 @@ text run at (0,0) width 24: "x" LayoutText {#text} at (24,0) size 24x55 text run at (24,0) width 24: "y" - LayoutText {#text} at (0,0) size 0x0 selection start: position 0 of child 0 {#text} of child 0 {DIV} of body selection end: position 1 of child 1 {#text} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt new file mode 100644 index 0000000..cffbb62 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt
@@ -0,0 +1,16 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x145 + LayoutBlockFlow {HTML} at (0,0) size 800x145 + LayoutBlockFlow {BODY} at (8,16) size 784x121 + LayoutBlockFlow {P} at (0,0) size 784x18 + LayoutText {#text} at (0,0) size 348x18 + text run at (0,0) width 348: "Passes if there are no overpainted selection highlights." + LayoutBlockFlow (anonymous) at (0,34) size 784x87 + LayoutInline {SPAN} at (0,0) size 189x74 + LayoutText {#text} at (0,3) size 189x74 + text run at (0,3) width 96: "text" + text run at (95,3) width 94 RTL: "\x{645}\x{62A}\x{646}:" + LayoutText {#text} at (0,0) size 0x0 +selection start: position 5 of child 0 {#text} of child 2 {SPAN} of body +selection end: position 13 of child 0 {#text} of child 2 {SPAN} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-connecting-line-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-connecting-line-expected.txt new file mode 100644 index 0000000..0dec203 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-connecting-line-expected.txt
@@ -0,0 +1,8 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x320 + LayoutBlockFlow {HTML} at (0,0) size 800x320 + LayoutBlockFlow {BODY} at (8,8) size 784x304 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,8) size 300x300 + LayoutHTMLCanvas {CANVAS} at (0,0) size 300x300
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/display_list_2d_canvas/fast/canvas/canvas-shadow-source-in-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/display_list_2d_canvas/fast/canvas/canvas-shadow-source-in-expected.txt index 74c840a..7b9924a3 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/display_list_2d_canvas/fast/canvas/canvas-shadow-source-in-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/display_list_2d_canvas/fast/canvas/canvas-shadow-source-in-expected.txt
@@ -13,8 +13,6 @@ text run at (0,0) width 71: "Test Image" LayoutBlockFlow (anonymous) at (0,242) size 784x206 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,26) size 202x202 LayoutHTMLCanvas {CANVAS} at (0,0) size 202x202 [border: (1px solid #999999)] layer at (8,250) size 202x202
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-circle-focus-ring-expected.txt new file mode 100644 index 0000000..33ea9f0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-circle-focus-ring-expected.txt
@@ -0,0 +1,17 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x36 + LayoutText {#text} at (0,0) size 779x36 + text run at (0,0) width 779: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,18) width 772: "shape=\"circle\">. This test PASSED if a circular-shaped focus ring is drawn around the <area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,52) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-focus-ring-in-positioned-container-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-focus-ring-in-positioned-container-expected.txt new file mode 100644 index 0000000..2eb3a50 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-focus-ring-in-positioned-container-expected.txt
@@ -0,0 +1,16 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x34 + LayoutBlockFlow {HTML} at (0,0) size 800x34 + LayoutBlockFlow {BODY} at (8,8) size 784x18 + LayoutText {#text} at (0,0) size 564x18 + text run at (0,0) width 564: "Tests that we paint area outline properly when the image is inside positioned containers." +layer at (20,50) size 0x0 + LayoutBlockFlow (positioned) {DIV} at (20,50) size 0x0 +layer at (30,60) size 50x54 + LayoutBlockFlow (positioned) {DIV} at (10,10) size 50x54 + LayoutImage {IMG} at (0,0) size 50x50 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-focus-ring-with-paint-root-offset-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-focus-ring-with-paint-root-offset-expected.txt new file mode 100644 index 0000000..af52d98 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-focus-ring-with-paint-root-offset-expected.txt
@@ -0,0 +1,14 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x34 + LayoutBlockFlow {HTML} at (0,0) size 800x34 + LayoutBlockFlow {BODY} at (8,8) size 784x18 + LayoutText {#text} at (0,0) size 447x18 + text run at (0,0) width 447: "Tests that we paint area outline properly when the paintroot is shifted." +layer at (5,50) size 50x54 + LayoutBlockFlow (positioned) {DIV} at (5,50) size 50x54 + LayoutImage {IMG} at (0,0) size 50x50 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-focus-ring-with-scale-transform-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-focus-ring-with-scale-transform-expected.txt new file mode 100644 index 0000000..0342978 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-focus-ring-with-scale-transform-expected.txt
@@ -0,0 +1,14 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x34 + LayoutBlockFlow {HTML} at (0,0) size 800x34 + LayoutBlockFlow {BODY} at (8,8) size 784x18 + LayoutText {#text} at (0,0) size 498x18 + text run at (0,0) width 498: "Tests that we paint area outline properly when the image's container is scaled." +layer at (100,100) size 100x100 + LayoutBlockFlow (positioned) {DIV} at (100,100) size 100x100 + LayoutImage {IMG} at (0,0) size 50x50 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-overflowing-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-overflowing-circle-focus-ring-expected.txt new file mode 100644 index 0000000..f81d1c78 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-overflowing-circle-focus-ring-expected.txt
@@ -0,0 +1,18 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x54 + LayoutText {#text} at (0,0) size 779x54 + text run at (0,0) width 779: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,18) width 756: "shape=\"circle\"> that overflows the img element. This test PASSED if a half-circule-shaped focus ring is drawn for the" + text run at (0,36) width 214: "<area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,70) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-overflowing-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-overflowing-polygon-focus-ring-expected.txt new file mode 100644 index 0000000..0ef44758 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-overflowing-polygon-focus-ring-expected.txt
@@ -0,0 +1,18 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x54 + LayoutText {#text} at (0,0) size 779x54 + text run at (0,0) width 779: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,18) width 764: "shape=\"polygon\"> that is overflowing the bounds for the img element. This test PASSED if a clipped star-shaped focus" + text run at (0,36) width 374: "ring is drawn around the <area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,70) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-polygon-focus-ring-expected.txt new file mode 100644 index 0000000..6f3cb4f --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/imagemap-polygon-focus-ring-expected.txt
@@ -0,0 +1,17 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x36 + LayoutText {#text} at (0,0) size 779x36 + text run at (0,0) width 779: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,18) width 773: "shape=\"polygon\">. This test PASSED if a cross-shaped focus ring is drawn around the <area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,52) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-circle-focus-ring-expected.txt new file mode 100644 index 0000000..33ea9f0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-circle-focus-ring-expected.txt
@@ -0,0 +1,17 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x36 + LayoutText {#text} at (0,0) size 779x36 + text run at (0,0) width 779: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,18) width 772: "shape=\"circle\">. This test PASSED if a circular-shaped focus ring is drawn around the <area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,52) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-focus-ring-in-positioned-container-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-focus-ring-in-positioned-container-expected.txt index 3ba5197..2eb3a50 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-focus-ring-in-positioned-container-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-focus-ring-in-positioned-container-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x18 LayoutText {#text} at (0,0) size 564x18 text run at (0,0) width 564: "Tests that we paint area outline properly when the image is inside positioned containers." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (20,50) size 0x0 LayoutBlockFlow (positioned) {DIV} at (20,50) size 0x0 layer at (30,60) size 50x54
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-focus-ring-with-paint-root-offset-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-focus-ring-with-paint-root-offset-expected.txt index 0839108..af52d98 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-focus-ring-with-paint-root-offset-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-focus-ring-with-paint-root-offset-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x18 LayoutText {#text} at (0,0) size 447x18 text run at (0,0) width 447: "Tests that we paint area outline properly when the paintroot is shifted." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (5,50) size 50x54 LayoutBlockFlow (positioned) {DIV} at (5,50) size 50x54 LayoutImage {IMG} at (0,0) size 50x50
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-focus-ring-with-scale-transform-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-focus-ring-with-scale-transform-expected.txt index ef870b0..0342978 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-focus-ring-with-scale-transform-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-focus-ring-with-scale-transform-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x18 LayoutText {#text} at (0,0) size 498x18 text run at (0,0) width 498: "Tests that we paint area outline properly when the image's container is scaled." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (100,100) size 100x100 LayoutBlockFlow (positioned) {DIV} at (100,100) size 100x100 LayoutImage {IMG} at (0,0) size 50x50
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-overflowing-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-overflowing-circle-focus-ring-expected.txt new file mode 100644 index 0000000..f81d1c78 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-overflowing-circle-focus-ring-expected.txt
@@ -0,0 +1,18 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x54 + LayoutText {#text} at (0,0) size 779x54 + text run at (0,0) width 779: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,18) width 756: "shape=\"circle\"> that overflows the img element. This test PASSED if a half-circule-shaped focus ring is drawn for the" + text run at (0,36) width 214: "<area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,70) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-overflowing-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-overflowing-polygon-focus-ring-expected.txt new file mode 100644 index 0000000..0ef44758 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-overflowing-polygon-focus-ring-expected.txt
@@ -0,0 +1,18 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x54 + LayoutText {#text} at (0,0) size 779x54 + text run at (0,0) width 779: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,18) width 764: "shape=\"polygon\"> that is overflowing the bounds for the img element. This test PASSED if a clipped star-shaped focus" + text run at (0,36) width 374: "ring is drawn around the <area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,70) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-polygon-focus-ring-expected.txt new file mode 100644 index 0000000..6f3cb4f --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/imagemap-polygon-focus-ring-expected.txt
@@ -0,0 +1,17 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x36 + LayoutText {#text} at (0,0) size 779x36 + text run at (0,0) width 779: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,18) width 773: "shape=\"polygon\">. This test PASSED if a cross-shaped focus ring is drawn around the <area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,52) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/canvas-ellipse-connecting-line-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/canvas-ellipse-connecting-line-expected.txt new file mode 100644 index 0000000..0dec203 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/canvas-ellipse-connecting-line-expected.txt
@@ -0,0 +1,8 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x320 + LayoutBlockFlow {HTML} at (0,0) size 800x320 + LayoutBlockFlow {BODY} at (8,8) size 784x304 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,8) size 300x300 + LayoutHTMLCanvas {CANVAS} at (0,0) size 300x300
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/canvas-shadow-source-in-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/canvas-shadow-source-in-expected.txt index 74c840a..7b9924a3 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/canvas-shadow-source-in-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/canvas-shadow-source-in-expected.txt
@@ -13,8 +13,6 @@ text run at (0,0) width 71: "Test Image" LayoutBlockFlow (anonymous) at (0,242) size 784x206 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,26) size 202x202 LayoutHTMLCanvas {CANVAS} at (0,0) size 202x202 [border: (1px solid #999999)] layer at (8,250) size 202x202
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/css1/classification/display-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/css1/classification/display-expected.txt index b483dc3..8a2b75f 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/css1/classification/display-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/css1/classification/display-expected.txt
@@ -56,7 +56,6 @@ LayoutBlockFlow {P} at (0,348) size 769x18 LayoutText {#text} at (0,0) size 252x18 text run at (0,0) width 252: "There should be no text after the colon:" - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,382) size 769x54 LayoutBlockFlow (anonymous) at (0,0) size 769x18 LayoutText {#text} at (0,0) size 116x18 @@ -117,7 +116,6 @@ LayoutBlockFlow {P} at (4,212) size 747x18 LayoutText {#text} at (0,0) size 252x18 text run at (0,0) width 252: "There should be no text after the colon:" - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (4,246) size 747x54 LayoutBlockFlow (anonymous) at (0,0) size 747x18 LayoutText {#text} at (0,0) size 116x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/misc/location-replace-crossdomain-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/misc/location-replace-crossdomain-expected.txt new file mode 100644 index 0000000..d20b4ab5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/misc/location-replace-crossdomain-expected.txt
@@ -0,0 +1,15 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,8) size 304x154 + LayoutIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #EEEEEE)] + layer at (0,0) size 300x150 + LayoutView at (0,0) size 300x150 + layer at (0,0) size 300x150 + LayoutBlockFlow {HTML} at (0,0) size 300x150 + LayoutBlockFlow {BODY} at (8,8) size 284x134 + LayoutText {#text} at (0,0) size 70x18 + text run at (0,0) width 70: "SUCCESS"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt new file mode 100644 index 0000000..0cca0f09 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt
@@ -0,0 +1,66 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x464 + LayoutBlockFlow {HTML} at (0,0) size 800x463.50 + LayoutBlockFlow {BODY} at (4,4) size 136x451 [border: (0.50px dashed #C0C0C0)] + LayoutBlockFlow {P} at (0.50,9.50) size 135x27 + LayoutText {#text} at (0,-1) size 131x28 + text run at (0,-1) width 125: "The following six blue boxes must" + text run at (0,8) width 131: "be of the same width. There must be" + text run at (0,17) width 25: "no red." + LayoutBlockFlow {P} at (9.50,45.50) size 117x27 [bgcolor=#008000] [border: (9px solid #0000FF)] + LayoutText {#text} at (9,8) size 3x10 + text run at (9,8) width 3: " " + LayoutBlockFlow {P} at (0.50,126.50) size 135x9 + LayoutText {#text} at (0,-1) size 14x10 + text run at (0,-1) width 14: " " + LayoutBlockFlow {P} at (0.50,189.50) size 135x9 + LayoutTable (anonymous) at (0.50,252.50) size 135x45 + LayoutTableSection (anonymous) at (0,0) size 135x45 + LayoutTableRow (anonymous) at (0,0) size 135x45 + LayoutTableCell {P} at (0,0) size 135x45 [r=0 c=0 rs=1 cs=1] + LayoutTable {TABLE} at (0.50,351.50) size 135x45 + LayoutTableSection {TBODY} at (0,0) size 135x45 + LayoutTableRow {TR} at (0,0) size 135x45 + LayoutTableCell {TD} at (0,0) size 135x45 [r=0 c=0 rs=1 cs=1] + LayoutBlockFlow (floating) {P} at (0.50,450.50) size 135x9 +layer at (14,131) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,194) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,257) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,356) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,455) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/misc/slow-loading-image-in-pattern-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/misc/slow-loading-image-in-pattern-expected.txt new file mode 100644 index 0000000..d01cd23 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/misc/slow-loading-image-in-pattern-expected.txt
@@ -0,0 +1,16 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x52 + LayoutBlockFlow {HTML} at (0,0) size 800x52 + LayoutBlockFlow {BODY} at (8,8) size 784x36 + LayoutText {#text} at (0,0) size 640x18 + text run at (0,0) width 640: "This tests slow loading png images referenced from a image element inside a SVG pattern resource." + LayoutBR {BR} at (639,0) size 1x18 + LayoutText {#text} at (0,18) size 572x18 + text run at (0,18) width 572: "You should see a 400x300 rect containing a tiled rendering of the Acid3 reference image." +layer at (10,50) size 406x306 clip at (13,53) size 400x300 + LayoutSVGRoot (positioned) {svg} at (10,50) size 406x306 + LayoutSVGHiddenContainer {defs} at (0,0) size 0x0 + LayoutSVGResourcePattern {pattern} [id="pattern"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse] + LayoutSVGImage {image} at (0,0) size 800x600 + LayoutSVGRect {rect} at (0,0) size 400x300 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=0.00] [width=400.00] [height=300.00]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/off-main-thread-fetch/http/tests/misc/location-replace-crossdomain-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/off-main-thread-fetch/http/tests/misc/location-replace-crossdomain-expected.txt new file mode 100644 index 0000000..d20b4ab5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/off-main-thread-fetch/http/tests/misc/location-replace-crossdomain-expected.txt
@@ -0,0 +1,15 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,8) size 304x154 + LayoutIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #EEEEEE)] + layer at (0,0) size 300x150 + LayoutView at (0,0) size 300x150 + layer at (0,0) size 300x150 + LayoutBlockFlow {HTML} at (0,0) size 300x150 + LayoutBlockFlow {BODY} at (8,8) size 284x134 + LayoutText {#text} at (0,0) size 70x18 + text run at (0,0) width 70: "SUCCESS"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/off-main-thread-fetch/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/off-main-thread-fetch/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt new file mode 100644 index 0000000..0cca0f09 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/off-main-thread-fetch/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt
@@ -0,0 +1,66 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x464 + LayoutBlockFlow {HTML} at (0,0) size 800x463.50 + LayoutBlockFlow {BODY} at (4,4) size 136x451 [border: (0.50px dashed #C0C0C0)] + LayoutBlockFlow {P} at (0.50,9.50) size 135x27 + LayoutText {#text} at (0,-1) size 131x28 + text run at (0,-1) width 125: "The following six blue boxes must" + text run at (0,8) width 131: "be of the same width. There must be" + text run at (0,17) width 25: "no red." + LayoutBlockFlow {P} at (9.50,45.50) size 117x27 [bgcolor=#008000] [border: (9px solid #0000FF)] + LayoutText {#text} at (9,8) size 3x10 + text run at (9,8) width 3: " " + LayoutBlockFlow {P} at (0.50,126.50) size 135x9 + LayoutText {#text} at (0,-1) size 14x10 + text run at (0,-1) width 14: " " + LayoutBlockFlow {P} at (0.50,189.50) size 135x9 + LayoutTable (anonymous) at (0.50,252.50) size 135x45 + LayoutTableSection (anonymous) at (0,0) size 135x45 + LayoutTableRow (anonymous) at (0,0) size 135x45 + LayoutTableCell {P} at (0,0) size 135x45 [r=0 c=0 rs=1 cs=1] + LayoutTable {TABLE} at (0.50,351.50) size 135x45 + LayoutTableSection {TBODY} at (0,0) size 135x45 + LayoutTableRow {TR} at (0,0) size 135x45 + LayoutTableCell {TD} at (0,0) size 135x45 [r=0 c=0 rs=1 cs=1] + LayoutBlockFlow (floating) {P} at (0.50,450.50) size 135x9 +layer at (14,131) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,194) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,257) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,356) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,455) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/off-main-thread-fetch/http/tests/misc/slow-loading-image-in-pattern-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/off-main-thread-fetch/http/tests/misc/slow-loading-image-in-pattern-expected.txt new file mode 100644 index 0000000..d01cd23 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/off-main-thread-fetch/http/tests/misc/slow-loading-image-in-pattern-expected.txt
@@ -0,0 +1,16 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x52 + LayoutBlockFlow {HTML} at (0,0) size 800x52 + LayoutBlockFlow {BODY} at (8,8) size 784x36 + LayoutText {#text} at (0,0) size 640x18 + text run at (0,0) width 640: "This tests slow loading png images referenced from a image element inside a SVG pattern resource." + LayoutBR {BR} at (639,0) size 1x18 + LayoutText {#text} at (0,18) size 572x18 + text run at (0,18) width 572: "You should see a 400x300 rect containing a tiled rendering of the Acid3 reference image." +layer at (10,50) size 406x306 clip at (13,53) size 400x300 + LayoutSVGRoot (positioned) {svg} at (10,50) size 406x306 + LayoutSVGHiddenContainer {defs} at (0,0) size 0x0 + LayoutSVGResourcePattern {pattern} [id="pattern"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse] + LayoutSVGImage {image} at (0,0) size 800x600 + LayoutSVGRect {rect} at (0,0) size 400x300 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=0.00] [width=400.00] [height=300.00]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-parent-reset-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-parent-reset-expected.txt index bb9be8e..d55ca74 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-parent-reset-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-parent-reset-expected.txt
@@ -6,8 +6,6 @@ LayoutBlockFlow (anonymous) at (0,150) size 784x18 LayoutText {#text} at (0,0) size 639x18 text run at (0,0) width 639: "This test verifies the clip parent of a layer gets correctly reset when it gained a non-composited clip." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 150x150 transparent LayoutBlockFlow {DIV} at (0,0) size 150x150 [bgcolor=#FF0000] layer at (8,8) size 100x100 scrollWidth 200 scrollHeight 200
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt index 84177152..81844b5 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt
@@ -2774,6 +2774,7 @@ getter event getter htmlFor getter integrity + getter noModule getter src getter text getter type @@ -2785,6 +2786,7 @@ setter event setter htmlFor setter integrity + setter noModule setter src setter text setter type
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/animations/rotate-transform-equivalent-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/animations/rotate-transform-equivalent-expected.txt index 2e1c9e15..a54c456 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/animations/rotate-transform-equivalent-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/animations/rotate-transform-equivalent-expected.txt
@@ -5,10 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 199x18 text run at (0,0) width 199: "There should be no red visible." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,26) size 106x106 LayoutBlockFlow (positioned) {DIV} at (8,26) size 106x106 [color=#FF0000] [border: (3px solid #FF0000)] LayoutText {#text} at (3,3) size 56x115
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt index 01dba85..e636f6a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt
@@ -6,7 +6,6 @@ LayoutText {#text} at (240,226) size 4x18 text run at (240,226) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (28,28) size 200x200 LayoutHTMLCanvas {CANVAS} at (20,20) size 200x200 [bgcolor=#00008000] layer at (272,28) size 200x200
diff --git a/third_party/WebKit/LayoutTests/platform/win/animations/rotate-transform-equivalent-expected.txt b/third_party/WebKit/LayoutTests/platform/win/animations/rotate-transform-equivalent-expected.txt index 9719df2..7fa14b7f 100644 --- a/third_party/WebKit/LayoutTests/platform/win/animations/rotate-transform-equivalent-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/animations/rotate-transform-equivalent-expected.txt
@@ -5,10 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 185x19 text run at (0,0) width 185: "There should be no red visible." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 106x106 LayoutBlockFlow (positioned) {DIV} at (8,28) size 106x106 [color=#FF0000] [border: (3px solid #FF0000)] LayoutText {#text} at (3,5) size 55x114
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/geometry/clipping-foreground-expected.txt b/third_party/WebKit/LayoutTests/platform/win/compositing/geometry/clipping-foreground-expected.txt index bb270aa3..667ca01 100644 --- a/third_party/WebKit/LayoutTests/platform/win/compositing/geometry/clipping-foreground-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/compositing/geometry/clipping-foreground-expected.txt
@@ -15,7 +15,6 @@ LayoutBlockFlow (positioned) zI: -1 {DIV} at (-40,-40) size 150x150 [color=#808080] [bgcolor=#C86464] [border: (2px solid #000000)] LayoutText zI: -1 {#text} at (22,22) size 106x40 text run at (22,22) width 106: "Behind" - LayoutText zI: -1 {#text} at (0,0) size 0x0 layer at (50,303) size 100x100 LayoutBlockFlow (positioned) {DIV} at (22,82) size 100x100 [bgcolor=#008000] [border: (2px solid #000000)] LayoutText {#text} at (22,22) size 55x41 @@ -26,8 +25,6 @@ LayoutText {#text} at (30,30) size 126x81 text run at (30,30) width 60: "Box" text run at (30,71) width 126: "contents" - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (158,351) size 150x150 LayoutBlockFlow (positioned) zI: 1 {DIV} at (90,90) size 150x150 [color=#808080] [bgcolor=#C8C880] [border: (2px solid #000000)] LayoutText zI: 1 {#text} at (22,22) size 87x81 @@ -38,7 +35,6 @@ LayoutBlockFlow (positioned) zI: -1 {DIV} at (-40,-40) size 150x150 [color=#808080] [bgcolor=#C86464] [border: (2px solid #000000)] LayoutText zI: -1 {#text} at (22,22) size 106x40 text run at (22,22) width 106: "Behind" - LayoutText zI: -1 {#text} at (0,0) size 0x0 layer at (374,146) size 100x100 backgroundClip at (402,114) size 180x180 clip at (402,114) size 180x180 LayoutBlockFlow (positioned) {DIV} at (22,82) size 100x100 [bgcolor=#008000] [border: (2px solid #000000)] LayoutText {#text} at (22,22) size 55x41 @@ -49,8 +45,6 @@ LayoutText {#text} at (30,30) size 126x81 text run at (30,30) width 60: "Box" text run at (30,71) width 126: "contents" - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (482,194) size 150x150 backgroundClip at (402,114) size 180x180 clip at (402,114) size 180x180 LayoutBlockFlow (positioned) zI: 1 {DIV} at (90,90) size 150x150 [color=#808080] [bgcolor=#C8C880] [border: (2px solid #000000)] LayoutText zI: 1 {#text} at (22,22) size 87x81
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/iframes/composited-iframe-alignment-expected.txt b/third_party/WebKit/LayoutTests/platform/win/compositing/iframes/composited-iframe-alignment-expected.txt index 274ba72..00c4f95f 100644 --- a/third_party/WebKit/LayoutTests/platform/win/compositing/iframes/composited-iframe-alignment-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/compositing/iframes/composited-iframe-alignment-expected.txt
@@ -10,7 +10,6 @@ text run at (334,20) width 84: "with no gaps. " LayoutBR {BR} at (0,0) size 0x0 LayoutBR {BR} at (0,40) size 0x19 - LayoutText {#text} at (0,0) size 0x0 layer at (100,100) size 440x340 LayoutIFrame (positioned) {IFRAME} at (100,100) size 440x340 [border: (20px solid #000000)] layer at (0,0) size 400x300
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/clip-parent-reset-expected.txt b/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/clip-parent-reset-expected.txt index 5e57eba..408e517 100644 --- a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/clip-parent-reset-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/clip-parent-reset-expected.txt
@@ -6,8 +6,6 @@ LayoutBlockFlow (anonymous) at (0,150) size 784x20 LayoutText {#text} at (0,0) size 595x19 text run at (0,0) width 595: "This test verifies the clip parent of a layer gets correctly reset when it gained a non-composited clip." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 150x150 transparent LayoutBlockFlow {DIV} at (0,0) size 150x150 [bgcolor=#FF0000] layer at (8,8) size 100x100 scrollWidth 200 scrollHeight 200
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt b/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt deleted file mode 100644 index dded8e3..0000000 --- a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -PASS repainted when expected -FAIL did not repaint when expected -PASS repainted when expected -PASS did not repaint as expected -FAIL did not repaint when expected -
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/video-frame-size-change-expected.txt b/third_party/WebKit/LayoutTests/platform/win/compositing/video-frame-size-change-expected.txt index 6c0438e..8cda59d 100644 --- a/third_party/WebKit/LayoutTests/platform/win/compositing/video-frame-size-change-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/compositing/video-frame-size-change-expected.txt
@@ -10,7 +10,6 @@ LayoutText {#text} at (320,165) size 4x19 text run at (320,165) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,52) size 320x180 LayoutVideo {VIDEO} at (0,0) size 320x180 layer at (332,52) size 320x180
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt b/third_party/WebKit/LayoutTests/platform/win/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt index 04b8f1e..b4a2a21 100644 --- a/third_party/WebKit/LayoutTests/platform/win/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt
@@ -6,7 +6,6 @@ LayoutText {#text} at (240,225) size 4x19 text run at (240,225) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (28,28) size 200x200 LayoutHTMLCanvas {CANVAS} at (20,20) size 200x200 [bgcolor=#00008000] layer at (272,28) size 200x200
diff --git a/third_party/WebKit/LayoutTests/platform/win/css1/classification/display-expected.txt b/third_party/WebKit/LayoutTests/platform/win/css1/classification/display-expected.txt index de3e0b8..99331257 100644 --- a/third_party/WebKit/LayoutTests/platform/win/css1/classification/display-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/css1/classification/display-expected.txt
@@ -55,7 +55,6 @@ LayoutBlockFlow {P} at (0,371) size 769x20 LayoutText {#text} at (0,0) size 235x19 text run at (0,0) width 235: "There should be no text after the colon:" - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,407) size 769x60 LayoutBlockFlow (anonymous) at (0,0) size 769x20 LayoutText {#text} at (0,0) size 104x19 @@ -116,7 +115,6 @@ LayoutBlockFlow {P} at (4,228) size 747x20 LayoutText {#text} at (0,0) size 235x19 text run at (0,0) width 235: "There should be no text after the colon:" - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (4,264) size 747x60 LayoutBlockFlow (anonymous) at (0,0) size 747x20 LayoutText {#text} at (0,0) size 104x19
diff --git a/third_party/WebKit/LayoutTests/platform/win/css2.1/t090501-c414-flt-ln-03-d-expected.txt b/third_party/WebKit/LayoutTests/platform/win/css2.1/t090501-c414-flt-ln-03-d-expected.txt index a0d6b74..e89b3e5 100644 --- a/third_party/WebKit/LayoutTests/platform/win/css2.1/t090501-c414-flt-ln-03-d-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/css2.1/t090501-c414-flt-ln-03-d-expected.txt
@@ -23,7 +23,6 @@ LayoutBlockFlow (floating) {P} at (21,21) size 150x58 [color=#FFFFFF] [bgcolor=#008080] [border: (3px solid #00FFFF)] LayoutText {#text} at (19,19) size 44x19 text run at (19,19) width 44: "AAAA" - LayoutText {#text} at (0,0) size 0x0 LayoutInline {SPAN} at (0,0) size 16x25 [color=#FFFFFF] [bgcolor=#800080] [border: (3px solid #FF00FF)] LayoutText {#text} at (491,21) size 10x19 text run at (491,21) width 10: "B"
diff --git a/third_party/WebKit/LayoutTests/platform/win/css2.1/t1204-root-e-expected.txt b/third_party/WebKit/LayoutTests/platform/win/css2.1/t1204-root-e-expected.txt index 3671cdd..290417fb 100644 --- a/third_party/WebKit/LayoutTests/platform/win/css2.1/t1204-root-e-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/css2.1/t1204-root-e-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow (anonymous) at (0,0) size 800x0 LayoutInline {<pseudo:before>} at (0,0) size 0x0 LayoutTextFragment (anonymous) at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {BODY} at (8,16) size 784x76 LayoutBlockFlow {P} at (0,0) size 784x20 LayoutText {#text} at (0,0) size 199x19
diff --git a/third_party/WebKit/LayoutTests/platform/win/css2.1/t1205-c561-list-displ-00-b-expected.txt b/third_party/WebKit/LayoutTests/platform/win/css2.1/t1205-c561-list-displ-00-b-expected.txt index a4f876a..0f34c47 100644 --- a/third_party/WebKit/LayoutTests/platform/win/css2.1/t1205-c561-list-displ-00-b-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/css2.1/t1205-c561-list-displ-00-b-expected.txt
@@ -28,7 +28,6 @@ LayoutBlockFlow {DIV} at (0,116) size 784x20 [color=#000080] LayoutText {#text} at (0,0) size 156x19 text run at (0,0) width 156: "5. This should be line five." - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,136) size 784x60 [color=#000080] LayoutBlockFlow (anonymous) at (0,0) size 784x20 LayoutText {#text} at (0,0) size 151x19
diff --git a/third_party/WebKit/LayoutTests/platform/win/css3/filters/regions-expanding-expected.txt b/third_party/WebKit/LayoutTests/platform/win/css3/filters/regions-expanding-expected.txt index 7888b65..743ae56 100644 --- a/third_party/WebKit/LayoutTests/platform/win/css3/filters/regions-expanding-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/css3/filters/regions-expanding-expected.txt
@@ -5,11 +5,9 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (160,75) size 4x19 text run at (160,75) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (324,75) size 4x19 text run at (324,75) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 160x90 LayoutImage {IMG} at (0,0) size 160x90 layer at (172,8) size 160x90
diff --git a/third_party/WebKit/LayoutTests/platform/win/css3/selectors3/xhtml/css3-modsel-d3-expected.txt b/third_party/WebKit/LayoutTests/platform/win/css3/selectors3/xhtml/css3-modsel-d3-expected.txt index 59fb6020..89e16a5 100644 --- a/third_party/WebKit/LayoutTests/platform/win/css3/selectors3/xhtml/css3-modsel-d3-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/css3/selectors3/xhtml/css3-modsel-d3-expected.txt
@@ -10,11 +10,8 @@ LayoutBlockFlow (anonymous) at (0,36) size 784x0 LayoutInline {stub} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutInline {t} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutInline {t} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {t} at (0,36) size 784x32 [bgcolor=#00FF00]
diff --git a/third_party/WebKit/LayoutTests/platform/win/css3/selectors3/xml/css3-modsel-d3-expected.txt b/third_party/WebKit/LayoutTests/platform/win/css3/selectors3/xml/css3-modsel-d3-expected.txt index f86442d..b32f92e 100644 --- a/third_party/WebKit/LayoutTests/platform/win/css3/selectors3/xml/css3-modsel-d3-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/css3/selectors3/xml/css3-modsel-d3-expected.txt
@@ -9,11 +9,8 @@ LayoutBlockFlow (anonymous) at (0,36) size 800x0 LayoutInline {stub} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutInline {t} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutInline {t} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {t} at (0,36) size 800x32 [bgcolor=#00FF00]
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-001-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-001-expected.txt index 8305aa0..dce3da6 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-001-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-001-expected.txt
@@ -11,7 +11,6 @@ text run at (0,0) width 416: "The shape of the caret, and whether it flashes, are not part of the test." LayoutBlockFlow (anonymous) at (0,72) size 784x119 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,88) size 412x114 clip at (9,89) size 410x112 LayoutTextControl {TEXTAREA} at (0,0) size 412x114 [color=#FFFFFF] [bgcolor=#000000] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (11,11) size 390x46
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-003-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-003-expected.txt index 5420c1e5..06f123b 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-003-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-003-expected.txt
@@ -12,7 +12,6 @@ text run at (0,0) width 416: "The shape of the caret, and whether it flashes, are not part of the test." LayoutBlockFlow (anonymous) at (0,72) size 784x119 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,88) size 412x114 clip at (9,89) size 410x112 LayoutTextControl {TEXTAREA} at (0,0) size 412x114 [color=#00FF00] [bgcolor=#000000] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (11,11) size 390x46
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-004-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-004-expected.txt index a233a8c..79b31495d 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-004-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-004-expected.txt
@@ -13,7 +13,6 @@ text run at (0,0) width 416: "The shape of the caret, and whether it flashes, are not part of the test." LayoutBlockFlow (anonymous) at (0,92) size 784x119 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,108) size 412x114 clip at (9,109) size 410x112 LayoutTextControl {TEXTAREA} at (0,0) size 412x114 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (11,11) size 390x46
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-005-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-005-expected.txt index d3277ad..e4e4aaad 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-005-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-005-expected.txt
@@ -13,7 +13,6 @@ text run at (0,0) width 416: "The shape of the caret, and whether it flashes, are not part of the test." LayoutBlockFlow (anonymous) at (0,92) size 784x119 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,108) size 412x114 clip at (9,109) size 410x112 LayoutTextControl {TEXTAREA} at (0,0) size 412x114 [color=#FFFFFF] [bgcolor=#000000] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (11,11) size 390x46
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-010-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-010-expected.txt index 3c19d0c..2a1d3a3 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-010-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-010-expected.txt
@@ -12,7 +12,6 @@ LayoutBlockFlow (anonymous) at (0,72) size 784x82 LayoutTextControl {INPUT} at (0,0) size 504x82 [color=#FFFFFF] [bgcolor=#000000] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (20,100) size 480x58 LayoutBlockFlow {DIV} at (12,12) size 480x58 caret: position 0 of child 0 {DIV} of {#document-fragment} of child 5 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-014-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-014-expected.txt index 9354b2e..9a36f92 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-014-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-014-expected.txt
@@ -14,5 +14,4 @@ LayoutText {#text} at (10,1) size 79x55 text run at (10,1) width 79: "link" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 caret: position 0 of child 0 {#text} of child 5 {A} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-015-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-015-expected.txt index 7a47e91..080b705 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-015-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-color-015-expected.txt
@@ -18,5 +18,4 @@ LayoutText {#text} at (10,1) size 79x55 text run at (10,1) width 79: "link" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 caret: position 0 of child 0 {#text} of child 8 {A} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-position-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-position-expected.txt index aea0309..afded68 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-position-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/caret/caret-position-expected.txt
@@ -7,7 +7,6 @@ text run at (0,1) width 297: "This tests if the caret position is aligned correctly. " LayoutTextControl {INPUT} at (296.95,0) size 205x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (308,11) size 200x16 LayoutBlockFlow {DIV} at (3,3) size 200x16 caret: position 0 of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/input/caret-at-the-edge-of-input-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/input/caret-at-the-edge-of-input-expected.txt index 348da63..2e6f869 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/input/caret-at-the-edge-of-input-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/input/caret-at-the-edge-of-input-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow (anonymous) at (0,20) size 784x22 LayoutTextControl {INPUT} at (0,0) size 103x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,31) size 99x16 scrollWidth 295 LayoutBlockFlow {DIV} at (2,3) size 99x16 LayoutText {#text} at (0,0) size 294x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/input/reveal-caret-of-multiline-input-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/input/reveal-caret-of-multiline-input-expected.txt index a3020ec2..0f0b8ab 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/input/reveal-caret-of-multiline-input-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/input/reveal-caret-of-multiline-input-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 568: "When the caret is scrolled out, on starting typing it must be brought to the center of the control." LayoutBlockFlow (anonymous) at (0,20) size 784x171 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 101x166 clip at (9,29) size 84x164 scrollY 120.00 scrollHeight 516 LayoutTextControl {TEXTAREA} at (0,0) size 101x166 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 80x512
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/inserting/4960120-1-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/inserting/4960120-1-expected.txt index 13165ff..bc5b0b4 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/inserting/4960120-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/inserting/4960120-1-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 483: "This tests for a bug where the first newline entered into a text area would be lost." LayoutBlockFlow (anonymous) at (0,36) size 784x36 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,44) size 179x36 clip at (9,45) size 177x34 LayoutTextControl {TEXTAREA} at (0,0) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 175x32
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/pasteboard/drop-text-without-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/pasteboard/drop-text-without-selection-expected.txt index 9ef4b37..f59d899 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/pasteboard/drop-text-without-selection-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/pasteboard/drop-text-without-selection-expected.txt
@@ -31,7 +31,6 @@ LayoutText {#text} at (177,1) size 154x19 text run at (177,1) width 154: "drop me into the text field" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,100) size 784x2 clip at (0,0) size 0x0 LayoutBlockFlow {HR} at (0,92) size 784x2 [border: (1px inset #EEEEEE)] layer at (10,113) size 169x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/selection/3690719-expected.png b/third_party/WebKit/LayoutTests/platform/win/editing/selection/3690719-expected.png deleted file mode 100644 index f8eb4415..0000000 --- a/third_party/WebKit/LayoutTests/platform/win/editing/selection/3690719-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/selection/3690719-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/selection/3690719-expected.txt deleted file mode 100644 index c513ffc..0000000 --- a/third_party/WebKit/LayoutTests/platform/win/editing/selection/3690719-expected.txt +++ /dev/null
@@ -1,143 +0,0 @@ -EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification -EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x600 - LayoutBlockFlow {HTML} at (0,0) size 800x600 - LayoutBlockFlow {BODY} at (8,3) size 784x581 [bgcolor=#FFFFFF] - LayoutBlockFlow {CENTER} at (0,0) size 784x272 - LayoutTable {TABLE} at (0,0) size 784x20 - LayoutTableSection {TBODY} at (0,0) size 784x20 - LayoutTableRow {TR} at (0,0) size 784x16 - LayoutTableCell {TD} at (0,0) size 784x16 [r=0 c=0 rs=1 cs=1] - LayoutInline {FONT} at (0,0) size 101x15 - LayoutInline {A} at (0,0) size 101x15 [color=#0000CC] - LayoutText {#text} at (683,0) size 101x15 - text run at (683,0) width 101: "Personalized Home" - LayoutTableRow {TR} at (0,16) size 784x4 - LayoutTableCell {TD} at (0,17) size 784x1 [r=1 c=0 rs=1 cs=1] - LayoutImage {IMG} at (0,0) size 1x1 - LayoutBlockFlow (anonymous) at (0,20) size 784x40 - LayoutBR {BR} at (392,0) size 0x19 - LayoutBR {BR} at (392,20) size 0x19 - LayoutBlockFlow {DIV} at (0,60) size 784x108 [border: (2px solid #AAAAFF)] - LayoutTable {TABLE} at (218,2) size 348x24 - LayoutTableSection {TBODY} at (0,0) size 348x24 - LayoutTableRow {TR} at (0,0) size 348x24 - LayoutTableCell {TD} at (0,0) size 348x24 [r=0 c=0 rs=1 cs=1] - LayoutInline {FONT} at (0,0) size 340x15 - LayoutInline {B} at (0,0) size 25x15 - LayoutText {#text} at (4,4) size 25x15 - text run at (4,4) width 25: "Web" - LayoutText {#text} at (28,4) size 13x15 - text run at (28,4) width 13: " " - LayoutInline {A} at (0,0) size 39x15 [color=#0000CC] - LayoutText {#text} at (40,4) size 39x15 - text run at (40,4) width 39: "Images" - LayoutText {#text} at (78,4) size 13x15 - text run at (78,4) width 13: " " - LayoutInline {A} at (0,0) size 40x15 [color=#0000CC] - LayoutText {#text} at (90,4) size 40x15 - text run at (90,4) width 40: "Groups" - LayoutText {#text} at (129,4) size 13x15 - text run at (129,4) width 13: " " - LayoutInline {A} at (0,0) size 31x15 [color=#0000CC] - LayoutText {#text} at (141,4) size 31x15 - text run at (141,4) width 31: "News" - LayoutText {#text} at (171,4) size 13x15 - text run at (171,4) width 13: " " - LayoutInline {A} at (0,0) size 42x15 [color=#0000CC] - LayoutText {#text} at (183,4) size 42x15 - text run at (183,4) width 42: "Froogle" - LayoutText {#text} at (224,4) size 13x15 - text run at (224,4) width 13: " " - LayoutInline {A} at (0,0) size 30x15 [color=#0000CC] - LayoutText {#text} at (236,4) size 30x15 - text run at (236,4) width 30: "Local" - LayoutInline {SUP} at (0,0) size 1x14 - LayoutInline {A} at (0,0) size 29x15 - LayoutInline {FONT} at (0,0) size 29x15 [color=#FF0000] - LayoutText {#text} at (265,4) size 29x15 - text run at (265,4) width 29: "New!" - LayoutText {#text} at (293,4) size 13x15 - text run at (293,4) width 13: " " - LayoutInline {B} at (0,0) size 39x15 - LayoutInline {A} at (0,0) size 39x15 [color=#0000CC] - LayoutText {#text} at (305,4) size 39x15 - text run at (305,4) width 39: "more \x{BB}" - LayoutTable {TABLE} at (2,26) size 780x44 - LayoutTableSection {TBODY} at (0,0) size 780x44 - LayoutTableRow {TR} at (0,0) size 780x44 - LayoutTableCell {TD} at (0,12) size 177x20 [r=0 c=0 rs=1 cs=1] - LayoutText {#text} at (0,0) size 4x19 - text run at (0,0) width 4: " " - LayoutTableCell {TD} at (177,0) size 418x44 [r=0 c=1 rs=1 cs=1] - LayoutTextControl {INPUT} at (0,0) size 418x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] - LayoutBR {BR} at (418,16) size 0x0 - LayoutButton {INPUT} at (99.50,22) size 102x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutBlockFlow (anonymous) at (8,3) size 86x16 - LayoutText {#text} at (0,0) size 86x16 - text run at (0,0) width 86: "Google Search" - LayoutButton {INPUT} at (201.50,22) size 117x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutBlockFlow (anonymous) at (8,3) size 101x16 - LayoutText {#text} at (0,0) size 101x16 - text run at (0,0) width 101: "I'm Feeling Lucky" - LayoutTableCell {TD} at (595,0) size 185x36 [r=0 c=2 rs=1 cs=1] - LayoutInline {FONT} at (0,0) size 74x36 - LayoutText {#text} at (0,0) size 6x12 - text run at (0,0) width 6: " " - LayoutInline {A} at (0,0) size 68x12 [color=#0000CC] - LayoutText {#text} at (6,0) size 68x12 - text run at (6,0) width 68: "Advanced Search" - LayoutBR {BR} at (74,10) size 0x0 - LayoutText {#text} at (0,12) size 6x12 - text run at (0,12) width 6: " " - LayoutInline {A} at (0,0) size 43x12 [color=#0000CC] - LayoutText {#text} at (6,12) size 43x12 - text run at (6,12) width 43: "Preferences" - LayoutBR {BR} at (49,22) size 0x0 - LayoutText {#text} at (0,24) size 6x12 - text run at (0,24) width 6: " " - LayoutInline {A} at (0,0) size 65x12 [color=#0000CC] - LayoutText {#text} at (6,24) size 65x12 - text run at (6,24) width 65: "Language Tools" - LayoutBlockFlow (anonymous) at (2,70) size 780x36 - LayoutBR {BR} at (390,0) size 0x19 - LayoutInline {FONT} at (0,0) size 146x15 - LayoutInline {FONT} at (0,0) size 28x15 [color=#FF0000] - LayoutText {#text} at (317,20) size 28x15 - text run at (317,20) width 28: "New!" - LayoutText {#text} at (345,20) size 3x15 - text run at (345,20) width 3: " " - LayoutInline {A} at (0,0) size 112x15 [color=#0000CC] - LayoutText {#text} at (348,20) size 112x15 - text run at (348,20) width 112: "Personalize this page" - LayoutText {#text} at (460,20) size 3x15 - text run at (460,20) width 3: "." - LayoutText {#text} at (0,0) size 0x0 - LayoutBlockFlow (anonymous) at (0,168) size 784x76 - LayoutBR {BR} at (392,0) size 0x19 - LayoutBR {BR} at (392,20) size 0x19 - LayoutBR {BR} at (392,40) size 0x19 - LayoutInline {FONT} at (0,0) size 316x15 - LayoutInline {A} at (0,0) size 117x15 [color=#0000CC] - LayoutText {#text} at (234,60) size 117x15 - text run at (234,60) width 117: "Advertising Programs" - LayoutText {#text} at (351,60) size 10x15 - text run at (351,60) width 10: " - " - LayoutInline {A} at (0,0) size 103x15 [color=#0000CC] - LayoutText {#text} at (361,60) size 103x15 - text run at (361,60) width 103: "Business Solutions" - LayoutText {#text} at (464,60) size 10x15 - text run at (464,60) width 10: " - " - LayoutInline {A} at (0,0) size 76x15 [color=#0000CC] - LayoutText {#text} at (474,60) size 76x15 - text run at (474,60) width 76: "About Google" - LayoutBlockFlow {P} at (0,260) size 784x12 - LayoutInline {FONT} at (0,0) size 60x12 - LayoutText {#text} at (362,0) size 60x12 - text run at (362,0) width 60: "\x{A9}2005 Google" -layer at (189,92) size 414x16 - LayoutBlockFlow {DIV} at (2,3) size 414x16 -selection start: position 0 of child 1 {TABLE} of child 4 {DIV} of child 0 {CENTER} of body -selection end: position 1 of child 3 {#text} of child 4 {FONT} of child 4 {DIV} of child 0 {CENTER} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/selection/4960137-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/selection/4960137-expected.txt index 291a41e4..359894bd 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/selection/4960137-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/selection/4960137-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 619: "This tests for an ASSERTion failure when setting the main frame's selection inside a node in a subframe." LayoutBlockFlow (anonymous) at (0,36) size 784x154 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,44) size 304x154 LayoutIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #EEEEEE)] layer at (0,0) size 300x150
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/selection/4975120-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/selection/4975120-expected.txt index 08be043..3d8a99b0 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/selection/4975120-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/selection/4975120-expected.txt
@@ -12,7 +12,6 @@ LayoutTextControl {INPUT} at (0,0) size 173x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutBR {BR} at (173,16) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,67) size 169x16 LayoutBlockFlow {DIV} at (2,3) size 169x16 LayoutText {#text} at (0,0) size 17x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/selection/5354455-2-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/selection/5354455-2-expected.txt index 101951e..c35838b 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/selection/5354455-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/selection/5354455-2-expected.txt
@@ -18,5 +18,4 @@ text run at (114,20) width 390: " run manually, right click on text, and a word should be selected. " text run at (503,20) width 83: "Right click on" text run at (0,40) width 564: "the empty space outside and to the right of the black border, the selection should be removed." - LayoutText {#text} at (0,0) size 0x0 caret: position 0 of child 0 {#text} of child 1 {H1} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/selection/drag-in-iframe-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/selection/drag-in-iframe-expected.txt index 8a79899..340f8667 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/selection/drag-in-iframe-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/selection/drag-in-iframe-expected.txt
@@ -11,7 +11,6 @@ text run at (0,20) width 98: "inside the frame." LayoutBlockFlow (anonymous) at (0,56) size 784x152 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,64) size 302x152 LayoutIFrame {IFRAME} at (0,0) size 302x152 [border: (1px solid #000000)] layer at (0,0) size 300x150
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/selection/expanding-selections2-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/selection/expanding-selections2-expected.txt index 49c35e7..8a2e62e 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/selection/expanding-selections2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/selection/expanding-selections2-expected.txt
@@ -18,5 +18,4 @@ LayoutBlockFlow (anonymous) at (0,76) size 784x20 LayoutText {#text} at (0,0) size 229x19 text run at (0,0) width 229: "This text is outside the editable region." - LayoutText {#text} at (0,0) size 0x0 caret: position 1 of child 0 {#text} of child 1 {SPAN} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/selection/focus-body-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/selection/focus-body-expected.txt index 7ba7f14..ca5c5858 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/selection/focus-body-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/selection/focus-body-expected.txt
@@ -7,5 +7,4 @@ LayoutText {#text} at (0,0) size 421x19 text run at (0,0) width 210: "This test focuses an editable body. " text run at (209,0) width 212: "Its contents should not be selected." - LayoutText {#text} at (0,0) size 0x0 caret: position 0 of child 0 {#text} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/selection/mixed-editability-1-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/selection/mixed-editability-1-expected.txt index 6b434bd..cabba745 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/selection/mixed-editability-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/selection/mixed-editability-1-expected.txt
@@ -13,6 +13,5 @@ text run at (461,0) width 301: "To run this test manually, double click between the" text run at (761,0) width 5: " " text run at (0,20) width 313: "first two letters of the first word of the first sentence." - LayoutText {#text} at (0,0) size 0x0 selection start: position 0 of child 0 {#text} of child 0 {SPAN} of body selection end: position 2 of child 0 {#text} of child 0 {SPAN} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/selection/move-by-sentence-001-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/selection/move-by-sentence-001-expected.txt index 5641c9c..1bb43ec 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/selection/move-by-sentence-001-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/selection/move-by-sentence-001-expected.txt
@@ -27,5 +27,4 @@ LayoutText {#text} at (28,14) size 238x26 text run at (28,14) width 238: "This is some linked text" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 caret: position 1 of child 0 {#text} of child 1 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/selection/node-removal-2-expected.png b/third_party/WebKit/LayoutTests/platform/win/editing/selection/node-removal-2-expected.png deleted file mode 100644 index 4dc8db8..0000000 --- a/third_party/WebKit/LayoutTests/platform/win/editing/selection/node-removal-2-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/selection/node-removal-2-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/selection/node-removal-2-expected.txt deleted file mode 100644 index e63f3c9..0000000 --- a/third_party/WebKit/LayoutTests/platform/win/editing/selection/node-removal-2-expected.txt +++ /dev/null
@@ -1,26 +0,0 @@ -EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification -EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x600 - LayoutBlockFlow {HTML} at (0,0) size 800x600 - LayoutBlockFlow {BODY} at (8,8) size 784x584 - LayoutBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 782x39 - text run at (0,0) width 651: "This tests behavior when a node that serves as the start or end of a selection is removed from the document. " - text run at (651,0) width 131: "Ideally, we would just" - text run at (0,20) width 551: "adjust the selection when an endpoint is removed, for now, we just blow away the selection." - LayoutBlockFlow {P} at (0,56) size 784x40 - LayoutText {#text} at (0,0) size 735x39 - text run at (0,0) width 455: "This test creates a selection that ends inside of a node that will be removed. " - text run at (455,0) width 164: "Then the node is removed. " - text run at (619,0) width 116: "Then a Select All is" - text run at (0,20) width 62: "executed. " - text run at (62,20) width 242: "The entire document should be selected." - LayoutBlockFlow {DIV} at (0,112) size 784x20 - LayoutText {#text} at (0,0) size 32x19 - text run at (0,0) width 32: "hello " - LayoutText {#text} at (32,0) size 40x19 - text run at (32,0) width 40: "world!" -selection start: position 0 of child 0 {#text} of child 1 {P} of body -selection end: position 7 of child 1 {#text} of child 5 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/selection/selection-actions-expected.txt b/third_party/WebKit/LayoutTests/platform/win/editing/selection/selection-actions-expected.txt index 8167231b..12a5ac2 100644 --- a/third_party/WebKit/LayoutTests/platform/win/editing/selection/selection-actions-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/editing/selection/selection-actions-expected.txt
@@ -32,6 +32,5 @@ LayoutBR {BR} at (61,135) size 0x0 LayoutText {#text} at (0,140) size 118x19 text run at (0,140) width 118: "This is a paragraph." - LayoutText {#text} at (0,0) size 0x0 selection start: position 11 of child 2 {#text} of body selection end: position 1 of child 7 {BR} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/external/wpt/url/url-setters-expected.txt b/third_party/WebKit/LayoutTests/platform/win/external/wpt/url/url-setters-expected.txt index 721366e..6a0f8f4 100644 --- a/third_party/WebKit/LayoutTests/platform/win/external/wpt/url/url-setters-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/external/wpt/url/url-setters-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 571 tests; 245 PASS, 326 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 574 tests; 248 PASS, 326 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… FAIL URL: Setting <a://example.net>.protocol = '' The empty string is not a valid scheme. Setter leaves the URL unchanged. assert_equals: expected "a://example.net" but got "file:///A://example.net" FAIL <a>: Setting <a://example.net>.protocol = '' The empty string is not a valid scheme. Setter leaves the URL unchanged. assert_equals: expected "a://example.net" but got "file:///A://example.net" @@ -85,6 +85,9 @@ PASS URL: Setting <data:text/html,<p>Test>.protocol = 'view-source+data:foo : bar' Stuff after the first ':' is ignored PASS <a>: Setting <data:text/html,<p>Test>.protocol = 'view-source+data:foo : bar' Stuff after the first ':' is ignored PASS <area>: Setting <data:text/html,<p>Test>.protocol = 'view-source+data:foo : bar' Stuff after the first ':' is ignored +PASS URL: Setting <http://foo.com:443/>.protocol = 'https' Port is set to null if it is the default for new scheme. +PASS <a>: Setting <http://foo.com:443/>.protocol = 'https' Port is set to null if it is the default for new scheme. +PASS <area>: Setting <http://foo.com:443/>.protocol = 'https' Port is set to null if it is the default for new scheme. PASS URL: Setting <file:///home/you/index.html>.username = 'me' No host means no username PASS <a>: Setting <file:///home/you/index.html>.username = 'me' No host means no username PASS <area>: Setting <file:///home/you/index.html>.username = 'me' No host means no username
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/canvas/canvas-ellipse-connecting-line-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/canvas/canvas-ellipse-connecting-line-expected.txt index be08368..f26bf3b 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/canvas/canvas-ellipse-connecting-line-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/canvas/canvas-ellipse-connecting-line-expected.txt
@@ -4,6 +4,5 @@ LayoutBlockFlow {HTML} at (0,0) size 800x321 LayoutBlockFlow {BODY} at (8,8) size 784x305 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 300x300 LayoutHTMLCanvas {CANVAS} at (0,0) size 300x300
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/canvas/canvas-shadow-source-in-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/canvas/canvas-shadow-source-in-expected.txt index a13484d9..a5916ba 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/canvas/canvas-shadow-source-in-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/canvas/canvas-shadow-source-in-expected.txt
@@ -13,8 +13,6 @@ text run at (0,0) width 66: "Test Image" LayoutBlockFlow (anonymous) at (0,247) size 784x207 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 202x202 LayoutHTMLCanvas {CANVAS} at (0,0) size 202x202 [border: (1px solid #999999)] layer at (8,255) size 202x202
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css-generated-content/table-before-after-child-add-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css-generated-content/table-before-after-child-add-expected.txt index 351fa1d..c5d0801 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/css-generated-content/table-before-after-child-add-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/css-generated-content/table-before-after-child-add-expected.txt
@@ -24,4 +24,3 @@ LayoutBlockFlow (anonymous) at (0,96) size 784x20 LayoutText {#text} at (0,0) size 74x19 text run at (0,0) width 74: "CONTENT" - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css-generated-content/table-cell-before-after-child-add-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css-generated-content/table-cell-before-after-child-add-expected.txt index 075da27..a6598da6 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/css-generated-content/table-cell-before-after-child-add-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/css-generated-content/table-cell-before-after-child-add-expected.txt
@@ -22,4 +22,3 @@ LayoutBlockFlow (anonymous) at (0,56) size 784x20 LayoutText {#text} at (0,0) size 74x19 text run at (0,0) width 74: "CONTENT" - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css-generated-content/table-row-before-after-child-add-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css-generated-content/table-row-before-after-child-add-expected.txt index 9d8a0c60..abf11e9 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/css-generated-content/table-row-before-after-child-add-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/css-generated-content/table-row-before-after-child-add-expected.txt
@@ -24,4 +24,3 @@ LayoutBlockFlow (anonymous) at (0,96) size 784x20 LayoutText {#text} at (0,0) size 74x19 text run at (0,0) width 74: "CONTENT" - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css-generated-content/table-table-before-after-child-add-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css-generated-content/table-table-before-after-child-add-expected.txt index 070c5e3..f2adca15 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/css-generated-content/table-table-before-after-child-add-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/css-generated-content/table-table-before-after-child-add-expected.txt
@@ -28,4 +28,3 @@ LayoutBlockFlow (anonymous) at (0,96) size 784x20 LayoutText {#text} at (0,0) size 74x19 text run at (0,0) width 74: "CONTENT" - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/ZeroOpacityLayers-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css/ZeroOpacityLayers-expected.txt index 175755c1..f646393 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/css/ZeroOpacityLayers-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/ZeroOpacityLayers-expected.txt
@@ -11,7 +11,6 @@ LayoutBlockFlow (positioned) {DIV} at (10,10) size 160x160 [bgcolor=#FF0000] LayoutText {#text} at (0,0) size 143x19 text run at (0,0) width 143: "Should not see this text." - LayoutText {#text} at (0,0) size 0x0 layer at (40,40) size 140x140 LayoutBlockFlow (positioned) {DIV} at (10,10) size 140x140 [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 113x39
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/ZeroOpacityLayers2-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css/ZeroOpacityLayers2-expected.txt index cc914b6..407ee6b 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/css/ZeroOpacityLayers2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/ZeroOpacityLayers2-expected.txt
@@ -11,7 +11,6 @@ LayoutBlockFlow (positioned) {DIV} at (10,10) size 160x160 [bgcolor=#FF0000] LayoutText {#text} at (0,0) size 143x19 text run at (0,0) width 143: "Should not see this text." - LayoutText {#text} at (0,0) size 0x0 layer at (40,40) size 140x140 transparent LayoutBlockFlow (positioned) {DIV} at (10,10) size 140x140 [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 113x39
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/font-face-opentype-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css/font-face-opentype-expected.txt index b2e6e2f..59a63be 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/css/font-face-opentype-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/font-face-opentype-expected.txt
@@ -27,7 +27,6 @@ LayoutText {#text} at (0,16) size 736x16 text run at (0,16) width 736: "PQRSTUVWXYZ[\\]^_`abcdefghijklmnoqrstuvwxyz{|}~" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,140) size 784x40 LayoutText {#text} at (0,0) size 768x39 text run at (0,0) width 768: "Check if glyphs not in Ahem.otf can be rendered using a fallback font. If the test passes, you should see a single-quote character" @@ -37,5 +36,3 @@ LayoutText {#text} at (0,2) size 3x16 text run at (0,2) width 3: "'" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/font-face-synthetic-bold-italic-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css/font-face-synthetic-bold-italic-expected.txt index 4f64064..8be3807 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/css/font-face-synthetic-bold-italic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/font-face-synthetic-bold-italic-expected.txt
@@ -59,4 +59,3 @@ LayoutInline {STRONG} at (0,0) size 0x0 LayoutInline {I} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/font-face-weight-matching-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css/font-face-weight-matching-expected.txt index 9c45222d..a4385f8 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/css/font-face-weight-matching-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/font-face-weight-matching-expected.txt
@@ -55,7 +55,6 @@ text run at (100,2) width 16: "A" LayoutText {#text} at (116,0) size 4x19 text run at (116,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutInline {SPAN} at (0,0) size 16x16 LayoutText {#text} at (120,2) size 16x16 text run at (120,2) width 16: "A" @@ -66,7 +65,6 @@ text run at (140,2) width 16: "A" LayoutText {#text} at (156,0) size 4x19 text run at (156,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutInline {SPAN} at (0,0) size 16x16 LayoutText {#text} at (160,2) size 16x16 text run at (160,2) width 16: "A" @@ -77,7 +75,6 @@ text run at (180,2) width 16: "A" LayoutText {#text} at (196,0) size 4x19 text run at (196,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutInline {SPAN} at (0,0) size 16x16 LayoutText {#text} at (200,2) size 16x16 text run at (200,2) width 16: "A" @@ -88,7 +85,6 @@ text run at (220,2) width 16: "A" LayoutText {#text} at (236,0) size 4x19 text run at (236,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutInline {SPAN} at (0,0) size 16x16 LayoutText {#text} at (240,2) size 16x16 text run at (240,2) width 16: "A" @@ -98,4 +94,3 @@ LayoutText {#text} at (260,2) size 16x16 text run at (260,2) width 16: "A" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/h1-in-section-elements-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css/h1-in-section-elements-expected.txt index 15ccd0c..d36a231 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/css/h1-in-section-elements-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/h1-in-section-elements-expected.txt
@@ -6,7 +6,6 @@ LayoutBlockFlow {P} at (0,0) size 784x20 LayoutText {#text} at (0,0) size 421x19 text run at (0,0) width 421: "For each of pairs, the first one and the second one should be identical." - LayoutText {#text} at (0,0) size 0x0 LayoutTable (floating) {TABLE} at (0,36) size 152x365 LayoutTableSection {TBODY} at (0,0) size 152x365 LayoutTableRow {TR} at (0,2) size 152x75
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/ignore-empty-focus-ring-rects-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css/ignore-empty-focus-ring-rects-expected.txt index 331c0c3..e23ec03 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/css/ignore-empty-focus-ring-rects-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/ignore-empty-focus-ring-rects-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x20 LayoutText {#text} at (0,0) size 706x19 text run at (0,0) width 706: "Should ignore empty rects when drawing focus ring. Passes if there is only a single focus ring around the green square." - LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 100x150 LayoutBlockFlow (positioned) {DIV} at (8,28) size 100x150 LayoutBlockFlow (anonymous) at (0,0) size 100x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/invalidation-errors-2-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css/invalidation-errors-2-expected.txt index dbdb6392..0fadcf1 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/css/invalidation-errors-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/invalidation-errors-2-expected.txt
@@ -12,7 +12,6 @@ LayoutBlockFlow (anonymous) at (0,36) size 784x0 LayoutInline {DIV} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 layer at (8,44) size 200x200 LayoutBlockFlow (floating) {DIV} at (0,0) size 200x200 [color=#FFFFFF] [bgcolor=#006400]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/invalidation-errors-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css/invalidation-errors-expected.txt index dbdb6392..0fadcf1 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/css/invalidation-errors-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/invalidation-errors-expected.txt
@@ -12,7 +12,6 @@ LayoutBlockFlow (anonymous) at (0,36) size 784x0 LayoutInline {DIV} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 layer at (8,44) size 200x200 LayoutBlockFlow (floating) {DIV} at (0,0) size 200x200 [color=#FFFFFF] [bgcolor=#006400]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/nested-floating-relative-position-percentages-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css/nested-floating-relative-position-percentages-expected.txt index 9c602206..a3f2121 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/css/nested-floating-relative-position-percentages-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/nested-floating-relative-position-percentages-expected.txt
@@ -9,9 +9,6 @@ layer at (400,28) size 630x420 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 LayoutBlockFlow (relative positioned) (floating) {DIV} at (0,20) size 630x420 LayoutBR {BR} at (630,0) size 0x19 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (90,33) size 200x200 LayoutBlockFlow (relative positioned) (floating) {DIV} at (5,5) size 200x200 [bgcolor=#000000] LayoutImage {IMG} at (0,0) size 200x200
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/dom/inner-text-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/dom/inner-text-expected.txt index 4381c013..780ddf8 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/dom/inner-text-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/dom/inner-text-expected.txt
@@ -8,4 +8,3 @@ LayoutInline {SPAN} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 210x19 text run at (0,0) width 210: " This text should only appear once." - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/008-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/008-expected.txt index 4350985..5f7714b 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/008-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/008-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x820 LayoutBlockFlow {BODY} at (8,8) size 784x804 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 339x804 backgroundClip at (8,8) size 339x592 clip at (9,9) size 337x591 LayoutTextControl {TEXTAREA} at (0,0) size 339x804 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 335x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/011-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/011-expected.txt index a3ffce4..2295e0bd 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/011-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/011-expected.txt
@@ -28,4 +28,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (16,15) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt index 97c96f9..0aadaae1a 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt
@@ -7,5 +7,4 @@ LayoutBlockFlow {DIV} at (0,0) size 784x100 LayoutBR {BR} at (100,0) size 0x19 LayoutImage (floating) {IMG} at (0,100) size 100x100 - LayoutText {#text} at (0,0) size 0x0 LayoutImage (floating) {IMG} at (100,100) size 100x100 [bgcolor=#0000FF]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt index af608723..35b5bf8 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt
@@ -23,7 +23,6 @@ LayoutBR {BR} at (248,15) size 0x0 LayoutBR {BR} at (0,20) size 0x19 LayoutBlockFlow (floating) {DIV} at (0,40) size 100x100 [bgcolor=#008000] - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,40) size 150x40 LayoutText {#text} at (100,0) size 44x39 text run at (100,0) width 44: "a green"
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/link-href-change-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/link-href-change-expected.txt index 6c65b8d..1c9ae2e 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/link-href-change-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/link-href-change-expected.txt
@@ -7,4 +7,3 @@ LayoutText {#text} at (15,0) size 321x19 text run at (15,0) width 321: "This should have a 10px solid black border around it." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/outerHTML-img-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/outerHTML-img-expected.txt index daeed30..c442b08 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/outerHTML-img-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/outerHTML-img-expected.txt
@@ -17,4 +17,3 @@ LayoutBlockFlow (anonymous) at (0,72) size 784x64 LayoutImage {IMG} at (0,0) size 52x64 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/window-resize-scrollbars-test-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/window-resize-scrollbars-test-expected.txt index 7e391ea..9a6ab6d 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/window-resize-scrollbars-test-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/window-resize-scrollbars-test-expected.txt
@@ -5,4 +5,3 @@ LayoutBlockFlow {BODY} at (8,8) size 752x560 LayoutText {#text} at (0,0) size 460x19 text run at (0,0) width 460: "This window should not have scroll bars. If it has scroll bars, try to use them." - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/window-scrollbars-test-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/window-scrollbars-test-expected.txt index 6cd936f6..138d8235 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/window-scrollbars-test-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/dynamic/window-scrollbars-test-expected.txt
@@ -5,4 +5,3 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 245x19 text run at (0,0) width 245: "This window should not have scroll bars." - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/events/context-no-deselect-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/events/context-no-deselect-expected.txt index 90aa009..ab8d5cf 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/events/context-no-deselect-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/events/context-no-deselect-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutTextControl {INPUT} at (0,0) size 173x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,11) size 169x16 LayoutBlockFlow {DIV} at (2,3) size 169x16 LayoutText {#text} at (0,0) size 104x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/button/button-align-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/button/button-align-expected.txt index d38a785..dcb1eaf8 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/button/button-align-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/button/button-align-expected.txt
@@ -33,7 +33,6 @@ LayoutText {#text} at (47,0) size 190x16 text run at (47,0) width 190: "This is should be center justified." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,124) size 784x22 LayoutButton {BUTTON} at (0,0) size 300x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] LayoutBlockFlow (anonymous) at (8,3) size 284x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/cursor-at-editable-content-boundary-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/cursor-at-editable-content-boundary-expected.txt index 96a816e8..c229f02 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/cursor-at-editable-content-boundary-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/cursor-at-editable-content-boundary-expected.txt
@@ -1,9 +1,7 @@ autowrap text area with dir=rtl. nowrap text area with dir=rtl. - autowrap text area with dir=ltr. - vertical text. PASS
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/form-added-to-table-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/form-added-to-table-expected.png deleted file mode 100644 index d102112..0000000 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/form-added-to-table-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/form-added-to-table-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/form-added-to-table-expected.txt deleted file mode 100644 index 21e163c6..0000000 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/form-added-to-table-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x600 - LayoutBlockFlow {HTML} at (0,0) size 800x600 - LayoutBlockFlow {BODY} at (8,8) size 784x584 - LayoutTable {TABLE} at (0,0) size 218x26 - LayoutTableSection {TBODY} at (0,0) size 218x26 - LayoutTableRow {TR} at (0,2) size 218x22 - LayoutTableCell {TD} at (2,2) size 214x22 [r=0 c=0 rs=1 cs=1] - LayoutText {#text} at (1,1) size 212x19 - text run at (1,1) width 212: "This test passes if it does not crash." -selection start: position 0 of child 0 {#text} of child 0 {TD} of child 0 {TR} of child 0 {TBODY} of child 1 {TABLE} of body -selection end: position 1 of child 1 {TABLE} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/indeterminate-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/indeterminate-expected.txt index 264da78..3ccf5b7 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/indeterminate-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/indeterminate-expected.txt
@@ -5,6 +5,5 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (20,1) size 470x19 text run at (20,1) width 470: " This checkbox should look 50% transparent and should be in the mixed state." - LayoutText {#text} at (0,0) size 0x0 layer at (12,11) size 13x13 transparent LayoutBlockFlow {INPUT} at (4,3) size 13x13
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/number/number-appearance-datalist-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/number/number-appearance-datalist-expected.txt index 89eb456..b1e5f913 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/number/number-appearance-datalist-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/number/number-appearance-datalist-expected.txt
@@ -27,7 +27,6 @@ LayoutFlexibleBox {DIV} at (2,3) size 169x16 LayoutBlockFlow {DIV} at (0,0) size 136.14x16 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,11) size 136x16 LayoutBlockFlow {DIV} at (0,0) size 136.14x16 layer at (187,11) size 136x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/number/number-appearance-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/number/number-appearance-rtl-expected.txt index c59eb78..d790ee0 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/number/number-appearance-rtl-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/number/number-appearance-rtl-expected.txt
@@ -24,7 +24,6 @@ LayoutBlockFlow {DIV} at (15,0) size 154x16 LayoutBlockFlow {DIV} at (0,0) size 15x16 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,152) size 784x22 LayoutTextControl {INPUT} at (0,0) size 173x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutFlexibleBox {DIV} at (2,3) size 169x16 @@ -35,7 +34,6 @@ LayoutFlexibleBox {DIV} at (2,3) size 169x16 LayoutBlockFlow {DIV} at (0,0) size 154x16 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,228) size 784x22 LayoutTextControl {INPUT} at (0,0) size 173x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutFlexibleBox {DIV} at (2,3) size 169x16 @@ -46,7 +44,6 @@ LayoutFlexibleBox {DIV} at (2,3) size 169x16 LayoutBlockFlow {DIV} at (15,0) size 154x16 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (636,19) size 154x16 LayoutBlockFlow {DIV} at (0,0) size 154x16 LayoutText {#text} at (147,0) size 7x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/preserveFormDuringResidualStyle-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/preserveFormDuringResidualStyle-expected.txt index 4120803..d93685b0 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/preserveFormDuringResidualStyle-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/preserveFormDuringResidualStyle-expected.txt
@@ -17,7 +17,6 @@ LayoutTableCell {TD} at (2,2) size 19x21 [r=0 c=0 rs=1 cs=1] LayoutImage {INPUT} at (1,1) size 17x19 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow (anonymous) at (0,25) size 784x0 LayoutInline {FONT} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/search/search-appearance-basic-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/search/search-appearance-basic-expected.txt index b6a2707f..a605e6c6cf 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/search/search-appearance-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/search/search-appearance-basic-expected.txt
@@ -96,7 +96,6 @@ LayoutFlexibleBox {DIV} at (18,4) size 141x13 LayoutBlockFlow {DIV} at (0,0) size 129x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (15,15) size 156x16 LayoutBlockFlow {DIV} at (0,0) size 156x16 LayoutText {#text} at (0,0) size 17x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/search/search-cancel-button-style-sharing-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/search/search-cancel-button-style-sharing-expected.txt index 78f2912..0e80d77 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/search/search-cancel-button-style-sharing-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/search/search-cancel-button-style-sharing-expected.txt
@@ -17,7 +17,6 @@ LayoutBlockFlow {DIV} at (0,0) size 156x16 LayoutBlockFlow {DIV} at (157,3.50) size 9x9 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (11,47) size 156x16 LayoutBlockFlow {DIV} at (0,0) size 156x16 layer at (190,47) size 156x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-appearance-basic-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-appearance-basic-expected.txt index ce3bfb2..7321302d 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-appearance-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-appearance-basic-expected.txt
@@ -7,7 +7,6 @@ text run at (46,59) width 4: " " LayoutText {#text} at (129,59) size 4x19 text run at (129,59) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (180,59) size 4x19 text run at (180,59) width 4: " " LayoutText {#text} at (250,59) size 4x19
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-with-display-none-option-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-with-display-none-option-expected.txt index 08810ce..4a1d0ef 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-with-display-none-option-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-with-display-none-option-expected.txt
@@ -18,7 +18,6 @@ LayoutText {#text} at (314,119) size 4x19 text run at (314,119) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,69) size 56x121 clip at (9,70) size 39x119 LayoutListBox {SELECT} at (0,17) size 56x121 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {OPTION} at (1,1) size 39x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-deselect-update-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-deselect-update-expected.txt index a90bddb..37e7aa7 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-deselect-update-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-deselect-update-expected.txt
@@ -10,4 +10,3 @@ LayoutText (anonymous) at (4,1) size 35x16 text run at (4,1) width 35: "PASS" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-align-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-align-expected.txt index af0a60e..9cd5392 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-align-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-align-expected.txt
@@ -40,7 +40,6 @@ LayoutText (anonymous) at (4,1) size 171x16 text run at (4,1) width 171: "This is should be left justified." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,136) size 784x20 LayoutMenuList {SELECT} at (0,0) size 300x20 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow (anonymous) at (1,1) size 298x18
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-autofilled-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-autofilled-expected.txt index 5e7498f2..fb132df 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-autofilled-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-autofilled-expected.txt
@@ -12,4 +12,3 @@ LayoutText (anonymous) at (4,1) size 23x18 text run at (4,1) width 23: "CA" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-change-listbox-size-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-change-listbox-size-expected.txt index 8912778..4375add 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-change-listbox-size-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-change-listbox-size-expected.txt
@@ -21,7 +21,6 @@ text run at (0,0) width 297: "This list box should be tall enough to fit 6 options." LayoutBlockFlow (anonymous) at (0,92) size 784x104 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,100) size 53x104 clip at (9,101) size 36x102 LayoutListBox {SELECT} at (0,0) size 53x104 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {OPTION} at (1,1) size 36x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-empty-option-height-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-empty-option-height-expected.txt index 019d3df..f941559 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-empty-option-height-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-empty-option-height-expected.txt
@@ -8,4 +8,3 @@ LayoutText (anonymous) at (0,0) size 4x16 text run at (0,0) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-initial-position-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-initial-position-expected.txt index fec1120..c0d314c 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-initial-position-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-initial-position-expected.txt
@@ -15,8 +15,7 @@ LayoutBR {BR} at (152,106) size 0x0 LayoutText {#text} at (155,162) size 4x19 text run at (155,162) width 4: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (159,177) size 0x0 LayoutText {#text} at (0,182) size 200x19 text run at (0,182) width 200: "dynamic insert of selected option:" LayoutBR {BR} at (200,197) size 0x0 @@ -42,8 +41,7 @@ text run at (4,1) width 134: "this should be selected" LayoutText {#text} at (156,333) size 4x19 text run at (156,333) width 4: " " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (160,348) size 0x0 LayoutText {#text} at (0,353) size 200x19 text run at (0,353) width 200: "dynamic insert of selected option:" LayoutBR {BR} at (200,368) size 0x0 @@ -57,7 +55,6 @@ text run at (0,0) width 180: "Display 'none' to 'inline-block'" LayoutBlockFlow (anonymous) at (0,445) size 784x70 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 155x70 clip at (9,29) size 138x68 scrollY 119.00 scrollHeight 238 LayoutListBox {SELECT} at (0,20) size 155x70 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {OPTION} at (1,1) size 138x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-item-background-clip-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-item-background-clip-expected.txt index 3b6e37b6..57d748e 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-item-background-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-item-background-clip-expected.txt
@@ -18,7 +18,6 @@ text run at (163,20) width 4: "." LayoutBlockFlow (anonymous) at (0,56) size 784x68 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,64) size 60x68 clip at (11,67) size 39x62 scrollHeight 74 LayoutListBox {SELECT} at (0,0.25) size 60x67.75 [bgcolor=#FFFFFF] [border: (3px solid #0000FF)] LayoutBlockFlow {OPTION} at (6,6) size 33x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt index 34302b150..fc11f67 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/select-listbox-multiple-no-focusring-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x87 LayoutBlockFlow {BODY} at (8,8) size 784x71 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 370x70 clip at (9,9) size 353x68 LayoutListBox {SELECT} at (0,0) size 369.77x70 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {OPTION} at (1,1) size 352.77x17 [color=#FFFFCC] [bgcolor=#0000FF]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-appearance-preventDefault-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-appearance-preventDefault-expected.txt index 57b6a4d..775355c 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-appearance-preventDefault-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-appearance-preventDefault-expected.txt
@@ -6,8 +6,6 @@ LayoutBR {BR} at (0,0) size 0x19 LayoutText {#text} at (0,20) size 630x19 text run at (0,20) width 630: "This tests that preventDefault called onmousedown will prevent a caret from being placed in the text field." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,50) size 173x22 clip at (12,52) size 169x18 LayoutTextControl (positioned) {INPUT} at (10,50) size 173x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] layer at (12,53) size 169x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-no-renderer-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-no-renderer-expected.txt index bae313c..50c11998 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-no-renderer-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-no-renderer-expected.txt
@@ -5,4 +5,3 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 552x19 text run at (0,0) width 552: "This test makes sure we don't crash when calling focus() on an element that has no renderer." - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-placeholder-visibility-1-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-placeholder-visibility-1-expected.txt index 39a54b9..06060a48 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-placeholder-visibility-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-placeholder-visibility-1-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow {DIV} at (0,36) size 784x22 LayoutTextControl {INPUT} at (0,0) size 173x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,47) size 169x16 LayoutBlockFlow {DIV} at (2,3) size 169x16 [color=#757575] LayoutText {#text} at (0,0) size 68x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-placeholder-visibility-3-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-placeholder-visibility-3-expected.txt index 897348c..e6217d4 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-placeholder-visibility-3-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-placeholder-visibility-3-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow {DIV} at (0,36) size 784x22 LayoutTextControl {INPUT} at (0,0) size 173x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,47) size 169x16 LayoutBlockFlow {DIV} at (2,3) size 169x16 [color=#757575] LayoutText {#text} at (0,0) size 68x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-tab-shows-caret-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-tab-shows-caret-expected.txt index 3c3051c9..8c598712 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-tab-shows-caret-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/input-tab-shows-caret-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x22 LayoutTextControl {INPUT} at (0,0) size 173x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,11) size 169x16 LayoutBlockFlow {DIV} at (2,3) size 169x16 caret: position 0 of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/text-appearance-datalist-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/text-appearance-datalist-expected.txt index 18e8322d..dda4f40 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/text-appearance-datalist-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/text-appearance-datalist-expected.txt
@@ -25,7 +25,6 @@ LayoutFlexibleBox {DIV} at (2,3) size 169x16 LayoutBlockFlow {DIV} at (0,0) size 151.14x16 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,11) size 151x16 LayoutBlockFlow {DIV} at (0,0) size 151.14x16 layer at (187,11) size 151x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/textfield-overflow-by-value-update-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/textfield-overflow-by-value-update-expected.txt index 0f6b1fa..7ae80dd 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/textfield-overflow-by-value-update-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/textfield-overflow-by-value-update-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x20 LayoutTextControl {INPUT} at (0,4) size 100x2 [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,-5) size 100x37 backgroundClip at (8,0) size 100x32 clip at (8,0) size 100x32 LayoutBlockFlow {DIV} at (0,-17.50) size 100x37 LayoutText {#text} at (0,0) size 67x36
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/textfield-overflow-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/textfield-overflow-expected.txt index bd79c042..81bca1d 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/textfield-overflow-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/textfield-overflow-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutTextControl {INPUT} at (0,0) size 173x10 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,5) size 169x16 LayoutBlockFlow {DIV} at (2,-3) size 169x16 caret: position 0 of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-align-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-align-expected.txt index 6952e4b..4bd73789 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-align-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-align-expected.txt
@@ -17,7 +17,6 @@ text run at (419,103) width 4: " " LayoutBR {BR} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,195) size 784x36 layer at (8,44) size 419x36 clip at (9,45) size 417x34 LayoutTextControl {TEXTAREA} at (0,0) size 419x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt index 48b4e3b..a6ec645 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-placeholder-visibility-1-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 363: "Focus field with a placeholder, then type, then delete all text." LayoutBlockFlow {DIV} at (0,36) size 784x36 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,44) size 179x36 clip at (9,45) size 177x34 LayoutTextControl {TEXTAREA} at (0,0) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 175x16 [color=#757575]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt index a37120f..e55e22d 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-placeholder-visibility-2-expected.txt
@@ -8,7 +8,6 @@ text run at (0,0) width 370: "Focus field with a placeholder, then type, then clear the value." LayoutBlockFlow {DIV} at (0,36) size 784x36 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,44) size 179x36 clip at (9,45) size 177x34 LayoutTextControl {TEXTAREA} at (0,0) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 175x16 [color=#757575]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/crash-on-zero-radius-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/crash-on-zero-radius-expected.png index 868bc932..af75602a 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/crash-on-zero-radius-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/crash-on-zero-radius-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/css3-degenerate-color-stops-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/css3-degenerate-color-stops-expected.png index 23f3970..0150080 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/css3-degenerate-color-stops-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/css3-degenerate-color-stops-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/css3-radial-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/css3-radial-gradients-expected.png index 781f8d5a..cb73edce 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/css3-radial-gradients-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/css3-radial-gradients-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/css3-repeating-radial-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/css3-repeating-radial-gradients-expected.png index e32e1d9..e2f2b860 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/css3-repeating-radial-gradients-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/css3-repeating-radial-gradients-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/generated-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/generated-gradients-expected.png index c9c3bad6..6093bce 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/generated-gradients-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/generated-gradients-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/radial-centered-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/radial-centered-expected.png index d4d08ad..4405ce8 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/radial-centered-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/radial-centered-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/simple-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/simple-gradients-expected.png index f99204c..df327645 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/simple-gradients-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/simple-gradients-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/unprefixed-radial-gradients-color-hints-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/unprefixed-radial-gradients-color-hints-expected.png index 9c2fe0c..7f371dd 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/unprefixed-radial-gradients-color-hints-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/unprefixed-radial-gradients-color-hints-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/unprefixed-radial-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/unprefixed-radial-gradients-expected.png index 781f8d5a..cb73edce 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/unprefixed-radial-gradients-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/unprefixed-radial-gradients-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/unprefixed-repeating-gradient-color-hint-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/unprefixed-repeating-gradient-color-hint-expected.png index 5362272..39f10a8 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/unprefixed-repeating-gradient-color-hint-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/unprefixed-repeating-gradient-color-hint-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/unprefixed-repeating-radial-gradients-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/unprefixed-repeating-radial-gradients-expected.png index e32e1d9..e2f2b860 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/unprefixed-repeating-radial-gradients-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/unprefixed-repeating-radial-gradients-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/invalid/014-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/invalid/014-expected.txt index dfe32c76..3ee1318 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/invalid/014-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/invalid/014-expected.txt
@@ -7,7 +7,6 @@ LayoutText {#text} at (0,0) size 569x19 text run at (0,0) width 270: "Random tests of some bizarre combinations. " text run at (270,0) width 299: "H2 should allow a form inside it, but p should not." - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {FORM} at (0,20) size 784x20 LayoutMenuList {SELECT} at (0,0) size 31x20 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow (anonymous) at (1,1) size 29x18
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/layers/inline-dirty-z-order-lists-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/layers/inline-dirty-z-order-lists-expected.txt index d6da1e4..da7fe133 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/layers/inline-dirty-z-order-lists-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/layers/inline-dirty-z-order-lists-expected.txt
@@ -21,9 +21,6 @@ text run at (420,0) width 272: "layer\x{2019}s and its stacking context\x{2019}s z-index lists." LayoutBlockFlow (anonymous) at (0,92) size 784x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,100) size 0x0 LayoutInline (relative positioned) {SPAN} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/layers/layer-visibility-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/layers/layer-visibility-expected.txt index b06ed7a..34375d4 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/layers/layer-visibility-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/layers/layer-visibility-expected.txt
@@ -51,7 +51,6 @@ LayoutText {#text} at (0,0) size 101x39 text run at (0,0) width 101: "3 green box with" text run at (0,20) width 55: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (278,50) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x24 [border: (2px solid #008000)] @@ -62,7 +61,6 @@ LayoutText {#text} at (0,0) size 101x39 text run at (0,0) width 101: "4 green box with" text run at (0,20) width 55: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (412,50) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] layer at (414,52) size 126x30 @@ -74,7 +72,6 @@ LayoutText {#text} at (0,0) size 101x39 text run at (0,0) width 101: "5 green box with" text run at (0,20) width 55: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (546,50) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x28 [border: (2px solid #FF0000)] @@ -86,7 +83,6 @@ LayoutText {#text} at (0,0) size 101x39 text run at (0,0) width 101: "6 green box with" text run at (0,20) width 55: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (10,154) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] hidden layer at (12,156) size 126x30 @@ -99,7 +95,6 @@ LayoutText {#text} at (0,0) size 101x39 text run at (0,0) width 101: "7 green box with" text run at (0,20) width 55: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (144,154) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] hidden layer at (146,156) size 126x30 @@ -113,7 +108,6 @@ LayoutText {#text} at (0,0) size 117x39 text run at (0,0) width 117: "8 double green box" text run at (0,20) width 84: "with word ok:" - LayoutText {#text} at (0,0) size 0x0 layer at (278,154) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #008000)] hidden layer at (280,156) size 126x30 @@ -127,7 +121,6 @@ LayoutText {#text} at (0,0) size 101x39 text run at (0,0) width 101: "9 green box with" text run at (0,20) width 55: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (412,154) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] hidden layer at (414,156) size 126x30 @@ -140,7 +133,6 @@ LayoutBlockFlow (relative positioned) {DIV} at (2,2) size 130x20 LayoutText {#text} at (0,0) size 83x19 text run at (0,0) width 83: "10 green box:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (546,134) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,20) size 130x34 [border: (2px solid #FF0000)] layer at (548,136) size 126x30 @@ -154,7 +146,6 @@ LayoutText {#text} at (0,0) size 109x39 text run at (0,0) width 109: "11 green box with" text run at (0,20) width 55: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (10,258) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x28 [border: (2px solid #FF0000)] @@ -166,7 +157,6 @@ LayoutText {#text} at (0,0) size 109x39 text run at (0,0) width 109: "12 green box with" text run at (0,20) width 55: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (144,258) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x28 [border: (2px solid #FF0000)] @@ -177,7 +167,6 @@ LayoutBlockFlow (relative positioned) {DIV} at (2,2) size 130x20 LayoutText {#text} at (0,0) size 83x19 text run at (0,0) width 83: "13 green box:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (278,238) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,20) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x28 [border: (2px solid #008000)] @@ -189,7 +178,6 @@ LayoutText {#text} at (0,0) size 109x39 text run at (0,0) width 109: "14 green box with" text run at (0,20) width 55: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (412,258) size 130x30 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x30 LayoutBlockFlow {DIV} at (0,0) size 130x24 [border: (2px solid #008000)] @@ -200,7 +188,6 @@ LayoutText {#text} at (0,0) size 109x39 text run at (0,0) width 109: "15 green box with" text run at (0,20) width 55: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (546,258) size 130x30 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x30 layer at (546,258) size 130x30 @@ -212,7 +199,6 @@ LayoutText {#text} at (0,0) size 109x39 text run at (0,0) width 109: "16 green box with" text run at (0,20) width 55: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (10,362) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x52 [border: (2px solid #FF0000)] @@ -227,7 +213,6 @@ LayoutText {#text} at (0,0) size 109x39 text run at (0,0) width 109: "17 green box with" text run at (0,20) width 55: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (144,362) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x52 [border: (2px solid #FF0000)] @@ -242,7 +227,6 @@ LayoutText {#text} at (0,0) size 109x39 text run at (0,0) width 109: "18 green box with" text run at (0,20) width 55: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (278,362) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x52 [border: (2px solid #FF0000)] @@ -257,7 +241,6 @@ LayoutText {#text} at (0,0) size 109x39 text run at (0,0) width 109: "19 green box with" text run at (0,20) width 55: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (412,362) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x28 [border: (2px solid #FF0000)] @@ -272,7 +255,6 @@ LayoutBlockFlow (relative positioned) {DIV} at (2,2) size 130x20 LayoutText {#text} at (0,0) size 83x19 text run at (0,0) width 83: "20 green box:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (546,342) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,20) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x52 [border: (2px solid #008000)] @@ -287,7 +269,6 @@ LayoutText {#text} at (0,0) size 120x39 text run at (0,0) width 120: "21 two green boxes" text run at (0,20) width 84: "with word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (10,466) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] LayoutBlockFlow {DIV} at (2,2) size 126x28 [border: (2px solid #FF0000)] @@ -303,7 +284,6 @@ LayoutText {#text} at (0,0) size 109x39 text run at (0,0) width 109: "22 green box with" text run at (0,20) width 55: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (144,466) size 130x34 LayoutBlockFlow (positioned) {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] layer at (146,468) size 126x30 @@ -315,7 +295,6 @@ LayoutText {#text} at (0,0) size 109x39 text run at (0,0) width 109: "23 green box with" text run at (0,20) width 55: "word ok:" - LayoutText {#text} at (0,0) size 0x0 hidden layer at (278,466) size 130x34 LayoutBlockFlow (positioned) zI: 1 {DIV} at (0,40) size 130x34 [border: (2px solid #FF0000)] hidden layer at (280,468) size 126x30
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/layers/layer-visibility-sublayer-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/layers/layer-visibility-sublayer-expected.txt index e2fbefe7..db5ee76 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/layers/layer-visibility-sublayer-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/layers/layer-visibility-sublayer-expected.txt
@@ -9,22 +9,19 @@ LayoutBR {BR} at (0,60) size 0x19 LayoutText {#text} at (0,80) size 172x19 text run at (0,80) width 172: "24 green box with word ok: " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (172,95) size 0x0 LayoutBR {BR} at (0,100) size 0x19 LayoutBR {BR} at (0,120) size 0x19 LayoutBR {BR} at (0,140) size 0x19 LayoutText {#text} at (0,160) size 172x19 text run at (0,160) width 172: "25 green box with word ok: " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (172,175) size 0x0 LayoutBR {BR} at (0,180) size 0x19 LayoutBR {BR} at (0,200) size 0x19 LayoutBR {BR} at (0,220) size 0x19 LayoutText {#text} at (0,240) size 172x19 text run at (0,240) width 172: "26 green box with word ok: " - LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (172,255) size 0x0 LayoutBR {BR} at (0,260) size 0x19 LayoutBR {BR} at (0,280) size 0x19 LayoutBR {BR} at (0,300) size 0x19
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/layers/remove-layer-with-nested-stacking-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/layers/remove-layer-with-nested-stacking-expected.txt index 47d1dda6..57079d7 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/layers/remove-layer-with-nested-stacking-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/layers/remove-layer-with-nested-stacking-expected.txt
@@ -10,8 +10,6 @@ LayoutBlockFlow (anonymous) at (0,70) size 784x100 LayoutBlockFlow (anonymous) at (0,170) size 784x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,78) size 100x100 LayoutBlockFlow {DIV} at (0,0) size 100x100 LayoutText {#text} at (0,0) size 0x0 @@ -24,4 +22,3 @@ LayoutBlockFlow {SPAN} at (0,0) size 100x50 [bgcolor=#008000] layer at (8,178) size 0x0 transparent LayoutInline {SPAN} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/layers/remove-only-this-layer-update-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/layers/remove-only-this-layer-update-expected.txt index b697898..cfc0fe04 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/layers/remove-only-this-layer-update-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/layers/remove-only-this-layer-update-expected.txt
@@ -10,7 +10,6 @@ text run at (475,0) width 225: "There should be no red on this page. " text run at (699,0) width 75: "This is a test" text run at (0,20) width 343: "case for https://bugs.webkit.org/show_bug.cgi?id=25252" - LayoutText {#text} at (0,0) size 0x0 layer at (100,100) size 100x100 LayoutBlockFlow (positioned) {DIV} at (100,100) size 100x100 [bgcolor=#FF0000] LayoutText {#text} at (0,0) size 33x19
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/parser/title-error-test-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/parser/title-error-test-expected.txt index 4db0480..ec1ac2e 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/parser/title-error-test-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/parser/title-error-test-expected.txt
@@ -6,7 +6,6 @@ LayoutBlockFlow (anonymous) at (0,0) size 784x0 LayoutInline {TIMER:TIME} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow (anonymous) at (0,0) size 784x20 LayoutBlockFlow {P} at (0,0) size 784x20 LayoutInline {SPAN} at (0,0) size 72x19 [color=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/parser/xhtml-alternate-entities-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/parser/xhtml-alternate-entities-expected.txt index 8e09fd26..ec946c93 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/parser/xhtml-alternate-entities-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/parser/xhtml-alternate-entities-expected.txt
@@ -17,7 +17,6 @@ LayoutInline {h1} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutInline {p} at (0,0) size 465x19 LayoutInline {font} at (0,0) size 465x19 LayoutText {#text} at (0,0) size 465x19
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/reflections/transparent-reflected-sublayers-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/reflections/transparent-reflected-sublayers-expected.txt index 3101e5ec..70e7a3b8 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/reflections/transparent-reflected-sublayers-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/reflections/transparent-reflected-sublayers-expected.txt
@@ -5,7 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 347x19 text run at (0,0) width 347: "You should see four green squares in a vertical line below." - LayoutText {#text} at (0,0) size 0x0 layer at (8,160) size 100x100 transparent LayoutBlockFlow (positioned) {DIV} at (8,160) size 100x100 [bgcolor=#008000] layer at (8,400) size 100x100
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/ruby/ruby-text-before-after-content-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/ruby/ruby-text-before-after-content-expected.txt index f743fcca..a36f624 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/ruby/ruby-text-before-after-content-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/ruby/ruby-text-before-after-content-expected.txt
@@ -22,4 +22,3 @@ LayoutText {#text} at (0,0) size 21x36 text run at (0,0) width 21: "B" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt index 34302b150..fc11f67 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x87 LayoutBlockFlow {BODY} at (8,8) size 784x71 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 370x70 clip at (9,9) size 353x68 LayoutListBox {SELECT} at (0,0) size 369.77x70 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {OPTION} at (1,1) size 352.77x17 [color=#FFFFCC] [bgcolor=#0000FF]
diff --git a/third_party/WebKit/LayoutTests/platform/win/html/details_summary/details-open2-expected.txt b/third_party/WebKit/LayoutTests/platform/win/html/details_summary/details-open2-expected.txt index 6ebdcb3..af7f2a5 100644 --- a/third_party/WebKit/LayoutTests/platform/win/html/details_summary/details-open2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/html/details_summary/details-open2-expected.txt
@@ -11,6 +11,5 @@ LayoutBlockFlow {DIV} at (0,20) size 784x22 LayoutTextControl {INPUT} at (0,0) size 173x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,31) size 169x16 LayoutBlockFlow {DIV} at (2,3) size 169x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/html/details_summary/details-replace-text-expected.txt b/third_party/WebKit/LayoutTests/platform/win/html/details_summary/details-replace-text-expected.txt index b02c1eaa..0b569d6a 100644 --- a/third_party/WebKit/LayoutTests/platform/win/html/details_summary/details-replace-text-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/html/details_summary/details-replace-text-expected.txt
@@ -14,7 +14,6 @@ text run at (0,0) width 64: "Details1" LayoutText {#text} at (64,0) size 4x19 text run at (64,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {SPAN} at (68,3) size 64x16 LayoutText {#text} at (0,0) size 64x16 text run at (0,0) width 64: "Details2"
diff --git a/third_party/WebKit/LayoutTests/platform/win/html/tabular_data/col_width_resizing_table-expected.txt b/third_party/WebKit/LayoutTests/platform/win/html/tabular_data/col_width_resizing_table-expected.txt index 0defe6b..6f2f836 100644 --- a/third_party/WebKit/LayoutTests/platform/win/html/tabular_data/col_width_resizing_table-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/html/tabular_data/col_width_resizing_table-expected.txt
@@ -35,4 +35,3 @@ LayoutText {#text} at (0,0) size 378x16 text run at (0,0) width 378: "Click me to test manually. The first column should grow to 500px." LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/http/tests/misc/location-replace-crossdomain-expected.txt b/third_party/WebKit/LayoutTests/platform/win/http/tests/misc/location-replace-crossdomain-expected.txt index d4f6273..dc234484 100644 --- a/third_party/WebKit/LayoutTests/platform/win/http/tests/misc/location-replace-crossdomain-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/http/tests/misc/location-replace-crossdomain-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {HTML} at (0,0) size 800x600 LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 304x154 LayoutIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #EEEEEE)] layer at (0,0) size 300x150
diff --git a/third_party/WebKit/LayoutTests/platform/win/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt b/third_party/WebKit/LayoutTests/platform/win/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt index 527c499a..c6cc0d2 100644 --- a/third_party/WebKit/LayoutTests/platform/win/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt
@@ -14,7 +14,6 @@ LayoutBlockFlow {P} at (0.50,126.50) size 135x9 LayoutText {#text} at (0,-2) size 12x12 text run at (0,-2) width 12: " " - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0.50,189.50) size 135x9 LayoutTable (anonymous) at (0.50,252.50) size 135x44 LayoutTableSection (anonymous) at (0,0) size 135x44
diff --git a/third_party/WebKit/LayoutTests/platform/win/http/tests/misc/slow-loading-image-in-pattern-expected.txt b/third_party/WebKit/LayoutTests/platform/win/http/tests/misc/slow-loading-image-in-pattern-expected.txt index 368ea23..388ccec3 100644 --- a/third_party/WebKit/LayoutTests/platform/win/http/tests/misc/slow-loading-image-in-pattern-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/http/tests/misc/slow-loading-image-in-pattern-expected.txt
@@ -8,7 +8,6 @@ LayoutBR {BR} at (596,0) size 0x19 LayoutText {#text} at (0,20) size 535x19 text run at (0,20) width 535: "You should see a 400x300 rect containing a tiled rendering of the Acid3 reference image." - LayoutText {#text} at (0,0) size 0x0 layer at (10,50) size 406x306 clip at (13,53) size 400x300 LayoutSVGRoot (positioned) {svg} at (10,50) size 406x306 LayoutSVGHiddenContainer {defs} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/http/tests/security/contentSecurityPolicy/object-src-param-code-blocked-expected.txt b/third_party/WebKit/LayoutTests/platform/win/http/tests/security/contentSecurityPolicy/object-src-param-code-blocked-expected.txt deleted file mode 100644 index 6ac9d59..0000000 --- a/third_party/WebKit/LayoutTests/platform/win/http/tests/security/contentSecurityPolicy/object-src-param-code-blocked-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE ERROR: Refused to load plugin data from 'http://127.0.0.1:8080/plugins/resources/mock-plugin.pl?code' because it violates the following Content Security Policy directive: "object-src http://localhost:8080". - -CONSOLE MESSAGE: line 16: PASS: Error occurred, so load was correctly blocked. -This test passes if there is a console message saying the plugin was blocked.
diff --git a/third_party/WebKit/LayoutTests/platform/win/http/tests/security/contentSecurityPolicy/object-src-param-movie-blocked-expected.txt b/third_party/WebKit/LayoutTests/platform/win/http/tests/security/contentSecurityPolicy/object-src-param-movie-blocked-expected.txt deleted file mode 100644 index d90778f..0000000 --- a/third_party/WebKit/LayoutTests/platform/win/http/tests/security/contentSecurityPolicy/object-src-param-movie-blocked-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE ERROR: Refused to load plugin data from 'http://127.0.0.1:8080/plugins/resources/mock-plugin.pl?movie' because it violates the following Content Security Policy directive: "object-src http://localhost:8080". - -CONSOLE MESSAGE: line 16: PASS: Error occurred, so load was correctly blocked. -This test passes if there is a console message saying the plugin was blocked.
diff --git a/third_party/WebKit/LayoutTests/platform/win/http/tests/security/contentSecurityPolicy/object-src-param-src-blocked-expected.txt b/third_party/WebKit/LayoutTests/platform/win/http/tests/security/contentSecurityPolicy/object-src-param-src-blocked-expected.txt deleted file mode 100644 index c249a48a..0000000 --- a/third_party/WebKit/LayoutTests/platform/win/http/tests/security/contentSecurityPolicy/object-src-param-src-blocked-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE ERROR: Refused to load plugin data from 'http://127.0.0.1:8080/plugins/resources/mock-plugin.pl?src' because it violates the following Content Security Policy directive: "object-src http://localhost:8080". - -CONSOLE MESSAGE: line 16: PASS: Error occurred, so load was correctly blocked. -This test passes if there is a console message saying the plugin was blocked.
diff --git a/third_party/WebKit/LayoutTests/platform/win/http/tests/security/contentSecurityPolicy/object-src-param-url-blocked-expected.txt b/third_party/WebKit/LayoutTests/platform/win/http/tests/security/contentSecurityPolicy/object-src-param-url-blocked-expected.txt deleted file mode 100644 index ee2140a..0000000 --- a/third_party/WebKit/LayoutTests/platform/win/http/tests/security/contentSecurityPolicy/object-src-param-url-blocked-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE ERROR: Refused to load plugin data from 'http://127.0.0.1:8080/plugins/resources/mock-plugin.pl?url' because it violates the following Content Security Policy directive: "object-src http://localhost:8080". - -CONSOLE MESSAGE: line 16: PASS: Error occurred, so load was correctly blocked. -This test passes if there is a console message saying the plugin was blocked.
diff --git a/third_party/WebKit/LayoutTests/platform/win/http/tests/security/cross-frame-access-callback-explicit-domain-ALLOW-expected.txt b/third_party/WebKit/LayoutTests/platform/win/http/tests/security/cross-frame-access-callback-explicit-domain-ALLOW-expected.txt deleted file mode 100644 index 3685219e..0000000 --- a/third_party/WebKit/LayoutTests/platform/win/http/tests/security/cross-frame-access-callback-explicit-domain-ALLOW-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -The child frame will get a function from the parent frame, set the document.domain property and then try to use the function. The function should still be able to access parent frame properties. - -PASS: canGet('window.location.href') should be 'true' and is. -PASS: window.thisIsTopFrame should be 'true' and is. -
diff --git a/third_party/WebKit/LayoutTests/platform/win/images/imagemap-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/win/images/imagemap-circle-focus-ring-expected.txt index d298933..551d1972 100644 --- a/third_party/WebKit/LayoutTests/platform/win/images/imagemap-circle-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/images/imagemap-circle-focus-ring-expected.txt
@@ -15,4 +15,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (0,0) size 128x128 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/images/imagemap-focus-ring-in-positioned-container-expected.txt b/third_party/WebKit/LayoutTests/platform/win/images/imagemap-focus-ring-in-positioned-container-expected.txt index c36591a3..d48be76 100644 --- a/third_party/WebKit/LayoutTests/platform/win/images/imagemap-focus-ring-in-positioned-container-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/images/imagemap-focus-ring-in-positioned-container-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x20 LayoutText {#text} at (0,0) size 523x19 text run at (0,0) width 523: "Tests that we paint area outline properly when the image is inside positioned containers." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (20,50) size 0x0 LayoutBlockFlow (positioned) {DIV} at (20,50) size 0x0 layer at (30,60) size 50x55
diff --git a/third_party/WebKit/LayoutTests/platform/win/images/imagemap-focus-ring-with-paint-root-offset-expected.txt b/third_party/WebKit/LayoutTests/platform/win/images/imagemap-focus-ring-with-paint-root-offset-expected.txt index e984f3a..7e9c8d8 100644 --- a/third_party/WebKit/LayoutTests/platform/win/images/imagemap-focus-ring-with-paint-root-offset-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/images/imagemap-focus-ring-with-paint-root-offset-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x20 LayoutText {#text} at (0,0) size 416x19 text run at (0,0) width 416: "Tests that we paint area outline properly when the paintroot is shifted." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (5,50) size 50x55 LayoutBlockFlow (positioned) {DIV} at (5,50) size 50x55 LayoutImage {IMG} at (0,0) size 50x50
diff --git a/third_party/WebKit/LayoutTests/platform/win/images/imagemap-focus-ring-with-scale-transform-expected.txt b/third_party/WebKit/LayoutTests/platform/win/images/imagemap-focus-ring-with-scale-transform-expected.txt index fceedccd..c78ff966 100644 --- a/third_party/WebKit/LayoutTests/platform/win/images/imagemap-focus-ring-with-scale-transform-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/images/imagemap-focus-ring-with-scale-transform-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x20 LayoutText {#text} at (0,0) size 464x19 text run at (0,0) width 464: "Tests that we paint area outline properly when the image's container is scaled." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (100,100) size 100x100 LayoutBlockFlow (positioned) {DIV} at (100,100) size 100x100 LayoutImage {IMG} at (0,0) size 50x50
diff --git a/third_party/WebKit/LayoutTests/platform/win/images/imagemap-overflowing-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/win/images/imagemap-overflowing-circle-focus-ring-expected.txt index dc9499d..0200378 100644 --- a/third_party/WebKit/LayoutTests/platform/win/images/imagemap-overflowing-circle-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/images/imagemap-overflowing-circle-focus-ring-expected.txt
@@ -16,4 +16,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (0,0) size 128x128 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/images/imagemap-overflowing-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/win/images/imagemap-overflowing-polygon-focus-ring-expected.txt index aff3f85..64e7871 100644 --- a/third_party/WebKit/LayoutTests/platform/win/images/imagemap-overflowing-polygon-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/images/imagemap-overflowing-polygon-focus-ring-expected.txt
@@ -16,4 +16,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (0,0) size 128x128 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/images/imagemap-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/win/images/imagemap-polygon-focus-ring-expected.txt index fb89379..5c215b2 100644 --- a/third_party/WebKit/LayoutTests/platform/win/images/imagemap-polygon-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/images/imagemap-polygon-focus-ring-expected.txt
@@ -15,4 +15,3 @@ LayoutText {#text} at (0,0) size 0x0 LayoutImage {IMG} at (0,0) size 128x128 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/block-selection-gap-stale-cache-expected.txt b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/block-selection-gap-stale-cache-expected.txt index 3be4717..dd2559c 100644 --- a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/block-selection-gap-stale-cache-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/block-selection-gap-stale-cache-expected.txt
@@ -9,4 +9,3 @@ LayoutBlockFlow (anonymous) at (0,100) size 784x20 LayoutText {#text} at (0,0) size 4x19 text run at (0,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt index 95c80a7..5c1b5b89c 100644 --- a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt
@@ -106,10 +106,6 @@ { "object": "LayoutText #text", "reason": "geometry" - }, - { - "object": "LayoutText #text", - "reason": "geometry" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/details-open-repaint-expected.txt b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/details-open-repaint-expected.txt index 04df947..28dd4c89 100644 --- a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/details-open-repaint-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/details-open-repaint-expected.txt
@@ -61,10 +61,6 @@ { "object": "LayoutText #text", "reason": "appeared" - }, - { - "object": "LayoutText #text", - "reason": "appeared" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt index c55864a..d18be3a 100644 --- a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt
@@ -9,7 +9,6 @@ LayoutBlockFlow (anonymous) at (0,22) size 784x20 LayoutText {#text} at (0,0) size 4x19 text run at (0,0) width 4: " " - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,42) size 784x0 layer at (10,11) size 169x16 LayoutBlockFlow {DIV} at (2,3) size 169x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/repaint-svg-after-style-change-expected.txt b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/repaint-svg-after-style-change-expected.txt index 005a4dd..a530f35 100644 --- a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/repaint-svg-after-style-change-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/repaint-svg-after-style-change-expected.txt
@@ -8,4 +8,3 @@ LayoutSVGPath {path} at (0,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [data="M 0 0 L 0 200 L 200 200 L 200 0 Z"] LayoutSVGPath {path} at (0,0) size 200x200 [fill={[type=SOLID] [color=#008000]}] [data="M 0 0 L 0 200 L 200 200 L 200 0 Z"] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/text-in-relative-positioned-inline-expected.txt b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/text-in-relative-positioned-inline-expected.txt index 1083c9c..a01ad78 100644 --- a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/text-in-relative-positioned-inline-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/text-in-relative-positioned-inline-expected.txt
@@ -9,7 +9,7 @@ { "object": "LayoutBlockFlow DIV", "rect": [108, 8, 684, 100], - "reason": "geometry" + "reason": "style change" }, { "object": "LayoutInline (relative positioned) SPAN id='target'", @@ -34,8 +34,12 @@ "reason": "disappeared" }, { + "object": "LayoutText #text", + "reason": "disappeared" + }, + { "object": "LayoutBlockFlow DIV", - "reason": "geometry" + "reason": "style change" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-inline-block-expected.txt b/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-inline-block-expected.txt index 8e983bab..4e5ac97 100644 --- a/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-inline-block-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-inline-block-expected.txt
@@ -8,6 +8,5 @@ text run at (0,1) width 24: "x" LayoutText {#text} at (24,1) size 22x55 text run at (24,1) width 22: "y" - LayoutText {#text} at (0,0) size 0x0 selection start: position 0 of child 0 {#text} of child 0 {DIV} of body selection end: position 1 of child 1 {#text} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt index 56e88501..7038969 100644 --- a/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt
@@ -12,6 +12,5 @@ text run at (0,1) width 96: "text" text run at (96,1) width 92 RTL: "\x{645}\x{62A}\x{646}:" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 selection start: position 5 of child 0 {#text} of child 2 {SPAN} of body selection end: position 13 of child 0 {#text} of child 2 {SPAN} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/plugins/webview-plugin-type-change-expected.txt b/third_party/WebKit/LayoutTests/platform/win/plugins/webview-plugin-type-change-expected.txt index de8a322..5c924d06 100644 --- a/third_party/WebKit/LayoutTests/platform/win/plugins/webview-plugin-type-change-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/plugins/webview-plugin-type-change-expected.txt
@@ -5,6 +5,5 @@ LayoutBlockFlow {HTML} at (0,0) size 800x173 LayoutBlockFlow {BODY} at (8,8) size 784x157 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 152x152 LayoutEmbeddedObject {EMBED} at (0,0) size 152x152 [border: (1px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/animate-elem-24-t-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/animate-elem-24-t-expected.txt index f212028..a4eb2c0 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/animate-elem-24-t-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/animate-elem-24-t-expected.txt
@@ -28,9 +28,6 @@ LayoutSVGText {text} at (0,-17) size 74x22 [transform={m=((0.87,-0.50)(0.50,0.87)) t=(0.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (0,-17) size 74x22 chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 11 width 74.00: "It's alive!" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGText {text} at (10,304) size 261x46 contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,304) size 261x46 chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 16 width 261.00: "$Revision: 1.7 $"
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/animate-elem-77-t-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/animate-elem-77-t-expected.txt index 6a58b19..89f227f7 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/animate-elem-77-t-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/animate-elem-77-t-expected.txt
@@ -79,7 +79,6 @@ LayoutSVGText {text} at (10,3) size 14x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,3) size 14x22 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 14.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (10,3) size 14x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(140.00,0.00)}] LayoutSVGText {text} at (10,3) size 14x22 contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,3) size 14x22 @@ -124,18 +123,14 @@ LayoutSVGText {text} at (-4,3) size 14x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(40.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (-4,3) size 14x22 chunk 1 (end anchor) text run 1 at (-4.00,20.00) startOffset 0 endOffset 1 width 14.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (146,3) size 14x22 LayoutSVGText {text} at (106,3) size 14x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(40.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (106,3) size 14x22 chunk 1 (end anchor) text run 1 at (106.00,20.00) startOffset 0 endOffset 1 width 14.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {a} at (256,3) size 14x22 LayoutSVGText {text} at (216,3) size 14x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(40.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (216,3) size 14x22 chunk 1 (end anchor) text run 1 at (216.00,20.00) startOffset 0 endOffset 1 width 14.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (10,-7) size 271x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,70.00)}] LayoutSVGHiddenContainer {defs} at (10,-7) size 51x34 LayoutSVGContainer {g} at (10,-7) size 51x34 @@ -172,18 +167,14 @@ LayoutSVGText {text} at (10,-7) size 21x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,-7) size 21x34 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 21.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (150,-7) size 21x34 LayoutSVGText {text} at (120,-7) size 21x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (120,-7) size 21x34 chunk 1 text run 1 at (120.00,20.00) startOffset 0 endOffset 1 width 21.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {a} at (260,-7) size 21x34 LayoutSVGText {text} at (230,-7) size 21x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (230,-7) size 21x34 chunk 1 text run 1 at (230.00,20.00) startOffset 0 endOffset 1 width 21.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (10,-8) size 271x35 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,105.00)}] LayoutSVGHiddenContainer {defs} at (10,-8) size 51x35 LayoutSVGContainer {g} at (10,-8) size 51x35 @@ -220,18 +211,14 @@ LayoutSVGText {text} at (10,-7) size 21x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,-7) size 21x34 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 21.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (40,-7) size 21x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(110.00,0.00)}] LayoutSVGText {text} at (10,-7) size 21x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,-7) size 21x34 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 21.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {a} at (40,-7) size 21x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(220.00,0.00)}] LayoutSVGText {text} at (10,-7) size 21x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,-7) size 21x34 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 21.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (10,3) size 261x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,140.00)}] LayoutSVGHiddenContainer {defs} at (10,3) size 41x22 LayoutSVGContainer {g} at (10,3) size 41x22 @@ -268,18 +255,14 @@ LayoutSVGText {text} at (8,3) size 13x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (8,3) size 13x22 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 11.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (38,3) size 13x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(110.00,0.00)}] LayoutSVGText {text} at (8,3) size 13x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (8,3) size 13x22 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 11.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (38,3) size 13x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(220.00,0.00)}] LayoutSVGText {text} at (8,3) size 13x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (8,3) size 13x22 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 11.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (10,2) size 264x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,175.00)}] LayoutSVGHiddenContainer {defs} at (10,2) size 44x23 LayoutSVGContainer {g} at (10,2) size 44x23 @@ -316,15 +299,11 @@ LayoutSVGText {text} at (10,2) size 14x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,2) size 14x23 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 14.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (40,2) size 14x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(110.00,0.00)}] LayoutSVGText {text} at (10,2) size 14x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,2) size 14x23 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 14.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGContainer {g} at (40,2) size 14x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(220.00,0.00)}] LayoutSVGText {text} at (10,2) size 14x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] contains 1 chunk(s) LayoutSVGInlineText {#text} at (10,2) size 14x23 chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 1 width 14.00: "A" - LayoutSVGInlineText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/pservers-grad-13-b-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/pservers-grad-13-b-expected.png index 93f3fba..eb95afdd 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/pservers-grad-13-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/pservers-grad-13-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/as-background-image/svg-as-background-3-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/as-background-image/svg-as-background-3-expected.png index b83b099d..5bcecf6 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/as-background-image/svg-as-background-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/as-background-image/svg-as-background-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/as-background-image/svg-as-background-with-relative-size-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/as-background-image/svg-as-background-with-relative-size-expected.png new file mode 100644 index 0000000..6c2dcc4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/svg/as-background-image/svg-as-background-with-relative-size-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/batik/text/xmlSpace-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/batik/text/xmlSpace-expected.txt index ae16705..7203606 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/batik/text/xmlSpace-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/batik/text/xmlSpace-expected.txt
@@ -258,7 +258,6 @@ LayoutSVGInlineText {#text} at (236,358) size 33x22 chunk 1 text run 1 at (236.00,375.00) startOffset 0 endOffset 2 width 19.00: "X " chunk 1 text run 1 at (255.00,375.00) startOffset 0 endOffset 1 width 14.00: "X" - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGText {text} at (345,359) size 80x17.59 contains 1 chunk(s) LayoutSVGInlineText {#text} at (345,359) size 80x8 chunk 1 text run 1 at (345.00,365.00) startOffset 0 endOffset 16 width 80.00: "unknown element "
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/canvas/canvas-draw-image-globalalpha-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/canvas/canvas-draw-image-globalalpha-expected.txt index 8d105e04..d7800601 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/canvas/canvas-draw-image-globalalpha-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/canvas/canvas-draw-image-globalalpha-expected.txt
@@ -4,6 +4,5 @@ LayoutBlockFlow {HTML} at (0,0) size 800x121 LayoutBlockFlow {BODY} at (8,8) size 784x105 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 100x100 LayoutHTMLCanvas {CANVAS} at (0,0) size 100x100
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt index 0bd4ccc..6070c9b 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt
@@ -10,5 +10,4 @@ LayoutSVGInlineText {#text} at (276.50,2085) size 247x19 chunk 1 (middle anchor) text run 1 at (276.50,2100.00) startOffset 0 endOffset 46 width 247.00: "The test passes if the circle sits in the rect" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 scrolled to 0,1700
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/custom/image-rescale-clip-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/custom/image-rescale-clip-expected.txt index a3acf285..6f0863e 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/custom/image-rescale-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/custom/image-rescale-clip-expected.txt
@@ -12,6 +12,5 @@ layer at (8,8) size 160x105 backgroundClip at (8,8) size 150x15 clip at (8,8) size 150x15 LayoutBlockFlow (positioned) {DIV} at (8,8) size 160x105 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (13,13) size 160x105 backgroundClip at (8,8) size 150x15 clip at (8,8) size 150x15 LayoutImage (relative positioned) {IMG} at (0,0) size 160x105
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/custom/mouse-move-on-svg-container-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/custom/mouse-move-on-svg-container-expected.txt index 0ad21c49..fd148ef7 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/custom/mouse-move-on-svg-container-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/custom/mouse-move-on-svg-container-expected.txt
@@ -10,6 +10,5 @@ LayoutSVGInlineText {#text} at (56,35) size 288x19 chunk 1 (middle anchor) text run 1 at (56.00,50.00) startOffset 0 endOffset 49 width 288.00: "The circle should stay in the bottom-right corner" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 selection start: position 0 of child 0 {#text} of child 3 {text} of child 1 {svg} of body selection end: position 25 of child 0 {#text} of child 3 {text} of child 1 {svg} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/custom/mouse-move-on-svg-root-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/custom/mouse-move-on-svg-root-expected.txt index 270e5736..4d6b5495 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/custom/mouse-move-on-svg-root-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/custom/mouse-move-on-svg-root-expected.txt
@@ -9,5 +9,4 @@ LayoutSVGInlineText {#text} at (99.50,35) size 201x19 chunk 1 (middle anchor) text run 1 at (99.50,50.00) startOffset 0 endOffset 34 width 201.00: "The circle should be in the middle" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 caret: position 16 of child 0 {#text} of child 3 {text} of child 1 {svg} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/custom/object-no-size-attributes-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/custom/object-no-size-attributes-expected.txt index fac6cf1e..ebceb32 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/custom/object-no-size-attributes-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/custom/object-no-size-attributes-expected.txt
@@ -4,7 +4,6 @@ LayoutBlockFlow {html} at (0,0) size 800x121 LayoutBlockFlow {body} at (8,8) size 784x105 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 100x100 LayoutEmbeddedObject {object} at (0,0) size 100x100 [bgcolor=#FF0000] layer at (0,0) size 100x100
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/custom/radial-gradient-with-outstanding-focalPoint-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/custom/radial-gradient-with-outstanding-focalPoint-expected.png deleted file mode 100644 index fc743a89..0000000 --- a/third_party/WebKit/LayoutTests/platform/win/svg/custom/radial-gradient-with-outstanding-focalPoint-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/hixie/mixed/003-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/hixie/mixed/003-expected.txt index 57a6673..d992cd7 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/hixie/mixed/003-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/hixie/mixed/003-expected.txt
@@ -12,7 +12,6 @@ LayoutSVGRoot {svg} at (0,0) size 200x200 LayoutSVGEllipse {circle} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [cx=50.00] [cy=50.00] [r=50.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (10,19) size 379x16 LayoutBlockFlow {div} at (2,3) size 379x16 LayoutText {#text} at (0,0) size 136x16
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/bbox-with-glyph-overflow-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/text/bbox-with-glyph-overflow-expected.txt index 4d774a1..17b4265 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/bbox-with-glyph-overflow-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/bbox-with-glyph-overflow-expected.txt
@@ -53,4 +53,3 @@ LayoutSVGRect {rect} at (37.44,299.84) size 319.56x100.30 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=37.44] [y=299.84] [width=319.56] [height=100.30] LayoutSVGRect {rect} at (50,420) size 133x70 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=50.00] [y=420.00] [width=133.00] [height=70.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/bbox-with-glyph-overflow-on-path-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/text/bbox-with-glyph-overflow-on-path-expected.txt index 1f8183d8..a041c03 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/bbox-with-glyph-overflow-on-path-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/bbox-with-glyph-overflow-on-path-expected.txt
@@ -108,4 +108,3 @@ LayoutSVGRect {rect} at (38.05,204.25) size 378.14x158.38 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=38.05] [y=204.25] [width=378.14] [height=158.38] LayoutSVGRect {rect} at (50,395) size 133x70 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=50.00] [y=395.00] [width=133.00] [height=70.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/bbox-with-glyph-overflow-zoomed-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/text/bbox-with-glyph-overflow-zoomed-expected.txt index 0784e2f..88cf85ef 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/bbox-with-glyph-overflow-zoomed-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/bbox-with-glyph-overflow-zoomed-expected.txt
@@ -50,4 +50,3 @@ LayoutSVGRect {rect} at (17.77,28.34) size 70.55x27.22 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=17.77] [y=28.34] [width=70.55] [height=27.22] LayoutSVGRect {rect} at (20,61.13) size 32.77x17.77 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=20.00] [y=61.13] [width=32.77] [height=17.77] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/combining-character-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/text/combining-character-queries-expected.txt index 5d0d76b..be3bef1 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/combining-character-queries-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/combining-character-queries-expected.txt
@@ -503,5 +503,3 @@ chunk 1 text run 1 at (360.00,350.00) startOffset 0 endOffset 1 width 26.00 RTL: "\x{FDB0}" chunk 1 text run 1 at (386.00,350.00) startOffset 0 endOffset 2 width 7.00: "i\x{333}" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/ligature-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/text/ligature-queries-expected.txt index 9248124..7bf266b 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/ligature-queries-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/ligature-queries-expected.txt
@@ -490,5 +490,3 @@ chunk 1 text run 23 at (486.44,438.78) startOffset 22 endOffset 23 width 25.00: "f" LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/surrogate-pair-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/text/surrogate-pair-queries-expected.txt index a8aab5a2..854f19d 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/surrogate-pair-queries-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/surrogate-pair-queries-expected.txt
@@ -336,5 +336,3 @@ LayoutSVGInlineText {#text} at (354,318) size 96x40 chunk 1 text run 1 at (354.00,350.00) startOffset 0 endOffset 7 width 96.00 RTL override: "\x{D83C}\x{DFB6}\x{D801}\x{DC37}\x{30C}\x{D83C}\x{DFB6}" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-background-images-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-background-images-expected.txt index 1bb3ebc..cbae191 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-background-images-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-background-images-expected.txt
@@ -14,6 +14,3 @@ text run at (462,143) width 3: " " LayoutImage {IMG} at (475.81,11.56) size 129.63x129.63 [border: (1.16px solid #000000)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-clip-path-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-clip-path-expected.txt index 78b66fa..0e498ff 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-clip-path-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-clip-path-expected.txt
@@ -16,17 +16,6 @@ LayoutSVGRect {rect} at (0,0) size 0.50x0.50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=0.50] [height=0.50] LayoutSVGRect {rect} at (0.50,0.50) size 0.50x0.50 [fill={[type=SOLID] [color=#000000]}] [x=0.50] [y=0.50] [width=0.50] [height=0.50] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (0,0) size 415x415 LayoutBlockFlow (positioned) {DIV} at (0,0) size 414.72x414.72 [bgcolor=#000000] layer at (0,0) size 207x207
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-hixie-mixed-008-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-hixie-mixed-008-expected.txt index 71074ea..61555e6 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-hixie-mixed-008-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-hixie-mixed-008-expected.txt
@@ -15,6 +15,3 @@ LayoutText {#text} at (139,1) size 122x57 text run at (139,1) width 122: "TEST" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-hixie-rendering-model-004-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-hixie-rendering-model-004-expected.txt index 4045f0e..6278557 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-hixie-rendering-model-004-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-hixie-rendering-model-004-expected.txt
@@ -11,6 +11,3 @@ LayoutSVGRoot {svg} at (0,0) size 144x144 LayoutSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#000080]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt index 1758416..d37d9549 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt
@@ -14,7 +14,6 @@ LayoutBlockFlow {P} at (0.58,129.38) size 138.88x9.25 LayoutText {#text} at (0,-2) size 12x12 text run at (0,-2) width 12: " " - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0.58,194.17) size 138.88x9.25 LayoutTable (anonymous) at (0.58,258.97) size 138x45 LayoutTableSection (anonymous) at (0,0) size 138x45
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt index 1f17663..49f847d 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt
@@ -6,10 +6,6 @@ LayoutText {#text} at (159,149) size 4x14 text run at (159,149) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (6,6) size 160x160 LayoutEmbeddedObject {OBJECT} at (0,0) size 159.67x159.67 [border: (1.38px dashed #800000)] layer at (0,0) size 153x153
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt index e575d35..8fc0c43 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt
@@ -8,9 +8,6 @@ LayoutBR {BR} at (351,338) size 1x14 LayoutText {#text} at (0,352) size 231x14 text run at (0,352) width 231: "The image of Tux should fill the entire red square." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (6,6) size 349x349 LayoutEmbeddedObject {OBJECT} at (0,0) size 348.59x348.59 [border: (0.69px solid #FF0000)] layer at (0,0) size 347x347
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/text/zoom-hixie-mixed-008-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/text/zoom-hixie-mixed-008-expected.txt index afa7b47..76fd7f3 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/text/zoom-hixie-mixed-008-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/text/zoom-hixie-mixed-008-expected.txt
@@ -15,6 +15,3 @@ LayoutText {#text} at (113,1) size 174x81 text run at (113,1) width 174: "TEST" LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/text/zoom-hixie-rendering-model-004-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/text/zoom-hixie-rendering-model-004-expected.txt index 65386ef..7a2edb2b 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/text/zoom-hixie-rendering-model-004-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/text/zoom-hixie-rendering-model-004-expected.txt
@@ -11,6 +11,3 @@ LayoutSVGRoot {svg} at (0,0) size 100x100 LayoutSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#000080]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt b/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt index 30b69f2..6f432cb77 100644 --- a/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt
@@ -11,7 +11,6 @@ text run at (489,228) width 4: " " LayoutBlockFlow {DIV} at (513,21) size 202x202 [border: (1px solid #000000)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (30,500) size 303x100 LayoutBlockFlow (positioned) {DIV} at (30,500) size 303.25x100 LayoutInline {SPAN} at (0,0) size 304x19 [color=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt b/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt index 74e9e579..8d6b5d6 100644 --- a/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (0,0) size 785x600 [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (21,21) size 402x402 [border: (1px solid #000000)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (42,42) size 340x340 LayoutBlockFlow {DIV} at (21,21) size 340x340 [bgcolor=#DDDDDD] [border: (1px solid #000000)] layer at (63,63) size 300x300
diff --git a/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt b/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt index 6a9537c6..49f75531 100644 --- a/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt
@@ -15,7 +15,6 @@ text run at (243,475) width 4: " " LayoutBlockFlow {DIV} at (267,268) size 202x202 [border: (1px solid #000000)] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (30,500) size 483x180 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600 LayoutBlockFlow (positioned) {DIV} at (30,500) size 482.81x180 LayoutInline {SPAN} at (0,0) size 288x19 [color=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/win/transforms/bounding-rect-zoom-expected.txt b/third_party/WebKit/LayoutTests/platform/win/transforms/bounding-rect-zoom-expected.txt index 9127724c..793d891 100644 --- a/third_party/WebKit/LayoutTests/platform/win/transforms/bounding-rect-zoom-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/transforms/bounding-rect-zoom-expected.txt
@@ -15,15 +15,9 @@ LayoutTableCell {TD} at (1,1) size 181x17 [r=0 c=0 rs=1 cs=1] LayoutText {#text} at (0,0) size 141x16 text run at (0,0) width 141: "getClientBoundingRect():" - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutTableCell {TD} at (183,1) size 601x17 [r=0 c=1 rs=1 cs=1] LayoutText {#text} at (0,0) size 94x16 text run at (0,0) width 94: "getClientRects():" - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (90,90) size 90x90 LayoutBlockFlow (positioned) {DIV} at (90,90) size 90x90 [bgcolor=#FF0000] layer at (90,90) size 90x90
diff --git a/third_party/WebKit/LayoutTests/platform/win/transforms/identity-matrix-expected.txt b/third_party/WebKit/LayoutTests/platform/win/transforms/identity-matrix-expected.txt index 397bad79..a9414b9 100644 --- a/third_party/WebKit/LayoutTests/platform/win/transforms/identity-matrix-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/transforms/identity-matrix-expected.txt
@@ -7,7 +7,5 @@ text run at (0,0) width 231: "The following divs should be identical: " LayoutBR {BR} at (0,0) size 0x0 LayoutBlockFlow (floating) {DIV} at (5,25) size 110x110 [bgcolor=#87CEEB] [border: (5px solid #000000)] - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (133,33) size 110x110 LayoutBlockFlow (floating) {DIV} at (125,25) size 110x110 [bgcolor=#87CEEB] [border: (5px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/compositing/geometry/clipping-foreground-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/compositing/geometry/clipping-foreground-expected.txt new file mode 100644 index 0000000..667ca01 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/compositing/geometry/clipping-foreground-expected.txt
@@ -0,0 +1,52 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 411x19 + text run at (0,0) width 411: "The layering of the boxes should not be affected by overflow:hidden." + LayoutBlockFlow (anonymous) at (0,36) size 784x477 + LayoutText {#text} at (320,305) size 4x19 + text run at (320,305) width 4: " " + LayoutText {#text} at (0,0) size 0x0 +layer at (68,261) size 200x200 layerType: background only +layer at (28,221) size 150x150 + LayoutBlockFlow (positioned) zI: -1 {DIV} at (-40,-40) size 150x150 [color=#808080] [bgcolor=#C86464] [border: (2px solid #000000)] + LayoutText zI: -1 {#text} at (22,22) size 106x40 + text run at (22,22) width 106: "Behind" +layer at (50,303) size 100x100 + LayoutBlockFlow (positioned) {DIV} at (22,82) size 100x100 [bgcolor=#008000] [border: (2px solid #000000)] + LayoutText {#text} at (22,22) size 55x41 + text run at (22,22) width 55: "Behind" + text run at (22,43) width 53: "behind" +layer at (68,261) size 200x200 layerType: foreground only + LayoutBlockFlow (relative positioned) {DIV} at (60,217) size 200x200 [color=#0000FF] [bgcolor=#FFFFFFCC] [border: (10px solid #000000)] + LayoutText {#text} at (30,30) size 126x81 + text run at (30,30) width 60: "Box" + text run at (30,71) width 126: "contents" +layer at (158,351) size 150x150 + LayoutBlockFlow (positioned) zI: 1 {DIV} at (90,90) size 150x150 [color=#808080] [bgcolor=#C8C880] [border: (2px solid #000000)] + LayoutText zI: 1 {#text} at (22,22) size 87x81 + text run at (22,22) width 33: "In" + text run at (22,63) width 87: "Front" +layer at (392,104) size 200x200 clip at (402,114) size 180x180 scrollWidth 230 scrollHeight 230 layerType: background only +layer at (352,64) size 150x150 backgroundClip at (402,114) size 180x180 clip at (402,114) size 180x180 + LayoutBlockFlow (positioned) zI: -1 {DIV} at (-40,-40) size 150x150 [color=#808080] [bgcolor=#C86464] [border: (2px solid #000000)] + LayoutText zI: -1 {#text} at (22,22) size 106x40 + text run at (22,22) width 106: "Behind" +layer at (374,146) size 100x100 backgroundClip at (402,114) size 180x180 clip at (402,114) size 180x180 + LayoutBlockFlow (positioned) {DIV} at (22,82) size 100x100 [bgcolor=#008000] [border: (2px solid #000000)] + LayoutText {#text} at (22,22) size 55x41 + text run at (22,22) width 55: "Behind" + text run at (22,43) width 53: "behind" +layer at (392,104) size 200x200 clip at (402,114) size 180x180 scrollWidth 230 scrollHeight 230 layerType: foreground only + LayoutBlockFlow (relative positioned) {DIV} at (384,60) size 200x200 [color=#0000FF] [bgcolor=#FFFFFFCC] [border: (10px solid #000000)] + LayoutText {#text} at (30,30) size 126x81 + text run at (30,30) width 60: "Box" + text run at (30,71) width 126: "contents" +layer at (482,194) size 150x150 backgroundClip at (402,114) size 180x180 clip at (402,114) size 180x180 + LayoutBlockFlow (positioned) zI: 1 {DIV} at (90,90) size 150x150 [color=#808080] [bgcolor=#C8C880] [border: (2px solid #000000)] + LayoutText zI: 1 {#text} at (22,22) size 87x81 + text run at (22,22) width 33: "In" + text run at (22,63) width 87: "Front"
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/compositing/iframes/composited-iframe-alignment-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/compositing/iframes/composited-iframe-alignment-expected.txt new file mode 100644 index 0000000..00c4f95f --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/compositing/iframes/composited-iframe-alignment-expected.txt
@@ -0,0 +1,21 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x76 + LayoutBlockFlow {HTML} at (0,0) size 800x76 + LayoutBlockFlow {BODY} at (8,8) size 784x60 + LayoutText {#text} at (0,0) size 766x39 + text run at (0,0) width 567: "Simple test of composited iframe content. There should be a blue box with a gray background " + text run at (567,0) width 199: "inside the black border. The gray" + text run at (0,20) width 334: "background should fit perfectly within the block border " + text run at (334,20) width 84: "with no gaps. " + LayoutBR {BR} at (0,0) size 0x0 + LayoutBR {BR} at (0,40) size 0x19 +layer at (100,100) size 440x340 + LayoutIFrame (positioned) {IFRAME} at (100,100) size 440x340 [border: (20px solid #000000)] + layer at (0,0) size 400x300 + LayoutView at (0,0) size 400x300 + layer at (0,0) size 400x230 + LayoutBlockFlow {HTML} at (0,0) size 400x230 + LayoutBlockFlow {BODY} at (8,10) size 384x210 [bgcolor=#C0C0C0] + layer at (18,10) size 210x210 + LayoutBlockFlow {DIV} at (10,0) size 210x210 [bgcolor=#0000FF]
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/compositing/overflow/clip-parent-reset-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/compositing/overflow/clip-parent-reset-expected.txt new file mode 100644 index 0000000..408e517 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/compositing/overflow/clip-parent-reset-expected.txt
@@ -0,0 +1,14 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x186 + LayoutBlockFlow {HTML} at (0,0) size 800x186 + LayoutBlockFlow {BODY} at (8,8) size 784x170 + LayoutBlockFlow (anonymous) at (0,150) size 784x20 + LayoutText {#text} at (0,0) size 595x19 + text run at (0,0) width 595: "This test verifies the clip parent of a layer gets correctly reset when it gained a non-composited clip." +layer at (8,8) size 150x150 transparent + LayoutBlockFlow {DIV} at (0,0) size 150x150 [bgcolor=#FF0000] +layer at (8,8) size 100x100 scrollWidth 200 scrollHeight 200 + LayoutBlockFlow {DIV} at (0,0) size 100x100 +layer at (8,8) size 200x200 backgroundClip at (8,8) size 100x100 clip at (8,8) size 100x100 + LayoutBlockFlow {DIV} at (0,0) size 200x200 [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/compositing/video-frame-size-change-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/compositing/video-frame-size-change-expected.txt new file mode 100644 index 0000000..8cda59d --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/compositing/video-frame-size-change-expected.txt
@@ -0,0 +1,26 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x245 + LayoutBlockFlow {HTML} at (0,0) size 800x245 + LayoutBlockFlow {BODY} at (8,16) size 784x221 + LayoutBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 457x19 + text run at (0,0) width 457: "Tests decoding and rendering a video element that has a changing resolution." + LayoutBlockFlow (anonymous) at (0,36) size 784x185 + LayoutText {#text} at (320,165) size 4x19 + text run at (320,165) width 4: " " + LayoutText {#text} at (0,0) size 0x0 +layer at (8,52) size 320x180 + LayoutVideo {VIDEO} at (0,0) size 320x180 +layer at (332,52) size 320x180 + LayoutVideo {VIDEO} at (324,0) size 320x180 +layer at (8,52) size 320x180 + LayoutFlexibleBox (relative positioned) {DIV} at (0,0) size 320x180 + LayoutBlockFlow {DIV} at (0,148) size 320x32 +layer at (8,52) size 320x138 + LayoutFlexibleBox (relative positioned) {DIV} at (0,0) size 320x138 +layer at (332,52) size 320x180 + LayoutFlexibleBox (relative positioned) {DIV} at (0,0) size 320x180 + LayoutBlockFlow {DIV} at (0,148) size 320x32 +layer at (332,52) size 320x138 + LayoutFlexibleBox (relative positioned) {DIV} at (0,0) size 320x138
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt new file mode 100644 index 0000000..b4a2a21 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt
@@ -0,0 +1,12 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x261 + LayoutBlockFlow {HTML} at (0,0) size 800x261 + LayoutBlockFlow {BODY} at (8,8) size 784x245 + LayoutText {#text} at (240,225) size 4x19 + text run at (240,225) width 4: " " + LayoutText {#text} at (0,0) size 0x0 +layer at (28,28) size 200x200 + LayoutHTMLCanvas {CANVAS} at (20,20) size 200x200 [bgcolor=#00008000] +layer at (272,28) size 200x200 + LayoutHTMLCanvas {CANVAS} at (264,20) size 200x200 [bgcolor=#00008000]
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/block-selection-gap-stale-cache-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/block-selection-gap-stale-cache-expected.txt new file mode 100644 index 0000000..dd2559c --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/block-selection-gap-stale-cache-expected.txt
@@ -0,0 +1,11 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {DIV} at (0,0) size 784x100 + LayoutBlockFlow {DIV} at (0,0) size 100x100 + LayoutBR {BR} at (100,100) size 0x0 + LayoutBlockFlow (anonymous) at (0,100) size 784x20 + LayoutText {#text} at (0,0) size 4x19 + text run at (0,0) width 4: " "
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt index 95c80a7..5c1b5b89c 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt
@@ -106,10 +106,6 @@ { "object": "LayoutText #text", "reason": "geometry" - }, - { - "object": "LayoutText #text", - "reason": "geometry" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/details-open-repaint-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/details-open-repaint-expected.txt index 04df947..28dd4c89 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/details-open-repaint-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/details-open-repaint-expected.txt
@@ -61,10 +61,6 @@ { "object": "LayoutText #text", "reason": "appeared" - }, - { - "object": "LayoutText #text", - "reason": "appeared" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt new file mode 100644 index 0000000..d18be3a --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/renderer-destruction-by-invalidateSelection-crash-expected.txt
@@ -0,0 +1,15 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {DIV} at (0,0) size 784x22 + LayoutTextControl {INPUT} at (0,0) size 173x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] + LayoutText {#text} at (0,0) size 0x0 + LayoutBlockFlow (anonymous) at (0,22) size 784x20 + LayoutText {#text} at (0,0) size 4x19 + text run at (0,0) width 4: " " + LayoutBlockFlow {DIV} at (0,42) size 784x0 +layer at (10,11) size 169x16 + LayoutBlockFlow {DIV} at (2,3) size 169x16 +caret: position 0 of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of child 1 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/repaint-svg-after-style-change-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/repaint-svg-after-style-change-expected.txt index 005a4dd..a530f35 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/repaint-svg-after-style-change-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/repaint-svg-after-style-change-expected.txt
@@ -8,4 +8,3 @@ LayoutSVGPath {path} at (0,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [data="M 0 0 L 0 200 L 200 200 L 200 0 Z"] LayoutSVGPath {path} at (0,0) size 200x200 [fill={[type=SOLID] [color=#008000]}] [data="M 0 0 L 0 200 L 200 200 L 200 0 Z"] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/text-in-relative-positioned-inline-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/text-in-relative-positioned-inline-expected.txt index 1083c9c..a01ad78 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/text-in-relative-positioned-inline-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/text-in-relative-positioned-inline-expected.txt
@@ -9,7 +9,7 @@ { "object": "LayoutBlockFlow DIV", "rect": [108, 8, 684, 100], - "reason": "geometry" + "reason": "style change" }, { "object": "LayoutInline (relative positioned) SPAN id='target'", @@ -34,8 +34,12 @@ "reason": "disappeared" }, { + "object": "LayoutText #text", + "reason": "disappeared" + }, + { "object": "LayoutBlockFlow DIV", - "reason": "geometry" + "reason": "style change" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/selection/text-selection-inline-block-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/selection/text-selection-inline-block-expected.txt new file mode 100644 index 0000000..4e5ac97 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/selection/text-selection-inline-block-expected.txt
@@ -0,0 +1,12 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x73 + LayoutBlockFlow {HTML} at (0,0) size 800x73 + LayoutBlockFlow {BODY} at (8,8) size 784x57 + LayoutBlockFlow {DIV} at (0,0) size 24x57 + LayoutText {#text} at (0,1) size 24x55 + text run at (0,1) width 24: "x" + LayoutText {#text} at (24,1) size 22x55 + text run at (24,1) width 22: "y" +selection start: position 0 of child 0 {#text} of child 0 {DIV} of body +selection end: position 1 of child 1 {#text} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt new file mode 100644 index 0000000..7038969 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/selection/text-selection-newline-mixed-ltr-rtl-expected.txt
@@ -0,0 +1,16 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x136 + LayoutBlockFlow {HTML} at (0,0) size 800x136 + LayoutBlockFlow {BODY} at (8,16) size 784x112 + LayoutBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 321x19 + text run at (0,0) width 321: "Passes if there are no overpainted selection highlights." + LayoutBlockFlow (anonymous) at (0,36) size 784x76 + LayoutInline {SPAN} at (0,0) size 188x73 + LayoutText {#text} at (0,1) size 188x73 + text run at (0,1) width 96: "text" + text run at (96,1) width 92 RTL: "\x{645}\x{62A}\x{646}:" + LayoutText {#text} at (0,0) size 0x0 +selection start: position 5 of child 0 {#text} of child 2 {SPAN} of body +selection end: position 13 of child 0 {#text} of child 2 {SPAN} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-connecting-line-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-connecting-line-expected.txt index be08368..f26bf3b 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-connecting-line-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-connecting-line-expected.txt
@@ -4,6 +4,5 @@ LayoutBlockFlow {HTML} at (0,0) size 800x321 LayoutBlockFlow {BODY} at (8,8) size 784x305 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 300x300 LayoutHTMLCanvas {CANVAS} at (0,0) size 300x300
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/display_list_2d_canvas/fast/canvas/canvas-shadow-source-in-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/display_list_2d_canvas/fast/canvas/canvas-shadow-source-in-expected.txt new file mode 100644 index 0000000..a5916ba --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/display_list_2d_canvas/fast/canvas/canvas-shadow-source-in-expected.txt
@@ -0,0 +1,19 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x470 + LayoutBlockFlow {HTML} at (0,0) size 800x470 + LayoutBlockFlow {BODY} at (8,8) size 784x454 + LayoutBlockFlow {DIV} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 57x19 + text run at (0,0) width 57: "Test Rect" + LayoutBlockFlow (anonymous) at (0,20) size 784x207 + LayoutText {#text} at (0,0) size 0x0 + LayoutBlockFlow {DIV} at (0,227) size 784x20 + LayoutText {#text} at (0,0) size 66x19 + text run at (0,0) width 66: "Test Image" + LayoutBlockFlow (anonymous) at (0,247) size 784x207 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,28) size 202x202 + LayoutHTMLCanvas {CANVAS} at (0,0) size 202x202 [border: (1px solid #999999)] +layer at (8,255) size 202x202 + LayoutHTMLCanvas {CANVAS} at (0,0) size 202x202 [border: (1px solid #999999)]
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-circle-focus-ring-expected.txt new file mode 100644 index 0000000..551d1972 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-circle-focus-ring-expected.txt
@@ -0,0 +1,17 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 729x39 + text run at (0,0) width 729: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,20) width 722: "shape=\"circle\">. This test PASSED if a circular-shaped focus ring is drawn around the <area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,56) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-focus-ring-in-positioned-container-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-focus-ring-in-positioned-container-expected.txt new file mode 100644 index 0000000..d48be76 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-focus-ring-in-positioned-container-expected.txt
@@ -0,0 +1,16 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x36 + LayoutBlockFlow {HTML} at (0,0) size 800x36 + LayoutBlockFlow {BODY} at (8,8) size 784x20 + LayoutText {#text} at (0,0) size 523x19 + text run at (0,0) width 523: "Tests that we paint area outline properly when the image is inside positioned containers." +layer at (20,50) size 0x0 + LayoutBlockFlow (positioned) {DIV} at (20,50) size 0x0 +layer at (30,60) size 50x55 + LayoutBlockFlow (positioned) {DIV} at (10,10) size 50x55 + LayoutImage {IMG} at (0,0) size 50x50 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-focus-ring-with-paint-root-offset-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-focus-ring-with-paint-root-offset-expected.txt new file mode 100644 index 0000000..7e9c8d8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-focus-ring-with-paint-root-offset-expected.txt
@@ -0,0 +1,14 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x36 + LayoutBlockFlow {HTML} at (0,0) size 800x36 + LayoutBlockFlow {BODY} at (8,8) size 784x20 + LayoutText {#text} at (0,0) size 416x19 + text run at (0,0) width 416: "Tests that we paint area outline properly when the paintroot is shifted." +layer at (5,50) size 50x55 + LayoutBlockFlow (positioned) {DIV} at (5,50) size 50x55 + LayoutImage {IMG} at (0,0) size 50x50 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-focus-ring-with-scale-transform-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-focus-ring-with-scale-transform-expected.txt new file mode 100644 index 0000000..c78ff966 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-focus-ring-with-scale-transform-expected.txt
@@ -0,0 +1,14 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x36 + LayoutBlockFlow {HTML} at (0,0) size 800x36 + LayoutBlockFlow {BODY} at (8,8) size 784x20 + LayoutText {#text} at (0,0) size 464x19 + text run at (0,0) width 464: "Tests that we paint area outline properly when the image's container is scaled." +layer at (100,100) size 100x100 + LayoutBlockFlow (positioned) {DIV} at (100,100) size 100x100 + LayoutImage {IMG} at (0,0) size 50x50 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-overflowing-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-overflowing-circle-focus-ring-expected.txt new file mode 100644 index 0000000..0200378 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-overflowing-circle-focus-ring-expected.txt
@@ -0,0 +1,18 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x60 + LayoutText {#text} at (0,0) size 763x59 + text run at (0,0) width 729: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,20) width 763: "shape=\"circle\"> that overflows the img element. This test PASSED if a half-circule-shaped focus ring is drawn for the <area> in" + text run at (0,40) width 138: "the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,76) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-overflowing-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-overflowing-polygon-focus-ring-expected.txt new file mode 100644 index 0000000..64e7871 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-overflowing-polygon-focus-ring-expected.txt
@@ -0,0 +1,18 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x60 + LayoutText {#text} at (0,0) size 751x59 + text run at (0,0) width 729: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,20) width 751: "shape=\"polygon\"> that is overflowing the bounds for the img element. This test PASSED if a clipped star-shaped focus ring is" + text run at (0,40) width 310: "drawn around the <area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,76) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-polygon-focus-ring-expected.txt new file mode 100644 index 0000000..5c215b2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/imagemap-polygon-focus-ring-expected.txt
@@ -0,0 +1,17 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 729x39 + text run at (0,0) width 729: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,20) width 726: "shape=\"polygon\">. This test PASSED if a cross-shaped focus ring is drawn around the <area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,56) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-circle-focus-ring-expected.txt new file mode 100644 index 0000000..551d1972 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-circle-focus-ring-expected.txt
@@ -0,0 +1,17 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 729x39 + text run at (0,0) width 729: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,20) width 722: "shape=\"circle\">. This test PASSED if a circular-shaped focus ring is drawn around the <area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,56) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-focus-ring-in-positioned-container-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-focus-ring-in-positioned-container-expected.txt index c36591a3..d48be76 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-focus-ring-in-positioned-container-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-focus-ring-in-positioned-container-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x20 LayoutText {#text} at (0,0) size 523x19 text run at (0,0) width 523: "Tests that we paint area outline properly when the image is inside positioned containers." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (20,50) size 0x0 LayoutBlockFlow (positioned) {DIV} at (20,50) size 0x0 layer at (30,60) size 50x55
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-focus-ring-with-paint-root-offset-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-focus-ring-with-paint-root-offset-expected.txt index e984f3a..7e9c8d8 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-focus-ring-with-paint-root-offset-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-focus-ring-with-paint-root-offset-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x20 LayoutText {#text} at (0,0) size 416x19 text run at (0,0) width 416: "Tests that we paint area outline properly when the paintroot is shifted." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (5,50) size 50x55 LayoutBlockFlow (positioned) {DIV} at (5,50) size 50x55 LayoutImage {IMG} at (0,0) size 50x50
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-focus-ring-with-scale-transform-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-focus-ring-with-scale-transform-expected.txt index fceedccd..c78ff966 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-focus-ring-with-scale-transform-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-focus-ring-with-scale-transform-expected.txt
@@ -5,8 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x20 LayoutText {#text} at (0,0) size 464x19 text run at (0,0) width 464: "Tests that we paint area outline properly when the image's container is scaled." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (100,100) size 100x100 LayoutBlockFlow (positioned) {DIV} at (100,100) size 100x100 LayoutImage {IMG} at (0,0) size 50x50
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-overflowing-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-overflowing-circle-focus-ring-expected.txt new file mode 100644 index 0000000..0200378 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-overflowing-circle-focus-ring-expected.txt
@@ -0,0 +1,18 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x60 + LayoutText {#text} at (0,0) size 763x59 + text run at (0,0) width 729: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,20) width 763: "shape=\"circle\"> that overflows the img element. This test PASSED if a half-circule-shaped focus ring is drawn for the <area> in" + text run at (0,40) width 138: "the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,76) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-overflowing-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-overflowing-polygon-focus-ring-expected.txt new file mode 100644 index 0000000..64e7871 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-overflowing-polygon-focus-ring-expected.txt
@@ -0,0 +1,18 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x60 + LayoutText {#text} at (0,0) size 751x59 + text run at (0,0) width 729: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,20) width 751: "shape=\"polygon\"> that is overflowing the bounds for the img element. This test PASSED if a clipped star-shaped focus ring is" + text run at (0,40) width 310: "drawn around the <area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,76) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-polygon-focus-ring-expected.txt new file mode 100644 index 0000000..5c215b2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/imagemap-polygon-focus-ring-expected.txt
@@ -0,0 +1,17 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 729x39 + text run at (0,0) width 729: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" + text run at (0,20) width 726: "shape=\"polygon\">. This test PASSED if a cross-shaped focus ring is drawn around the <area> in the imagemap (below)." + LayoutBlockFlow (anonymous) at (0,56) size 784x128 + LayoutInline {MAP} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {AREA} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (0,0) size 128x128 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-ellipse-connecting-line-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-ellipse-connecting-line-expected.txt index be08368..f26bf3b 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-ellipse-connecting-line-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-ellipse-connecting-line-expected.txt
@@ -4,6 +4,5 @@ LayoutBlockFlow {HTML} at (0,0) size 800x321 LayoutBlockFlow {BODY} at (8,8) size 784x305 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 300x300 LayoutHTMLCanvas {CANVAS} at (0,0) size 300x300
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-shadow-source-in-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-shadow-source-in-expected.txt index a13484d9..a5916ba 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-shadow-source-in-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-shadow-source-in-expected.txt
@@ -13,8 +13,6 @@ text run at (0,0) width 66: "Test Image" LayoutBlockFlow (anonymous) at (0,247) size 784x207 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 202x202 LayoutHTMLCanvas {CANVAS} at (0,0) size 202x202 [border: (1px solid #999999)] layer at (8,255) size 202x202
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/css1/classification/display-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/css1/classification/display-expected.txt index de3e0b8..99331257 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/css1/classification/display-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/css1/classification/display-expected.txt
@@ -55,7 +55,6 @@ LayoutBlockFlow {P} at (0,371) size 769x20 LayoutText {#text} at (0,0) size 235x19 text run at (0,0) width 235: "There should be no text after the colon:" - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (0,407) size 769x60 LayoutBlockFlow (anonymous) at (0,0) size 769x20 LayoutText {#text} at (0,0) size 104x19 @@ -116,7 +115,6 @@ LayoutBlockFlow {P} at (4,228) size 747x20 LayoutText {#text} at (0,0) size 235x19 text run at (0,0) width 235: "There should be no text after the colon:" - LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {P} at (4,264) size 747x60 LayoutBlockFlow (anonymous) at (0,0) size 747x20 LayoutText {#text} at (0,0) size 104x19
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/misc/location-replace-crossdomain-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/misc/location-replace-crossdomain-expected.txt new file mode 100644 index 0000000..dc234484 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/misc/location-replace-crossdomain-expected.txt
@@ -0,0 +1,15 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,8) size 304x154 + LayoutIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #EEEEEE)] + layer at (0,0) size 300x150 + LayoutView at (0,0) size 300x150 + layer at (0,0) size 300x150 + LayoutBlockFlow {HTML} at (0,0) size 300x150 + LayoutBlockFlow {BODY} at (8,8) size 284x134 + LayoutText {#text} at (0,0) size 69x19 + text run at (0,0) width 69: "SUCCESS"
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt new file mode 100644 index 0000000..c6cc0d2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt
@@ -0,0 +1,66 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x462 + LayoutBlockFlow {HTML} at (0,0) size 800x461.50 + LayoutBlockFlow {BODY} at (4,4) size 136x449 [border: (0.50px dashed #C0C0C0)] + LayoutBlockFlow {P} at (0.50,9.50) size 135x27 + LayoutText {#text} at (0,-2) size 133x30 + text run at (0,-2) width 130: "The following six blue boxes must" + text run at (0,7) width 133: "be of the same width. There must be" + text run at (0,16) width 26: "no red." + LayoutBlockFlow {P} at (9.50,45.50) size 117x27 [bgcolor=#008000] [border: (9px solid #0000FF)] + LayoutText {#text} at (9,7) size 2x12 + text run at (9,7) width 2: " " + LayoutBlockFlow {P} at (0.50,126.50) size 135x9 + LayoutText {#text} at (0,-2) size 12x12 + text run at (0,-2) width 12: " " + LayoutBlockFlow {P} at (0.50,189.50) size 135x9 + LayoutTable (anonymous) at (0.50,252.50) size 135x44 + LayoutTableSection (anonymous) at (0,0) size 135x44 + LayoutTableRow (anonymous) at (0,0) size 135x44 + LayoutTableCell {P} at (0,0) size 135x44 [r=0 c=0 rs=1 cs=1] + LayoutTable {TABLE} at (0.50,350.50) size 135x44 + LayoutTableSection {TBODY} at (0,0) size 135x44 + LayoutTableRow {TR} at (0,0) size 135x44 + LayoutTableCell {TD} at (0,0) size 135x44 [r=0 c=0 rs=1 cs=1] + LayoutBlockFlow (floating) {P} at (0.50,448.50) size 135x9 +layer at (14,131) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,194) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,257) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,355) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,453) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"]
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/misc/slow-loading-image-in-pattern-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/misc/slow-loading-image-in-pattern-expected.txt new file mode 100644 index 0000000..388ccec3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/misc/slow-loading-image-in-pattern-expected.txt
@@ -0,0 +1,16 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x56 + LayoutBlockFlow {HTML} at (0,0) size 800x56 + LayoutBlockFlow {BODY} at (8,8) size 784x40 + LayoutText {#text} at (0,0) size 596x19 + text run at (0,0) width 596: "This tests slow loading png images referenced from a image element inside a SVG pattern resource." + LayoutBR {BR} at (596,0) size 0x19 + LayoutText {#text} at (0,20) size 535x19 + text run at (0,20) width 535: "You should see a 400x300 rect containing a tiled rendering of the Acid3 reference image." +layer at (10,50) size 406x306 clip at (13,53) size 400x300 + LayoutSVGRoot (positioned) {svg} at (10,50) size 406x306 + LayoutSVGHiddenContainer {defs} at (0,0) size 0x0 + LayoutSVGResourcePattern {pattern} [id="pattern"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse] + LayoutSVGImage {image} at (0,0) size 800x600 + LayoutSVGRect {rect} at (0,0) size 400x300 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=0.00] [width=400.00] [height=300.00]
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/contentSecurityPolicy/object-src-param-code-blocked-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/contentSecurityPolicy/object-src-param-code-blocked-expected.txt index 6ac9d59..93a06ac 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/contentSecurityPolicy/object-src-param-code-blocked-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/contentSecurityPolicy/object-src-param-code-blocked-expected.txt
@@ -1,4 +1,4 @@ CONSOLE ERROR: Refused to load plugin data from 'http://127.0.0.1:8080/plugins/resources/mock-plugin.pl?code' because it violates the following Content Security Policy directive: "object-src http://localhost:8080". CONSOLE MESSAGE: line 16: PASS: Error occurred, so load was correctly blocked. -This test passes if there is a console message saying the plugin was blocked. +This test passes if there is a console message saying the plugin was blocked.
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/contentSecurityPolicy/object-src-param-movie-blocked-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/contentSecurityPolicy/object-src-param-movie-blocked-expected.txt index d90778f..d2a9c40 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/contentSecurityPolicy/object-src-param-movie-blocked-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/contentSecurityPolicy/object-src-param-movie-blocked-expected.txt
@@ -1,4 +1,4 @@ CONSOLE ERROR: Refused to load plugin data from 'http://127.0.0.1:8080/plugins/resources/mock-plugin.pl?movie' because it violates the following Content Security Policy directive: "object-src http://localhost:8080". CONSOLE MESSAGE: line 16: PASS: Error occurred, so load was correctly blocked. -This test passes if there is a console message saying the plugin was blocked. +This test passes if there is a console message saying the plugin was blocked.
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/contentSecurityPolicy/object-src-param-src-blocked-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/contentSecurityPolicy/object-src-param-src-blocked-expected.txt index c249a48a..780596e 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/contentSecurityPolicy/object-src-param-src-blocked-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/contentSecurityPolicy/object-src-param-src-blocked-expected.txt
@@ -1,4 +1,4 @@ CONSOLE ERROR: Refused to load plugin data from 'http://127.0.0.1:8080/plugins/resources/mock-plugin.pl?src' because it violates the following Content Security Policy directive: "object-src http://localhost:8080". CONSOLE MESSAGE: line 16: PASS: Error occurred, so load was correctly blocked. -This test passes if there is a console message saying the plugin was blocked. +This test passes if there is a console message saying the plugin was blocked.
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/contentSecurityPolicy/object-src-param-url-blocked-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/contentSecurityPolicy/object-src-param-url-blocked-expected.txt index ee2140a..82de5e0 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/contentSecurityPolicy/object-src-param-url-blocked-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/contentSecurityPolicy/object-src-param-url-blocked-expected.txt
@@ -1,4 +1,4 @@ CONSOLE ERROR: Refused to load plugin data from 'http://127.0.0.1:8080/plugins/resources/mock-plugin.pl?url' because it violates the following Content Security Policy directive: "object-src http://localhost:8080". CONSOLE MESSAGE: line 16: PASS: Error occurred, so load was correctly blocked. -This test passes if there is a console message saying the plugin was blocked. +This test passes if there is a console message saying the plugin was blocked.
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/cross-frame-access-callback-explicit-domain-ALLOW-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/cross-frame-access-callback-explicit-domain-ALLOW-expected.txt index 3685219e..3f9666e 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/cross-frame-access-callback-explicit-domain-ALLOW-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/security/cross-frame-access-callback-explicit-domain-ALLOW-expected.txt
@@ -1,4 +1,4 @@ -The child frame will get a function from the parent frame, set the document.domain property and then try to use the function. The function should still be able to access parent frame properties. +The child frame will get a function from the parent frame, set the document.domain property and then try to use the function. The function should still be able to access parent frame properties. PASS: canGet('window.location.href') should be 'true' and is. PASS: window.thisIsTopFrame should be 'true' and is.
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/off-main-thread-fetch/http/tests/misc/location-replace-crossdomain-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/off-main-thread-fetch/http/tests/misc/location-replace-crossdomain-expected.txt new file mode 100644 index 0000000..dc234484 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/off-main-thread-fetch/http/tests/misc/location-replace-crossdomain-expected.txt
@@ -0,0 +1,15 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutBlockFlow {HTML} at (0,0) size 800x600 + LayoutBlockFlow {BODY} at (8,8) size 784x584 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,8) size 304x154 + LayoutIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #EEEEEE)] + layer at (0,0) size 300x150 + LayoutView at (0,0) size 300x150 + layer at (0,0) size 300x150 + LayoutBlockFlow {HTML} at (0,0) size 300x150 + LayoutBlockFlow {BODY} at (8,8) size 284x134 + LayoutText {#text} at (0,0) size 69x19 + text run at (0,0) width 69: "SUCCESS"
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/off-main-thread-fetch/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/off-main-thread-fetch/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt new file mode 100644 index 0000000..c6cc0d2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/off-main-thread-fetch/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt
@@ -0,0 +1,66 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x462 + LayoutBlockFlow {HTML} at (0,0) size 800x461.50 + LayoutBlockFlow {BODY} at (4,4) size 136x449 [border: (0.50px dashed #C0C0C0)] + LayoutBlockFlow {P} at (0.50,9.50) size 135x27 + LayoutText {#text} at (0,-2) size 133x30 + text run at (0,-2) width 130: "The following six blue boxes must" + text run at (0,7) width 133: "be of the same width. There must be" + text run at (0,16) width 26: "no red." + LayoutBlockFlow {P} at (9.50,45.50) size 117x27 [bgcolor=#008000] [border: (9px solid #0000FF)] + LayoutText {#text} at (9,7) size 2x12 + text run at (9,7) width 2: " " + LayoutBlockFlow {P} at (0.50,126.50) size 135x9 + LayoutText {#text} at (0,-2) size 12x12 + text run at (0,-2) width 12: " " + LayoutBlockFlow {P} at (0.50,189.50) size 135x9 + LayoutTable (anonymous) at (0.50,252.50) size 135x44 + LayoutTableSection (anonymous) at (0,0) size 135x44 + LayoutTableRow (anonymous) at (0,0) size 135x44 + LayoutTableCell {P} at (0,0) size 135x44 [r=0 c=0 rs=1 cs=1] + LayoutTable {TABLE} at (0.50,350.50) size 135x44 + LayoutTableSection {TBODY} at (0,0) size 135x44 + LayoutTableRow {TR} at (0,0) size 135x44 + LayoutTableCell {TD} at (0,0) size 135x44 [r=0 c=0 rs=1 cs=1] + LayoutBlockFlow (floating) {P} at (0.50,448.50) size 135x9 +layer at (14,131) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,194) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,257) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,355) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"] +layer at (14,453) size 117x43 + LayoutEmbeddedObject {OBJECT} at (9,0) size 117x42.75 [bgcolor=#FF0000] [border: (9px solid #0000FF)] + layer at (0,0) size 99x25 + LayoutView at (0,0) size 99x25 + layer at (0,0) size 99x25 + LayoutSVGRoot {svg} at (0,0) size 99x25 + LayoutSVGRect {rect} at (0,0) size 1000x250 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00] + LayoutSVGPath {path} at (150,50) size 700x150 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"]
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/off-main-thread-fetch/http/tests/misc/slow-loading-image-in-pattern-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/off-main-thread-fetch/http/tests/misc/slow-loading-image-in-pattern-expected.txt new file mode 100644 index 0000000..388ccec3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/off-main-thread-fetch/http/tests/misc/slow-loading-image-in-pattern-expected.txt
@@ -0,0 +1,16 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x56 + LayoutBlockFlow {HTML} at (0,0) size 800x56 + LayoutBlockFlow {BODY} at (8,8) size 784x40 + LayoutText {#text} at (0,0) size 596x19 + text run at (0,0) width 596: "This tests slow loading png images referenced from a image element inside a SVG pattern resource." + LayoutBR {BR} at (596,0) size 0x19 + LayoutText {#text} at (0,20) size 535x19 + text run at (0,20) width 535: "You should see a 400x300 rect containing a tiled rendering of the Acid3 reference image." +layer at (10,50) size 406x306 clip at (13,53) size 400x300 + LayoutSVGRoot (positioned) {svg} at (10,50) size 406x306 + LayoutSVGHiddenContainer {defs} at (0,0) size 0x0 + LayoutSVGResourcePattern {pattern} [id="pattern"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse] + LayoutSVGImage {image} at (0,0) size 800x600 + LayoutSVGRect {rect} at (0,0) size 400x300 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=0.00] [width=400.00] [height=300.00]
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-parent-reset-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-parent-reset-expected.txt index 5e57eba..408e517 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-parent-reset-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-parent-reset-expected.txt
@@ -6,8 +6,6 @@ LayoutBlockFlow (anonymous) at (0,150) size 784x20 LayoutText {#text} at (0,0) size 595x19 text run at (0,0) width 595: "This test verifies the clip parent of a layer gets correctly reset when it gained a non-composited clip." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 150x150 transparent LayoutBlockFlow {DIV} at (0,0) size 150x150 [bgcolor=#FF0000] layer at (8,8) size 100x100 scrollWidth 200 scrollHeight 200
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt index 9135a2cd..6fd2bfa 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt
@@ -2703,6 +2703,7 @@ getter event getter htmlFor getter integrity + getter noModule getter src getter text getter type @@ -2714,6 +2715,7 @@ setter event setter htmlFor setter integrity + setter noModule setter src setter text setter type
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/threaded/animations/rotate-transform-equivalent-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/threaded/animations/rotate-transform-equivalent-expected.txt index 9719df2..7fa14b7f 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/threaded/animations/rotate-transform-equivalent-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/threaded/animations/rotate-transform-equivalent-expected.txt
@@ -5,10 +5,6 @@ LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 185x19 text run at (0,0) width 185: "There should be no red visible." - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 106x106 LayoutBlockFlow (positioned) {DIV} at (8,28) size 106x106 [color=#FF0000] [border: (3px solid #FF0000)] LayoutText {#text} at (3,5) size 55x114
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/threaded/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/threaded/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt index 04b8f1e..b4a2a21 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/threaded/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/threaded/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt
@@ -6,7 +6,6 @@ LayoutText {#text} at (240,225) size 4x19 text run at (240,225) width 4: " " LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (28,28) size 200x200 LayoutHTMLCanvas {CANVAS} at (20,20) size 200x200 [bgcolor=#00008000] layer at (272,28) size 200x200
diff --git a/third_party/WebKit/LayoutTests/platform/win7/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt deleted file mode 100644 index dded8e3..0000000 --- a/third_party/WebKit/LayoutTests/platform/win7/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -PASS repainted when expected -FAIL did not repaint when expected -PASS repainted when expected -PASS did not repaint as expected -FAIL did not repaint when expected -
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/css/invalidation-errors-2-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/css/invalidation-errors-2-expected.txt index c416e7c..28367e1 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/css/invalidation-errors-2-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/css/invalidation-errors-2-expected.txt
@@ -12,7 +12,6 @@ LayoutBlockFlow (anonymous) at (0,36) size 784x0 LayoutInline {DIV} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 layer at (8,44) size 200x200 LayoutBlockFlow (floating) {DIV} at (0,0) size 200x200 [color=#FFFFFF] [bgcolor=#006400]
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/css/invalidation-errors-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/css/invalidation-errors-expected.txt index c416e7c..28367e1 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/css/invalidation-errors-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/css/invalidation-errors-expected.txt
@@ -12,7 +12,6 @@ LayoutBlockFlow (anonymous) at (0,36) size 784x0 LayoutInline {DIV} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 layer at (8,44) size 200x200 LayoutBlockFlow (floating) {DIV} at (0,0) size 200x200 [color=#FFFFFF] [bgcolor=#006400]
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/search/search-appearance-basic-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/search/search-appearance-basic-expected.txt index e3d19481..215cd2b 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/search/search-appearance-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/search/search-appearance-basic-expected.txt
@@ -96,7 +96,6 @@ LayoutFlexibleBox {DIV} at (18,4) size 137x13 LayoutBlockFlow {DIV} at (0,0) size 125x13 LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 layer at (15,15) size 156x16 LayoutBlockFlow {DIV} at (0,0) size 156x16 LayoutText {#text} at (0,0) size 17x16
diff --git a/third_party/WebKit/LayoutTests/platform/win7/svg/text/bbox-with-glyph-overflow-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/svg/text/bbox-with-glyph-overflow-expected.txt index 3d35da8..91af6aa 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/svg/text/bbox-with-glyph-overflow-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win7/svg/text/bbox-with-glyph-overflow-expected.txt
@@ -53,4 +53,3 @@ LayoutSVGRect {rect} at (37.44,299.84) size 319.56x100.30 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=37.44] [y=299.84] [width=319.56] [height=100.30] LayoutSVGRect {rect} at (50,419) size 139x71 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=50.00] [y=419.00] [width=139.00] [height=71.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win7/svg/text/bbox-with-glyph-overflow-on-path-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/svg/text/bbox-with-glyph-overflow-on-path-expected.txt index 93b1e65..a580edc3 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/svg/text/bbox-with-glyph-overflow-on-path-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win7/svg/text/bbox-with-glyph-overflow-on-path-expected.txt
@@ -108,4 +108,3 @@ LayoutSVGRect {rect} at (38.05,204.25) size 378.14x158.38 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=38.05] [y=204.25] [width=378.14] [height=158.38] LayoutSVGRect {rect} at (50,394) size 139x71 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=50.00] [y=394.00] [width=139.00] [height=71.00] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win7/svg/text/bbox-with-glyph-overflow-zoomed-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/svg/text/bbox-with-glyph-overflow-zoomed-expected.txt index c813cdbc..02c3c74 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/svg/text/bbox-with-glyph-overflow-zoomed-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win7/svg/text/bbox-with-glyph-overflow-zoomed-expected.txt
@@ -50,4 +50,3 @@ LayoutSVGRect {rect} at (17.77,28.34) size 70.55x27.22 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=17.77] [y=28.34] [width=70.55] [height=27.22] LayoutSVGRect {rect} at (20,61.67) size 33.88x16.66 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#00000000]}] [x=20.00] [y=61.67] [width=33.88] [height=16.66] LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win7/virtual/display_list_2d_canvas/fast/canvas/canvas-shadow-source-in-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/virtual/display_list_2d_canvas/fast/canvas/canvas-shadow-source-in-expected.txt deleted file mode 100644 index a13484d9..0000000 --- a/third_party/WebKit/LayoutTests/platform/win7/virtual/display_list_2d_canvas/fast/canvas/canvas-shadow-source-in-expected.txt +++ /dev/null
@@ -1,21 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x470 - LayoutBlockFlow {HTML} at (0,0) size 800x470 - LayoutBlockFlow {BODY} at (8,8) size 784x454 - LayoutBlockFlow {DIV} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 57x19 - text run at (0,0) width 57: "Test Rect" - LayoutBlockFlow (anonymous) at (0,20) size 784x207 - LayoutText {#text} at (0,0) size 0x0 - LayoutBlockFlow {DIV} at (0,227) size 784x20 - LayoutText {#text} at (0,0) size 66x19 - text run at (0,0) width 66: "Test Image" - LayoutBlockFlow (anonymous) at (0,247) size 784x207 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,28) size 202x202 - LayoutHTMLCanvas {CANVAS} at (0,0) size 202x202 [border: (1px solid #999999)] -layer at (8,255) size 202x202 - LayoutHTMLCanvas {CANVAS} at (0,0) size 202x202 [border: (1px solid #999999)]
diff --git a/third_party/WebKit/LayoutTests/plugins/webview-plugin-type-change-expected.txt b/third_party/WebKit/LayoutTests/plugins/webview-plugin-type-change-expected.txt deleted file mode 100644 index a2665404..0000000 --- a/third_party/WebKit/LayoutTests/plugins/webview-plugin-type-change-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE MESSAGE: Blink Test Plugin: initializing -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x172 - LayoutBlockFlow {HTML} at (0,0) size 800x172 - LayoutBlockFlow {BODY} at (8,8) size 784x156 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,8) size 152x152 - LayoutEmbeddedObject {EMBED} at (0,0) size 152x152 [border: (1px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/scrollbars/scrollbar-pointer-events-expected.txt b/third_party/WebKit/LayoutTests/scrollbars/scrollbar-pointer-events-expected.txt index 019d20c..4b281de 100644 --- a/third_party/WebKit/LayoutTests/scrollbars/scrollbar-pointer-events-expected.txt +++ b/third_party/WebKit/LayoutTests/scrollbars/scrollbar-pointer-events-expected.txt
@@ -5,4 +5,3 @@ Div 3 Div 4 Div 5 -
diff --git a/third_party/WebKit/LayoutTests/sensor/orientation-sensor.html b/third_party/WebKit/LayoutTests/sensor/orientation-sensor.html index 8355a9c..75c8e4a 100644 --- a/third_party/WebKit/LayoutTests/sensor/orientation-sensor.html +++ b/third_party/WebKit/LayoutTests/sensor/orientation-sensor.html
@@ -81,7 +81,7 @@ resolve(mockSensor); }, reject); - sensorObject.onchange = wrapper.callback; + sensorObject.onreading = wrapper.callback; sensorObject.onerror = reject; }); })
diff --git a/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js b/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js index cb1f2d5..0742e89 100644 --- a/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js +++ b/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
@@ -222,7 +222,7 @@ resolve(mockSensor); }, reject); - sensorObject.onchange = wrapper.callback; + sensorObject.onreading = wrapper.callback; sensorObject.onerror = reject; }); }) @@ -233,7 +233,7 @@ sensor_test(sensor => { return checkOnChangeIsCalledAndReadingIsValid(sensor); - }, prefix + 'Test that onChange is called and sensor reading is valid (onchange reporting).'); + }, prefix + 'Test that onChange is called and sensor reading is valid (onreading reporting).'); sensor_test(sensor => { sensor.mockSensorProvider.setContinuousReportingMode(); @@ -254,7 +254,7 @@ resolve(mockSensor); }, reject); - sensorObject.onchange = wrapper.callback; + sensorObject.onreading = wrapper.callback; sensorObject.onerror = reject; }); }) @@ -296,7 +296,7 @@ resolve(mockSensor); }, reject); - sensorObject.onchange = wrapper.callback; + sensorObject.onreading = wrapper.callback; sensorObject.onerror = reject; })) .then(mockSensor => { @@ -346,7 +346,7 @@ resolve(mockSensor); }, reject); - sensor1.onchange = wrapper.callback; + sensor1.onreading = wrapper.callback; sensor1.onerror = reject; sensor2.onerror = reject; }); @@ -392,8 +392,8 @@ } }, reject); - fastSensor.onchange = fastSensorWrapper.callback; - slowSensor.onchange = slowSensorWrapper.callback; + fastSensor.onreading = fastSensorWrapper.callback; + slowSensor.onreading = slowSensorWrapper.callback; fastSensor.onerror = reject; slowSensor.onerror = reject; }); @@ -405,7 +405,7 @@ sensor_test(sensor => { return checkFrequencyHintWorks(sensor); - }, prefix + 'Test that frequency hint works (onchange reporting).'); + }, prefix + 'Test that frequency hint works (onreading reporting).'); sensor_test(sensor => { sensor.mockSensorProvider.setContinuousReportingMode();
diff --git a/third_party/WebKit/LayoutTests/svg/as-background-image/svg-as-background-with-relative-size-expected.png b/third_party/WebKit/LayoutTests/svg/as-background-image/svg-as-background-with-relative-size-expected.png deleted file mode 100644 index 214217f8..0000000 --- a/third_party/WebKit/LayoutTests/svg/as-background-image/svg-as-background-with-relative-size-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/canvas/canvas-draw-image-globalalpha-expected.txt b/third_party/WebKit/LayoutTests/svg/canvas/canvas-draw-image-globalalpha-expected.txt deleted file mode 100644 index 5fe4940..0000000 --- a/third_party/WebKit/LayoutTests/svg/canvas/canvas-draw-image-globalalpha-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x120 - LayoutBlockFlow {HTML} at (0,0) size 800x120 - LayoutBlockFlow {BODY} at (8,8) size 784x104 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,8) size 100x100 - LayoutHTMLCanvas {CANVAS} at (0,0) size 100x100
diff --git a/third_party/WebKit/LayoutTests/svg/custom/invalid-text-content-expected.txt b/third_party/WebKit/LayoutTests/svg/custom/invalid-text-content-expected.txt index 19a53c4c..c5e51f3 100644 --- a/third_party/WebKit/LayoutTests/svg/custom/invalid-text-content-expected.txt +++ b/third_party/WebKit/LayoutTests/svg/custom/invalid-text-content-expected.txt
@@ -5,14 +5,8 @@ LayoutSVGText {text} at (0,0) size 0x0 LayoutSVGTSpan {tspan} at (0,0) size 0x0 LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGTextPath {textPath} at (0,0) size 0x0 LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 - LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGInlineText {#text} at (0,0) size 0x0 LayoutSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
diff --git a/third_party/WebKit/LayoutTests/svg/custom/object-no-size-attributes-expected.txt b/third_party/WebKit/LayoutTests/svg/custom/object-no-size-attributes-expected.txt deleted file mode 100644 index f9f00b6..0000000 --- a/third_party/WebKit/LayoutTests/svg/custom/object-no-size-attributes-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x120 - LayoutBlockFlow {html} at (0,0) size 800x120 - LayoutBlockFlow {body} at (8,8) size 784x104 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,8) size 100x100 - LayoutEmbeddedObject {object} at (0,0) size 100x100 [bgcolor=#FF0000] - layer at (0,0) size 100x100 - LayoutView at (0,0) size 100x100 - layer at (0,0) size 100x100 - LayoutSVGRoot {svg} at (0,0) size 100x100 - LayoutSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
diff --git a/third_party/WebKit/LayoutTests/svg/custom/radial-gradient-with-outstanding-focalPoint-expected.png b/third_party/WebKit/LayoutTests/svg/custom/radial-gradient-with-outstanding-focalPoint-expected.png new file mode 100644 index 0000000..b92a4dc --- /dev/null +++ b/third_party/WebKit/LayoutTests/svg/custom/radial-gradient-with-outstanding-focalPoint-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/custom/radialGradient-focal-radius-expected.png b/third_party/WebKit/LayoutTests/svg/custom/radialGradient-focal-radius-expected.png index e70cdba..6a39bd7b 100644 --- a/third_party/WebKit/LayoutTests/svg/custom/radialGradient-focal-radius-expected.png +++ b/third_party/WebKit/LayoutTests/svg/custom/radialGradient-focal-radius-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/dom/parent-view-layout-crash-expected.txt b/third_party/WebKit/LayoutTests/svg/dom/parent-view-layout-crash-expected.txt index 1ca3dca7..630c83f 100644 --- a/third_party/WebKit/LayoutTests/svg/dom/parent-view-layout-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/svg/dom/parent-view-layout-crash-expected.txt
@@ -1 +1 @@ -Test passes if it does not crash. +Test passes if it does not crash.
diff --git a/third_party/WebKit/LayoutTests/svg/dom/stylesheet-candidate-node-crash-main-expected.txt b/third_party/WebKit/LayoutTests/svg/dom/stylesheet-candidate-node-crash-main-expected.txt index 630c83f..c6f20fc 100644 --- a/third_party/WebKit/LayoutTests/svg/dom/stylesheet-candidate-node-crash-main-expected.txt +++ b/third_party/WebKit/LayoutTests/svg/dom/stylesheet-candidate-node-crash-main-expected.txt
@@ -1 +1 @@ -Test passes if it does not crash. +Test passes if it does not crash.
diff --git a/third_party/WebKit/LayoutTests/svg/zoom/page/zoom-clip-path-expected.txt b/third_party/WebKit/LayoutTests/svg/zoom/page/zoom-clip-path-expected.txt deleted file mode 100644 index f883b04..0000000 --- a/third_party/WebKit/LayoutTests/svg/zoom/page/zoom-clip-path-expected.txt +++ /dev/null
@@ -1,43 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x248 - LayoutBlockFlow {HTML} at (0,0) size 800x248.16 - LayoutBlockFlow {BODY} at (16.58,16.58) size 766.84x215 - LayoutSVGRoot {svg} at (0,0) size 207.36x207.36 - LayoutSVGHiddenContainer {defs} at (0,0) size 0x0 - LayoutSVGResourceClipper {clipPath} [id="clip1"] [clipPathUnits=userSpaceOnUse] - LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00] - LayoutSVGResourceClipper {clipPath} [id="clip2"] [clipPathUnits=userSpaceOnUse] - LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00] - LayoutSVGRect {rect} at (50,50) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=50.00] [y=50.00] [width=50.00] [height=50.00] - LayoutSVGResourceClipper {clipPath} [id="clip3"] [clipPathUnits=objectBoundingBox] - LayoutSVGRect {rect} at (0,0) size 0.50x0.50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=0.50] [height=0.50] - LayoutSVGResourceClipper {clipPath} [id="clip4"] [clipPathUnits=objectBoundingBox] - LayoutSVGRect {rect} at (0,0) size 0.50x0.50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=0.50] [height=0.50] - LayoutSVGRect {rect} at (0.50,0.50) size 0.50x0.50 [fill={[type=SOLID] [color=#000000]}] [x=0.50] [y=0.50] [width=0.50] [height=0.50] - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (0,0) size 415x415 - LayoutBlockFlow (positioned) {DIV} at (0,0) size 414.72x414.72 [bgcolor=#000000] -layer at (0,0) size 207x207 - LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000] -layer at (0,0) size 207x207 - LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000] -layer at (0,0) size 207x207 - LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000] -layer at (0,0) size 207x207 - LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000] -layer at (0,0) size 207x207 - LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000] -layer at (0,0) size 207x207 - LayoutBlockFlow (positioned) {DIV} at (0,0) size 207.36x207.36 [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.png b/third_party/WebKit/LayoutTests/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.png index 2274e9b..00469cc 100644 --- a/third_party/WebKit/LayoutTests/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.png +++ b/third_party/WebKit/LayoutTests/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssMatrixComponent.html b/third_party/WebKit/LayoutTests/typedcssom/cssMatrixComponent.html index 64dcc944..3920f6a 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/cssMatrixComponent.html +++ b/third_party/WebKit/LayoutTests/typedcssom/cssMatrixComponent.html
@@ -1,104 +1,73 @@ <!DOCTYPE html> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="resources/comparisons.js"></script> <script> +var EPSILON = 10e-6; // Float epsilon + var testParams = [ { - input: new CSSMatrixComponent(new DOMMatrixReadOnly([0, 0, 0, 0, 0, 0])), - a: 0, b: 0, c: 0, d: 0, e: 0, f: 0, + input: new DOMMatrixReadOnly([0, 0, 0, 0, 0, 0]), is2D: true, cssText: "matrix(0, 0, 0, 0, 0, 0)" }, { - input: new CSSMatrixComponent(new DOMMatrixReadOnly([2, 4, 6, 8, 10, 12])), - a: 2, b: 4, c: 6, d: 8, e: 10, f: 12, + input: new DOMMatrixReadOnly([2, 4, 6, 8, 10, 12]), is2D: true, cssText: "matrix(2, 4, 6, 8, 10, 12)" }, { - input: new CSSMatrixComponent( - new DOMMatrixReadOnly([-2, -4, -6, -8, -10, -12])), - a: -2, b: -4, c: -6, d: -8, e: -10, f: -12, + input: new DOMMatrixReadOnly([-2, -4, -6, -8, -10, -12]), is2D: true, cssText: "matrix(-2, -4, -6, -8, -10, -12)" }, { - input: new CSSMatrixComponent( - new DOMMatrixReadOnly([1.1, -2.2, 3.3, -4.4, 5.5, 0.6])), - a: 1.1, b: -2.2, c: 3.3, d: -4.4, e: 5.5, f: 0.6, + input: new DOMMatrixReadOnly([1.1, -2.2, 3.3, -4.4, 5.5, 0.6]), is2D: true, cssText: "matrix(1.1, -2.2, 3.3, -4.4, 5.5, 0.6)" }, { - input: new CSSMatrixComponent( - new DOMMatrixReadOnly( - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])), - m11: 0, m12: 0, m13: 0, m14: 0, m21: 0, m22: 0, m23: 0, m24: 0, - m31: 0, m32: 0, m33: 0, m34: 0, m41: 0, m42: 0, m43: 0, m44: 0, + input: new DOMMatrixReadOnly( + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), is2D: false, cssText: "matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)" }, { - input: new CSSMatrixComponent( - new DOMMatrixReadOnly( - [11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, 44])), - m11: 11, m12: 12, m13: 13, m14: 14, m21: 21, m22: 22, m23: 23, m24: 24, - m31: 31, m32: 32, m33: 33, m34: 34, m41: 41, m42: 42, m43: 43, m44: 44, + input: new DOMMatrixReadOnly( + [11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, 44]), is2D: false, cssText: "matrix3d(11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, 44)" }, { - input: new CSSMatrixComponent( - new DOMMatrixReadOnly( - [1.1, 1.2, -13, -1.4, 2, 0, -2, 4, 3.1, 3, 3, 3.4, -4.1, 42, 43, 4.4])), - m11: 1.1, m12: 1.2, m13: -13, m14: -1.4, m21: 2, m22: 0, m23: -2, m24: 4, - m31: 3.1, m32: 3, m33: 3, m34: 3.4, m41: -4.1, m42: 42, m43: 43, m44: 4.4, + input: new DOMMatrixReadOnly( + [1.1, 1.2, -13, -1.4, 2, 0, -2, 4, 3.1, 3, 3, 3.4, -4.1, 42, 43, 4.4]), is2D: false, cssText: "matrix3d(1.1, 1.2, -13, -1.4, 2, 0, -2, 4, 3.1, 3, 3, 3.4, -4.1, 42, 43, 4.4)" +}, +// Set is2D to true with options, while also passing a 3D matrix. Should be +// truncated for cssText. +{ + input: new DOMMatrixReadOnly( + [11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, 44]), + is2D: true, + cssText: "matrix(11, 12, 21, 22, 41, 42)" } ]; -var attributeValues2D = ["a", "b", "c", "d", "e", "f"]; -var attributeValues3D = [ - "m11", - "m12", - "m13", - "m14", - "m21", - "m22", - "m23", - "m24", - "m31", - "m32", - "m33", - "m34", - "m41", - "m42", - "m43", - "m44" -]; - for (let params of testParams) { - test(() => { - var attributeValues = params.is2D ? attributeValues2D : attributeValues3D; - for (var j = 0; j < attributeValues.length; ++j) { - var attribute = attributeValues[j]; - assert_equals(params.input.matrix[attribute], params[attribute]); - } - }, "(a, ... , f) and (m11, ... , m44) attributes are correct for " + - params.cssText); -} + let matrixComponent = new CSSMatrixComponent(params.input, {is2D: params.is2D}); -for (let params of testParams) { test(() => { - assert_equals(params.input.is2D(), params.is2D); + assert_matrix_approx_equals(matrixComponent.matrix, params.input, EPSILON); + }, "matrix getter returns same matrix as the input for " + params.cssText); + + test(() => { + assert_equals(matrixComponent.is2D, params.is2D); }, "is2D value is correct for " + params.cssText); -} -for (let params of testParams) { test(() => { - assert_equals(params.input.toString(), params.cssText); + assert_equals(matrixComponent.toString(), params.cssText); }, "toString is correct for " + params.cssText); } @@ -110,4 +79,17 @@ assert_throws(new TypeError(), () => { new CSSMatrixComponent(undefined); }); }, "invalid number of arguments to the constructor throws"); +test(() => { + let matrix3d = new DOMMatrixReadOnly( + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); + let matrix2d = new DOMMatrixReadOnly([1, 2, 5, 6, 13, 14]); + let matrixComponent = new CSSMatrixComponent(matrix3d); + matrixComponent.is2D = true; + assert_matrix_approx_equals(matrixComponent.matrix, matrix3d, EPSILON); + + let transformValue = new CSSTransformValue([matrixComponent]); + assert_true(transformValue.is2D); + assert_matrix_approx_equals(transformValue.toMatrix(), matrix2d, EPSILON); +}, "Matrix is converted to 2D inside CSSTransformValue when is2D is true."); + </script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssPerspective.html b/third_party/WebKit/LayoutTests/typedcssom/cssPerspective.html index 297762f..faf45ac 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/cssPerspective.html +++ b/third_party/WebKit/LayoutTests/typedcssom/cssPerspective.html
@@ -33,5 +33,13 @@ assert_equals(perspective.toString(), 'perspective(10px)'); }, "toString should return perspective(<CSSNumericValue.cssString()>)"); +test(() => { + let perspective = new CSSPerspective(new CSSUnitValue(10, 'px')); + assert_false(perspective.is2D); + + perspective.is2D = true; + assert_false(perspective.is2D); +}, "Setting is2D does nothing"); + </script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssRotation-expected.txt b/third_party/WebKit/LayoutTests/typedcssom/cssRotation-expected.txt index 3e257d48..11e426c 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/cssRotation-expected.txt +++ b/third_party/WebKit/LayoutTests/typedcssom/cssRotation-expected.txt
@@ -13,7 +13,7 @@ PASS is2D value is correct for rotate(10deg) PASS is2D value is correct for rotate(-21deg) PASS is2D value is correct for rotate(3.2deg) -FAIL is2D value is correct for rotate3d(0, 0, 1, 90deg) assert_equals: expected false but got true +PASS is2D value is correct for rotate3d(0, 0, 1, 90deg) PASS is2D value is correct for rotate3d(2.7, -3, 4.4, 0deg) PASS is2D value is correct for rotate3d(2, 3, 4, 10deg) PASS is2D value is correct for rotate3d(2, 3.7, -4, -1.2deg) @@ -31,7 +31,7 @@ FAIL toMatrix works for rotate(10deg) assert_approx_equals: expected 0.9848077 +/- 0.000001 but got 1 FAIL toMatrix works for rotate(-21deg) assert_approx_equals: expected 0.9335804 +/- 0.000001 but got 1 FAIL toMatrix works for rotate(3.2deg) assert_approx_equals: expected 0.9984407 +/- 0.000001 but got 1 -FAIL toMatrix works for rotate3d(0, 0, 1, 90deg) assert_approx_equals: expected 0 +/- 0.000001 but got 1 +FAIL toMatrix works for rotate3d(0, 0, 1, 90deg) assert_equals: is2D expected false but got true FAIL toMatrix works for rotate3d(2.7, -3, 4.4, 0deg) assert_equals: is2D expected false but got true FAIL toMatrix works for rotate3d(2, 3, 4, 10deg) assert_equals: is2D expected false but got true FAIL toMatrix works for rotate3d(2, 3.7, -4, -1.2deg) assert_equals: is2D expected false but got true
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssRotation.html b/third_party/WebKit/LayoutTests/typedcssom/cssRotation.html index 22ad92b..194a7c04 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/cssRotation.html +++ b/third_party/WebKit/LayoutTests/typedcssom/cssRotation.html
@@ -33,7 +33,8 @@ x: 0, y: 0, z: 1, - is2D: true, cssText: "rotate(-21deg)", + is2D: true, + cssText: "rotate(-21deg)", asMatrix: new DOMMatrixReadOnly([0.9335804, -0.3583679, 0.3583679, 0.9335804, 0, 0]) }, { @@ -128,7 +129,7 @@ for (let params of testParams) { test(() => { - assert_equals(params.input.is2D(), params.is2D); + assert_equals(params.input.is2D, params.is2D); }, "is2D value is correct for " + params.cssText); } @@ -143,7 +144,7 @@ test(() => { var transformValue = new CSSTransformValue([input]); var result = transformValue.toMatrix(); - assert_equals(result.is2D, input.is2D(), 'is2D'); + assert_equals(result.is2D, input.is2D, 'is2D'); assert_matrix_approx_equals(result, params.asMatrix, EPSILON); }, "toMatrix works for " + params.cssText); }
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssScale.html b/third_party/WebKit/LayoutTests/typedcssom/cssScale.html index 82c084d..250be2c 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/cssScale.html +++ b/third_party/WebKit/LayoutTests/typedcssom/cssScale.html
@@ -60,7 +60,7 @@ for (let params of testParams) { test(() => { - assert_equals(params.input.is2D(), params.is2D); + assert_equals(params.input.is2D, params.is2D); }, "is2D value is correct for " + params.cssText); } @@ -109,9 +109,9 @@ var input = params.input; var transformValue = new CSSTransformValue([input]); var inputAsMatrix = transformValue.toMatrix(); - assert_equals(inputAsMatrix.is2D, input.is2D()); + assert_equals(inputAsMatrix.is2D, input.is2D); - var expectedMatrix = input.is2D() ? + var expectedMatrix = input.is2D ? new DOMMatrixReadOnly([input.x, 0, 0, input.y, 0, 0]) : new DOMMatrixReadOnly( [input.x, 0, 0, 0, 0, input.y, 0, 0, 0, 0, input.z, 0, 0, 0, 0, 1]);
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssSkew.html b/third_party/WebKit/LayoutTests/typedcssom/cssSkew.html index c7375e5..e8b3db13 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/cssSkew.html +++ b/third_party/WebKit/LayoutTests/typedcssom/cssSkew.html
@@ -68,7 +68,7 @@ for (let params of testParams) { test(() => { - assert_true(params.input.is2D()); + assert_true(params.input.is2D); }, "is2D value is correct for " + params.cssText); } @@ -130,4 +130,14 @@ }, "Setting " + a + " with invalid values"); } +test(() => { + let skew = new CSSSkew( + new CSSUnitValue(1, 'deg'), new CSSUnitValue(2, 'deg')); + assert_true(skew.is2D); + + skew.is2D = false; + + assert_true(skew.is2D); +}, "Setting is2D does nothing"); + </script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssTranslation.html b/third_party/WebKit/LayoutTests/typedcssom/cssTranslation.html index d781605..5d8fe06 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/cssTranslation.html +++ b/third_party/WebKit/LayoutTests/typedcssom/cssTranslation.html
@@ -10,7 +10,7 @@ var tenPercent = new CSSUnitValue(10, "percent"); var testParams = [ - // 2D CSSTranslation Transform Components + // 2D translations { input: new CSSTranslation(zeroLength, zeroLength), x: zeroLength, y: zeroLength, @@ -29,7 +29,7 @@ is2D: true, cssText: "translate(10%, 0px)" }, - // 3D CSSTranslation Transform Components + // 3D translations { input: new CSSTranslation(zeroLength, zeroLength, zeroLength), x: zeroLength, y: zeroLength, z: zeroLength, @@ -55,14 +55,14 @@ assert_equals(params.input.x, params.x); assert_equals(params.input.y, params.y); if (params.is2D) { - assert_equals(params.input.z, null); + assert_equals(params.input.z.value, 0); } else { assert_equals(params.input.z, params.z); } }, "x, y, and z values are correct for " + params.cssText); test(() => { - assert_equals(params.input.is2D(), params.is2D); + assert_equals(params.input.is2D, params.is2D); }, "is2D value is correct for " + params.cssText); test(() => { @@ -78,7 +78,7 @@ assert_equals(translation.x.unit, 'percent'); assert_equals(translation.y.value, 20); assert_equals(translation.y.unit, 'percent'); - assert_equals(translation.z, null); + assert_equals(translation.z.value, 0); let translation3d = new CSSTranslation( new CSSUnitValue(30, 'percent'),
diff --git a/third_party/WebKit/LayoutTests/virtual/disable-spinvalidation/paint/invalidation/remove-inline-block-descendant-of-flex-expected.txt b/third_party/WebKit/LayoutTests/virtual/disable-spinvalidation/paint/invalidation/remove-inline-block-descendant-of-flex-expected.txt deleted file mode 100644 index d8f8c8ee..0000000 --- a/third_party/WebKit/LayoutTests/virtual/disable-spinvalidation/paint/invalidation/remove-inline-block-descendant-of-flex-expected.txt +++ /dev/null
@@ -1,67 +0,0 @@ -{ - "layers": [ - { - "name": "LayoutView #document", - "bounds": [800, 600], - "contentsOpaque": true, - "drawsContent": true, - "paintInvalidations": [ - { - "object": "LayoutBlockFlow DIV", - "rect": [0, 100, 100, 300], - "reason": "geometry" - }, - { - "object": "LayoutBlockFlow DIV id='inline-block-2' class='item'", - "rect": [0, 200, 100, 100], - "reason": "geometry" - }, - { - "object": "LayoutBlockFlow DIV id='inline-block-1' class='item'", - "rect": [0, 100, 100, 100], - "reason": "disappeared" - }, - { - "object": "LayoutBlockFlow DIV id='inline-block-2' class='item'", - "rect": [0, 100, 100, 100], - "reason": "geometry" - } - ] - } - ], - "objectPaintInvalidations": [ - { - "object": "LayoutBR BR", - "reason": "disappeared" - }, - { - "object": "LayoutBlockFlow DIV id='inline-block-1' class='item'", - "reason": "disappeared" - }, - { - "object": "LayoutBlockFlow DIV", - "reason": "geometry" - }, - { - "object": "RootInlineBox", - "reason": "geometry" - }, - { - "object": "LayoutBlockFlow DIV id='inline-block-2' class='item'", - "reason": "geometry" - }, - { - "object": "RootInlineBox", - "reason": "geometry" - }, - { - "object": "LayoutBR BR", - "reason": "geometry" - }, - { - "object": "InlineTextBox '\n'", - "reason": "geometry" - } - ] -} -
diff --git a/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-connecting-line-expected.txt b/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-connecting-line-expected.txt deleted file mode 100644 index d990b54..0000000 --- a/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-connecting-line-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x320 - LayoutBlockFlow {HTML} at (0,0) size 800x320 - LayoutBlockFlow {BODY} at (8,8) size 784x304 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,8) size 300x300 - LayoutHTMLCanvas {CANVAS} at (0,0) size 300x300
diff --git a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-ellipse-connecting-line-expected.txt b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-ellipse-connecting-line-expected.txt deleted file mode 100644 index d990b54..0000000 --- a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-ellipse-connecting-line-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x320 - LayoutBlockFlow {HTML} at (0,0) size 800x320 - LayoutBlockFlow {BODY} at (8,8) size 784x304 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,8) size 300x300 - LayoutHTMLCanvas {CANVAS} at (0,0) size 300x300
diff --git a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-render-layer-expected.txt b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-render-layer-expected.txt deleted file mode 100644 index 0fc3715..0000000 --- a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-render-layer-expected.txt +++ /dev/null
@@ -1,15 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x116 - LayoutBlockFlow {HTML} at (0,0) size 800x116 - LayoutBlockFlow {BODY} at (8,8) size 784x100 - LayoutText {#text} at (0,0) size 0x0 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,8) size 100x100 - LayoutHTMLCanvas {CANVAS} at (0,0) size 100x100 -layer at (108,8) size 100x100 - LayoutHTMLCanvas {CANVAS} at (100,0) size 100x100 -layer at (208,8) size 100x100 - LayoutHTMLCanvas {CANVAS} at (200,0) size 100x100 -layer at (308,8) size 100x100 - LayoutHTMLCanvas {CANVAS} at (300,0) size 100x100
diff --git a/third_party/WebKit/LayoutTests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt b/third_party/WebKit/LayoutTests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt deleted file mode 100644 index dded8e3..0000000 --- a/third_party/WebKit/LayoutTests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -PASS repainted when expected -FAIL did not repaint when expected -PASS repainted when expected -PASS did not repaint as expected -FAIL did not repaint when expected -
diff --git a/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt index ea30df3..b4b4f0c 100644 --- a/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
@@ -791,9 +791,10 @@ method constructor interface CSSTransformComponent attribute @@toStringTag + getter is2D method constructor - method is2D method toString + setter is2D interface CSSTransformValue : CSSStyleValue attribute @@toStringTag getter is2D @@ -6469,15 +6470,15 @@ attribute @@toStringTag getter activated getter onactivate - getter onchange getter onerror + getter onreading getter timestamp method constructor method start method stop setter onactivate - setter onchange setter onerror + setter onreading interface SensorErrorEvent : Event attribute @@toStringTag getter error
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt index 3bc8c27..451ccf83 100644 --- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt
@@ -817,6 +817,7 @@ property event property htmlFor property integrity + property noModule property src property text property type @@ -1402,6 +1403,7 @@ property event property htmlFor property integrity + property noModule property src property text property type
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt index 5b5187d7..fa94703 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
@@ -791,9 +791,10 @@ method constructor interface CSSTransformComponent attribute @@toStringTag + getter is2D method constructor - method is2D method toString + setter is2D interface CSSTransformValue : CSSStyleValue attribute @@toStringTag getter is2D @@ -6476,15 +6477,15 @@ attribute @@toStringTag getter activated getter onactivate - getter onchange getter onerror + getter onreading getter timestamp method constructor method start method stop setter onactivate - setter onchange setter onerror + setter onreading interface SensorErrorEvent : Event attribute @@toStringTag getter error
diff --git a/third_party/WebKit/LayoutTests/webshare/README.md b/third_party/WebKit/LayoutTests/webshare/README.md new file mode 100644 index 0000000..2f29426 --- /dev/null +++ b/third_party/WebKit/LayoutTests/webshare/README.md
@@ -0,0 +1,11 @@ +# Web Share layout tests + +The main body of Web Share tests are found in +[`external/wpt/web-share`](../external/wpt/web-share) (imported from Web +Platform Tests). However, many of those tests are necessarily manual +(since they involve user interaction). + +The tests in this directory are Chromium-specific automated versions of +the manual tests from WPT. They use user-gesture hacks and a mock Mojo +implementation to fully automate the API tests. These should be kept in +sync with the upstream manual versions of the tests.
diff --git a/third_party/WebKit/LayoutTests/webshare/idl.html b/third_party/WebKit/LayoutTests/webshare/idl.html deleted file mode 100644 index c5dfede..0000000 --- a/third_party/WebKit/LayoutTests/webshare/idl.html +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html> -<link rel="help" href="https://wicg.github.io/web-share/"> -<script src=../resources/testharness.js></script> -<script src=../resources/testharnessreport.js></script> -<script src=../resources/WebIDLParser.js></script> -<script src=../resources/idlharness.js></script> -<script type="text/plain" id="untested"> - interface Navigator { - }; -</script> -<script type="text/plain" id="tested"> - partial interface Navigator { - [SecureContext] - Promise<void> share(ShareData data); - }; - - dictionary ShareData { - USVString title; - USVString text; - USVString url; - }; -</script> -<script> - "use strict"; - var idl_array = new IdlArray(); - idl_array.add_untested_idls(document.querySelector("#untested").textContent); - idl_array.add_idls(document.querySelector('#tested').textContent); - idl_array.add_objects({ - Navigator: ['navigator'] - }); - idl_array.test(); -</script>
diff --git a/third_party/WebKit/LayoutTests/webshare/share-types.html b/third_party/WebKit/LayoutTests/webshare/share-types.html index 56249c0..39789706 100644 --- a/third_party/WebKit/LayoutTests/webshare/share-types.html +++ b/third_party/WebKit/LayoutTests/webshare/share-types.html
@@ -36,11 +36,4 @@ {title: null, text: undefined, url: null})); }, 'share of null/undefined dict values'); -promise_test(t => { - // URL is invalid in that the URL Parser returns failure (port is too - // large). - const url = 'http://example.com:65536'; - return promise_rejects(t, new TypeError(), navigator.share({url: url})); -}, 'share with an invalid URL'); - </script>
diff --git a/third_party/WebKit/LayoutTests/webshare/share-without-user-gesture.html b/third_party/WebKit/LayoutTests/webshare/share-without-user-gesture.html deleted file mode 100644 index e3c1390..0000000 --- a/third_party/WebKit/LayoutTests/webshare/share-without-user-gesture.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<script> - -promise_test(t => { - return promise_rejects( - t, 'SecurityError', - navigator.share({title: 'the title', text: 'the message', url: 'data:the url'})); -}, 'share without a user gesture'); - -</script>
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp index 1707ea6..a8176cd 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp
@@ -102,7 +102,11 @@ Persistent<ClassicPendingScript> pending_script_; }; -class TestPendingScriptClient final : public PendingScriptClient { +class TestPendingScriptClient final + : public GarbageCollectedFinalized<TestPendingScriptClient>, + public PendingScriptClient { + USING_GARBAGE_COLLECTED_MIXIN(TestPendingScriptClient); + public: TestPendingScriptClient() : finished_(false) {} void PendingScriptFinished(PendingScript*) override { finished_ = true; } @@ -135,7 +139,7 @@ EXPECT_TRUE(client->Finished()); bool error_occurred = false; ScriptSourceCode source_code = GetPendingScript() - ->GetSource(KURL(), error_occurred) + ->GetSource(NullURL(), error_occurred) ->GetScriptSourceCode(); EXPECT_FALSE(error_occurred); EXPECT_TRUE(source_code.Streamer()); @@ -175,7 +179,7 @@ bool error_occurred = false; ScriptSourceCode source_code = GetPendingScript() - ->GetSource(KURL(), error_occurred) + ->GetSource(NullURL(), error_occurred) ->GetScriptSourceCode(); EXPECT_FALSE(error_occurred); EXPECT_TRUE(source_code.Streamer()); @@ -243,7 +247,7 @@ bool error_occurred = false; ScriptSourceCode source_code = GetPendingScript() - ->GetSource(KURL(), error_occurred) + ->GetSource(NullURL(), error_occurred) ->GetScriptSourceCode(); EXPECT_FALSE(error_occurred); // ScriptSourceCode doesn't refer to the streamer, since we have suppressed @@ -271,7 +275,7 @@ bool error_occurred = false; ScriptSourceCode source_code = GetPendingScript() - ->GetSource(KURL(), error_occurred) + ->GetSource(NullURL(), error_occurred) ->GetScriptSourceCode(); EXPECT_FALSE(error_occurred); EXPECT_FALSE(source_code.Streamer()); @@ -298,7 +302,7 @@ bool error_occurred = false; ScriptSourceCode source_code = GetPendingScript() - ->GetSource(KURL(), error_occurred) + ->GetSource(NullURL(), error_occurred) ->GetScriptSourceCode(); EXPECT_FALSE(error_occurred); EXPECT_FALSE(source_code.Streamer()); @@ -328,7 +332,7 @@ EXPECT_TRUE(client->Finished()); bool error_occurred = false; ScriptSourceCode source_code = GetPendingScript() - ->GetSource(KURL(), error_occurred) + ->GetSource(NullURL(), error_occurred) ->GetScriptSourceCode(); EXPECT_FALSE(error_occurred); EXPECT_TRUE(source_code.Streamer()); @@ -365,7 +369,7 @@ EXPECT_TRUE(client->Finished()); bool error_occurred = false; ScriptSourceCode source_code = GetPendingScript() - ->GetSource(KURL(), error_occurred) + ->GetSource(NullURL(), error_occurred) ->GetScriptSourceCode(); EXPECT_FALSE(error_occurred); EXPECT_TRUE(source_code.Streamer()); @@ -403,7 +407,7 @@ EXPECT_TRUE(client->Finished()); bool error_occurred = false; ScriptSourceCode source_code = GetPendingScript() - ->GetSource(KURL(), error_occurred) + ->GetSource(NullURL(), error_occurred) ->GetScriptSourceCode(); EXPECT_FALSE(error_occurred); EXPECT_TRUE(source_code.Streamer());
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp index 7a3b651..736f8847 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp
@@ -68,7 +68,7 @@ } void SetEmptyResource() { - resource_ = ScriptResource::CreateForTest(KURL(), UTF8Encoding()); + resource_ = ScriptResource::CreateForTest(NullURL(), UTF8Encoding()); } void SetResource() {
diff --git a/third_party/WebKit/Source/bindings/scripts/idl_definitions.py b/third_party/WebKit/Source/bindings/scripts/idl_definitions.py index 1b2209a..57346b4 100644 --- a/third_party/WebKit/Source/bindings/scripts/idl_definitions.py +++ b/third_party/WebKit/Source/bindings/scripts/idl_definitions.py
@@ -54,8 +54,6 @@ IdlIterable < IdlIterableOrMaplikeOrSetlike IdlMaplike < IdlIterableOrMaplikeOrSetlike IdlSetlike < IdlIterableOrMaplikeOrSetlike - IdlException < IdlInterface - (same contents as IdlInterface) TypedObject :: Object with one or more attributes that is a type. @@ -115,10 +113,6 @@ if child_class == 'Interface': interface = IdlInterface(child) self.interfaces[interface.name] = interface - elif child_class == 'Exception': - exception = IdlException(child) - # For simplicity, treat exceptions as interfaces - self.interfaces[exception.name] = exception elif child_class == 'Typedef': typedef = IdlTypedef(child) self.typedefs[typedef.name] = typedef @@ -287,11 +281,11 @@ ################################################################################ -# Interfaces and Exceptions +# Interfaces ################################################################################ class IdlInterface(object): - def __init__(self, node=None): + def __init__(self, node): self.attributes = [] self.constants = [] self.constructors = [] @@ -307,11 +301,8 @@ self.setlike = None self.original_interface = None self.partial_interfaces = [] - if not node: # Early exit for IdlException.__init__ - return self.is_callback = bool(node.GetProperty('CALLBACK')) - self.is_exception = False # FIXME: uppercase 'Partial' => 'PARTIAL' in base IDL parser self.is_partial = bool(node.GetProperty('Partial')) self.name = node.GetName() @@ -420,42 +411,6 @@ self.stringifier = other.stringifier -class IdlException(IdlInterface): - # Properly exceptions and interfaces are distinct, and thus should inherit a - # common base class (say, "IdlExceptionOrInterface"). - # However, there is only one exception (DOMException), and new exceptions - # are not expected. Thus it is easier to implement exceptions as a - # restricted subclass of interfaces. - # http://www.w3.org/TR/WebIDL/#idl-exceptions - def __init__(self, node): - # Exceptions are similar to Interfaces, but simpler - IdlInterface.__init__(self) - self.is_callback = False - self.is_exception = True - self.is_partial = False - self.name = node.GetName() - self.idl_type = IdlType(self.name) - - children = node.GetChildren() - for child in children: - child_class = child.GetClass() - if child_class == 'Attribute': - attribute = IdlAttribute(child) - self.attributes.append(attribute) - elif child_class == 'Const': - self.constants.append(IdlConstant(child)) - elif child_class == 'ExtAttributes': - extended_attributes = ext_attributes_node_to_extended_attributes(child) - self.constructors, self.custom_constructors = ( - extended_attributes_to_constructors(extended_attributes)) - clear_constructor_attributes(extended_attributes) - self.extended_attributes = extended_attributes - elif child_class == 'ExceptionOperation': - self.operations.append(IdlOperation.from_exception_operation_node(child)) - else: - raise ValueError('Unrecognized node class: %s' % child_class) - - ################################################################################ # Attributes ################################################################################ @@ -617,27 +572,6 @@ raise ValueError('Unrecognized node class: %s' % child_class) @classmethod - def from_exception_operation_node(cls, node): - # Needed to handle one case in DOMException.idl: - # // Override in a Mozilla compatible format - # [NotEnumerable] DOMString toString(); - # FIXME: can we remove this? replace with a stringifier? - operation = cls() - operation.name = node.GetName() - children = node.GetChildren() - if len(children) < 1 or len(children) > 2: - raise ValueError('ExceptionOperation node with %s children, expected 1 or 2' % len(children)) - - type_node = children[0] - operation.idl_type = type_node_to_type(type_node) - - if len(children) > 1: - ext_attributes_node = children[1] - operation.extended_attributes = ext_attributes_node_to_extended_attributes(ext_attributes_node) - - return operation - - @classmethod def constructor_from_arguments_node(cls, name, arguments_node): constructor = cls() constructor.name = name
diff --git a/third_party/WebKit/Source/bindings/scripts/idl_reader.py b/third_party/WebKit/Source/bindings/scripts/idl_reader.py index 9ff34c14..b1a4883 100644 --- a/third_party/WebKit/Source/bindings/scripts/idl_reader.py +++ b/third_party/WebKit/Source/bindings/scripts/idl_reader.py
@@ -47,7 +47,7 @@ """Validate file contents with filename convention. The Blink IDL conventions are: - - If an IDL file defines an interface, a dictionary, or an exception, + - If an IDL file defines an interface or a dictionary, the IDL file must contain exactly one definition. The definition name must agree with the file's basename, unless it is a partial definition. (e.g., 'partial interface Foo' can be in FooBar.idl).
diff --git a/third_party/WebKit/Source/bindings/scripts/utilities.py b/third_party/WebKit/Source/bindings/scripts/utilities.py index de112e9..43ccd50 100644 --- a/third_party/WebKit/Source/bindings/scripts/utilities.py +++ b/third_party/WebKit/Source/bindings/scripts/utilities.py
@@ -356,7 +356,7 @@ """True when a given IDL file contents could generate .h/.cpp files.""" # FIXME: This would be error-prone and we should use AST rather than # improving the regexp pattern. - match = re.search(r'(interface|dictionary|exception)\s+\w+', file_contents) + match = re.search(r'(interface|dictionary)\s+\w+', file_contents) return bool(match) @@ -370,7 +370,7 @@ match = re.search( r'\[([^[]*)\]\s*' - r'(interface|callback\s+interface|partial\s+interface|exception)\s+' + r'(interface|callback\s+interface|partial\s+interface)\s+' r'\w+\s*' r'(:\s*\w+\s*)?' r'{',
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_interface.py b/third_party/WebKit/Source/bindings/scripts/v8_interface.py index 1df1f5ca..787f759d 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_interface.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_interface.py
@@ -243,6 +243,12 @@ # as in the WebIDL spec? is_immutable_prototype = is_global or 'ImmutablePrototype' in extended_attributes + # DOMException is defined in WebIDL and is the only object that resembles + # the concept of an "exception interface" (which was removed from the spec + # in 2014). |is_exception == true| is mostly used to make the prototype + # object inherit from %ErrorPrototype% in V8PerContextData. + is_exception = interface.name == 'DOMException' + wrapper_class_id = ('kNodeClassId' if inherits_interface(interface.name, 'Node') else 'kObjectClassId') # [ActiveScriptWrappable] must be accompanied with [DependentLifetime]. @@ -274,7 +280,7 @@ 'is_array_buffer_or_view': is_array_buffer_or_view, 'is_check_security': is_check_security, 'is_event_target': is_event_target, - 'is_exception': interface.is_exception, + 'is_exception': is_exception, 'is_global': is_global, 'is_immutable_prototype': is_immutable_prototype, 'is_node': inherits_interface(interface.name, 'Node'),
diff --git a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl index 11b0ffa..ce5780e5 100644 --- a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl +++ b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
@@ -528,7 +528,7 @@ 'kNotInheritFromActiveScriptWrappable' %} // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -545,7 +545,7 @@ WrapperTypeInfo::{{active_scriptwrappable_inheritance}}, WrapperTypeInfo::{{lifetime}}, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl index 8df375e..c921f5d 100644 --- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl +++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
@@ -22,7 +22,7 @@ {% if not is_partial %} // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -39,7 +39,7 @@ WrapperTypeInfo::{{active_scriptwrappable_inheritance}}, WrapperTypeInfo::{{lifetime}}, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif @@ -347,7 +347,7 @@ {% if data_attributes %} // Suppress warning: global constructors, because AttributeConfiguration is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -356,7 +356,7 @@ {{attribute_configuration(data_attribute) | indent(4)}}, {% endfor %} }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif @@ -368,7 +368,7 @@ {% if lazy_data_attributes %} // Suppress warning: global constructors, because AttributeConfiguration is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -377,7 +377,7 @@ {{attribute_configuration(data_attribute) | indent(4)}}, {% endfor %} }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/templates/legacy_callback_interface.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/legacy_callback_interface.cpp.tmpl index f020ae7..6f017e6 100644 --- a/third_party/WebKit/Source/bindings/templates/legacy_callback_interface.cpp.tmpl +++ b/third_party/WebKit/Source/bindings/templates/legacy_callback_interface.cpp.tmpl
@@ -11,7 +11,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is // trivial and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -28,7 +28,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kDependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/idls/core/TestException.idl b/third_party/WebKit/Source/bindings/tests/idls/core/TestException.idl deleted file mode 100644 index 49bb703..0000000 --- a/third_party/WebKit/Source/bindings/tests/idls/core/TestException.idl +++ /dev/null
@@ -1,39 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - Constructor(unsigned short argument), - DoNotCheckConstants -] exception TestException { - readonly attribute unsigned short readonlyUnsignedShortAttribute; - readonly attribute DOMString readonlyStringAttribute; - - const unsigned short UNSIGNED_SHORT_CONSTANT = 1; - - [NotEnumerable] DOMString toString(); -};
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp index cdd4ea9e..85ebae9 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp
@@ -26,7 +26,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -43,7 +43,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.cpp index f9c8a724..0624223 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.cpp
@@ -37,7 +37,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -54,7 +54,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.cpp index 498b519..34c88eb 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.cpp
@@ -26,7 +26,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -43,7 +43,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp index d2bfd88..c93a2dc 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp
@@ -26,7 +26,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -43,7 +43,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kDependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp index affe2f03b..81b567e 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp
@@ -28,7 +28,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -45,7 +45,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp index b0abc15..9f8ee2f 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp
@@ -28,7 +28,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -45,7 +45,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestException.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestException.cpp deleted file mode 100644 index eb463a9..0000000 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestException.cpp +++ /dev/null
@@ -1,225 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file has been auto-generated by code_generator_v8.py. -// DO NOT MODIFY! - -// This file has been generated from the Jinja2 template in -// third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl - -// clang-format off -#include "V8TestException.h" - -#include "bindings/core/v8/ExceptionState.h" -#include "bindings/core/v8/IDLTypes.h" -#include "bindings/core/v8/NativeValueTraitsImpl.h" -#include "bindings/core/v8/V8DOMConfiguration.h" -#include "core/dom/ExecutionContext.h" -#include "core/frame/LocalDOMWindow.h" -#include "platform/bindings/V8ObjectConstructor.h" -#include "platform/wtf/GetPtr.h" -#include "platform/wtf/RefPtr.h" - -namespace blink { - -// Suppress warning: global constructors, because struct WrapperTypeInfo is trivial -// and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wglobal-constructors" -#endif -const WrapperTypeInfo V8TestException::wrapperTypeInfo = { - gin::kEmbedderBlink, - V8TestException::domTemplate, - V8TestException::Trace, - V8TestException::TraceWrappers, - nullptr, - "TestException", - nullptr, - WrapperTypeInfo::kWrapperTypeExceptionPrototype, - WrapperTypeInfo::kObjectClassId, - WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, - WrapperTypeInfo::kIndependent, -}; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) -#pragma clang diagnostic pop -#endif - -// This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestException.h. -// For details, see the comment of DEFINE_WRAPPERTYPEINFO in -// platform/bindings/ScriptWrappable.h. -const WrapperTypeInfo& TestException::wrapper_type_info_ = V8TestException::wrapperTypeInfo; - -// not [ActiveScriptWrappable] -static_assert( - !std::is_base_of<ActiveScriptWrappableBase, TestException>::value, - "TestException inherits from ActiveScriptWrappable<>, but is not specifying " - "[ActiveScriptWrappable] extended attribute in the IDL file. " - "Be consistent."); -static_assert( - std::is_same<decltype(&TestException::HasPendingActivity), - decltype(&ScriptWrappable::HasPendingActivity)>::value, - "TestException is overriding hasPendingActivity(), but is not specifying " - "[ActiveScriptWrappable] extended attribute in the IDL file. " - "Be consistent."); - -namespace TestExceptionV8Internal { - -static void readonlyUnsignedShortAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { - v8::Local<v8::Object> holder = info.Holder(); - - TestException* impl = V8TestException::toImpl(holder); - - V8SetReturnValueUnsigned(info, impl->readonlyUnsignedShortAttribute()); -} - -static void readonlyStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { - v8::Local<v8::Object> holder = info.Holder(); - - TestException* impl = V8TestException::toImpl(holder); - - V8SetReturnValueString(info, impl->readonlyStringAttribute(), info.GetIsolate()); -} - -static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { - TestException* impl = V8TestException::toImpl(info.Holder()); - - V8SetReturnValueString(info, impl->toString(), info.GetIsolate()); -} - -static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) { - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kConstructionContext, "TestException"); - - if (UNLIKELY(info.Length() < 1)) { - exceptionState.ThrowTypeError(ExceptionMessages::NotEnoughArguments(1, info.Length())); - return; - } - - uint16_t argument; - argument = NativeValueTraits<IDLUnsignedShort>::NativeValue(info.GetIsolate(), info[0], exceptionState, kNormalConversion); - if (exceptionState.HadException()) - return; - - TestException* impl = TestException::Create(argument); - v8::Local<v8::Object> wrapper = info.Holder(); - wrapper = impl->AssociateWithWrapper(info.GetIsolate(), &V8TestException::wrapperTypeInfo, wrapper); - V8SetReturnValue(info, wrapper); -} - -} // namespace TestExceptionV8Internal - -void V8TestException::readonlyUnsignedShortAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { - TestExceptionV8Internal::readonlyUnsignedShortAttributeAttributeGetter(info); -} - -void V8TestException::readonlyStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { - TestExceptionV8Internal::readonlyStringAttributeAttributeGetter(info); -} - -void V8TestException::toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { - TestExceptionV8Internal::toStringMethod(info); -} - -static const V8DOMConfiguration::AccessorConfiguration V8TestExceptionAccessors[] = { - { "readonlyUnsignedShortAttribute", V8TestException::readonlyUnsignedShortAttributeAttributeGetterCallback, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kAllWorlds }, - - { "readonlyStringAttribute", V8TestException::readonlyStringAttributeAttributeGetterCallback, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kAllWorlds }, -}; - -static const V8DOMConfiguration::MethodConfiguration V8TestExceptionMethods[] = { - {"toString", V8TestException::toStringMethodCallback, 0, static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kDoNotCheckAccess, V8DOMConfiguration::kAllWorlds}, -}; - -void V8TestException::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { - if (!info.IsConstructCall()) { - V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("TestException")); - return; - } - - if (ConstructorMode::Current(info.GetIsolate()) == ConstructorMode::kWrapExistingObject) { - V8SetReturnValue(info, info.Holder()); - return; - } - - TestExceptionV8Internal::constructor(info); -} - -static void installV8TestExceptionTemplate( - v8::Isolate* isolate, - const DOMWrapperWorld& world, - v8::Local<v8::FunctionTemplate> interfaceTemplate) { - // Initialize the interface object's template. - V8DOMConfiguration::InitializeDOMInterfaceTemplate(isolate, interfaceTemplate, V8TestException::wrapperTypeInfo.interface_name, v8::Local<v8::FunctionTemplate>(), V8TestException::internalFieldCount); - interfaceTemplate->SetCallHandler(V8TestException::constructorCallback); - interfaceTemplate->SetLength(1); - - v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate); - ALLOW_UNUSED_LOCAL(signature); - v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->InstanceTemplate(); - ALLOW_UNUSED_LOCAL(instanceTemplate); - v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->PrototypeTemplate(); - ALLOW_UNUSED_LOCAL(prototypeTemplate); - - // Register IDL constants, attributes and operations. - const V8DOMConfiguration::ConstantConfiguration V8TestExceptionConstants[] = { - {"UNSIGNED_SHORT_CONSTANT", 1, 0, V8DOMConfiguration::kConstantTypeUnsignedShort}, - }; - V8DOMConfiguration::InstallConstants( - isolate, interfaceTemplate, prototypeTemplate, - V8TestExceptionConstants, WTF_ARRAY_LENGTH(V8TestExceptionConstants)); - V8DOMConfiguration::InstallAccessors( - isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, - signature, V8TestExceptionAccessors, WTF_ARRAY_LENGTH(V8TestExceptionAccessors)); - V8DOMConfiguration::InstallMethods( - isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, - signature, V8TestExceptionMethods, WTF_ARRAY_LENGTH(V8TestExceptionMethods)); - - // Custom signature - - V8TestException::InstallRuntimeEnabledFeaturesOnTemplate( - isolate, world, interfaceTemplate); -} - -void V8TestException::InstallRuntimeEnabledFeaturesOnTemplate( - v8::Isolate* isolate, - const DOMWrapperWorld& world, - v8::Local<v8::FunctionTemplate> interface_template) { - v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interface_template); - ALLOW_UNUSED_LOCAL(signature); - v8::Local<v8::ObjectTemplate> instance_template = interface_template->InstanceTemplate(); - ALLOW_UNUSED_LOCAL(instance_template); - v8::Local<v8::ObjectTemplate> prototype_template = interface_template->PrototypeTemplate(); - ALLOW_UNUSED_LOCAL(prototype_template); - - // Register IDL constants, attributes and operations. - - // Custom signature -} - -v8::Local<v8::FunctionTemplate> V8TestException::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) { - return V8DOMConfiguration::DomClassTemplate(isolate, world, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestExceptionTemplate); -} - -bool V8TestException::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) { - return V8PerIsolateData::From(isolate)->HasInstance(&wrapperTypeInfo, v8Value); -} - -v8::Local<v8::Object> V8TestException::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) { - return V8PerIsolateData::From(isolate)->FindInstanceInPrototypeChain(&wrapperTypeInfo, v8Value); -} - -TestException* V8TestException::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value) { - return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : nullptr; -} - -TestException* NativeValueTraits<TestException>::NativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) { - TestException* nativeValue = V8TestException::toImplWithTypeCheck(isolate, value); - if (!nativeValue) { - exceptionState.ThrowTypeError(ExceptionMessages::FailedToConvertJSValue( - "TestException")); - } - return nativeValue; -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestException.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestException.h deleted file mode 100644 index 025bd6c..0000000 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestException.h +++ /dev/null
@@ -1,73 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file has been auto-generated by code_generator_v8.py. -// DO NOT MODIFY! - -// This file has been generated from the Jinja2 template in -// third_party/WebKit/Source/bindings/templates/interface.h.tmpl - -// clang-format off -#ifndef V8TestException_h -#define V8TestException_h - -#include "bindings/core/v8/GeneratedCodeHelper.h" -#include "bindings/core/v8/NativeValueTraits.h" -#include "bindings/core/v8/ToV8ForCore.h" -#include "bindings/core/v8/V8BindingForCore.h" -#include "bindings/tests/idls/core/TestException.h" -#include "core/CoreExport.h" -#include "platform/bindings/ScriptWrappable.h" -#include "platform/bindings/V8DOMWrapper.h" -#include "platform/bindings/WrapperTypeInfo.h" -#include "platform/heap/Handle.h" - -namespace blink { - -class V8TestException { - STATIC_ONLY(V8TestException); - public: - CORE_EXPORT static bool hasInstance(v8::Local<v8::Value>, v8::Isolate*); - static v8::Local<v8::Object> findInstanceInPrototypeChain(v8::Local<v8::Value>, v8::Isolate*); - CORE_EXPORT static v8::Local<v8::FunctionTemplate> domTemplate(v8::Isolate*, const DOMWrapperWorld&); - static TestException* toImpl(v8::Local<v8::Object> object) { - return ToScriptWrappable(object)->ToImpl<TestException>(); - } - CORE_EXPORT static TestException* toImplWithTypeCheck(v8::Isolate*, v8::Local<v8::Value>); - CORE_EXPORT static const WrapperTypeInfo wrapperTypeInfo; - static void Trace(Visitor* visitor, ScriptWrappable* scriptWrappable) { - visitor->Trace(scriptWrappable->ToImpl<TestException>()); - } - static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) { - visitor->TraceWrappers(scriptWrappable->ToImpl<TestException>()); - } - static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + 0; - - // Callback functions - CORE_EXPORT static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); - - CORE_EXPORT static void readonlyUnsignedShortAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>&); - CORE_EXPORT static void readonlyStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>&); - - CORE_EXPORT static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); - - static void InstallRuntimeEnabledFeaturesOnTemplate( - v8::Isolate*, - const DOMWrapperWorld&, - v8::Local<v8::FunctionTemplate> interface_template); -}; - -template <> -struct NativeValueTraits<TestException> : public NativeValueTraitsBase<TestException> { - CORE_EXPORT static TestException* NativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&); -}; - -template <> -struct V8TypeOf<TestException> { - typedef V8TestException Type; -}; - -} // namespace blink - -#endif // V8TestException_h
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp index b71f155..9be6fb7a 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp
@@ -26,7 +26,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -43,7 +43,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp index e244e41..7cbb68b5 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp
@@ -26,7 +26,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -43,7 +43,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp index d2b0c00d..6f75b849 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp
@@ -26,7 +26,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -43,7 +43,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp index 99139e1..28eff1b7 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
@@ -44,7 +44,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -61,7 +61,7 @@ WrapperTypeInfo::kInheritFromActiveScriptWrappable, WrapperTypeInfo::kDependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif @@ -2901,7 +2901,7 @@ // Suppress warning: global constructors, because AttributeConfiguration is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -2912,7 +2912,7 @@ { "TestInterface2", V8ConstructorAttributeGetter, nullptr, const_cast<WrapperTypeInfo*>(&V8TestInterface2::wrapperTypeInfo), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kAllWorlds }, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp index 56ba60bc..670b815 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
@@ -30,7 +30,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -47,7 +47,7 @@ WrapperTypeInfo::kInheritFromActiveScriptWrappable, WrapperTypeInfo::kDependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp index bb1571e8..e3cd8f5 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp
@@ -26,7 +26,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -43,7 +43,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp index 5ab47ab..f17a47c 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
@@ -27,7 +27,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -44,7 +44,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif @@ -492,7 +492,7 @@ // Suppress warning: global constructors, because AttributeConfiguration is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -505,7 +505,7 @@ { "doNotCheckSecurityReplaceableReadonlyLongAttribute", V8TestInterfaceCheckSecurity::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCallback, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kAllWorlds }, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp index 55e55bf..ab13073 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp
@@ -32,7 +32,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -49,7 +49,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif @@ -297,7 +297,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -314,7 +314,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp index ec3fbfa8..d3142a49 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp
@@ -27,7 +27,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -44,7 +44,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp index a29673b..d7d8ad0 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp
@@ -25,7 +25,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -42,7 +42,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp index 98b7ec9..b3c3a42 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp
@@ -26,7 +26,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -43,7 +43,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp index f34bafe..fbcec51 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp
@@ -23,7 +23,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -40,7 +40,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp index ffb4b99..3ad6a050a2 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp
@@ -27,7 +27,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -44,7 +44,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kDependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp index 860827f..cafc636 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp
@@ -22,7 +22,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -39,7 +39,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp index ad5f79d..4b5ca15e 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp
@@ -26,7 +26,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -43,7 +43,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp index 714614e6..6d16f507 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp
@@ -25,7 +25,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -42,7 +42,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif @@ -70,7 +70,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -87,7 +87,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp index d7edfff..38a8ba8 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
@@ -29,7 +29,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -46,7 +46,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp index 8561eb12..1cf9d75 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
@@ -27,7 +27,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -44,7 +44,7 @@ WrapperTypeInfo::kInheritFromActiveScriptWrappable, WrapperTypeInfo::kDependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif @@ -72,20 +72,20 @@ // Suppress warning: global constructors, because AttributeConfiguration is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceNamedConstructorLazyDataAttributes[] = { { "testNamedConstructorConstructorAttribute", V8TestNamedConstructor::NamedConstructorAttributeGetter, nullptr, const_cast<WrapperTypeInfo*>(&V8TestNamedConstructor::wrapperTypeInfo), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kAllWorlds }, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -102,7 +102,7 @@ WrapperTypeInfo::kInheritFromActiveScriptWrappable, WrapperTypeInfo::kDependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp index 1c726c9..d9edac2 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp
@@ -26,7 +26,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -43,7 +43,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif @@ -71,7 +71,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -88,7 +88,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp index 33e9d24..0779be6 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp
@@ -29,7 +29,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -46,7 +46,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kDependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp index c780dd0..6c6d59f8 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp
@@ -25,7 +25,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -42,7 +42,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.cpp index c3669d7..df7552a 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.cpp
@@ -25,7 +25,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -42,7 +42,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestLegacyCallbackInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestLegacyCallbackInterface.cpp index d107bbad..c999caf 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestLegacyCallbackInterface.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestLegacyCallbackInterface.cpp
@@ -21,7 +21,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is // trivial and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -38,7 +38,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kDependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp index ca7aa68..963e952 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp
@@ -25,7 +25,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -42,7 +42,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kDependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp index 0c81ec1..325b494 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
@@ -84,7 +84,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -101,7 +101,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif @@ -12269,7 +12269,7 @@ // Suppress warning: global constructors, because AttributeConfiguration is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -12278,20 +12278,20 @@ { "measureAsFeatureNameTestInterfaceEmptyConstructorAttribute", V8TestObject::measureAsFeatureNameTestInterfaceEmptyConstructorAttributeConstructorGetterCallback, nullptr, const_cast<WrapperTypeInfo*>(&V8TestInterfaceEmpty::wrapperTypeInfo), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kAllWorlds }, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif // Suppress warning: global constructors, because AttributeConfiguration is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif static const V8DOMConfiguration::AttributeConfiguration V8TestObjectLazyDataAttributes[] = { { "testInterfaceEmptyConstructorAttribute", V8ConstructorAttributeGetter, nullptr, const_cast<WrapperTypeInfo*>(&V8TestInterfaceEmpty::wrapperTypeInfo), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kAllWorlds }, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp index fc50996..99da49e 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
@@ -30,7 +30,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -47,7 +47,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp index b604394..567dea7d 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp
@@ -24,7 +24,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -41,7 +41,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp index 6068add7..ba2ebea 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
@@ -37,7 +37,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -54,7 +54,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif @@ -464,14 +464,14 @@ // Suppress warning: global constructors, because AttributeConfiguration is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif static const V8DOMConfiguration::AttributeConfiguration V8TestTypedefsLazyDataAttributes[] = { { "tAttribute", V8ConstructorAttributeGetter, nullptr, const_cast<WrapperTypeInfo*>(&V8TestInterface::wrapperTypeInfo), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kAllWorlds }, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp index 1a679d0..5429220e 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp
@@ -24,7 +24,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -41,7 +41,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp index 769e6c2..2e5a6e3b 100644 --- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
@@ -28,7 +28,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -45,7 +45,7 @@ WrapperTypeInfo::kInheritFromActiveScriptWrappable, WrapperTypeInfo::kDependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif @@ -811,14 +811,14 @@ // Suppress warning: global constructors, because AttributeConfiguration is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif static const V8DOMConfiguration::AttributeConfiguration V8TestInterface5LazyDataAttributes[] = { { "testInterfaceConstructorAttribute", V8ConstructorAttributeGetter, nullptr, const_cast<WrapperTypeInfo*>(&V8TestInterface5::wrapperTypeInfo), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kAllWorlds }, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestSubObject.cpp b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestSubObject.cpp index 07ad9b9..4922d20 100644 --- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestSubObject.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestSubObject.cpp
@@ -24,7 +24,7 @@ // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif @@ -41,7 +41,7 @@ WrapperTypeInfo::kNotInheritFromActiveScriptWrappable, WrapperTypeInfo::kIndependent, }; -#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__) #pragma clang diagnostic pop #endif
diff --git a/third_party/WebKit/Source/build/scripts/make_computed_style_base.py b/third_party/WebKit/Source/build/scripts/make_computed_style_base.py index 6b4bed2..f70e525 100755 --- a/third_party/WebKit/Source/build/scripts/make_computed_style_base.py +++ b/third_party/WebKit/Source/build/scripts/make_computed_style_base.py
@@ -4,7 +4,6 @@ # found in the LICENSE file. import math -import sys import json5_generator import template_expander @@ -14,7 +13,6 @@ enum_for_css_keyword, enum_type_name, enum_value_name, class_member_name, method_name, class_name, join_name ) -from collections import defaultdict, OrderedDict from itertools import chain # Heuristic ordering of types from largest to smallest, used to sort fields by their alignment sizes. @@ -109,6 +107,14 @@ return group_path +class Enum(object): + """Represents a generated enum in ComputedStyleBaseConstants.""" + def __init__(self, type_name, keywords, is_set): + self.type_name = type_name + self.values = [enum_value_name(keyword) for keyword in keywords] + self.is_set = is_set + + class DiffGroup(object): """Represents a group of expressions and subgroups that need to be diffed for a function in ComputedStyle. @@ -294,27 +300,29 @@ def _create_enums(properties): - """ - Returns an OrderedDict of enums to be generated, enum name -> [list of enum values] - """ + """Returns a list of Enums to be generated""" enums = {} for property_ in properties: # Only generate enums for keyword properties that do not require includes. - if property_['field_template'] == 'keyword' and len(property_['include_paths']) == 0: - enum_name = property_['type_name'] - enum_values = [enum_value_name(k) for k in property_['keywords']] + if property_['field_template'] in ('keyword', 'multi_keyword') and len(property_['include_paths']) == 0: + enum = Enum(property_['type_name'], property_['keywords'], + is_set=(property_['field_template'] == 'multi_keyword')) - if enum_name in enums: + if property_['field_template'] == 'multi_keyword': + assert property_['keywords'][0] == 'none', \ + "First keyword in a 'multi_keyword' field must be 'none' in '{}'.".format(property_['name']) + + if enum.type_name in enums: # There's an enum with the same name, check if the enum values are the same - assert set(enums[enum_name]) == set(enum_values), \ - ("'" + property_['name'] + "' can't have type_name '" + enum_name + "' " + assert set(enums[enum.type_name].values) == set(enum.values), \ + ("'" + property_['name'] + "' can't have type_name '" + enum.type_name + "' " "because it was used by a previous property, but with a different set of keywords. " "Either give it a different name or ensure the keywords are the same.") - enums[enum_name] = enum_values + enums[enum.type_name] = enum - # Return the enums sorted by key (enum name) - return OrderedDict(sorted(enums.items(), key=lambda t: t[0])) + # Return the enums sorted by type name + return list(sorted(enums.values(), key=lambda e: e.type_name)) def _create_property_field(property_): @@ -334,6 +342,10 @@ ("'" + property_['name'] + "' is a keyword field, " "so it should not specify a field_size") size = int(math.ceil(math.log(len(property_['keywords']), 2))) + elif property_['field_template'] == 'multi_keyword': + type_name = property_['type_name'] + default_value = type_name + '::' + enum_value_name(property_['default_value']) + size = len(property_['keywords']) - 1 # Subtract 1 for 'none' keyword elif property_['field_template'] == 'storage_only': type_name = property_['type_name'] default_value = property_['default_value']
diff --git a/third_party/WebKit/Source/build/scripts/make_css_value_id_mappings.py b/third_party/WebKit/Source/build/scripts/make_css_value_id_mappings.py index 8394727..648310e 100755 --- a/third_party/WebKit/Source/build/scripts/make_css_value_id_mappings.py +++ b/third_party/WebKit/Source/build/scripts/make_css_value_id_mappings.py
@@ -22,7 +22,7 @@ mappings = {} include_paths = set() for property_ in self._properties.values(): - if property_['field_template'] == 'keyword': + if property_['field_template'] in ('keyword', 'multi_keyword'): include_paths.update(property_['include_paths']) mappings[property_['type_name']] = {
diff --git a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl index f5abe9f1..c7261c7 100644 --- a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl +++ b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl
@@ -20,6 +20,7 @@ aspects of the field (e.g. getters, setters). #} {% import 'fields/keyword.tmpl' as keyword %} +{% import 'fields/multi_keyword.tmpl' as multi_keyword %} {% import 'fields/primitive.tmpl' as primitive %} {% import 'fields/monotonic_flag.tmpl' as monotonic_flag %} {% import 'fields/storage_only.tmpl' as storage_only %} @@ -28,6 +29,7 @@ {% from 'fields/field.tmpl' import encode %} {% set field_templates = { 'keyword': keyword, + 'multi_keyword': multi_keyword, 'primitive': primitive, 'monotonic_flag': monotonic_flag, 'storage_only': storage_only,
diff --git a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBaseConstants.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBaseConstants.h.tmpl index 2e4535c..03c41f8 100644 --- a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBaseConstants.h.tmpl +++ b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBaseConstants.h.tmpl
@@ -1,4 +1,4 @@ -{% from 'macros.tmpl' import license %} +{% from 'macros.tmpl' import license, print_if %} {{license()}} #ifndef ComputedStyleBaseConstants_h @@ -9,13 +9,28 @@ // TODO(sashab): Move these enums to their own namespace, or add a CSS prefix, // for consistency and to prevent name conflicts. -{% for enum_name, enum_values in enums.items() %} -enum class {{enum_name}} : unsigned { - {% for enum_value in enum_values %} - {{enum_value}}, +{% for enum in enums %} +enum class {{enum.type_name}} : unsigned { + {% for value in enum.values %} + {{value}}{{print_if(enum.is_set, " = " ~ (0 if loop.first else 2**loop.index0))}}, {% endfor %} }; +{% if enum.is_set %} +static const int k{{enum.type_name}}Bits = {{enum.values|length - 1}}; + +{% for op in ('|', '^') %} +inline {{enum.type_name}} operator{{op}}({{enum.type_name}} a, {{enum.type_name}} b) { + return static_cast<{{enum.type_name}}>( + static_cast<unsigned>(a) {{op}} static_cast<unsigned>(b) + ); +} +inline {{enum.type_name}}& operator{{op}}=({{enum.type_name}}& a, {{enum.type_name}} b) { + return a = a {{op}} b; +} + +{% endfor %} +{% endif %} {% endfor %} } // namespace blink
diff --git a/third_party/WebKit/Source/build/scripts/templates/fields/multi_keyword.tmpl b/third_party/WebKit/Source/build/scripts/templates/fields/multi_keyword.tmpl new file mode 100644 index 0000000..1b97b4f --- /dev/null +++ b/third_party/WebKit/Source/build/scripts/templates/fields/multi_keyword.tmpl
@@ -0,0 +1,8 @@ +{% import 'fields/keyword.tmpl' as keyword %} + +{% macro decl_public_methods(field) -%} +{{keyword.decl_public_methods(field)}} +{%- endmacro %} + +{% macro decl_protected_methods(field) -%} +{%- endmacro %}
diff --git a/third_party/WebKit/Source/core/BUILD.gn b/third_party/WebKit/Source/core/BUILD.gn index c8ed280..abebeeb 100644 --- a/third_party/WebKit/Source/core/BUILD.gn +++ b/third_party/WebKit/Source/core/BUILD.gn
@@ -586,6 +586,7 @@ "$blink_core_output_dir/css/properties/CSSPropertyAPIZoom.h", "$blink_core_output_dir/css/properties/CSSPropertyDescriptor.cpp", "$blink_core_output_dir/css/properties/CSSPropertyDescriptor.h", + "$blink_core_output_dir/css/properties/CSSShorthandPropertyAPIAnimation.h", "$blink_core_output_dir/css/properties/CSSShorthandPropertyAPIBorderRadius.h", "$blink_core_output_dir/css/properties/CSSShorthandPropertyAPIBorderSpacing.h", "$blink_core_output_dir/css/properties/CSSShorthandPropertyAPIColumns.h", @@ -595,6 +596,7 @@ "$blink_core_output_dir/css/properties/CSSShorthandPropertyAPIOverflow.h", "$blink_core_output_dir/css/properties/CSSShorthandPropertyAPIOffset.h", "$blink_core_output_dir/css/properties/CSSShorthandPropertyAPITextDecoration.h", + "$blink_core_output_dir/css/properties/CSSShorthandPropertyAPITransition.h", "$blink_core_output_dir/css/properties/CSSShorthandPropertyAPIWebkitMarginCollapse.h", ] } @@ -1252,6 +1254,7 @@ "dom/TreeScopeTest.cpp", "dom/URLSearchParamsTest.cpp", "dom/UserGestureIndicatorTest.cpp", + "dom/WhitespaceAttacherTest.cpp", "dom/custom/CustomElementDefinitionTest.cpp", "dom/custom/CustomElementDescriptorTest.cpp", "dom/custom/CustomElementReactionQueueTest.cpp", @@ -1268,11 +1271,13 @@ "editing/TextFinderTest.cpp", "events/EventPathTest.cpp", "events/EventTargetTest.cpp", + "events/ListenerLeakTest.cpp", "events/PointerEventFactoryTest.cpp", "events/TouchEventTest.cpp", "events/WebInputEventConversionTest.cpp", "exported/FakeWebPlugin.cpp", "exported/FakeWebPlugin.h", + "exported/PrerenderingTest.cpp", "exported/WebAssociatedURLLoaderImplTest.cpp", "exported/WebDocumentSubresourceFilterTest.cpp", "exported/WebDocumentTest.cpp", @@ -1280,6 +1285,7 @@ "exported/WebElementTest.cpp", "exported/WebFrameSerializerTest.cpp", "exported/WebHelperPluginTest.cpp", + "exported/WebMeaningfulLayoutsTest.cpp", "exported/WebNodeTest.cpp", "exported/WebPluginContainerTest.cpp", "exported/WebRangeTest.cpp", @@ -1292,6 +1298,7 @@ "fileapi/FileTest.cpp", "frame/BrowserControlsTest.cpp", "frame/DOMTimerTest.cpp", + "frame/DeferredLoadingTest.cpp", "frame/DocumentLoadingRenderingTest.cpp", "frame/FrameSerializerTest.cpp", "frame/FrameTest.cpp", @@ -1299,6 +1306,7 @@ "frame/FrameTestHelpers.h", "frame/HistoryTest.cpp", "frame/LocalFrameViewTest.cpp", + "frame/MHTMLTest.cpp", "frame/OriginsUsingFeaturesTest.cpp", "frame/PerformanceMonitorTest.cpp", "frame/RootFrameViewportTest.cpp", @@ -1435,6 +1443,7 @@ "loader/MixedContentCheckerTest.cpp", "loader/NetworkQuietDetectorTest.cpp", "loader/PingLoaderTest.cpp", + "loader/ProgrammaticScrollTest.cpp", "loader/ProgressTrackerTest.cpp", "loader/TextResourceDecoderBuilderTest.cpp", "loader/ThreadableLoaderTest.cpp", @@ -1488,6 +1497,9 @@ "paint/TextPainterTest.cpp", "paint/TextSelectionRepaintTest.cpp", "paint/VideoPainterTest.cpp", + "scheduler/ActiveConnectionThrottlingTest.cpp", + "scheduler/FrameThrottlingTest.cpp", + "scheduler/ThrottlingTest.cpp", "streams/ReadableStreamOperationsTest.cpp", "style/BorderValueTest.cpp", "style/ComputedStyleTest.cpp",
diff --git a/third_party/WebKit/Source/core/CoreExport.h b/third_party/WebKit/Source/core/CoreExport.h index 83cb16f..0659a1fa 100644 --- a/third_party/WebKit/Source/core/CoreExport.h +++ b/third_party/WebKit/Source/core/CoreExport.h
@@ -5,7 +5,7 @@ #ifndef CoreExport_h #define CoreExport_h -#include "platform/wtf/Compiler.h" +#include "build/build_config.h" #if defined(COMPONENT_BUILD) #if defined(WIN32) @@ -29,11 +29,11 @@ #endif #if defined(BLINK_CORE_IMPLEMENTATION) && BLINK_CORE_IMPLEMENTATION -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) #define CORE_TEMPLATE_CLASS_EXPORT #define CORE_EXTERN_TEMPLATE_EXPORT CORE_EXPORT #define CORE_TEMPLATE_EXPORT CORE_EXPORT -#elif COMPILER(GCC) +#elif defined(COMPILER_GCC) #define CORE_TEMPLATE_CLASS_EXPORT CORE_EXPORT #define CORE_EXTERN_TEMPLATE_EXPORT CORE_EXPORT #define CORE_TEMPLATE_EXPORT
diff --git a/third_party/WebKit/Source/core/animation/CSSInterpolationEnvironment.h b/third_party/WebKit/Source/core/animation/CSSInterpolationEnvironment.h index 27e3caf49..eaf51add 100644 --- a/third_party/WebKit/Source/core/animation/CSSInterpolationEnvironment.h +++ b/third_party/WebKit/Source/core/animation/CSSInterpolationEnvironment.h
@@ -11,12 +11,17 @@ namespace blink { class ComputedStyle; +class CSSVariableResolver; class CSSInterpolationEnvironment : public InterpolationEnvironment { public: explicit CSSInterpolationEnvironment(const InterpolationTypesMap& map, - StyleResolverState& state) - : InterpolationEnvironment(map), state_(&state), style_(state.Style()) {} + StyleResolverState& state, + CSSVariableResolver* variable_resolver) + : InterpolationEnvironment(map), + state_(&state), + style_(state.Style()), + variable_resolver_(variable_resolver) {} explicit CSSInterpolationEnvironment(const InterpolationTypesMap& map, const ComputedStyle& style) @@ -38,9 +43,17 @@ return *style_; } + bool HasVariableResolver() const { return variable_resolver_; } + + CSSVariableResolver& VariableResolver() const { + DCHECK(HasVariableResolver()); + return *variable_resolver_; + } + private: StyleResolverState* state_ = nullptr; const ComputedStyle* style_ = nullptr; + CSSVariableResolver* variable_resolver_ = nullptr; }; DEFINE_TYPE_CASTS(CSSInterpolationEnvironment,
diff --git a/third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp index 48a9e95..7d1467e 100644 --- a/third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp
@@ -97,6 +97,37 @@ Persistent<const CSSValue> initial_value_; }; +class ResolvedRegisteredCustomPropertyChecker + : public InterpolationType::ConversionChecker { + public: + static std::unique_ptr<ResolvedRegisteredCustomPropertyChecker> Create( + const CSSCustomPropertyDeclaration& declaration, + RefPtr<CSSVariableData> resolved_tokens) { + return WTF::WrapUnique(new ResolvedRegisteredCustomPropertyChecker( + declaration, std::move(resolved_tokens))); + } + + private: + ResolvedRegisteredCustomPropertyChecker( + const CSSCustomPropertyDeclaration& declaration, + RefPtr<CSSVariableData> resolved_tokens) + : declaration_(declaration), + resolved_tokens_(std::move(resolved_tokens)) {} + + bool IsValid(const InterpolationEnvironment& environment, + const InterpolationValue&) const final { + DCHECK(ToCSSInterpolationEnvironment(environment).HasVariableResolver()); + RefPtr<CSSVariableData> resolved_tokens = + ToCSSInterpolationEnvironment(environment) + .VariableResolver() + .ResolveCustomPropertyAnimationKeyframe(*declaration_); + return DataEquivalent(resolved_tokens, resolved_tokens_); + } + + Persistent<const CSSCustomPropertyDeclaration> declaration_; + RefPtr<CSSVariableData> resolved_tokens_; +}; + CSSInterpolationType::CSSInterpolationType( PropertyHandle property, const PropertyRegistration* registration) @@ -125,15 +156,18 @@ const InterpolationValue& underlying, ConversionCheckers& conversion_checkers) const { const CSSValue* value = ToCSSPropertySpecificKeyframe(keyframe).Value(); - const StyleResolverState& state = - ToCSSInterpolationEnvironment(environment).GetState(); + const CSSInterpolationEnvironment& css_environment = + ToCSSInterpolationEnvironment(environment); + const StyleResolverState& state = css_environment.GetState(); if (!value) return MaybeConvertNeutral(underlying, conversion_checkers); if (GetProperty().IsCSSCustomProperty()) { + DCHECK(css_environment.HasVariableResolver()); return MaybeConvertCustomPropertyDeclaration( - ToCSSCustomPropertyDeclaration(*value), state, conversion_checkers); + ToCSSCustomPropertyDeclaration(*value), state, + css_environment.VariableResolver(), conversion_checkers); } if (value->IsVariableReferenceValue() || @@ -165,6 +199,7 @@ InterpolationValue CSSInterpolationType::MaybeConvertCustomPropertyDeclaration( const CSSCustomPropertyDeclaration& declaration, const StyleResolverState& state, + CSSVariableResolver& variable_resolver, ConversionCheckers& conversion_checkers) const { const AtomicString& name = declaration.GetName(); DCHECK_EQ(GetProperty().CustomPropertyName(), name); @@ -193,22 +228,23 @@ return MaybeConvertValue(*value, &state, conversion_checkers); } + RefPtr<CSSVariableData> resolved_tokens; if (declaration.Value()->NeedsVariableResolution()) { - // TODO(alancutter): Support smooth interpolation with var() values for - // registered custom properties. This requires integrating animated custom - // property value application with the CSSVariableResolver to apply them in - // the appropriate order defined by the chain of var() dependencies. - // All CSSInterpolationTypes should fail convertion here except for - // CSSDefaultInterpolationType. + resolved_tokens = + variable_resolver.ResolveCustomPropertyAnimationKeyframe(declaration); + conversion_checkers.push_back( + ResolvedRegisteredCustomPropertyChecker::Create(declaration, + resolved_tokens)); + } else { + resolved_tokens = declaration.Value(); + } + const CSSValue* resolved_value = + resolved_tokens ? resolved_tokens->ParseForSyntax(registration_->Syntax()) + : nullptr; + if (!resolved_value) { return nullptr; } - - const CSSValue* parsed_value = - declaration.Value()->ParseForSyntax(Registration().Syntax()); - if (!parsed_value) { - return nullptr; - } - return MaybeConvertValue(*parsed_value, &state, conversion_checkers); + return MaybeConvertValue(*resolved_value, &state, conversion_checkers); } InterpolationValue CSSInterpolationType::MaybeConvertUnderlyingValue(
diff --git a/third_party/WebKit/Source/core/animation/CSSInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSInterpolationType.h index fd9f780..285ea11 100644 --- a/third_party/WebKit/Source/core/animation/CSSInterpolationType.h +++ b/third_party/WebKit/Source/core/animation/CSSInterpolationType.h
@@ -11,6 +11,7 @@ namespace blink { class CSSCustomPropertyDeclaration; +class CSSVariableResolver; class ComputedStyle; class PropertyRegistration; class StyleResolverState; @@ -73,6 +74,7 @@ InterpolationValue MaybeConvertCustomPropertyDeclaration( const CSSCustomPropertyDeclaration&, const StyleResolverState&, + CSSVariableResolver&, ConversionCheckers&) const; virtual const CSSValue* CreateCSSValue(const InterpolableValue&,
diff --git a/third_party/WebKit/Source/core/animation/CSSPathInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSPathInterpolationType.cpp index 2b4a256..b54fb796 100644 --- a/third_party/WebKit/Source/core/animation/CSSPathInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSPathInterpolationType.cpp
@@ -91,7 +91,7 @@ return nullptr; } return PathInterpolationFunctions::ConvertValue( - ToCSSPathValue(value).ByteStream()); + cssvalue::ToCSSPathValue(value).ByteStream()); } InterpolationValue
diff --git a/third_party/WebKit/Source/core/animation/EffectStack.h b/third_party/WebKit/Source/core/animation/EffectStack.h index 1e0aa5f..7d6e6aa 100644 --- a/third_party/WebKit/Source/core/animation/EffectStack.h +++ b/third_party/WebKit/Source/core/animation/EffectStack.h
@@ -43,8 +43,6 @@ namespace blink { -using ActiveInterpolationsMap = HashMap<PropertyHandle, ActiveInterpolations>; - class InertEffect; // Represents the order in which a sequence of SampledEffects should apply.
diff --git a/third_party/WebKit/Source/core/animation/Interpolation.h b/third_party/WebKit/Source/core/animation/Interpolation.h index 4fb0c2f2..a948192e 100644 --- a/third_party/WebKit/Source/core/animation/Interpolation.h +++ b/third_party/WebKit/Source/core/animation/Interpolation.h
@@ -8,13 +8,12 @@ #include <memory> #include "core/CoreExport.h" #include "core/animation/InterpolableValue.h" +#include "core/animation/PropertyHandle.h" #include "platform/wtf/Forward.h" #include "platform/wtf/RefCounted.h" namespace blink { -class PropertyHandle; - // The Interpolation class is an abstract class representing an animation effect // between two keyframe values for the same property (CSS property, SVG // attribute, etc), for example animating the CSS property 'left' from '100px' @@ -81,6 +80,7 @@ }; using ActiveInterpolations = Vector<RefPtr<Interpolation>, 1>; +using ActiveInterpolationsMap = HashMap<PropertyHandle, ActiveInterpolations>; } // namespace blink
diff --git a/third_party/WebKit/Source/core/animation/OWNERS b/third_party/WebKit/Source/core/animation/OWNERS index f5286e3..b9930d2 100644 --- a/third_party/WebKit/Source/core/animation/OWNERS +++ b/third_party/WebKit/Source/core/animation/OWNERS
@@ -1,5 +1,6 @@ alancutter@chromium.org dstockwell@chromium.org +ericwilligers@chromium.org shans@chromium.org suzyh@chromium.org timloh@chromium.org
diff --git a/third_party/WebKit/Source/core/animation/SVGPathInterpolationType.cpp b/third_party/WebKit/Source/core/animation/SVGPathInterpolationType.cpp index 9109335a62..218e7b4 100644 --- a/third_party/WebKit/Source/core/animation/SVGPathInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/SVGPathInterpolationType.cpp
@@ -46,7 +46,7 @@ const InterpolableValue& interpolable_value, const NonInterpolableValue* non_interpolable_value) const { return SVGPath::Create( - CSSPathValue::Create(PathInterpolationFunctions::AppliedValue( + cssvalue::CSSPathValue::Create(PathInterpolationFunctions::AppliedValue( interpolable_value, non_interpolable_value))); }
diff --git a/third_party/WebKit/Source/core/animation/TimingInputTest.cpp b/third_party/WebKit/Source/core/animation/TimingInputTest.cpp index f3f0ee7..99dc2a59 100644 --- a/third_party/WebKit/Source/core/animation/TimingInputTest.cpp +++ b/third_party/WebKit/Source/core/animation/TimingInputTest.cpp
@@ -15,7 +15,7 @@ namespace blink { -class AnimationTimingInputTest : public testing::Test { +class AnimationTimingInputTest : public ::testing::Test { public: Timing ApplyTimingInputNumber(v8::Isolate*, String timing_property,
diff --git a/third_party/WebKit/Source/core/animation/TransitionInterpolation.cpp b/third_party/WebKit/Source/core/animation/TransitionInterpolation.cpp index b2f0a6d..29875ba3 100644 --- a/third_party/WebKit/Source/core/animation/TransitionInterpolation.cpp +++ b/third_party/WebKit/Source/core/animation/TransitionInterpolation.cpp
@@ -47,7 +47,7 @@ void TransitionInterpolation::Apply(StyleResolverState& state) const { CSSInterpolationTypesMap map(state.GetDocument().GetPropertyRegistry()); - CSSInterpolationEnvironment environment(map, state); + CSSInterpolationEnvironment environment(map, state, nullptr); type_.Apply(CurrentInterpolableValue(), CurrentNonInterpolableValue(), environment); }
diff --git a/third_party/WebKit/Source/core/core.gni b/third_party/WebKit/Source/core/core.gni index adbfa3a..0749c98 100644 --- a/third_party/WebKit/Source/core/core.gni +++ b/third_party/WebKit/Source/core/core.gni
@@ -3,6 +3,7 @@ # found in the LICENSE file. import("//build/config/chrome_build.gni") +import("//build/config/jumbo.gni") import("//build/split_static_library.gni") import("//third_party/WebKit/Source/config.gni") @@ -73,18 +74,18 @@ # visibility # Normal meaning if defined. If undefined, defaults to everything in core. template("blink_core_sources") { - if (is_component_build) { - target_type = "source_set" + jumbo_target(target_name) { + if (is_component_build) { + target_type = "source_set" - # This assert avoids an unused variable warning. - assert(!defined(invoker.split_count) || invoker.split_count != 0) - } else if (!defined(invoker.split_count)) { - target_type = "static_library" - } else { - target_type = "split_static_library" - } + # This assert avoids an unused variable warning. + assert(!defined(invoker.split_count) || invoker.split_count != 0) + } else if (!defined(invoker.split_count)) { + target_type = "static_library" + } else { + target_type = "split_static_library" + } - target(target_type, target_name) { # The visibility will get overridden by forward_variables_from below if the # invoker defined it. visibility = [ "//third_party/WebKit/Source/core/*" ]
diff --git a/third_party/WebKit/Source/core/core_idl_files.gni b/third_party/WebKit/Source/core/core_idl_files.gni index 1c7fa4a..a7fec9f 100644 --- a/third_party/WebKit/Source/core/core_idl_files.gni +++ b/third_party/WebKit/Source/core/core_idl_files.gni
@@ -515,6 +515,7 @@ "css/FontFaceSetLoadEventInit.idl", "css/MediaQueryListEventInit.idl", "css/PropertyDescriptor.idl", + "css/cssom/CSSMatrixComponentOptions.idl", "dom/ElementCreationOptions.idl", "dom/ElementDefinitionOptions.idl", "dom/ElementRegistrationOptions.idl",
diff --git a/third_party/WebKit/Source/core/css/BUILD.gn b/third_party/WebKit/Source/core/css/BUILD.gn index 61763c6..88e8273 100644 --- a/third_party/WebKit/Source/core/css/BUILD.gn +++ b/third_party/WebKit/Source/core/css/BUILD.gn
@@ -506,6 +506,9 @@ "properties/CSSPropertyAnimationIterationCountUtils.h", "properties/CSSPropertyAnimationNameUtils.cpp", "properties/CSSPropertyAnimationNameUtils.h", + "properties/CSSPropertyAnimationTimingFunctionUtils.cpp", + "properties/CSSPropertyAnimationTimingFunctionUtils.h", + "properties/CSSPropertyAnimationUtils.h", "properties/CSSPropertyBorderImageUtils.cpp", "properties/CSSPropertyBorderImageUtils.h", "properties/CSSPropertyBoxShadowUtils.cpp", @@ -533,6 +536,7 @@ "properties/CSSPropertyTransitionPropertyUtils.h", "properties/CSSPropertyWebkitBorderWidthUtils.cpp", "properties/CSSPropertyWebkitBorderWidthUtils.h", + "properties/CSSShorthandPropertyAPIAnimation.cpp", "properties/CSSShorthandPropertyAPIBorderRadius.cpp", "properties/CSSShorthandPropertyAPIBorderSpacing.cpp", "properties/CSSShorthandPropertyAPIColumns.cpp", @@ -542,6 +546,7 @@ "properties/CSSShorthandPropertyAPIOffset.cpp", "properties/CSSShorthandPropertyAPIOverflow.cpp", "properties/CSSShorthandPropertyAPITextDecoration.cpp", + "properties/CSSShorthandPropertyAPITransition.cpp", "properties/CSSShorthandPropertyAPIWebkitMarginCollapse.cpp", "resolver/AnimatedStyleBuilder.cpp", "resolver/AnimatedStyleBuilder.h",
diff --git a/third_party/WebKit/Source/core/css/CSSPathValue.cpp b/third_party/WebKit/Source/core/css/CSSPathValue.cpp index 320a134c..947bd9a2 100644 --- a/third_party/WebKit/Source/core/css/CSSPathValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSPathValue.cpp
@@ -10,6 +10,8 @@ namespace blink { +namespace cssvalue { + CSSPathValue* CSSPathValue::Create(PassRefPtr<StylePath> style_path) { return new CSSPathValue(std::move(style_path)); } @@ -54,4 +56,5 @@ CSSValue::TraceAfterDispatch(visitor); } +} // namespace cssvalue } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/CSSPathValue.h b/third_party/WebKit/Source/core/css/CSSPathValue.h index 3deba2f5..28da5476 100644 --- a/third_party/WebKit/Source/core/css/CSSPathValue.h +++ b/third_party/WebKit/Source/core/css/CSSPathValue.h
@@ -16,6 +16,8 @@ class StylePath; +namespace cssvalue { + class CSSPathValue : public CSSValue { public: static CSSPathValue* Create(PassRefPtr<StylePath>); @@ -42,6 +44,7 @@ DEFINE_CSS_VALUE_TYPE_CASTS(CSSPathValue, IsPathValue()); +} // namespace cssvalue } // namespace blink #endif // CSSPathValue_h
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h b/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h index bffbfbd..b0d9265 100644 --- a/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h +++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
@@ -658,27 +658,6 @@ } template <> -inline TextDecoration CSSIdentifierValue::ConvertTo() const { - switch (value_id_) { - case CSSValueNone: - return TextDecoration::kNone; - case CSSValueUnderline: - return TextDecoration::kUnderline; - case CSSValueOverline: - return TextDecoration::kOverline; - case CSSValueLineThrough: - return TextDecoration::kLineThrough; - case CSSValueBlink: - return TextDecoration::kBlink; - default: - break; - } - - NOTREACHED(); - return TextDecoration::kNone; -} - -template <> inline TextDecorationSkip CSSIdentifierValue::ConvertTo() const { switch (value_id_) { case CSSValueObjects:
diff --git a/third_party/WebKit/Source/core/css/CSSProperties.json5 b/third_party/WebKit/Source/core/css/CSSProperties.json5 index 94c9dab..c65a4f8 100644 --- a/third_party/WebKit/Source/core/css/CSSProperties.json5 +++ b/third_party/WebKit/Source/core/css/CSSProperties.json5
@@ -87,6 +87,8 @@ // If include_paths is empty, we would also generate the corresponding // enum definition in ComputedStyleConstants.h. "keyword", + // Field can take on any subset of values from a list of keywords. + "multi_keyword", // Field stores a primitive value like int/bool. The type is specified by // type_name. The interface has a initial/getter/setter/resetter. "primitive", @@ -1743,8 +1745,8 @@ type_name: "WebBlendMode", field_template: "keyword", keywords: ["normal", "multiply", "screen", "overlay", "darken", "lighten", - "color-dodge", "color-burn", "hard-light", "soft-light", "difference", - "exclusion", "hue", "saturation", "color", "luminosity"], + "color-dodge", "color-burn", "hard-light", "soft-light", "difference", + "exclusion", "hue", "saturation", "color", "luminosity"], field_group: "rare-non-inherited", default_value: "normal", include_paths: ["public/platform/WebBlendMode.h"], @@ -2553,9 +2555,9 @@ name_for_methods: "TextDecoration", runtime_flag: "CSS3TextDecorations", type_name: "TextDecoration", - field_template: "storage_only", - field_size: 4, - default_value: "TextDecoration::kNone", + field_template: "multi_keyword", + default_value: "none", + keywords: ["none", "underline", "overline", "line-through", "blink"], field_group: "visual", }, { @@ -3665,6 +3667,8 @@ { name: "animation", longhands: "animation-name;animation-duration;animation-timing-function;animation-delay;animation-iteration-count;animation-direction;animation-fill-mode;animation-play-state", + api_class: true, + api_methods: ["parseShorthand"], }, { name: "background", @@ -3873,6 +3877,8 @@ { name: "transition", longhands: "transition-property;transition-duration;transition-timing-function;transition-delay", + api_class: true, + api_methods: ["parseShorthand"], }, { name: "-webkit-border-after",
diff --git a/third_party/WebKit/Source/core/css/CSSSelector.h b/third_party/WebKit/Source/core/css/CSSSelector.h index 6e64a91..319b859 100644 --- a/third_party/WebKit/Source/core/css/CSSSelector.h +++ b/third_party/WebKit/Source/core/css/CSSSelector.h
@@ -301,7 +301,7 @@ return pseudo_type_ == kPseudoHost || pseudo_type_ == kPseudoHostContext; } bool IsUserActionPseudoClass() const; - bool IsInsertionPointCrossing() const { + bool IsV0InsertionPointCrossing() const { return pseudo_type_ == kPseudoHostContext || pseudo_type_ == kPseudoContent; } bool IsIdClassOrAttributeSelector() const;
diff --git a/third_party/WebKit/Source/core/css/CSSTestHelper.cpp b/third_party/WebKit/Source/core/css/CSSTestHelper.cpp index b0f82af..a8177ac 100644 --- a/third_party/WebKit/Source/core/css/CSSTestHelper.cpp +++ b/third_party/WebKit/Source/core/css/CSSTestHelper.cpp
@@ -44,8 +44,8 @@ CSSTestHelper::CSSTestHelper() { document_ = Document::Create(); TextPosition position; - style_sheet_ = - CSSStyleSheet::CreateInline(*document_, KURL(), position, UTF8Encoding()); + style_sheet_ = CSSStyleSheet::CreateInline(*document_, NullURL(), position, + UTF8Encoding()); } CSSRuleList* CSSTestHelper::CssRules() {
diff --git a/third_party/WebKit/Source/core/css/OWNERS b/third_party/WebKit/Source/core/css/OWNERS index 5271a5f..d294f42b 100644 --- a/third_party/WebKit/Source/core/css/OWNERS +++ b/third_party/WebKit/Source/core/css/OWNERS
@@ -1,6 +1,12 @@ bugsnash@chromium.org -meade@chromium.org +ericwilligers@chromium.org nainar@chromium.org +shend@chromium.org suzyh@chromium.org +rjwright@chromium.org + +# Also core owners +alancutter@chromium.org +meade@chromium.org # COMPONENT: Blink>CSS
diff --git a/third_party/WebKit/Source/core/css/RuleFeature.cpp b/third_party/WebKit/Source/core/css/RuleFeature.cpp index d511aa5c..e5f2454 100644 --- a/third_party/WebKit/Source/core/css/RuleFeature.cpp +++ b/third_party/WebKit/Source/core/css/RuleFeature.cpp
@@ -754,7 +754,7 @@ if (simple_selector.IsHostPseudoClass()) descendant_features.tree_boundary_crossing = true; - if (simple_selector.IsInsertionPointCrossing()) + if (simple_selector.IsV0InsertionPointCrossing()) descendant_features.insertion_point_crossing = true; AddFeaturesToInvalidationSetsForSelectorList(
diff --git a/third_party/WebKit/Source/core/css/SelectorChecker.cpp b/third_party/WebKit/Source/core/css/SelectorChecker.cpp index c283616..24a9e94c 100644 --- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp +++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
@@ -36,12 +36,12 @@ #include "core/dom/ElementTraversal.h" #include "core/dom/FlatTreeTraversal.h" #include "core/dom/Fullscreen.h" -#include "core/dom/InsertionPoint.h" #include "core/dom/NodeComputedStyle.h" #include "core/dom/NthIndexCache.h" #include "core/dom/ShadowRoot.h" #include "core/dom/StyleEngine.h" #include "core/dom/Text.h" +#include "core/dom/V0InsertionPoint.h" #include "core/editing/FrameSelection.h" #include "core/frame/LocalFrame.h" #include "core/html/HTMLDocument.h" @@ -521,7 +521,7 @@ const SelectorCheckingContext& context, const Element& element, MatchResult& result) const { - HeapVector<Member<InsertionPoint>, 8> insertion_points; + HeapVector<Member<V0InsertionPoint>, 8> insertion_points; CollectDestinationInsertionPoints(element, insertion_points); SelectorCheckingContext next_context(context); for (const auto& insertion_point : insertion_points) { @@ -1183,7 +1183,7 @@ return Match(sub_context); } case CSSSelector::kPseudoContent: - return element.IsInShadowTree() && element.IsInsertionPoint(); + return element.IsInShadowTree() && element.IsV0InsertionPoint(); case CSSSelector::kPseudoShadow: return element.IsInShadowTree() && context.previous_element; default:
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.cpp b/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.cpp index 3ad9133..952ec18 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.cpp +++ b/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.cpp
@@ -5,31 +5,57 @@ #include "core/css/cssom/CSSMatrixComponent.h" #include "core/css/CSSPrimitiveValue.h" +#include "core/css/cssom/CSSMatrixComponentOptions.h" +#include "core/geometry/DOMMatrix.h" #include "platform/wtf/MathExtras.h" namespace blink { -CSSMatrixComponent* CSSMatrixComponent::Create(DOMMatrixReadOnly* matrix) { - return new CSSMatrixComponent(matrix); +namespace { + +DOMMatrix* To2DMatrix(DOMMatrixReadOnly* matrix) { + DOMMatrix* twoDimensionalMatrix = DOMMatrix::Create(); + twoDimensionalMatrix->setA(matrix->m11()); + twoDimensionalMatrix->setB(matrix->m12()); + twoDimensionalMatrix->setC(matrix->m21()); + twoDimensionalMatrix->setD(matrix->m22()); + twoDimensionalMatrix->setE(matrix->m41()); + twoDimensionalMatrix->setF(matrix->m42()); + return twoDimensionalMatrix; +} + +} // namespace + +CSSMatrixComponent* CSSMatrixComponent::Create( + DOMMatrixReadOnly* matrix, + const CSSMatrixComponentOptions& options) { + return new CSSMatrixComponent(matrix, options.is2D() || matrix->is2D()); +} + +DOMMatrix* CSSMatrixComponent::AsMatrix() const { + if (is2D() && !matrix_->is2D()) + return To2DMatrix(matrix_); + + return matrix_.Get(); } CSSFunctionValue* CSSMatrixComponent::ToCSSValue() const { CSSFunctionValue* result = - CSSFunctionValue::Create(is2d_ ? CSSValueMatrix : CSSValueMatrix3d); + CSSFunctionValue::Create(is2D() ? CSSValueMatrix : CSSValueMatrix3d); - if (is2d_) { - double values[6] = {matrix()->a(), matrix()->b(), matrix()->c(), - matrix()->d(), matrix()->e(), matrix()->f()}; + if (is2D()) { + double values[6] = {matrix_->a(), matrix_->b(), matrix_->c(), + matrix_->d(), matrix_->e(), matrix_->f()}; for (double value : values) { result->Append(*CSSPrimitiveValue::Create( value, CSSPrimitiveValue::UnitType::kNumber)); } } else { double values[16] = { - matrix()->m11(), matrix()->m12(), matrix()->m13(), matrix()->m14(), - matrix()->m21(), matrix()->m22(), matrix()->m23(), matrix()->m24(), - matrix()->m31(), matrix()->m32(), matrix()->m33(), matrix()->m34(), - matrix()->m41(), matrix()->m42(), matrix()->m43(), matrix()->m44()}; + matrix_->m11(), matrix_->m12(), matrix_->m13(), matrix_->m14(), + matrix_->m21(), matrix_->m22(), matrix_->m23(), matrix_->m24(), + matrix_->m31(), matrix_->m32(), matrix_->m33(), matrix_->m34(), + matrix_->m41(), matrix_->m42(), matrix_->m43(), matrix_->m44()}; for (double value : values) { result->Append(*CSSPrimitiveValue::Create( value, CSSPrimitiveValue::UnitType::kNumber)); @@ -39,10 +65,4 @@ return result; } -CSSMatrixComponent::CSSMatrixComponent(DOMMatrixReadOnly* matrix) - : CSSTransformComponent() { - matrix_ = DOMMatrix::Create(matrix); - is2d_ = matrix->is2D(); -} - } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.h b/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.h index 1a2800dc..ec92f978 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.h +++ b/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.h
@@ -7,10 +7,11 @@ #include "core/css/cssom/CSSTransformComponent.h" #include "core/geometry/DOMMatrix.h" +#include "core/geometry/DOMMatrixReadOnly.h" namespace blink { -class DOMMatrix; +class CSSMatrixComponentOptions; // Represents a matrix value in a CSSTransformValue used for properties like // "transform". @@ -20,24 +21,24 @@ DEFINE_WRAPPERTYPEINFO(); public: - // Constructor defined in the IDL. - static CSSMatrixComponent* Create(DOMMatrixReadOnly*); + // Constructors defined in the IDL. + static CSSMatrixComponent* Create(DOMMatrixReadOnly*, + const CSSMatrixComponentOptions&); // Blink-internal ways of creating CSSMatrixComponents. static CSSMatrixComponent* FromCSSValue(const CSSFunctionValue& value) { + // TODO(meade): Implement. return nullptr; } // Getters and setters for attributes defined in the IDL. - DOMMatrix* matrix() const { return matrix_; } + DOMMatrix* matrix() { return matrix_.Get(); } void setMatrix(DOMMatrix* matrix) { matrix_ = matrix; } // Internal methods - from CSSTransformComponent. - TransformComponentType GetType() const override { - return is2d_ ? kMatrixType : kMatrix3DType; - } - DOMMatrix* AsMatrix() const override { return matrix(); } - CSSFunctionValue* ToCSSValue() const override; + TransformComponentType GetType() const final { return kMatrixType; } + DOMMatrix* AsMatrix() const final; + CSSFunctionValue* ToCSSValue() const final; DEFINE_INLINE_VIRTUAL_TRACE() { visitor->Trace(matrix_); @@ -45,10 +46,10 @@ } private: - CSSMatrixComponent(DOMMatrixReadOnly*); + CSSMatrixComponent(DOMMatrixReadOnly* matrix, bool is2D) + : CSSTransformComponent(is2D), matrix_(DOMMatrix::Create(matrix)) {} Member<DOMMatrix> matrix_; - bool is2d_; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.idl b/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.idl index 7dd2600..4ffa517 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.idl +++ b/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.idl
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - // Represents a matrix value in a CSSTransformValue used for properties like // "transform". // Spec: https://drafts.css-houdini.org/css-typed-om/#cssmatrixcomponent [ - Constructor(DOMMatrixReadOnly matrix), + Constructor(DOMMatrixReadOnly matrix, + optional CSSMatrixComponentOptions options), Exposed=(Window,PaintWorklet), RuntimeEnabled=CSSTypedOM ] interface CSSMatrixComponent : CSSTransformComponent {
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponentOptions.idl b/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponentOptions.idl new file mode 100644 index 0000000..3b926a5 --- /dev/null +++ b/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponentOptions.idl
@@ -0,0 +1,10 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Options for creating a CSSMatrixComponent. See CSSMatrixComponent for usage. +// Spec: https://drafts.css-houdini.org/css-typed-om/#dictdef-cssmatrixcomponentoptions +dictionary CSSMatrixComponentOptions { + boolean is2D = false; +}; +
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSPerspective.h b/third_party/WebKit/Source/core/css/cssom/CSSPerspective.h index 9909115..f27abc30 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSPerspective.h +++ b/third_party/WebKit/Source/core/css/cssom/CSSPerspective.h
@@ -32,6 +32,11 @@ CSSNumericValue* length() { return length_.Get(); } void setLength(CSSNumericValue*, ExceptionState&); + // From CSSTransformComponent + // Setting is2D for CSSPerspective does nothing. + // https://drafts.css-houdini.org/css-typed-om/#dom-cssskew-is2d + void setIs2D(bool is2D) final {} + // Internal methods - from CSSTransformComponent. TransformComponentType GetType() const final { return kPerspectiveType; } // TODO: Implement AsMatrix for CSSPerspective. @@ -44,7 +49,8 @@ } private: - CSSPerspective(CSSNumericValue* length) : length_(length) {} + CSSPerspective(CSSNumericValue* length) + : CSSTransformComponent(false /* is2D */), length_(length) {} Member<CSSNumericValue> length_; };
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp b/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp index 0d8607f9..367e9847 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp +++ b/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp
@@ -61,6 +61,15 @@ } // namespace +CSSRotation* CSSRotation::Create(CSSNumericValue* angle, + ExceptionState& exception_state) { + if (angle->GetType() != CSSStyleValue::StyleValueType::kAngleType) { + exception_state.ThrowTypeError("Must pass an angle to CSSRotation"); + return nullptr; + } + return new CSSRotation(0, 0, 1, angle, true /* is2D */); +} + CSSRotation* CSSRotation::Create(double x, double y, double z, @@ -70,7 +79,12 @@ exception_state.ThrowTypeError("Must pass an angle to CSSRotation"); return nullptr; } - return new CSSRotation(x, y, z, angle); + return new CSSRotation(x, y, z, angle, false /* is2D */); +} + +CSSRotation* CSSRotation::Create(CSSNumericValue* angle) { + DCHECK_EQ(angle->GetType(), CSSStyleValue::StyleValueType::kAngleType); + return new CSSRotation(0, 0, 1, angle, true /* is2D */); } CSSRotation* CSSRotation::Create(double x, @@ -78,7 +92,7 @@ double z, CSSNumericValue* angle) { DCHECK_EQ(angle->GetType(), CSSStyleValue::StyleValueType::kAngleType); - return new CSSRotation(x, y, z, angle); + return new CSSRotation(x, y, z, angle, false /* is2D */); } CSSRotation* CSSRotation::FromCSSValue(const CSSFunctionValue& value) { @@ -115,8 +129,8 @@ // TODO(meade): Re-implement this when we finish rewriting number/length // types. // CSSFunctionValue* result = - // CSSFunctionValue::Create(is2d_ ? CSSValueRotate : CSSValueRotate3d); - // if (!is2d_) { + // CSSFunctionValue::Create(is2D() ? CSSValueRotate : CSSValueRotate3d); + // if (!is2D()) { // result->Append( // *CSSPrimitiveValue::Create(x_, CSSPrimitiveValue::UnitType::kNumber)); // result->Append(
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSRotation.h b/third_party/WebKit/Source/core/css/cssom/CSSRotation.h index ea573ef..818bba79b 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSRotation.h +++ b/third_party/WebKit/Source/core/css/cssom/CSSRotation.h
@@ -22,10 +22,7 @@ public: // Constructors defined in the IDL. - static CSSRotation* Create(CSSNumericValue* angle, - ExceptionState& exception_state) { - return Create(0, 0, 1, angle, exception_state); - } + static CSSRotation* Create(CSSNumericValue* angle, ExceptionState&); static CSSRotation* Create(double x, double y, double z, @@ -33,9 +30,7 @@ ExceptionState&); // Blink-internal ways of creating CSSRotations. - static CSSRotation* Create(CSSNumericValue* angle) { - return Create(0, 0, 1, angle); - } + static CSSRotation* Create(CSSNumericValue* angle); static CSSRotation* Create(double x, double y, double z, @@ -53,9 +48,7 @@ void setZ(double z) { z_ = z; } // Internal methods - from CSSTransformComponent. - TransformComponentType GetType() const final { - return z_ == 1 ? kRotationType : kRotation3DType; - } + TransformComponentType GetType() const final { return kRotationType; } DOMMatrix* AsMatrix() const final { return nullptr; // TODO(meade): Implement. @@ -74,8 +67,8 @@ } private: - CSSRotation(double x, double y, double z, CSSNumericValue* angle) - : angle_(angle), x_(x), y_(y), z_(z) {} + CSSRotation(double x, double y, double z, CSSNumericValue* angle, bool is2D) + : CSSTransformComponent(is2D), angle_(angle), x_(x), y_(y), z_(z) {} Member<CSSNumericValue> angle_; double x_;
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSScale.cpp b/third_party/WebKit/Source/core/css/cssom/CSSScale.cpp index aea9088..03a2791 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSScale.cpp +++ b/third_party/WebKit/Source/core/css/cssom/CSSScale.cpp
@@ -64,13 +64,13 @@ CSSFunctionValue* CSSScale::ToCSSValue() const { CSSFunctionValue* result = - CSSFunctionValue::Create(is2d_ ? CSSValueScale : CSSValueScale3d); + CSSFunctionValue::Create(is2D() ? CSSValueScale : CSSValueScale3d); result->Append( *CSSPrimitiveValue::Create(x_, CSSPrimitiveValue::UnitType::kNumber)); result->Append( *CSSPrimitiveValue::Create(y_, CSSPrimitiveValue::UnitType::kNumber)); - if (!is2d_) + if (!is2D()) result->Append( *CSSPrimitiveValue::Create(z_, CSSPrimitiveValue::UnitType::kNumber));
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSScale.h b/third_party/WebKit/Source/core/css/cssom/CSSScale.h index a285779..3284af0f 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSScale.h +++ b/third_party/WebKit/Source/core/css/cssom/CSSScale.h
@@ -38,23 +38,22 @@ void setZ(double z) { z_ = z; } // Internal methods - from CSSTransformComponent. - TransformComponentType GetType() const override { - return is2d_ ? kScaleType : kScale3DType; - } - DOMMatrix* AsMatrix() const override { + TransformComponentType GetType() const final { return kScaleType; } + DOMMatrix* AsMatrix() const final { DOMMatrix* result = DOMMatrix::Create(); return result->scaleSelf(x_, y_, z_); } - CSSFunctionValue* ToCSSValue() const override; + CSSFunctionValue* ToCSSValue() const final; private: - CSSScale(double x, double y) : x_(x), y_(y), z_(1), is2d_(true) {} - CSSScale(double x, double y, double z) : x_(x), y_(y), z_(z), is2d_(false) {} + CSSScale(double x, double y) + : CSSTransformComponent(true /* is2D */), x_(x), y_(y), z_(1) {} + CSSScale(double x, double y, double z) + : CSSTransformComponent(false /* is2D */), x_(x), y_(y), z_(z) {} double x_; double y_; double z_; - bool is2d_; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSSkew.h b/third_party/WebKit/Source/core/css/cssom/CSSSkew.h index ef234ed2..bf8a4d1b 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSSkew.h +++ b/third_party/WebKit/Source/core/css/cssom/CSSSkew.h
@@ -35,6 +35,11 @@ void setAx(CSSNumericValue*, ExceptionState&); void setAy(CSSNumericValue*, ExceptionState&); + // From CSSTransformComponent + // Setting is2D for CSSSkew does nothing. + // https://drafts.css-houdini.org/css-typed-om/#dom-cssskew-is2d + void setIs2D(bool is2D) final {} + // Internal methods - from CSSTransformComponent. DOMMatrix* AsMatrix() const override; TransformComponentType GetType() const override { return kSkewType; } @@ -48,7 +53,7 @@ private: CSSSkew(CSSNumericValue* ax, CSSNumericValue* ay) - : CSSTransformComponent(), ax_(ax), ay_(ay) {} + : CSSTransformComponent(true /* is2D */), ax_(ax), ay_(ay) {} Member<CSSNumericValue> ax_; Member<CSSNumericValue> ay_;
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSTransformComponent.h b/third_party/WebKit/Source/core/css/cssom/CSSTransformComponent.h index ebc67ea..0f258c1 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSTransformComponent.h +++ b/third_party/WebKit/Source/core/css/cssom/CSSTransformComponent.h
@@ -32,10 +32,6 @@ kScaleType, kSkewType, kTranslationType, - kMatrix3DType, - kRotation3DType, - kScale3DType, - kTranslation3DType }; virtual ~CSSTransformComponent() {} @@ -44,7 +40,8 @@ static CSSTransformComponent* FromCSSValue(const CSSValue&); // Getters and setters for attributes defined in the IDL. - bool is2D() const { return Is2DComponentType(GetType()); } + bool is2D() const { return is2D_; } + virtual void setIs2D(bool is2D) { is2D_ = is2D; } virtual String toString() const { const CSSValue* result = ToCSSValue(); // TODO(meade): Remove this once all the number and length types are @@ -60,15 +57,10 @@ DEFINE_INLINE_VIRTUAL_TRACE() {} protected: - static bool Is2DComponentType(TransformComponentType transform_type) { - return transform_type != kMatrix3DType && - transform_type != kPerspectiveType && - transform_type != kRotation3DType && - transform_type != kScale3DType && - transform_type != kTranslation3DType; - } + CSSTransformComponent(bool is2D) : is2D_(is2D) {} - CSSTransformComponent() = default; + private: + bool is2D_; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSTransformComponent.idl b/third_party/WebKit/Source/core/css/cssom/CSSTransformComponent.idl index fcfcbe3..ec592a2 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSTransformComponent.idl +++ b/third_party/WebKit/Source/core/css/cssom/CSSTransformComponent.idl
@@ -11,5 +11,5 @@ RuntimeEnabled=CSSTypedOM ] interface CSSTransformComponent { stringifier; - boolean is2D(); + attribute boolean is2D; };
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSTranslation.cpp b/third_party/WebKit/Source/core/css/cssom/CSSTranslation.cpp index 539f6fd6..7948a0d3 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSTranslation.cpp +++ b/third_party/WebKit/Source/core/css/cssom/CSSTranslation.cpp
@@ -13,6 +13,22 @@ CSSTranslation* CSSTranslation::Create(CSSNumericValue* x, CSSNumericValue* y, + ExceptionState& exception_state) { + if ((x->GetType() != CSSStyleValue::StyleValueType::kLengthType && + x->GetType() != CSSStyleValue::StyleValueType::kPercentType) || + (y->GetType() != CSSStyleValue::StyleValueType::kLengthType && + y->GetType() != CSSStyleValue::StyleValueType::kPercentType)) { + exception_state.ThrowTypeError( + "Must pass length or percentage to X and Y of CSSTranslation"); + return nullptr; + } + return new CSSTranslation( + x, y, CSSUnitValue::Create(0, CSSPrimitiveValue::UnitType::kPixels), + true /* is2D */); +} + +CSSTranslation* CSSTranslation::Create(CSSNumericValue* x, + CSSNumericValue* y, CSSNumericValue* z, ExceptionState& exception_state) { if ((x->GetType() != CSSStyleValue::StyleValueType::kLengthType && @@ -32,7 +48,7 @@ "CSSTranslation does not support z CSSNumericValue with percent units"); return nullptr; } - return new CSSTranslation(x, y, z); + return new CSSTranslation(x, y, z, false /* is2D */); } void CSSTranslation::setX(CSSNumericValue* x, ExceptionState& exception_state) { @@ -70,10 +86,10 @@ CSSFunctionValue* CSSTranslation::ToCSSValue() const { CSSFunctionValue* result = CSSFunctionValue::Create( - Is2D() ? CSSValueTranslate : CSSValueTranslate3d); + is2D() ? CSSValueTranslate : CSSValueTranslate3d); result->Append(*x_->ToCSSValue()); result->Append(*y_->ToCSSValue()); - if (!Is2D()) + if (!is2D()) result->Append(*z_->ToCSSValue()); return result; }
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSTranslation.h b/third_party/WebKit/Source/core/css/cssom/CSSTranslation.h index 23513ca..069919b 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSTranslation.h +++ b/third_party/WebKit/Source/core/css/cssom/CSSTranslation.h
@@ -31,9 +31,7 @@ ExceptionState&); static CSSTranslation* Create(CSSNumericValue* x, CSSNumericValue* y, - ExceptionState& exception_state) { - return Create(x, y, nullptr, exception_state); - } + ExceptionState&); // Blink-internal ways of creating CSSTranslations. static CSSTranslation* FromCSSValue(const CSSFunctionValue& value) { @@ -49,9 +47,7 @@ void setZ(CSSNumericValue* z, ExceptionState&); // Internal methods - from CSSTransformComponent. - TransformComponentType GetType() const final { - return Is2D() ? kTranslationType : kTranslation3DType; - } + TransformComponentType GetType() const final { return kTranslationType; } // TODO: Implement AsMatrix for CSSTranslation. DOMMatrix* AsMatrix() const final { return nullptr; } CSSFunctionValue* ToCSSValue() const final; @@ -64,10 +60,11 @@ } private: - CSSTranslation(CSSNumericValue* x, CSSNumericValue* y, CSSNumericValue* z) - : CSSTransformComponent(), x_(x), y_(y), z_(z) {} - - bool Is2D() const { return !z_; } + CSSTranslation(CSSNumericValue* x, + CSSNumericValue* y, + CSSNumericValue* z, + bool is2D) + : CSSTransformComponent(is2D), x_(x), y_(y), z_(z) {} Member<CSSNumericValue> x_; Member<CSSNumericValue> y_;
diff --git a/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp b/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp index f17a5d9..90fa677 100644 --- a/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp +++ b/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp
@@ -205,7 +205,7 @@ return true; } - if (insertion_point_crossing_ && element.IsInsertionPoint()) + if (insertion_point_crossing_ && element.IsV0InsertionPoint()) return true; for (const auto& invalidation_set : invalidation_sets_) { @@ -417,7 +417,7 @@ } } - if (recursion_data.InsertionPointCrossing() && element.IsInsertionPoint()) + if (recursion_data.InsertionPointCrossing() && element.IsV0InsertionPoint()) element.SetNeedsStyleRecalc(kSubtreeStyleChange, StyleChangeReasonForTracing::Create( StyleChangeReason::kStyleInvalidator));
diff --git a/third_party/WebKit/Source/core/css/parser/CSSLazyParsingTest.cpp b/third_party/WebKit/Source/core/css/parser/CSSLazyParsingTest.cpp index 168e032..d5891e19 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSLazyParsingTest.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSLazyParsingTest.cpp
@@ -17,7 +17,7 @@ namespace blink { -class CSSLazyParsingTest : public testing::Test { +class CSSLazyParsingTest : public ::testing::Test { public: bool HasParsedProperties(StyleRule* rule) { return rule->HasParsedProperties();
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp index 0906685a..8e314d1 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -22,7 +22,6 @@ #include "core/css/CSSReflectValue.h" #include "core/css/CSSShadowValue.h" #include "core/css/CSSStringValue.h" -#include "core/css/CSSTimingFunctionValue.h" #include "core/css/CSSURIValue.h" #include "core/css/CSSUnicodeRangeValue.h" #include "core/css/CSSUnsetValue.h" @@ -35,8 +34,7 @@ #include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSVariableParser.h" #include "core/css/properties/CSSPropertyAlignmentUtils.h" -#include "core/css/properties/CSSPropertyAnimationIterationCountUtils.h" -#include "core/css/properties/CSSPropertyAnimationNameUtils.h" +#include "core/css/properties/CSSPropertyAnimationTimingFunctionUtils.h" #include "core/css/properties/CSSPropertyBorderImageUtils.h" #include "core/css/properties/CSSPropertyBoxShadowUtils.h" #include "core/css/properties/CSSPropertyDescriptor.h" @@ -45,7 +43,6 @@ #include "core/css/properties/CSSPropertyMarginUtils.h" #include "core/css/properties/CSSPropertyOffsetRotateUtils.h" #include "core/css/properties/CSSPropertyPositionUtils.h" -#include "core/css/properties/CSSPropertyTransitionPropertyUtils.h" #include "core/css/properties/CSSPropertyWebkitBorderWidthUtils.h" #include "core/frame/UseCounter.h" #include "core/layout/LayoutTheme.h" @@ -311,192 +308,6 @@ return ConsumeString(range); } -static CSSValue* ConsumeSteps(CSSParserTokenRange& range) { - DCHECK_EQ(range.Peek().FunctionId(), CSSValueSteps); - CSSParserTokenRange range_copy = range; - CSSParserTokenRange args = ConsumeFunction(range_copy); - - CSSPrimitiveValue* steps = ConsumePositiveInteger(args); - if (!steps) - return nullptr; - - StepsTimingFunction::StepPosition position = - StepsTimingFunction::StepPosition::END; - if (ConsumeCommaIncludingWhitespace(args)) { - switch (args.ConsumeIncludingWhitespace().Id()) { - case CSSValueMiddle: - if (!RuntimeEnabledFeatures::WebAnimationsAPIEnabled()) - return nullptr; - position = StepsTimingFunction::StepPosition::MIDDLE; - break; - case CSSValueStart: - position = StepsTimingFunction::StepPosition::START; - break; - case CSSValueEnd: - position = StepsTimingFunction::StepPosition::END; - break; - default: - return nullptr; - } - } - - if (!args.AtEnd()) - return nullptr; - - range = range_copy; - return CSSStepsTimingFunctionValue::Create(steps->GetIntValue(), position); -} - -static CSSValue* ConsumeFrames(CSSParserTokenRange& range) { - DCHECK_EQ(range.Peek().FunctionId(), CSSValueFrames); - CSSParserTokenRange range_copy = range; - CSSParserTokenRange args = ConsumeFunction(range_copy); - - CSSPrimitiveValue* frames = ConsumePositiveInteger(args); - if (!frames) - return nullptr; - - int frames_int = frames->GetIntValue(); - if (frames_int <= 1) - return nullptr; - - if (!args.AtEnd()) - return nullptr; - - range = range_copy; - return CSSFramesTimingFunctionValue::Create(frames_int); -} - -static CSSValue* ConsumeCubicBezier(CSSParserTokenRange& range) { - DCHECK_EQ(range.Peek().FunctionId(), CSSValueCubicBezier); - CSSParserTokenRange range_copy = range; - CSSParserTokenRange args = ConsumeFunction(range_copy); - - double x1, y1, x2, y2; - if (ConsumeNumberRaw(args, x1) && x1 >= 0 && x1 <= 1 && - ConsumeCommaIncludingWhitespace(args) && ConsumeNumberRaw(args, y1) && - ConsumeCommaIncludingWhitespace(args) && ConsumeNumberRaw(args, x2) && - x2 >= 0 && x2 <= 1 && ConsumeCommaIncludingWhitespace(args) && - ConsumeNumberRaw(args, y2) && args.AtEnd()) { - range = range_copy; - return CSSCubicBezierTimingFunctionValue::Create(x1, y1, x2, y2); - } - - return nullptr; -} - -static CSSValue* ConsumeAnimationTimingFunction(CSSParserTokenRange& range) { - CSSValueID id = range.Peek().Id(); - if (id == CSSValueEase || id == CSSValueLinear || id == CSSValueEaseIn || - id == CSSValueEaseOut || id == CSSValueEaseInOut || - id == CSSValueStepStart || id == CSSValueStepEnd || - id == CSSValueStepMiddle) - return ConsumeIdent(range); - - CSSValueID function = range.Peek().FunctionId(); - if (function == CSSValueSteps) - return ConsumeSteps(range); - if (RuntimeEnabledFeatures::FramesTimingFunctionEnabled() && - function == CSSValueFrames) { - return ConsumeFrames(range); - } - if (function == CSSValueCubicBezier) - return ConsumeCubicBezier(range); - return nullptr; -} - -static CSSValue* ConsumeAnimationValue(CSSPropertyID property, - CSSParserTokenRange& range, - const CSSParserContext* context, - bool use_legacy_parsing) { - switch (property) { - case CSSPropertyAnimationDelay: - case CSSPropertyTransitionDelay: - return ConsumeTime(range, kValueRangeAll); - case CSSPropertyAnimationDirection: - return ConsumeIdent<CSSValueNormal, CSSValueAlternate, CSSValueReverse, - CSSValueAlternateReverse>(range); - case CSSPropertyAnimationDuration: - case CSSPropertyTransitionDuration: - return ConsumeTime(range, kValueRangeNonNegative); - case CSSPropertyAnimationFillMode: - return ConsumeIdent<CSSValueNone, CSSValueForwards, CSSValueBackwards, - CSSValueBoth>(range); - case CSSPropertyAnimationIterationCount: - return CSSPropertyAnimationIterationCountUtils:: - ConsumeAnimationIterationCount(range); - case CSSPropertyAnimationName: - return CSSPropertyAnimationNameUtils::ConsumeAnimationName( - range, context, use_legacy_parsing); - case CSSPropertyAnimationPlayState: - return ConsumeIdent<CSSValueRunning, CSSValuePaused>(range); - case CSSPropertyTransitionProperty: - return CSSPropertyTransitionPropertyUtils::ConsumeTransitionProperty( - range); - case CSSPropertyAnimationTimingFunction: - case CSSPropertyTransitionTimingFunction: - return ConsumeAnimationTimingFunction(range); - default: - NOTREACHED(); - return nullptr; - } -} - -bool CSSPropertyParser::ConsumeAnimationShorthand( - const StylePropertyShorthand& shorthand, - bool use_legacy_parsing, - bool important) { - const unsigned longhand_count = shorthand.length(); - CSSValueList* longhands[8]; - DCHECK_LE(longhand_count, 8u); - for (size_t i = 0; i < longhand_count; ++i) - longhands[i] = CSSValueList::CreateCommaSeparated(); - - do { - bool parsed_longhand[8] = {false}; - do { - bool found_property = false; - for (size_t i = 0; i < longhand_count; ++i) { - if (parsed_longhand[i]) - continue; - - if (CSSValue* value = - ConsumeAnimationValue(shorthand.properties()[i], range_, - context_, use_legacy_parsing)) { - parsed_longhand[i] = true; - found_property = true; - longhands[i]->Append(*value); - break; - } - } - if (!found_property) - return false; - } while (!range_.AtEnd() && range_.Peek().GetType() != kCommaToken); - - // TODO(timloh): This will make invalid longhands, see crbug.com/386459 - for (size_t i = 0; i < longhand_count; ++i) { - if (!parsed_longhand[i]) - longhands[i]->Append(*CSSInitialValue::Create()); - parsed_longhand[i] = false; - } - } while (ConsumeCommaIncludingWhitespace(range_)); - - for (size_t i = 0; i < longhand_count; ++i) { - // TODO(bugsnash): Refactor out the need to check for - // CSSPropertyTransitionProperty here when this is method implemented in the - // property APIs - if (shorthand.properties()[i] == CSSPropertyTransitionProperty && - !CSSPropertyTransitionPropertyUtils::IsValidPropertyList(*longhands[i])) - return false; - } - - for (size_t i = 0; i < longhand_count; ++i) { - AddParsedProperty(shorthand.properties()[i], shorthand.id(), *longhands[i], - important); - } - return range_.AtEnd(); -} - static CSSFunctionValue* ConsumeFilterFunction( CSSParserTokenRange& range, const CSSParserContext* context) { @@ -1310,7 +1121,9 @@ kValueRangeNonNegative); case CSSPropertyAnimationTimingFunction: case CSSPropertyTransitionTimingFunction: - return ConsumeCommaSeparatedList(ConsumeAnimationTimingFunction, range_); + return ConsumeCommaSeparatedList(CSSPropertyAnimationTimingFunctionUtils:: + ConsumeAnimationTimingFunction, + range_); case CSSPropertyGridColumnGap: case CSSPropertyGridRowGap: return ConsumeLengthOrPercent(range_, context_->Mode(), @@ -2501,13 +2314,6 @@ } switch (property) { - case CSSPropertyAnimation: - return ConsumeAnimationShorthand( - animationShorthandForParsing(), - unresolved_property == CSSPropertyAliasWebkitAnimation, important); - case CSSPropertyTransition: - return ConsumeAnimationShorthand(transitionShorthandForParsing(), false, - important); case CSSPropertyTextDecoration: DCHECK(RuntimeEnabledFeatures::CSS3TextDecorationsEnabled()); return ConsumeShorthandGreedily(textDecorationShorthand(), important);
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h index 57ced9e..4fc7e94 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h
@@ -88,10 +88,6 @@ bool Consume2Values(const StylePropertyShorthand&, bool important); bool Consume4Values(const StylePropertyShorthand&, bool important); - // Legacy parsing allows <string>s for animation-name - bool ConsumeAnimationShorthand(const StylePropertyShorthand&, - bool use_legacy_parsing, - bool important); bool ConsumeBackgroundShorthand(const StylePropertyShorthand&, bool important);
diff --git a/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp index 1896a476..19174f62 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
@@ -874,6 +874,51 @@ "-internal-media-controls-overlay-cast-button") { feature = WebFeature:: kCSSSelectorInternalMediaControlsOverlayCastButton; + } else if (current->Value() == "-webkit-media-controls") { + feature = WebFeature::kCSSSelectorWebkitMediaControls; + } else if (current->Value() == + "-webkit-media-controls-overlay-enclosure") { + feature = + WebFeature::kCSSSelectorWebkitMediaControlsOverlayEnclosure; + } else if (current->Value() == + "-webkit-media-controls-overlay-play-button") { + feature = + WebFeature::kCSSSelectorWebkitMediaControlsOverlayPlayButton; + } else if (current->Value() == "-webkit-media-controls-enclosure") { + feature = WebFeature::kCSSSelectorWebkitMediaControlsEnclosure; + } else if (current->Value() == "-webkit-media-controls-panel") { + feature = WebFeature::kCSSSelectorWebkitMediaControlsPanel; + } else if (current->Value() == + "-webkit-media-controls-play-button") { + feature = WebFeature::kCSSSelectorWebkitMediaControlsPlayButton; + } else if (current->Value() == + "-webkit-media-controls-current-time-display") { + feature = + WebFeature::kCSSSelectorWebkitMediaControlsCurrentTimeDisplay; + } else if (current->Value() == + "-webkit-media-controls-time-remaining-display") { + feature = WebFeature:: + kCSSSelectorWebkitMediaControlsTimeRemainingDisplay; + } else if (current->Value() == "-webkit-media-controls-timeline") { + feature = WebFeature::kCSSSelectorWebkitMediaControlsTimeline; + } else if (current->Value() == + "-webkit-media-controls-timeline-container") { + feature = + WebFeature::kCSSSelectorWebkitMediaControlsTimelineContainer; + } else if (current->Value() == + "-webkit-media-controls-mute-button") { + feature = WebFeature::kCSSSelectorWebkitMediaControlsMuteButton; + } else if (current->Value() == + "-webkit-media-controls-volume-slider") { + feature = WebFeature::kCSSSelectorWebkitMediaControlsVolumeSlider; + } else if (current->Value() == + "-webkit-media-controls-fullscreen-button") { + feature = + WebFeature::kCSSSelectorWebkitMediaControlsFullscreenButton; + } else if (current->Value() == + "-webkit-media-controls-toggle-closed-captions-button") { + feature = WebFeature:: + kCSSSelectorWebkitMediaControlsToggleClosedCaptionsButton; } } break;
diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationTimingFunctionUtils.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationTimingFunctionUtils.cpp new file mode 100644 index 0000000..57961c2 --- /dev/null +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationTimingFunctionUtils.cpp
@@ -0,0 +1,122 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/css/properties/CSSPropertyAnimationTimingFunctionUtils.h" + +#include "core/css/CSSTimingFunctionValue.h" +#include "core/css/parser/CSSPropertyParserHelpers.h" +#include "platform/RuntimeEnabledFeatures.h" + +namespace blink { + +namespace { + +CSSValue* ConsumeSteps(CSSParserTokenRange& range) { + DCHECK_EQ(range.Peek().FunctionId(), CSSValueSteps); + CSSParserTokenRange range_copy = range; + CSSParserTokenRange args = + CSSPropertyParserHelpers::ConsumeFunction(range_copy); + + CSSPrimitiveValue* steps = + CSSPropertyParserHelpers::ConsumePositiveInteger(args); + if (!steps) + return nullptr; + + StepsTimingFunction::StepPosition position = + StepsTimingFunction::StepPosition::END; + if (CSSPropertyParserHelpers::ConsumeCommaIncludingWhitespace(args)) { + switch (args.ConsumeIncludingWhitespace().Id()) { + case CSSValueMiddle: + if (!RuntimeEnabledFeatures::WebAnimationsAPIEnabled()) + return nullptr; + position = StepsTimingFunction::StepPosition::MIDDLE; + break; + case CSSValueStart: + position = StepsTimingFunction::StepPosition::START; + break; + case CSSValueEnd: + position = StepsTimingFunction::StepPosition::END; + break; + default: + return nullptr; + } + } + + if (!args.AtEnd()) + return nullptr; + + range = range_copy; + return CSSStepsTimingFunctionValue::Create(steps->GetIntValue(), position); +} + +CSSValue* ConsumeFrames(CSSParserTokenRange& range) { + DCHECK_EQ(range.Peek().FunctionId(), CSSValueFrames); + CSSParserTokenRange range_copy = range; + CSSParserTokenRange args = + CSSPropertyParserHelpers::ConsumeFunction(range_copy); + + CSSPrimitiveValue* frames = + CSSPropertyParserHelpers::ConsumePositiveInteger(args); + if (!frames) + return nullptr; + + int frames_int = frames->GetIntValue(); + if (frames_int <= 1) + return nullptr; + + if (!args.AtEnd()) + return nullptr; + + range = range_copy; + return CSSFramesTimingFunctionValue::Create(frames_int); +} + +CSSValue* ConsumeCubicBezier(CSSParserTokenRange& range) { + DCHECK_EQ(range.Peek().FunctionId(), CSSValueCubicBezier); + CSSParserTokenRange range_copy = range; + CSSParserTokenRange args = + CSSPropertyParserHelpers::ConsumeFunction(range_copy); + + double x1, y1, x2, y2; + if (CSSPropertyParserHelpers::ConsumeNumberRaw(args, x1) && x1 >= 0 && + x1 <= 1 && + CSSPropertyParserHelpers::ConsumeCommaIncludingWhitespace(args) && + CSSPropertyParserHelpers::ConsumeNumberRaw(args, y1) && + CSSPropertyParserHelpers::ConsumeCommaIncludingWhitespace(args) && + CSSPropertyParserHelpers::ConsumeNumberRaw(args, x2) && x2 >= 0 && + x2 <= 1 && + CSSPropertyParserHelpers::ConsumeCommaIncludingWhitespace(args) && + CSSPropertyParserHelpers::ConsumeNumberRaw(args, y2) && args.AtEnd()) { + range = range_copy; + return CSSCubicBezierTimingFunctionValue::Create(x1, y1, x2, y2); + } + + return nullptr; +} + +} // namespace + +CSSValue* +CSSPropertyAnimationTimingFunctionUtils::ConsumeAnimationTimingFunction( + CSSParserTokenRange& range) { + CSSValueID id = range.Peek().Id(); + if (id == CSSValueEase || id == CSSValueLinear || id == CSSValueEaseIn || + id == CSSValueEaseOut || id == CSSValueEaseInOut || + id == CSSValueStepStart || id == CSSValueStepEnd || + id == CSSValueStepMiddle) + return CSSPropertyParserHelpers::ConsumeIdent(range); + + CSSValueID function = range.Peek().FunctionId(); + if (function == CSSValueSteps) + return ConsumeSteps(range); + if (RuntimeEnabledFeatures::FramesTimingFunctionEnabled() && + function == CSSValueFrames) { + return ConsumeFrames(range); + } + if (function == CSSValueCubicBezier) + return ConsumeCubicBezier(range); + return nullptr; +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationTimingFunctionUtils.h b/third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationTimingFunctionUtils.h new file mode 100644 index 0000000..d067fd98 --- /dev/null +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationTimingFunctionUtils.h
@@ -0,0 +1,24 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CSSPropertyAnimationTimingFunctionUtils_h +#define CSSPropertyAnimationTimingFunctionUtils_h + +#include "platform/wtf/Allocator.h" + +namespace blink { + +class CSSParserTokenRange; +class CSSValue; + +class CSSPropertyAnimationTimingFunctionUtils { + STATIC_ONLY(CSSPropertyAnimationTimingFunctionUtils); + + public: + static CSSValue* ConsumeAnimationTimingFunction(CSSParserTokenRange&); +}; + +} // namespace blink + +#endif // CSSPropertyAnimationTimingFunctionUtils_h
diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationUtils.h b/third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationUtils.h new file mode 100644 index 0000000..f6158cc --- /dev/null +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationUtils.h
@@ -0,0 +1,70 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CSSPropertyAnimationUtils_h +#define CSSPropertyAnimationUtils_h + +#include "core/StylePropertyShorthand.h" +#include "core/css/CSSInitialValue.h" +#include "core/css/parser/CSSPropertyParserHelpers.h" +#include "platform/heap/HeapAllocator.h" +#include "platform/wtf/Allocator.h" + +namespace blink { + +constexpr size_t kMaxNumAnimationLonghands = 8; + +class CSSPropertyAnimationUtils { + STATIC_ONLY(CSSPropertyAnimationUtils); + + public: + template <typename Callback, typename... Args> + static bool ConsumeAnimationShorthand( + const StylePropertyShorthand& shorthand, + HeapVector<CSSValueList*, kMaxNumAnimationLonghands>& longhands, + Callback consumeLonghandItem, + CSSParserTokenRange& range, + const Args&... args) { + const unsigned longhand_count = shorthand.length(); + DCHECK_LE(longhand_count, kMaxNumAnimationLonghands); + + for (size_t i = 0; i < longhand_count; ++i) + longhands[i] = CSSValueList::CreateCommaSeparated(); + + do { + bool parsed_longhand[kMaxNumAnimationLonghands] = {false}; + do { + bool found_property = false; + for (size_t i = 0; i < longhand_count; ++i) { + if (parsed_longhand[i]) + continue; + + CSSValue* value = + consumeLonghandItem(shorthand.properties()[i], range, args...); + if (value) { + parsed_longhand[i] = true; + found_property = true; + longhands[i]->Append(*value); + break; + } + } + if (!found_property) + return false; + } while (!range.AtEnd() && range.Peek().GetType() != kCommaToken); + + // TODO(timloh): This will make invalid longhands, see crbug.com/386459 + for (size_t i = 0; i < longhand_count; ++i) { + if (!parsed_longhand[i]) + longhands[i]->Append(*CSSInitialValue::Create()); + parsed_longhand[i] = false; + } + } while (CSSPropertyParserHelpers::ConsumeCommaIncludingWhitespace(range)); + + return true; + } +}; + +} // namespace blink + +#endif // CSSPropertyAnimationUtils_h
diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyOffsetPathUtils.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyOffsetPathUtils.cpp index 711cf4b1..bd3542b 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyOffsetPathUtils.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyOffsetPathUtils.cpp
@@ -41,7 +41,7 @@ range = function_range; if (byte_stream->IsEmpty()) return CSSIdentifierValue::Create(CSSValueNone); - return CSSPathValue::Create(std::move(byte_stream)); + return cssvalue::CSSPathValue::Create(std::move(byte_stream)); } CSSValue* ConsumeRay(CSSParserTokenRange& range,
diff --git a/third_party/WebKit/Source/core/css/properties/CSSShorthandPropertyAPIAnimation.cpp b/third_party/WebKit/Source/core/css/properties/CSSShorthandPropertyAPIAnimation.cpp new file mode 100644 index 0000000..195fa81 --- /dev/null +++ b/third_party/WebKit/Source/core/css/properties/CSSShorthandPropertyAPIAnimation.cpp
@@ -0,0 +1,85 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/css/properties/CSSShorthandPropertyAPIAnimation.h" + +#include "core/StylePropertyShorthand.h" +#include "core/css/CSSIdentifierValue.h" +#include "core/css/parser/CSSParserContext.h" +#include "core/css/parser/CSSParserLocalContext.h" +#include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/CSSPropertyAnimationIterationCountUtils.h" +#include "core/css/properties/CSSPropertyAnimationNameUtils.h" +#include "core/css/properties/CSSPropertyAnimationTimingFunctionUtils.h" +#include "core/css/properties/CSSPropertyAnimationUtils.h" + +namespace blink { + +namespace { + +// Legacy parsing allows <string>s for animation-name. +CSSValue* ConsumeAnimationValue(CSSPropertyID property, + CSSParserTokenRange& range, + const CSSParserContext& context, + bool use_legacy_parsing) { + switch (property) { + case CSSPropertyAnimationDelay: + return CSSPropertyParserHelpers::ConsumeTime(range, kValueRangeAll); + case CSSPropertyAnimationDirection: + return CSSPropertyParserHelpers::ConsumeIdent< + CSSValueNormal, CSSValueAlternate, CSSValueReverse, + CSSValueAlternateReverse>(range); + case CSSPropertyAnimationDuration: + return CSSPropertyParserHelpers::ConsumeTime(range, + kValueRangeNonNegative); + case CSSPropertyAnimationFillMode: + return CSSPropertyParserHelpers::ConsumeIdent< + CSSValueNone, CSSValueForwards, CSSValueBackwards, CSSValueBoth>( + range); + case CSSPropertyAnimationIterationCount: + return CSSPropertyAnimationIterationCountUtils:: + ConsumeAnimationIterationCount(range); + case CSSPropertyAnimationName: + return CSSPropertyAnimationNameUtils::ConsumeAnimationName( + range, &context, use_legacy_parsing); + case CSSPropertyAnimationPlayState: + return CSSPropertyParserHelpers::ConsumeIdent<CSSValueRunning, + CSSValuePaused>(range); + case CSSPropertyAnimationTimingFunction: + return CSSPropertyAnimationTimingFunctionUtils:: + ConsumeAnimationTimingFunction(range); + default: + NOTREACHED(); + return nullptr; + } +} + +} // namespace + +bool CSSShorthandPropertyAPIAnimation::parseShorthand( + bool important, + CSSParserTokenRange& range, + const CSSParserContext& context, + const CSSParserLocalContext& local_context, + HeapVector<CSSProperty, 256>& properties) { + const StylePropertyShorthand shorthand = animationShorthandForParsing(); + const unsigned longhand_count = shorthand.length(); + + HeapVector<CSSValueList*, kMaxNumAnimationLonghands> longhands( + longhand_count); + if (!CSSPropertyAnimationUtils::ConsumeAnimationShorthand( + shorthand, longhands, ConsumeAnimationValue, range, context, + local_context.UseAliasParsing())) { + return false; + } + + for (size_t i = 0; i < longhand_count; ++i) { + CSSPropertyParserHelpers::AddProperty( + shorthand.properties()[i], shorthand.id(), *longhands[i], important, + CSSPropertyParserHelpers::IsImplicitProperty::kNotImplicit, properties); + } + return range.AtEnd(); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/CSSShorthandPropertyAPITransition.cpp b/third_party/WebKit/Source/core/css/properties/CSSShorthandPropertyAPITransition.cpp new file mode 100644 index 0000000..43db3ed4 --- /dev/null +++ b/third_party/WebKit/Source/core/css/properties/CSSShorthandPropertyAPITransition.cpp
@@ -0,0 +1,73 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/css/properties/CSSShorthandPropertyAPITransition.h" + +#include "core/StylePropertyShorthand.h" +#include "core/css/CSSIdentifierValue.h" +#include "core/css/parser/CSSParserContext.h" +#include "core/css/parser/CSSParserLocalContext.h" +#include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/CSSPropertyAnimationTimingFunctionUtils.h" +#include "core/css/properties/CSSPropertyAnimationUtils.h" +#include "core/css/properties/CSSPropertyTransitionPropertyUtils.h" + +namespace blink { + +namespace { + +CSSValue* ConsumeTransitionValue(CSSPropertyID property, + CSSParserTokenRange& range) { + switch (property) { + case CSSPropertyTransitionDelay: + return CSSPropertyParserHelpers::ConsumeTime(range, kValueRangeAll); + case CSSPropertyTransitionDuration: + return CSSPropertyParserHelpers::ConsumeTime(range, + kValueRangeNonNegative); + case CSSPropertyTransitionProperty: + return CSSPropertyTransitionPropertyUtils::ConsumeTransitionProperty( + range); + case CSSPropertyTransitionTimingFunction: + return CSSPropertyAnimationTimingFunctionUtils:: + ConsumeAnimationTimingFunction(range); + default: + NOTREACHED(); + return nullptr; + } +} + +} // namespace + +bool CSSShorthandPropertyAPITransition::parseShorthand( + bool important, + CSSParserTokenRange& range, + const CSSParserContext& context, + const CSSParserLocalContext&, + HeapVector<CSSProperty, 256>& properties) { + const StylePropertyShorthand shorthand = transitionShorthandForParsing(); + const unsigned longhand_count = shorthand.length(); + + HeapVector<CSSValueList*, kMaxNumAnimationLonghands> longhands( + longhand_count); + if (!CSSPropertyAnimationUtils::ConsumeAnimationShorthand( + shorthand, longhands, ConsumeTransitionValue, range)) { + return false; + } + + for (size_t i = 0; i < longhand_count; ++i) { + if (shorthand.properties()[i] == CSSPropertyTransitionProperty && + !CSSPropertyTransitionPropertyUtils::IsValidPropertyList(*longhands[i])) + return false; + } + + for (size_t i = 0; i < longhand_count; ++i) { + CSSPropertyParserHelpers::AddProperty( + shorthand.properties()[i], shorthand.id(), *longhands[i], important, + CSSPropertyParserHelpers::IsImplicitProperty::kNotImplicit, properties); + } + + return range.AtEnd(); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp index 3d5c702..be9e6e7 100644 --- a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
@@ -8,6 +8,7 @@ #include "core/CSSValueKeywords.h" #include "core/StyleBuilderFunctions.h" #include "core/StylePropertyShorthand.h" +#include "core/css/CSSCustomPropertyDeclaration.h" #include "core/css/CSSPendingSubstitutionValue.h" #include "core/css/CSSUnsetValue.h" #include "core/css/CSSVariableData.h" @@ -100,6 +101,7 @@ Vector<CSSParserToken> tokens; Vector<String> backing_strings; backing_strings.AppendVector(variable_data.BackingStrings()); + DCHECK(!variables_seen_.Contains(name)); variables_seen_.insert(name); bool success = ResolveTokenRange(variable_data.Tokens(), disallow_animation_tainted, @@ -126,6 +128,20 @@ range.ConsumeIncludingWhitespace().Value().ToAtomicString(); DCHECK(range.AtEnd() || (range.Peek().GetType() == kCommaToken)); + PropertyHandle property(variable_name); + if (state_.AnimationPendingCustomProperties().Contains(property) && + !variables_seen_.Contains(variable_name)) { + // We make the StyleResolverState mutable for animated custom properties as + // an optimisation. Without this we would need to compute animated values on + // the stack without saving the result or perform an expensive and complex + // value dependency graph analysis to compute them in the required order. + StyleResolver::ApplyAnimatedCustomProperty( + const_cast<StyleResolverState&>(state_), *this, property); + // Null custom property storage may become non-null after application, we + // must refresh these cached values. + inherited_variables_ = state_.Style()->InheritedVariables(); + non_inherited_variables_ = state_.Style()->NonInheritedVariables(); + } CSSVariableData* variable_data = ValueForCustomProperty(variable_name); if (!variable_data || (disallow_animation_tainted && variable_data->IsAnimationTainted())) { @@ -283,6 +299,21 @@ return CSSUnsetValue::Create(); } +RefPtr<CSSVariableData> +CSSVariableResolver::ResolveCustomPropertyAnimationKeyframe( + const CSSCustomPropertyDeclaration& keyframe) { + DCHECK(keyframe.Value()); + DCHECK(keyframe.Value()->NeedsVariableResolution()); + const AtomicString& name = keyframe.GetName(); + + if (variables_seen_.Contains(name)) { + cycle_start_points_.insert(name); + return nullptr; + } + + return ResolveCustomProperty(name, *keyframe.Value()); +} + void CSSVariableResolver::ResolveVariableDefinitions() { if (!inherited_variables_ && !non_inherited_variables_) return;
diff --git a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h index dbb8a82..cd83e95 100644 --- a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h +++ b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h
@@ -13,6 +13,7 @@ namespace blink { +class CSSCustomPropertyDeclaration; class CSSParserTokenRange; class CSSPendingSubstitutionValue; class CSSVariableData; @@ -28,6 +29,9 @@ public: CSSVariableResolver(const StyleResolverState&); + RefPtr<CSSVariableData> ResolveCustomPropertyAnimationKeyframe( + const CSSCustomPropertyDeclaration& keyframe); + void ResolveVariableDefinitions(); // Shorthand properties are not supported.
diff --git a/third_party/WebKit/Source/core/css/resolver/ElementResolveContext.cpp b/third_party/WebKit/Source/core/css/resolver/ElementResolveContext.cpp index 46c9f4f7..adf8d77 100644 --- a/third_party/WebKit/Source/core/css/resolver/ElementResolveContext.cpp +++ b/third_party/WebKit/Source/core/css/resolver/ElementResolveContext.cpp
@@ -22,10 +22,10 @@ #include "core/css/resolver/ElementResolveContext.h" -#include "core/dom/InsertionPoint.h" #include "core/dom/LayoutTreeBuilderTraversal.h" #include "core/dom/Node.h" #include "core/dom/NodeComputedStyle.h" +#include "core/dom/V0InsertionPoint.h" #include "core/dom/VisitedLinkState.h" namespace blink { @@ -47,7 +47,7 @@ element)), distributed_to_insertion_point_(false) { LayoutTreeBuilderTraversal::ParentDetails parent_details; - if (element.IsActiveSlotOrActiveInsertionPoint()) { + if (element.IsActiveSlotOrActiveV0InsertionPoint()) { parent_node_ = nullptr; layout_parent_ = nullptr; } else {
diff --git a/third_party/WebKit/Source/core/css/resolver/ElementResolveContext.h b/third_party/WebKit/Source/core/css/resolver/ElementResolveContext.h index 59af85c4..26d8a051 100644 --- a/third_party/WebKit/Source/core/css/resolver/ElementResolveContext.h +++ b/third_party/WebKit/Source/core/css/resolver/ElementResolveContext.h
@@ -56,7 +56,7 @@ return LayoutParent() ? LayoutParent()->GetComputedStyle() : nullptr; } EInsideLink ElementLinkState() const { return element_link_state_; } - bool DistributedToInsertionPoint() const { + bool DistributedToV0InsertionPoint() const { return distributed_to_insertion_point_; }
diff --git a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp b/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp index 1c56751..15f00f1b 100644 --- a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp +++ b/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp
@@ -38,12 +38,12 @@ #include "core/dom/Document.h" #include "core/dom/ElementShadow.h" #include "core/dom/ElementTraversal.h" -#include "core/dom/InsertionPoint.h" #include "core/dom/Node.h" #include "core/dom/NodeComputedStyle.h" #include "core/dom/QualifiedName.h" #include "core/dom/SpaceSplitString.h" #include "core/dom/StyleEngine.h" +#include "core/dom/V0InsertionPoint.h" #include "core/html/HTMLElement.h" #include "core/html/HTMLImageElement.h" #include "core/html/HTMLInputElement.h" @@ -221,7 +221,7 @@ bool SharedStyleFinder::SharingCandidateDistributedToSameInsertionPoint( Element& candidate) const { - HeapVector<Member<InsertionPoint>, 8> insertion_points, + HeapVector<Member<V0InsertionPoint>, 8> insertion_points, candidate_insertion_points; CollectDestinationInsertionPoints(GetElement(), insertion_points); CollectDestinationInsertionPoints(candidate, candidate_insertion_points);
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp index 1f1e3d09..5f7cd64 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
@@ -812,7 +812,7 @@ } for (auto& named_grid_line : named_grid_lines) { - Vector<size_t> grid_line_indexes = named_grid_line.value; + Vector<size_t>& grid_line_indexes = named_grid_line.value; std::sort(grid_line_indexes.begin(), grid_line_indexes.end()); } }
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp index 6490ddb..4a25179 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
@@ -689,7 +689,7 @@ // contenteditable attribute (implemented by -webkit-user-modify) should // be propagated from shadow host to distributed node. - if (state.DistributedToInsertionPoint()) { + if (state.DistributedToV0InsertionPoint()) { if (Element* parent = element->parentElement()) { if (ComputedStyle* style_of_shadow_host = parent->MutableComputedStyle()) state.Style()->SetUserModify(style_of_shadow_host->UserModify()); @@ -1130,6 +1130,69 @@ } } +static void ApplyAnimatedCustomProperties(StyleResolverState& state) { + if (!state.IsAnimatingCustomProperties()) { + return; + } + CSSAnimationUpdate& update = state.AnimationUpdate(); + HashSet<PropertyHandle>& pending = state.AnimationPendingCustomProperties(); + DCHECK(pending.IsEmpty()); + for (const auto& interpolations : + {update.ActiveInterpolationsForCustomAnimations(), + update.ActiveInterpolationsForCustomTransitions()}) { + for (const auto& entry : interpolations) { + pending.insert(entry.key); + } + } + while (!pending.IsEmpty()) { + PropertyHandle property = *pending.begin(); + CSSVariableResolver variable_resolver(state); + StyleResolver::ApplyAnimatedCustomProperty(state, variable_resolver, + property); + // The property must no longer be pending after applying it. + DCHECK_EQ(pending.find(property), pending.end()); + } +} + +static const ActiveInterpolations& ActiveInterpolationsForCustomProperty( + const StyleResolverState& state, + const PropertyHandle& property) { + // Interpolations will never be found in both animations_map and + // transitions_map. This condition is ensured by + // CSSAnimations::CalculateTransitionUpdateForProperty(). + const ActiveInterpolationsMap& animations_map = + state.AnimationUpdate().ActiveInterpolationsForCustomAnimations(); + const ActiveInterpolationsMap& transitions_map = + state.AnimationUpdate().ActiveInterpolationsForCustomTransitions(); + const auto& animation = animations_map.find(property); + if (animation != animations_map.end()) { + DCHECK_EQ(transitions_map.find(property), transitions_map.end()); + return animation->value; + } + const auto& transition = transitions_map.find(property); + DCHECK_NE(transition, transitions_map.end()); + return transition->value; +} + +void StyleResolver::ApplyAnimatedCustomProperty( + StyleResolverState& state, + CSSVariableResolver& variable_resolver, + const PropertyHandle& property) { + DCHECK(property.IsCSSCustomProperty()); + DCHECK(state.AnimationPendingCustomProperties().Contains(property)); + const ActiveInterpolations& interpolations = + ActiveInterpolationsForCustomProperty(state, property); + const Interpolation& interpolation = *interpolations.front(); + if (interpolation.IsInvalidatableInterpolation()) { + CSSInterpolationTypesMap map(state.GetDocument().GetPropertyRegistry()); + CSSInterpolationEnvironment environment(map, state, &variable_resolver); + InvalidatableInterpolation::ApplyStack(interpolations, environment); + } else { + ToTransitionInterpolation(interpolation).Apply(state); + } + state.AnimationPendingCustomProperties().erase(property); +} + bool StyleResolver::ApplyAnimatedStandardProperties( StyleResolverState& state, const Element* animating_element) { @@ -1168,24 +1231,18 @@ state.SetApplyPropertyToVisitedLinkStyle(true); } - const ActiveInterpolationsMap& - active_interpolations_map_for_standard_animations = - state.AnimationUpdate().ActiveInterpolationsForStandardAnimations(); - const ActiveInterpolationsMap& - active_interpolations_map_for_standard_transitions = - state.AnimationUpdate().ActiveInterpolationsForStandardTransitions(); - // TODO(crbug.com/644148): Apply animations on custom properties. - ApplyAnimatedProperties<kHighPropertyPriority>( - state, active_interpolations_map_for_standard_animations); - ApplyAnimatedProperties<kHighPropertyPriority>( - state, active_interpolations_map_for_standard_transitions); + const ActiveInterpolationsMap& animations_map = + state.AnimationUpdate().ActiveInterpolationsForStandardAnimations(); + const ActiveInterpolationsMap& transitions_map = + state.AnimationUpdate().ActiveInterpolationsForStandardTransitions(); + ApplyAnimatedStandardProperties<kHighPropertyPriority>(state, animations_map); + ApplyAnimatedStandardProperties<kHighPropertyPriority>(state, + transitions_map); UpdateFont(state); - ApplyAnimatedProperties<kLowPropertyPriority>( - state, active_interpolations_map_for_standard_animations); - ApplyAnimatedProperties<kLowPropertyPriority>( - state, active_interpolations_map_for_standard_transitions); + ApplyAnimatedStandardProperties<kLowPropertyPriority>(state, animations_map); + ApplyAnimatedStandardProperties<kLowPropertyPriority>(state, transitions_map); // Start loading resources used by animations. LoadPendingResources(state); @@ -1218,9 +1275,12 @@ } template <CSSPropertyPriority priority> -void StyleResolver::ApplyAnimatedProperties( +void StyleResolver::ApplyAnimatedStandardProperties( StyleResolverState& state, const ActiveInterpolationsMap& active_interpolations_map) { + static_assert( + priority != kResolveVariables, + "Use applyAnimatedCustomProperty() for custom property animations"); // TODO(alancutter): Don't apply presentation attribute animations here, // they should instead apply in // SVGElement::CollectStyleForPresentationAttribute(). @@ -1228,13 +1288,12 @@ CSSPropertyID property = entry.key.IsCSSProperty() ? entry.key.CssProperty() : entry.key.PresentationAttribute(); - DCHECK_EQ(entry.key.IsCSSCustomProperty(), priority == kResolveVariables); if (!CSSPropertyPriorityData<priority>::PropertyHasPriority(property)) continue; const Interpolation& interpolation = *entry.value.front(); if (interpolation.IsInvalidatableInterpolation()) { CSSInterpolationTypesMap map(state.GetDocument().GetPropertyRegistry()); - CSSInterpolationEnvironment environment(map, state); + CSSInterpolationEnvironment environment(map, state, nullptr); InvalidatableInterpolation::ApplyStack(entry.value, environment); } else if (interpolation.IsTransitionInterpolation()) { ToTransitionInterpolation(interpolation).Apply(state); @@ -1707,7 +1766,7 @@ if (state.ParentStyle()->InheritedDataShared( *cached_matched_properties->parent_computed_style) && !IsAtShadowBoundary(element) && - (!state.DistributedToInsertionPoint() || + (!state.DistributedToV0InsertionPoint() || state.Style()->UserModify() == EUserModify::kReadOnly)) { INCREMENT_STYLE_STATS_COUNTER(GetDocument().GetStyleEngine(), matched_property_cache_inherited_hit, 1); @@ -1750,12 +1809,7 @@ state, match_result.AuthorRules(), true, apply_inherited_only, needs_apply_pass); if (apply_animations == kIncludeAnimations) { - ApplyAnimatedProperties<kResolveVariables>( - state, - state.AnimationUpdate().ActiveInterpolationsForCustomAnimations()); - ApplyAnimatedProperties<kResolveVariables>( - state, - state.AnimationUpdate().ActiveInterpolationsForCustomTransitions()); + ApplyAnimatedCustomProperties(state); } // TODO(leviw): stop recalculating every time CSSVariableResolver(state).ResolveVariableDefinitions(); @@ -1770,12 +1824,7 @@ state, match_result.AuthorRules(), true, apply_inherited_only, needs_apply_pass); if (apply_animations == kIncludeAnimations) { - ApplyAnimatedProperties<kResolveVariables>( - state, - state.AnimationUpdate().ActiveInterpolationsForCustomAnimations()); - ApplyAnimatedProperties<kResolveVariables>( - state, - state.AnimationUpdate().ActiveInterpolationsForCustomTransitions()); + ApplyAnimatedCustomProperties(state); } CSSVariableResolver(state).ResolveVariableDefinitions(); }
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.h b/third_party/WebKit/Source/core/css/resolver/StyleResolver.h index d73d2ac..7a00bd6 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.h +++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.h
@@ -24,6 +24,7 @@ #define StyleResolver_h #include "core/CoreExport.h" +#include "core/animation/Interpolation.h" #include "core/animation/PropertyHandle.h" #include "core/css/ElementRuleCollector.h" #include "core/css/PseudoStyleRequest.h" @@ -52,6 +53,7 @@ class RuleSet; class StylePropertySet; class StyleRuleUsageTracker; +class CSSVariableResolver; enum StyleSharingBehavior { kAllowStyleSharing, @@ -63,8 +65,6 @@ const unsigned kStyleSharingListSize = 15; const unsigned kStyleSharingMaxDepth = 32; using StyleSharingList = HeapDeque<Member<Element>, kStyleSharingListSize>; -using ActiveInterpolationsMap = - HashMap<PropertyHandle, Vector<RefPtr<Interpolation>, 1>>; // This class selects a ComputedStyle for a given element based on a collection // of stylesheets. @@ -157,6 +157,10 @@ void SetRuleUsageTracker(StyleRuleUsageTracker*); void UpdateMediaType(); + static void ApplyAnimatedCustomProperty(StyleResolverState&, + CSSVariableResolver&, + const PropertyHandle&); + DECLARE_TRACE(); private: @@ -278,8 +282,8 @@ NeedsApplyPass&, PropertyWhitelistType = kPropertyWhitelistNone); template <CSSPropertyPriority priority> - void ApplyAnimatedProperties(StyleResolverState&, - const ActiveInterpolationsMap&); + void ApplyAnimatedStandardProperties(StyleResolverState&, + const ActiveInterpolationsMap&); template <CSSPropertyPriority priority> void ApplyAllProperty(StyleResolverState&, const CSSValue&,
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h b/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h index 5f55270..66af27c 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h +++ b/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h
@@ -72,8 +72,8 @@ EInsideLink ElementLinkState() const { return element_context_.ElementLinkState(); } - bool DistributedToInsertionPoint() const { - return element_context_.DistributedToInsertionPoint(); + bool DistributedToV0InsertionPoint() const { + return element_context_.DistributedToV0InsertionPoint(); } const ElementResolveContext& ElementContext() const { @@ -102,6 +102,9 @@ } CSSAnimationUpdate& AnimationUpdate() { return animation_update_; } + const CSSAnimationUpdate& AnimationUpdate() const { + return animation_update_; + } bool IsAnimationInterpolationMapReady() const { return is_animation_interpolation_map_ready_; @@ -117,6 +120,14 @@ is_animating_custom_properties_ = value; } + HashSet<PropertyHandle>& AnimationPendingCustomProperties() { + return animation_pending_custom_properties_; + } + + const HashSet<PropertyHandle>& AnimationPendingCustomProperties() const { + return animation_pending_custom_properties_; + } + void SetParentStyle(RefPtr<const ComputedStyle> parent_style) { parent_style_ = std::move(parent_style); } @@ -237,6 +248,7 @@ CSSAnimationUpdate animation_update_; bool is_animation_interpolation_map_ready_; bool is_animating_custom_properties_; + HashSet<PropertyHandle> animation_pending_custom_properties_; bool apply_property_to_regular_style_; bool apply_property_to_visited_link_style_;
diff --git a/third_party/WebKit/Source/core/css/threaded/MultiThreadedTestUtil.h b/third_party/WebKit/Source/core/css/threaded/MultiThreadedTestUtil.h index 772ee69..7d27ea6 100644 --- a/third_party/WebKit/Source/core/css/threaded/MultiThreadedTestUtil.h +++ b/third_party/WebKit/Source/core/css/threaded/MultiThreadedTestUtil.h
@@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef MultiThreadedTestUtil_h +#define MultiThreadedTestUtil_h + #include "testing/gtest/include/gtest/gtest.h" #include "platform/CrossThreadFunctional.h" @@ -21,7 +24,7 @@ // instead of the normal gtest macros for MultiThreadedTests. // It guarantees that those tests are only run on Thread Sanitizer enabled // builds. -// Also, TSAN_TEST subclasses MultiThreadTest instead of testing::Test. +// Also, TSAN_TEST subclasses MultiThreadTest instead of ::testing::Test. #if defined(THREAD_SANITIZER) #define TSAN_TEST(test_case_name, test_name) \ @@ -42,7 +45,7 @@ #endif -class MultiThreadedTest : public testing::Test { +class MultiThreadedTest : public ::testing::Test { public: // RunOnThreads run a closure num_threads * callbacks_per_thread times. // The default for this is 10*100 = 1000 times. @@ -92,3 +95,5 @@ }; } // namespace blink + +#endif // MultiThreadedTestUtil_h
diff --git a/third_party/WebKit/Source/core/dom/Attribute.h b/third_party/WebKit/Source/core/dom/Attribute.h index beefc78c..717c61a 100644 --- a/third_party/WebKit/Source/core/dom/Attribute.h +++ b/third_party/WebKit/Source/core/dom/Attribute.h
@@ -26,6 +26,7 @@ #ifndef Attribute_h #define Attribute_h +#include "build/build_config.h" #include "core/dom/QualifiedName.h" #include "platform/wtf/Allocator.h" @@ -62,7 +63,7 @@ // elements may have placed the Attribute in a hash by name. void ParserSetName(const QualifiedName& name) { name_ = name; } -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) // NOTE: This constructor is not actually implemented, it's just defined so // MSVC will let us use a zero-length array of Attributes. Attribute();
diff --git a/third_party/WebKit/Source/core/dom/BUILD.gn b/third_party/WebKit/Source/core/dom/BUILD.gn index bfb8b36..d87d1f78 100644 --- a/third_party/WebKit/Source/core/dom/BUILD.gn +++ b/third_party/WebKit/Source/core/dom/BUILD.gn
@@ -110,10 +110,6 @@ "DocumentLifecycle.cpp", "DocumentLifecycle.h", "DocumentOrShadowRoot.h", - "DocumentOrderedList.cpp", - "DocumentOrderedList.h", - "DocumentOrderedMap.cpp", - "DocumentOrderedMap.h", "DocumentParser.cpp", "DocumentParser.h", "DocumentParserClient.h", @@ -182,8 +178,6 @@ "IgnoreDestructiveWriteCountIncrementer.h", "IncrementLoadEventDelayCount.cpp", "IncrementLoadEventDelayCount.h", - "InsertionPoint.cpp", - "InsertionPoint.h", "IntersectionObservation.cpp", "IntersectionObservation.h", "IntersectionObserver.cpp", @@ -355,6 +349,10 @@ "TouchList.h", "TransformSource.h", "TransformSourceLibxslt.cpp", + "TreeOrderedList.cpp", + "TreeOrderedList.h", + "TreeOrderedMap.cpp", + "TreeOrderedMap.h", "TreeScope.cpp", "TreeScope.h", "TreeScopeAdopter.cpp", @@ -370,11 +368,15 @@ "UserActionElementSet.h", "UserGestureIndicator.cpp", "UserGestureIndicator.h", + "V0InsertionPoint.cpp", + "V0InsertionPoint.h", "ViewportDescription.cpp", "ViewportDescription.h", "VisitedLinkState.cpp", "VisitedLinkState.h", "WeakIdentifierMap.h", + "WhitespaceAttacher.cpp", + "WhitespaceAttacher.h", "XMLDocument.cpp", "XMLDocument.h", "custom/CEReactionsScope.cpp",
diff --git a/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp b/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp index 027fd39..945f5e6c 100644 --- a/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp +++ b/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp
@@ -183,7 +183,7 @@ } return ClassicScript::Create(ScriptSourceCode( - GetElement()->TextContent(), document_url, StartingPosition())); + GetElement()->TextFromChildren(), document_url, StartingPosition())); } void ClassicPendingScript::SetStreamer(ScriptStreamer* streamer) {
diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.cpp b/third_party/WebKit/Source/core/dom/ContainerNode.cpp index c0764da..8f532c3a 100644 --- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp +++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
@@ -40,6 +40,7 @@ #include "core/dom/StaticNodeList.h" #include "core/dom/StyleChangeReason.h" #include "core/dom/StyleEngine.h" +#include "core/dom/WhitespaceAttacher.h" #include "core/events/MutationEvent.h" #include "core/frame/LocalFrameView.h" #include "core/html/HTMLCollection.h" @@ -668,7 +669,7 @@ { HTMLFrameOwnerElement::PluginDisposeSuspendScope suspend_plugin_dispose; - DocumentOrderedMap::RemoveScope tree_remove_scope; + TreeOrderedMap::RemoveScope tree_remove_scope; Node* prev = child->previousSibling(); Node* next = child->nextSibling(); @@ -724,7 +725,7 @@ old_child.NotifyMutationObserversNodeWillDetach(); HTMLFrameOwnerElement::PluginDisposeSuspendScope suspend_plugin_dispose; - DocumentOrderedMap::RemoveScope tree_remove_scope; + TreeOrderedMap::RemoveScope tree_remove_scope; Node* prev = old_child.previousSibling(); Node* next = old_child.nextSibling(); @@ -762,7 +763,7 @@ { HTMLFrameOwnerElement::PluginDisposeSuspendScope suspend_plugin_dispose; - DocumentOrderedMap::RemoveScope tree_remove_scope; + TreeOrderedMap::RemoveScope tree_remove_scope; { EventDispatchForbiddenScope assert_no_event_dispatch; ScriptForbiddenScope forbid_script; @@ -1454,16 +1455,15 @@ } } -void ContainerNode::RebuildLayoutTreeForChild(Node* child, - Text*& next_text_sibling) { - bool rebuild_child = - child->NeedsReattachLayoutTree() || child->ChildNeedsReattachLayoutTree(); - +void ContainerNode::RebuildLayoutTreeForChild( + Node* child, + WhitespaceAttacher& whitespace_attacher) { if (child->IsTextNode()) { Text* text_node = ToText(child); - if (rebuild_child) - text_node->RebuildTextLayoutTree(next_text_sibling); - next_text_sibling = text_node; + if (child->NeedsReattachLayoutTree()) + text_node->RebuildTextLayoutTree(whitespace_attacher); + else + whitespace_attacher.DidVisitText(text_node); return; } @@ -1471,20 +1471,24 @@ return; Element* element = ToElement(child); - if (rebuild_child) - element->RebuildLayoutTree(next_text_sibling); - if (element->GetLayoutObject()) - next_text_sibling = nullptr; + if (element->NeedsRebuildLayoutTree(whitespace_attacher)) + element->RebuildLayoutTree(whitespace_attacher); + else + whitespace_attacher.DidVisitElement(element); } -void ContainerNode::RebuildChildrenLayoutTrees(Text*& next_text_sibling) { +void ContainerNode::RebuildChildrenLayoutTrees( + WhitespaceAttacher& whitespace_attacher) { DCHECK(!NeedsReattachLayoutTree()); - if (IsActiveSlotOrActiveInsertionPoint()) { - if (isHTMLSlotElement(this)) - toHTMLSlotElement(this)->RebuildDistributedChildrenLayoutTrees(); - else - ToInsertionPoint(this)->RebuildDistributedChildrenLayoutTrees(); + if (IsActiveSlotOrActiveV0InsertionPoint()) { + if (isHTMLSlotElement(this)) { + toHTMLSlotElement(this)->RebuildDistributedChildrenLayoutTrees( + whitespace_attacher); + } else { + ToV0InsertionPoint(this)->RebuildDistributedChildrenLayoutTrees( + whitespace_attacher); + } } // This loop is deliberately backwards because we use insertBefore in the @@ -1493,7 +1497,7 @@ // and work our way back means in the common case, we'll find the insertion // point in O(1) time. See crbug.com/288225 for (Node* child = lastChild(); child; child = child->previousSibling()) - RebuildLayoutTreeForChild(child, next_text_sibling); + RebuildLayoutTreeForChild(child, whitespace_attacher); // This is done in ContainerNode::AttachLayoutTree but will never be cleared // if we don't enter ContainerNode::AttachLayoutTree so we do it here. @@ -1669,7 +1673,7 @@ if (node->IsShadowRoot()) return true; - if (node->IsInsertionPoint()) + if (node->IsV0InsertionPoint()) return true; if (isHTMLSlotElement(node))
diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.h b/third_party/WebKit/Source/core/dom/ContainerNode.h index 84123c2..7a399af5 100644 --- a/third_party/WebKit/Source/core/dom/ContainerNode.h +++ b/third_party/WebKit/Source/core/dom/ContainerNode.h
@@ -42,6 +42,7 @@ class NameNodeList; using StaticElementList = StaticNodeTypeList<Element>; class RadioNodeList; +class WhitespaceAttacher; enum DynamicRestyleFlags { kChildrenOrSiblingsAffectedByFocus = 1 << 0, @@ -260,8 +261,8 @@ Node* node_before_change, Node* node_after_change); void RecalcDescendantStyles(StyleRecalcChange); - void RebuildChildrenLayoutTrees(Text*& next_text_sibling); - void RebuildLayoutTreeForChild(Node* child, Text*& next_text_sibling); + void RebuildChildrenLayoutTrees(WhitespaceAttacher&); + void RebuildLayoutTreeForChild(Node* child, WhitespaceAttacher&); bool ChildrenSupportStyleSharing() const { return !HasRestyleFlags(); }
diff --git a/third_party/WebKit/Source/core/dom/DOMException.idl b/third_party/WebKit/Source/core/dom/DOMException.idl index a7c3748..5056da9 100644 --- a/third_party/WebKit/Source/core/dom/DOMException.idl +++ b/third_party/WebKit/Source/core/dom/DOMException.idl
@@ -34,7 +34,7 @@ Constructor(optional DOMString message = "", optional DOMString name = "Error"), Exposed=(Window,Worker), DoNotCheckConstants -] exception DOMException { +] interface DOMException { readonly attribute unsigned short code; readonly attribute DOMString name;
diff --git a/third_party/WebKit/Source/core/dom/DOMURL.h b/third_party/WebKit/Source/core/dom/DOMURL.h index ab5d9ae..b114211 100644 --- a/third_party/WebKit/Source/core/dom/DOMURL.h +++ b/third_party/WebKit/Source/core/dom/DOMURL.h
@@ -54,7 +54,7 @@ static DOMURL* Create(const String& url, const String& base, ExceptionState& exception_state) { - return new DOMURL(url, KURL(KURL(), base), exception_state); + return new DOMURL(url, KURL(NullURL(), base), exception_state); } ~DOMURL();
diff --git a/third_party/WebKit/Source/core/dom/DistributedNodes.cpp b/third_party/WebKit/Source/core/dom/DistributedNodes.cpp index d2a4bea..7ffbf465 100644 --- a/third_party/WebKit/Source/core/dom/DistributedNodes.cpp +++ b/third_party/WebKit/Source/core/dom/DistributedNodes.cpp
@@ -26,7 +26,7 @@ #include "core/dom/DistributedNodes.h" -#include "core/dom/InsertionPoint.h" +#include "core/dom/V0InsertionPoint.h" namespace blink { @@ -37,7 +37,7 @@ void DistributedNodes::Append(Node* node) { DCHECK(node); - DCHECK(!node->IsActiveSlotOrActiveInsertionPoint()); + DCHECK(!node->IsActiveSlotOrActiveV0InsertionPoint()); size_t size = nodes_.size(); indices_.Set(node, size); nodes_.push_back(node);
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index 486d531..1237ded0 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -109,6 +109,7 @@ #include "core/dom/TransformSource.h" #include "core/dom/TreeWalker.h" #include "core/dom/VisitedLinkState.h" +#include "core/dom/WhitespaceAttacher.h" #include "core/dom/XMLDocument.h" #include "core/dom/custom/CustomElement.h" #include "core/dom/custom/CustomElementDefinition.h" @@ -513,6 +514,7 @@ // pointer? dom_window_(frame_ ? frame_->DomWindow() : nullptr), imports_controller_(this, initializer.ImportsController()), + parser_(this, nullptr), context_features_(ContextFeatures::DefaultSwitch()), well_formed_(false), implementation_(this, nullptr), @@ -683,6 +685,12 @@ void Document::SetCompatibilityMode(CompatibilityMode mode) { if (compatibility_mode_locked_ || mode == compatibility_mode_) return; + + if (compatibility_mode_ == kQuirksMode) + UseCounter::Count(*this, WebFeature::kQuirksModeDocument); + else if (compatibility_mode_ == kLimitedQuirksMode) + UseCounter::Count(*this, WebFeature::kLimitedQuirksModeDocument); + compatibility_mode_ = mode; GetSelectorQueryCache().Invalidate(); } @@ -2171,7 +2179,8 @@ if (document_element->NeedsReattachLayoutTree() || document_element->ChildNeedsReattachLayoutTree()) { TRACE_EVENT0("blink,blink_style", "Document::rebuildLayoutTree"); - document_element->RebuildLayoutTree(); + WhitespaceAttacher whitespace_attacher; + document_element->RebuildLayoutTree(whitespace_attacher); } } @@ -5040,7 +5049,7 @@ SecurityOrigin* origin = top.GetSecurityContext()->GetSecurityOrigin(); // TODO(yhirano): Ideally |origin| should not be null here. if (origin) - top_document_url = KURL(KURL(), origin->ToString()); + top_document_url = KURL(NullURL(), origin->ToString()); else top_document_url = SecurityOrigin::UrlWithUniqueSecurityOrigin(); } @@ -6907,6 +6916,7 @@ // them only alive for live nodes. Otherwise we would keep lists of dead // nodes alive that have not yet been invalidated. visitor->TraceWrappers(imports_controller_); + visitor->TraceWrappers(parser_); visitor->TraceWrappers(implementation_); visitor->TraceWrappers(style_sheet_list_); visitor->TraceWrappers(style_engine_);
diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h index 31b2524a..89293da 100644 --- a/third_party/WebKit/Source/core/dom/Document.h +++ b/third_party/WebKit/Source/core/dom/Document.h
@@ -1463,7 +1463,7 @@ TraceWrapperMember<HTMLImportsController> imports_controller_; Member<ResourceFetcher> fetcher_; - Member<DocumentParser> parser_; + TraceWrapperMember<DocumentParser> parser_; Member<ContextFeatures> context_features_; bool well_formed_;
diff --git a/third_party/WebKit/Source/core/dom/DocumentOrderedList.cpp b/third_party/WebKit/Source/core/dom/DocumentOrderedList.cpp deleted file mode 100644 index 3d7d1846..0000000 --- a/third_party/WebKit/Source/core/dom/DocumentOrderedList.cpp +++ /dev/null
@@ -1,70 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * (C) 2001 Dirk Mueller (mueller@kde.org) - * (C) 2006 Alexey Proskuryakov (ap@webkit.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All - * rights reserved. - * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. - * (http://www.torchmobile.com/) - * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. - * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "core/dom/DocumentOrderedList.h" - -#include "core/dom/Node.h" - -namespace blink { - -void DocumentOrderedList::Add(Node* node) { - if (nodes_.IsEmpty()) { - nodes_.insert(node); - return; - } - - // Determine an appropriate insertion point. - iterator begin = nodes_.begin(); - iterator end = nodes_.end(); - iterator it = end; - Node* following_node = 0; - do { - --it; - Node* n = *it; - unsigned short position = - n->compareDocumentPosition(node, Node::kTreatShadowTreesAsComposed); - if (position & Node::kDocumentPositionFollowing) { - nodes_.InsertBefore(following_node, node); - return; - } - following_node = n; - } while (it != begin); - - nodes_.InsertBefore(following_node, node); -} - -void DocumentOrderedList::Remove(const Node* node) { - nodes_.erase(const_cast<Node*>(node)); -} - -DEFINE_TRACE(DocumentOrderedList) { - visitor->Trace(nodes_); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/DocumentOrderedList.h b/third_party/WebKit/Source/core/dom/DocumentOrderedList.h deleted file mode 100644 index 540c3d4..0000000 --- a/third_party/WebKit/Source/core/dom/DocumentOrderedList.h +++ /dev/null
@@ -1,74 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * (C) 2001 Dirk Mueller (mueller@kde.org) - * (C) 2006 Alexey Proskuryakov (ap@webkit.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All - * rights reserved. - * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. - * (http://www.torchmobile.com/) - * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef DocumentOrderedList_h -#define DocumentOrderedList_h - -#include "platform/heap/Handle.h" -#include "platform/wtf/ListHashSet.h" - -namespace blink { - -class Node; - -class DocumentOrderedList final { - WTF_MAKE_NONCOPYABLE(DocumentOrderedList); - DISALLOW_NEW(); - - public: - DocumentOrderedList() {} - - void Add(Node*); - void Remove(const Node*); - bool IsEmpty() const { return nodes_.IsEmpty(); } - void Clear() { nodes_.clear(); } - size_t size() const { return nodes_.size(); } - - using iterator = HeapListHashSet<Member<Node>, 32>::iterator; - using const_iterator = HeapListHashSet<Member<Node>, 32>::const_iterator; - using const_reverse_iterator = - HeapListHashSet<Member<Node>, 32>::const_reverse_iterator; - - iterator begin() { return nodes_.begin(); } - iterator end() { return nodes_.end(); } - const_iterator begin() const { return nodes_.begin(); } - const_iterator end() const { return nodes_.end(); } - - const_reverse_iterator rbegin() const { return nodes_.rbegin(); } - const_reverse_iterator rend() const { return nodes_.rend(); } - - DECLARE_TRACE(); - - private: - HeapListHashSet<Member<Node>, 32> nodes_; -}; - -} // namespace blink - -#endif
diff --git a/third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp b/third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp deleted file mode 100644 index b5fd1cf..0000000 --- a/third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp +++ /dev/null
@@ -1,222 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "core/dom/DocumentOrderedMap.h" - -#include "core/HTMLNames.h" -#include "core/dom/Element.h" -#include "core/dom/ElementTraversal.h" -#include "core/dom/TreeScope.h" -#include "core/html/HTMLMapElement.h" -#include "core/html/HTMLSlotElement.h" - -namespace blink { - -using namespace HTMLNames; - -DocumentOrderedMap* DocumentOrderedMap::Create() { - return new DocumentOrderedMap; -} - -DocumentOrderedMap::DocumentOrderedMap() {} - -#if DCHECK_IS_ON() -static int g_remove_scope_level = 0; - -DocumentOrderedMap::RemoveScope::RemoveScope() { - g_remove_scope_level++; -} - -DocumentOrderedMap::RemoveScope::~RemoveScope() { - DCHECK(g_remove_scope_level); - g_remove_scope_level--; -} -#endif - -inline bool KeyMatchesId(const AtomicString& key, const Element& element) { - return element.GetIdAttribute() == key; -} - -inline bool KeyMatchesMapName(const AtomicString& key, const Element& element) { - return isHTMLMapElement(element) && - toHTMLMapElement(element).GetName() == key; -} - -inline bool KeyMatchesSlotName(const AtomicString& key, - const Element& element) { - return isHTMLSlotElement(element) && - toHTMLSlotElement(element).GetName() == key; -} - -void DocumentOrderedMap::Add(const AtomicString& key, Element* element) { - DCHECK(key); - DCHECK(element); - - Map::AddResult add_result = map_.insert(key, new MapEntry(element)); - if (add_result.is_new_entry) - return; - - Member<MapEntry>& entry = add_result.stored_value->value; - DCHECK(entry->count); - entry->element = nullptr; - entry->count++; - entry->ordered_list.clear(); -} - -void DocumentOrderedMap::Remove(const AtomicString& key, Element* element) { - DCHECK(key); - DCHECK(element); - - Map::iterator it = map_.find(key); - if (it == map_.end()) - return; - - Member<MapEntry>& entry = it->value; - DCHECK(entry->count); - if (entry->count == 1) { - DCHECK(!entry->element || entry->element == element); - map_.erase(it); - } else { - if (entry->element == element) { - DCHECK(entry->ordered_list.IsEmpty() || - entry->ordered_list.front() == element); - entry->element = - entry->ordered_list.size() > 1 ? entry->ordered_list[1] : nullptr; - } - entry->count--; - entry->ordered_list.clear(); - } -} - -template <bool keyMatches(const AtomicString&, const Element&)> -inline Element* DocumentOrderedMap::Get(const AtomicString& key, - const TreeScope& scope) const { - DCHECK(key); - - MapEntry* entry = map_.at(key); - if (!entry) - return nullptr; - - DCHECK(entry->count); - if (entry->element) - return entry->element; - - // Iterate to find the node that matches. Nothing will match iff an element - // with children having duplicate IDs is being removed -- the tree traversal - // will be over an updated tree not having that subtree. In all other cases, - // a match is expected. - for (Element& element : ElementTraversal::StartsAfter(scope.RootNode())) { - if (!keyMatches(key, element)) - continue; - entry->element = &element; - return &element; - } -// As get()/getElementById() can legitimately be called while handling element -// removals, allow failure iff we're in the scope of node removals. -#if DCHECK_IS_ON() - DCHECK(g_remove_scope_level); -#endif - return nullptr; -} - -Element* DocumentOrderedMap::GetElementById(const AtomicString& key, - const TreeScope& scope) const { - return Get<KeyMatchesId>(key, scope); -} - -const HeapVector<Member<Element>>& DocumentOrderedMap::GetAllElementsById( - const AtomicString& key, - const TreeScope& scope) const { - DCHECK(key); - DEFINE_STATIC_LOCAL(HeapVector<Member<Element>>, empty_vector, - (new HeapVector<Member<Element>>)); - - Map::iterator it = map_.find(key); - if (it == map_.end()) - return empty_vector; - - Member<MapEntry>& entry = it->value; - DCHECK(entry->count); - - if (entry->ordered_list.IsEmpty()) { - entry->ordered_list.ReserveCapacity(entry->count); - for (Element* element = - entry->element ? entry->element.Get() - : ElementTraversal::FirstWithin(scope.RootNode()); - entry->ordered_list.size() < entry->count; - element = ElementTraversal::Next(*element)) { - DCHECK(element); - if (!KeyMatchesId(key, *element)) - continue; - entry->ordered_list.UncheckedAppend(element); - } - if (!entry->element) - entry->element = entry->ordered_list.front(); - } - - return entry->ordered_list; -} - -Element* DocumentOrderedMap::GetElementByMapName(const AtomicString& key, - const TreeScope& scope) const { - return Get<KeyMatchesMapName>(key, scope); -} - -// TODO(hayato): Template get<> by return type. -HTMLSlotElement* DocumentOrderedMap::GetSlotByName( - const AtomicString& key, - const TreeScope& scope) const { - if (Element* slot = Get<KeyMatchesSlotName>(key, scope)) { - DCHECK(isHTMLSlotElement(slot)); - return toHTMLSlotElement(slot); - } - return nullptr; -} - -Element* DocumentOrderedMap::GetCachedFirstElementWithoutAccessingNodeTree( - const AtomicString& key) { - MapEntry* entry = map_.at(key); - if (!entry) - return nullptr; - DCHECK(entry->count); - return entry->element; -} - -DEFINE_TRACE(DocumentOrderedMap) { - visitor->Trace(map_); -} - -DEFINE_TRACE(DocumentOrderedMap::MapEntry) { - visitor->Trace(element); - visitor->Trace(ordered_list); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/DocumentOrderedMap.h b/third_party/WebKit/Source/core/dom/DocumentOrderedMap.h deleted file mode 100644 index 568bd38..0000000 --- a/third_party/WebKit/Source/core/dom/DocumentOrderedMap.h +++ /dev/null
@@ -1,127 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef DocumentOrderedMap_h -#define DocumentOrderedMap_h - -#include "platform/heap/Handle.h" -#include "platform/wtf/Allocator.h" -#include "platform/wtf/Forward.h" -#include "platform/wtf/HashMap.h" -#include "platform/wtf/text/AtomicString.h" -#include "platform/wtf/text/AtomicStringHash.h" -#include "platform/wtf/text/StringImpl.h" - -namespace blink { - -class Element; -class HTMLSlotElement; -class TreeScope; - -class DocumentOrderedMap : public GarbageCollected<DocumentOrderedMap> { - public: - static DocumentOrderedMap* Create(); - - void Add(const AtomicString&, Element*); - void Remove(const AtomicString&, Element*); - - bool Contains(const AtomicString&) const; - bool ContainsMultiple(const AtomicString&) const; - // concrete instantiations of the get<>() method template - Element* GetElementById(const AtomicString&, const TreeScope&) const; - const HeapVector<Member<Element>>& GetAllElementsById(const AtomicString&, - const TreeScope&) const; - Element* GetElementByMapName(const AtomicString&, const TreeScope&) const; - HTMLSlotElement* GetSlotByName(const AtomicString&, const TreeScope&) const; - // Don't use this unless the caller can know the internal state of - // DocumentOrderedMap exactly. - Element* GetCachedFirstElementWithoutAccessingNodeTree(const AtomicString&); - - DECLARE_TRACE(); - -#if DCHECK_IS_ON() - // While removing a ContainerNode, ID lookups won't be precise should the tree - // have elements with duplicate IDs contained in the element being removed. - // Rare trees, but ID lookups may legitimately fail across such removals; - // this scope object informs DocumentOrderedMaps about the transitory - // state of the underlying tree. - class RemoveScope { - STACK_ALLOCATED(); - - public: - RemoveScope(); - ~RemoveScope(); - }; -#else - class RemoveScope { - STACK_ALLOCATED(); - - public: - RemoveScope() {} - ~RemoveScope() {} - }; -#endif - - private: - DocumentOrderedMap(); - - template <bool keyMatches(const AtomicString&, const Element&)> - Element* Get(const AtomicString&, const TreeScope&) const; - - class MapEntry : public GarbageCollected<MapEntry> { - public: - explicit MapEntry(Element* first_element) - : element(first_element), count(1) {} - - DECLARE_TRACE(); - - Member<Element> element; - unsigned count; - HeapVector<Member<Element>> ordered_list; - }; - - using Map = HeapHashMap<AtomicString, Member<MapEntry>>; - - mutable Map map_; -}; - -inline bool DocumentOrderedMap::Contains(const AtomicString& id) const { - return map_.Contains(id); -} - -inline bool DocumentOrderedMap::ContainsMultiple(const AtomicString& id) const { - Map::const_iterator it = map_.find(id); - return it != map_.end() && it->value->count > 1; -} - -} // namespace blink - -#endif // DocumentOrderedMap_h
diff --git a/third_party/WebKit/Source/core/dom/DocumentParser.h b/third_party/WebKit/Source/core/dom/DocumentParser.h index 6f2b4929..fb94e1a 100644 --- a/third_party/WebKit/Source/core/dom/DocumentParser.h +++ b/third_party/WebKit/Source/core/dom/DocumentParser.h
@@ -26,6 +26,7 @@ #include <memory> #include "core/CoreExport.h" +#include "platform/bindings/ScriptWrappable.h" #include "platform/heap/Handle.h" #include "platform/wtf/Forward.h" @@ -38,7 +39,8 @@ class TextResourceDecoder; class CORE_EXPORT DocumentParser - : public GarbageCollectedFinalized<DocumentParser> { + : public GarbageCollectedFinalized<DocumentParser>, + public TraceWrapperBase { public: virtual ~DocumentParser(); DECLARE_VIRTUAL_TRACE();
diff --git a/third_party/WebKit/Source/core/dom/DocumentTest.cpp b/third_party/WebKit/Source/core/dom/DocumentTest.cpp index e36b1953..aee33d2 100644 --- a/third_party/WebKit/Source/core/dom/DocumentTest.cpp +++ b/third_party/WebKit/Source/core/dom/DocumentTest.cpp
@@ -520,14 +520,16 @@ } TEST_F(DocumentTest, OutgoingReferrer) { - GetDocument().SetURL(KURL(KURL(), "https://www.example.com/hoge#fuga?piyo")); + GetDocument().SetURL( + KURL(NullURL(), "https://www.example.com/hoge#fuga?piyo")); GetDocument().SetSecurityOrigin( - SecurityOrigin::Create(KURL(KURL(), "https://www.example.com/"))); + SecurityOrigin::Create(KURL(NullURL(), "https://www.example.com/"))); EXPECT_EQ("https://www.example.com/hoge", GetDocument().OutgoingReferrer()); } TEST_F(DocumentTest, OutgoingReferrerWithUniqueOrigin) { - GetDocument().SetURL(KURL(KURL(), "https://www.example.com/hoge#fuga?piyo")); + GetDocument().SetURL( + KURL(NullURL(), "https://www.example.com/hoge#fuga?piyo")); GetDocument().SetSecurityOrigin(SecurityOrigin::CreateUnique()); EXPECT_EQ(String(), GetDocument().OutgoingReferrer()); } @@ -834,13 +836,13 @@ GetDocument().SetSecurityOrigin(origin); SandboxFlags mask = kSandboxOrigin; GetDocument().EnforceSandboxFlags(mask); - GetDocument().SetURL(KURL(KURL(), "https://test.com/foobar/document")); + GetDocument().SetURL(KURL(NullURL(), "https://test.com/foobar/document")); ApplicationCacheHost* appcache_host = GetDocument().Loader()->GetApplicationCacheHost(); appcache_host->host_ = WTF::MakeUnique<MockWebApplicationCacheHost>(); appcache_host->SelectCacheWithManifest( - KURL(KURL(), "https://test.com/foobar/manifest")); + KURL(NullURL(), "https://test.com/foobar/manifest")); MockWebApplicationCacheHost* mock_web_host = static_cast<MockWebApplicationCacheHost*>(appcache_host->host_.get()); EXPECT_FALSE(mock_web_host->with_manifest_was_called_); @@ -855,13 +857,13 @@ suborigin.SetName("foobar"); origin->AddSuborigin(suborigin); GetDocument().SetSecurityOrigin(origin); - GetDocument().SetURL(KURL(KURL(), "https://test.com/foobar/document")); + GetDocument().SetURL(KURL(NullURL(), "https://test.com/foobar/document")); ApplicationCacheHost* appcache_host = GetDocument().Loader()->GetApplicationCacheHost(); appcache_host->host_ = WTF::MakeUnique<MockWebApplicationCacheHost>(); appcache_host->SelectCacheWithManifest( - KURL(KURL(), "https://test.com/foobar/manifest")); + KURL(NullURL(), "https://test.com/foobar/manifest")); MockWebApplicationCacheHost* mock_web_host = static_cast<MockWebApplicationCacheHost*>(appcache_host->host_.get()); EXPECT_FALSE(mock_web_host->with_manifest_was_called_);
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp index c10655f..309febbf 100644 --- a/third_party/WebKit/Source/core/dom/Element.cpp +++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -64,7 +64,6 @@ #include "core/dom/ExceptionCode.h" #include "core/dom/FirstLetterPseudoElement.h" #include "core/dom/Fullscreen.h" -#include "core/dom/InsertionPoint.h" #include "core/dom/LayoutTreeBuilder.h" #include "core/dom/MutationObserverInterestGroup.h" #include "core/dom/MutationRecord.h" @@ -81,6 +80,8 @@ #include "core/dom/StyleChangeReason.h" #include "core/dom/StyleEngine.h" #include "core/dom/Text.h" +#include "core/dom/V0InsertionPoint.h" +#include "core/dom/WhitespaceAttacher.h" #include "core/dom/custom/CustomElement.h" #include "core/dom/custom/CustomElementRegistry.h" #include "core/dom/custom/V0CustomElement.h" @@ -1794,7 +1795,7 @@ data->ClearComputedStyle(); } - if (!IsActiveSlotOrActiveInsertionPoint()) { + if (!IsActiveSlotOrActiveV0InsertionPoint()) { LayoutTreeBuilderForElement builder(*this, context.resolved_style); builder.CreateLayoutObjectIfNeeded(); @@ -2116,29 +2117,42 @@ return local_change; } -void Element::RebuildLayoutTree(Text* next_text_sibling) { +void Element::RebuildLayoutTree(WhitespaceAttacher& whitespace_attacher) { DCHECK(InActiveDocument()); DCHECK(parentNode()); if (NeedsReattachLayoutTree()) { AttachContext reattach_context; reattach_context.resolved_style = GetNonAttachedStyle(); - bool layout_object_will_change = NeedsAttach() || GetLayoutObject(); ReattachLayoutTree(reattach_context); - if (layout_object_will_change || GetLayoutObject()) - ReattachWhitespaceSiblingsIfNeeded(next_text_sibling); SetNonAttachedStyle(nullptr); - } else if (ChildNeedsReattachLayoutTree()) { - DCHECK(!NeedsReattachLayoutTree()); + whitespace_attacher.DidReattachElement(this, + reattach_context.previous_in_flow); + } else { SelectorFilterParentScope filter_scope(*this); StyleSharingDepthScope sharing_scope(*this); - Text* next_text_sibling = nullptr; - RebuildPseudoElementLayoutTree(kPseudoIdAfter); - RebuildShadowRootLayoutTree(next_text_sibling); - RebuildChildrenLayoutTrees(next_text_sibling); - RebuildPseudoElementLayoutTree(kPseudoIdBefore, next_text_sibling); - RebuildPseudoElementLayoutTree(kPseudoIdBackdrop); - RebuildPseudoElementLayoutTree(kPseudoIdFirstLetter); + // We create a local WhitespaceAttacher when rebuilding children of an + // element with a LayoutObject since whitespace nodes do not rely on layout + // objects further up the tree. Also, if this Element's layout object is an + // out-of-flow box, in-flow children should not affect whitespace siblings + // of the out-of-flow box. However, if this element is a display:contents + // element. Continue using the passed in attacher as display:contents + // children may affect whitespace nodes further up the tree as they may be + // layout tree siblings. + WhitespaceAttacher local_attacher; + WhitespaceAttacher* child_attacher; + if (GetLayoutObject()) { + whitespace_attacher.DidVisitElement(this); + child_attacher = &local_attacher; + } else { + child_attacher = &whitespace_attacher; + } + RebuildPseudoElementLayoutTree(kPseudoIdAfter, *child_attacher); + RebuildShadowRootLayoutTree(*child_attacher); + RebuildChildrenLayoutTrees(*child_attacher); + RebuildPseudoElementLayoutTree(kPseudoIdBefore, *child_attacher); + RebuildPseudoElementLayoutTree(kPseudoIdBackdrop, *child_attacher); + RebuildPseudoElementLayoutTree(kPseudoIdFirstLetter, *child_attacher); } DCHECK(!NeedsStyleRecalc()); DCHECK(!ChildNeedsStyleRecalc()); @@ -2146,25 +2160,22 @@ DCHECK(!ChildNeedsReattachLayoutTree()); } -void Element::RebuildShadowRootLayoutTree(Text*& next_text_sibling) { +void Element::RebuildShadowRootLayoutTree( + WhitespaceAttacher& whitespace_attacher) { for (ShadowRoot* root = YoungestShadowRoot(); root; root = root->OlderShadowRoot()) { - // TODO(rune@opera.com): nextTextSibling is not set correctly when we have - // slotted nodes (crbug.com/648931). Also, it may be incorrect when we have - // multiple shadow roots (for V0 shadow hosts). - root->RebuildLayoutTree(next_text_sibling); + root->RebuildLayoutTree(whitespace_attacher); } } -void Element::RebuildPseudoElementLayoutTree(PseudoId pseudo_id, - Text* next_text_sibling) { +void Element::RebuildPseudoElementLayoutTree( + PseudoId pseudo_id, + WhitespaceAttacher& whitespace_attacher) { if (PseudoElement* element = GetPseudoElement(pseudo_id)) { if (pseudo_id == kPseudoIdFirstLetter && UpdateFirstLetter(element)) return; - if (element->NeedsReattachLayoutTree() || - element->ChildNeedsReattachLayoutTree()) { - element->RebuildLayoutTree(next_text_sibling); - } + if (element->NeedsRebuildLayoutTree(whitespace_attacher)) + element->RebuildLayoutTree(whitespace_attacher); } else { CreatePseudoElementIfNeeded(pseudo_id); }
diff --git a/third_party/WebKit/Source/core/dom/Element.h b/third_party/WebKit/Source/core/dom/Element.h index 68baf15..ba33318 100644 --- a/third_party/WebKit/Source/core/dom/Element.h +++ b/third_party/WebKit/Source/core/dom/Element.h
@@ -35,6 +35,7 @@ #include "core/dom/Document.h" #include "core/dom/ElementData.h" #include "core/dom/SpaceSplitString.h" +#include "core/dom/WhitespaceAttacher.h" #include "platform/heap/Handle.h" #include "platform/scroll/ScrollTypes.h" #include "public/platform/WebFocusType.h" @@ -438,7 +439,14 @@ virtual LayoutObject* CreateLayoutObject(const ComputedStyle&); virtual bool LayoutObjectIsNeeded(const ComputedStyle&); void RecalcStyle(StyleRecalcChange); - void RebuildLayoutTree(Text* next_text_sibling = nullptr); + bool NeedsRebuildLayoutTree( + const WhitespaceAttacher& whitespace_attacher) const { + return NeedsReattachLayoutTree() || ChildNeedsReattachLayoutTree() || + IsActiveSlotOrActiveV0InsertionPoint() || + (whitespace_attacher.LastTextNodeNeedsReattach() && + HasDisplayContentsStyle()); + } + void RebuildLayoutTree(WhitespaceAttacher&); void PseudoStateChanged(CSSSelector::PseudoType); void SetAnimationStyleChange(bool); void ClearAnimationStyleChange(); @@ -881,9 +889,8 @@ PassRefPtr<ComputedStyle> PropagateInheritedProperties(StyleRecalcChange); StyleRecalcChange RecalcOwnStyle(StyleRecalcChange); - void RebuildPseudoElementLayoutTree(PseudoId, - Text* next_text_sibling = nullptr); - void RebuildShadowRootLayoutTree(Text*& next_text_sibling); + void RebuildPseudoElementLayoutTree(PseudoId, WhitespaceAttacher&); + void RebuildShadowRootLayoutTree(WhitespaceAttacher&); inline void CheckForEmptyStyleChange(); void UpdatePseudoElement(PseudoId, StyleRecalcChange);
diff --git a/third_party/WebKit/Source/core/dom/ElementData.h b/third_party/WebKit/Source/core/dom/ElementData.h index 6c8f10c0..ff3cc983 100644 --- a/third_party/WebKit/Source/core/dom/ElementData.h +++ b/third_party/WebKit/Source/core/dom/ElementData.h
@@ -32,6 +32,7 @@ #ifndef ElementData_h #define ElementData_h +#include "build/build_config.h" #include "core/dom/Attribute.h" #include "core/dom/AttributeCollection.h" #include "core/dom/SpaceSplitString.h" @@ -112,10 +113,10 @@ DEFINE_TYPE_CASTS(thisType, ElementData, data, pointerPredicate, \ referencePredicate) -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) #pragma warning(push) -#pragma warning( \ - disable : 4200) // Disable "zero-sized array in struct/union" warning +// Disable "zero-sized array in struct/union" warning +#pragma warning(disable : 4200) #endif // SharableElementData is managed by ElementDataCache and is produced by @@ -150,7 +151,7 @@ !data->IsUnique(), !data.IsUnique()); -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) #pragma warning(pop) #endif
diff --git a/third_party/WebKit/Source/core/dom/ElementShadowV0.cpp b/third_party/WebKit/Source/core/dom/ElementShadowV0.cpp index 03768fc..184c2ee0 100644 --- a/third_party/WebKit/Source/core/dom/ElementShadowV0.cpp +++ b/third_party/WebKit/Source/core/dom/ElementShadowV0.cpp
@@ -42,7 +42,7 @@ explicit DistributionPool(const ContainerNode&); void Clear(); ~DistributionPool(); - void DistributeTo(InsertionPoint*, ElementShadowV0*); + void DistributeTo(V0InsertionPoint*, ElementShadowV0*); void PopulateChildren(const ContainerNode&); private: @@ -68,8 +68,8 @@ // TODO(hayato): Support re-distribution across v0 and v1 shadow trees continue; } - if (IsActiveInsertionPoint(*child)) { - InsertionPoint* insertion_point = ToInsertionPoint(child); + if (IsActiveV0InsertionPoint(*child)) { + V0InsertionPoint* insertion_point = ToV0InsertionPoint(child); for (size_t i = 0; i < insertion_point->DistributedNodesSize(); ++i) nodes_.push_back(insertion_point->DistributedNodeAt(i)); } else { @@ -80,7 +80,7 @@ distributed_.Fill(false); } -void DistributionPool::DistributeTo(InsertionPoint* insertion_point, +void DistributionPool::DistributeTo(V0InsertionPoint* insertion_point, ElementShadowV0* element_shadow) { DistributedNodes distributed_nodes; @@ -140,7 +140,7 @@ return element_shadow_->OldestShadowRoot(); } -const InsertionPoint* ElementShadowV0::FinalDestinationInsertionPointFor( +const V0InsertionPoint* ElementShadowV0::FinalDestinationInsertionPointFor( const Node* key) const { DCHECK(key); DCHECK(!key->NeedsDistributionRecalc()); @@ -203,7 +203,7 @@ } void ElementShadowV0::DidDistributeNode(const Node* node, - InsertionPoint* insertion_point) { + V0InsertionPoint* insertion_point) { NodeToDestinationInsertionPoints::AddResult result = node_to_insertion_points_.insert(node, nullptr); if (result.is_new_entry)
diff --git a/third_party/WebKit/Source/core/dom/ElementShadowV0.h b/third_party/WebKit/Source/core/dom/ElementShadowV0.h index 1fbc003d..4001f87c52 100644 --- a/third_party/WebKit/Source/core/dom/ElementShadowV0.h +++ b/third_party/WebKit/Source/core/dom/ElementShadowV0.h
@@ -28,8 +28,8 @@ #define ElementShadowV0_h #include "core/CoreExport.h" -#include "core/dom/InsertionPoint.h" #include "core/dom/SelectRuleFeatureSet.h" +#include "core/dom/V0InsertionPoint.h" #include "platform/bindings/ScriptWrappable.h" #include "platform/heap/Handle.h" #include "platform/wtf/Noncopyable.h" @@ -48,12 +48,12 @@ void WillAffectSelector(); const SelectRuleFeatureSet& EnsureSelectFeatureSet(); - const InsertionPoint* FinalDestinationInsertionPointFor(const Node*) const; + const V0InsertionPoint* FinalDestinationInsertionPointFor(const Node*) const; const DestinationInsertionPoints* DestinationInsertionPointsFor( const Node*) const; void Distribute(); - void DidDistributeNode(const Node*, InsertionPoint*); + void DidDistributeNode(const Node*, V0InsertionPoint*); void ClearDistribution(); DECLARE_TRACE(); @@ -65,7 +65,7 @@ ShadowRoot& YoungestShadowRoot() const; ShadowRoot& OldestShadowRoot() const; - void DistributeNodeChildrenTo(InsertionPoint*, ContainerNode*); + void DistributeNodeChildrenTo(V0InsertionPoint*, ContainerNode*); void CollectSelectFeatureSetFrom(const ShadowRoot&); bool NeedsSelectFeatureSet() const { return needs_select_feature_set_; }
diff --git a/third_party/WebKit/Source/core/dom/FlatTreeTraversal.cpp b/third_party/WebKit/Source/core/dom/FlatTreeTraversal.cpp index 6955503..1babc5a 100644 --- a/third_party/WebKit/Source/core/dom/FlatTreeTraversal.cpp +++ b/third_party/WebKit/Source/core/dom/FlatTreeTraversal.cpp
@@ -37,7 +37,7 @@ return node.IsElementNode() ? ToElement(node).Shadow() : nullptr; } -static inline bool CanBeDistributedToInsertionPoint(const Node& node) { +static inline bool CanBeDistributedToV0InsertionPoint(const Node& node) { return node.IsInV0ShadowTree() || node.IsChildOfV0ShadowHost(); } @@ -92,9 +92,9 @@ sibling = (direction == kTraversalDirectionForward ? sibling->nextSibling() : sibling->previousSibling())) { - if (!IsActiveInsertionPoint(*sibling)) + if (!IsActiveV0InsertionPoint(*sibling)) return const_cast<Node*>(sibling); - const InsertionPoint& insertion_point = ToInsertionPoint(*sibling); + const V0InsertionPoint& insertion_point = ToV0InsertionPoint(*sibling); if (Node* found = (direction == kTraversalDirectionForward ? insertion_point.FirstDistributedNode() : insertion_point.LastDistributedNode())) @@ -165,7 +165,7 @@ Node* FlatTreeTraversal::TraverseSiblingsForV0Distribution( const Node& node, TraversalDirection direction) { - const InsertionPoint* final_destination = ResolveReprojection(&node); + const V0InsertionPoint* final_destination = ResolveReprojection(&node); if (!final_destination) return nullptr; if (Node* found = (direction == kTraversalDirectionForward @@ -200,7 +200,7 @@ } } - if (CanBeDistributedToInsertionPoint(node)) + if (CanBeDistributedToV0InsertionPoint(node)) return TraverseParentForV0(node, details); DCHECK(!ShadowWhereNodeCanBeDistributedForV0(node)); @@ -211,7 +211,7 @@ const Node& node, ParentTraversalDetails* details) { if (ShadowWhereNodeCanBeDistributedForV0(node)) { - if (const InsertionPoint* insertion_point = ResolveReprojection(&node)) { + if (const V0InsertionPoint* insertion_point = ResolveReprojection(&node)) { if (details) details->DidTraverseInsertionPoint(insertion_point); // The node is distributed. But the distribution was stopped at this @@ -223,7 +223,7 @@ return nullptr; } ContainerNode* parent = TraverseParentOrHost(node); - if (IsActiveInsertionPoint(*parent)) + if (IsActiveV0InsertionPoint(*parent)) return nullptr; return parent; }
diff --git a/third_party/WebKit/Source/core/dom/FlatTreeTraversal.h b/third_party/WebKit/Source/core/dom/FlatTreeTraversal.h index 1d6f4f9..2e9e958d 100644 --- a/third_party/WebKit/Source/core/dom/FlatTreeTraversal.h +++ b/third_party/WebKit/Source/core/dom/FlatTreeTraversal.h
@@ -29,9 +29,9 @@ #include "core/CoreExport.h" #include "core/dom/Document.h" -#include "core/dom/InsertionPoint.h" #include "core/dom/LayoutTreeBuilderTraversal.h" #include "core/dom/ShadowRoot.h" +#include "core/dom/V0InsertionPoint.h" #include "platform/wtf/Allocator.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/dom/IdleDeadlineTest.cpp b/third_party/WebKit/Source/core/dom/IdleDeadlineTest.cpp index 5e0a902..59d723e 100644 --- a/third_party/WebKit/Source/core/dom/IdleDeadlineTest.cpp +++ b/third_party/WebKit/Source/core/dom/IdleDeadlineTest.cpp
@@ -68,7 +68,7 @@ } // namespace -class IdleDeadlineTest : public testing::Test { +class IdleDeadlineTest : public ::testing::Test { public: void SetUp() override { original_time_function_ = SetTimeFunctionsForTesting([] { return 1.0; });
diff --git a/third_party/WebKit/Source/core/dom/InsertionPoint.cpp b/third_party/WebKit/Source/core/dom/InsertionPoint.cpp deleted file mode 100644 index e32c5f8..0000000 --- a/third_party/WebKit/Source/core/dom/InsertionPoint.cpp +++ /dev/null
@@ -1,318 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "core/dom/InsertionPoint.h" - -#include "core/HTMLNames.h" -#include "core/dom/ElementShadow.h" -#include "core/dom/ElementShadowV0.h" -#include "core/dom/ElementTraversal.h" -#include "core/dom/QualifiedName.h" -#include "core/dom/StaticNodeList.h" -#include "core/dom/StyleChangeReason.h" - -namespace blink { - -using namespace HTMLNames; - -InsertionPoint::InsertionPoint(const QualifiedName& tag_name, - Document& document) - : HTMLElement(tag_name, document, kCreateInsertionPoint), - registered_with_shadow_root_(false) { - SetHasCustomStyleCallbacks(); -} - -InsertionPoint::~InsertionPoint() {} - -void InsertionPoint::SetDistributedNodes(DistributedNodes& distributed_nodes) { - // Attempt not to reattach nodes that would be distributed to the exact same - // location by comparing the old and new distributions. - - size_t i = 0; - size_t j = 0; - - for (; i < distributed_nodes_.size() && j < distributed_nodes.size(); - ++i, ++j) { - if (distributed_nodes_.size() < distributed_nodes.size()) { - // If the new distribution is larger than the old one, reattach all nodes - // in the new distribution that were inserted. - for (; j < distributed_nodes.size() && - distributed_nodes_.at(i) != distributed_nodes.at(j); - ++j) - distributed_nodes.at(j)->LazyReattachIfAttached(); - if (j == distributed_nodes.size()) - break; - } else if (distributed_nodes_.size() > distributed_nodes.size()) { - // If the old distribution is larger than the new one, reattach all nodes - // in the old distribution that were removed. - for (; i < distributed_nodes_.size() && - distributed_nodes_.at(i) != distributed_nodes.at(j); - ++i) - distributed_nodes_.at(i)->LazyReattachIfAttached(); - if (i == distributed_nodes_.size()) - break; - } else if (distributed_nodes_.at(i) != distributed_nodes.at(j)) { - // If both distributions are the same length reattach both old and new. - distributed_nodes_.at(i)->LazyReattachIfAttached(); - distributed_nodes.at(j)->LazyReattachIfAttached(); - } - } - - // If we hit the end of either list above we need to reattach all remaining - // nodes. - - for (; i < distributed_nodes_.size(); ++i) - distributed_nodes_.at(i)->LazyReattachIfAttached(); - - for (; j < distributed_nodes.size(); ++j) - distributed_nodes.at(j)->LazyReattachIfAttached(); - - distributed_nodes_.Swap(distributed_nodes); - // Deallocate a Vector and a HashMap explicitly so that - // Oilpan can recycle them without an intervening GC. - distributed_nodes.Clear(); - distributed_nodes_.ShrinkToFit(); -} - -void InsertionPoint::AttachLayoutTree(AttachContext& context) { - // We need to attach the distribution here so that they're inserted in the - // right order otherwise the n^2 protection inside LayoutTreeBuilder will - // cause them to be inserted in the wrong place later. This also lets - // distributed nodes benefit from the n^2 protection. - AttachContext children_context(context); - children_context.resolved_style = nullptr; - - for (size_t i = 0; i < distributed_nodes_.size(); ++i) { - Node* child = distributed_nodes_.at(i); - if (child->NeedsAttach()) - child->AttachLayoutTree(children_context); - } - if (children_context.previous_in_flow) - context.previous_in_flow = children_context.previous_in_flow; - - HTMLElement::AttachLayoutTree(context); -} - -void InsertionPoint::DetachLayoutTree(const AttachContext& context) { - for (size_t i = 0; i < distributed_nodes_.size(); ++i) - distributed_nodes_.at(i)->LazyReattachIfAttached(); - - HTMLElement::DetachLayoutTree(context); -} - -void InsertionPoint::RebuildDistributedChildrenLayoutTrees() { - Text* next_text_sibling = nullptr; - // This loop traverses the nodes from right to left for the same reason as the - // one described in ContainerNode::RebuildChildrenLayoutTrees(). - for (size_t i = distributed_nodes_.size(); i > 0; --i) - RebuildLayoutTreeForChild(distributed_nodes_.at(i - 1), next_text_sibling); -} - -void InsertionPoint::WillRecalcStyle(StyleRecalcChange change) { - StyleChangeType style_change_type = kNoStyleChange; - - if (change > kInherit || GetStyleChangeType() > kLocalStyleChange) - style_change_type = kSubtreeStyleChange; - else if (change > kNoInherit) - style_change_type = kLocalStyleChange; - else - return; - - for (size_t i = 0; i < distributed_nodes_.size(); ++i) { - distributed_nodes_.at(i)->SetNeedsStyleRecalc( - style_change_type, - StyleChangeReasonForTracing::Create( - StyleChangeReason::kPropagateInheritChangeToDistributedNodes)); - } -} - -bool InsertionPoint::CanBeActive() const { - ShadowRoot* shadow_root = ContainingShadowRoot(); - if (!shadow_root) - return false; - if (shadow_root->IsV1()) - return false; - return !Traversal<InsertionPoint>::FirstAncestor(*this); -} - -bool InsertionPoint::IsActive() const { - if (!CanBeActive()) - return false; - ShadowRoot* shadow_root = ContainingShadowRoot(); - DCHECK(shadow_root); - if (!isHTMLShadowElement(*this) || - shadow_root->DescendantShadowElementCount() <= 1) - return true; - - // Slow path only when there are more than one shadow elements in a shadow - // tree. That should be a rare case. - for (const auto& point : shadow_root->DescendantInsertionPoints()) { - if (isHTMLShadowElement(*point)) - return point == this; - } - return true; -} - -bool InsertionPoint::IsShadowInsertionPoint() const { - return isHTMLShadowElement(*this) && IsActive(); -} - -bool InsertionPoint::IsContentInsertionPoint() const { - return isHTMLContentElement(*this) && IsActive(); -} - -StaticNodeList* InsertionPoint::getDistributedNodes() { - UpdateDistribution(); - - HeapVector<Member<Node>> nodes; - nodes.ReserveInitialCapacity(distributed_nodes_.size()); - for (size_t i = 0; i < distributed_nodes_.size(); ++i) - nodes.UncheckedAppend(distributed_nodes_.at(i)); - - return StaticNodeList::Adopt(nodes); -} - -bool InsertionPoint::LayoutObjectIsNeeded(const ComputedStyle& style) { - return !IsActive() && HTMLElement::LayoutObjectIsNeeded(style); -} - -void InsertionPoint::ChildrenChanged(const ChildrenChange& change) { - HTMLElement::ChildrenChanged(change); - if (ShadowRoot* root = ContainingShadowRoot()) { - if (ElementShadow* root_owner = root->Owner()) - root_owner->SetNeedsDistributionRecalc(); - } -} - -Node::InsertionNotificationRequest InsertionPoint::InsertedInto( - ContainerNode* insertion_point) { - HTMLElement::InsertedInto(insertion_point); - if (ShadowRoot* root = ContainingShadowRoot()) { - if (!root->IsV1()) { - if (ElementShadow* root_owner = root->Owner()) { - root_owner->SetNeedsDistributionRecalc(); - if (CanBeActive() && !registered_with_shadow_root_ && - insertion_point->GetTreeScope().RootNode() == root) { - registered_with_shadow_root_ = true; - root->DidAddInsertionPoint(this); - if (CanAffectSelector()) - root_owner->V0().WillAffectSelector(); - } - } - } - } - - // We could have been distributed into in a detached subtree, make sure to - // clear the distribution when inserted again to avoid cycles. - ClearDistribution(); - - return kInsertionDone; -} - -void InsertionPoint::RemovedFrom(ContainerNode* insertion_point) { - ShadowRoot* root = ContainingShadowRoot(); - if (!root) - root = insertion_point->ContainingShadowRoot(); - - if (root) { - if (ElementShadow* root_owner = root->Owner()) - root_owner->SetNeedsDistributionRecalc(); - } - - // host can be null when removedFrom() is called from ElementShadow - // destructor. - ElementShadow* root_owner = root ? root->Owner() : 0; - - // Since this insertion point is no longer visible from the shadow subtree, it - // need to clean itself up. - ClearDistribution(); - - if (registered_with_shadow_root_ && - insertion_point->GetTreeScope().RootNode() == root) { - DCHECK(root); - registered_with_shadow_root_ = false; - root->DidRemoveInsertionPoint(this); - if (!root->IsV1() && root_owner) { - if (CanAffectSelector()) - root_owner->V0().WillAffectSelector(); - } - } - - HTMLElement::RemovedFrom(insertion_point); -} - -DEFINE_TRACE(InsertionPoint) { - visitor->Trace(distributed_nodes_); - HTMLElement::Trace(visitor); -} - -const InsertionPoint* ResolveReprojection(const Node* projected_node) { - DCHECK(projected_node); - const InsertionPoint* insertion_point = 0; - const Node* current = projected_node; - ElementShadow* last_element_shadow = 0; - while (true) { - ElementShadow* shadow = ShadowWhereNodeCanBeDistributedForV0(*current); - if (!shadow || shadow->IsV1() || shadow == last_element_shadow) - break; - last_element_shadow = shadow; - const InsertionPoint* inserted_to = - shadow->V0().FinalDestinationInsertionPointFor(projected_node); - if (!inserted_to) - break; - DCHECK_NE(current, inserted_to); - current = inserted_to; - insertion_point = inserted_to; - } - return insertion_point; -} - -void CollectDestinationInsertionPoints( - const Node& node, - HeapVector<Member<InsertionPoint>, 8>& results) { - const Node* current = &node; - ElementShadow* last_element_shadow = 0; - while (true) { - ElementShadow* shadow = ShadowWhereNodeCanBeDistributedForV0(*current); - if (!shadow || shadow->IsV1() || shadow == last_element_shadow) - return; - last_element_shadow = shadow; - const DestinationInsertionPoints* insertion_points = - shadow->V0().DestinationInsertionPointsFor(&node); - if (!insertion_points) - return; - for (size_t i = 0; i < insertion_points->size(); ++i) - results.push_back(insertion_points->at(i).Get()); - DCHECK_NE(current, insertion_points->back().Get()); - current = insertion_points->back().Get(); - } -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/InsertionPoint.h b/third_party/WebKit/Source/core/dom/InsertionPoint.h deleted file mode 100644 index fa2c1bfb..0000000 --- a/third_party/WebKit/Source/core/dom/InsertionPoint.h +++ /dev/null
@@ -1,132 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef InsertionPoint_h -#define InsertionPoint_h - -#include "core/CoreExport.h" -#include "core/css/CSSSelectorList.h" -#include "core/dom/DistributedNodes.h" -#include "core/dom/ShadowRoot.h" -#include "core/html/HTMLElement.h" - -namespace blink { - -class CORE_EXPORT InsertionPoint : public HTMLElement { - public: - ~InsertionPoint() override; - - bool HasDistribution() const { return !distributed_nodes_.IsEmpty(); } - void SetDistributedNodes(DistributedNodes&); - void ClearDistribution() { distributed_nodes_.Clear(); } - bool IsActive() const; - bool CanBeActive() const; - - bool IsShadowInsertionPoint() const; - bool IsContentInsertionPoint() const; - - StaticNodeList* getDistributedNodes(); - - virtual bool CanAffectSelector() const { return false; } - - void AttachLayoutTree(AttachContext&) override; - void DetachLayoutTree(const AttachContext& = AttachContext()) override; - void RebuildDistributedChildrenLayoutTrees(); - - size_t DistributedNodesSize() const { return distributed_nodes_.size(); } - Node* DistributedNodeAt(size_t index) const { - return distributed_nodes_.at(index); - } - Node* FirstDistributedNode() const { - return distributed_nodes_.IsEmpty() ? 0 : distributed_nodes_.First(); - } - Node* LastDistributedNode() const { - return distributed_nodes_.IsEmpty() ? 0 : distributed_nodes_.Last(); - } - Node* DistributedNodeNextTo(const Node* node) const { - return distributed_nodes_.NextTo(node); - } - Node* DistributedNodePreviousTo(const Node* node) const { - return distributed_nodes_.PreviousTo(node); - } - - DECLARE_VIRTUAL_TRACE(); - - protected: - InsertionPoint(const QualifiedName&, Document&); - bool LayoutObjectIsNeeded(const ComputedStyle&) override; - void ChildrenChanged(const ChildrenChange&) override; - InsertionNotificationRequest InsertedInto(ContainerNode*) override; - void RemovedFrom(ContainerNode*) override; - void WillRecalcStyle(StyleRecalcChange) override; - - private: - bool IsInsertionPoint() const = - delete; // This will catch anyone doing an unnecessary check. - - DistributedNodes distributed_nodes_; - bool registered_with_shadow_root_; -}; - -typedef HeapVector<Member<InsertionPoint>, 1> DestinationInsertionPoints; - -DEFINE_ELEMENT_TYPE_CASTS(InsertionPoint, IsInsertionPoint()); - -inline bool IsActiveInsertionPoint(const Node& node) { - return node.IsInsertionPoint() && ToInsertionPoint(node).IsActive(); -} - -inline bool IsActiveShadowInsertionPoint(const Node& node) { - return node.IsInsertionPoint() && - ToInsertionPoint(node).IsShadowInsertionPoint(); -} - -inline ElementShadow* ShadowWhereNodeCanBeDistributedForV0(const Node& node) { - Node* parent = node.parentNode(); - if (!parent) - return nullptr; - if (parent->IsShadowRoot() && !ToShadowRoot(parent)->IsYoungest()) - return node.OwnerShadowHost()->Shadow(); - if (IsActiveInsertionPoint(*parent)) - return node.OwnerShadowHost()->Shadow(); - if (parent->IsElementNode()) - return ToElement(parent)->Shadow(); - return nullptr; -} - -const InsertionPoint* ResolveReprojection(const Node*); - -void CollectDestinationInsertionPoints( - const Node&, - HeapVector<Member<InsertionPoint>, 8>& results); - -} // namespace blink - -#endif // InsertionPoint_h
diff --git a/third_party/WebKit/Source/core/dom/LayoutTreeBuilder.cpp b/third_party/WebKit/Source/core/dom/LayoutTreeBuilder.cpp index dc50d65..934a6baff 100644 --- a/third_party/WebKit/Source/core/dom/LayoutTreeBuilder.cpp +++ b/third_party/WebKit/Source/core/dom/LayoutTreeBuilder.cpp
@@ -32,10 +32,10 @@ #include "core/css/resolver/StyleResolver.h" #include "core/dom/FirstLetterPseudoElement.h" #include "core/dom/Fullscreen.h" -#include "core/dom/InsertionPoint.h" #include "core/dom/Node.h" #include "core/dom/PseudoElement.h" #include "core/dom/Text.h" +#include "core/dom/V0InsertionPoint.h" #include "core/layout/LayoutFullScreen.h" #include "core/layout/LayoutObject.h" #include "core/layout/LayoutText.h" @@ -48,7 +48,7 @@ LayoutTreeBuilderForElement::LayoutTreeBuilderForElement(Element& element, ComputedStyle* style) : LayoutTreeBuilder(element, nullptr), style_(style) { - DCHECK(!element.IsActiveSlotOrActiveInsertionPoint()); + DCHECK(!element.IsActiveSlotOrActiveV0InsertionPoint()); // TODO(ecobos): Move the first-letter logic inside parentLayoutObject too? // It's an extra (unnecessary) check for text nodes, though. if (element.IsFirstLetterPseudoElement()) { @@ -151,8 +151,6 @@ ToElement(LayoutTreeBuilderTraversal::Parent(*node_)) ->HasDisplayContentsStyle()); - DCHECK(node_->TextLayoutObjectIsNeeded(style, *layout_object_parent_)); - LayoutText* new_layout_object = node_->CreateTextLayoutObject(style); if (!layout_object_parent_->IsChildAllowed(new_layout_object, style)) { new_layout_object->Destroy();
diff --git a/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.cpp b/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.cpp index f4ff6dc3..da8c6dcc 100644 --- a/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.cpp +++ b/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.cpp
@@ -44,7 +44,7 @@ } void LayoutTreeBuilderTraversal::ParentDetails::DidTraverseInsertionPoint( - const InsertionPoint* insertion_point) { + const V0InsertionPoint* insertion_point) { if (!insertion_point_) { insertion_point_ = insertion_point; } @@ -304,6 +304,11 @@ return nullptr; } +Node* LayoutTreeBuilderTraversal::FirstLayoutChild(const Node& node) { + int32_t limit = kTraverseAllSiblings; + return NextLayoutSiblingInternal(PseudoAwareFirstChild(node), limit); +} + LayoutObject* LayoutTreeBuilderTraversal::NextSiblingLayoutObject( const Node& node, int32_t limit) {
diff --git a/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.h b/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.h index ae23c66..2728c549 100644 --- a/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.h +++ b/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.h
@@ -30,7 +30,7 @@ #include <cstdint> #include "core/CoreExport.h" #include "core/dom/Element.h" -#include "core/dom/InsertionPoint.h" +#include "core/dom/V0InsertionPoint.h" namespace blink { @@ -45,16 +45,18 @@ public: ParentDetails() : insertion_point_(nullptr) {} - const InsertionPoint* GetInsertionPoint() const { return insertion_point_; } + const V0InsertionPoint* GetInsertionPoint() const { + return insertion_point_; + } - void DidTraverseInsertionPoint(const InsertionPoint*); + void DidTraverseInsertionPoint(const V0InsertionPoint*); bool operator==(const ParentDetails& other) { return insertion_point_ == other.insertion_point_; } private: - Member<const InsertionPoint> insertion_point_; + Member<const V0InsertionPoint> insertion_point_; }; static ContainerNode* Parent(const Node&, ParentDetails* = nullptr); @@ -69,6 +71,8 @@ int32_t limit = kTraverseAllSiblings; return PreviousLayoutSibling(node, limit); } + static Node* FirstLayoutChild(const Node&); + static Node* PreviousSibling(const Node&); static Node* Previous(const Node&, const Node* stay_within); static Node* Next(const Node&, const Node* stay_within);
diff --git a/third_party/WebKit/Source/core/dom/MockScriptElementBase.h b/third_party/WebKit/Source/core/dom/MockScriptElementBase.h index f913a63c..828e5c2e 100644 --- a/third_party/WebKit/Source/core/dom/MockScriptElementBase.h +++ b/third_party/WebKit/Source/core/dom/MockScriptElementBase.h
@@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef MockScriptElementBase_h +#define MockScriptElementBase_h + #include "bindings/core/v8/HTMLScriptElementOrSVGScriptElement.h" #include "core/dom/Document.h" #include "core/dom/ScriptElementBase.h" @@ -16,7 +19,7 @@ public: static MockScriptElementBase* Create() { - return new testing::StrictMock<MockScriptElementBase>(); + return new ::testing::StrictMock<MockScriptElementBase>(); } virtual ~MockScriptElementBase() {} @@ -35,7 +38,6 @@ MOCK_CONST_METHOD0(TypeAttributeValue, String()); MOCK_METHOD0(TextFromChildren, String()); - MOCK_CONST_METHOD0(TextContent, String()); MOCK_CONST_METHOD0(HasSourceAttribute, bool()); MOCK_CONST_METHOD0(IsConnected, bool()); MOCK_CONST_METHOD0(HasChildren, bool()); @@ -54,3 +56,5 @@ }; } // namespace blink + +#endif // MockScriptElementBase_h
diff --git a/third_party/WebKit/Source/core/dom/Modulator.cpp b/third_party/WebKit/Source/core/dom/Modulator.cpp index 47a504e..bb35523 100644 --- a/third_party/WebKit/Source/core/dom/Modulator.cpp +++ b/third_party/WebKit/Source/core/dom/Modulator.cpp
@@ -75,7 +75,7 @@ const KURL& base_url) { // Step 1. Apply the URL parser to specifier. If the result is not failure, // return the result. - KURL url(KURL(), module_request); + KURL url(NullURL(), module_request); if (url.IsValid()) return url;
diff --git a/third_party/WebKit/Source/core/dom/Modulator.h b/third_party/WebKit/Source/core/dom/Modulator.h index 4aa36b1..ef910f66 100644 --- a/third_party/WebKit/Source/core/dom/Modulator.h +++ b/third_party/WebKit/Source/core/dom/Modulator.h
@@ -5,6 +5,7 @@ #ifndef Modulator_h #define Modulator_h +#include "bindings/core/v8/ScriptModule.h" #include "core/CoreExport.h" #include "core/dom/AncestorList.h" #include "platform/bindings/ScriptWrappable.h" @@ -22,7 +23,6 @@ class ModuleScript; class ModuleScriptFetchRequest; class ModuleScriptLoaderClient; -class ScriptModule; class ScriptModuleResolver; class ScriptState; class ScriptValue; @@ -123,6 +123,8 @@ virtual ScriptValue InstantiateModule(ScriptModule) = 0; + virtual ScriptModuleState GetRecordStatus(ScriptModule) = 0; + // https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-error virtual ScriptValue GetError(const ModuleScript*) = 0;
diff --git a/third_party/WebKit/Source/core/dom/ModulatorImpl.cpp b/third_party/WebKit/Source/core/dom/ModulatorImpl.cpp index 0f916e5..2cbe420e 100644 --- a/third_party/WebKit/Source/core/dom/ModulatorImpl.cpp +++ b/third_party/WebKit/Source/core/dom/ModulatorImpl.cpp
@@ -148,6 +148,11 @@ return script_module.Instantiate(script_state_.Get()); } +ScriptModuleState ModulatorImpl::GetRecordStatus(ScriptModule script_module) { + ScriptState::Scope scope(script_state_.Get()); + return script_module.Status(script_state_.Get()); +} + ScriptValue ModulatorImpl::GetError(const ModuleScript* module_script) { DCHECK(module_script); ScriptState::Scope scope(script_state_.Get()); @@ -209,10 +214,10 @@ // Step 3. "If s is errored, then report the exception given by s's error for // s and abort these steps." [spec text] if (module_script->IsErrored()) { - v8::Isolate* isolate = script_state_->GetIsolate(); - ScriptModule::ReportException( - script_state_.Get(), module_script->CreateErrorInternal(isolate), - module_script->BaseURL().GetString(), module_script->StartPosition()); + ScriptValue error = GetError(module_script); + ScriptModule::ReportException(script_state_.Get(), error.V8Value(), + module_script->BaseURL().GetString(), + module_script->StartPosition()); return; }
diff --git a/third_party/WebKit/Source/core/dom/ModulatorImpl.h b/third_party/WebKit/Source/core/dom/ModulatorImpl.h index e60b02ea..9a87c58 100644 --- a/third_party/WebKit/Source/core/dom/ModulatorImpl.h +++ b/third_party/WebKit/Source/core/dom/ModulatorImpl.h
@@ -66,6 +66,7 @@ const TextPosition&, ExceptionState&) override; ScriptValue InstantiateModule(ScriptModule) override; + ScriptModuleState GetRecordStatus(ScriptModule) override; ScriptValue GetError(const ModuleScript*) override; Vector<ModuleRequest> ModuleRequestsFromScriptModule(ScriptModule) override; void ExecuteModule(const ModuleScript*) override;
diff --git a/third_party/WebKit/Source/core/dom/ModulatorTest.cpp b/third_party/WebKit/Source/core/dom/ModulatorTest.cpp index 0c31e6c..4ab6131 100644 --- a/third_party/WebKit/Source/core/dom/ModulatorTest.cpp +++ b/third_party/WebKit/Source/core/dom/ModulatorTest.cpp
@@ -16,16 +16,16 @@ // "The following are valid module specifiers according to the above // algorithm:" - EXPECT_TRUE( - Modulator::ResolveModuleSpecifier("https://example.com/apples.js", KURL()) - .IsValid()); + EXPECT_TRUE(Modulator::ResolveModuleSpecifier("https://example.com/apples.js", + NullURL()) + .IsValid()); - KURL resolved = - Modulator::ResolveModuleSpecifier("http:example.com\\pears.mjs", KURL()); + KURL resolved = Modulator::ResolveModuleSpecifier( + "http:example.com\\pears.mjs", NullURL()); EXPECT_TRUE(resolved.IsValid()); EXPECT_EQ("http://example.com/pears.mjs", resolved.GetString()); - KURL base_url(KURL(), "https://example.com"); + KURL base_url(NullURL(), "https://example.com"); EXPECT_TRUE( Modulator::ResolveModuleSpecifier("//example.com/", base_url).IsValid()); EXPECT_TRUE( @@ -36,7 +36,7 @@ EXPECT_TRUE( Modulator::ResolveModuleSpecifier("/limes.jsx", base_url).IsValid()); EXPECT_TRUE(Modulator::ResolveModuleSpecifier( - "data:text/javascript,export default 'grapes';", KURL()) + "data:text/javascript,export default 'grapes';", NullURL()) .IsValid()); EXPECT_TRUE( Modulator::ResolveModuleSpecifier( @@ -47,23 +47,23 @@ // "The following are valid module specifiers according to the above // algorithm, but will invariably cause failures when they are fetched:" EXPECT_TRUE(Modulator::ResolveModuleSpecifier( - "javascript:export default 'artichokes';", KURL()) + "javascript:export default 'artichokes';", NullURL()) .IsValid()); EXPECT_TRUE(Modulator::ResolveModuleSpecifier( - "data:text/plain,export default 'kale';", KURL()) + "data:text/plain,export default 'kale';", NullURL()) .IsValid()); EXPECT_TRUE( - Modulator::ResolveModuleSpecifier("about:legumes", KURL()).IsValid()); + Modulator::ResolveModuleSpecifier("about:legumes", NullURL()).IsValid()); EXPECT_TRUE( - Modulator::ResolveModuleSpecifier("wss://example.com/celery", KURL()) + Modulator::ResolveModuleSpecifier("wss://example.com/celery", NullURL()) .IsValid()); // "The following are not valid module specifiers according to the above // algorithm:" EXPECT_FALSE( - Modulator::ResolveModuleSpecifier("https://f:b/c", KURL()).IsValid()); + Modulator::ResolveModuleSpecifier("https://f:b/c", NullURL()).IsValid()); EXPECT_FALSE( - Modulator::ResolveModuleSpecifier("pumpkins.js", KURL()).IsValid()); + Modulator::ResolveModuleSpecifier("pumpkins.js", NullURL()).IsValid()); // Unprefixed module specifiers should still fail w/ a valid baseURL. EXPECT_FALSE(
diff --git a/third_party/WebKit/Source/core/dom/ModuleMapTest.cpp b/third_party/WebKit/Source/core/dom/ModuleMapTest.cpp index 8848834..f5a92a9 100644 --- a/third_party/WebKit/Source/core/dom/ModuleMapTest.cpp +++ b/third_party/WebKit/Source/core/dom/ModuleMapTest.cpp
@@ -146,7 +146,7 @@ test_requests_.clear(); } -class ModuleMapTest : public testing::Test { +class ModuleMapTest : public ::testing::Test { public: void SetUp() override; @@ -168,7 +168,7 @@ platform; platform->AdvanceClockSeconds(1.); // For non-zero DocumentParserTimings - KURL url(KURL(), "https://example.com/foo.js"); + KURL url(NullURL(), "https://example.com/foo.js"); ModuleScriptFetchRequest module_request( url, String(), kParserInserted, WebURLRequest::kFetchCredentialsModeOmit); @@ -187,8 +187,7 @@ 1); EXPECT_TRUE(client->WasNotifyFinished()); EXPECT_TRUE(client->GetModuleScript()); - EXPECT_EQ(client->GetModuleScript()->State(), - ModuleInstantiationState::kUninstantiated); + EXPECT_FALSE(client->GetModuleScript()->HasInstantiated()); // Secondary request TestSingleModuleClient* client2 = new TestSingleModuleClient; @@ -206,8 +205,7 @@ << "registerModuleScript sholudn't be called in secondary request."; EXPECT_TRUE(client2->WasNotifyFinished()); EXPECT_TRUE(client2->GetModuleScript()); - EXPECT_EQ(client2->GetModuleScript()->State(), - ModuleInstantiationState::kUninstantiated); + EXPECT_FALSE(client2->GetModuleScript()->HasInstantiated()); } TEST_F(ModuleMapTest, concurrentRequestsShouldJoin) { @@ -215,7 +213,7 @@ platform; platform->AdvanceClockSeconds(1.); // For non-zero DocumentParserTimings - KURL url(KURL(), "https://example.com/foo.js"); + KURL url(NullURL(), "https://example.com/foo.js"); ModuleScriptFetchRequest module_request( url, String(), kParserInserted, WebURLRequest::kFetchCredentialsModeOmit); @@ -243,12 +241,10 @@ EXPECT_TRUE(client->WasNotifyFinished()); EXPECT_TRUE(client->GetModuleScript()); - EXPECT_EQ(client->GetModuleScript()->State(), - ModuleInstantiationState::kUninstantiated); + EXPECT_FALSE(client->GetModuleScript()->HasInstantiated()); EXPECT_TRUE(client2->WasNotifyFinished()); EXPECT_TRUE(client2->GetModuleScript()); - EXPECT_EQ(client2->GetModuleScript()->State(), - ModuleInstantiationState::kUninstantiated); + EXPECT_FALSE(client2->GetModuleScript()->HasInstantiated()); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/ModulePendingScript.cpp b/third_party/WebKit/Source/core/dom/ModulePendingScript.cpp index db9f6b8..3d6b556d7 100644 --- a/third_party/WebKit/Source/core/dom/ModulePendingScript.cpp +++ b/third_party/WebKit/Source/core/dom/ModulePendingScript.cpp
@@ -25,7 +25,10 @@ void ModulePendingScriptTreeClient::NotifyModuleTreeLoadFinished( ModuleScript* module_script) { DCHECK(!module_script || module_script->IsErrored() || - module_script->State() == ModuleInstantiationState::kInstantiated); + module_script->RecordStatus() >= ScriptModuleState::kInstantiated) + << "ModulePendingScriptTreeClient::NotifyModuleTreeLoadFinished was " + "unexpectedly notified " + << *module_script; DCHECK(!finished_); finished_ = true; module_script_ = module_script;
diff --git a/third_party/WebKit/Source/core/dom/ModuleScript.cpp b/third_party/WebKit/Source/core/dom/ModuleScript.cpp index b17da72e..87ff924c 100644 --- a/third_party/WebKit/Source/core/dom/ModuleScript.cpp +++ b/third_party/WebKit/Source/core/dom/ModuleScript.cpp
@@ -184,8 +184,42 @@ return record_.IsEmpty(); } +ScriptModuleState ModuleScript::RecordStatus() const { + DCHECK(!record_.IsEmpty()); + return settings_object_->GetRecordStatus(Record()); +} + +// https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-has-instantiated +bool ModuleScript::HasInstantiated() const { + // "We say that a module script has instantiated if ..." [spec text] + + // "its module record is not null, and ..." [spec text] + if (record_.IsEmpty()) + return false; + + // "its module record's [[Status]] field is ..." [spec text] + ScriptModuleState status = RecordStatus(); + + // "either "instantiated" or "evaluated"." [spec text] + return status == ScriptModuleState::kInstantiated || + status == ScriptModuleState::kEvaluated; +} + +// https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-is-errored +bool ModuleScript::IsErrored() const { + // "We say that a module script is errored ..." [spec text] + + // "if either its module record is null, ..." [spec text] + if (record_.IsEmpty()) + return true; + + // "or its module record's [[Status]] field has the value "errored"." [spec + // text] + return RecordStatus() == ScriptModuleState::kErrored; +} + void ModuleScript::SetErrorAndClearRecord(ScriptValue error) { - DVLOG(1) << "ModuleScript[" << this << "]::SetErrorAndClearRecord()"; + DVLOG(1) << *this << "::SetErrorAndClearRecord()"; // https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-set-pre-instantiation-error // Step 1. "If script's module record is not null, ..." [spec text] @@ -207,15 +241,6 @@ } } -void ModuleScript::SetInstantiationSuccess() { - // Implements Step 7.2 of: - // https://html.spec.whatwg.org/multipage/webappapis.html#internal-module-script-graph-fetching-procedure - - // "set script's instantiation state to "instantiated"." - DCHECK_EQ(state_, ModuleInstantiationState::kUninstantiated); - state_ = ModuleInstantiationState::kInstantiated; -} - DEFINE_TRACE(ModuleScript) { visitor->Trace(settings_object_); Script::Trace(visitor); @@ -235,7 +260,7 @@ } void ModuleScript::RunScript(LocalFrame* frame, const SecurityOrigin*) const { - DVLOG(1) << "ModuleScript[" << this << "]::RunScript()"; + DVLOG(1) << *this << "::RunScript()"; settings_object_->ExecuteModule(this); } @@ -243,4 +268,17 @@ return source_text_; } +std::ostream& operator<<(std::ostream& stream, + const ModuleScript& module_script) { + stream << "ModuleScript[" << &module_script << ", "; + if (module_script.HasEmptyRecord()) { + stream << "errored (empty record)"; + } else { + stream << "record's [[Status]] = " + << ScriptModuleStateToString(module_script.RecordStatus()); + } + + return stream << "]"; +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/ModuleScript.h b/third_party/WebKit/Source/core/dom/ModuleScript.h index 0bbea7c4..ecc2bb7 100644 --- a/third_party/WebKit/Source/core/dom/ModuleScript.h +++ b/third_party/WebKit/Source/core/dom/ModuleScript.h
@@ -61,16 +61,18 @@ ModuleInstantiationState State() const { return state_; } + // Corresponds to spec concept: module script's record's [[Status]] + ScriptModuleState RecordStatus() const; + + // https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-has-instantiated + bool HasInstantiated() const; + // https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-is-errored - bool IsErrored() const { return record_.IsEmpty(); } + bool IsErrored() const; // https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-set-pre-instantiation-error void SetErrorAndClearRecord(ScriptValue error); - // Implements Step 7.2 of: - // https://html.spec.whatwg.org/multipage/webappapis.html#internal-module-script-graph-fetching-procedure - void SetInstantiationSuccess(); - v8::Local<v8::Value> CreateError(v8::Isolate* isolate) const { return preinstantiation_error_.NewLocal(isolate); } @@ -144,9 +146,13 @@ // DOMWindow -> Modulator/ModulatorImpl -> ModuleTreeLinkerRegistry // -> ModuleTreeLinker -> ModuleScript // * inline module script case, after the PendingScript is created. - // HTMLScriptElement -> ScriptLoader -> PendingScript -> ModulePendingScript + // HTMLScriptElement -> ScriptLoader -> ModulePendingScript // -> ModulePendingScriptTreeClient -> ModuleScript. - // + // * inline module script case, queued in HTMLParserScriptRunner, + // when HTMLScriptElement is removed before execution. + // Document -> HTMLDocumentParser -> HTMLParserScriptRunner + // -> ModulePendingScript -> ModulePendingScriptTreeClient + // -> ModuleScript. // All the classes/references on the graphs above should be // TraceWrapperBase/TraceWrapperMember<>/etc., TraceWrapperV8Reference<v8::Value> preinstantiation_error_; @@ -166,6 +172,8 @@ const TextPosition start_position_; }; +CORE_EXPORT std::ostream& operator<<(std::ostream&, const ModuleScript&); + } // namespace blink #endif
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp index 6a0b680..95fcd7a4 100644 --- a/third_party/WebKit/Source/core/dom/Node.cpp +++ b/third_party/WebKit/Source/core/dom/Node.cpp
@@ -48,7 +48,6 @@ #include "core/dom/ExceptionCode.h" #include "core/dom/FlatTreeTraversal.h" #include "core/dom/GetRootNodeOptions.h" -#include "core/dom/InsertionPoint.h" #include "core/dom/LayoutTreeBuilderTraversal.h" #include "core/dom/NodeRareData.h" #include "core/dom/NodeTraversal.h" @@ -62,6 +61,7 @@ #include "core/dom/Text.h" #include "core/dom/TreeScopeAdopter.h" #include "core/dom/UserActionElementSet.h" +#include "core/dom/V0InsertionPoint.h" #include "core/dom/custom/CustomElement.h" #include "core/editing/EditingUtilities.h" #include "core/editing/markers/DocumentMarkerController.h" @@ -800,8 +800,8 @@ } if (node.IsInV0ShadowTree() || node.IsChildOfV0ShadowHost()) { if (ShadowWhereNodeCanBeDistributedForV0(node)) { - if (InsertionPoint* insertion_point = - const_cast<InsertionPoint*>(ResolveReprojection(&node))) { + if (V0InsertionPoint* insertion_point = + const_cast<V0InsertionPoint*>(ResolveReprojection(&node))) { return insertion_point; } } @@ -1048,23 +1048,6 @@ ClearChildNeedsStyleInvalidation(); } -void Node::ReattachWhitespaceSiblingsIfNeeded(Text* start) { - ScriptForbiddenScope forbid_script_during_raw_iteration; - for (Node* sibling = start; sibling; sibling = sibling->nextSibling()) { - if (sibling->IsTextNode() && ToText(sibling)->ContainsOnlyWhitespace()) { - bool had_layout_object = !!sibling->GetLayoutObject(); - ToText(sibling)->ReattachLayoutTreeIfNeeded(); - // If sibling's layout object status didn't change we don't need to - // continue checking other siblings since their layout object status won't - // change either. - if (!!sibling->GetLayoutObject() == had_layout_object) - return; - } else if (sibling->GetLayoutObject()) { - return; - } - } -} - const ComputedStyle* Node::VirtualEnsureComputedStyle( PseudoId pseudo_element_specifier) { return ParentOrShadowHostNode() @@ -1114,13 +1097,13 @@ bool Node::CanParticipateInFlatTree() const { // TODO(hayato): Return false for pseudo elements. - return !IsShadowRoot() && !IsActiveSlotOrActiveInsertionPoint(); + return !IsShadowRoot() && !IsActiveSlotOrActiveV0InsertionPoint(); } -bool Node::IsActiveSlotOrActiveInsertionPoint() const { +bool Node::IsActiveSlotOrActiveV0InsertionPoint() const { return (isHTMLSlotElement(*this) && toHTMLSlotElement(*this).SupportsDistribution()) || - IsActiveInsertionPoint(*this); + IsActiveV0InsertionPoint(*this); } AtomicString Node::SlotName() const { @@ -2439,7 +2422,7 @@ StaticNodeList* Node::getDestinationInsertionPoints() { UpdateDistribution(); - HeapVector<Member<InsertionPoint>, 8> insertion_points; + HeapVector<Member<V0InsertionPoint>, 8> insertion_points; CollectDestinationInsertionPoints(*this, insertion_points); HeapVector<Member<Node>> filtered_insertion_points; for (const auto& insertion_point : insertion_points) {
diff --git a/third_party/WebKit/Source/core/dom/Node.h b/third_party/WebKit/Source/core/dom/Node.h index aacf220..2884e032 100644 --- a/third_party/WebKit/Source/core/dom/Node.h +++ b/third_party/WebKit/Source/core/dom/Node.h
@@ -71,7 +71,6 @@ class StaticNodeTypeList; using StaticNodeList = StaticNodeTypeList<Node>; class StyleChangeReasonForTracing; -class Text; class WebMouseEvent; class WebPluginContainerBase; @@ -336,13 +335,13 @@ bool IsTreeScope() const; bool IsDocumentFragment() const { return GetFlag(kIsDocumentFragmentFlag); } bool IsShadowRoot() const { return IsDocumentFragment() && IsTreeScope(); } - bool IsInsertionPoint() const { return GetFlag(kIsInsertionPointFlag); } + bool IsV0InsertionPoint() const { return GetFlag(kIsV0InsertionPointFlag); } bool CanParticipateInFlatTree() const; - bool IsActiveSlotOrActiveInsertionPoint() const; + bool IsActiveSlotOrActiveV0InsertionPoint() const; // A re-distribution across v0 and v1 shadow trees is not supported. bool IsSlotable() const { - return IsTextNode() || (IsElementNode() && !IsInsertionPoint()); + return IsTextNode() || (IsElementNode() && !IsV0InsertionPoint()); } AtomicString SlotName() const; @@ -846,7 +845,7 @@ kIsHTMLFlag = 1 << 4, kIsSVGFlag = 1 << 5, kIsDocumentFragmentFlag = 1 << 6, - kIsInsertionPointFlag = 1 << 7, + kIsV0InsertionPointFlag = 1 << 7, // Changes based on if the element should be treated like a link, // ex. When setting the href attribute on an <a>. @@ -916,7 +915,7 @@ kCreateHTMLElement = kCreateElement | kIsHTMLFlag, kCreateSVGElement = kCreateElement | kIsSVGFlag, kCreateDocument = kCreateContainer | kIsConnectedFlag, - kCreateInsertionPoint = kCreateHTMLElement | kIsInsertionPointFlag, + kCreateV0InsertionPoint = kCreateHTMLElement | kIsV0InsertionPointFlag, kCreateEditingText = kCreateText | kHasNameOrIsEditingTextFlag, }; @@ -932,8 +931,6 @@ const RegisteredEventListener&) override; DispatchEventResult DispatchEventInternal(Event*) override; - static void ReattachWhitespaceSiblingsIfNeeded(Text* start); - bool HasRareData() const { return GetFlag(kHasRareDataFlag); } NodeRareData* RareData() const;
diff --git a/third_party/WebKit/Source/core/dom/NodeComputedStyle.h b/third_party/WebKit/Source/core/dom/NodeComputedStyle.h index 14bd8db..f3c1c78 100644 --- a/third_party/WebKit/Source/core/dom/NodeComputedStyle.h +++ b/third_party/WebKit/Source/core/dom/NodeComputedStyle.h
@@ -26,9 +26,9 @@ #define NodeComputedStyle_h #include "core/dom/Element.h" -#include "core/dom/InsertionPoint.h" #include "core/dom/LayoutTreeBuilderTraversal.h" #include "core/dom/Node.h" +#include "core/dom/V0InsertionPoint.h" #include "core/html/HTMLOptGroupElement.h" #include "core/layout/LayoutObject.h" @@ -49,7 +49,7 @@ } inline const ComputedStyle* Node::ParentComputedStyle() const { - if (IsActiveSlotOrActiveInsertionPoint()) + if (IsActiveSlotOrActiveV0InsertionPoint()) return 0; ContainerNode* parent = LayoutTreeBuilderTraversal::Parent(*this); return parent ? parent->GetComputedStyle() : 0;
diff --git a/third_party/WebKit/Source/core/dom/PendingScript.h b/third_party/WebKit/Source/core/dom/PendingScript.h index f2c6452..3ff01e0 100644 --- a/third_party/WebKit/Source/core/dom/PendingScript.h +++ b/third_party/WebKit/Source/core/dom/PendingScript.h
@@ -41,8 +41,7 @@ class Document; class PendingScript; -class CORE_EXPORT PendingScriptClient - : public GarbageCollectedFinalized<PendingScriptClient> { +class CORE_EXPORT PendingScriptClient : public GarbageCollectedMixin { public: virtual ~PendingScriptClient() {}
diff --git a/third_party/WebKit/Source/core/dom/ScriptElementBase.h b/third_party/WebKit/Source/core/dom/ScriptElementBase.h index 6733970..1dd774a 100644 --- a/third_party/WebKit/Source/core/dom/ScriptElementBase.h +++ b/third_party/WebKit/Source/core/dom/ScriptElementBase.h
@@ -54,7 +54,6 @@ virtual String TypeAttributeValue() const = 0; virtual String TextFromChildren() = 0; - virtual String TextContent() const = 0; virtual bool HasSourceAttribute() const = 0; virtual bool IsConnected() const = 0; virtual bool HasChildren() const = 0;
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp index a119577..26211c17 100644 --- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
@@ -460,19 +460,14 @@ // run these substeps:" if (!element_->HasSourceAttribute()) { // 22.1. "Let source text be the value of the text IDL attribute." - // This step is done later: - // - in ScriptLoader::pendingScript() (Step 23, 6th Clause), - // as Element::textFromChildren() in ScriptLoader::scriptContent(), - // - in HTMLParserScriptRunner::processScriptElementInternal() + // This step is done later as ScriptElementBase::TextFromChildren(): + // - in ScriptLoader::PrepareScript() (Step 23, 6th Clause), + // - in HTMLParserScriptRunner::ProcessScriptElementInternal() // (Duplicated code of Step 23, 6th Clause), - // as Element::textContent(), - // - in XMLDocumentParser::endElementNs() (Step 23, 5th Clause), - // as Element::textFromChildren() in ScriptLoader::scriptContent(), - // - PendingScript::getSource() (Indirectly used via - // HTMLParserScriptRunner::processScriptElementInternal(), - // Step 23, 5th Clause), - // as Element::textContent(). - // TODO(hiroshige): Make them merged or consistent. + // - in XMLDocumentParser::EndElementNs() (Step 23, 5th Clause), or + // - in PendingScript::GetSource() (Indirectly used via + // HTMLParserScriptRunner::ProcessScriptElementInternal(), + // Step 23, 5th Clause). // 22.2. "Switch on the script's type:" switch (GetScriptType()) { @@ -496,8 +491,8 @@ Modulator* modulator = Modulator::From( ToScriptStateForMainWorld(context_document->GetFrame())); ModuleScript* module_script = ModuleScript::Create( - ScriptContent(), modulator, base_url, nonce, parser_state, - credentials_mode, kSharableCrossOrigin, position); + element_->TextFromChildren(), modulator, base_url, nonce, + parser_state, credentials_mode, kSharableCrossOrigin, position); // 3. "If this returns null, set the script's script to null and abort // these substeps; the script is ready." @@ -681,13 +676,22 @@ ? element_document.Url() : KURL(); - if (!ExecuteScript(ClassicScript::Create( - ScriptSourceCode(ScriptContent(), script_url, position)))) { - DispatchErrorEvent(); - return false; + switch (ExecuteScript(ClassicScript::Create( + ScriptSourceCode(element_->TextFromChildren(), script_url, position)))) { + case ExecuteScriptResult::kShouldFireLoadEvent: + // The load event is not fired because this is an inline script. + return true; + + case ExecuteScriptResult::kShouldFireErrorEvent: + DispatchErrorEvent(); + return false; + + case ExecuteScriptResult::kShouldFireNone: + return true; } - return true; + NOTREACHED(); + return false; } bool ScriptLoader::FetchClassicScript( @@ -793,9 +797,10 @@ return nullptr; } -bool ScriptLoader::ExecuteScript(const Script* script) { +ScriptLoader::ExecuteScriptResult ScriptLoader::ExecuteScript( + const Script* script) { double script_exec_start_time = MonotonicallyIncreasingTime(); - bool result = DoExecuteScript(script); + ExecuteScriptResult result = DoExecuteScript(script); // NOTE: we do not check m_willBeParserExecuted here, since // m_willBeParserExecuted is false for inline scripts, and we want to @@ -815,18 +820,19 @@ // i.e. load/error events are dispatched by the caller. // Steps 3--7 are implemented here in doExecuteScript(). // TODO(hiroshige): Move event dispatching code to doExecuteScript(). -bool ScriptLoader::DoExecuteScript(const Script* script) { +ScriptLoader::ExecuteScriptResult ScriptLoader::DoExecuteScript( + const Script* script) { DCHECK(already_started_); CHECK_EQ(script->GetScriptType(), GetScriptType()); Document* element_document = &(element_->GetDocument()); Document* context_document = element_document->ContextDocument(); if (!context_document) - return true; + return ExecuteScriptResult::kShouldFireNone; LocalFrame* frame = context_document->GetFrame(); if (!frame) - return true; + return ExecuteScriptResult::kShouldFireNone; if (!is_external_script_) { const ContentSecurityPolicy* csp = @@ -840,14 +846,14 @@ if (!should_bypass_main_world_csp && !element_->AllowInlineScriptForCSP(nonce, start_line_number_, script->InlineSourceTextForCSP())) { - return false; + return ExecuteScriptResult::kShouldFireErrorEvent; } } if (is_external_script_) { if (!script->CheckMIMETypeBeforeRunScript( context_document, element_->GetDocument().GetSecurityOrigin())) - return false; + return ExecuteScriptResult::kShouldFireErrorEvent; } const bool is_imported_script = context_document != element_document; @@ -892,7 +898,7 @@ // to old script element." context_document->PopCurrentScript(current_script); - return true; + return ExecuteScriptResult::kShouldFireLoadEvent; // 7. "Decrement the ignore-destructive-writes counter of neutralized doc, // if it was incremented in the earlier step." @@ -904,16 +910,26 @@ DCHECK(async_exec_type_ != ScriptRunner::kNone); DCHECK(pending_script_->IsExternal()); bool error_occurred = false; - Script* script = pending_script_->GetSource(KURL(), error_occurred); - const bool wasCanceled = pending_script_->WasCanceled(); + Script* script = pending_script_->GetSource(NullURL(), error_occurred); + const bool was_canceled = pending_script_->WasCanceled(); DetachPendingScript(); if (error_occurred) { DispatchErrorEvent(); - } else if (!wasCanceled) { - if (ExecuteScript(script)) - DispatchLoadEvent(); - else - DispatchErrorEvent(); + } else { + // TODO(hiroshige): Remove |was_canceled| once it is confirmed that this + // CHECK never fails. + CHECK(!was_canceled); + + switch (ExecuteScript(script)) { + case ExecuteScriptResult::kShouldFireLoadEvent: + DispatchLoadEvent(); + break; + case ExecuteScriptResult::kShouldFireErrorEvent: + DispatchErrorEvent(); + break; + case ExecuteScriptResult::kShouldFireNone: + break; + } } resource_ = nullptr; module_tree_client_ = nullptr; @@ -989,8 +1005,4 @@ DeprecatedEqualIgnoringCase(event_attribute, "onload()"); } -String ScriptLoader::ScriptContent() const { - return element_->TextFromChildren(); -} - } // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.h b/third_party/WebKit/Source/core/dom/ScriptLoader.h index 9b9c245..a3171bc 100644 --- a/third_party/WebKit/Source/core/dom/ScriptLoader.h +++ b/third_party/WebKit/Source/core/dom/ScriptLoader.h
@@ -46,8 +46,11 @@ class Modulator; class ModulePendingScriptTreeClient; -class CORE_EXPORT ScriptLoader : public PendingScriptClient, +class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>, + public PendingScriptClient, public TraceWrapperBase { + USING_GARBAGE_COLLECTED_MIXIN(ScriptLoader); + public: static ScriptLoader* Create(ScriptElementBase* element, bool created_by_parser, @@ -78,14 +81,16 @@ TextPosition::MinimumPosition(), LegacyTypeSupport = kDisallowLegacyTypeInTypeAttribute); - String ScriptContent() const; - // Creates a PendingScript for external script whose fetch is started in // FetchClassicScript()/FetchModuleScriptTree(). PendingScript* CreatePendingScript(); - // Returns false if and only if execution was blocked. - bool ExecuteScript(const Script*); + enum class ExecuteScriptResult { + kShouldFireErrorEvent, + kShouldFireLoadEvent, + kShouldFireNone + }; + WARN_UNUSED_RESULT ExecuteScriptResult ExecuteScript(const Script*); virtual void Execute(); // XML parser calls these @@ -163,7 +168,7 @@ ParserDisposition, WebURLRequest::FetchCredentialsMode); - bool DoExecuteScript(const Script*); + ExecuteScriptResult DoExecuteScript(const Script*); // Clears the connection to the PendingScript. void DetachPendingScript();
diff --git a/third_party/WebKit/Source/core/dom/ScriptModuleResolverImplTest.cpp b/third_party/WebKit/Source/core/dom/ScriptModuleResolverImplTest.cpp index 94406eb..9075a3d0 100644 --- a/third_party/WebKit/Source/core/dom/ScriptModuleResolverImplTest.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptModuleResolverImplTest.cpp
@@ -46,7 +46,10 @@ ModuleScript* GetFetchedModuleScript(const KURL&) override; - ScriptValue GetError(const ModuleScript* module_script) { + ScriptModuleState GetRecordStatus(ScriptModule) override { + return ScriptModuleState::kInstantiated; + } + ScriptValue GetError(const ModuleScript* module_script) override { ScriptState::Scope scope(script_state_.Get()); return ScriptValue(script_state_.Get(), module_script->CreateError(script_state_->GetIsolate())); @@ -80,14 +83,13 @@ ModuleScript* referrer_module_script = ModuleScript::CreateForTest( modulator, referrer_record, referrer_url, "", kParserInserted, WebURLRequest::kFetchCredentialsModeOmit); - referrer_module_script->SetInstantiationSuccess(); return referrer_module_script; } ModuleScript* CreateTargetModuleScript( Modulator* modulator, V8TestingScope& scope, - ModuleInstantiationState state = ModuleInstantiationState::kInstantiated) { + ScriptModuleState state = ScriptModuleState::kInstantiated) { ScriptModule record = ScriptModule::Compile( scope.GetIsolate(), "export const pi = 3.14;", "target.js", kSharableCrossOrigin, TextPosition::MinimumPosition(), @@ -96,10 +98,8 @@ ModuleScript* module_script = ModuleScript::CreateForTest(modulator, record, url, "", kParserInserted, WebURLRequest::kFetchCredentialsModeOmit); - if (state == ModuleInstantiationState::kInstantiated) { - module_script->SetInstantiationSuccess(); - } else { - EXPECT_EQ(ModuleInstantiationState::kErrored, state); + if (state != ScriptModuleState::kInstantiated) { + EXPECT_EQ(ScriptModuleState::kErrored, state); v8::Local<v8::Value> error = V8ThrowException::CreateError(scope.GetIsolate(), "hoge"); module_script->SetErrorAndClearRecord( @@ -110,7 +110,7 @@ } // namespace -class ScriptModuleResolverImplTest : public testing::Test { +class ScriptModuleResolverImplTest : public ::testing::Test { public: void SetUp() override; @@ -212,8 +212,8 @@ CreateReferrerModuleScript(modulator_, scope); resolver->RegisterModuleScript(referrer_module_script); - ModuleScript* target_module_script = CreateTargetModuleScript( - modulator_, scope, ModuleInstantiationState::kErrored); + ModuleScript* target_module_script = + CreateTargetModuleScript(modulator_, scope, ScriptModuleState::kErrored); Modulator()->SetModuleScript(target_module_script); ScriptModule resolved =
diff --git a/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp b/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp index 6430ebb..a1bd764 100644 --- a/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp
@@ -35,7 +35,7 @@ : ScriptLoader(MockScriptElementBase::Create(), false, false, false) {} }; -class ScriptRunnerTest : public testing::Test { +class ScriptRunnerTest : public ::testing::Test { public: ScriptRunnerTest() : document_(Document::Create()) {} @@ -298,7 +298,7 @@ int expected[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; - EXPECT_THAT(order_, testing::ElementsAreArray(expected)); + EXPECT_THAT(order_, ::testing::ElementsAreArray(expected)); } TEST_F(ScriptRunnerTest, ResumeAndSuspend_InOrder) {
diff --git a/third_party/WebKit/Source/core/dom/ScriptedIdleTaskControllerTest.cpp b/third_party/WebKit/Source/core/dom/ScriptedIdleTaskControllerTest.cpp index cfb303a..b3f3c44 100644 --- a/third_party/WebKit/Source/core/dom/ScriptedIdleTaskControllerTest.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptedIdleTaskControllerTest.cpp
@@ -95,7 +95,7 @@ } // namespace -class ScriptedIdleTaskControllerTest : public testing::Test { +class ScriptedIdleTaskControllerTest : public ::testing::Test { public: void SetUp() override { execution_context_ = new NullExecutionContext(); } @@ -118,7 +118,7 @@ EXPECT_CALL(*callback, handleEvent(testing::_)); platform->RunIdleTask(); - testing::Mock::VerifyAndClearExpectations(callback); + ::testing::Mock::VerifyAndClearExpectations(callback); EXPECT_FALSE(platform->HasIdleTask()); } @@ -135,7 +135,7 @@ EXPECT_CALL(*callback, handleEvent(testing::_)).Times(0); platform->RunIdleTask(); - testing::Mock::VerifyAndClearExpectations(callback); + ::testing::Mock::VerifyAndClearExpectations(callback); // The idle task should have been reposted. EXPECT_TRUE(platform->HasIdleTask());
diff --git a/third_party/WebKit/Source/core/dom/SelectorQueryTest.cpp b/third_party/WebKit/Source/core/dom/SelectorQueryTest.cpp index f210c1bf..f444d10d 100644 --- a/third_party/WebKit/Source/core/dom/SelectorQueryTest.cpp +++ b/third_party/WebKit/Source/core/dom/SelectorQueryTest.cpp
@@ -68,7 +68,7 @@ "<body><style>span::before { content: 'X' }</style><span></span></body>"); CSSSelectorList selector_list = CSSParser::ParseSelector( - CSSParserContext::Create(*document, KURL(), kReferrerPolicyDefault, + CSSParserContext::Create(*document, NullURL(), kReferrerPolicyDefault, WTF::TextEncoding(), CSSParserContext::kStaticProfile), nullptr, "span::before"); @@ -78,7 +78,7 @@ EXPECT_EQ(nullptr, elm); selector_list = CSSParser::ParseSelector( - CSSParserContext::Create(*document, KURL(), kReferrerPolicyDefault, + CSSParserContext::Create(*document, NullURL(), kReferrerPolicyDefault, WTF::TextEncoding(), CSSParserContext::kStaticProfile), nullptr, "span"); @@ -97,7 +97,7 @@ document->body()->BeginParsingChildren(); CSSSelectorList selector_list = CSSParser::ParseSelector( - CSSParserContext::Create(*document, KURL(), kReferrerPolicyDefault, + CSSParserContext::Create(*document, NullURL(), kReferrerPolicyDefault, WTF::TextEncoding(), CSSParserContext::kStaticProfile), nullptr, "p:last-of-type");
diff --git a/third_party/WebKit/Source/core/dom/ShadowRoot.cpp b/third_party/WebKit/Source/core/dom/ShadowRoot.cpp index cbc82e5..d00f06a 100644 --- a/third_party/WebKit/Source/core/dom/ShadowRoot.cpp +++ b/third_party/WebKit/Source/core/dom/ShadowRoot.cpp
@@ -32,11 +32,12 @@ #include "core/css/resolver/StyleSharingDepthScope.h" #include "core/dom/ElementShadow.h" #include "core/dom/ElementTraversal.h" -#include "core/dom/InsertionPoint.h" #include "core/dom/ShadowRootRareDataV0.h" #include "core/dom/SlotAssignment.h" #include "core/dom/StyleEngine.h" #include "core/dom/Text.h" +#include "core/dom/V0InsertionPoint.h" +#include "core/dom/WhitespaceAttacher.h" #include "core/editing/serializers/Serialization.h" #include "core/html/HTMLShadowElement.h" #include "core/html/HTMLSlotElement.h" @@ -157,20 +158,21 @@ ClearChildNeedsStyleRecalc(); } -void ShadowRoot::RebuildLayoutTree(Text*& next_text_sibling) { +void ShadowRoot::RebuildLayoutTree(WhitespaceAttacher& whitespace_attacher) { if (!NeedsReattachLayoutTree() && !ChildNeedsReattachLayoutTree()) { - SkipRebuildLayoutTree(next_text_sibling); + SkipRebuildLayoutTree(whitespace_attacher); return; } StyleSharingDepthScope sharing_scope(*this); ClearNeedsReattachLayoutTree(); - RebuildChildrenLayoutTrees(next_text_sibling); + RebuildChildrenLayoutTrees(whitespace_attacher); ClearChildNeedsReattachLayoutTree(); } -void ShadowRoot::SkipRebuildLayoutTree(Text*& next_text_sibling) const { +void ShadowRoot::SkipRebuildLayoutTree( + WhitespaceAttacher& whitespace_attacher) const { // We call this method when neither this, nor our child nodes are marked // for re-attachment, but the host has been marked with // childNeedsReattachLayoutTree. That happens when ::before or ::after needs @@ -187,12 +189,12 @@ for (Node* sibling = firstChild(); sibling; sibling = sibling->nextSibling()) { if (sibling->IsTextNode()) { - next_text_sibling = ToText(sibling); + whitespace_attacher.DidVisitText(ToText(sibling)); return; } LayoutObject* layout_object = sibling->GetLayoutObject(); if (layout_object && !layout_object->IsFloatingOrOutOfFlowPositioned()) { - next_text_sibling = nullptr; + whitespace_attacher.DidVisitElement(ToElement(sibling)); return; } } @@ -265,7 +267,7 @@ change.sibling_after_change); } - if (InsertionPoint* point = ShadowInsertionPointOfYoungerShadowRoot()) { + if (V0InsertionPoint* point = ShadowInsertionPointOfYoungerShadowRoot()) { if (ShadowRoot* root = point->ContainingShadowRoot()) root->Owner()->SetNeedsDistributionRecalc(); } @@ -312,12 +314,12 @@ shadow_insertion_point); } -void ShadowRoot::DidAddInsertionPoint(InsertionPoint* insertion_point) { +void ShadowRoot::DidAddInsertionPoint(V0InsertionPoint* insertion_point) { EnsureShadowRootRareDataV0().DidAddInsertionPoint(insertion_point); InvalidateDescendantInsertionPoints(); } -void ShadowRoot::DidRemoveInsertionPoint(InsertionPoint* insertion_point) { +void ShadowRoot::DidRemoveInsertionPoint(V0InsertionPoint* insertion_point) { shadow_root_rare_data_v0_->DidRemoveInsertionPoint(insertion_point); InvalidateDescendantInsertionPoints(); } @@ -327,10 +329,10 @@ shadow_root_rare_data_v0_->ClearDescendantInsertionPoints(); } -const HeapVector<Member<InsertionPoint>>& +const HeapVector<Member<V0InsertionPoint>>& ShadowRoot::DescendantInsertionPoints() { - DEFINE_STATIC_LOCAL(HeapVector<Member<InsertionPoint>>, empty_list, - (new HeapVector<Member<InsertionPoint>>)); + DEFINE_STATIC_LOCAL(HeapVector<Member<V0InsertionPoint>>, empty_list, + (new HeapVector<Member<V0InsertionPoint>>)); if (shadow_root_rare_data_v0_ && descendant_insertion_points_is_valid_) return shadow_root_rare_data_v0_->DescendantInsertionPoints(); @@ -339,9 +341,9 @@ if (!ContainsInsertionPoints()) return empty_list; - HeapVector<Member<InsertionPoint>> insertion_points; - for (InsertionPoint& insertion_point : - Traversal<InsertionPoint>::DescendantsOf(*this)) + HeapVector<Member<V0InsertionPoint>> insertion_points; + for (V0InsertionPoint& insertion_point : + Traversal<V0InsertionPoint>::DescendantsOf(*this)) insertion_points.push_back(&insertion_point); EnsureShadowRootRareDataV0().SetDescendantInsertionPoints(insertion_points);
diff --git a/third_party/WebKit/Source/core/dom/ShadowRoot.h b/third_party/WebKit/Source/core/dom/ShadowRoot.h index cc994c1..9acbae68 100644 --- a/third_party/WebKit/Source/core/dom/ShadowRoot.h +++ b/third_party/WebKit/Source/core/dom/ShadowRoot.h
@@ -41,9 +41,10 @@ class ElementShadow; class ExceptionState; class HTMLShadowElement; -class InsertionPoint; +class V0InsertionPoint; class ShadowRootRareDataV0; class SlotAssignment; +class WhitespaceAttacher; enum class ShadowRootType { kUserAgent, V0, kOpen, kClosed }; @@ -114,15 +115,15 @@ unsigned DescendantShadowElementCount() const; HTMLShadowElement* ShadowInsertionPointOfYoungerShadowRoot() const; void SetShadowInsertionPointOfYoungerShadowRoot(HTMLShadowElement*); - void DidAddInsertionPoint(InsertionPoint*); - void DidRemoveInsertionPoint(InsertionPoint*); - const HeapVector<Member<InsertionPoint>>& DescendantInsertionPoints(); + void DidAddInsertionPoint(V0InsertionPoint*); + void DidRemoveInsertionPoint(V0InsertionPoint*); + const HeapVector<Member<V0InsertionPoint>>& DescendantInsertionPoints(); // For Internals, don't use this. unsigned ChildShadowRootCount() const { return child_shadow_root_count_; } void RecalcStyle(StyleRecalcChange); - void RebuildLayoutTree(Text*& next_text_sibling); + void RebuildLayoutTree(WhitespaceAttacher&); void RegisterScopedHTMLStyleChild(); void UnregisterScopedHTMLStyleChild(); @@ -175,7 +176,7 @@ --child_shadow_root_count_; } void InvalidateDescendantInsertionPoints(); - void SkipRebuildLayoutTree(Text*& next_text_sibling) const; + void SkipRebuildLayoutTree(WhitespaceAttacher&) const; Member<ShadowRootRareDataV0> shadow_root_rare_data_v0_; Member<StyleSheetList> style_sheet_list_;
diff --git a/third_party/WebKit/Source/core/dom/ShadowRootRareDataV0.h b/third_party/WebKit/Source/core/dom/ShadowRootRareDataV0.h index b09d4f7..9fb50546 100644 --- a/third_party/WebKit/Source/core/dom/ShadowRootRareDataV0.h +++ b/third_party/WebKit/Source/core/dom/ShadowRootRareDataV0.h
@@ -31,7 +31,7 @@ #ifndef ShadowRootRareDataV0_h #define ShadowRootRareDataV0_h -#include "core/dom/InsertionPoint.h" +#include "core/dom/V0InsertionPoint.h" #include "platform/wtf/Vector.h" namespace blink { @@ -50,8 +50,8 @@ shadow_insertion_point_of_younger_shadow_root_ = shadow_insertion_point; } - void DidAddInsertionPoint(InsertionPoint*); - void DidRemoveInsertionPoint(InsertionPoint*); + void DidAddInsertionPoint(V0InsertionPoint*); + void DidRemoveInsertionPoint(V0InsertionPoint*); bool ContainsShadowElements() const { return descendant_shadow_element_count_; @@ -64,10 +64,11 @@ return descendant_shadow_element_count_; } - const HeapVector<Member<InsertionPoint>>& DescendantInsertionPoints() { + const HeapVector<Member<V0InsertionPoint>>& DescendantInsertionPoints() { return descendant_insertion_points_; } - void SetDescendantInsertionPoints(HeapVector<Member<InsertionPoint>>& list) { + void SetDescendantInsertionPoints( + HeapVector<Member<V0InsertionPoint>>& list) { descendant_insertion_points_.swap(list); } void ClearDescendantInsertionPoints() { @@ -97,10 +98,11 @@ Member<HTMLShadowElement> shadow_insertion_point_of_younger_shadow_root_; unsigned descendant_shadow_element_count_; unsigned descendant_content_element_count_; - HeapVector<Member<InsertionPoint>> descendant_insertion_points_; + HeapVector<Member<V0InsertionPoint>> descendant_insertion_points_; }; -inline void ShadowRootRareDataV0::DidAddInsertionPoint(InsertionPoint* point) { +inline void ShadowRootRareDataV0::DidAddInsertionPoint( + V0InsertionPoint* point) { DCHECK(point); if (isHTMLShadowElement(*point)) ++descendant_shadow_element_count_; @@ -111,7 +113,7 @@ } inline void ShadowRootRareDataV0::DidRemoveInsertionPoint( - InsertionPoint* point) { + V0InsertionPoint* point) { DCHECK(point); if (isHTMLShadowElement(*point)) { DCHECK_GT(descendant_shadow_element_count_, 0u);
diff --git a/third_party/WebKit/Source/core/dom/SlotAssignment.cpp b/third_party/WebKit/Source/core/dom/SlotAssignment.cpp index 9c890e597..db9574a 100644 --- a/third_party/WebKit/Source/core/dom/SlotAssignment.cpp +++ b/third_party/WebKit/Source/core/dom/SlotAssignment.cpp
@@ -7,10 +7,10 @@ #include "core/HTMLNames.h" #include "core/dom/ElementShadow.h" #include "core/dom/ElementTraversal.h" -#include "core/dom/InsertionPoint.h" #include "core/dom/Node.h" #include "core/dom/NodeTraversal.h" #include "core/dom/ShadowRoot.h" +#include "core/dom/V0InsertionPoint.h" #include "core/html/HTMLSlotElement.h" namespace blink { @@ -28,8 +28,7 @@ DCHECK(!slot_map_->Contains(slot.GetName()) || GetCachedFirstSlotWithoutAccessingNodeTree(slot.GetName())); DidAddSlotInternal(slot); - // Ensures that DocumentOrderedMap has a cache if there is a slot for the - // name. + // Ensures that TreeOrderedMap has a cache if there is a slot for the name. DCHECK(GetCachedFirstSlotWithoutAccessingNodeTree(slot.GetName())); } @@ -46,8 +45,7 @@ DCHECK(GetCachedFirstSlotWithoutAccessingNodeTree(slot.GetName())); DidRemoveSlotInternal(slot, slot.GetName(), SlotMutationType::kRemoved); - // Ensures that DocumentOrderedMap has a cache if there is a slot for the - // name. + // Ensures that TreeOrderedMap has a cache if there is a slot for the name. DCHECK(!slot_map_->Contains(slot.GetName()) || GetCachedFirstSlotWithoutAccessingNodeTree(slot.GetName())); } @@ -74,8 +72,7 @@ // This might invalidate the slot_map's cache. slot_map_->Add(slot_name, &slot); - // This also ensures that DocumentOrderedMap has a cache for the first - // element. + // This also ensures that TreeOrderedMap has a cache for the first element. HTMLSlotElement* new_active = FindSlotByName(slot_name); DCHECK(new_active); DCHECK(new_active == slot || new_active == old_active); @@ -121,8 +118,7 @@ GetCachedFirstSlotWithoutAccessingNodeTree(slot_name); DCHECK(old_active); slot_map_->Remove(slot_name, &slot); - // This also ensures that DocumentOrderedMap has a cache for the first - // element. + // This also ensures that TreeOrderedMap has a cache for the first element. HTMLSlotElement* new_active = FindSlotByName(slot_name); DCHECK(!new_active || new_active != slot); @@ -186,7 +182,7 @@ } SlotAssignment::SlotAssignment(ShadowRoot& owner) - : slot_map_(DocumentOrderedMap::Create()), + : slot_map_(TreeOrderedMap::Create()), owner_(&owner), needs_collect_slots_(false), slot_count_(0) {
diff --git a/third_party/WebKit/Source/core/dom/SlotAssignment.h b/third_party/WebKit/Source/core/dom/SlotAssignment.h index 4152aa36..4f7e01af 100644 --- a/third_party/WebKit/Source/core/dom/SlotAssignment.h +++ b/third_party/WebKit/Source/core/dom/SlotAssignment.h
@@ -5,8 +5,7 @@ #ifndef SlotAssignment_h #define SlotAssignment_h -// #include "core/dom/DocumentOrderedList.h" -#include "core/dom/DocumentOrderedMap.h" +#include "core/dom/TreeOrderedMap.h" #include "platform/heap/Handle.h" #include "platform/wtf/HashMap.h" #include "platform/wtf/text/AtomicString.h" @@ -71,7 +70,7 @@ SlotMutationType); HeapVector<Member<HTMLSlotElement>> slots_; - Member<DocumentOrderedMap> slot_map_; + Member<TreeOrderedMap> slot_map_; WeakMember<ShadowRoot> owner_; unsigned needs_collect_slots_ : 1; unsigned slot_count_ : 31;
diff --git a/third_party/WebKit/Source/core/dom/StaticRangeTest.cpp b/third_party/WebKit/Source/core/dom/StaticRangeTest.cpp index 293834b..a9cf9fcb 100644 --- a/third_party/WebKit/Source/core/dom/StaticRangeTest.cpp +++ b/third_party/WebKit/Source/core/dom/StaticRangeTest.cpp
@@ -22,7 +22,7 @@ namespace blink { -class StaticRangeTest : public testing::Test { +class StaticRangeTest : public ::testing::Test { protected: void SetUp() override;
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.cpp b/third_party/WebKit/Source/core/dom/StyleEngine.cpp index 4c8ec07..48405c8 100644 --- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp +++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
@@ -604,7 +604,7 @@ const String& text, TextPosition start_position) { CSSStyleSheet* style_sheet = nullptr; - style_sheet = CSSStyleSheet::CreateInline(element, KURL(), start_position, + style_sheet = CSSStyleSheet::CreateInline(element, NullURL(), start_position, GetDocument().Encoding()); style_sheet->Contents()->ParseStringAtPosition(text, start_position); return style_sheet;
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.h b/third_party/WebKit/Source/core/dom/StyleEngine.h index 0a95186..5a4c56c8 100644 --- a/third_party/WebKit/Source/core/dom/StyleEngine.h +++ b/third_party/WebKit/Source/core/dom/StyleEngine.h
@@ -40,9 +40,9 @@ #include "core/css/resolver/StyleResolver.h" #include "core/css/resolver/StyleResolverStats.h" #include "core/dom/Document.h" -#include "core/dom/DocumentOrderedList.h" #include "core/dom/DocumentStyleSheetCollection.h" #include "core/dom/StyleEngineContext.h" +#include "core/dom/TreeOrderedList.h" #include "platform/bindings/ScriptWrappable.h" #include "platform/bindings/TraceWrapperMember.h" #include "platform/heap/Handle.h" @@ -185,7 +185,7 @@ void ShadowRootRemovedFromDocument(ShadowRoot*); void AddTreeBoundaryCrossingScope(const TreeScope&); - const DocumentOrderedList& TreeBoundaryCrossingScopes() const { + const TreeOrderedList& TreeBoundaryCrossingScopes() const { return tree_boundary_crossing_scopes_; } void ResetAuthorStyle(TreeScope&); @@ -379,7 +379,7 @@ bool tree_scopes_removed_ = false; UnorderedTreeScopeSet dirty_tree_scopes_; UnorderedTreeScopeSet active_tree_scopes_; - DocumentOrderedList tree_boundary_crossing_scopes_; + TreeOrderedList tree_boundary_crossing_scopes_; String preferred_stylesheet_set_name_; String selected_stylesheet_set_name_;
diff --git a/third_party/WebKit/Source/core/dom/Text.cpp b/third_party/WebKit/Source/core/dom/Text.cpp index 2d89f5a..ab56be4 100644 --- a/third_party/WebKit/Source/core/dom/Text.cpp +++ b/third_party/WebKit/Source/core/dom/Text.cpp
@@ -32,6 +32,7 @@ #include "core/dom/NodeComputedStyle.h" #include "core/dom/NodeTraversal.h" #include "core/dom/ShadowRoot.h" +#include "core/dom/WhitespaceAttacher.h" #include "core/events/ScopedEventQueue.h" #include "core/layout/LayoutText.h" #include "core/layout/LayoutTextCombine.h" @@ -257,7 +258,12 @@ return true; } -bool Text::TextLayoutObjectIsNeeded(const ComputedStyle& style, +static inline bool EndsWithWhitespace(const String& text) { + return text.length() && IsASCIISpace(text[text.length() - 1]); +} + +bool Text::TextLayoutObjectIsNeeded(const AttachContext& context, + const ComputedStyle& style, const LayoutObject& parent) const { DCHECK(!GetDocument().ChildNeedsDistributionRecalc()); @@ -287,51 +293,19 @@ if (style.PreserveNewline()) return true; - // Avoiding creation of a layoutObject for the text node is a non-essential - // memory optimization. So to avoid blowing up on very wide DOMs, we limit - // the number of siblings to visit. - unsigned max_siblings_to_visit = 50; - - const LayoutObject* prev = - LayoutTreeBuilderTraversal::PreviousSiblingLayoutObject( - *this, max_siblings_to_visit); - if (prev && prev->IsBR()) // <span><br/> <br/></span> + if (!context.use_previous_in_flow) return false; - if (parent.IsLayoutInline()) { - // <span><div/> <div/></span> - if (prev && !prev->IsInline() && !prev->IsFloatingOrOutOfFlowPositioned()) - return false; - } else { - if (parent.IsLayoutBlock() && !parent.ChildrenInline() && - (!prev || !prev->IsInline())) - return false; + if (!context.previous_in_flow) + return parent.IsLayoutInline(); - LayoutObject* first = parent.SlowFirstChild(); - for (; first && first->IsFloatingOrOutOfFlowPositioned() && - max_siblings_to_visit; - first = first->NextSibling(), --max_siblings_to_visit) { - } - if (!first || first == GetLayoutObject() || - LayoutTreeBuilderTraversal::NextSiblingLayoutObject( - *this, max_siblings_to_visit) == first) { - // If we're adding children to this flow our previous siblings are not in - // the layout tree yet so we cannot know if we will be the first child in - // the line and collapse away. We have to assume we need a layout object. - Node* first_child_node = - parent.GetNode() - ? LayoutTreeBuilderTraversal::FirstChild(*parent.GetNode()) - : nullptr; - if (first && first == GetLayoutObject() && first_child_node && - !first_child_node->GetLayoutObject()) - return true; - - // Whitespace at the start of a block just goes away. Don't even - // make a layout object for this text. - return !first_child_node; - } + if (context.previous_in_flow->IsText()) { + return !EndsWithWhitespace( + ToLayoutText(context.previous_in_flow)->GetText()); } - return true; + + return context.previous_in_flow->IsInline() && + !context.previous_in_flow->IsBR(); } static bool IsSVGText(Text* text) { @@ -358,7 +332,7 @@ if (style_parent && parent_layout_object) { DCHECK(style_parent->GetComputedStyle()); - if (TextLayoutObjectIsNeeded(*style_parent->GetComputedStyle(), + if (TextLayoutObjectIsNeeded(context, *style_parent->GetComputedStyle(), *parent_layout_object)) { LayoutTreeBuilderForText(*this, parent_layout_object, style_parent->MutableComputedStyle()) @@ -368,7 +342,7 @@ CharacterData::AttachLayoutTree(context); } -void Text::ReattachLayoutTreeIfNeeded() { +void Text::ReattachLayoutTreeIfNeeded(const AttachContext& context) { bool layout_object_is_needed = false; ContainerNode* style_parent = LayoutTreeBuilderTraversal::Parent(*this); LayoutObject* parent_layout_object = @@ -376,7 +350,7 @@ if (style_parent && parent_layout_object) { DCHECK(style_parent->GetComputedStyle()); layout_object_is_needed = TextLayoutObjectIsNeeded( - *style_parent->GetComputedStyle(), *parent_layout_object); + context, *style_parent->GetComputedStyle(), *parent_layout_object); } if (layout_object_is_needed == !!GetLayoutObject()) @@ -411,14 +385,13 @@ } } -void Text::RebuildTextLayoutTree(Text* next_text_sibling) { +void Text::RebuildTextLayoutTree(WhitespaceAttacher& whitespace_attacher) { DCHECK(!ChildNeedsStyleRecalc()); DCHECK(NeedsReattachLayoutTree()); DCHECK(parentNode()); ReattachLayoutTree(); - if (GetLayoutObject()) - ReattachWhitespaceSiblingsIfNeeded(next_text_sibling); + whitespace_attacher.DidReattachText(this); ClearNeedsReattachLayoutTree(); } @@ -442,7 +415,8 @@ // |childNeedsDistributionRecalc|, but this code tries to figure out if we can // use an optimized code path that avoids reattach. if (!text_node.GetDocument().ChildNeedsDistributionRecalc() && - !text_node.TextLayoutObjectIsNeeded(*text_layout_object->Style(), + !text_node.TextLayoutObjectIsNeeded(Node::AttachContext(), + *text_layout_object->Style(), *text_layout_object->Parent())) { return true; }
diff --git a/third_party/WebKit/Source/core/dom/Text.h b/third_party/WebKit/Source/core/dom/Text.h index 5dbffc36..6a6a50c9 100644 --- a/third_party/WebKit/Source/core/dom/Text.h +++ b/third_party/WebKit/Source/core/dom/Text.h
@@ -31,6 +31,7 @@ class ExceptionState; class LayoutText; +class WhitespaceAttacher; class CORE_EXPORT Text : public CharacterData { DEFINE_WRAPPERTYPEINFO(); @@ -54,15 +55,16 @@ Text* ReplaceWholeText(const String&); void RecalcTextStyle(StyleRecalcChange); - void RebuildTextLayoutTree(Text* next_text_sibling); - bool TextLayoutObjectIsNeeded(const ComputedStyle&, + void RebuildTextLayoutTree(WhitespaceAttacher&); + bool TextLayoutObjectIsNeeded(const AttachContext&, + const ComputedStyle&, const LayoutObject& parent) const; LayoutText* CreateTextLayoutObject(const ComputedStyle&); void UpdateTextLayoutObject(unsigned offset_of_replaced_data, unsigned length_of_replaced_data); void AttachLayoutTree(AttachContext&) final; - void ReattachLayoutTreeIfNeeded(); + void ReattachLayoutTreeIfNeeded(const AttachContext&); bool CanContainRangeEndPoint() const final { return true; } NodeType getNodeType() const override;
diff --git a/third_party/WebKit/Source/core/dom/TextTest.cpp b/third_party/WebKit/Source/core/dom/TextTest.cpp index b9bbedc9..197ee7a 100644 --- a/third_party/WebKit/Source/core/dom/TextTest.cpp +++ b/third_party/WebKit/Source/core/dom/TextTest.cpp
@@ -40,4 +40,173 @@ EXPECT_FALSE(text->GetLayoutObject()->IsTextFragment()); } +TEST_F(TextTest, TextLayoutObjectIsNeeded_CannotHaveChildren) { + SetBodyContent("<img id=image>"); + UpdateAllLifecyclePhases(); + + Element* img = GetDocument().getElementById("image"); + ASSERT_TRUE(img); + + const LayoutObject* img_layout = img->GetLayoutObject(); + ASSERT_TRUE(img_layout); + const ComputedStyle& style = img_layout->StyleRef(); + + Text* text = Text::Create(GetDocument(), "dummy"); + + Node::AttachContext context; + EXPECT_FALSE(text->TextLayoutObjectIsNeeded(context, style, *img_layout)); + + context.use_previous_in_flow = true; + EXPECT_FALSE(text->TextLayoutObjectIsNeeded(context, style, *img_layout)); +} + +TEST_F(TextTest, TextLayoutObjectIsNeeded_EditingText) { + SetBodyContent("<span id=parent></span>"); + UpdateAllLifecyclePhases(); + + Element* parent = GetDocument().getElementById("parent"); + ASSERT_TRUE(parent); + + const LayoutObject* parent_layout = parent->GetLayoutObject(); + ASSERT_TRUE(parent_layout); + const ComputedStyle& style = parent_layout->StyleRef(); + + Text* text_empty = Text::CreateEditingText(GetDocument(), ""); + Text* text_whitespace = Text::CreateEditingText(GetDocument(), " "); + Text* text = Text::CreateEditingText(GetDocument(), "dummy"); + + Node::AttachContext context; + EXPECT_TRUE( + text_empty->TextLayoutObjectIsNeeded(context, style, *parent_layout)); + EXPECT_TRUE(text_whitespace->TextLayoutObjectIsNeeded(context, style, + *parent_layout)); + EXPECT_TRUE(text->TextLayoutObjectIsNeeded(context, style, *parent_layout)); + + context.use_previous_in_flow = true; + EXPECT_TRUE( + text_empty->TextLayoutObjectIsNeeded(context, style, *parent_layout)); + EXPECT_TRUE(text_whitespace->TextLayoutObjectIsNeeded(context, style, + *parent_layout)); + EXPECT_TRUE(text->TextLayoutObjectIsNeeded(context, style, *parent_layout)); +} + +TEST_F(TextTest, TextLayoutObjectIsNeeded_Empty) { + SetBodyContent("<span id=parent></span>"); + UpdateAllLifecyclePhases(); + + Element* parent = GetDocument().getElementById("parent"); + ASSERT_TRUE(parent); + + const LayoutObject* parent_layout = parent->GetLayoutObject(); + ASSERT_TRUE(parent_layout); + const ComputedStyle& style = parent_layout->StyleRef(); + + Text* text = Text::Create(GetDocument(), ""); + + Node::AttachContext context; + EXPECT_FALSE(text->TextLayoutObjectIsNeeded(context, style, *parent_layout)); + context.use_previous_in_flow = true; + EXPECT_FALSE(text->TextLayoutObjectIsNeeded(context, style, *parent_layout)); +} + +TEST_F(TextTest, TextLayoutObjectIsNeeded_Whitespace) { + SetBodyContent( + "<div id=block></div>Ends with whitespace " + "<span id=inline></span>Nospace<br id=br>"); + UpdateAllLifecyclePhases(); + + LayoutObject* block = + GetDocument().getElementById("block")->GetLayoutObject(); + LayoutObject* in_line = + GetDocument().getElementById("inline")->GetLayoutObject(); + LayoutObject* space_at_end = + GetDocument().getElementById("block")->nextSibling()->GetLayoutObject(); + LayoutObject* no_space = + GetDocument().getElementById("inline")->nextSibling()->GetLayoutObject(); + LayoutObject* br = GetDocument().getElementById("br")->GetLayoutObject(); + ASSERT_TRUE(block); + ASSERT_TRUE(in_line); + ASSERT_TRUE(space_at_end); + ASSERT_TRUE(no_space); + ASSERT_TRUE(br); + + Text* whitespace = Text::Create(GetDocument(), " "); + Node::AttachContext context; + + EXPECT_FALSE( + whitespace->TextLayoutObjectIsNeeded(context, block->StyleRef(), *block)); + EXPECT_FALSE(whitespace->TextLayoutObjectIsNeeded( + context, in_line->StyleRef(), *in_line)); + + context.use_previous_in_flow = true; + EXPECT_FALSE( + whitespace->TextLayoutObjectIsNeeded(context, block->StyleRef(), *block)); + EXPECT_TRUE(whitespace->TextLayoutObjectIsNeeded(context, in_line->StyleRef(), + *in_line)); + + context.previous_in_flow = in_line; + EXPECT_TRUE( + whitespace->TextLayoutObjectIsNeeded(context, block->StyleRef(), *block)); + EXPECT_TRUE(whitespace->TextLayoutObjectIsNeeded(context, in_line->StyleRef(), + *in_line)); + + context.previous_in_flow = space_at_end; + EXPECT_FALSE( + whitespace->TextLayoutObjectIsNeeded(context, block->StyleRef(), *block)); + EXPECT_FALSE(whitespace->TextLayoutObjectIsNeeded( + context, in_line->StyleRef(), *in_line)); + + context.previous_in_flow = no_space; + EXPECT_TRUE( + whitespace->TextLayoutObjectIsNeeded(context, block->StyleRef(), *block)); + EXPECT_TRUE(whitespace->TextLayoutObjectIsNeeded(context, in_line->StyleRef(), + *in_line)); + + context.previous_in_flow = block; + EXPECT_FALSE( + whitespace->TextLayoutObjectIsNeeded(context, block->StyleRef(), *block)); + EXPECT_FALSE(whitespace->TextLayoutObjectIsNeeded( + context, in_line->StyleRef(), *in_line)); + + context.previous_in_flow = br; + EXPECT_FALSE( + whitespace->TextLayoutObjectIsNeeded(context, block->StyleRef(), *block)); + EXPECT_FALSE(whitespace->TextLayoutObjectIsNeeded( + context, in_line->StyleRef(), *in_line)); +} + +TEST_F(TextTest, TextLayoutObjectIsNeeded_PreserveNewLine) { + SetBodyContent( + "<div id=pre style='white-space:pre'></div>" + "<div id=pre-line style='white-space:pre-line'></div>" + "<div id=pre-wrap style='white-space:pre-wrap'></div>"); + UpdateAllLifecyclePhases(); + + Text* text = Text::Create(GetDocument(), " "); + + Element* pre = GetDocument().getElementById("pre"); + ASSERT_TRUE(pre); + const LayoutObject* pre_layout = pre->GetLayoutObject(); + ASSERT_TRUE(pre_layout); + const ComputedStyle& pre_style = pre_layout->StyleRef(); + EXPECT_TRUE(text->TextLayoutObjectIsNeeded(Node::AttachContext(), pre_style, + *pre_layout)); + + Element* pre_line = GetDocument().getElementById("pre-line"); + ASSERT_TRUE(pre_line); + const LayoutObject* pre_line_layout = pre_line->GetLayoutObject(); + ASSERT_TRUE(pre_line_layout); + const ComputedStyle& pre_line_style = pre_line_layout->StyleRef(); + EXPECT_TRUE(text->TextLayoutObjectIsNeeded(Node::AttachContext(), + pre_line_style, *pre_line_layout)); + + Element* pre_wrap = GetDocument().getElementById("pre-wrap"); + ASSERT_TRUE(pre_wrap); + const LayoutObject* pre_wrap_layout = pre_wrap->GetLayoutObject(); + ASSERT_TRUE(pre_wrap_layout); + const ComputedStyle& pre_wrap_style = pre_wrap_layout->StyleRef(); + EXPECT_TRUE(text->TextLayoutObjectIsNeeded(Node::AttachContext(), + pre_wrap_style, *pre_wrap_layout)); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/TreeOrderedList.cpp b/third_party/WebKit/Source/core/dom/TreeOrderedList.cpp new file mode 100644 index 0000000..ab6396f --- /dev/null +++ b/third_party/WebKit/Source/core/dom/TreeOrderedList.cpp
@@ -0,0 +1,70 @@ +/* + * Copyright (C) 1999 Lars Knoll (knoll@kde.org) + * (C) 1999 Antti Koivisto (koivisto@kde.org) + * (C) 2001 Dirk Mueller (mueller@kde.org) + * (C) 2006 Alexey Proskuryakov (ap@webkit.org) + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All + * rights reserved. + * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. + * (http://www.torchmobile.com/) + * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) + * Copyright (C) 2013 Google Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "core/dom/TreeOrderedList.h" + +#include "core/dom/Node.h" + +namespace blink { + +void TreeOrderedList::Add(Node* node) { + if (nodes_.IsEmpty()) { + nodes_.insert(node); + return; + } + + // Determine an appropriate insertion point. + iterator begin = nodes_.begin(); + iterator end = nodes_.end(); + iterator it = end; + Node* following_node = 0; + do { + --it; + Node* n = *it; + unsigned short position = + n->compareDocumentPosition(node, Node::kTreatShadowTreesAsComposed); + if (position & Node::kDocumentPositionFollowing) { + nodes_.InsertBefore(following_node, node); + return; + } + following_node = n; + } while (it != begin); + + nodes_.InsertBefore(following_node, node); +} + +void TreeOrderedList::Remove(const Node* node) { + nodes_.erase(const_cast<Node*>(node)); +} + +DEFINE_TRACE(TreeOrderedList) { + visitor->Trace(nodes_); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/TreeOrderedList.h b/third_party/WebKit/Source/core/dom/TreeOrderedList.h new file mode 100644 index 0000000..1e5cc2af --- /dev/null +++ b/third_party/WebKit/Source/core/dom/TreeOrderedList.h
@@ -0,0 +1,74 @@ +/* + * Copyright (C) 1999 Lars Knoll (knoll@kde.org) + * (C) 1999 Antti Koivisto (koivisto@kde.org) + * (C) 2001 Dirk Mueller (mueller@kde.org) + * (C) 2006 Alexey Proskuryakov (ap@webkit.org) + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All + * rights reserved. + * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. + * (http://www.torchmobile.com/) + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) + * Copyright (C) 2013 Google Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef TreeOrderedList_h +#define TreeOrderedList_h + +#include "platform/heap/Handle.h" +#include "platform/wtf/ListHashSet.h" + +namespace blink { + +class Node; + +class TreeOrderedList final { + WTF_MAKE_NONCOPYABLE(TreeOrderedList); + DISALLOW_NEW(); + + public: + TreeOrderedList() {} + + void Add(Node*); + void Remove(const Node*); + bool IsEmpty() const { return nodes_.IsEmpty(); } + void Clear() { nodes_.clear(); } + size_t size() const { return nodes_.size(); } + + using iterator = HeapListHashSet<Member<Node>, 32>::iterator; + using const_iterator = HeapListHashSet<Member<Node>, 32>::const_iterator; + using const_reverse_iterator = + HeapListHashSet<Member<Node>, 32>::const_reverse_iterator; + + iterator begin() { return nodes_.begin(); } + iterator end() { return nodes_.end(); } + const_iterator begin() const { return nodes_.begin(); } + const_iterator end() const { return nodes_.end(); } + + const_reverse_iterator rbegin() const { return nodes_.rbegin(); } + const_reverse_iterator rend() const { return nodes_.rend(); } + + DECLARE_TRACE(); + + private: + HeapListHashSet<Member<Node>, 32> nodes_; +}; + +} // namespace blink + +#endif
diff --git a/third_party/WebKit/Source/core/dom/TreeOrderedMap.cpp b/third_party/WebKit/Source/core/dom/TreeOrderedMap.cpp new file mode 100644 index 0000000..88d79e9 --- /dev/null +++ b/third_party/WebKit/Source/core/dom/TreeOrderedMap.cpp
@@ -0,0 +1,221 @@ +/* + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "core/dom/TreeOrderedMap.h" + +#include "core/HTMLNames.h" +#include "core/dom/Element.h" +#include "core/dom/ElementTraversal.h" +#include "core/dom/TreeScope.h" +#include "core/html/HTMLMapElement.h" +#include "core/html/HTMLSlotElement.h" + +namespace blink { + +using namespace HTMLNames; + +TreeOrderedMap* TreeOrderedMap::Create() { + return new TreeOrderedMap; +} + +TreeOrderedMap::TreeOrderedMap() {} + +#if DCHECK_IS_ON() +static int g_remove_scope_level = 0; + +TreeOrderedMap::RemoveScope::RemoveScope() { + g_remove_scope_level++; +} + +TreeOrderedMap::RemoveScope::~RemoveScope() { + DCHECK(g_remove_scope_level); + g_remove_scope_level--; +} +#endif + +inline bool KeyMatchesId(const AtomicString& key, const Element& element) { + return element.GetIdAttribute() == key; +} + +inline bool KeyMatchesMapName(const AtomicString& key, const Element& element) { + return isHTMLMapElement(element) && + toHTMLMapElement(element).GetName() == key; +} + +inline bool KeyMatchesSlotName(const AtomicString& key, + const Element& element) { + return isHTMLSlotElement(element) && + toHTMLSlotElement(element).GetName() == key; +} + +void TreeOrderedMap::Add(const AtomicString& key, Element* element) { + DCHECK(key); + DCHECK(element); + + Map::AddResult add_result = map_.insert(key, new MapEntry(element)); + if (add_result.is_new_entry) + return; + + Member<MapEntry>& entry = add_result.stored_value->value; + DCHECK(entry->count); + entry->element = nullptr; + entry->count++; + entry->ordered_list.clear(); +} + +void TreeOrderedMap::Remove(const AtomicString& key, Element* element) { + DCHECK(key); + DCHECK(element); + + Map::iterator it = map_.find(key); + if (it == map_.end()) + return; + + Member<MapEntry>& entry = it->value; + DCHECK(entry->count); + if (entry->count == 1) { + DCHECK(!entry->element || entry->element == element); + map_.erase(it); + } else { + if (entry->element == element) { + DCHECK(entry->ordered_list.IsEmpty() || + entry->ordered_list.front() == element); + entry->element = + entry->ordered_list.size() > 1 ? entry->ordered_list[1] : nullptr; + } + entry->count--; + entry->ordered_list.clear(); + } +} + +template <bool keyMatches(const AtomicString&, const Element&)> +inline Element* TreeOrderedMap::Get(const AtomicString& key, + const TreeScope& scope) const { + DCHECK(key); + + MapEntry* entry = map_.at(key); + if (!entry) + return nullptr; + + DCHECK(entry->count); + if (entry->element) + return entry->element; + + // Iterate to find the node that matches. Nothing will match iff an element + // with children having duplicate IDs is being removed -- the tree traversal + // will be over an updated tree not having that subtree. In all other cases, + // a match is expected. + for (Element& element : ElementTraversal::StartsAfter(scope.RootNode())) { + if (!keyMatches(key, element)) + continue; + entry->element = &element; + return &element; + } +// As get()/getElementById() can legitimately be called while handling element +// removals, allow failure iff we're in the scope of node removals. +#if DCHECK_IS_ON() + DCHECK(g_remove_scope_level); +#endif + return nullptr; +} + +Element* TreeOrderedMap::GetElementById(const AtomicString& key, + const TreeScope& scope) const { + return Get<KeyMatchesId>(key, scope); +} + +const HeapVector<Member<Element>>& TreeOrderedMap::GetAllElementsById( + const AtomicString& key, + const TreeScope& scope) const { + DCHECK(key); + DEFINE_STATIC_LOCAL(HeapVector<Member<Element>>, empty_vector, + (new HeapVector<Member<Element>>)); + + Map::iterator it = map_.find(key); + if (it == map_.end()) + return empty_vector; + + Member<MapEntry>& entry = it->value; + DCHECK(entry->count); + + if (entry->ordered_list.IsEmpty()) { + entry->ordered_list.ReserveCapacity(entry->count); + for (Element* element = + entry->element ? entry->element.Get() + : ElementTraversal::FirstWithin(scope.RootNode()); + entry->ordered_list.size() < entry->count; + element = ElementTraversal::Next(*element)) { + DCHECK(element); + if (!KeyMatchesId(key, *element)) + continue; + entry->ordered_list.UncheckedAppend(element); + } + if (!entry->element) + entry->element = entry->ordered_list.front(); + } + + return entry->ordered_list; +} + +Element* TreeOrderedMap::GetElementByMapName(const AtomicString& key, + const TreeScope& scope) const { + return Get<KeyMatchesMapName>(key, scope); +} + +// TODO(hayato): Template get<> by return type. +HTMLSlotElement* TreeOrderedMap::GetSlotByName(const AtomicString& key, + const TreeScope& scope) const { + if (Element* slot = Get<KeyMatchesSlotName>(key, scope)) { + DCHECK(isHTMLSlotElement(slot)); + return toHTMLSlotElement(slot); + } + return nullptr; +} + +Element* TreeOrderedMap::GetCachedFirstElementWithoutAccessingNodeTree( + const AtomicString& key) { + MapEntry* entry = map_.at(key); + if (!entry) + return nullptr; + DCHECK(entry->count); + return entry->element; +} + +DEFINE_TRACE(TreeOrderedMap) { + visitor->Trace(map_); +} + +DEFINE_TRACE(TreeOrderedMap::MapEntry) { + visitor->Trace(element); + visitor->Trace(ordered_list); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/TreeOrderedMap.h b/third_party/WebKit/Source/core/dom/TreeOrderedMap.h new file mode 100644 index 0000000..4e25472 --- /dev/null +++ b/third_party/WebKit/Source/core/dom/TreeOrderedMap.h
@@ -0,0 +1,127 @@ +/* + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef TreeOrderedMap_h +#define TreeOrderedMap_h + +#include "platform/heap/Handle.h" +#include "platform/wtf/Allocator.h" +#include "platform/wtf/Forward.h" +#include "platform/wtf/HashMap.h" +#include "platform/wtf/text/AtomicString.h" +#include "platform/wtf/text/AtomicStringHash.h" +#include "platform/wtf/text/StringImpl.h" + +namespace blink { + +class Element; +class HTMLSlotElement; +class TreeScope; + +class TreeOrderedMap : public GarbageCollected<TreeOrderedMap> { + public: + static TreeOrderedMap* Create(); + + void Add(const AtomicString&, Element*); + void Remove(const AtomicString&, Element*); + + bool Contains(const AtomicString&) const; + bool ContainsMultiple(const AtomicString&) const; + // concrete instantiations of the get<>() method template + Element* GetElementById(const AtomicString&, const TreeScope&) const; + const HeapVector<Member<Element>>& GetAllElementsById(const AtomicString&, + const TreeScope&) const; + Element* GetElementByMapName(const AtomicString&, const TreeScope&) const; + HTMLSlotElement* GetSlotByName(const AtomicString&, const TreeScope&) const; + // Don't use this unless the caller can know the internal state of + // TreeOrderedMap exactly. + Element* GetCachedFirstElementWithoutAccessingNodeTree(const AtomicString&); + + DECLARE_TRACE(); + +#if DCHECK_IS_ON() + // While removing a ContainerNode, ID lookups won't be precise should the tree + // have elements with duplicate IDs contained in the element being removed. + // Rare trees, but ID lookups may legitimately fail across such removals; + // this scope object informs TreeOrderedMaps about the transitory state of the + // underlying tree. + class RemoveScope { + STACK_ALLOCATED(); + + public: + RemoveScope(); + ~RemoveScope(); + }; +#else + class RemoveScope { + STACK_ALLOCATED(); + + public: + RemoveScope() {} + ~RemoveScope() {} + }; +#endif + + private: + TreeOrderedMap(); + + template <bool keyMatches(const AtomicString&, const Element&)> + Element* Get(const AtomicString&, const TreeScope&) const; + + class MapEntry : public GarbageCollected<MapEntry> { + public: + explicit MapEntry(Element* first_element) + : element(first_element), count(1) {} + + DECLARE_TRACE(); + + Member<Element> element; + unsigned count; + HeapVector<Member<Element>> ordered_list; + }; + + using Map = HeapHashMap<AtomicString, Member<MapEntry>>; + + mutable Map map_; +}; + +inline bool TreeOrderedMap::Contains(const AtomicString& id) const { + return map_.Contains(id); +} + +inline bool TreeOrderedMap::ContainsMultiple(const AtomicString& id) const { + Map::const_iterator it = map_.find(id); + return it != map_.end() && it->value->count > 1; +} + +} // namespace blink + +#endif // TreeOrderedMap_h
diff --git a/third_party/WebKit/Source/core/dom/TreeScope.cpp b/third_party/WebKit/Source/core/dom/TreeScope.cpp index 2afc197..29d1fee1 100644 --- a/third_party/WebKit/Source/core/dom/TreeScope.cpp +++ b/third_party/WebKit/Source/core/dom/TreeScope.cpp
@@ -140,7 +140,7 @@ void TreeScope::AddElementById(const AtomicString& element_id, Element* element) { if (!elements_by_id_) - elements_by_id_ = DocumentOrderedMap::Create(); + elements_by_id_ = TreeOrderedMap::Create(); elements_by_id_->Add(element_id, element); id_target_observer_registry_->NotifyObservers(element_id); } @@ -171,7 +171,7 @@ if (!name) return; if (!image_maps_by_name_) - image_maps_by_name_ = DocumentOrderedMap::Create(); + image_maps_by_name_ = TreeOrderedMap::Create(); image_maps_by_name_->Add(name, image_map); }
diff --git a/third_party/WebKit/Source/core/dom/TreeScope.h b/third_party/WebKit/Source/core/dom/TreeScope.h index 85afcab5..86d0a02 100644 --- a/third_party/WebKit/Source/core/dom/TreeScope.h +++ b/third_party/WebKit/Source/core/dom/TreeScope.h
@@ -28,7 +28,7 @@ #define TreeScope_h #include "core/CoreExport.h" -#include "core/dom/DocumentOrderedMap.h" +#include "core/dom/TreeOrderedMap.h" #include "core/html/forms/RadioButtonGroupScope.h" #include "core/layout/HitTestRequest.h" #include "platform/heap/Handle.h" @@ -145,8 +145,8 @@ Member<Document> document_; Member<TreeScope> parent_tree_scope_; - Member<DocumentOrderedMap> elements_by_id_; - Member<DocumentOrderedMap> image_maps_by_name_; + Member<TreeOrderedMap> elements_by_id_; + Member<TreeOrderedMap> image_maps_by_name_; Member<IdTargetObserverRegistry> id_target_observer_registry_;
diff --git a/third_party/WebKit/Source/core/dom/TreeScopeStyleSheetCollection.h b/third_party/WebKit/Source/core/dom/TreeScopeStyleSheetCollection.h index 59c7776..fb23067 100644 --- a/third_party/WebKit/Source/core/dom/TreeScopeStyleSheetCollection.h +++ b/third_party/WebKit/Source/core/dom/TreeScopeStyleSheetCollection.h
@@ -31,8 +31,8 @@ #define TreeScopeStyleSheetCollection_h #include "core/CoreExport.h" -#include "core/dom/DocumentOrderedList.h" #include "core/dom/StyleSheetCollection.h" +#include "core/dom/TreeOrderedList.h" #include "core/dom/TreeScope.h" namespace blink { @@ -67,7 +67,7 @@ void ApplyActiveStyleSheetChanges(StyleSheetCollection&); Member<TreeScope> tree_scope_; - DocumentOrderedList style_sheet_candidate_nodes_; + TreeOrderedList style_sheet_candidate_nodes_; private: friend class TreeScopeStyleSheetCollectionTest;
diff --git a/third_party/WebKit/Source/core/dom/V0InsertionPoint.cpp b/third_party/WebKit/Source/core/dom/V0InsertionPoint.cpp new file mode 100644 index 0000000..52f31c6 --- /dev/null +++ b/third_party/WebKit/Source/core/dom/V0InsertionPoint.cpp
@@ -0,0 +1,322 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "core/dom/V0InsertionPoint.h" + +#include "core/HTMLNames.h" +#include "core/dom/ElementShadow.h" +#include "core/dom/ElementShadowV0.h" +#include "core/dom/ElementTraversal.h" +#include "core/dom/QualifiedName.h" +#include "core/dom/StaticNodeList.h" +#include "core/dom/StyleChangeReason.h" +#include "core/dom/WhitespaceAttacher.h" + +namespace blink { + +using namespace HTMLNames; + +V0InsertionPoint::V0InsertionPoint(const QualifiedName& tag_name, + Document& document) + : HTMLElement(tag_name, document, kCreateV0InsertionPoint), + registered_with_shadow_root_(false) { + SetHasCustomStyleCallbacks(); +} + +V0InsertionPoint::~V0InsertionPoint() {} + +void V0InsertionPoint::SetDistributedNodes( + DistributedNodes& distributed_nodes) { + // Attempt not to reattach nodes that would be distributed to the exact same + // location by comparing the old and new distributions. + + size_t i = 0; + size_t j = 0; + + for (; i < distributed_nodes_.size() && j < distributed_nodes.size(); + ++i, ++j) { + if (distributed_nodes_.size() < distributed_nodes.size()) { + // If the new distribution is larger than the old one, reattach all nodes + // in the new distribution that were inserted. + for (; j < distributed_nodes.size() && + distributed_nodes_.at(i) != distributed_nodes.at(j); + ++j) + distributed_nodes.at(j)->LazyReattachIfAttached(); + if (j == distributed_nodes.size()) + break; + } else if (distributed_nodes_.size() > distributed_nodes.size()) { + // If the old distribution is larger than the new one, reattach all nodes + // in the old distribution that were removed. + for (; i < distributed_nodes_.size() && + distributed_nodes_.at(i) != distributed_nodes.at(j); + ++i) + distributed_nodes_.at(i)->LazyReattachIfAttached(); + if (i == distributed_nodes_.size()) + break; + } else if (distributed_nodes_.at(i) != distributed_nodes.at(j)) { + // If both distributions are the same length reattach both old and new. + distributed_nodes_.at(i)->LazyReattachIfAttached(); + distributed_nodes.at(j)->LazyReattachIfAttached(); + } + } + + // If we hit the end of either list above we need to reattach all remaining + // nodes. + + for (; i < distributed_nodes_.size(); ++i) + distributed_nodes_.at(i)->LazyReattachIfAttached(); + + for (; j < distributed_nodes.size(); ++j) + distributed_nodes.at(j)->LazyReattachIfAttached(); + + distributed_nodes_.Swap(distributed_nodes); + // Deallocate a Vector and a HashMap explicitly so that + // Oilpan can recycle them without an intervening GC. + distributed_nodes.Clear(); + distributed_nodes_.ShrinkToFit(); +} + +void V0InsertionPoint::AttachLayoutTree(AttachContext& context) { + // We need to attach the distribution here so that they're inserted in the + // right order otherwise the n^2 protection inside LayoutTreeBuilder will + // cause them to be inserted in the wrong place later. This also lets + // distributed nodes benefit from the n^2 protection. + AttachContext children_context(context); + children_context.resolved_style = nullptr; + + for (size_t i = 0; i < distributed_nodes_.size(); ++i) { + Node* child = distributed_nodes_.at(i); + if (child->NeedsAttach()) + child->AttachLayoutTree(children_context); + } + if (children_context.previous_in_flow) + context.previous_in_flow = children_context.previous_in_flow; + + HTMLElement::AttachLayoutTree(context); +} + +void V0InsertionPoint::DetachLayoutTree(const AttachContext& context) { + for (size_t i = 0; i < distributed_nodes_.size(); ++i) + distributed_nodes_.at(i)->LazyReattachIfAttached(); + + HTMLElement::DetachLayoutTree(context); +} + +void V0InsertionPoint::RebuildDistributedChildrenLayoutTrees( + WhitespaceAttacher& whitespace_attacher) { + // This loop traverses the nodes from right to left for the same reason as the + // one described in ContainerNode::RebuildChildrenLayoutTrees(). + for (size_t i = distributed_nodes_.size(); i > 0; --i) { + RebuildLayoutTreeForChild(distributed_nodes_.at(i - 1), + whitespace_attacher); + } +} + +void V0InsertionPoint::WillRecalcStyle(StyleRecalcChange change) { + StyleChangeType style_change_type = kNoStyleChange; + + if (change > kInherit || GetStyleChangeType() > kLocalStyleChange) + style_change_type = kSubtreeStyleChange; + else if (change > kNoInherit) + style_change_type = kLocalStyleChange; + else + return; + + for (size_t i = 0; i < distributed_nodes_.size(); ++i) { + distributed_nodes_.at(i)->SetNeedsStyleRecalc( + style_change_type, + StyleChangeReasonForTracing::Create( + StyleChangeReason::kPropagateInheritChangeToDistributedNodes)); + } +} + +bool V0InsertionPoint::CanBeActive() const { + ShadowRoot* shadow_root = ContainingShadowRoot(); + if (!shadow_root) + return false; + if (shadow_root->IsV1()) + return false; + return !Traversal<V0InsertionPoint>::FirstAncestor(*this); +} + +bool V0InsertionPoint::IsActive() const { + if (!CanBeActive()) + return false; + ShadowRoot* shadow_root = ContainingShadowRoot(); + DCHECK(shadow_root); + if (!isHTMLShadowElement(*this) || + shadow_root->DescendantShadowElementCount() <= 1) + return true; + + // Slow path only when there are more than one shadow elements in a shadow + // tree. That should be a rare case. + for (const auto& point : shadow_root->DescendantInsertionPoints()) { + if (isHTMLShadowElement(*point)) + return point == this; + } + return true; +} + +bool V0InsertionPoint::IsShadowInsertionPoint() const { + return isHTMLShadowElement(*this) && IsActive(); +} + +bool V0InsertionPoint::IsContentInsertionPoint() const { + return isHTMLContentElement(*this) && IsActive(); +} + +StaticNodeList* V0InsertionPoint::getDistributedNodes() { + UpdateDistribution(); + + HeapVector<Member<Node>> nodes; + nodes.ReserveInitialCapacity(distributed_nodes_.size()); + for (size_t i = 0; i < distributed_nodes_.size(); ++i) + nodes.UncheckedAppend(distributed_nodes_.at(i)); + + return StaticNodeList::Adopt(nodes); +} + +bool V0InsertionPoint::LayoutObjectIsNeeded(const ComputedStyle& style) { + return !IsActive() && HTMLElement::LayoutObjectIsNeeded(style); +} + +void V0InsertionPoint::ChildrenChanged(const ChildrenChange& change) { + HTMLElement::ChildrenChanged(change); + if (ShadowRoot* root = ContainingShadowRoot()) { + if (ElementShadow* root_owner = root->Owner()) + root_owner->SetNeedsDistributionRecalc(); + } +} + +Node::InsertionNotificationRequest V0InsertionPoint::InsertedInto( + ContainerNode* insertion_point) { + HTMLElement::InsertedInto(insertion_point); + if (ShadowRoot* root = ContainingShadowRoot()) { + if (!root->IsV1()) { + if (ElementShadow* root_owner = root->Owner()) { + root_owner->SetNeedsDistributionRecalc(); + if (CanBeActive() && !registered_with_shadow_root_ && + insertion_point->GetTreeScope().RootNode() == root) { + registered_with_shadow_root_ = true; + root->DidAddInsertionPoint(this); + if (CanAffectSelector()) + root_owner->V0().WillAffectSelector(); + } + } + } + } + + // We could have been distributed into in a detached subtree, make sure to + // clear the distribution when inserted again to avoid cycles. + ClearDistribution(); + + return kInsertionDone; +} + +void V0InsertionPoint::RemovedFrom(ContainerNode* insertion_point) { + ShadowRoot* root = ContainingShadowRoot(); + if (!root) + root = insertion_point->ContainingShadowRoot(); + + if (root) { + if (ElementShadow* root_owner = root->Owner()) + root_owner->SetNeedsDistributionRecalc(); + } + + // host can be null when removedFrom() is called from ElementShadow + // destructor. + ElementShadow* root_owner = root ? root->Owner() : 0; + + // Since this insertion point is no longer visible from the shadow subtree, it + // need to clean itself up. + ClearDistribution(); + + if (registered_with_shadow_root_ && + insertion_point->GetTreeScope().RootNode() == root) { + DCHECK(root); + registered_with_shadow_root_ = false; + root->DidRemoveInsertionPoint(this); + if (!root->IsV1() && root_owner) { + if (CanAffectSelector()) + root_owner->V0().WillAffectSelector(); + } + } + + HTMLElement::RemovedFrom(insertion_point); +} + +DEFINE_TRACE(V0InsertionPoint) { + visitor->Trace(distributed_nodes_); + HTMLElement::Trace(visitor); +} + +const V0InsertionPoint* ResolveReprojection(const Node* projected_node) { + DCHECK(projected_node); + const V0InsertionPoint* insertion_point = 0; + const Node* current = projected_node; + ElementShadow* last_element_shadow = 0; + while (true) { + ElementShadow* shadow = ShadowWhereNodeCanBeDistributedForV0(*current); + if (!shadow || shadow->IsV1() || shadow == last_element_shadow) + break; + last_element_shadow = shadow; + const V0InsertionPoint* inserted_to = + shadow->V0().FinalDestinationInsertionPointFor(projected_node); + if (!inserted_to) + break; + DCHECK_NE(current, inserted_to); + current = inserted_to; + insertion_point = inserted_to; + } + return insertion_point; +} + +void CollectDestinationInsertionPoints( + const Node& node, + HeapVector<Member<V0InsertionPoint>, 8>& results) { + const Node* current = &node; + ElementShadow* last_element_shadow = 0; + while (true) { + ElementShadow* shadow = ShadowWhereNodeCanBeDistributedForV0(*current); + if (!shadow || shadow->IsV1() || shadow == last_element_shadow) + return; + last_element_shadow = shadow; + const DestinationInsertionPoints* insertion_points = + shadow->V0().DestinationInsertionPointsFor(&node); + if (!insertion_points) + return; + for (size_t i = 0; i < insertion_points->size(); ++i) + results.push_back(insertion_points->at(i).Get()); + DCHECK_NE(current, insertion_points->back().Get()); + current = insertion_points->back().Get(); + } +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/V0InsertionPoint.h b/third_party/WebKit/Source/core/dom/V0InsertionPoint.h new file mode 100644 index 0000000..097c83a33 --- /dev/null +++ b/third_party/WebKit/Source/core/dom/V0InsertionPoint.h
@@ -0,0 +1,132 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef V0InsertionPoint_h +#define V0InsertionPoint_h + +#include "core/CoreExport.h" +#include "core/css/CSSSelectorList.h" +#include "core/dom/DistributedNodes.h" +#include "core/dom/ShadowRoot.h" +#include "core/html/HTMLElement.h" + +namespace blink { + +class CORE_EXPORT V0InsertionPoint : public HTMLElement { + public: + ~V0InsertionPoint() override; + + bool HasDistribution() const { return !distributed_nodes_.IsEmpty(); } + void SetDistributedNodes(DistributedNodes&); + void ClearDistribution() { distributed_nodes_.Clear(); } + bool IsActive() const; + bool CanBeActive() const; + + bool IsShadowInsertionPoint() const; + bool IsContentInsertionPoint() const; + + StaticNodeList* getDistributedNodes(); + + virtual bool CanAffectSelector() const { return false; } + + void AttachLayoutTree(AttachContext&) override; + void DetachLayoutTree(const AttachContext& = AttachContext()) override; + void RebuildDistributedChildrenLayoutTrees(WhitespaceAttacher&); + + size_t DistributedNodesSize() const { return distributed_nodes_.size(); } + Node* DistributedNodeAt(size_t index) const { + return distributed_nodes_.at(index); + } + Node* FirstDistributedNode() const { + return distributed_nodes_.IsEmpty() ? 0 : distributed_nodes_.First(); + } + Node* LastDistributedNode() const { + return distributed_nodes_.IsEmpty() ? 0 : distributed_nodes_.Last(); + } + Node* DistributedNodeNextTo(const Node* node) const { + return distributed_nodes_.NextTo(node); + } + Node* DistributedNodePreviousTo(const Node* node) const { + return distributed_nodes_.PreviousTo(node); + } + + DECLARE_VIRTUAL_TRACE(); + + protected: + V0InsertionPoint(const QualifiedName&, Document&); + bool LayoutObjectIsNeeded(const ComputedStyle&) override; + void ChildrenChanged(const ChildrenChange&) override; + InsertionNotificationRequest InsertedInto(ContainerNode*) override; + void RemovedFrom(ContainerNode*) override; + void WillRecalcStyle(StyleRecalcChange) override; + + private: + bool IsV0InsertionPoint() const = + delete; // This will catch anyone doing an unnecessary check. + + DistributedNodes distributed_nodes_; + bool registered_with_shadow_root_; +}; + +typedef HeapVector<Member<V0InsertionPoint>, 1> DestinationInsertionPoints; + +DEFINE_ELEMENT_TYPE_CASTS(V0InsertionPoint, IsV0InsertionPoint()); + +inline bool IsActiveV0InsertionPoint(const Node& node) { + return node.IsV0InsertionPoint() && ToV0InsertionPoint(node).IsActive(); +} + +inline bool IsActiveShadowInsertionPoint(const Node& node) { + return node.IsV0InsertionPoint() && + ToV0InsertionPoint(node).IsShadowInsertionPoint(); +} + +inline ElementShadow* ShadowWhereNodeCanBeDistributedForV0(const Node& node) { + Node* parent = node.parentNode(); + if (!parent) + return nullptr; + if (parent->IsShadowRoot() && !ToShadowRoot(parent)->IsYoungest()) + return node.OwnerShadowHost()->Shadow(); + if (IsActiveV0InsertionPoint(*parent)) + return node.OwnerShadowHost()->Shadow(); + if (parent->IsElementNode()) + return ToElement(parent)->Shadow(); + return nullptr; +} + +const V0InsertionPoint* ResolveReprojection(const Node*); + +void CollectDestinationInsertionPoints( + const Node&, + HeapVector<Member<V0InsertionPoint>, 8>& results); + +} // namespace blink + +#endif // V0InsertionPoint_h
diff --git a/third_party/WebKit/Source/core/dom/WhitespaceAttacher.cpp b/third_party/WebKit/Source/core/dom/WhitespaceAttacher.cpp new file mode 100644 index 0000000..922259c --- /dev/null +++ b/third_party/WebKit/Source/core/dom/WhitespaceAttacher.cpp
@@ -0,0 +1,178 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/dom/WhitespaceAttacher.h" + +#include "core/dom/Element.h" +#include "core/dom/Text.h" +#include "core/layout/LayoutText.h" +#include "platform/ScriptForbiddenScope.h" + +namespace blink { + +WhitespaceAttacher::~WhitespaceAttacher() { + if (last_text_node_ && last_text_node_needs_reattach_) + ReattachWhitespaceSiblings(nullptr); +} + +void WhitespaceAttacher::DidReattach(Node* node, LayoutObject* prev_in_flow) { + DCHECK(node); + DCHECK(node->IsTextNode() || node->IsElementNode()); + // See Invariants in WhitespaceAttacher.h + DCHECK(!last_display_contents_ || !last_text_node_needs_reattach_); + + ForceLastTextNodeNeedsReattach(); + + // No subsequent text nodes affected. + if (!last_text_node_) + return; + + LayoutObject* layout_object = node->GetLayoutObject(); + if (!layout_object) + layout_object = prev_in_flow; + + // Only in-flow boxes affect subsequent whitespace. + if (layout_object && !layout_object->IsFloatingOrOutOfFlowPositioned()) + ReattachWhitespaceSiblings(layout_object); +} + +void WhitespaceAttacher::DidReattachText(Text* text) { + DCHECK(text); + DidReattach(text, text->GetLayoutObject()); + SetLastTextNode(text); + if (!text->GetLayoutObject()) + last_text_node_needs_reattach_ = true; +} + +void WhitespaceAttacher::DidReattachElement(Element* element, + LayoutObject* prev_in_flow) { + DCHECK(element); + DidReattach(element, prev_in_flow); +} + +void WhitespaceAttacher::DidVisitText(Text* text) { + DCHECK(text); + if (!last_text_node_ || !last_text_node_needs_reattach_) { + SetLastTextNode(text); + return; + } + // At this point we have a last_text_node_ which needs re-attachment. + // If last_text_node_needs_reattach_ is true, we traverse into + // display:contents elements to find the first preceding in-flow sibling, at + // which point we do the re-attachment (covered by LastTextNodeNeedsReattach() + // check in Element::NeedsRebuildLayoutTree()). DidVisitElement() below + // returns early for display:contents when last_text_node_needs_reattach_ is + // non-null. + DCHECK(!last_display_contents_); + if (LayoutObject* text_layout_object = text->GetLayoutObject()) { + ReattachWhitespaceSiblings(text_layout_object); + } else { + if (last_text_node_->ContainsOnlyWhitespace()) + last_text_node_->ReattachLayoutTreeIfNeeded(Node::AttachContext()); + } + SetLastTextNode(text); +} + +void WhitespaceAttacher::DidVisitElement(Element* element) { + DCHECK(element); + LayoutObject* layout_object = element->GetLayoutObject(); + if (!layout_object) { + // Don't set last_display_contents_ when we have a text node which needs to + // be re-attached. See the comments in DidVisitText() above. + if (last_text_node_needs_reattach_) + return; + if (element->HasDisplayContentsStyle()) + last_display_contents_ = element; + return; + } + if (!last_text_node_ || !last_text_node_needs_reattach_) { + SetLastTextNode(nullptr); + return; + } + if (layout_object->IsFloatingOrOutOfFlowPositioned()) + return; + ReattachWhitespaceSiblings(layout_object); +} + +void WhitespaceAttacher::ReattachWhitespaceSiblings( + LayoutObject* previous_in_flow) { + DCHECK(!last_display_contents_); + DCHECK(last_text_node_); + DCHECK(last_text_node_needs_reattach_); + ScriptForbiddenScope forbid_script; + + Node::AttachContext context; + context.previous_in_flow = previous_in_flow; + context.use_previous_in_flow = true; + + for (Node* sibling = last_text_node_; sibling; + sibling = LayoutTreeBuilderTraversal::NextLayoutSibling(*sibling)) { + LayoutObject* sibling_layout_object = sibling->GetLayoutObject(); + if (sibling->IsTextNode() && ToText(sibling)->ContainsOnlyWhitespace()) { + bool had_layout_object = !!sibling_layout_object; + ToText(sibling)->ReattachLayoutTreeIfNeeded(context); + sibling_layout_object = sibling->GetLayoutObject(); + // If sibling's layout object status didn't change we don't need to + // continue checking other siblings since their layout object status + // won't change either. + if (!!sibling_layout_object == had_layout_object) + break; + if (sibling_layout_object) + context.previous_in_flow = sibling_layout_object; + } else if (sibling_layout_object && + !sibling_layout_object->IsFloatingOrOutOfFlowPositioned()) { + break; + } + } + SetLastTextNode(nullptr); +} + +void WhitespaceAttacher::ForceLastTextNodeNeedsReattach() { + // If an element got re-attached, the need for a subsequent whitespace node + // LayoutObject may have changed. Make sure we try a re-attach when we + // encounter the next in-flow. + if (last_text_node_needs_reattach_) + return; + if (last_display_contents_) + UpdateLastTextNodeFromDisplayContents(); + if (last_text_node_) + last_text_node_needs_reattach_ = true; +} + +void WhitespaceAttacher::UpdateLastTextNodeFromDisplayContents() { + DCHECK(last_display_contents_); + DCHECK(last_display_contents_->HasDisplayContentsStyle()); + Element* contents_element = last_display_contents_.Release(); + Node* sibling = + LayoutTreeBuilderTraversal::FirstLayoutChild(*contents_element); + + if (!sibling) + sibling = LayoutTreeBuilderTraversal::NextLayoutSibling(*contents_element); + + if (!sibling) { + DCHECK(!last_text_node_); + return; + } + + DCHECK(!sibling->IsElementNode() || + !ToElement(sibling)->HasDisplayContentsStyle()); + + for (; sibling && sibling != last_text_node_; + sibling = LayoutTreeBuilderTraversal::NextLayoutSibling(*sibling)) { + LayoutObject* layout_object = sibling->GetLayoutObject(); + if (sibling->IsTextNode()) { + Text* text = ToText(sibling); + if (text->ContainsOnlyWhitespace()) { + last_text_node_ = text; + return; + } + } + if (layout_object && !layout_object->IsFloatingOrOutOfFlowPositioned()) { + last_text_node_ = nullptr; + break; + } + } +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/WhitespaceAttacher.h b/third_party/WebKit/Source/core/dom/WhitespaceAttacher.h new file mode 100644 index 0000000..93e7f17 --- /dev/null +++ b/third_party/WebKit/Source/core/dom/WhitespaceAttacher.h
@@ -0,0 +1,88 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WhitespaceAttacher_h +#define WhitespaceAttacher_h + +#include "core/CoreExport.h" +#include "platform/heap/Member.h" + +namespace blink { + +class Element; +class LayoutObject; +class Text; + +// The WhitespaceAttacher is used during the layout tree rebuild to lazily re- +// attach whitespace LayoutObjects when necessary. For more details about white- +// space LayoutObjects, see the WhitespaceLayoutObjects.md file in this +// directory. +// TODO(rune@opera.com): Update WhitespaceLayoutObjects.md documentation. +// +// As RebuildLayoutTree walks from last to first child, we track the last text +// node, or the last skipped display:contents element we have seen. These are +// reset to null as soon as we encounter an in-flow element. +// +// If the tracked text node needed a (re-)attach, we call +// ReattachWhitespaceSiblings once we visit or re-attach the first preceding +// in-flow. +// +// If we re-attach a preceding in-flow, we also call ReattachWhitespaceSiblings +// since the need for a succeeding whitespace LayoutObject may change. + +class CORE_EXPORT WhitespaceAttacher { + STACK_ALLOCATED(); + + public: + WhitespaceAttacher() {} + ~WhitespaceAttacher(); + + void DidVisitText(Text*); + void DidReattachText(Text*); + void DidVisitElement(Element*); + void DidReattachElement(Element*, LayoutObject*); + bool LastTextNodeNeedsReattach() const { + return last_text_node_needs_reattach_; + } + + private: + void DidReattach(Node*, LayoutObject*); + void ReattachWhitespaceSiblings(LayoutObject* previous_in_flow); + void ForceLastTextNodeNeedsReattach(); + void UpdateLastTextNodeFromDisplayContents(); + + void SetLastTextNode(Text* text) { + last_display_contents_ = nullptr; + last_text_node_ = text; + if (!text) + last_text_node_needs_reattach_ = false; + } + + // If we encounter a display:contents, without traversing its flat tree + // children during layout tree rebuild, we store that element and start + // traversing it for text nodes as needed if we re-attach a preceding node + // without encountering a text node or an in-flow element first. + // + // If there is already a text node which needs re-attachment, we traverse into + // the display:contents element instead as we need to find the last in-flow + // descendant of that subtree which is used to check if the re-attached text + // node needs a LayoutText or not. + // + // Invariants: + // DCHECK(!last_display_contents_ || !last_text_node_needs_reattach_) + // DCHECK(last_text_node_ || !last_text_node_needs_reattach_) + Member<Element> last_display_contents_ = nullptr; + + // The last text node we've visited during rebuild for this attacher. + Member<Text> last_text_node_ = nullptr; + + // Set to true if we need to re-attach last_text_node_ when: + // 1. We visiting a previous in-flow sibling, or + // 2. We get to the start of the sibling list during the rebuild. + bool last_text_node_needs_reattach_ = false; +}; + +} // namespace blink + +#endif // WhitespaceAttacher_h
diff --git a/third_party/WebKit/Source/core/dom/WhitespaceAttacherTest.cpp b/third_party/WebKit/Source/core/dom/WhitespaceAttacherTest.cpp new file mode 100644 index 0000000..051fcb5 --- /dev/null +++ b/third_party/WebKit/Source/core/dom/WhitespaceAttacherTest.cpp
@@ -0,0 +1,451 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/dom/WhitespaceAttacher.h" + +#include <gtest/gtest.h> +#include "bindings/core/v8/V8BindingForCore.h" +#include "core/dom/NodeComputedStyle.h" +#include "core/dom/ShadowRoot.h" +#include "core/dom/ShadowRootInit.h" +#include "core/layout/LayoutText.h" +#include "core/testing/DummyPageHolder.h" + +namespace blink { + +class WhitespaceAttacherTest : public ::testing::Test { + protected: + void SetUp() override { + dummy_page_holder_ = DummyPageHolder::Create(IntSize(800, 600)); + } + Document& GetDocument() { return dummy_page_holder_->GetDocument(); } + ShadowRoot& AttachShadow(Element& host); + + private: + std::unique_ptr<DummyPageHolder> dummy_page_holder_; +}; + +ShadowRoot& WhitespaceAttacherTest::AttachShadow(Element& host) { + ShadowRootInit init; + init.setMode("open"); + ShadowRoot* shadow_root = + host.attachShadow(ToScriptStateForMainWorld(GetDocument().GetFrame()), + init, ASSERT_NO_EXCEPTION); + EXPECT_TRUE(shadow_root); + return *shadow_root; +} + +TEST_F(WhitespaceAttacherTest, WhitespaceAfterReattachedBlock) { + GetDocument().body()->setInnerHTML("<div id=block></div> "); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* div = GetDocument().getElementById("block"); + Text* text = ToText(div->nextSibling()); + EXPECT_FALSE(text->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + // Force LayoutText to see that the reattach works. + text->SetLayoutObject( + text->CreateTextLayoutObject(GetDocument().body()->ComputedStyleRef())); + + WhitespaceAttacher attacher; + attacher.DidVisitText(text); + attacher.DidReattachElement(div, div->GetLayoutObject()); + EXPECT_FALSE(text->GetLayoutObject()); +} + +TEST_F(WhitespaceAttacherTest, WhitespaceAfterReattachedInline) { + GetDocument().body()->setInnerHTML("<span id=inline></span> "); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* span = GetDocument().getElementById("inline"); + Text* text = ToText(span->nextSibling()); + EXPECT_TRUE(text->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + // Clear LayoutText to see that the reattach works. + text->SetLayoutObject(nullptr); + + WhitespaceAttacher attacher; + attacher.DidVisitText(text); + attacher.DidReattachElement(span, span->GetLayoutObject()); + EXPECT_TRUE(text->GetLayoutObject()); +} + +TEST_F(WhitespaceAttacherTest, WhitespaceAfterReattachedWhitespace) { + GetDocument().body()->setInnerHTML("<span id=inline></span> <!-- --> "); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* span = GetDocument().getElementById("inline"); + Text* first_whitespace = ToText(span->nextSibling()); + Text* second_whitespace = + ToText(first_whitespace->nextSibling()->nextSibling()); + EXPECT_TRUE(first_whitespace->GetLayoutObject()); + EXPECT_FALSE(second_whitespace->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + // Force LayoutText on the second whitespace to see that the reattach works. + second_whitespace->SetLayoutObject(second_whitespace->CreateTextLayoutObject( + GetDocument().body()->ComputedStyleRef())); + + WhitespaceAttacher attacher; + attacher.DidVisitText(second_whitespace); + EXPECT_TRUE(second_whitespace->GetLayoutObject()); + + attacher.DidReattachText(first_whitespace); + EXPECT_TRUE(first_whitespace->GetLayoutObject()); + EXPECT_FALSE(second_whitespace->GetLayoutObject()); +} + +TEST_F(WhitespaceAttacherTest, VisitBlockAfterReattachedWhitespace) { + GetDocument().body()->setInnerHTML("<div id=block></div> "); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* div = GetDocument().getElementById("block"); + Text* text = ToText(div->nextSibling()); + EXPECT_FALSE(text->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + WhitespaceAttacher attacher; + attacher.DidReattachText(text); + EXPECT_FALSE(text->GetLayoutObject()); + + attacher.DidVisitElement(div); + EXPECT_FALSE(text->GetLayoutObject()); +} + +TEST_F(WhitespaceAttacherTest, VisitInlineAfterReattachedWhitespace) { + GetDocument().body()->setInnerHTML("<span id=inline></span> "); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* span = GetDocument().getElementById("inline"); + Text* text = ToText(span->nextSibling()); + EXPECT_TRUE(text->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + // Clear LayoutText to see that the reattach works. + text->SetLayoutObject(nullptr); + + WhitespaceAttacher attacher; + attacher.DidReattachText(text); + EXPECT_FALSE(text->GetLayoutObject()); + + attacher.DidVisitElement(span); + EXPECT_TRUE(text->GetLayoutObject()); +} + +TEST_F(WhitespaceAttacherTest, VisitTextAfterReattachedWhitespace) { + GetDocument().body()->setInnerHTML("Text<!-- --> "); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Text* text = ToText(GetDocument().body()->firstChild()); + Text* whitespace = ToText(text->nextSibling()->nextSibling()); + EXPECT_TRUE(text->GetLayoutObject()); + EXPECT_TRUE(whitespace->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + // Clear LayoutText to see that the reattach works. + whitespace->SetLayoutObject(nullptr); + + WhitespaceAttacher attacher; + attacher.DidReattachText(whitespace); + EXPECT_FALSE(whitespace->GetLayoutObject()); + + attacher.DidVisitText(text); + EXPECT_TRUE(text->GetLayoutObject()); + EXPECT_TRUE(whitespace->GetLayoutObject()); +} + +TEST_F(WhitespaceAttacherTest, ReattachWhitespaceInsideBlockExitingScope) { + GetDocument().body()->setInnerHTML("<div id=block> </div>"); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* div = GetDocument().getElementById("block"); + Text* text = ToText(div->firstChild()); + EXPECT_FALSE(text->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + { + WhitespaceAttacher attacher; + attacher.DidReattachText(text); + EXPECT_FALSE(text->GetLayoutObject()); + + // Force LayoutText to see that the reattach works. + text->SetLayoutObject( + text->CreateTextLayoutObject(div->ComputedStyleRef())); + } + EXPECT_FALSE(text->GetLayoutObject()); +} + +TEST_F(WhitespaceAttacherTest, ReattachWhitespaceInsideInlineExitingScope) { + GetDocument().body()->setInnerHTML("<span id=inline> </span>"); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* span = GetDocument().getElementById("inline"); + Text* text = ToText(span->firstChild()); + EXPECT_TRUE(text->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + // Clear LayoutText to see that the reattach works. + text->SetLayoutObject(nullptr); + + { + WhitespaceAttacher attacher; + attacher.DidReattachText(text); + EXPECT_FALSE(text->GetLayoutObject()); + } + EXPECT_TRUE(text->GetLayoutObject()); +} + +TEST_F(WhitespaceAttacherTest, SlottedWhitespaceAfterReattachedBlock) { + GetDocument().body()->setInnerHTML("<div id=host> </div>"); + Element* host = GetDocument().getElementById("host"); + ASSERT_TRUE(host); + + ShadowRoot& shadow_root = AttachShadow(*host); + shadow_root.setInnerHTML("<div id=block></div><slot></slot>"); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* div = shadow_root.getElementById("block"); + Text* text = ToText(host->firstChild()); + EXPECT_FALSE(text->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + // Force LayoutText to see that the reattach works. + text->SetLayoutObject(text->CreateTextLayoutObject(host->ComputedStyleRef())); + + WhitespaceAttacher attacher; + attacher.DidVisitText(text); + EXPECT_TRUE(text->GetLayoutObject()); + + attacher.DidReattachElement(div, div->GetLayoutObject()); + EXPECT_FALSE(text->GetLayoutObject()); +} + +TEST_F(WhitespaceAttacherTest, SlottedWhitespaceAfterReattachedInline) { + GetDocument().body()->setInnerHTML("<div id=host> </div>"); + Element* host = GetDocument().getElementById("host"); + ASSERT_TRUE(host); + + ShadowRoot& shadow_root = AttachShadow(*host); + shadow_root.setInnerHTML("<span id=inline></span><slot></slot>"); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* span = shadow_root.getElementById("inline"); + Text* text = ToText(host->firstChild()); + EXPECT_TRUE(text->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + // Clear LayoutText to see that the reattach works. + text->SetLayoutObject(nullptr); + + WhitespaceAttacher attacher; + attacher.DidVisitText(text); + EXPECT_FALSE(text->GetLayoutObject()); + + attacher.DidReattachElement(span, span->GetLayoutObject()); + EXPECT_TRUE(text->GetLayoutObject()); +} + +TEST_F(WhitespaceAttacherTest, + WhitespaceInDisplayContentsAfterReattachedBlock) { + GetDocument().body()->setInnerHTML( + "<div id=block></div><span style='display:contents'> </span>"); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* div = GetDocument().getElementById("block"); + Element* contents = ToElement(div->nextSibling()); + Text* text = ToText(contents->firstChild()); + EXPECT_FALSE(contents->GetLayoutObject()); + EXPECT_FALSE(text->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + // Force LayoutText to see that the reattach works. + text->SetLayoutObject( + text->CreateTextLayoutObject(contents->ComputedStyleRef())); + + WhitespaceAttacher attacher; + attacher.DidVisitElement(contents); + EXPECT_TRUE(text->GetLayoutObject()); + + attacher.DidReattachElement(div, div->GetLayoutObject()); + EXPECT_FALSE(text->GetLayoutObject()); +} + +TEST_F(WhitespaceAttacherTest, + WhitespaceInDisplayContentsAfterReattachedInline) { + GetDocument().body()->setInnerHTML( + "<span id=inline></span><span style='display:contents'> </span>"); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* span = GetDocument().getElementById("inline"); + Element* contents = ToElement(span->nextSibling()); + Text* text = ToText(contents->firstChild()); + EXPECT_FALSE(contents->GetLayoutObject()); + EXPECT_TRUE(text->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + // Clear LayoutText to see that the reattach works. + text->SetLayoutObject(nullptr); + + WhitespaceAttacher attacher; + attacher.DidVisitElement(contents); + EXPECT_FALSE(text->GetLayoutObject()); + + attacher.DidReattachElement(span, span->GetLayoutObject()); + EXPECT_TRUE(text->GetLayoutObject()); +} + +TEST_F(WhitespaceAttacherTest, + WhitespaceAfterEmptyDisplayContentsAfterReattachedBlock) { + GetDocument().body()->setInnerHTML( + "<div id=block></div><span style='display:contents'></span> "); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* div = GetDocument().getElementById("block"); + Element* contents = ToElement(div->nextSibling()); + Text* text = ToText(contents->nextSibling()); + EXPECT_FALSE(contents->GetLayoutObject()); + EXPECT_FALSE(text->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + // Force LayoutText to see that the reattach works. + text->SetLayoutObject( + text->CreateTextLayoutObject(contents->ComputedStyleRef())); + + WhitespaceAttacher attacher; + attacher.DidVisitText(text); + attacher.DidVisitElement(contents); + EXPECT_TRUE(text->GetLayoutObject()); + + attacher.DidReattachElement(div, div->GetLayoutObject()); + EXPECT_FALSE(text->GetLayoutObject()); +} + +TEST_F(WhitespaceAttacherTest, + WhitespaceAfterDisplayContentsWithDisplayNoneChildAfterReattachedBlock) { + GetDocument().body()->setInnerHTML( + "<div id=block></div><span style='display:contents'>" + "<span style='display:none'></span></span> "); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* div = GetDocument().getElementById("block"); + Element* contents = ToElement(div->nextSibling()); + Text* text = ToText(contents->nextSibling()); + EXPECT_FALSE(contents->GetLayoutObject()); + EXPECT_FALSE(text->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + // Force LayoutText to see that the reattach works. + text->SetLayoutObject( + text->CreateTextLayoutObject(contents->ComputedStyleRef())); + + WhitespaceAttacher attacher; + attacher.DidVisitText(text); + attacher.DidVisitElement(contents); + EXPECT_TRUE(text->GetLayoutObject()); + + attacher.DidReattachElement(div, div->GetLayoutObject()); + EXPECT_FALSE(text->GetLayoutObject()); +} + +TEST_F(WhitespaceAttacherTest, WhitespaceDeepInsideDisplayContents) { + GetDocument().body()->setInnerHTML( + "<span id=inline></span><span style='display:contents'>" + "<span style='display:none'></span>" + "<span id=inner style='display:contents'> </span></span>"); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* span = GetDocument().getElementById("inline"); + Element* contents = ToElement(span->nextSibling()); + Text* text = ToText(GetDocument().getElementById("inner")->firstChild()); + EXPECT_TRUE(text->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + // Clear LayoutText to see that the reattach works. + text->SetLayoutObject(nullptr); + + WhitespaceAttacher attacher; + attacher.DidVisitElement(contents); + EXPECT_FALSE(text->GetLayoutObject()); + + attacher.DidReattachElement(span, span->GetLayoutObject()); + EXPECT_TRUE(text->GetLayoutObject()); +} + +TEST_F(WhitespaceAttacherTest, MultipleDisplayContents) { + GetDocument().body()->setInnerHTML( + "<span id=inline></span>" + "<span style='display:contents'></span>" + "<span style='display:contents'></span>" + "<span style='display:contents'> </span>"); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* span = GetDocument().getElementById("inline"); + Element* first_contents = ToElement(span->nextSibling()); + Element* second_contents = ToElement(first_contents->nextSibling()); + Element* last_contents = ToElement(second_contents->nextSibling()); + Text* text = ToText(last_contents->firstChild()); + EXPECT_TRUE(text->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + // Clear LayoutText to see that the reattach works. + text->SetLayoutObject(nullptr); + + WhitespaceAttacher attacher; + attacher.DidVisitElement(last_contents); + attacher.DidVisitElement(second_contents); + attacher.DidVisitElement(first_contents); + EXPECT_FALSE(text->GetLayoutObject()); + + attacher.DidReattachElement(span, span->GetLayoutObject()); + EXPECT_TRUE(text->GetLayoutObject()); +} + +TEST_F(WhitespaceAttacherTest, SlottedWhitespaceInsideDisplayContents) { + GetDocument().body()->setInnerHTML("<div id=host> </div>"); + Element* host = GetDocument().getElementById("host"); + ASSERT_TRUE(host); + + ShadowRoot& shadow_root = AttachShadow(*host); + shadow_root.setInnerHTML( + "<span id=inline></span>" + "<div style='display:contents'><slot></slot></div>"); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* span = shadow_root.getElementById("inline"); + Element* contents = ToElement(span->nextSibling()); + Text* text = ToText(host->firstChild()); + EXPECT_TRUE(text->GetLayoutObject()); + + GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInStyleRecalc); + + // Clear LayoutText to see that the reattach works. + text->SetLayoutObject(nullptr); + + WhitespaceAttacher attacher; + attacher.DidVisitElement(contents); + EXPECT_FALSE(text->GetLayoutObject()); + + attacher.DidReattachElement(span, span->GetLayoutObject()); + EXPECT_TRUE(text->GetLayoutObject()); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementReactionTestHelpers.h b/third_party/WebKit/Source/core/dom/custom/CustomElementReactionTestHelpers.h index a95abde..31fa7732 100644 --- a/third_party/WebKit/Source/core/dom/custom/CustomElementReactionTestHelpers.h +++ b/third_party/WebKit/Source/core/dom/custom/CustomElementReactionTestHelpers.h
@@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef CustomElementReactionTestHelpers_h +#define CustomElementReactionTestHelpers_h + #include "core/dom/custom/CustomElementReaction.h" #include <initializer_list> @@ -148,3 +151,5 @@ }; } // namespace blink + +#endif // CustomElementReactionTestHelpers_h
diff --git a/third_party/WebKit/Source/core/editing/KeyboardTest.cpp b/third_party/WebKit/Source/core/editing/KeyboardTest.cpp index 2d35f72..63dbfa79 100644 --- a/third_party/WebKit/Source/core/editing/KeyboardTest.cpp +++ b/third_party/WebKit/Source/core/editing/KeyboardTest.cpp
@@ -41,7 +41,7 @@ namespace blink { -class KeyboardTest : public testing::Test { +class KeyboardTest : public ::testing::Test { public: // Pass a WebKeyboardEvent into the EditorClient and get back the string // name of which editing event that key causes.
diff --git a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp index 8d87696..633bfb72 100644 --- a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp +++ b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
@@ -120,20 +120,21 @@ return true; } -static VisibleSelectionInFlatTree CalcSelection( +static EphemeralRangeInFlatTree CalcSelection( const FrameSelection& frame_selection) { const VisibleSelectionInFlatTree& original_selection = frame_selection.ComputeVisibleSelectionInFlatTree(); if (!ShouldShowBlockCursor(frame_selection, original_selection)) - return original_selection; + return {original_selection.Start(), original_selection.End()}; const PositionInFlatTree end_position = NextPositionOf( original_selection.Start(), PositionMoveType::kGraphemeCluster); - return CreateVisibleSelection( + const VisibleSelectionInFlatTree& block_cursor = CreateVisibleSelection( SelectionInFlatTree::Builder() .SetBaseAndExtent(original_selection.Start(), end_position) .Build()); + return {block_cursor.Start(), block_cursor.End()}; } // Objects each have a single selection rect to examine. @@ -297,13 +298,12 @@ if (selection_in_dom.IsNone()) return SelectionPaintRange(); - const VisibleSelectionInFlatTree& selection = CalcSelection(frame_selection); - if (!selection.IsRange() || frame_selection.IsHidden()) + const EphemeralRangeInFlatTree& selection = CalcSelection(frame_selection); + if (selection.IsCollapsed() || frame_selection.IsHidden()) return SelectionPaintRange(); - DCHECK(!selection.IsNone()); - const PositionInFlatTree start_pos = selection.Start(); - const PositionInFlatTree end_pos = selection.End(); + const PositionInFlatTree start_pos = selection.StartPosition(); + const PositionInFlatTree end_pos = selection.EndPosition(); DCHECK_LE(start_pos, end_pos); LayoutObject* start_layout_object = start_pos.AnchorNode()->GetLayoutObject(); LayoutObject* end_layout_object = end_pos.AnchorNode()->GetLayoutObject();
diff --git a/third_party/WebKit/Source/core/editing/Position.cpp b/third_party/WebKit/Source/core/editing/Position.cpp index 6cfa2ed..cbb60add 100644 --- a/third_party/WebKit/Source/core/editing/Position.cpp +++ b/third_party/WebKit/Source/core/editing/Position.cpp
@@ -537,7 +537,7 @@ if (pos.IsOffsetInAnchor()) { if (anchor->IsCharacterDataNode()) return PositionInFlatTree(anchor, pos.ComputeOffsetInContainerNode()); - DCHECK(!anchor->IsActiveSlotOrActiveInsertionPoint()); + DCHECK(!anchor->IsActiveSlotOrActiveV0InsertionPoint()); int offset = pos.ComputeOffsetInContainerNode(); Node* child = NodeTraversal::ChildAt(*anchor, offset); if (!child) { @@ -547,7 +547,7 @@ return PositionInFlatTree(anchor, PositionAnchorType::kAfterChildren); } child->UpdateDistribution(); - if (child->IsActiveSlotOrActiveInsertionPoint()) { + if (child->IsActiveSlotOrActiveV0InsertionPoint()) { if (anchor->IsShadowRoot()) return PositionInFlatTree(anchor->OwnerShadowHost(), offset); return PositionInFlatTree(anchor, offset);
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.cpp b/third_party/WebKit/Source/core/editing/SelectionController.cpp index d8383c49..03c4b05 100644 --- a/third_party/WebKit/Source/core/editing/SelectionController.cpp +++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -140,7 +140,7 @@ } void SelectionController::ContextDestroyed(Document*) { - original_base_in_flat_tree_ = VisiblePositionInFlatTree(); + original_base_in_flat_tree_ = PositionInFlatTreeWithAffinity(); } static PositionInFlatTree AdjustPositionRespectUserSelectAll( @@ -360,6 +360,25 @@ return builder.Build(); } +// Returns true if selection starts from |SVGText| node and |target_node| is +// not the containing block of |SVGText| node. +// See https://bugs.webkit.org/show_bug.cgi?id=12334 for details. +static bool ShouldRespectSVGTextBoundaries( + const Node& target_node, + const FrameSelection& frame_selection) { + const PositionInFlatTree& base = + frame_selection.ComputeVisibleSelectionInFlatTree().Base(); + // TODO(editing-dev): We should use |ComputeContainerNode()|. + const Node* const base_node = base.AnchorNode(); + if (!base_node) + return false; + LayoutObject* const base_layout_object = base_node->GetLayoutObject(); + if (!base_layout_object || !base_layout_object->IsSVGText()) + return false; + return target_node.GetLayoutObject()->ContainingBlock() != + base_layout_object->ContainingBlock(); +} + void SelectionController::UpdateSelectionForMouseDrag( const HitTestResult& hit_test_result, Node* mouse_press_node, @@ -393,18 +412,9 @@ // existing selection. // Special case to limit selection to the containing block for SVG text. - // FIXME: Isn't there a better non-SVG-specific way to do this? - if (Node* selection_base_node = - Selection().ComputeVisibleSelectionInFlatTree().Base().AnchorNode()) { - if (LayoutObject* selection_base_layout_object = - selection_base_node->GetLayoutObject()) { - if (selection_base_layout_object->IsSVGText()) { - if (target->GetLayoutObject()->ContainingBlock() != - selection_base_layout_object->ContainingBlock()) - return; - } - } - } + // TODO(editing_dev): Isn't there a better non-SVG-specific way to do this? + if (ShouldRespectSVGTextBoundaries(*target, Selection())) + return; if (selection_state_ == SelectionState::kHaveNotStartedSelection && DispatchSelectStart(target) != DispatchEventResult::kNotCanceled) @@ -464,14 +474,15 @@ if (visible_selection.IsRange()) { selection_state_ = SelectionState::kExtendedSelection; - } else { - granularity = kCharacterGranularity; - selection_state_ = SelectionState::kPlacedCaret; + SetNonDirectionalSelectionIfNeeded( + selection, granularity, kDoNotAdjustEndpoints, handle_visibility); + + return true; } - SetNonDirectionalSelectionIfNeeded(selection, granularity, + selection_state_ = SelectionState::kPlacedCaret; + SetNonDirectionalSelectionIfNeeded(selection, kCharacterGranularity, kDoNotAdjustEndpoints, handle_visibility); - return true; } @@ -529,7 +540,7 @@ } if (append_trailing_whitespace == AppendTrailingWhitespace::kShouldAppend) - new_selection.AppendTrailingWhitespace(); + new_selection = new_selection.AppendTrailingWhitespace(); return UpdateSelectionForMouseDownDispatchingSelectStart( inner_node, @@ -573,7 +584,7 @@ SelectionInFlatTree::Builder().Collapse(start).Extend(end).Build()); if (append_trailing_whitespace == AppendTrailingWhitespace::kShouldAppend) - new_selection.AppendTrailingWhitespace(); + new_selection = new_selection.AppendTrailingWhitespace(); UpdateSelectionForMouseDownDispatchingSelectStart( inner_node, @@ -729,8 +740,10 @@ const VisibleSelectionInFlatTree& new_selection = CreateVisibleSelection(passed_selection); + // TODO(editing-dev): We should use |PositionWithAffinity| to pass affinity + // to |CreateVisiblePosition()| for |original_base|. const PositionInFlatTree& base_position = - original_base_in_flat_tree_.DeepEquivalent(); + original_base_in_flat_tree_.GetPosition(); const VisiblePositionInFlatTree& original_base = base_position.IsConnected() ? CreateVisiblePosition(base_position) : VisiblePositionInFlatTree(); @@ -750,7 +763,7 @@ SelectionInFlatTree::Builder builder(new_selection.AsSelection()); if (adjusted_selection.Base() != base.DeepEquivalent() || adjusted_selection.Extent() != extent.DeepEquivalent()) { - original_base_in_flat_tree_ = base; + original_base_in_flat_tree_ = base.ToPositionWithAffinity(); SetContext(&GetDocument()); builder.SetBaseAndExtent(adjusted_selection.Base(), adjusted_selection.Extent()); @@ -760,7 +773,7 @@ builder.SetBaseAndExtent(original_base.DeepEquivalent(), new_selection.Extent()); } - original_base_in_flat_tree_ = VisiblePositionInFlatTree(); + original_base_in_flat_tree_ = PositionInFlatTreeWithAffinity(); } builder.SetIsHandleVisible(handle_visibility == HandleVisibility::kVisible) @@ -827,13 +840,14 @@ // m_beganSelectingText to prevent handleMouseReleaseEvent // from setting caret selection. selection_state_ = SelectionState::kExtendedSelection; - } else { - const bool did_select = SelectClosestWordFromMouseEvent(event); - if (did_select && Selection().IsHandleVisible()) { - frame_->GetEventHandler().ShowNonLocatedContextMenu(nullptr, - kMenuSourceTouch); - } + return true; } + if (!SelectClosestWordFromMouseEvent(event)) + return true; + if (!Selection().IsHandleVisible()) + return true; + frame_->GetEventHandler().ShowNonLocatedContextMenu(nullptr, + kMenuSourceTouch); return true; }
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.h b/third_party/WebKit/Source/core/editing/SelectionController.h index 516d703..0e3642f 100644 --- a/third_party/WebKit/Source/core/editing/SelectionController.h +++ b/third_party/WebKit/Source/core/editing/SelectionController.h
@@ -130,10 +130,8 @@ bool HandleTripleClick(const MouseEventWithHitTestResults&); Member<LocalFrame> const frame_; - // TODO(yosin): We should use |PositionWIthAffinityInFlatTree| since we - // should reduce usage of |VisibleSelectionInFlatTree|. // Used to store base before the adjustment at bidi boundary - VisiblePositionInFlatTree original_base_in_flat_tree_; + PositionInFlatTreeWithAffinity original_base_in_flat_tree_; bool mouse_down_may_start_select_; bool mouse_down_was_single_click_in_selection_; bool mouse_down_allows_multi_click_;
diff --git a/third_party/WebKit/Source/core/editing/VisibleSelection.cpp b/third_party/WebKit/Source/core/editing/VisibleSelection.cpp index c145886..3edc4f5 100644 --- a/third_party/WebKit/Source/core/editing/VisibleSelection.cpp +++ b/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
@@ -180,17 +180,20 @@ } template <typename Strategy> -void VisibleSelectionTemplate<Strategy>::AppendTrailingWhitespace() { +VisibleSelectionTemplate<Strategy> +VisibleSelectionTemplate<Strategy>::AppendTrailingWhitespace() const { if (IsNone()) - return; + return *this; DCHECK_EQ(granularity_, kWordGranularity); if (!IsRange()) - return; + return *this; const PositionTemplate<Strategy>& new_end = SkipWhitespace(end_); if (end_ == new_end) - return; - has_trailing_whitespace_ = true; - end_ = new_end; + return *this; + VisibleSelectionTemplate<Strategy> result = *this; + result.has_trailing_whitespace_ = true; + result.end_ = new_end; + return result; } template <typename Strategy> @@ -452,7 +455,7 @@ } if (!has_trailing_whitespace_) return; - AppendTrailingWhitespace(); + *this = AppendTrailingWhitespace(); } template <typename Strategy>
diff --git a/third_party/WebKit/Source/core/editing/VisibleSelection.h b/third_party/WebKit/Source/core/editing/VisibleSelection.h index d9a827d..4414b04 100644 --- a/third_party/WebKit/Source/core/editing/VisibleSelection.h +++ b/third_party/WebKit/Source/core/editing/VisibleSelection.h
@@ -111,7 +111,7 @@ bool IsBaseFirst() const { return base_is_first_; } bool IsDirectional() const { return is_directional_; } - void AppendTrailingWhitespace(); + VisibleSelectionTemplate<Strategy> AppendTrailingWhitespace() const; // TODO(yosin) Most callers probably don't want these functions, but // are using them for historical reasons. |toNormalizedEphemeralRange()|
diff --git a/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp b/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp index 6fb33fc..4077327d 100644 --- a/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp +++ b/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp
@@ -82,16 +82,16 @@ // TODO(editing-dev): We should remove above comment once we fix [1]. // [1] http://crbug.com/701657 double-click on user-select:none should not // compute selection. - VisibleSelection selection = + const VisibleSelection selection = CreateVisibleSelection(SelectionInDOMTree::Builder() .Collapse(Position::BeforeNode(*input)) .Extend(Position::AfterNode(*input)) .SetGranularity(kWordGranularity) .Build()); - selection.AppendTrailingWhitespace(); + const VisibleSelection result = selection.AppendTrailingWhitespace(); - EXPECT_EQ(Position::BeforeNode(*input), selection.Start()); - EXPECT_EQ(Position::AfterNode(*input), selection.End()); + EXPECT_EQ(Position::BeforeNode(*input), result.Start()); + EXPECT_EQ(Position::AfterNode(*input), result.End()); } TEST_F(VisibleSelectionTest, expandUsingGranularity) {
diff --git a/third_party/WebKit/Source/core/editing/state_machines/StateMachineTestUtil.h b/third_party/WebKit/Source/core/editing/state_machines/StateMachineTestUtil.h index 0e4c7109..96c9da5 100644 --- a/third_party/WebKit/Source/core/editing/state_machines/StateMachineTestUtil.h +++ b/third_party/WebKit/Source/core/editing/state_machines/StateMachineTestUtil.h
@@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef StateMachineTestUtil_h +#define StateMachineTestUtil_h + #include "base/macros.h" #include "platform/wtf/Vector.h" #include "platform/wtf/text/Unicode.h" @@ -52,3 +55,5 @@ }; } // namespace blink + +#endif // StateMachineTestUtil_h
diff --git a/third_party/WebKit/Source/core/events/EventPath.cpp b/third_party/WebKit/Source/core/events/EventPath.cpp index b6fa614..2421a38 100644 --- a/third_party/WebKit/Source/core/events/EventPath.cpp +++ b/third_party/WebKit/Source/core/events/EventPath.cpp
@@ -28,10 +28,10 @@ #include "core/EventNames.h" #include "core/dom/Document.h" -#include "core/dom/InsertionPoint.h" #include "core/dom/ShadowRoot.h" #include "core/dom/Touch.h" #include "core/dom/TouchList.h" +#include "core/dom/V0InsertionPoint.h" #include "core/events/TouchEvent.h" #include "core/events/TouchEventContext.h" #include "core/html/HTMLSlotElement.h" @@ -103,7 +103,7 @@ while (current) { if (event_ && current->KeepEventInNode(event_)) break; - HeapVector<Member<InsertionPoint>, 8> insertion_points; + HeapVector<Member<V0InsertionPoint>, 8> insertion_points; CollectDestinationInsertionPoints(*current, insertion_points); if (!insertion_points.IsEmpty()) { for (const auto& insertion_point : insertion_points) {
diff --git a/third_party/WebKit/Source/core/events/EventTypeNames.json5 b/third_party/WebKit/Source/core/events/EventTypeNames.json5 index fefd670..17c522a4 100644 --- a/third_party/WebKit/Source/core/events/EventTypeNames.json5 +++ b/third_party/WebKit/Source/core/events/EventTypeNames.json5
@@ -193,6 +193,7 @@ "progress", "push", "ratechange", + "reading", "readystatechange", "rejectionhandled", "removesourcebuffer",
diff --git a/third_party/WebKit/Source/core/events/ListenerLeakTest.cpp b/third_party/WebKit/Source/core/events/ListenerLeakTest.cpp new file mode 100644 index 0000000..8a0b947 --- /dev/null +++ b/third_party/WebKit/Source/core/events/ListenerLeakTest.cpp
@@ -0,0 +1,120 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "core/frame/FrameTestHelpers.h" +#include "platform/testing/URLTestHelpers.h" +#include "platform/testing/UnitTestHelpers.h" +#include "public/platform/Platform.h" +#include "public/platform/WebURLLoaderMockFactory.h" +#include "public/web/WebView.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "v8/include/v8-profiler.h" +#include "v8/include/v8.h" + +namespace blink { + +const v8::HeapGraphNode* GetProperty(const v8::HeapGraphNode* node, + v8::HeapGraphEdge::Type type, + const char* name) { + for (int i = 0, count = node->GetChildrenCount(); i < count; ++i) { + const v8::HeapGraphEdge* prop = node->GetChild(i); + if (prop->GetType() == type) { + v8::String::Utf8Value prop_name(prop->GetName()); + if (!strcmp(name, *prop_name)) + return prop->GetToNode(); + } + } + return nullptr; +} + +int GetNumObjects(const char* constructor) { + v8::Isolate* isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + v8::HeapProfiler* profiler = isolate->GetHeapProfiler(); + const v8::HeapSnapshot* snapshot = profiler->TakeHeapSnapshot(); + if (!snapshot) + return -1; + int count = 0; + for (int i = 0; i < snapshot->GetNodesCount(); ++i) { + const v8::HeapGraphNode* node = snapshot->GetNode(i); + if (node->GetType() != v8::HeapGraphNode::kObject) + continue; + v8::String::Utf8Value node_name(node->GetName()); + if (!strcmp(constructor, *node_name)) { + const v8::HeapGraphNode* constructor_prop = + GetProperty(node, v8::HeapGraphEdge::kProperty, "constructor"); + // Skip an Object instance named after the constructor. + if (constructor_prop) { + v8::String::Utf8Value constructor_name(constructor_prop->GetName()); + if (!strcmp(constructor, *constructor_name)) + continue; + } + ++count; + } + } + return count; +} + +class ListenerLeakTest : public ::testing::Test { + public: + void RunTest(const std::string& filename) { + std::string base_url("http://www.example.com/"); + std::string file_name(filename); + URLTestHelpers::RegisterMockedURLLoadFromBase( + WebString::FromUTF8(base_url), blink::testing::CoreTestDataPath(), + WebString::FromUTF8(file_name)); + web_view_helper.InitializeAndLoad(base_url + file_name); + } + + void TearDown() override { + Platform::Current() + ->GetURLLoaderMockFactory() + ->UnregisterAllURLsAndClearMemoryCache(); + } + + protected: + FrameTestHelpers::WebViewHelper web_view_helper; +}; + +// This test tries to create a reference cycle between node and its listener. +// See http://crbug/17400. +TEST_F(ListenerLeakTest, ReferenceCycle) { + RunTest("listener/listener_leak1.html"); + ASSERT_EQ(0, GetNumObjects("EventListenerLeakTestObject1")); +} + +// This test sets node onclick many times to expose a possible memory +// leak where all listeners get referenced by the node. +TEST_F(ListenerLeakTest, HiddenReferences) { + RunTest("listener/listener_leak2.html"); + ASSERT_EQ(1, GetNumObjects("EventListenerLeakTestObject2")); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/events/TouchEventTest.cpp b/third_party/WebKit/Source/core/events/TouchEventTest.cpp index 020e218b..23801e6 100644 --- a/third_party/WebKit/Source/core/events/TouchEventTest.cpp +++ b/third_party/WebKit/Source/core/events/TouchEventTest.cpp
@@ -11,7 +11,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using testing::ElementsAre; +using ::testing::ElementsAre; namespace blink { @@ -42,7 +42,7 @@ std::vector<MessageSource> message_sources_; }; -class TouchEventTest : public testing::Test { +class TouchEventTest : public ::testing::Test { public: TouchEventTest() { chrome_client_ = new ConsoleCapturingChromeClient(); @@ -133,7 +133,7 @@ EXPECT_THAT(MessageSources(), ElementsAre(kInterventionMessageSource)); } -class TouchEventTestNoFrame : public testing::Test {}; +class TouchEventTestNoFrame : public ::testing::Test {}; TEST_F(TouchEventTestNoFrame, PreventDefaultDoesntRequireFrame) { TouchEvent::Create()->preventDefault();
diff --git a/third_party/WebKit/Source/core/events/WebInputEventConversionTest.cpp b/third_party/WebKit/Source/core/events/WebInputEventConversionTest.cpp index c2b64dad..5d92a7b 100644 --- a/third_party/WebKit/Source/core/events/WebInputEventConversionTest.cpp +++ b/third_party/WebKit/Source/core/events/WebInputEventConversionTest.cpp
@@ -74,7 +74,7 @@ void RegisterMockedURL(const std::string& base_url, const std::string& file_name) { URLTestHelpers::RegisterMockedURLLoadFromBase(WebString::FromUTF8(base_url), - testing::WebTestDataPath(), + testing::CoreTestDataPath(), WebString::FromUTF8(file_name)); }
diff --git a/third_party/WebKit/Source/core/exported/BUILD.gn b/third_party/WebKit/Source/core/exported/BUILD.gn index 1d645502..17cadb6 100644 --- a/third_party/WebKit/Source/core/exported/BUILD.gn +++ b/third_party/WebKit/Source/core/exported/BUILD.gn
@@ -92,5 +92,10 @@ "WebViewBase.h", ] + jumbo_excluded_sources = [ + # Too many different toElement (ListedElement and Node). https://crbug.com/738389 + "WebSearchableFormData.cpp", + ] + defines = [ "BLINK_IMPLEMENTATION=1" ] }
diff --git a/third_party/WebKit/Source/core/exported/PrerenderingTest.cpp b/third_party/WebKit/Source/core/exported/PrerenderingTest.cpp new file mode 100644 index 0000000..232c590 --- /dev/null +++ b/third_party/WebKit/Source/core/exported/PrerenderingTest.cpp
@@ -0,0 +1,477 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <functional> +#include <list> +#include <memory> +#include "core/dom/NodeTraversal.h" +#include "core/frame/FrameTestHelpers.h" +#include "core/frame/WebLocalFrameBase.h" +#include "platform/testing/URLTestHelpers.h" +#include "platform/testing/UnitTestHelpers.h" +#include "platform/wtf/PtrUtil.h" +#include "public/platform/Platform.h" +#include "public/platform/WebCache.h" +#include "public/platform/WebPrerender.h" +#include "public/platform/WebPrerenderingSupport.h" +#include "public/platform/WebString.h" +#include "public/platform/WebURLLoaderMockFactory.h" +#include "public/web/WebFrame.h" +#include "public/web/WebPrerendererClient.h" +#include "public/web/WebScriptSource.h" +#include "public/web/WebView.h" +#include "public/web/WebViewClient.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace blink { + +namespace { + +WebURL ToWebURL(const char* url) { + return WebURL(blink::URLTestHelpers::ToKURL(url)); +} + +class TestPrerendererClient : public WebPrerendererClient { + public: + TestPrerendererClient() {} + virtual ~TestPrerendererClient() {} + + void SetExtraDataForNextPrerender(WebPrerender::ExtraData* extra_data) { + DCHECK(!extra_data_); + extra_data_ = WTF::WrapUnique(extra_data); + } + + WebPrerender ReleaseWebPrerender() { + DCHECK(!web_prerenders_.empty()); + WebPrerender retval(web_prerenders_.front()); + web_prerenders_.pop_front(); + return retval; + } + + bool empty() const { return web_prerenders_.empty(); } + + void Clear() { web_prerenders_.clear(); } + + private: + // From WebPrerendererClient: + void WillAddPrerender(WebPrerender* prerender) override { + prerender->SetExtraData(extra_data_.release()); + + DCHECK(!prerender->IsNull()); + web_prerenders_.push_back(*prerender); + } + + bool IsPrefetchOnly() override { return false; } + + std::unique_ptr<WebPrerender::ExtraData> extra_data_; + std::list<WebPrerender> web_prerenders_; +}; + +class TestPrerenderingSupport : public WebPrerenderingSupport { + public: + TestPrerenderingSupport() { Initialize(this); } + + ~TestPrerenderingSupport() override { Shutdown(); } + + void Clear() { + added_prerenders_.clear(); + canceled_prerenders_.clear(); + abandoned_prerenders_.clear(); + } + + size_t TotalCount() const { + return added_prerenders_.size() + canceled_prerenders_.size() + + abandoned_prerenders_.size(); + } + + size_t AddCount(const WebPrerender& prerender) const { + return std::count_if(added_prerenders_.begin(), added_prerenders_.end(), + [&prerender](const WebPrerender& other) { + return other.ToPrerender() == + prerender.ToPrerender(); + }); + } + + size_t CancelCount(const WebPrerender& prerender) const { + return std::count_if( + canceled_prerenders_.begin(), canceled_prerenders_.end(), + [&prerender](const WebPrerender& other) { + return other.ToPrerender() == prerender.ToPrerender(); + }); + } + + size_t AbandonCount(const WebPrerender& prerender) const { + return std::count_if( + abandoned_prerenders_.begin(), abandoned_prerenders_.end(), + [&prerender](const WebPrerender& other) { + return other.ToPrerender() == prerender.ToPrerender(); + }); + } + + private: + // From WebPrerenderingSupport: + void Add(const WebPrerender& prerender) override { + added_prerenders_.push_back(prerender); + } + + void Cancel(const WebPrerender& prerender) override { + canceled_prerenders_.push_back(prerender); + } + + void Abandon(const WebPrerender& prerender) override { + abandoned_prerenders_.push_back(prerender); + } + + void PrefetchFinished() override {} + + Vector<WebPrerender> added_prerenders_; + Vector<WebPrerender> canceled_prerenders_; + Vector<WebPrerender> abandoned_prerenders_; +}; + +class PrerenderingTest : public ::testing::Test { + public: + ~PrerenderingTest() override { + Platform::Current() + ->GetURLLoaderMockFactory() + ->UnregisterAllURLsAndClearMemoryCache(); + } + + void Initialize(const char* base_url, const char* file_name) { + URLTestHelpers::RegisterMockedURLLoadFromBase( + WebString::FromUTF8(base_url), blink::testing::CoreTestDataPath(), + WebString::FromUTF8(file_name)); + web_view_helper_.Initialize(); + web_view_helper_.WebView()->SetPrerendererClient(&prerenderer_client_); + + FrameTestHelpers::LoadFrame(web_view_helper_.WebView()->MainFrameImpl(), + std::string(base_url) + file_name); + } + + void NavigateAway() { + FrameTestHelpers::LoadFrame(web_view_helper_.WebView()->MainFrameImpl(), + "about:blank"); + } + + void Close() { + web_view_helper_.LocalMainFrame()->CollectGarbage(); + web_view_helper_.Reset(); + + WebCache::Clear(); + } + + Element& Console() { + Document* document = + web_view_helper_.LocalMainFrame()->GetFrame()->GetDocument(); + Element* console = document->getElementById("console"); + DCHECK(isHTMLUListElement(console)); + return *console; + } + + unsigned ConsoleLength() { return Console().CountChildren() - 1; } + + WebString ConsoleAt(unsigned i) { + DCHECK_GT(ConsoleLength(), i); + + Node* item = NodeTraversal::ChildAt(Console(), 1 + i); + + DCHECK(item); + DCHECK(isHTMLLIElement(item)); + DCHECK(item->hasChildren()); + + return item->textContent(); + } + + void ExecuteScript(const char* code) { + web_view_helper_.LocalMainFrame()->ExecuteScript( + WebScriptSource(WebString::FromUTF8(code))); + } + + TestPrerenderingSupport* PrerenderingSupport() { + return &prerendering_support_; + } + + TestPrerendererClient* PrerendererClient() { return &prerenderer_client_; } + + private: + TestPrerenderingSupport prerendering_support_; + TestPrerendererClient prerenderer_client_; + + FrameTestHelpers::WebViewHelper web_view_helper_; +}; + +} // namespace + +TEST_F(PrerenderingTest, SinglePrerender) { + Initialize("http://www.foo.com/", "prerender/single_prerender.html"); + + WebPrerender web_prerender = PrerendererClient()->ReleaseWebPrerender(); + EXPECT_FALSE(web_prerender.IsNull()); + EXPECT_EQ(ToWebURL("http://prerender.com/"), web_prerender.Url()); + EXPECT_EQ(kPrerenderRelTypePrerender, web_prerender.RelTypes()); + + EXPECT_EQ(1u, PrerenderingSupport()->AddCount(web_prerender)); + EXPECT_EQ(1u, PrerenderingSupport()->TotalCount()); + + web_prerender.DidStartPrerender(); + EXPECT_EQ(1u, ConsoleLength()); + EXPECT_EQ("webkitprerenderstart", ConsoleAt(0)); + + web_prerender.DidSendDOMContentLoadedForPrerender(); + EXPECT_EQ(2u, ConsoleLength()); + EXPECT_EQ("webkitprerenderdomcontentloaded", ConsoleAt(1)); + + web_prerender.DidSendLoadForPrerender(); + EXPECT_EQ(3u, ConsoleLength()); + EXPECT_EQ("webkitprerenderload", ConsoleAt(2)); + + web_prerender.DidStopPrerender(); + EXPECT_EQ(4u, ConsoleLength()); + EXPECT_EQ("webkitprerenderstop", ConsoleAt(3)); +} + +TEST_F(PrerenderingTest, CancelPrerender) { + Initialize("http://www.foo.com/", "prerender/single_prerender.html"); + + WebPrerender web_prerender = PrerendererClient()->ReleaseWebPrerender(); + EXPECT_FALSE(web_prerender.IsNull()); + + EXPECT_EQ(1u, PrerenderingSupport()->AddCount(web_prerender)); + EXPECT_EQ(1u, PrerenderingSupport()->TotalCount()); + + ExecuteScript("removePrerender()"); + + EXPECT_EQ(1u, PrerenderingSupport()->CancelCount(web_prerender)); + EXPECT_EQ(2u, PrerenderingSupport()->TotalCount()); +} + +TEST_F(PrerenderingTest, AbandonPrerender) { + Initialize("http://www.foo.com/", "prerender/single_prerender.html"); + + WebPrerender web_prerender = PrerendererClient()->ReleaseWebPrerender(); + EXPECT_FALSE(web_prerender.IsNull()); + + EXPECT_EQ(1u, PrerenderingSupport()->AddCount(web_prerender)); + EXPECT_EQ(1u, PrerenderingSupport()->TotalCount()); + + NavigateAway(); + + EXPECT_EQ(1u, PrerenderingSupport()->AbandonCount(web_prerender)); + EXPECT_EQ(2u, PrerenderingSupport()->TotalCount()); + + // Check that the prerender does not emit an extra cancel when + // garbage-collecting everything. + Close(); + + EXPECT_EQ(2u, PrerenderingSupport()->TotalCount()); +} + +TEST_F(PrerenderingTest, ExtraData) { + class TestExtraData : public WebPrerender::ExtraData { + public: + explicit TestExtraData(bool* alive) : alive_(alive) { *alive = true; } + + ~TestExtraData() override { *alive_ = false; } + + private: + bool* alive_; + }; + + bool alive = false; + { + PrerendererClient()->SetExtraDataForNextPrerender( + new TestExtraData(&alive)); + Initialize("http://www.foo.com/", "prerender/single_prerender.html"); + EXPECT_TRUE(alive); + + WebPrerender web_prerender = PrerendererClient()->ReleaseWebPrerender(); + + ExecuteScript("removePrerender()"); + Close(); + PrerenderingSupport()->Clear(); + } + EXPECT_FALSE(alive); +} + +TEST_F(PrerenderingTest, TwoPrerenders) { + Initialize("http://www.foo.com/", "prerender/multiple_prerenders.html"); + + WebPrerender first_prerender = PrerendererClient()->ReleaseWebPrerender(); + EXPECT_FALSE(first_prerender.IsNull()); + EXPECT_EQ(ToWebURL("http://first-prerender.com/"), first_prerender.Url()); + + WebPrerender second_prerender = PrerendererClient()->ReleaseWebPrerender(); + EXPECT_FALSE(first_prerender.IsNull()); + EXPECT_EQ(ToWebURL("http://second-prerender.com/"), second_prerender.Url()); + + EXPECT_EQ(1u, PrerenderingSupport()->AddCount(first_prerender)); + EXPECT_EQ(1u, PrerenderingSupport()->AddCount(second_prerender)); + EXPECT_EQ(2u, PrerenderingSupport()->TotalCount()); + + first_prerender.DidStartPrerender(); + EXPECT_EQ(1u, ConsoleLength()); + EXPECT_EQ("first_webkitprerenderstart", ConsoleAt(0)); + + second_prerender.DidStartPrerender(); + EXPECT_EQ(2u, ConsoleLength()); + EXPECT_EQ("second_webkitprerenderstart", ConsoleAt(1)); +} + +TEST_F(PrerenderingTest, TwoPrerendersRemovingFirstThenNavigating) { + Initialize("http://www.foo.com/", "prerender/multiple_prerenders.html"); + + WebPrerender first_prerender = PrerendererClient()->ReleaseWebPrerender(); + WebPrerender second_prerender = PrerendererClient()->ReleaseWebPrerender(); + + EXPECT_EQ(1u, PrerenderingSupport()->AddCount(first_prerender)); + EXPECT_EQ(1u, PrerenderingSupport()->AddCount(second_prerender)); + EXPECT_EQ(2u, PrerenderingSupport()->TotalCount()); + + ExecuteScript("removeFirstPrerender()"); + + EXPECT_EQ(1u, PrerenderingSupport()->CancelCount(first_prerender)); + EXPECT_EQ(3u, PrerenderingSupport()->TotalCount()); + + NavigateAway(); + + EXPECT_EQ(1u, PrerenderingSupport()->AbandonCount(second_prerender)); + EXPECT_EQ(4u, PrerenderingSupport()->TotalCount()); +} + +TEST_F(PrerenderingTest, TwoPrerendersAddingThird) { + Initialize("http://www.foo.com/", "prerender/multiple_prerenders.html"); + + WebPrerender first_prerender = PrerendererClient()->ReleaseWebPrerender(); + WebPrerender second_prerender = PrerendererClient()->ReleaseWebPrerender(); + + EXPECT_EQ(1u, PrerenderingSupport()->AddCount(first_prerender)); + EXPECT_EQ(1u, PrerenderingSupport()->AddCount(second_prerender)); + EXPECT_EQ(2u, PrerenderingSupport()->TotalCount()); + + ExecuteScript("addThirdPrerender()"); + + WebPrerender third_prerender = PrerendererClient()->ReleaseWebPrerender(); + EXPECT_EQ(1u, PrerenderingSupport()->AddCount(third_prerender)); + EXPECT_EQ(3u, PrerenderingSupport()->TotalCount()); +} + +TEST_F(PrerenderingTest, ShortLivedClient) { + Initialize("http://www.foo.com/", "prerender/single_prerender.html"); + + WebPrerender web_prerender = PrerendererClient()->ReleaseWebPrerender(); + EXPECT_FALSE(web_prerender.IsNull()); + + EXPECT_EQ(1u, PrerenderingSupport()->AddCount(web_prerender)); + EXPECT_EQ(1u, PrerenderingSupport()->TotalCount()); + + NavigateAway(); + Close(); + + // This test passes if this next line doesn't crash. + web_prerender.DidStartPrerender(); +} + +TEST_F(PrerenderingTest, FastRemoveElement) { + Initialize("http://www.foo.com/", "prerender/single_prerender.html"); + + WebPrerender web_prerender = PrerendererClient()->ReleaseWebPrerender(); + EXPECT_FALSE(web_prerender.IsNull()); + + EXPECT_EQ(1u, PrerenderingSupport()->AddCount(web_prerender)); + EXPECT_EQ(1u, PrerenderingSupport()->TotalCount()); + + // Race removing & starting the prerender against each other, as if the + // element was removed very quickly. + ExecuteScript("removePrerender()"); + EXPECT_FALSE(web_prerender.IsNull()); + web_prerender.DidStartPrerender(); + + // The page should be totally disconnected from the Prerender at this point, + // so the console should not have updated. + EXPECT_EQ(0u, ConsoleLength()); +} + +TEST_F(PrerenderingTest, MutateTarget) { + Initialize("http://www.foo.com/", "prerender/single_prerender.html"); + + WebPrerender web_prerender = PrerendererClient()->ReleaseWebPrerender(); + EXPECT_FALSE(web_prerender.IsNull()); + EXPECT_EQ(ToWebURL("http://prerender.com/"), web_prerender.Url()); + + EXPECT_EQ(1u, PrerenderingSupport()->AddCount(web_prerender)); + EXPECT_EQ(0u, PrerenderingSupport()->CancelCount(web_prerender)); + EXPECT_EQ(1u, PrerenderingSupport()->TotalCount()); + + // Change the href of this prerender, make sure this is treated as a remove + // and add. + ExecuteScript("mutateTarget()"); + EXPECT_EQ(1u, PrerenderingSupport()->CancelCount(web_prerender)); + + WebPrerender mutated_prerender = PrerendererClient()->ReleaseWebPrerender(); + EXPECT_EQ(ToWebURL("http://mutated.com/"), mutated_prerender.Url()); + EXPECT_EQ(1u, PrerenderingSupport()->AddCount(web_prerender)); + EXPECT_EQ(1u, PrerenderingSupport()->AddCount(mutated_prerender)); + EXPECT_EQ(3u, PrerenderingSupport()->TotalCount()); +} + +TEST_F(PrerenderingTest, MutateRel) { + Initialize("http://www.foo.com/", "prerender/single_prerender.html"); + + WebPrerender web_prerender = PrerendererClient()->ReleaseWebPrerender(); + EXPECT_FALSE(web_prerender.IsNull()); + EXPECT_EQ(ToWebURL("http://prerender.com/"), web_prerender.Url()); + + EXPECT_EQ(1u, PrerenderingSupport()->AddCount(web_prerender)); + EXPECT_EQ(0u, PrerenderingSupport()->CancelCount(web_prerender)); + EXPECT_EQ(1u, PrerenderingSupport()->TotalCount()); + + // Change the rel of this prerender, make sure this is treated as a remove. + ExecuteScript("mutateRel()"); + EXPECT_EQ(1u, PrerenderingSupport()->CancelCount(web_prerender)); + EXPECT_EQ(2u, PrerenderingSupport()->TotalCount()); +} + +TEST_F(PrerenderingTest, RelNext) { + Initialize("http://www.foo.com/", "prerender/rel_next_prerender.html"); + + WebPrerender rel_next_only = PrerendererClient()->ReleaseWebPrerender(); + EXPECT_EQ(ToWebURL("http://rel-next-only.com/"), rel_next_only.Url()); + EXPECT_EQ(kPrerenderRelTypeNext, rel_next_only.RelTypes()); + + WebPrerender rel_next_and_prerender = + PrerendererClient()->ReleaseWebPrerender(); + EXPECT_EQ(ToWebURL("http://rel-next-and-prerender.com/"), + rel_next_and_prerender.Url()); + EXPECT_EQ( + static_cast<unsigned>(kPrerenderRelTypeNext | kPrerenderRelTypePrerender), + rel_next_and_prerender.RelTypes()); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/exported/WebAssociatedURLLoaderImplTest.cpp b/third_party/WebKit/Source/core/exported/WebAssociatedURLLoaderImplTest.cpp index bc84ed4..826963c4 100644 --- a/third_party/WebKit/Source/core/exported/WebAssociatedURLLoaderImplTest.cpp +++ b/third_party/WebKit/Source/core/exported/WebAssociatedURLLoaderImplTest.cpp
@@ -68,7 +68,7 @@ did_finish_loading_(false), did_fail_(false) { // Reuse one of the test files from WebFrameTest. - frame_file_path_ = testing::WebTestDataPath("iframes_test.html"); + frame_file_path_ = testing::CoreTestDataPath("iframes_test.html"); } KURL RegisterMockedUrl(const std::string& url_root, @@ -77,7 +77,7 @@ response.SetMIMEType("text/html"); KURL url = ToKURL(url_root + filename.Utf8().data()); Platform::Current()->GetURLLoaderMockFactory()->RegisterURL( - url, response, testing::WebTestDataPath(filename.Utf8().data())); + url, response, testing::CoreTestDataPath(filename.Utf8().data())); return url; }
diff --git a/third_party/WebKit/Source/core/exported/WebDocumentSubresourceFilterTest.cpp b/third_party/WebKit/Source/core/exported/WebDocumentSubresourceFilterTest.cpp index e64863d3..5d0a6b6 100644 --- a/third_party/WebKit/Source/core/exported/WebDocumentSubresourceFilterTest.cpp +++ b/third_party/WebKit/Source/core/exported/WebDocumentSubresourceFilterTest.cpp
@@ -115,7 +115,7 @@ private: void RegisterMockedHttpURLLoad(const std::string& file_name) { URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url_), testing::WebTestDataPath(), + WebString::FromUTF8(base_url_), testing::CoreTestDataPath(), WebString::FromUTF8(file_name)); }
diff --git a/third_party/WebKit/Source/core/exported/WebDocumentTest.cpp b/third_party/WebKit/Source/core/exported/WebDocumentTest.cpp index f6e8703e..fad1dd53 100644 --- a/third_party/WebKit/Source/core/exported/WebDocumentTest.cpp +++ b/third_party/WebKit/Source/core/exported/WebDocumentTest.cpp
@@ -47,7 +47,7 @@ void WebDocumentTest::SetUpTestCase() { URLTestHelpers::RegisterMockedURLLoad( ToKURL(std::string(kDefaultOrigin) + kManifestDummyFilePath), - testing::WebTestDataPath(kManifestDummyFilePath)); + testing::CoreTestDataPath(kManifestDummyFilePath)); } void WebDocumentTest::LoadURL(const std::string& url) { @@ -203,7 +203,7 @@ } void RegisterMockedURLLoad(const KURL& url, const char* path) { - URLTestHelpers::RegisterMockedURLLoad(url, testing::WebTestDataPath(path)); + URLTestHelpers::RegisterMockedURLLoad(url, testing::CoreTestDataPath(path)); } } // anonymous namespace
diff --git a/third_party/WebKit/Source/core/exported/WebElementTest.cpp b/third_party/WebKit/Source/core/exported/WebElementTest.cpp index 29bc0be..abbe75b 100644 --- a/third_party/WebKit/Source/core/exported/WebElementTest.cpp +++ b/third_party/WebKit/Source/core/exported/WebElementTest.cpp
@@ -60,7 +60,7 @@ " <span></span> " "</div>"; -class WebElementTest : public testing::Test { +class WebElementTest : public ::testing::Test { protected: Document& GetDocument() { return page_holder_->GetDocument(); } void InsertHTML(String html);
diff --git a/third_party/WebKit/Source/core/exported/WebFrameSerializer.cpp b/third_party/WebKit/Source/core/exported/WebFrameSerializer.cpp index 1a5f7b76..da07aaf 100644 --- a/third_party/WebKit/Source/core/exported/WebFrameSerializer.cpp +++ b/third_party/WebKit/Source/core/exported/WebFrameSerializer.cpp
@@ -453,7 +453,7 @@ MHTMLArchive::GenerateMHTMLHeader(boundary, document->title(), document->SuggestedMIMEType(), *buffer->MutableData()); - return buffer; + return WebThreadSafeData(buffer); } WebThreadSafeData WebFrameSerializer::GenerateMHTMLParts( @@ -516,7 +516,7 @@ *output->MutableData()); } } - return output; + return WebThreadSafeData(output); } bool WebFrameSerializer::Serialize(
diff --git a/third_party/WebKit/Source/core/exported/WebFrameSerializerTest.cpp b/third_party/WebKit/Source/core/exported/WebFrameSerializerTest.cpp index d027903..a87ccb6 100644 --- a/third_party/WebKit/Source/core/exported/WebFrameSerializerTest.cpp +++ b/third_party/WebKit/Source/core/exported/WebFrameSerializerTest.cpp
@@ -85,7 +85,7 @@ const String& file_path, const String& mime_type = "image/png") { URLTestHelpers::RegisterMockedURLLoad( - url, testing::WebTestDataPath(file_path.Utf8().data()), mime_type); + url, testing::CoreTestDataPath(file_path.Utf8().data()), mime_type); } class SingleLinkRewritingDelegate
diff --git a/third_party/WebKit/Source/web/tests/WebMeaningfulLayoutsTest.cpp b/third_party/WebKit/Source/core/exported/WebMeaningfulLayoutsTest.cpp similarity index 100% rename from third_party/WebKit/Source/web/tests/WebMeaningfulLayoutsTest.cpp rename to third_party/WebKit/Source/core/exported/WebMeaningfulLayoutsTest.cpp
diff --git a/third_party/WebKit/Source/core/exported/WebNodeTest.cpp b/third_party/WebKit/Source/core/exported/WebNodeTest.cpp index fb55724..e20bee9 100644 --- a/third_party/WebKit/Source/core/exported/WebNodeTest.cpp +++ b/third_party/WebKit/Source/core/exported/WebNodeTest.cpp
@@ -14,7 +14,7 @@ namespace blink { -class WebNodeTest : public testing::Test { +class WebNodeTest : public ::testing::Test { protected: Document& GetDocument() { return page_holder_->GetDocument(); }
diff --git a/third_party/WebKit/Source/core/exported/WebPagePopupImpl.cpp b/third_party/WebKit/Source/core/exported/WebPagePopupImpl.cpp index 335b16e..53843199 100644 --- a/third_party/WebKit/Source/core/exported/WebPagePopupImpl.cpp +++ b/third_party/WebKit/Source/core/exported/WebPagePopupImpl.cpp
@@ -321,7 +321,7 @@ frame->SetPageZoomFactor(popup_client_->ZoomFactor()); frame->Loader().Load( FrameLoadRequest(0, ResourceRequest(BlankURL()), - SubstituteData(data, "text/html", "UTF-8", KURL(), + SubstituteData(data, "text/html", "UTF-8", NullURL(), kForceSynchronousLoad))); return true; }
diff --git a/third_party/WebKit/Source/core/exported/WebPluginContainerTest.cpp b/third_party/WebKit/Source/core/exported/WebPluginContainerTest.cpp index 671a7380..9d371e4 100644 --- a/third_party/WebKit/Source/core/exported/WebPluginContainerTest.cpp +++ b/third_party/WebKit/Source/core/exported/WebPluginContainerTest.cpp
@@ -94,7 +94,7 @@ const std::string& file_name, const std::string& mime_type = std::string("text/html")) { URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url_), testing::WebTestDataPath(), + WebString::FromUTF8(base_url_), testing::CoreTestDataPath(), WebString::FromUTF8(file_name), WebString::FromUTF8(mime_type)); }
diff --git a/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.cpp b/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.cpp index 2b8b8a1..1c201913 100644 --- a/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.cpp +++ b/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.cpp
@@ -151,11 +151,6 @@ return nullptr; } -unsigned WebRemoteFrameImpl::UnloadListenerCount() const { - NOTREACHED(); - return 0; -} - WebLocalFrame* WebRemoteFrameImpl::CreateLocalChild( WebTreeScopeType scope, const WebString& name,
diff --git a/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.h b/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.h index 9b18dc8..71fc0b5 100644 --- a/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.h +++ b/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.h
@@ -45,7 +45,6 @@ bool IsViewSourceModeEnabled() const override; WebAssociatedURLLoader* CreateAssociatedURLLoader( const WebAssociatedURLLoaderOptions&) override; - unsigned UnloadListenerCount() const override; // WebRemoteFrame methods: WebLocalFrame* CreateLocalChild(WebTreeScopeType,
diff --git a/third_party/WebKit/Source/core/exported/WebSearchableFormDataTest.cpp b/third_party/WebKit/Source/core/exported/WebSearchableFormDataTest.cpp index bbb959a..a3737af0 100644 --- a/third_party/WebKit/Source/core/exported/WebSearchableFormDataTest.cpp +++ b/third_party/WebKit/Source/core/exported/WebSearchableFormDataTest.cpp
@@ -51,7 +51,7 @@ void RegisterMockedURLLoadFromBaseURL(const std::string& base_url, const std::string& file_name) { URLTestHelpers::RegisterMockedURLLoadFromBase(WebString::FromUTF8(base_url), - testing::WebTestDataPath(), + testing::CoreTestDataPath(), WebString::FromUTF8(file_name)); }
diff --git a/third_party/WebKit/Source/core/exported/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/core/exported/WebSharedWorkerImpl.cpp index ebc1cb5..3f07a02 100644 --- a/third_party/WebKit/Source/core/exported/WebSharedWorkerImpl.cpp +++ b/third_party/WebKit/Source/core/exported/WebSharedWorkerImpl.cpp
@@ -167,9 +167,9 @@ CString content(""); RefPtr<SharedBuffer> buffer( SharedBuffer::Create(content.data(), content.length())); - main_frame_->GetFrame()->Loader().Load( - FrameLoadRequest(0, ResourceRequest(url_), - SubstituteData(buffer, "text/html", "UTF-8", KURL()))); + main_frame_->GetFrame()->Loader().Load(FrameLoadRequest( + 0, ResourceRequest(url_), + SubstituteData(buffer, "text/html", "UTF-8", NullURL()))); } void WebSharedWorkerImpl::FrameDetached(WebLocalFrame* frame, DetachType type) {
diff --git a/third_party/WebKit/Source/core/exported/WebViewTest.cpp b/third_party/WebKit/Source/core/exported/WebViewTest.cpp index cdb4c84..51d27e36 100644 --- a/third_party/WebKit/Source/core/exported/WebViewTest.cpp +++ b/third_party/WebKit/Source/core/exported/WebViewTest.cpp
@@ -244,7 +244,7 @@ protected: std::string RegisterMockedHttpURLLoad(const std::string& file_name) { return URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url_), testing::WebTestDataPath(), + WebString::FromUTF8(base_url_), testing::CoreTestDataPath(), WebString::FromUTF8(file_name)) .GetString() .Utf8(); @@ -556,7 +556,7 @@ TEST_P(WebViewTest, HitTestResultAtWithPageScale) { std::string url = base_url_ + "specify_size.html?" + "50px" + ":" + "50px"; URLTestHelpers::RegisterMockedURLLoad( - ToKURL(url), testing::WebTestDataPath("specify_size.html")); + ToKURL(url), testing::CoreTestDataPath("specify_size.html")); WebView* web_view = web_view_helper_.InitializeAndLoad(url); web_view->Resize(WebSize(100, 100)); WebPoint hit_point(75, 75); @@ -577,7 +577,7 @@ TEST_P(WebViewTest, HitTestResultAtWithPageScaleAndPan) { std::string url = base_url_ + "specify_size.html?" + "50px" + ":" + "50px"; URLTestHelpers::RegisterMockedURLLoad( - ToKURL(url), testing::WebTestDataPath("specify_size.html")); + ToKURL(url), testing::CoreTestDataPath("specify_size.html")); WebViewBase* web_view = web_view_helper_.Initialize(); LoadFrame(web_view->MainFrameImpl(), url); web_view->Resize(WebSize(100, 100)); @@ -674,7 +674,7 @@ std::string url = base_url_ + "specify_size.html?" + page_width + ":" + page_height; URLTestHelpers::RegisterMockedURLLoad( - ToKURL(url), testing::WebTestDataPath("specify_size.html")); + ToKURL(url), testing::CoreTestDataPath("specify_size.html")); WebViewBase* web_view = web_view_helper_.InitializeAndLoad(url, nullptr, &client); client.GetTestData().SetWebView(web_view); @@ -896,7 +896,7 @@ std::string url = RegisterMockedHttpURLLoad("div_with_image.html"); URLTestHelpers::RegisterMockedURLLoad( ToKURL("http://www.test.com/foo.png"), - testing::WebTestDataPath("white-1x1.png")); + testing::CoreTestDataPath("white-1x1.png")); WebViewBase* web_view_impl = web_view_helper_.InitializeAndLoad(url); web_view_impl->SetInitialFocus(false); WebTextInputInfo info = web_view_impl->MainFrameImpl() @@ -2234,7 +2234,7 @@ URLTestHelpers::RegisterMockedURLLoad( ToKURL("http://www.test.com/foo.png"), - testing::WebTestDataPath("white-1x1.png")); + testing::CoreTestDataPath("white-1x1.png")); WebViewBase* web_view = web_view_helper_.InitializeAndLoad( base_url_ + "long_press_links_and_images.html"); @@ -3626,7 +3626,7 @@ TEST_P(WebViewTest, PreferredSize) { std::string url = base_url_ + "specify_size.html?100px:100px"; URLTestHelpers::RegisterMockedURLLoad( - ToKURL(url), testing::WebTestDataPath("specify_size.html")); + ToKURL(url), testing::CoreTestDataPath("specify_size.html")); WebView* web_view = web_view_helper_.InitializeAndLoad(url); WebSize size = web_view->ContentsPreferredMinimumSize(); @@ -3652,7 +3652,7 @@ url = base_url_ + "specify_size.html?1.5px:1.5px"; URLTestHelpers::RegisterMockedURLLoad( - ToKURL(url), testing::WebTestDataPath("specify_size.html")); + ToKURL(url), testing::CoreTestDataPath("specify_size.html")); web_view = web_view_helper_.InitializeAndLoad(url); web_view->SetZoomLevel(WebView::ZoomFactorToZoomLevel(1)); @@ -3664,7 +3664,7 @@ TEST_P(WebViewTest, PreferredSizeDirtyLayout) { std::string url = base_url_ + "specify_size.html?100px:100px"; URLTestHelpers::RegisterMockedURLLoad( - ToKURL(url), testing::WebTestDataPath("specify_size.html")); + ToKURL(url), testing::CoreTestDataPath("specify_size.html")); WebViewBase* web_view = web_view_helper_.InitializeAndLoad(url); WebElement document_element = web_view->MainFrameImpl()->GetDocument().DocumentElement();
diff --git a/third_party/WebKit/Source/core/fileapi/URLFileAPI.cpp b/third_party/WebKit/Source/core/fileapi/URLFileAPI.cpp index d7669235..4389c2c6 100644 --- a/third_party/WebKit/Source/core/fileapi/URLFileAPI.cpp +++ b/third_party/WebKit/Source/core/fileapi/URLFileAPI.cpp
@@ -41,7 +41,7 @@ ExecutionContext* execution_context = ExecutionContext::From(script_state); DCHECK(execution_context); - KURL url(KURL(), url_string); + KURL url(NullURL(), url_string); execution_context->RemoveURLFromMemoryCache(url); execution_context->GetPublicURLManager().Revoke(url); }
diff --git a/third_party/WebKit/Source/core/frame/BrowserControlsTest.cpp b/third_party/WebKit/Source/core/frame/BrowserControlsTest.cpp index e0719e52..0f6cf9d 100644 --- a/third_party/WebKit/Source/core/frame/BrowserControlsTest.cpp +++ b/third_party/WebKit/Source/core/frame/BrowserControlsTest.cpp
@@ -93,7 +93,7 @@ void RegisterMockedHttpURLLoad(const std::string& file_name) { URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url_), testing::WebTestDataPath(), + WebString::FromUTF8(base_url_), testing::CoreTestDataPath(), WebString::FromUTF8(file_name)); }
diff --git a/third_party/WebKit/Source/core/frame/DOMTimerTest.cpp b/third_party/WebKit/Source/core/frame/DOMTimerTest.cpp index fabf068..4a11a8a 100644 --- a/third_party/WebKit/Source/core/frame/DOMTimerTest.cpp +++ b/third_party/WebKit/Source/core/frame/DOMTimerTest.cpp
@@ -17,9 +17,9 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using testing::DoubleNear; -using testing::ElementsAreArray; -using testing::Matcher; +using ::testing::DoubleNear; +using ::testing::ElementsAreArray; +using ::testing::Matcher; namespace blink {
diff --git a/third_party/WebKit/Source/core/frame/DOMWindow.cpp b/third_party/WebKit/Source/core/frame/DOMWindow.cpp index 1d00e718..0f86edb 100644 --- a/third_party/WebKit/Source/core/frame/DOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/DOMWindow.cpp
@@ -217,10 +217,10 @@ KURL target_url = IsLocalDOMWindow() ? blink::ToLocalDOMWindow(this)->document()->Url() - : KURL(KURL(), GetFrame() - ->GetSecurityContext() - ->GetSecurityOrigin() - ->ToString()); + : KURL(NullURL(), GetFrame() + ->GetSecurityContext() + ->GetSecurityOrigin() + ->ToString()); if (MixedContentChecker::IsMixedContent(source_document->GetSecurityOrigin(), target_url)) { UseCounter::Count(source->GetFrame(), @@ -315,7 +315,7 @@ // there isn't anything else to show other than "null" for its origin. KURL target_url = IsLocalDOMWindow() ? blink::ToLocalDOMWindow(this)->document()->Url() - : KURL(KURL(), target_origin->ToString()); + : KURL(NullURL(), target_origin->ToString()); if (GetFrame()->GetSecurityContext()->IsSandboxed(kSandboxOrigin) || calling_window->document()->IsSandboxed(kSandboxOrigin)) { message = "Blocked a frame at \"" +
diff --git a/third_party/WebKit/Source/web/tests/DeferredLoadingTest.cpp b/third_party/WebKit/Source/core/frame/DeferredLoadingTest.cpp similarity index 100% rename from third_party/WebKit/Source/web/tests/DeferredLoadingTest.cpp rename to third_party/WebKit/Source/core/frame/DeferredLoadingTest.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameSerializer.cpp b/third_party/WebKit/Source/core/frame/FrameSerializer.cpp index df5c806a..1ee0e76 100644 --- a/third_party/WebKit/Source/core/frame/FrameSerializer.cpp +++ b/third_party/WebKit/Source/core/frame/FrameSerializer.cpp
@@ -353,7 +353,7 @@ } else if (isHTMLStyleElement(element)) { HTMLStyleElement& style_element = toHTMLStyleElement(element); if (CSSStyleSheet* sheet = style_element.sheet()) - SerializeCSSStyleSheet(*sheet, KURL()); + SerializeCSSStyleSheet(*sheet, NullURL()); } } if (should_collect_problem_metric_) {
diff --git a/third_party/WebKit/Source/core/frame/FrameSerializerTest.cpp b/third_party/WebKit/Source/core/frame/FrameSerializerTest.cpp index a2f08c3..3e4963c 100644 --- a/third_party/WebKit/Source/core/frame/FrameSerializerTest.cpp +++ b/third_party/WebKit/Source/core/frame/FrameSerializerTest.cpp
@@ -81,7 +81,7 @@ void RegisterURL(const KURL& url, const char* file, const char* mime_type) { RegisterMockedURLLoad( - url, testing::WebTestDataPath(WebString::FromUTF8(folder_ + file)), + url, testing::CoreTestDataPath(WebString::FromUTF8(folder_ + file)), WebString::FromUTF8(mime_type)); }
diff --git a/third_party/WebKit/Source/core/frame/FrameTest.cpp b/third_party/WebKit/Source/core/frame/FrameTest.cpp index b5ac98b..d221c70 100644 --- a/third_party/WebKit/Source/core/frame/FrameTest.cpp +++ b/third_party/WebKit/Source/core/frame/FrameTest.cpp
@@ -25,10 +25,10 @@ Document& GetDocument() const { return dummy_page_holder_->GetDocument(); } void Navigate(const String& destinationUrl) { - const KURL& url = KURL(KURL(), destinationUrl); - FrameLoadRequest request( - nullptr, ResourceRequest(url), - SubstituteData(SharedBuffer::Create(), "text/html", "UTF-8", KURL())); + const KURL& url = KURL(NullURL(), destinationUrl); + FrameLoadRequest request(nullptr, ResourceRequest(url), + SubstituteData(SharedBuffer::Create(), "text/html", + "UTF-8", NullURL())); GetDocument().GetFrame()->Loader().Load(request); blink::testing::RunPendingTasks(); ASSERT_EQ(url.GetString(), GetDocument().Url().GetString());
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp index 4103d75..ea22e0a 100644 --- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -26,6 +26,10 @@ #include "core/frame/LocalDOMWindow.h" +#include <memory> +#include <string> +#include <utility> + #include "bindings/core/v8/ScriptController.h" #include "bindings/core/v8/SourceLocation.h" #include "bindings/core/v8/WindowProxy.h" @@ -91,8 +95,6 @@ #include "public/platform/WebScreenInfo.h" #include "public/platform/site_engagement.mojom-blink.h" -#include <memory> - namespace blink { // Timeout for link preloads to be used after window.onload @@ -265,11 +267,6 @@ return frame->IsMainFrame(); } -unsigned LocalDOMWindow::PendingUnloadEventListeners() const { - return WindowsWithUnloadEventListeners().count( - const_cast<LocalDOMWindow*>(this)); -} - LocalDOMWindow::LocalDOMWindow(LocalFrame& frame) : DOMWindow(frame), visualViewport_(DOMVisualViewport::Create(this)),
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.h b/third_party/WebKit/Source/core/frame/LocalDOMWindow.h index ccd8b4c..777a7c71 100644 --- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.h +++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.h
@@ -265,8 +265,6 @@ void FrameDestroyed(); void Reset(); - unsigned PendingUnloadEventListeners() const; - Element* frameElement() const; DOMWindow* open(const String& url_string,
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp index 605326f1..c642ebe1 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp +++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -257,15 +257,12 @@ if (!loader_.GetDocumentLoader()->GetHistoryItem()) return; FrameLoadRequest request = FrameLoadRequest( - nullptr, loader_.ResourceRequestForReload(load_type, KURL(), + nullptr, loader_.ResourceRequestForReload(load_type, NullURL(), client_redirect_policy)); request.SetClientRedirect(client_redirect_policy); loader_.Load(request, load_type); } else { - DCHECK_EQ(RuntimeEnabledFeatures::LocationHardReloadEnabled() - ? kFrameLoadTypeReloadBypassingCache - : kFrameLoadTypeReload, - load_type); + DCHECK_EQ(kFrameLoadTypeReload, load_type); navigation_scheduler_->ScheduleReload(); } }
diff --git a/third_party/WebKit/Source/core/frame/LocalFrameViewTest.cpp b/third_party/WebKit/Source/core/frame/LocalFrameViewTest.cpp index 3a7bf59c..a703ec3 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrameViewTest.cpp +++ b/third_party/WebKit/Source/core/frame/LocalFrameViewTest.cpp
@@ -23,8 +23,8 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using testing::_; -using testing::AnyNumber; +using ::testing::_; +using ::testing::AnyNumber; namespace blink { namespace { @@ -51,9 +51,9 @@ typedef bool TestParamRootLayerScrolling; class LocalFrameViewTest - : public testing::WithParamInterface<TestParamRootLayerScrolling>, + : public ::testing::WithParamInterface<TestParamRootLayerScrolling>, private ScopedRootLayerScrollingForTest, - public testing::Test { + public ::testing::Test { protected: LocalFrameViewTest() : ScopedRootLayerScrollingForTest(GetParam()), @@ -63,7 +63,7 @@ } ~LocalFrameViewTest() { - testing::Mock::VerifyAndClearExpectations(&ChromeClient()); + ::testing::Mock::VerifyAndClearExpectations(&ChromeClient()); } void SetUp() override {
diff --git a/third_party/WebKit/Source/core/frame/Location.cpp b/third_party/WebKit/Source/core/frame/Location.cpp index 78ad92a..07bac16f 100644 --- a/third_party/WebKit/Source/core/frame/Location.cpp +++ b/third_party/WebKit/Source/core/frame/Location.cpp
@@ -38,7 +38,6 @@ #include "core/frame/LocalDOMWindow.h" #include "core/frame/LocalFrame.h" #include "core/loader/FrameLoader.h" -#include "platform/RuntimeEnabledFeatures.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/SecurityOrigin.h" @@ -227,11 +226,8 @@ return; if (GetDocument()->Url().ProtocolIsJavaScript()) return; - dom_window_->GetFrame()->Reload( - RuntimeEnabledFeatures::LocationHardReloadEnabled() - ? kFrameLoadTypeReloadBypassingCache - : kFrameLoadTypeReload, - ClientRedirectPolicy::kClientRedirect); + dom_window_->GetFrame()->Reload(kFrameLoadTypeReload, + ClientRedirectPolicy::kClientRedirect); } void Location::SetLocation(const String& url,
diff --git a/third_party/WebKit/Source/core/frame/MHTMLTest.cpp b/third_party/WebKit/Source/core/frame/MHTMLTest.cpp new file mode 100644 index 0000000..3a7c535 --- /dev/null +++ b/third_party/WebKit/Source/core/frame/MHTMLTest.cpp
@@ -0,0 +1,340 @@ +/* + * Copyright (C) 2014 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "core/dom/Document.h" +#include "core/dom/Element.h" +#include "core/dom/ElementShadow.h" +#include "core/frame/FrameTestHelpers.h" +#include "core/frame/LocalFrame.h" +#include "core/frame/Location.h" +#include "core/frame/WebLocalFrameBase.h" +#include "core/page/Page.h" +#include "platform/SerializedResource.h" +#include "platform/SharedBuffer.h" +#include "platform/mhtml/MHTMLArchive.h" +#include "platform/mhtml/MHTMLParser.h" +#include "platform/testing/URLTestHelpers.h" +#include "platform/testing/UnitTestHelpers.h" +#include "platform/weborigin/KURL.h" +#include "platform/weborigin/SchemeRegistry.h" +#include "public/platform/Platform.h" +#include "public/platform/WebString.h" +#include "public/platform/WebURL.h" +#include "public/platform/WebURLLoaderMockFactory.h" +#include "public/platform/WebURLRequest.h" +#include "public/platform/WebURLResponse.h" +#include "public/web/WebDocument.h" +#include "public/web/WebFrame.h" +#include "public/web/WebView.h" +#include "testing/gtest/include/gtest/gtest.h" + +using blink::URLTestHelpers::ToKURL; + +namespace blink { + +class LineReader { + public: + LineReader(const std::string& text) : text_(text), index_(0) {} + bool GetNextLine(std::string* line) { + line->clear(); + if (index_ >= text_.length()) + return false; + + size_t end_of_line_index = text_.find("\r\n", index_); + if (end_of_line_index == std::string::npos) { + *line = text_.substr(index_); + index_ = text_.length(); + return true; + } + + *line = text_.substr(index_, end_of_line_index - index_); + index_ = end_of_line_index + 2; + return true; + } + + private: + std::string text_; + size_t index_; +}; + +class MHTMLTest : public ::testing::Test { + public: + MHTMLTest() { file_path_ = testing::CoreTestDataPath("mhtml/"); } + + protected: + void SetUp() override { helper_.Initialize(); } + + void TearDown() override { + Platform::Current() + ->GetURLLoaderMockFactory() + ->UnregisterAllURLsAndClearMemoryCache(); + } + + void RegisterMockedURLLoad(const std::string& url, + const std::string& file_name) { + URLTestHelpers::RegisterMockedURLLoad( + ToKURL(url), + testing::CoreTestDataPath(WebString::FromUTF8("mhtml/" + file_name)), + WebString::FromUTF8("multipart/related")); + } + + void LoadURLInTopFrame(const WebURL& url) { + FrameTestHelpers::LoadFrame(helper_.WebView()->MainFrameImpl(), + url.GetString().Utf8().data()); + } + + Page* GetPage() const { return helper_.WebView()->GetPage(); } + + void AddResource(const char* url, + const char* mime, + RefPtr<SharedBuffer> data) { + SerializedResource resource(ToKURL(url), mime, std::move(data)); + resources_.push_back(resource); + } + + void AddResource(const char* url, const char* mime, const char* file_name) { + AddResource(url, mime, ReadFile(file_name)); + } + + void AddTestResources() { + AddResource("http://www.test.com", "text/html", "css_test_page.html"); + AddResource("http://www.test.com/link_styles.css", "text/css", + "link_styles.css"); + AddResource("http://www.test.com/import_style_from_link.css", "text/css", + "import_style_from_link.css"); + AddResource("http://www.test.com/import_styles.css", "text/css", + "import_styles.css"); + AddResource("http://www.test.com/red_background.png", "image/png", + "red_background.png"); + AddResource("http://www.test.com/orange_background.png", "image/png", + "orange_background.png"); + AddResource("http://www.test.com/yellow_background.png", "image/png", + "yellow_background.png"); + AddResource("http://www.test.com/green_background.png", "image/png", + "green_background.png"); + AddResource("http://www.test.com/blue_background.png", "image/png", + "blue_background.png"); + AddResource("http://www.test.com/purple_background.png", "image/png", + "purple_background.png"); + AddResource("http://www.test.com/ul-dot.png", "image/png", "ul-dot.png"); + AddResource("http://www.test.com/ol-dot.png", "image/png", "ol-dot.png"); + } + + static PassRefPtr<RawData> GenerateMHTMLData( + const Vector<SerializedResource>& resources, + MHTMLArchive::EncodingPolicy encoding_policy, + const String& title, + const String& mime_type) { + // This boundary is as good as any other. Plus it gets used in almost + // all the examples in the MHTML spec - RFC 2557. + String boundary = String::FromUTF8("boundary-example"); + + RefPtr<RawData> mhtml_data = RawData::Create(); + MHTMLArchive::GenerateMHTMLHeader(boundary, title, mime_type, + *mhtml_data->MutableData()); + for (const auto& resource : resources) { + MHTMLArchive::GenerateMHTMLPart(boundary, String(), encoding_policy, + resource, *mhtml_data->MutableData()); + } + MHTMLArchive::GenerateMHTMLFooterForTesting(boundary, + *mhtml_data->MutableData()); + + // Validate the generated MHTML. + MHTMLParser parser( + SharedBuffer::Create(mhtml_data->data(), mhtml_data->length())); + EXPECT_FALSE(parser.ParseArchive().IsEmpty()) + << "Generated MHTML is malformed"; + + return mhtml_data; + } + + PassRefPtr<RawData> Serialize(const char* title, + const char* mime, + MHTMLArchive::EncodingPolicy encoding_policy) { + return GenerateMHTMLData(resources_, encoding_policy, title, mime); + } + + private: + PassRefPtr<SharedBuffer> ReadFile(const char* file_name) { + String file_path = file_path_ + file_name; + return testing::ReadFromFile(file_path); + } + + String file_path_; + Vector<SerializedResource> resources_; + FrameTestHelpers::WebViewHelper helper_; +}; + +// Checks that the domain is set to the actual MHTML file, not the URL it was +// generated from. +TEST_F(MHTMLTest, CheckDomain) { + const char kFileURL[] = "file:///simple_test.mht"; + + // Register the mocked frame and load it. + WebURL url = ToKURL(kFileURL); + RegisterMockedURLLoad(kFileURL, "simple_test.mht"); + LoadURLInTopFrame(url); + ASSERT_TRUE(GetPage()); + LocalFrame* frame = ToLocalFrame(GetPage()->MainFrame()); + ASSERT_TRUE(frame); + Document* document = frame->GetDocument(); + ASSERT_TRUE(document); + + EXPECT_STREQ(kFileURL, frame->DomWindow()->location()->href().Ascii().data()); + + SecurityOrigin* origin = document->GetSecurityOrigin(); + EXPECT_STRNE("localhost", origin->Domain().Ascii().data()); +} + +TEST_F(MHTMLTest, TestMHTMLEncoding) { + AddTestResources(); + RefPtr<RawData> data = Serialize("Test Serialization", "text/html", + MHTMLArchive::kUseDefaultEncoding); + + // Read the MHTML data line per line and do some pseudo-parsing to make sure + // the right encoding is used for the different sections. + LineReader line_reader(std::string(data->data(), data->length())); + int section_checked_count = 0; + const char* expected_encoding = 0; + std::string line; + while (line_reader.GetNextLine(&line)) { + if (line.compare(0, 13, "Content-Type:") == 0) { + ASSERT_FALSE(expected_encoding); + if (line.find("multipart/related;") != std::string::npos) { + // Skip this one, it's part of the MHTML header. + continue; + } + if (line.find("text/") != std::string::npos) + expected_encoding = "quoted-printable"; + else if (line.find("image/") != std::string::npos) + expected_encoding = "base64"; + else + FAIL() << "Unexpected Content-Type: " << line; + continue; + } + if (line.compare(0, 26, "Content-Transfer-Encoding:") == 0) { + ASSERT_TRUE(expected_encoding); + EXPECT_NE(line.find(expected_encoding), std::string::npos); + expected_encoding = 0; + section_checked_count++; + } + } + EXPECT_EQ(12, section_checked_count); +} + +TEST_F(MHTMLTest, MHTMLFromScheme) { + AddTestResources(); + RefPtr<RawData> raw_data = Serialize("Test Serialization", "text/html", + MHTMLArchive::kUseDefaultEncoding); + + RefPtr<SharedBuffer> data = + SharedBuffer::Create(raw_data->data(), raw_data->length()); + KURL http_url = ToKURL("http://www.example.com"); + KURL content_url = ToKURL("content://foo"); + KURL file_url = ToKURL("file://foo"); + KURL special_scheme_url = ToKURL("fooscheme://bar"); + + // MHTMLArchives can only be initialized from local schemes, http/https + // schemes, and content scheme(Android specific). + EXPECT_NE(nullptr, MHTMLArchive::Create(http_url, data.Get())); +#if OS(ANDROID) + EXPECT_NE(nullptr, MHTMLArchive::Create(content_url, data.Get())); +#else + EXPECT_EQ(nullptr, MHTMLArchive::Create(content_url, data.Get())); +#endif + EXPECT_NE(nullptr, MHTMLArchive::Create(file_url, data.Get())); + EXPECT_EQ(nullptr, MHTMLArchive::Create(special_scheme_url, data.Get())); + SchemeRegistry::RegisterURLSchemeAsLocal("fooscheme"); + EXPECT_NE(nullptr, MHTMLArchive::Create(special_scheme_url, data.Get())); +} + +// Checks that full sandboxing protection has been turned on. +TEST_F(MHTMLTest, EnforceSandboxFlags) { + const char kURL[] = "http://www.example.com"; + + // Register the mocked frame and load it. + RegisterMockedURLLoad(kURL, "page_with_javascript.mht"); + LoadURLInTopFrame(ToKURL(kURL)); + ASSERT_TRUE(GetPage()); + LocalFrame* frame = ToLocalFrame(GetPage()->MainFrame()); + ASSERT_TRUE(frame); + Document* document = frame->GetDocument(); + ASSERT_TRUE(document); + + // Full sandboxing with the exception to new top-level windows should be + // turned on. + EXPECT_EQ(kSandboxAll & ~(kSandboxPopups | + kSandboxPropagatesToAuxiliaryBrowsingContexts), + document->GetSandboxFlags()); + + // MHTML document should be loaded into unique origin. + EXPECT_TRUE(document->GetSecurityOrigin()->IsUnique()); + // Script execution should be disabled. + EXPECT_FALSE(document->CanExecuteScripts(kNotAboutToExecuteScript)); + + // The element to be created by the script is not there. + EXPECT_FALSE(document->getElementById("mySpan")); +} + +TEST_F(MHTMLTest, ShadowDom) { + const char kURL[] = "http://www.example.com"; + + // Register the mocked frame and load it. + RegisterMockedURLLoad(kURL, "shadow.mht"); + LoadURLInTopFrame(ToKURL(kURL)); + ASSERT_TRUE(GetPage()); + LocalFrame* frame = ToLocalFrame(GetPage()->MainFrame()); + ASSERT_TRUE(frame); + Document* document = frame->GetDocument(); + ASSERT_TRUE(document); + + EXPECT_TRUE(IsShadowHost(document->getElementById("h1"))); + EXPECT_TRUE(IsShadowHost(document->getElementById("h2"))); + // The nested shadow DOM tree is created. + EXPECT_TRUE(IsShadowHost(document->getElementById("h2") + ->Shadow() + ->OldestShadowRoot() + .getElementById("h3"))); + + EXPECT_TRUE(IsShadowHost(document->getElementById("h4"))); + // The static element in the shadow dom template is found. + EXPECT_TRUE(document->getElementById("h4") + ->Shadow() + ->OldestShadowRoot() + .getElementById("s1")); + // The element to be created by the script in the shadow dom template is + // not found because the script is blocked. + EXPECT_FALSE(document->getElementById("h4") + ->Shadow() + ->OldestShadowRoot() + .getElementById("s2")); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/frame/PerformanceMonitorTest.cpp b/third_party/WebKit/Source/core/frame/PerformanceMonitorTest.cpp index 44a279d..79303670 100644 --- a/third_party/WebKit/Source/core/frame/PerformanceMonitorTest.cpp +++ b/third_party/WebKit/Source/core/frame/PerformanceMonitorTest.cpp
@@ -56,13 +56,14 @@ void PerformanceMonitorTest::SetUp() { page_holder_ = DummyPageHolder::Create(IntSize(800, 600)); - page_holder_->GetDocument().SetURL(KURL(KURL(), "https://example.com/foo")); + page_holder_->GetDocument().SetURL( + KURL(NullURL(), "https://example.com/foo")); monitor_ = new PerformanceMonitor(GetFrame()); // Create another dummy page holder and pretend this is the iframe. another_page_holder_ = DummyPageHolder::Create(IntSize(400, 300)); another_page_holder_->GetDocument().SetURL( - KURL(KURL(), "https://iframed.com/bar")); + KURL(NullURL(), "https://iframed.com/bar")); } void PerformanceMonitorTest::TearDown() {
diff --git a/third_party/WebKit/Source/core/frame/UseCounterTest.cpp b/third_party/WebKit/Source/core/frame/UseCounterTest.cpp index 672dec8..230240b4 100644 --- a/third_party/WebKit/Source/core/frame/UseCounterTest.cpp +++ b/third_party/WebKit/Source/core/frame/UseCounterTest.cpp
@@ -391,7 +391,7 @@ CSSPropertyFontWeight, 3); // Or empty URLs (a main frame with no Document) - use_counter.DidCommitLoad(KURL()); + use_counter.DidCommitLoad(NullURL()); use_counter.RecordMeasurement(WebFeature::kFetch); use_counter.Count(kHTMLStandardMode, CSSPropertyFontWeight); ExpectHistograms(histogram_tester, 2, WebFeature::kFetch, 3,
diff --git a/third_party/WebKit/Source/core/frame/VisualViewportTest.cpp b/third_party/WebKit/Source/core/frame/VisualViewportTest.cpp index 9feffc0..26e5d5a 100644 --- a/third_party/WebKit/Source/core/frame/VisualViewportTest.cpp +++ b/third_party/WebKit/Source/core/frame/VisualViewportTest.cpp
@@ -157,7 +157,7 @@ void RegisterMockedHttpURLLoad(const std::string& fileName) { URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url_), blink::testing::WebTestDataPath(), + WebString::FromUTF8(base_url_), blink::testing::CoreTestDataPath(), WebString::FromUTF8(fileName)); } @@ -165,7 +165,7 @@ const std::string& fileName) { URLTestHelpers::RegisterMockedURLLoad( ToKURL(url), - blink::testing::WebTestDataPath(WebString::FromUTF8(fileName))); + blink::testing::CoreTestDataPath(WebString::FromUTF8(fileName))); } WebViewBase* WebViewImpl() const { return helper_.WebView(); }
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp index 38401ec..65bd1fa 100644 --- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp +++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
@@ -278,7 +278,7 @@ // // TODO(mkwst): Move this check up into the browser process. See // https://crbug.com/555418. - KURL url(KURL(), + KURL url(NullURL(), current->GetSecurityContext()->GetSecurityOrigin()->ToString()); if (!directive->Allows(url, ResourceRequest::RedirectStatus::kNoRedirect)) return false; @@ -428,7 +428,7 @@ // targets, as we won't have had a chance to redirect yet. ReportViolation( directive->GetText(), ContentSecurityPolicy::DirectiveType::kPluginTypes, - message + "\n", KURL(), ResourceRequest::RedirectStatus::kNoRedirect); + message + "\n", NullURL(), ResourceRequest::RedirectStatus::kNoRedirect); return DenyIfEnforcingPolicy(); }
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveListTest.cpp b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveListTest.cpp index 4c38b3d..f224619 100644 --- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveListTest.cpp +++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveListTest.cpp
@@ -159,7 +159,7 @@ for (const auto& test : cases) { SCOPED_TRACE(testing::Message() << "List: `" << test.list << "`, URL: `" << test.url << "`"); - KURL script_src = KURL(KURL(), test.url); + KURL script_src = KURL(NullURL(), test.url); // Report-only Member<CSPDirectiveList> directive_list = @@ -215,7 +215,7 @@ for (const auto& test : cases) { SCOPED_TRACE(testing::Message() << "List: `" << test.list << "`, URL: `" << test.url << "`"); - KURL resource = KURL(KURL(), test.url); + KURL resource = KURL(NullURL(), test.url); // Report-only 'script-src' Member<CSPDirectiveList> directive_list = @@ -353,7 +353,7 @@ SCOPED_TRACE(testing::Message() << "List: `" << test.list << "`, URL: `" << test.url << "`, Integrity: `" << test.integrity << "`"); - KURL resource = KURL(KURL(), test.url); + KURL resource = KURL(NullURL(), test.url); IntegrityMetadataSet integrity_metadata; ASSERT_EQ(SubresourceIntegrity::kIntegrityParseValidResult, @@ -485,7 +485,7 @@ }; for (const auto& test : cases) { - KURL resource = KURL(KURL(), test.url); + KURL resource = KURL(NullURL(), test.url); // Report-only Member<CSPDirectiveList> directive_list = CreateList(test.list, kContentSecurityPolicyHeaderTypeReport); @@ -540,7 +540,7 @@ for (const auto& test : cases) { SCOPED_TRACE(test.list); - KURL resource = KURL(KURL(), "https://example.test/worker.js"); + KURL resource = KURL(NullURL(), "https://example.test/worker.js"); Member<CSPDirectiveList> directive_list = CreateList(test.list, kContentSecurityPolicyHeaderTypeEnforce); EXPECT_EQ(test.allowed, @@ -585,7 +585,7 @@ for (const auto& test : cases) { SCOPED_TRACE(test.list); - KURL resource = KURL(KURL(), "https://example.test/worker.js"); + KURL resource = KURL(NullURL(), "https://example.test/worker.js"); Member<CSPDirectiveList> directive_list = CreateList(test.list, kContentSecurityPolicyHeaderTypeEnforce); EXPECT_EQ(test.allowed,
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp index 191e78b..4f1744f 100644 --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
@@ -824,6 +824,7 @@ case WebURLRequest::kRequestContextBeacon: case WebURLRequest::kRequestContextEventSource: case WebURLRequest::kRequestContextFetch: + case WebURLRequest::kRequestContextPing: case WebURLRequest::kRequestContextXMLHttpRequest: case WebURLRequest::kRequestContextSubresource: return AllowConnectToSource(url, redirect_status, reporting_policy, @@ -869,7 +870,6 @@ case WebURLRequest::kRequestContextHyperlink: case WebURLRequest::kRequestContextInternal: case WebURLRequest::kRequestContextLocation: - case WebURLRequest::kRequestContextPing: case WebURLRequest::kRequestContextPlugin: case WebURLRequest::kRequestContextPrefetch: case WebURLRequest::kRequestContextUnspecified:
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp index 3837880..cc56529 100644 --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp
@@ -128,8 +128,8 @@ kContentSecurityPolicyHeaderTypeReport, kContentSecurityPolicyHeaderSourceHTTP); - KURL example_url(KURL(), "http://example.com"); - KURL not_example_url(KURL(), "http://not-example.com"); + KURL example_url(NullURL(), "http://example.com"); + KURL not_example_url(NullURL(), "http://not-example.com"); ContentSecurityPolicy* csp2 = ContentSecurityPolicy::Create(); csp2->CopyStateFrom(csp.Get()); @@ -162,8 +162,8 @@ kContentSecurityPolicyHeaderTypeEnforce, kContentSecurityPolicyHeaderSourceHTTP); - KURL example_url(KURL(), "http://example.com"); - KURL not_example_url(KURL(), "http://not-example.com"); + KURL example_url(NullURL(), "http://example.com"); + KURL not_example_url(NullURL(), "http://not-example.com"); ContentSecurityPolicy* csp2 = ContentSecurityPolicy::Create(); csp2->CopyPluginTypesFrom(csp.Get()); @@ -250,7 +250,7 @@ // plugin, but not to subresource requests that the plugin itself // makes. https://crbug.com/603952 TEST_F(ContentSecurityPolicyTest, ObjectSrc) { - KURL url(KURL(), "https://example.test"); + KURL url(NullURL(), "https://example.test"); csp->BindToExecutionContext(execution_context.Get()); csp->DidReceiveHeader("object-src 'none';", kContentSecurityPolicyHeaderTypeEnforce, @@ -273,7 +273,7 @@ } TEST_F(ContentSecurityPolicyTest, ConnectSrc) { - KURL url(KURL(), "https://example.test"); + KURL url(NullURL(), "https://example.test"); csp->BindToExecutionContext(execution_context.Get()); csp->DidReceiveHeader("connect-src 'none';", kContentSecurityPolicyHeaderTypeEnforce, @@ -307,7 +307,7 @@ // Tests that requests for scripts and styles are blocked // if `require-sri-for` delivered in HTTP header requires integrity be present TEST_F(ContentSecurityPolicyTest, RequireSRIForInHeaderMissingIntegrity) { - KURL url(KURL(), "https://example.test"); + KURL url(NullURL(), "https://example.test"); // Enforce Persistent<ContentSecurityPolicy> policy = ContentSecurityPolicy::Create(); policy->BindToExecutionContext(execution_context.Get()); @@ -395,7 +395,7 @@ // Tests that requests for scripts and styles are allowed // if `require-sri-for` delivered in HTTP header requires integrity be present TEST_F(ContentSecurityPolicyTest, RequireSRIForInHeaderPresentIntegrity) { - KURL url(KURL(), "https://example.test"); + KURL url(NullURL(), "https://example.test"); IntegrityMetadataSet integrity_metadata; integrity_metadata.insert( IntegrityMetadata("1234", kHashAlgorithmSha384).ToPair()); @@ -478,7 +478,7 @@ // Tests that requests for scripts and styles are blocked // if `require-sri-for` delivered in meta tag requires integrity be present TEST_F(ContentSecurityPolicyTest, RequireSRIForInMetaMissingIntegrity) { - KURL url(KURL(), "https://example.test"); + KURL url(NullURL(), "https://example.test"); // Enforce Persistent<ContentSecurityPolicy> policy = ContentSecurityPolicy::Create(); policy->BindToExecutionContext(execution_context.Get()); @@ -567,7 +567,7 @@ // Tests that requests for scripts and styles are allowed // if `require-sri-for` delivered meta tag requires integrity be present TEST_F(ContentSecurityPolicyTest, RequireSRIForInMetaPresentIntegrity) { - KURL url(KURL(), "https://example.test"); + KURL url(NullURL(), "https://example.test"); IntegrityMetadataSet integrity_metadata; integrity_metadata.insert( IntegrityMetadata("1234", kHashAlgorithmSha384).ToPair()); @@ -668,7 +668,7 @@ SCOPED_TRACE(testing::Message() << "Policy: `" << test.policy << "`, URL: `" << test.url << "`, Nonce: `" << test.nonce << "`"); - KURL resource = KURL(KURL(), test.url); + KURL resource = KURL(NullURL(), test.url); unsigned expected_reports = test.allowed ? 0u : 1u; @@ -827,7 +827,7 @@ SCOPED_TRACE(testing::Message() << "Policy: `" << test.policy1 << "`/`" << test.policy2 << "`, URL: `" << test.url << "`, Nonce: `" << test.nonce << "`"); - KURL resource = KURL(KURL(), test.url); + KURL resource = KURL(NullURL(), test.url); unsigned expected_reports = test.allowed1 != test.allowed2 ? 1u : (test.allowed1 ? 0u : 2u);
diff --git a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp index b5cd50e..eacfe62 100644 --- a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp +++ b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp
@@ -49,27 +49,33 @@ bool DOMMatrixReadOnly::ValidateAndFixup(DOMMatrixInit& other, ExceptionState& exception_state) { - if (other.hasA() && other.hasM11() && other.a() != other.m11()) { + if (other.hasA() && other.hasM11() && other.a() != other.m11() && + !(std::isnan(other.a()) && std::isnan(other.m11()))) { exception_state.ThrowTypeError(GetErrorMessage("a", "m11")); return false; } - if (other.hasB() && other.hasM12() && other.b() != other.m12()) { + if (other.hasB() && other.hasM12() && other.b() != other.m12() && + !(std::isnan(other.b()) && std::isnan(other.m12()))) { exception_state.ThrowTypeError(GetErrorMessage("b", "m12")); return false; } - if (other.hasC() && other.hasM21() && other.c() != other.m21()) { + if (other.hasC() && other.hasM21() && other.c() != other.m21() && + !(std::isnan(other.c()) && std::isnan(other.m21()))) { exception_state.ThrowTypeError(GetErrorMessage("c", "m21")); return false; } - if (other.hasD() && other.hasM22() && other.d() != other.m22()) { + if (other.hasD() && other.hasM22() && other.d() != other.m22() && + !(std::isnan(other.d()) && std::isnan(other.m22()))) { exception_state.ThrowTypeError(GetErrorMessage("d", "m22")); return false; } - if (other.hasE() && other.hasM41() && other.e() != other.m41()) { + if (other.hasE() && other.hasM41() && other.e() != other.m41() && + !(std::isnan(other.e()) && std::isnan(other.m41()))) { exception_state.ThrowTypeError(GetErrorMessage("e", "m41")); return false; } - if (other.hasF() && other.hasM42() && other.f() != other.m42()) { + if (other.hasF() && other.hasM42() && other.f() != other.m42() && + !(std::isnan(other.f()) && std::isnan(other.m42()))) { exception_state.ThrowTypeError(GetErrorMessage("f", "m42")); return false; }
diff --git a/third_party/WebKit/Source/core/html/BUILD.gn b/third_party/WebKit/Source/core/html/BUILD.gn index 84cf436e..942e2a6 100644 --- a/third_party/WebKit/Source/core/html/BUILD.gn +++ b/third_party/WebKit/Source/core/html/BUILD.gn
@@ -551,6 +551,17 @@ "track/vtt/VTTTokenizer.h", ] + jumbo_excluded_sources = [ + "canvas/CanvasRenderingContext.cpp", # https://crbug.com/716395 + + # Does ugly things with undef (patch incoming) + "parser/HTMLTokenizer.cpp", + + # kSupportedTokens in both HTMLMediaElementControlsList.cpp + # and HTMLIFrameElementSandbox.cpp + "HTMLIFrameElementSandbox.cpp", + ] + configs += [ # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. "//build/config/compiler:no_size_t_to_int_warning",
diff --git a/third_party/WebKit/Source/core/html/HTMLContentElement.cpp b/third_party/WebKit/Source/core/html/HTMLContentElement.cpp index 110d869..cc90887 100644 --- a/third_party/WebKit/Source/core/html/HTMLContentElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLContentElement.cpp
@@ -48,7 +48,7 @@ inline HTMLContentElement::HTMLContentElement(Document& document, HTMLContentSelectFilter* filter) - : InsertionPoint(contentTag, document), + : V0InsertionPoint(contentTag, document), should_parse_select_(false), is_valid_selector_(true), filter_(filter) { @@ -59,7 +59,7 @@ DEFINE_TRACE(HTMLContentElement) { visitor->Trace(filter_); - InsertionPoint::Trace(visitor); + V0InsertionPoint::Trace(visitor); } void HTMLContentElement::ParseSelect() { @@ -83,7 +83,7 @@ should_parse_select_ = true; select_ = params.new_value; } else { - InsertionPoint::ParseAttribute(params); + V0InsertionPoint::ParseAttribute(params); } }
diff --git a/third_party/WebKit/Source/core/html/HTMLContentElement.h b/third_party/WebKit/Source/core/html/HTMLContentElement.h index 4ab69458..76cfb90 100644 --- a/third_party/WebKit/Source/core/html/HTMLContentElement.h +++ b/third_party/WebKit/Source/core/html/HTMLContentElement.h
@@ -33,7 +33,7 @@ #include "core/CoreExport.h" #include "core/css/CSSSelectorList.h" -#include "core/dom/InsertionPoint.h" +#include "core/dom/V0InsertionPoint.h" #include "platform/heap/Handle.h" namespace blink { @@ -48,7 +48,7 @@ DEFINE_INLINE_VIRTUAL_TRACE() {} }; -class CORE_EXPORT HTMLContentElement final : public InsertionPoint { +class CORE_EXPORT HTMLContentElement final : public V0InsertionPoint { DEFINE_WRAPPERTYPEINFO(); public:
diff --git a/third_party/WebKit/Source/core/html/HTMLEmbedElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLEmbedElementTest.cpp index 369fbec..ac9535d8 100644 --- a/third_party/WebKit/Source/core/html/HTMLEmbedElementTest.cpp +++ b/third_party/WebKit/Source/core/html/HTMLEmbedElementTest.cpp
@@ -14,7 +14,7 @@ namespace blink { -class HTMLEmbedElementTest : public testing::Test { +class HTMLEmbedElementTest : public ::testing::Test { protected: HTMLEmbedElementTest() {}
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLFrameElementTest.cpp index 68f4809..f7f8e3f 100644 --- a/third_party/WebKit/Source/core/html/HTMLFrameElementTest.cpp +++ b/third_party/WebKit/Source/core/html/HTMLFrameElementTest.cpp
@@ -16,7 +16,7 @@ // fullscreen feature should be unconditionally disabled. TEST_F(HTMLFrameElementTest, DefaultContainerPolicy) { Document* document = Document::Create(); - KURL document_url = KURL(KURL(), "http://example.com"); + KURL document_url = KURL(NullURL(), "http://example.com"); document->SetURL(document_url); document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url));
diff --git a/third_party/WebKit/Source/core/html/HTMLIFrameElementAllowTest.cpp b/third_party/WebKit/Source/core/html/HTMLIFrameElementAllowTest.cpp index 3b96561..6a79950 100644 --- a/third_party/WebKit/Source/core/html/HTMLIFrameElementAllowTest.cpp +++ b/third_party/WebKit/Source/core/html/HTMLIFrameElementAllowTest.cpp
@@ -9,7 +9,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using testing::UnorderedElementsAre; +using ::testing::UnorderedElementsAre; namespace blink {
diff --git a/third_party/WebKit/Source/core/html/HTMLIFrameElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLIFrameElementTest.cpp index f08d9bf..d59ccdb5 100644 --- a/third_party/WebKit/Source/core/html/HTMLIFrameElementTest.cpp +++ b/third_party/WebKit/Source/core/html/HTMLIFrameElementTest.cpp
@@ -40,7 +40,7 @@ // and that frames which should inherit their parent document's origin do so. TEST_F(HTMLIFrameElementTest, FramesUseCorrectOrigin) { Document* document = Document::Create(); - KURL document_url = KURL(KURL(), "http://example.com"); + KURL document_url = KURL(NullURL(), "http://example.com"); document->SetURL(document_url); document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url)); @@ -70,7 +70,7 @@ // sandboxed iframe. TEST_F(HTMLIFrameElementTest, SandboxFramesUseCorrectOrigin) { Document* document = Document::Create(); - KURL document_url = KURL(KURL(), "http://example.com"); + KURL document_url = KURL(NullURL(), "http://example.com"); document->SetURL(document_url); document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url)); @@ -95,7 +95,7 @@ // parent document's origin for the container policy. TEST_F(HTMLIFrameElementTest, SameOriginSandboxFramesUseCorrectOrigin) { Document* document = Document::Create(); - KURL document_url = KURL(KURL(), "http://example.com"); + KURL document_url = KURL(NullURL(), "http://example.com"); document->SetURL(document_url); document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url)); @@ -114,7 +114,7 @@ // container policy in a srcdoc iframe. TEST_F(HTMLIFrameElementTest, SrcdocFramesUseCorrectOrigin) { Document* document = Document::Create(); - KURL document_url = KURL(KURL(), "http://example.com"); + KURL document_url = KURL(NullURL(), "http://example.com"); document->SetURL(document_url); document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url)); @@ -131,7 +131,7 @@ // sandboxed iframe with a srcdoc. TEST_F(HTMLIFrameElementTest, SandboxedSrcdocFramesUseCorrectOrigin) { Document* document = Document::Create(); - KURL document_url = KURL(KURL(), "http://example.com"); + KURL document_url = KURL(NullURL(), "http://example.com"); document->SetURL(document_url); document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url)); @@ -150,7 +150,7 @@ // relative to the parent document. TEST_F(HTMLIFrameElementTest, RelativeURLsUseCorrectOrigin) { Document* document = Document::Create(); - KURL document_url = KURL(KURL(), "http://example.com"); + KURL document_url = KURL(NullURL(), "http://example.com"); document->SetURL(document_url); document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url)); @@ -176,7 +176,7 @@ // Test that the correct container policy is constructed on an iframe element. TEST_F(HTMLIFrameElementTest, DefaultContainerPolicy) { Document* document = Document::Create(); - KURL document_url = KURL(KURL(), "http://example.com"); + KURL document_url = KURL(NullURL(), "http://example.com"); document->SetURL(document_url); document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url)); @@ -194,7 +194,7 @@ // restricted to the domain in the src attribute. TEST_F(HTMLIFrameElementTest, AllowAttributeContainerPolicy) { Document* document = Document::Create(); - KURL document_url = KURL(KURL(), "http://example.com"); + KURL document_url = KURL(NullURL(), "http://example.com"); document->SetURL(document_url); document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url)); @@ -237,7 +237,7 @@ // policy which is restricted to a unique origin. TEST_F(HTMLIFrameElementTest, SandboxAttributeContainerPolicy) { Document* document = Document::Create(); - KURL document_url = KURL(KURL(), "http://example.com"); + KURL document_url = KURL(NullURL(), "http://example.com"); document->SetURL(document_url); document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url)); @@ -263,7 +263,7 @@ // containing document. TEST_F(HTMLIFrameElementTest, SameOriginSandboxAttributeContainerPolicy) { Document* document = Document::Create(); - KURL document_url = KURL(KURL(), "http://example.com"); + KURL document_url = KURL(NullURL(), "http://example.com"); document->SetURL(document_url); document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url)); @@ -289,7 +289,7 @@ // iframe element. TEST_F(HTMLIFrameElementTest, ConstructEmptyContainerPolicy) { Document* document = Document::Create(); - KURL document_url = KURL(KURL(), "http://example.com"); + KURL document_url = KURL(NullURL(), "http://example.com"); document->SetURL(document_url); document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url)); @@ -304,7 +304,7 @@ // to enable features in the frame. TEST_F(HTMLIFrameElementTest, ConstructContainerPolicy) { Document* document = Document::Create(); - KURL document_url = KURL(KURL(), "http://example.com"); + KURL document_url = KURL(NullURL(), "http://example.com"); document->SetURL(document_url); document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url)); @@ -331,7 +331,7 @@ // is used to enable fullscreen in the frame. TEST_F(HTMLIFrameElementTest, ConstructContainerPolicyWithAllowFullscreen) { Document* document = Document::Create(); - KURL document_url = KURL(KURL(), "http://example.com"); + KURL document_url = KURL(NullURL(), "http://example.com"); document->SetURL(document_url); document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url)); @@ -349,7 +349,7 @@ // attribute is used to enable the paymentrequest API in the frame. TEST_F(HTMLIFrameElementTest, ConstructContainerPolicyWithAllowPaymentRequest) { Document* document = Document::Create(); - KURL document_url = KURL(KURL(), "http://example.com"); + KURL document_url = KURL(NullURL(), "http://example.com"); document->SetURL(document_url); document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url)); @@ -378,7 +378,7 @@ // allowpaymentrequest,) while fullscreen should be enabled for all origins. TEST_F(HTMLIFrameElementTest, ConstructContainerPolicyWithAllowAttributes) { Document* document = Document::Create(); - KURL document_url = KURL(KURL(), "http://example.com"); + KURL document_url = KURL(NullURL(), "http://example.com"); document->SetURL(document_url); document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url));
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLImageElementTest.cpp index 2d1f8a8c..7747d29 100644 --- a/third_party/WebKit/Source/core/html/HTMLImageElementTest.cpp +++ b/third_party/WebKit/Source/core/html/HTMLImageElementTest.cpp
@@ -14,7 +14,7 @@ const int kViewportWidth = 500; const int kViewportHeight = 600; -class HTMLImageElementTest : public testing::Test { +class HTMLImageElementTest : public ::testing::Test { protected: HTMLImageElementTest() : dummy_page_holder_(
diff --git a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp index a126cc10..1f62bc8 100644 --- a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
@@ -39,10 +39,10 @@ #include "core/dom/AXObjectCache.h" #include "core/dom/Document.h" #include "core/dom/IdTargetObserver.h" -#include "core/dom/InsertionPoint.h" #include "core/dom/ShadowRoot.h" #include "core/dom/StyleChangeReason.h" #include "core/dom/TaskRunnerHelper.h" +#include "core/dom/V0InsertionPoint.h" #include "core/editing/FrameSelection.h" #include "core/editing/spellcheck/SpellChecker.h" #include "core/events/BeforeTextInsertedEvent.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp index 5903d766..c6447b4 100644 --- a/third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp +++ b/third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp
@@ -20,7 +20,7 @@ namespace blink { -class HTMLInputElementTest : public testing::Test { +class HTMLInputElementTest : public ::testing::Test { protected: Document& GetDocument() { return page_holder_->GetDocument(); } HTMLInputElement& TestElement() {
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp index b157134..d7c296d 100644 --- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
@@ -145,12 +145,11 @@ link_ = LinkManifest::Create(this); } else if (rel_attribute_.IsServiceWorker() && OriginTrials::linkServiceWorkerEnabled(GetExecutionContext())) { - if (GetDocument().GetFrame()) - link_ = GetDocument() - .GetFrame() - ->Loader() - .Client() - ->CreateServiceWorkerLinkResource(this); + if (GetDocument().GetFrame()) { + link_ = + GetDocument().GetFrame()->Client()->CreateServiceWorkerLinkResource( + this); + } } else { LinkStyle* link = LinkStyle::Create(this); if (FastHasAttribute(disabledAttr)) {
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElementSizesAttributeTest.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElementSizesAttributeTest.cpp index 672eb43d..20b0549 100644 --- a/third_party/WebKit/Source/core/html/HTMLLinkElementSizesAttributeTest.cpp +++ b/third_party/WebKit/Source/core/html/HTMLLinkElementSizesAttributeTest.cpp
@@ -11,7 +11,7 @@ namespace blink { -class HTMLLinkElementSizesAttributeTest : public testing::Test {}; +class HTMLLinkElementSizesAttributeTest : public ::testing::Test {}; TEST(HTMLLinkElementSizesAttributeTest, setSizesPropertyValue_updatesAttribute) {
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElementTest.cpp index efdfd2d..f27b606 100644 --- a/third_party/WebKit/Source/core/html/HTMLLinkElementTest.cpp +++ b/third_party/WebKit/Source/core/html/HTMLLinkElementTest.cpp
@@ -35,7 +35,7 @@ "</head>"); HTMLLinkElement* link_element = ToElement<HTMLLinkElement>(GetDocument().head()->firstChild()); - EXPECT_EQ(KURL(), link_element->Href()); + EXPECT_EQ(NullURL(), link_element->Href()); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/html/HTMLMetaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMetaElement.cpp index 54d78a2b..abd5300a 100644 --- a/third_party/WebKit/Source/core/html/HTMLMetaElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMetaElement.cpp
@@ -489,11 +489,7 @@ ViewportDescription::kMobileOptimizedMeta); else if (DeprecatedEqualIgnoringCase(name_value, "theme-color") && GetDocument().GetFrame()) - GetDocument() - .GetFrame() - ->Loader() - .Client() - ->DispatchDidChangeThemeColor(); + GetDocument().GetFrame()->Client()->DispatchDidChangeThemeColor(); } // Get the document to process the tag, but only if we're actually part of DOM
diff --git a/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp b/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp index e857502..b7348a4 100644 --- a/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp
@@ -287,7 +287,7 @@ // Overwrites the URL and MIME type of a Flash embed to use an HTML5 embed. KURL overriden_url = - GetDocument().GetFrame()->Loader().Client()->OverrideFlashEmbedWithHTML( + GetDocument().GetFrame()->Client()->OverrideFlashEmbedWithHTML( GetDocument().CompleteURL(url_)); if (!overriden_url.IsEmpty()) { url_ = overriden_url.GetString();
diff --git a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp index e69e0f3e..b0a216fa 100644 --- a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
@@ -233,11 +233,8 @@ return; if (!GetDocument().GetFrame() || - !GetDocument() - .GetFrame() - ->Loader() - .Client() - ->CanCreatePluginWithoutRenderer(service_type_)) + !GetDocument().GetFrame()->Client()->CanCreatePluginWithoutRenderer( + service_type_)) return; if (GetLayoutObject() && GetLayoutObject()->IsLayoutEmbeddedContent()) @@ -247,11 +244,8 @@ } void HTMLPlugInElement::CreatePluginWithoutLayoutObject() { - DCHECK(GetDocument() - .GetFrame() - ->Loader() - .Client() - ->CanCreatePluginWithoutRenderer(service_type_)); + DCHECK(GetDocument().GetFrame()->Client()->CanCreatePluginWithoutRenderer( + service_type_)); KURL url; // CSP can block src-less objects.
diff --git a/third_party/WebKit/Source/core/html/HTMLScriptElement.cpp b/third_party/WebKit/Source/core/html/HTMLScriptElement.cpp index 083d115..e8db754 100644 --- a/third_party/WebKit/Source/core/html/HTMLScriptElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLScriptElement.cpp
@@ -171,10 +171,6 @@ return Element::TextFromChildren(); } -String HTMLScriptElement::TextContent() const { - return Element::textContent(); -} - bool HTMLScriptElement::AsyncAttributeValue() const { return FastHasAttribute(asyncAttr); }
diff --git a/third_party/WebKit/Source/core/html/HTMLScriptElement.h b/third_party/WebKit/Source/core/html/HTMLScriptElement.h index 2a06418..d9f1a4ca 100644 --- a/third_party/WebKit/Source/core/html/HTMLScriptElement.h +++ b/third_party/WebKit/Source/core/html/HTMLScriptElement.h
@@ -86,7 +86,6 @@ String CrossOriginAttributeValue() const override; String IntegrityAttributeValue() const override; String TextFromChildren() override; - String TextContent() const override; bool AsyncAttributeValue() const override; bool DeferAttributeValue() const override; bool HasSourceAttribute() const override;
diff --git a/third_party/WebKit/Source/core/html/HTMLShadowElement.cpp b/third_party/WebKit/Source/core/html/HTMLShadowElement.cpp index b5409cd6..51f697a 100644 --- a/third_party/WebKit/Source/core/html/HTMLShadowElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLShadowElement.cpp
@@ -41,7 +41,7 @@ class Document; inline HTMLShadowElement::HTMLShadowElement(Document& document) - : InsertionPoint(HTMLNames::shadowTag, document) { + : V0InsertionPoint(HTMLNames::shadowTag, document) { UseCounter::Count(document, WebFeature::kHTMLShadowElement); } @@ -79,7 +79,7 @@ kRenderingMessageSource, kWarningMessageLevel, message)); } } - return InsertionPoint::InsertedInto(insertion_point); + return V0InsertionPoint::InsertedInto(insertion_point); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/html/HTMLShadowElement.h b/third_party/WebKit/Source/core/html/HTMLShadowElement.h index 6be83a2..3b831f36 100644 --- a/third_party/WebKit/Source/core/html/HTMLShadowElement.h +++ b/third_party/WebKit/Source/core/html/HTMLShadowElement.h
@@ -31,12 +31,12 @@ #ifndef HTMLShadowElement_h #define HTMLShadowElement_h -#include "core/dom/InsertionPoint.h" +#include "core/dom/V0InsertionPoint.h" #include "platform/wtf/Forward.h" namespace blink { -class HTMLShadowElement final : public InsertionPoint { +class HTMLShadowElement final : public V0InsertionPoint { DEFINE_WRAPPERTYPEINFO(); public:
diff --git a/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp b/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp index b86056fe..2548099 100644 --- a/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
@@ -33,11 +33,12 @@ #include <array> #include "core/HTMLNames.h" #include "core/dom/ElementShadow.h" -#include "core/dom/InsertionPoint.h" #include "core/dom/NodeTraversal.h" #include "core/dom/SlotAssignment.h" #include "core/dom/StyleChangeReason.h" #include "core/dom/StyleEngine.h" +#include "core/dom/V0InsertionPoint.h" +#include "core/dom/WhitespaceAttacher.h" #include "core/events/Event.h" #include "core/frame/UseCounter.h" #include "core/html/AssignedNodesOptions.h" @@ -183,15 +184,15 @@ HTMLElement::DetachLayoutTree(context); } -void HTMLSlotElement::RebuildDistributedChildrenLayoutTrees() { +void HTMLSlotElement::RebuildDistributedChildrenLayoutTrees( + WhitespaceAttacher& whitespace_attacher) { if (!SupportsDistribution()) return; - Text* next_text_sibling = nullptr; // This loop traverses the nodes from right to left for the same reason as the // one described in ContainerNode::RebuildChildrenLayoutTrees(). for (auto it = distributed_nodes_.rbegin(); it != distributed_nodes_.rend(); ++it) { - RebuildLayoutTreeForChild(*it, next_text_sibling); + RebuildLayoutTreeForChild(*it, whitespace_attacher); } }
diff --git a/third_party/WebKit/Source/core/html/HTMLSlotElement.h b/third_party/WebKit/Source/core/html/HTMLSlotElement.h index 2120c38..7d05af0 100644 --- a/third_party/WebKit/Source/core/html/HTMLSlotElement.h +++ b/third_party/WebKit/Source/core/html/HTMLSlotElement.h
@@ -75,7 +75,7 @@ void AttachLayoutTree(AttachContext&) final; void DetachLayoutTree(const AttachContext& = AttachContext()) final; - void RebuildDistributedChildrenLayoutTrees(); + void RebuildDistributedChildrenLayoutTrees(WhitespaceAttacher&); void AttributeChanged(const AttributeModificationParams&) final;
diff --git a/third_party/WebKit/Source/core/html/HTMLSlotElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLSlotElementTest.cpp index 1f05e6e..c07969f 100644 --- a/third_party/WebKit/Source/core/html/HTMLSlotElementTest.cpp +++ b/third_party/WebKit/Source/core/html/HTMLSlotElementTest.cpp
@@ -16,7 +16,7 @@ using Backtrack = std::pair<size_t, size_t>; } -class HTMLSlotElementTest : public testing::Test { +class HTMLSlotElementTest : public ::testing::Test { protected: HTMLSlotElementTest() {} Seq LongestCommonSubsequence(const Seq& seq1, const Seq& seq2);
diff --git a/third_party/WebKit/Source/core/html/ImageDocumentTest.cpp b/third_party/WebKit/Source/core/html/ImageDocumentTest.cpp index 53e744d..5a128192ca 100644 --- a/third_party/WebKit/Source/core/html/ImageDocumentTest.cpp +++ b/third_party/WebKit/Source/core/html/ImageDocumentTest.cpp
@@ -98,7 +98,7 @@ LocalFrame& frame = dummy_page_holder_->GetFrame(); frame.GetDocument()->Shutdown(); - DocumentInit init(KURL(), &frame); + DocumentInit init(NullURL(), &frame); frame.DomWindow()->InstallNewDocument("image/jpeg", init); }
diff --git a/third_party/WebKit/Source/core/html/LinkManifest.cpp b/third_party/WebKit/Source/core/html/LinkManifest.cpp index 5a9976f3..1d59adc5 100644 --- a/third_party/WebKit/Source/core/html/LinkManifest.cpp +++ b/third_party/WebKit/Source/core/html/LinkManifest.cpp
@@ -23,11 +23,7 @@ if (!owner_ || !owner_->GetDocument().GetFrame()) return; - owner_->GetDocument() - .GetFrame() - ->Loader() - .Client() - ->DispatchDidChangeManifest(); + owner_->GetDocument().GetFrame()->Client()->DispatchDidChangeManifest(); } bool LinkManifest::HasLoaded() const {
diff --git a/third_party/WebKit/Source/core/html/LinkStyle.cpp b/third_party/WebKit/Source/core/html/LinkStyle.cpp index 00230a06..df3ef93 100644 --- a/third_party/WebKit/Source/core/html/LinkStyle.cpp +++ b/third_party/WebKit/Source/core/html/LinkStyle.cpp
@@ -386,9 +386,8 @@ return; if (!GetDocument().GetContentSecurityPolicy()->AllowImageFromSource(href)) return; - if (GetDocument().GetFrame() && - GetDocument().GetFrame()->Loader().Client()) { - GetDocument().GetFrame()->Loader().Client()->DispatchDidChangeIcons( + if (GetDocument().GetFrame() && GetDocument().GetFrame()->Client()) { + GetDocument().GetFrame()->Client()->DispatchDidChangeIcons( owner_->RelAttribute().GetIconType()); } }
diff --git a/third_party/WebKit/Source/core/html/forms/ExternalPopupMenuTest.cpp b/third_party/WebKit/Source/core/html/forms/ExternalPopupMenuTest.cpp index d3a098f2..7bf73f86 100644 --- a/third_party/WebKit/Source/core/html/forms/ExternalPopupMenuTest.cpp +++ b/third_party/WebKit/Source/core/html/forms/ExternalPopupMenuTest.cpp
@@ -112,7 +112,7 @@ void RegisterMockedURLLoad(const std::string& file_name) { URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url_), testing::WebTestDataPath("popup"), + WebString::FromUTF8(base_url_), testing::CoreTestDataPath("popup"), WebString::FromUTF8(file_name), WebString::FromUTF8("text/html")); }
diff --git a/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp b/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp index 1196ea8..860b0b0 100644 --- a/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp +++ b/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp
@@ -99,9 +99,9 @@ MockInterfaceProvider interface_provider; std::unique_ptr<DummyPageHolder> page_holder = DummyPageHolder::Create( IntSize(2000, 2000), nullptr, nullptr, nullptr, &interface_provider); - page_holder->GetDocument().SetURL(KURL(KURL(), "https://example.test")); + page_holder->GetDocument().SetURL(KURL(NullURL(), "https://example.test")); page_holder->GetDocument().SetSecurityOrigin( - SecurityOrigin::Create(KURL(KURL(), "https://example.test"))); + SecurityOrigin::Create(KURL(NullURL(), "https://example.test"))); page_holder->GetDocument().body()->setInnerHTML("<input type='password'>"); page_holder->GetDocument().View()->UpdateAllLifecyclePhases(); // No message should have been sent from a secure context.
diff --git a/third_party/WebKit/Source/core/html/forms/URLInputType.cpp b/third_party/WebKit/Source/core/html/forms/URLInputType.cpp index d47e95e..e1fef8bd 100644 --- a/third_party/WebKit/Source/core/html/forms/URLInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/URLInputType.cpp
@@ -50,7 +50,7 @@ } bool URLInputType::TypeMismatchFor(const String& value) const { - return !value.IsEmpty() && !KURL(KURL(), value).IsValid(); + return !value.IsEmpty() && !KURL(NullURL(), value).IsValid(); } bool URLInputType::TypeMismatch() const {
diff --git a/third_party/WebKit/Source/core/html/media/AutoplayUmaHelperTest.cpp b/third_party/WebKit/Source/core/html/media/AutoplayUmaHelperTest.cpp index b67791f..0c50715e 100644 --- a/third_party/WebKit/Source/core/html/media/AutoplayUmaHelperTest.cpp +++ b/third_party/WebKit/Source/core/html/media/AutoplayUmaHelperTest.cpp
@@ -36,7 +36,7 @@ } }; -class AutoplayUmaHelperTest : public testing::Test { +class AutoplayUmaHelperTest : public ::testing::Test { protected: Document& GetDocument() { return page_holder_->GetDocument(); }
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp index bc7e3977..c0d2dc4 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -132,6 +132,7 @@ tokenizer_(sync_policy == kForceSynchronousParsing ? HTMLTokenizer::Create(options_) : nullptr), + script_runner_(this, nullptr), loading_task_runner_( TaskRunnerHelper::Get(TaskType::kNetworking, &document)), parser_scheduler_( @@ -178,6 +179,10 @@ HTMLParserScriptRunnerHost::Trace(visitor); } +DEFINE_TRACE_WRAPPERS(HTMLDocumentParser) { + visitor->TraceWrappers(script_runner_); +} + void HTMLDocumentParser::Detach() { if (!IsParsingFragment() && tokenized_chunk_queue_.Get() && tokenized_chunk_queue_->PeakPendingChunkCount()) {
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h index ebe1e2de..d8088c7b 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h +++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h
@@ -45,6 +45,7 @@ #include "core/html/parser/TextResourceDecoder.h" #include "core/html/parser/XSSAuditor.h" #include "core/html/parser/XSSAuditorDelegate.h" +#include "platform/bindings/TraceWrapperMember.h" #include "platform/wtf/Deque.h" #include "platform/wtf/RefPtr.h" #include "platform/wtf/WeakPtr.h" @@ -81,6 +82,7 @@ } ~HTMLDocumentParser() override; DECLARE_VIRTUAL_TRACE(); + DECLARE_TRACE_WRAPPERS(); // TODO(alexclarke): Remove when background parser goes away. void Dispose(); @@ -241,7 +243,7 @@ std::unique_ptr<HTMLToken> token_; std::unique_ptr<HTMLTokenizer> tokenizer_; - Member<HTMLParserScriptRunner> script_runner_; + TraceWrapperMember<HTMLParserScriptRunner> script_runner_; Member<HTMLTreeBuilder> tree_builder_; std::unique_ptr<HTMLPreloadScanner> preload_scanner_;
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParserTest.cpp b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParserTest.cpp index 2188bab..c09af06 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParserTest.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParserTest.cpp
@@ -28,11 +28,11 @@ bool is_prefetch_only_; }; -class HTMLDocumentParserTest : public testing::Test { +class HTMLDocumentParserTest : public ::testing::Test { protected: HTMLDocumentParserTest() : dummy_page_holder_(DummyPageHolder::Create()) { dummy_page_holder_->GetDocument().SetURL( - KURL(KURL(), "https://example.test")); + KURL(NullURL(), "https://example.test")); } HTMLDocumentParser* CreateParser(HTMLDocument& document) {
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp b/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp index a519349..9ed19cd 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
@@ -79,9 +79,10 @@ return value; } -bool DoExecuteScript(ScriptElementBase* element, - const Script* script, - const TextPosition& text_position) { +WARN_UNUSED_RESULT ScriptLoader::ExecuteScriptResult DoExecuteScript( + ScriptElementBase* element, + const Script* script, + const TextPosition& text_position) { ScriptLoader* script_loader = element->Loader(); DCHECK(script_loader); TRACE_EVENT_WITH_FLOW1("blink", "HTMLParserScriptRunner ExecuteScript", @@ -158,7 +159,7 @@ : reentry_permit_(reentry_permit), document_(document), host_(host), - parser_blocking_script_(nullptr) { + parser_blocking_script_(this, nullptr) { DCHECK(host_); } @@ -261,10 +262,15 @@ MonotonicallyIncreasingTime() - script_parser_blocking_time, script_loader->WasCreatedDuringDocumentWrite()); } - if (!DoExecuteScript(element, script, script_start_position)) { - script_loader->DispatchErrorEvent(); - } else { - element->DispatchLoadEvent(); + switch (DoExecuteScript(element, script, script_start_position)) { + case ScriptLoader::ExecuteScriptResult::kShouldFireErrorEvent: + script_loader->DispatchErrorEvent(); + break; + case ScriptLoader::ExecuteScriptResult::kShouldFireLoadEvent: + element->DispatchLoadEvent(); + break; + case ScriptLoader::ExecuteScriptResult::kShouldFireNone: + break; } } @@ -578,7 +584,8 @@ // "Add the element to the end of the list of scripts that will execute // when the document has finished parsing associated with the Document // of the parser that created the element." - scripts_to_execute_after_parsing_.push_back(pending_script); + scripts_to_execute_after_parsing_.push_back( + TraceWrapperMember<PendingScript>(this, pending_script)); } PendingScript* HTMLParserScriptRunner::RequestPendingScript( @@ -653,11 +660,22 @@ if (parser_blocking_script_) parser_blocking_script_->Dispose(); parser_blocking_script_ = nullptr; - ScriptSourceCode source_code(script->textContent(), + ScriptSourceCode source_code(element->TextFromChildren(), DocumentURLForScriptExecution(document_), script_start_position); - DoExecuteScript(element, ClassicScript::Create(source_code), - script_start_position); + switch (DoExecuteScript(element, ClassicScript::Create(source_code), + script_start_position)) { + case ScriptLoader::ExecuteScriptResult::kShouldFireLoadEvent: + // The load event is not fired because this is an inline script. + break; + + case ScriptLoader::ExecuteScriptResult::kShouldFireErrorEvent: + script_loader->DispatchErrorEvent(); + break; + + case ScriptLoader::ExecuteScriptResult::kShouldFireNone: + break; + } } } else { // 2nd Clause of Step 23. @@ -681,5 +699,10 @@ visitor->Trace(scripts_to_execute_after_parsing_); PendingScriptClient::Trace(visitor); } +DEFINE_TRACE_WRAPPERS(HTMLParserScriptRunner) { + visitor->TraceWrappers(parser_blocking_script_); + for (const auto& member : scripts_to_execute_after_parsing_) + visitor->TraceWrappers(member); +} } // namespace blink
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.h b/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.h index 6da466c..52b8f39b 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.h +++ b/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.h
@@ -29,6 +29,8 @@ #include "bindings/core/v8/ScriptStreamer.h" #include "core/dom/PendingScript.h" #include "core/html/parser/HTMLParserReentryPermit.h" +#include "platform/bindings/ScriptWrappable.h" +#include "platform/bindings/TraceWrapperMember.h" #include "platform/heap/Handle.h" #include "platform/loader/fetch/ResourceClient.h" #include "platform/wtf/Deque.h" @@ -50,8 +52,12 @@ // executing it when required. // // An HTMLParserScriptRunner is owned by its host, an HTMLDocumentParser. -class HTMLParserScriptRunner final : public PendingScriptClient { +class HTMLParserScriptRunner final + : public GarbageCollectedFinalized<HTMLParserScriptRunner>, + public PendingScriptClient, + public TraceWrapperBase { WTF_MAKE_NONCOPYABLE(HTMLParserScriptRunner); + USING_GARBAGE_COLLECTED_MIXIN(HTMLParserScriptRunner); public: static HTMLParserScriptRunner* Create(HTMLParserReentryPermit* reentry_permit, @@ -91,6 +97,7 @@ } DECLARE_TRACE(); + DECLARE_TRACE_WRAPPERS(); private: HTMLParserScriptRunner(HTMLParserReentryPermit*, @@ -126,10 +133,11 @@ Member<HTMLParserScriptRunnerHost> host_; // https://html.spec.whatwg.org/#pending-parsing-blocking-script - Member<PendingScript> parser_blocking_script_; + TraceWrapperMember<PendingScript> parser_blocking_script_; // https://html.spec.whatwg.org/#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing - HeapDeque<Member<PendingScript>> scripts_to_execute_after_parsing_; + HeapDeque<TraceWrapperMember<PendingScript>> + scripts_to_execute_after_parsing_; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp index eac0d94b..1180cfb0 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp
@@ -149,7 +149,7 @@ std::unique_ptr<PreloadRequest> preload_request_; }; -class HTMLPreloadScannerTest : public testing::Test { +class HTMLPreloadScannerTest : public ::testing::Test { protected: enum ViewportState { kViewportEnabled,
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloaderTest.cpp b/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloaderTest.cpp index 3ac54756..dd55969 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloaderTest.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloaderTest.cpp
@@ -41,7 +41,7 @@ mutable bool is_cross_origin_; }; -class HTMLResourcePreloaderTest : public testing::Test { +class HTMLResourcePreloaderTest : public ::testing::Test { protected: HTMLResourcePreloaderTest() : dummy_page_holder_(DummyPageHolder::Create()) {}
diff --git a/third_party/WebKit/Source/core/html/parser/MarkupTokenizerInlines.h b/third_party/WebKit/Source/core/html/parser/MarkupTokenizerInlines.h index a8714c1..78f93779 100644 --- a/third_party/WebKit/Source/core/html/parser/MarkupTokenizerInlines.h +++ b/third_party/WebKit/Source/core/html/parser/MarkupTokenizerInlines.h
@@ -28,6 +28,7 @@ #ifndef MarkupTokenizerInlines_h #define MarkupTokenizerInlines_h +#include "build/build_config.h" #include "platform/text/SegmentedString.h" namespace blink { @@ -49,7 +50,7 @@ source.AdvanceAndASSERT(*expected_characters++); } -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) // We need to disable the "unreachable code" warning because we want to assert // that some code points aren't reached in the state machine. #pragma warning(disable : 4702)
diff --git a/third_party/WebKit/Source/core/html/parser/TextResourceDecoderForFuzzing.h b/third_party/WebKit/Source/core/html/parser/TextResourceDecoderForFuzzing.h index 28abd933..9e44ae4 100644 --- a/third_party/WebKit/Source/core/html/parser/TextResourceDecoderForFuzzing.h +++ b/third_party/WebKit/Source/core/html/parser/TextResourceDecoderForFuzzing.h
@@ -28,7 +28,7 @@ case TextResourceDecoderOptions::kUseAllAutoDetection: return TextResourceDecoderOptions::CreateWithAutoDetection( FuzzedContentType(fuzzed_data), FuzzedEncoding(fuzzed_data), - WTF::TextEncoding(), KURL()); + WTF::TextEncoding(), NullURL()); case TextResourceDecoderOptions::kUseContentAndBOMBasedDetection: return TextResourceDecoderOptions(FuzzedContentType(fuzzed_data),
diff --git a/third_party/WebKit/Source/core/html/parser/XSSAuditorDelegate.cpp b/third_party/WebKit/Source/core/html/parser/XSSAuditorDelegate.cpp index 3d7a8e1..a75de00 100644 --- a/third_party/WebKit/Source/core/html/parser/XSSAuditorDelegate.cpp +++ b/third_party/WebKit/Source/core/html/parser/XSSAuditorDelegate.cpp
@@ -112,24 +112,25 @@ document_->AddConsoleMessage(ConsoleMessage::Create( kJSMessageSource, kErrorMessageLevel, xss_info.BuildConsoleError())); - FrameLoader& frame_loader = document_->GetFrame()->Loader(); + LocalFrame* local_frame = document_->GetFrame(); + FrameLoader& frame_loader = local_frame->Loader(); if (xss_info.did_block_entire_page_) frame_loader.StopAllLoaders(); - if (!did_send_notifications_ && frame_loader.Client()) { + if (!did_send_notifications_ && local_frame->Client()) { did_send_notifications_ = true; - frame_loader.Client()->DidDetectXSS(document_->Url(), + local_frame->Client()->DidDetectXSS(document_->Url(), xss_info.did_block_entire_page_); if (!report_url_.IsEmpty()) - PingLoader::SendViolationReport(document_->GetFrame(), report_url_, + PingLoader::SendViolationReport(local_frame, report_url_, GenerateViolationReport(xss_info), PingLoader::kXSSAuditorViolationReport); } if (xss_info.did_block_entire_page_) { - document_->GetFrame()->GetNavigationScheduler().SchedulePageBlock( + local_frame->GetNavigationScheduler().SchedulePageBlock( document_, ResourceError::BLOCKED_BY_XSS_AUDITOR); } }
diff --git a/third_party/WebKit/Source/core/input/ImeOnFocusTest.cpp b/third_party/WebKit/Source/core/input/ImeOnFocusTest.cpp index d4c73b0b..7a31ed0bc 100644 --- a/third_party/WebKit/Source/core/input/ImeOnFocusTest.cpp +++ b/third_party/WebKit/Source/core/input/ImeOnFocusTest.cpp
@@ -95,7 +95,7 @@ std::string frame) { ImeRequestTrackingWebViewClient client; RegisterMockedURLLoadFromBase(WebString::FromUTF8(base_url_), - testing::WebTestDataPath(), + testing::CoreTestDataPath(), WebString::FromUTF8(file_name)); WebViewBase* web_view = web_view_helper_.Initialize(nullptr, nullptr, &client); @@ -115,7 +115,7 @@ if (!frame.empty()) { RegisterMockedURLLoadFromBase(WebString::FromUTF8(base_url_), - testing::WebTestDataPath(), + testing::CoreTestDataPath(), WebString::FromUTF8(frame)); WebLocalFrame* child_frame = web_view->MainFrame()->FirstChild()->ToWebLocalFrame();
diff --git a/third_party/WebKit/Source/core/input/TouchActionTest.cpp b/third_party/WebKit/Source/core/input/TouchActionTest.cpp index df0f0bf..b72042e 100644 --- a/third_party/WebKit/Source/core/input/TouchActionTest.cpp +++ b/third_party/WebKit/Source/core/input/TouchActionTest.cpp
@@ -96,13 +96,13 @@ public: TouchActionTest() : base_url_("http://www.test.com/") { URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url_), testing::WebTestDataPath(), + WebString::FromUTF8(base_url_), testing::CoreTestDataPath(), "touch-action-tests.css"); URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url_), testing::WebTestDataPath(), + WebString::FromUTF8(base_url_), testing::CoreTestDataPath(), "touch-action-tests.js"); URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url_), testing::WebTestDataPath(), + WebString::FromUTF8(base_url_), testing::CoreTestDataPath(), "white-1x1.png"); } @@ -200,7 +200,7 @@ std::string file, TouchActionTrackingWebWidgetClient& client) { URLTestHelpers::RegisterMockedURLLoadFromBase(WebString::FromUTF8(base_url_), - testing::WebTestDataPath(), + testing::CoreTestDataPath(), WebString::FromUTF8(file)); // Note that JavaScript must be enabled for shadow DOM tests. WebViewBase* web_view = web_view_helper_.InitializeAndLoad(
diff --git a/third_party/WebKit/Source/core/inspector/BUILD.gn b/third_party/WebKit/Source/core/inspector/BUILD.gn index 9d6d7ee..ca9d502 100644 --- a/third_party/WebKit/Source/core/inspector/BUILD.gn +++ b/third_party/WebKit/Source/core/inspector/BUILD.gn
@@ -94,6 +94,21 @@ "WorkerThreadDebugger.h", ] + jumbo_excluded_sources = [ + # Collides with DOMPatchSupport.cpp (patch incoming) + "InspectorAnimationAgent.cpp", + + # Collides with InspectorPageAgent.cpp and + # NetworkResourcesData.cpp (patch incoming) + "InspectorNetworkAgent.cpp", + + # Collides with InspectorPageAgent.cpp (patch incoming) + "MainThreadDebugger.cpp", + + "InspectorOverlayAgent.cpp", # Way too many different "Response" + "InspectorEmulationAgent.cpp", # Way too many different "Response" + ] + configs += [ # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. "//build/config/compiler:no_size_t_to_int_warning",
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp index a2e047b..3397142 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
@@ -46,12 +46,12 @@ #include "core/dom/DocumentType.h" #include "core/dom/Element.h" #include "core/dom/ElementShadow.h" -#include "core/dom/InsertionPoint.h" #include "core/dom/Node.h" #include "core/dom/PseudoElement.h" #include "core/dom/ShadowRoot.h" #include "core/dom/StaticNodeList.h" #include "core/dom/Text.h" +#include "core/dom/V0InsertionPoint.h" #include "core/editing/serializers/Serialization.h" #include "core/frame/LocalFrame.h" #include "core/html/HTMLFrameOwnerElement.h" @@ -1459,9 +1459,9 @@ value->setXmlVersion(element->ownerDocument()->xmlVersion()); } - if (element->IsInsertionPoint()) { + if (element->IsV0InsertionPoint()) { value->setDistributedNodes( - BuildArrayForDistributedNodes(ToInsertionPoint(element))); + BuildArrayForDistributedNodes(ToV0InsertionPoint(element))); force_push_children = true; } if (isHTMLSlotElement(*element)) { @@ -1587,7 +1587,7 @@ std::unique_ptr<protocol::Array<protocol::DOM::BackendNode>> InspectorDOMAgent::BuildArrayForDistributedNodes( - InsertionPoint* insertion_point) { + V0InsertionPoint* insertion_point) { std::unique_ptr<protocol::Array<protocol::DOM::BackendNode>> distributed_nodes = protocol::Array<protocol::DOM::BackendNode>::create(); for (size_t i = 0; i < insertion_point->DistributedNodesSize(); ++i) { @@ -1949,10 +1949,10 @@ for (ShadowRoot* root = shadow_host->YoungestShadowRoot(); root; root = root->OlderShadowRoot()) { - const HeapVector<Member<InsertionPoint>>& insertion_points = + const HeapVector<Member<V0InsertionPoint>>& insertion_points = root->DescendantInsertionPoints(); for (const auto& it : insertion_points) { - InsertionPoint* insertion_point = it.Get(); + V0InsertionPoint* insertion_point = it.Get(); int insertion_point_id = document_node_to_id_map_->at(insertion_point); if (insertion_point_id) GetFrontend()->distributedNodesUpdated(
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h index a48cad1b..a20c2bf 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h
@@ -55,7 +55,7 @@ class ExceptionState; class FloatQuad; class HTMLSlotElement; -class InsertionPoint; +class V0InsertionPoint; class InspectedFrames; class InspectorHistory; class Node; @@ -288,7 +288,7 @@ std::unique_ptr<protocol::Array<protocol::DOM::Node>> BuildArrayForPseudoElements(Element*, NodeToIdMap* nodes_map); std::unique_ptr<protocol::Array<protocol::DOM::BackendNode>> - BuildArrayForDistributedNodes(InsertionPoint*); + BuildArrayForDistributedNodes(V0InsertionPoint*); std::unique_ptr<protocol::Array<protocol::DOM::BackendNode>> BuildDistributedNodesForSlot(HTMLSlotElement*);
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.cpp index 1ecd605..4395577 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.cpp
@@ -166,6 +166,9 @@ if (layoutNodeIndex != -1) value->setLayoutNodeIndex(layoutNodeIndex); + if (node->WillRespondToMouseClickEvents()) + value->setIsClickable(true); + if (node->IsElementNode()) { Element* element = ToElement(node); value->setAttributes(BuildArrayForElementAttributes(element)); @@ -217,6 +220,8 @@ Document* document = ToDocument(node); value->setDocumentURL(InspectorDOMAgent::DocumentURLString(document)); value->setBaseURL(InspectorDOMAgent::DocumentBaseURLString(document)); + if (document->ContentLanguage()) + value->setContentLanguage(document->ContentLanguage().Utf8().data()); } else if (node->IsDocumentTypeNode()) { DocumentType* doc_type = ToDocumentType(node); value->setPublicId(doc_type->publicId());
diff --git a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp index 3d773e7..cb21b97 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
@@ -51,6 +51,7 @@ #include "core/loader/ThreadableLoaderClient.h" #include "core/page/Page.h" #include "core/probe/CoreProbes.h" +#include "core/workers/WorkerGlobalScope.h" #include "core/xmlhttprequest/XMLHttpRequest.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/blob/BlobData.h" @@ -552,6 +553,7 @@ DEFINE_TRACE(InspectorNetworkAgent) { visitor->Trace(inspected_frames_); + visitor->Trace(worker_global_scope_); visitor->Trace(resources_data_); visitor->Trace(replay_xhrs_); visitor->Trace(replay_xhrs_to_be_deleted_); @@ -578,13 +580,13 @@ } void InspectorNetworkAgent::DidBlockRequest( - LocalFrame* frame, + ExecutionContext* execution_context, const ResourceRequest& request, DocumentLoader* loader, const FetchInitiatorInfo& initiator_info, ResourceRequestBlockedReason reason) { unsigned long identifier = CreateUniqueIdentifier(); - WillSendRequestInternal(frame, identifier, loader, request, + WillSendRequestInternal(execution_context, identifier, loader, request, ResourceResponse(), initiator_info); String request_id = IdentifiersFactory::RequestId(identifier); @@ -606,14 +608,14 @@ } void InspectorNetworkAgent::WillSendRequestInternal( - LocalFrame* frame, + ExecutionContext* execution_context, unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request, const ResourceResponse& redirect_response, const FetchInitiatorInfo& initiator_info) { String request_id = IdentifiersFactory::RequestId(identifier); - String loader_id = IdentifiersFactory::LoaderId(loader); + String loader_id = loader ? IdentifiersFactory::LoaderId(loader) : ""; resources_data_->ResourceCreated(request_id, loader_id, request.Url()); InspectorPageAgent::ResourceType type = InspectorPageAgent::kOtherResource; @@ -625,12 +627,14 @@ resources_data_->SetResourceType(request_id, type); } - String frame_id = - loader->GetFrame() ? IdentifiersFactory::FrameId(loader->GetFrame()) : ""; + String frame_id = loader && loader->GetFrame() + ? IdentifiersFactory::FrameId(loader->GetFrame()) + : ""; std::unique_ptr<protocol::Network::Initiator> initiator_object = - BuildInitiatorObject( - loader->GetFrame() ? loader->GetFrame()->GetDocument() : 0, - initiator_info); + BuildInitiatorObject(loader && loader->GetFrame() + ? loader->GetFrame()->GetDocument() + : nullptr, + initiator_info); if (initiator_info.name == FetchInitiatorTypeNames::document) { FrameNavigationInitiatorMap::iterator it = frame_navigation_initiator_map_.find(frame_id); @@ -641,8 +645,14 @@ std::unique_ptr<protocol::Network::Request> request_info( BuildObjectForResourceRequest(request)); - request_info->setMixedContentType(MixedContentTypeForContextType( - MixedContentChecker::ContextTypeForInspector(frame, request))); + // |loader| is null while inspecting worker if off-main-thread-fetch is + // enabled. TODO(horo): Refactor MixedContentChecker and set mixed content + // type even if |loader| is null. + if (loader) { + request_info->setMixedContentType(MixedContentTypeForContextType( + MixedContentChecker::ContextTypeForInspector(loader->GetFrame(), + request))); + } request_info->setReferrerPolicy( GetReferrerPolicy(request.GetReferrerPolicy())); @@ -650,17 +660,23 @@ request_info->setIsLinkPreload(true); String resource_type = InspectorPageAgent::ResourceTypeJson(type); + String documentURL = + loader ? UrlWithoutFragment(loader->Url()).GetString() + : UrlWithoutFragment(execution_context->Url()).GetString(); + Maybe<String> maybe_frame_id; + if (!frame_id.IsEmpty()) + maybe_frame_id = frame_id; GetFrontend()->requestWillBeSent( - request_id, frame_id, loader_id, - UrlWithoutFragment(loader->Url()).GetString(), std::move(request_info), + request_id, loader_id, documentURL, std::move(request_info), MonotonicallyIncreasingTime(), CurrentTime(), std::move(initiator_object), - BuildObjectForResourceResponse(redirect_response), resource_type); + BuildObjectForResourceResponse(redirect_response), resource_type, + std::move(maybe_frame_id)); if (pending_xhr_replay_data_ && !pending_xhr_replay_data_->Async()) GetFrontend()->flush(); } void InspectorNetworkAgent::WillSendRequest( - LocalFrame* frame, + ExecutionContext* execution_context, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, @@ -700,8 +716,8 @@ if (state_->booleanProperty(NetworkAgentState::kBypassServiceWorker, false)) request.SetServiceWorkerMode(WebURLRequest::ServiceWorkerMode::kNone); - WillSendRequestInternal(frame, identifier, loader, request, redirect_response, - initiator_info); + WillSendRequestInternal(execution_context, identifier, loader, request, + redirect_response, initiator_info); if (!host_id_.IsEmpty()) request.AddHTTPHeaderField( @@ -715,7 +731,6 @@ } void InspectorNetworkAgent::DidReceiveResourceResponse( - LocalFrame* frame, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, @@ -751,7 +766,9 @@ // doesn't affect Resource lifetime. if (cached_resource) resources_data_->AddResource(request_id, cached_resource); - String frame_id = IdentifiersFactory::FrameId(frame); + String frame_id = loader && loader->GetFrame() + ? IdentifiersFactory::FrameId(loader->GetFrame()) + : ""; String loader_id = loader ? IdentifiersFactory::LoaderId(loader) : ""; resources_data_->ResponseReceived(request_id, frame_id, response); resources_data_->SetResourceType(request_id, type); @@ -765,24 +782,28 @@ response_security_details->certificate); } - if (resource_response && !resource_is_empty) - GetFrontend()->responseReceived(request_id, frame_id, loader_id, - MonotonicallyIncreasingTime(), - InspectorPageAgent::ResourceTypeJson(type), - std::move(resource_response)); + if (resource_response && !resource_is_empty) { + Maybe<String> maybe_frame_id; + if (!frame_id.IsEmpty()) + maybe_frame_id = frame_id; + GetFrontend()->responseReceived( + request_id, loader_id, MonotonicallyIncreasingTime(), + InspectorPageAgent::ResourceTypeJson(type), + std::move(resource_response), std::move(maybe_frame_id)); + } // If we revalidated the resource and got Not modified, send content length // following didReceiveResponse as there will be no calls to didReceiveData // from the network stack. if (is_not_modified && cached_resource && cached_resource->EncodedSize()) - DidReceiveData(frame, identifier, 0, cached_resource->EncodedSize()); + DidReceiveData(identifier, loader, 0, cached_resource->EncodedSize()); } static bool IsErrorStatusCode(int status_code) { return status_code >= 400; } -void InspectorNetworkAgent::DidReceiveData(LocalFrame*, - unsigned long identifier, +void InspectorNetworkAgent::DidReceiveData(unsigned long identifier, + DocumentLoader* loader, const char* data, int data_length) { String request_id = IdentifiersFactory::RequestId(identifier); @@ -804,15 +825,14 @@ } void InspectorNetworkAgent::DidReceiveEncodedDataLength( - LocalFrame*, unsigned long identifier, int encoded_data_length) { String request_id = IdentifiersFactory::RequestId(identifier); resources_data_->AddPendingEncodedDataLength(request_id, encoded_data_length); } -void InspectorNetworkAgent::DidFinishLoading(LocalFrame*, - unsigned long identifier, +void InspectorNetworkAgent::DidFinishLoading(unsigned long identifier, + DocumentLoader*, double monotonic_finish_time, int64_t encoded_data_length, int64_t decoded_body_length) { @@ -849,8 +869,8 @@ const ResourceResponse& response, Resource* resource) { // Update the response and finish loading - DidReceiveResourceResponse(frame, identifier, loader, response, resource); - DidFinishLoading(frame, identifier, 0, + DidReceiveResourceResponse(identifier, loader, response, resource); + DidFinishLoading(identifier, loader, 0, WebURLLoaderClient::kUnknownEncodedDataLength, 0); } @@ -1263,6 +1283,8 @@ resource_data ? resource_data->DownloadedFileBlob() : nullptr; if (!blob) return false; + if (worker_global_scope_) + return true; LocalFrame* frame = IdentifiersFactory::FrameById(inspected_frames_, resource_data->FrameId()); return frame && frame->GetDocument(); @@ -1274,12 +1296,17 @@ NetworkResourcesData::ResourceData const* resource_data = resources_data_->Data(request_id); BlobDataHandle* blob = resource_data->DownloadedFileBlob(); - LocalFrame* frame = IdentifiersFactory::FrameById(inspected_frames_, - resource_data->FrameId()); - Document* document = frame->GetDocument(); InspectorFileReaderLoaderClient* client = new InspectorFileReaderLoaderClient( blob, resource_data->MimeType(), resource_data->TextEncodingName(), std::move(callback)); + if (worker_global_scope_) { + client->Start(worker_global_scope_); + return; + } + DCHECK(inspected_frames_); + LocalFrame* frame = IdentifiersFactory::FrameById(inspected_frames_, + resource_data->FrameId()); + Document* document = frame->GetDocument(); client->Start(document); } @@ -1395,6 +1422,9 @@ double download_throughput, double upload_throughput, Maybe<String> connection_type) { + if (!IsMainThread()) + return Response::Error("Not supported"); + WebConnectionType type = kWebConnectionTypeUnknown; if (connection_type.isJust()) { type = ToWebConnectionType(connection_type.fromJust()); @@ -1416,7 +1446,7 @@ // We should extract network cache state into a global entity which can be // queried from FrameLoader and other places. state_->setBoolean(NetworkAgentState::kCacheDisabled, cache_disabled); - if (cache_disabled) + if (cache_disabled && IsMainThread()) GetMemoryCache()->EvictResources(); return Response::OK(); } @@ -1453,6 +1483,8 @@ void InspectorNetworkAgent::DidCommitLoad(LocalFrame* frame, DocumentLoader* loader) { + DCHECK(inspected_frames_); + DCHECK(IsMainThread()); if (loader->GetFrame() != inspected_frames_->Root()) return; @@ -1506,11 +1538,14 @@ const KURL& url, String* content, bool* base64_encoded) { + DCHECK(document); + DCHECK(IsMainThread()); // First try to fetch content from the cached resource. Resource* cached_resource = document->Fetcher()->CachedResource(url); - if (!cached_resource) + if (!cached_resource) { cached_resource = GetMemoryCache()->ResourceForURL( url, document->Fetcher()->GetCacheIdentifier()); + } if (cached_resource && InspectorPageAgent::CachedResourceContent( cached_resource, content, base64_encoded)) return true; @@ -1536,17 +1571,25 @@ replay_xhrs_to_be_deleted_.clear(); } -InspectorNetworkAgent::InspectorNetworkAgent(InspectedFrames* inspected_frames) +InspectorNetworkAgent::InspectorNetworkAgent( + InspectedFrames* inspected_frames, + WorkerGlobalScope* worker_global_scope) : inspected_frames_(inspected_frames), + worker_global_scope_(worker_global_scope), resources_data_( NetworkResourcesData::Create(g_maximum_total_buffer_size, g_maximum_resource_buffer_size)), pending_request_(nullptr), remove_finished_replay_xhr_timer_( - TaskRunnerHelper::Get(TaskType::kUnspecedLoading, - inspected_frames->Root()), + inspected_frames ? TaskRunnerHelper::Get(TaskType::kUnspecedLoading, + inspected_frames->Root()) + : TaskRunnerHelper::Get(TaskType::kUnspecedLoading, + worker_global_scope), this, - &InspectorNetworkAgent::RemoveFinishedReplayXHRFired) {} + &InspectorNetworkAgent::RemoveFinishedReplayXHRFired) { + DCHECK((IsMainThread() && inspected_frames_ && !worker_global_scope_) || + (!IsMainThread() && !inspected_frames_ && worker_global_scope_)); +} void InspectorNetworkAgent::ShouldForceCORSPreflight(bool* result) { if (state_->booleanProperty(NetworkAgentState::kCacheDisabled, false))
diff --git a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h index 33c7cff..e9a8ed9 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h
@@ -57,15 +57,21 @@ class ThreadableLoaderClient; class XHRReplayData; class XMLHttpRequest; - class WebSocketHandshakeRequest; class WebSocketHandshakeResponse; +class WorkerGlobalScope; class CORE_EXPORT InspectorNetworkAgent final : public InspectorBaseAgent<protocol::Network::Metainfo> { public: static InspectorNetworkAgent* Create(InspectedFrames* inspected_frames) { - return new InspectorNetworkAgent(inspected_frames); + return new InspectorNetworkAgent(inspected_frames, nullptr); + } + static InspectorNetworkAgent* CreateForWorker( + WorkerGlobalScope* worker_global_scope) { + // TODO(horo): Extract the logc for frames and for workers into different + // classes. + return new InspectorNetworkAgent(nullptr, worker_global_scope); } void Restore() override; @@ -74,34 +80,32 @@ DECLARE_VIRTUAL_TRACE(); // Probes. - void DidBlockRequest(LocalFrame*, + void DidBlockRequest(ExecutionContext*, const ResourceRequest&, DocumentLoader*, const FetchInitiatorInfo&, ResourceRequestBlockedReason); void DidChangeResourcePriority(unsigned long identifier, ResourceLoadPriority); - void WillSendRequest(LocalFrame*, + void WillSendRequest(ExecutionContext*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirect_response, const FetchInitiatorInfo&); void MarkResourceAsCached(unsigned long identifier); - void DidReceiveResourceResponse(LocalFrame*, - unsigned long identifier, + void DidReceiveResourceResponse(unsigned long identifier, DocumentLoader*, const ResourceResponse&, Resource*); - void DidReceiveData(LocalFrame*, - unsigned long identifier, + void DidReceiveData(unsigned long identifier, + DocumentLoader*, const char* data, int data_length); - void DidReceiveEncodedDataLength(LocalFrame*, - unsigned long identifier, + void DidReceiveEncodedDataLength(unsigned long identifier, int encoded_data_length); - void DidFinishLoading(LocalFrame*, - unsigned long identifier, + void DidFinishLoading(unsigned long identifier, + DocumentLoader*, double monotonic_finish_time, int64_t encoded_data_length, int64_t decoded_body_length); @@ -230,10 +234,10 @@ bool CacheDisabled(); private: - explicit InspectorNetworkAgent(InspectedFrames*); + explicit InspectorNetworkAgent(InspectedFrames*, WorkerGlobalScope*); void Enable(int total_buffer_size, int resource_buffer_size); - void WillSendRequestInternal(LocalFrame*, + void WillSendRequestInternal(ExecutionContext*, unsigned long identifier, DocumentLoader*, const ResourceRequest&, @@ -253,7 +257,10 @@ std::unique_ptr<GetResponseBodyCallback>); void ClearPendingRequestData(); + // This is null while inspecting workers. Member<InspectedFrames> inspected_frames_; + // This is null while inspecting frames. + Member<WorkerGlobalScope> worker_global_scope_; String host_id_; Member<NetworkResourcesData> resources_data_;
diff --git a/third_party/WebKit/Source/core/inspector/InspectorOverlayAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorOverlayAgent.cpp index 3867549..c82ea827 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorOverlayAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorOverlayAgent.cpp
@@ -841,10 +841,10 @@ const WebData& overlay_page_html_resource = Platform::Current()->GetDataResource("InspectorOverlayPage.html"); - loader.Load( - FrameLoadRequest(0, ResourceRequest(BlankURL()), - SubstituteData(overlay_page_html_resource, "text/html", - "UTF-8", KURL(), kForceSynchronousLoad))); + loader.Load(FrameLoadRequest( + 0, ResourceRequest(BlankURL()), + SubstituteData(overlay_page_html_resource, "text/html", "UTF-8", + NullURL(), kForceSynchronousLoad))); v8::Isolate* isolate = ToIsolate(frame); ScriptState* script_state = ToScriptStateForMainWorld(frame); DCHECK(script_state);
diff --git a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp index e21edf3..3382b3d2 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
@@ -24,6 +24,7 @@ #include "core/layout/HitTestResult.h" #include "core/layout/LayoutImage.h" #include "core/layout/LayoutObject.h" +#include "core/loader/DocumentLoader.h" #include "core/loader/resource/CSSStyleSheetResource.h" #include "core/page/Page.h" #include "core/paint/PaintLayer.h" @@ -108,55 +109,59 @@ } void InspectorTraceEvents::WillSendRequest( - LocalFrame* frame, + ExecutionContext*, unsigned long identifier, - DocumentLoader*, + DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& redirect_response, const FetchInitiatorInfo&) { + LocalFrame* frame = loader ? loader->GetFrame() : nullptr; TRACE_EVENT_INSTANT1( "devtools.timeline", "ResourceSendRequest", TRACE_EVENT_SCOPE_THREAD, "data", InspectorSendRequestEvent::Data(identifier, frame, request)); - probe::AsyncTaskScheduled(frame->GetDocument(), "SendRequest", - AsyncId(identifier)); + probe::AsyncTaskScheduled(frame ? frame->GetDocument() : nullptr, + "SendRequest", AsyncId(identifier)); } void InspectorTraceEvents::DidReceiveResourceResponse( - LocalFrame* frame, unsigned long identifier, - DocumentLoader*, + DocumentLoader* loader, const ResourceResponse& response, Resource*) { + LocalFrame* frame = loader ? loader->GetFrame() : nullptr; TRACE_EVENT_INSTANT1( "devtools.timeline", "ResourceReceiveResponse", TRACE_EVENT_SCOPE_THREAD, "data", InspectorReceiveResponseEvent::Data(identifier, frame, response)); - probe::AsyncTask async_task(frame->GetDocument(), AsyncId(identifier), - "response"); + probe::AsyncTask async_task(frame ? frame->GetDocument() : nullptr, + AsyncId(identifier), "response"); } -void InspectorTraceEvents::DidReceiveData(LocalFrame* frame, - unsigned long identifier, +void InspectorTraceEvents::DidReceiveData(unsigned long identifier, + DocumentLoader* loader, const char* data, int encoded_data_length) { + LocalFrame* frame = loader ? loader->GetFrame() : nullptr; TRACE_EVENT_INSTANT1( "devtools.timeline", "ResourceReceivedData", TRACE_EVENT_SCOPE_THREAD, "data", InspectorReceiveDataEvent::Data(identifier, frame, encoded_data_length)); - probe::AsyncTask async_task(frame->GetDocument(), AsyncId(identifier), - "data"); + probe::AsyncTask async_task(frame ? frame->GetDocument() : nullptr, + AsyncId(identifier), "data"); } -void InspectorTraceEvents::DidFinishLoading(LocalFrame* frame, - unsigned long identifier, +void InspectorTraceEvents::DidFinishLoading(unsigned long identifier, + DocumentLoader* loader, double finish_time, int64_t encoded_data_length, int64_t decoded_body_length) { + LocalFrame* frame = loader ? loader->GetFrame() : nullptr; TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceFinish", TRACE_EVENT_SCOPE_THREAD, "data", InspectorResourceFinishEvent::Data( identifier, finish_time, false, encoded_data_length, decoded_body_length)); - probe::AsyncTask async_task(frame->GetDocument(), AsyncId(identifier)); + probe::AsyncTask async_task(frame ? frame->GetDocument() : nullptr, + AsyncId(identifier)); } void InspectorTraceEvents::DidFailLoading(unsigned long identifier,
diff --git a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h index 757aff16..748f68d 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h +++ b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h
@@ -75,24 +75,22 @@ protocol::UberDispatcher*, protocol::DictionaryValue*) override; void Dispose() override; - - void WillSendRequest(LocalFrame*, + void WillSendRequest(ExecutionContext*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirect_response, const FetchInitiatorInfo&); - void DidReceiveResourceResponse(LocalFrame*, - unsigned long identifier, + void DidReceiveResourceResponse(unsigned long identifier, DocumentLoader*, const ResourceResponse&, Resource*); - void DidReceiveData(LocalFrame*, - unsigned long identifier, + void DidReceiveData(unsigned long identifier, + DocumentLoader*, const char* data, int data_length); - void DidFinishLoading(LocalFrame*, - unsigned long identifier, + void DidFinishLoading(unsigned long identifier, + DocumentLoader*, double monotonic_finish_time, int64_t encoded_data_length, int64_t decoded_body_length);
diff --git a/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp b/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp index 08f91c4..3053528 100644 --- a/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp +++ b/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
@@ -32,13 +32,17 @@ #include "core/CoreProbeSink.h" #include "core/inspector/InspectorLogAgent.h" +#include "core/inspector/InspectorNetworkAgent.h" #include "core/inspector/InspectorTraceEvents.h" #include "core/inspector/WorkerThreadDebugger.h" #include "core/inspector/protocol/Protocol.h" +#include "core/loader/WorkerFetchContext.h" #include "core/probe/CoreProbes.h" #include "core/workers/WorkerBackingThread.h" +#include "core/workers/WorkerGlobalScope.h" #include "core/workers/WorkerReportingProxy.h" #include "core/workers/WorkerThread.h" +#include "platform/RuntimeEnabledFeatures.h" #include "platform/WebThreadSupportingGC.h" namespace blink { @@ -70,6 +74,12 @@ debugger_->ContextGroupId(thread_), nullptr); session->Append( new InspectorLogAgent(thread_->GetConsoleMessageStorage(), nullptr)); + if (thread_->GlobalScope()->IsWorkerGlobalScope() && + RuntimeEnabledFeatures::OffMainThreadFetchEnabled()) { + DCHECK(ToWorkerGlobalScope(thread_->GlobalScope())->GetFetchContext()); + session->Append(InspectorNetworkAgent::CreateForWorker( + ToWorkerGlobalScope(thread_->GlobalScope()))); + } if (sessions_.IsEmpty()) thread_->GetWorkerBackingThread().BackingThread().AddTaskObserver(this); sessions_.insert(session_id, session);
diff --git a/third_party/WebKit/Source/core/inspector/browser_protocol.json b/third_party/WebKit/Source/core/inspector/browser_protocol.json index a1d9555..c5ce1d31 100644 --- a/third_party/WebKit/Source/core/inspector/browser_protocol.json +++ b/third_party/WebKit/Source/core/inspector/browser_protocol.json
@@ -1582,15 +1582,15 @@ "description": "Fired when page is about to send HTTP request.", "parameters": [ { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." }, - { "name": "frameId", "$ref": "Page.FrameId", "description": "Frame identifier.", "experimental": true }, - { "name": "loaderId", "$ref": "LoaderId", "description": "Loader identifier." }, + { "name": "loaderId", "$ref": "LoaderId", "description": "Loader identifier. Empty string if the request is fetched form worker." }, { "name": "documentURL", "type": "string", "description": "URL of the document this request is loaded for." }, { "name": "request", "$ref": "Request", "description": "Request data." }, { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }, { "name": "wallTime", "$ref": "Timestamp", "experimental": true, "description": "UTC Timestamp." }, { "name": "initiator", "$ref": "Initiator", "description": "Request initiator." }, { "name": "redirectResponse", "optional": true, "$ref": "Response", "description": "Redirect response data." }, - { "name": "type", "$ref": "Page.ResourceType", "optional": true, "experimental": true, "description": "Type of this resource." } + { "name": "type", "$ref": "Page.ResourceType", "optional": true, "experimental": true, "description": "Type of this resource." }, + { "name": "frameId", "optional": true, "$ref": "Page.FrameId", "description": "Frame identifier.", "experimental": true } ] }, { @@ -1605,11 +1605,11 @@ "description": "Fired when HTTP response is available.", "parameters": [ { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." }, - { "name": "frameId", "$ref": "Page.FrameId", "description": "Frame identifier.", "experimental": true }, - { "name": "loaderId", "$ref": "LoaderId", "description": "Loader identifier." }, + { "name": "loaderId", "$ref": "LoaderId", "description": "Loader identifier. Empty string if the request is fetched form worker." }, { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }, { "name": "type", "$ref": "Page.ResourceType", "description": "Resource type." }, - { "name": "response", "$ref": "Response", "description": "Response data." } + { "name": "response", "$ref": "Response", "description": "Response data." }, + { "name": "frameId", "optional": true, "$ref": "Page.FrameId", "description": "Frame identifier.", "experimental": true } ] }, { @@ -3346,13 +3346,15 @@ { "name": "layoutNodeIndex", "type": "integer", "optional": true, "description": "The index of the node's related layout tree node in the <code>layoutTreeNodes</code> array returned by <code>getSnapshot</code>, if any." }, { "name": "documentURL", "type": "string", "optional": true, "description": "Document URL that <code>Document</code> or <code>FrameOwner</code> node points to." }, { "name": "baseURL", "type": "string", "optional": true, "description": "Base URL that <code>Document</code> or <code>FrameOwner</code> node uses for URL completion." }, + { "name": "contentLanguage", "type": "string", "optional": true, "description": "Only set for documents, contains the document's content language." }, { "name": "publicId", "type": "string", "optional": true, "description": "<code>DocumentType</code> node's publicId." }, { "name": "systemId", "type": "string", "optional": true, "description": "<code>DocumentType</code> node's systemId." }, { "name": "frameId", "$ref": "Page.FrameId", "optional": true, "description": "Frame ID for frame owner elements." }, { "name": "contentDocumentIndex", "type": "integer", "optional": true, "description": "The index of a frame owner element's content document in the <code>domNodes</code> array returned by <code>getSnapshot</code>, if any." }, { "name": "importedDocumentIndex", "type": "integer", "optional": true, "description": "Index of the imported document's node of a link element in the <code>domNodes</code> array returned by <code>getSnapshot</code>, if any." }, { "name": "templateContentIndex", "type": "integer", "optional": true, "description": "Index of the content node of a template element in the <code>domNodes</code> array returned by <code>getSnapshot</code>." }, - { "name": "pseudoType", "$ref": "DOM.PseudoType", "optional": true, "description": "Type of a pseudo element node." } + { "name": "pseudoType", "$ref": "DOM.PseudoType", "optional": true, "description": "Type of a pseudo element node." }, + { "name": "isClickable", "type": "boolean", "optional": true, "description": "Whether this DOM node responds to mouse clicks. This includes nodes that have had click event listeners attached via JavaScript as well as anchor tags that naturally navigate when clicked." } ], "description": "A Node in the DOM tree." },
diff --git a/third_party/WebKit/Source/core/layout/CollapsedBorderValueTest.cpp b/third_party/WebKit/Source/core/layout/CollapsedBorderValueTest.cpp index ca6c92b0..7ed70df 100644 --- a/third_party/WebKit/Source/core/layout/CollapsedBorderValueTest.cpp +++ b/third_party/WebKit/Source/core/layout/CollapsedBorderValueTest.cpp
@@ -9,7 +9,7 @@ namespace blink { -class CollapsedBorderValueTest : public testing::Test { +class CollapsedBorderValueTest : public ::testing::Test { protected: void ExpectInvisible(const CollapsedBorderValue& v, unsigned expected_width = 0) {
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp b/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp index da78da84..e991442 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
@@ -1034,66 +1034,6 @@ : LayoutBlockFlow::BorderBottom(); } -unsigned LayoutTableCell::CollapsedBorderHalfStart(bool outer) const { - UpdateCollapsedBorderValues(); - const auto* collapsed_border_values = this->GetCollapsedBorderValues(); - if (!collapsed_border_values) - return 0; - - const auto& border = collapsed_border_values->StartBorder(); - if (border.Exists()) { - return (border.Width() + - ((TableStyle().IsLeftToRightDirection() ^ outer) ? 1 : 0)) / - 2; // Give the extra pixel to top and left. - } - return 0; -} - -unsigned LayoutTableCell::CollapsedBorderHalfEnd(bool outer) const { - UpdateCollapsedBorderValues(); - const auto* collapsed_border_values = this->GetCollapsedBorderValues(); - if (!collapsed_border_values) - return 0; - - const auto& border = collapsed_border_values->EndBorder(); - if (border.Exists()) { - return (border.Width() + - ((TableStyle().IsLeftToRightDirection() ^ outer) ? 0 : 1)) / - 2; - } - return 0; -} - -unsigned LayoutTableCell::CollapsedBorderHalfBefore(bool outer) const { - UpdateCollapsedBorderValues(); - const auto* collapsed_border_values = this->GetCollapsedBorderValues(); - if (!collapsed_border_values) - return 0; - - const auto& border = collapsed_border_values->BeforeBorder(); - if (border.Exists()) { - return (border.Width() + - ((TableStyle().IsFlippedBlocksWritingMode() ^ outer) ? 0 : 1)) / - 2; // Give the extra pixel to top and left. - } - return 0; -} - -unsigned LayoutTableCell::CollapsedBorderHalfAfter(bool outer) const { - UpdateCollapsedBorderValues(); - const auto* collapsed_border_values = this->GetCollapsedBorderValues(); - if (!collapsed_border_values) - return 0; - - const auto& border = collapsed_border_values->AfterBorder(); - if (border.Exists()) { - return (border.Width() + - ((TableStyle().IsFlippedBlocksWritingMode() ^ outer) ? 1 : 0)) / - 2; - } - return 0; -} - void LayoutTableCell::Paint(const PaintInfo& paint_info, const LayoutPoint& paint_offset) const { TableCellPainter(*this).Paint(paint_info, paint_offset);
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableCell.h b/third_party/WebKit/Source/core/layout/LayoutTableCell.h index 06c189f8..73ea06c 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableCell.h +++ b/third_party/WebKit/Source/core/layout/LayoutTableCell.h
@@ -349,35 +349,75 @@ void ComputeOverflow(LayoutUnit old_client_after_edge, bool recompute_floats = false) override; - // Converts collapsed border half width from the table's logical orientation - // to physical orientation. - LogicalToPhysical<unsigned> LogicalCollapsedBorderHalfToPhysical( - bool outer) const { - return LogicalToPhysical<unsigned>( + using CollapsedBorderValuesMethod = + const CollapsedBorderValue& (CollapsedBorderValues::*)() const; + LogicalToPhysical<CollapsedBorderValuesMethod> + CollapsedBorderValuesMethodsPhysical() const { + return LogicalToPhysical<CollapsedBorderValuesMethod>( + // Collapsed border logical directions are in table's directions. TableStyle().GetWritingMode(), TableStyle().Direction(), - CollapsedBorderHalfStart(outer), CollapsedBorderHalfEnd(outer), - CollapsedBorderHalfBefore(outer), CollapsedBorderHalfAfter(outer)); + &CollapsedBorderValues::StartBorder, &CollapsedBorderValues::EndBorder, + &CollapsedBorderValues::BeforeBorder, + &CollapsedBorderValues::AfterBorder); + } + + // Give the extra pixel of half collapsed border to top and left. + static constexpr bool kInnerHalfPixelAsOneTop = true; + static constexpr bool kInnerHalfPixelAsOneRight = false; + static constexpr bool kInnerHalfPixelAsOneBottom = false; + static constexpr bool kInnerHalfPixelAsOneLeft = true; + + PhysicalToLogical<bool> InnerHalfPixelAsOneLogical() const { + return PhysicalToLogical<bool>( + // Collapsed border logical directions are in table's directions. + TableStyle().GetWritingMode(), TableStyle().Direction(), + kInnerHalfPixelAsOneTop, kInnerHalfPixelAsOneRight, + kInnerHalfPixelAsOneBottom, kInnerHalfPixelAsOneLeft); } unsigned CollapsedBorderHalfLeft(bool outer) const { - return LogicalCollapsedBorderHalfToPhysical(outer).Left(); + return CollapsedBorderHalf(kInnerHalfPixelAsOneLeft ^ outer, + CollapsedBorderValuesMethodsPhysical().Left()); } unsigned CollapsedBorderHalfRight(bool outer) const { - return LogicalCollapsedBorderHalfToPhysical(outer).Right(); + return CollapsedBorderHalf(kInnerHalfPixelAsOneRight ^ outer, + CollapsedBorderValuesMethodsPhysical().Right()); } unsigned CollapsedBorderHalfTop(bool outer) const { - return LogicalCollapsedBorderHalfToPhysical(outer).Top(); + return CollapsedBorderHalf(kInnerHalfPixelAsOneTop ^ outer, + CollapsedBorderValuesMethodsPhysical().Top()); } unsigned CollapsedBorderHalfBottom(bool outer) const { - return LogicalCollapsedBorderHalfToPhysical(outer).Bottom(); + return CollapsedBorderHalf(kInnerHalfPixelAsOneBottom ^ outer, + CollapsedBorderValuesMethodsPhysical().Bottom()); } // For the following methods, the 'start', 'end', 'before', 'after' directions // are all in the table's inline and block directions. - unsigned CollapsedBorderHalfStart(bool outer) const; - unsigned CollapsedBorderHalfEnd(bool outer) const; - unsigned CollapsedBorderHalfBefore(bool outer) const; - unsigned CollapsedBorderHalfAfter(bool outer) const; + unsigned CollapsedBorderHalfStart(bool outer) const { + return CollapsedBorderHalf(InnerHalfPixelAsOneLogical().Start() ^ outer, + &CollapsedBorderValues::StartBorder); + } + unsigned CollapsedBorderHalfEnd(bool outer) const { + return CollapsedBorderHalf(InnerHalfPixelAsOneLogical().End() ^ outer, + &CollapsedBorderValues::EndBorder); + } + unsigned CollapsedBorderHalfBefore(bool outer) const { + return CollapsedBorderHalf(InnerHalfPixelAsOneLogical().Before() ^ outer, + &CollapsedBorderValues::BeforeBorder); + } + unsigned CollapsedBorderHalfAfter(bool outer) const { + return CollapsedBorderHalf(InnerHalfPixelAsOneLogical().After() ^ outer, + &CollapsedBorderValues::AfterBorder); + } + + unsigned CollapsedBorderHalf(bool half_pixel_as_one, + CollapsedBorderValuesMethod m) const { + UpdateCollapsedBorderValues(); + if (const auto* values = GetCollapsedBorderValues()) + return ((values->*m)().Width() + (half_pixel_as_one ? 1 : 0)) / 2; + return 0; + } LogicalToPhysical<int> LogicalIntrinsicPaddingToPhysical() const { return LogicalToPhysical<int>(
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableCellTest.cpp b/third_party/WebKit/Source/core/layout/LayoutTableCellTest.cpp index 115acea..c2c688d 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableCellTest.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTableCellTest.cpp
@@ -290,6 +290,38 @@ EXPECT_EQ(8u, cell2->CollapsedOuterBorderEnd()); EXPECT_EQ(1u, cell2->CollapsedOuterBorderBefore()); EXPECT_EQ(2u, cell2->CollapsedOuterBorderAfter()); + + ToElement(cell1->Table()->GetNode()) + ->setAttribute(HTMLNames::styleAttr, + "writing-mode: vertical-rl; direction: rtl"); + GetDocument().View()->UpdateAllLifecyclePhases(); + + EXPECT_EQ(5, cell1->BorderLeft()); + EXPECT_EQ(0, cell1->BorderRight()); + EXPECT_EQ(8, cell1->BorderTop()); + EXPECT_EQ(0, cell1->BorderBottom()); + EXPECT_EQ(2, cell2->BorderLeft()); + EXPECT_EQ(1, cell2->BorderRight()); + EXPECT_EQ(8, cell2->BorderTop()); + EXPECT_EQ(7, cell2->BorderBottom()); + + EXPECT_EQ(0u, cell1->CollapsedInnerBorderStart()); + EXPECT_EQ(8u, cell1->CollapsedInnerBorderEnd()); + EXPECT_EQ(0u, cell1->CollapsedInnerBorderBefore()); + EXPECT_EQ(5u, cell1->CollapsedInnerBorderAfter()); + EXPECT_EQ(7u, cell2->CollapsedInnerBorderStart()); + EXPECT_EQ(8u, cell2->CollapsedInnerBorderEnd()); + EXPECT_EQ(1u, cell2->CollapsedInnerBorderBefore()); + EXPECT_EQ(2u, cell2->CollapsedInnerBorderAfter()); + + EXPECT_EQ(0u, cell1->CollapsedOuterBorderStart()); + EXPECT_EQ(7u, cell1->CollapsedOuterBorderEnd()); + EXPECT_EQ(0u, cell1->CollapsedOuterBorderBefore()); + EXPECT_EQ(5u, cell1->CollapsedOuterBorderAfter()); + EXPECT_EQ(8u, cell2->CollapsedOuterBorderStart()); + EXPECT_EQ(7u, cell2->CollapsedOuterBorderEnd()); + EXPECT_EQ(2u, cell2->CollapsedOuterBorderBefore()); + EXPECT_EQ(1u, cell2->CollapsedOuterBorderAfter()); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp b/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp index 54523c6..24d45c8c 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp
@@ -79,7 +79,7 @@ void RenderingTest::LoadAhem() { RefPtr<SharedBuffer> shared_buffer = - testing::ReadFromFile(testing::WebTestDataPath("Ahem.ttf")); + testing::ReadFromFile(testing::CoreTestDataPath("Ahem.ttf")); StringOrArrayBufferOrArrayBufferView buffer = StringOrArrayBufferOrArrayBufferView::fromArrayBuffer( DOMArrayBuffer::Create(shared_buffer));
diff --git a/third_party/WebKit/Source/core/layout/LayoutTestHelper.h b/third_party/WebKit/Source/core/layout/LayoutTestHelper.h index 04c19e7..7eb1013 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTestHelper.h +++ b/third_party/WebKit/Source/core/layout/LayoutTestHelper.h
@@ -66,7 +66,7 @@ Member<LocalFrame> parent_; }; -class RenderingTest : public testing::Test { +class RenderingTest : public ::testing::Test { USING_FAST_MALLOC(RenderingTest); public:
diff --git a/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp b/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp index bd9d5aa..79b58cf0 100644 --- a/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp +++ b/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp
@@ -13,7 +13,7 @@ typedef bool TestParamRootLayerScrolling; class MapCoordinatesTest - : public testing::WithParamInterface<TestParamRootLayerScrolling>, + : public ::testing::WithParamInterface<TestParamRootLayerScrolling>, private ScopedRootLayerScrollingForTest, public RenderingTest { public:
diff --git a/third_party/WebKit/Source/core/layout/OverflowModelTest.cpp b/third_party/WebKit/Source/core/layout/OverflowModelTest.cpp index e1dd6f0..95ad342 100644 --- a/third_party/WebKit/Source/core/layout/OverflowModelTest.cpp +++ b/third_party/WebKit/Source/core/layout/OverflowModelTest.cpp
@@ -44,7 +44,7 @@ return LayoutRect(0, 0, 100, 100); } -class SimpleOverflowModelTest : public testing::Test { +class SimpleOverflowModelTest : public ::testing::Test { protected: SimpleOverflowModelTest() : overflow_(InitialLayoutOverflow(), InitialVisualOverflow()) {} @@ -111,7 +111,7 @@ EXPECT_EQ(LayoutRect(500, 100, 100, 100), overflow_.VisualOverflowRect()); } -class BoxOverflowModelTest : public testing::Test { +class BoxOverflowModelTest : public ::testing::Test { protected: BoxOverflowModelTest() : overflow_(InitialLayoutOverflow(), InitialVisualOverflow()) {}
diff --git a/third_party/WebKit/Source/core/layout/PointerEventsHitRules.cpp b/third_party/WebKit/Source/core/layout/PointerEventsHitRules.cpp index 95855c4..0ba0c671 100644 --- a/third_party/WebKit/Source/core/layout/PointerEventsHitRules.cpp +++ b/third_party/WebKit/Source/core/layout/PointerEventsHitRules.cpp
@@ -124,5 +124,3 @@ } } // namespace blink - -// vim:ts=4:noet
diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp index e86d3b8..344d0c6 100644 --- a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp +++ b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
@@ -19,7 +19,7 @@ typedef bool TestParamRootLayerScrolling; class ScrollAnchorTest - : public testing::WithParamInterface<TestParamRootLayerScrolling>, + : public ::testing::WithParamInterface<TestParamRootLayerScrolling>, private ScopedRootLayerScrollingForTest, public RenderingTest { public:
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp index 5ffe801..6a631dc 100644 --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
@@ -17,7 +17,7 @@ typedef bool TestParamRootLayerScrolling; class CompositedLayerMappingTest - : public testing::WithParamInterface<TestParamRootLayerScrolling>, + : public ::testing::WithParamInterface<TestParamRootLayerScrolling>, private ScopedRootLayerScrollingForTest, public RenderingTest { public:
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositorWorkerTest.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositorWorkerTest.cpp index a0dce8a9..69e02407 100644 --- a/third_party/WebKit/Source/core/layout/compositing/CompositorWorkerTest.cpp +++ b/third_party/WebKit/Source/core/layout/compositing/CompositorWorkerTest.cpp
@@ -63,7 +63,7 @@ void RegisterMockedHttpURLLoad(const std::string& file_name) { URLTestHelpers::RegisterMockedURLLoadFromBase( - base_url_, testing::WebTestDataPath(), WebString::FromUTF8(file_name)); + base_url_, testing::CoreTestDataPath(), WebString::FromUTF8(file_name)); } WebLayer* GetRootScrollLayer() {
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc index b4df24dc..5fa4b4d2 100644 --- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc +++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
@@ -163,57 +163,8 @@ return text_index; } -} // namespace - -NGInlineNode::NGInlineNode(LayoutNGBlockFlow* block) - : NGLayoutInputNode(block) { - DCHECK(block); - block->SetLayoutNGInline(true); - if (!block->HasNGInlineNodeData()) - block->ResetNGInlineNodeData(); -} - -NGInlineItemRange NGInlineNode::Items(unsigned start, unsigned end) { - return NGInlineItemRange(&MutableData().items_, start, end); -} - -void NGInlineNode::InvalidatePrepareLayout() { - ToLayoutNGBlockFlow(GetLayoutBlockFlow())->ResetNGInlineNodeData(); - MutableData().text_content_ = String(); - MutableData().items_.clear(); -} - -void NGInlineNode::PrepareLayout() { - // Scan list of siblings collecting all in-flow non-atomic inlines. A single - // NGInlineNode represent a collection of adjacent non-atomic inlines. - CollectInlines(); - SegmentText(); - ShapeText(); -} - -// TODO(xiaochengh): Remove this forward declaration, and move the function body -// to the anonymous namespace. -static LayoutBox* CollectInlinesInternal(LayoutBlockFlow*, - NGInlineItemsBuilder*); - -// Depth-first-scan of all LayoutInline and LayoutText nodes that make up this -// NGInlineNode object. Collects LayoutText items, merging them up into the -// parent LayoutInline where possible, and joining all text content in a single -// string to allow bidi resolution and shaping of the entire block. -void NGInlineNode::CollectInlines() { - DCHECK(Data().text_content_.IsNull()); - DCHECK(Data().items_.IsEmpty()); - NGInlineItemsBuilder builder(&MutableData().items_); - MutableData().next_sibling_ = - CollectInlinesInternal(GetLayoutBlockFlow(), &builder); - MutableData().text_content_ = builder.ToString(); - MutableData().is_bidi_enabled_ = - !Data().text_content_.IsEmpty() && - !(Data().text_content_.Is8Bit() && !builder.HasBidiControls()); -} - -static LayoutBox* CollectInlinesInternal(LayoutBlockFlow* block, - NGInlineItemsBuilder* builder) { +LayoutBox* CollectInlinesInternal(LayoutBlockFlow* block, + NGInlineItemsBuilder* builder) { builder->EnterBlock(block->Style()); LayoutObject* node = block->FirstChild(); LayoutBox* next_box = nullptr; @@ -280,6 +231,50 @@ return next_box; } +} // namespace + +NGInlineNode::NGInlineNode(LayoutNGBlockFlow* block) + : NGLayoutInputNode(block) { + DCHECK(block); + block->SetLayoutNGInline(true); + if (!block->HasNGInlineNodeData()) + block->ResetNGInlineNodeData(); +} + +NGInlineItemRange NGInlineNode::Items(unsigned start, unsigned end) { + return NGInlineItemRange(&MutableData().items_, start, end); +} + +void NGInlineNode::InvalidatePrepareLayout() { + ToLayoutNGBlockFlow(GetLayoutBlockFlow())->ResetNGInlineNodeData(); + MutableData().text_content_ = String(); + MutableData().items_.clear(); +} + +void NGInlineNode::PrepareLayout() { + // Scan list of siblings collecting all in-flow non-atomic inlines. A single + // NGInlineNode represent a collection of adjacent non-atomic inlines. + CollectInlines(); + SegmentText(); + ShapeText(); +} + +// Depth-first-scan of all LayoutInline and LayoutText nodes that make up this +// NGInlineNode object. Collects LayoutText items, merging them up into the +// parent LayoutInline where possible, and joining all text content in a single +// string to allow bidi resolution and shaping of the entire block. +void NGInlineNode::CollectInlines() { + DCHECK(Data().text_content_.IsNull()); + DCHECK(Data().items_.IsEmpty()); + NGInlineItemsBuilder builder(&MutableData().items_); + MutableData().next_sibling_ = + CollectInlinesInternal(GetLayoutBlockFlow(), &builder); + MutableData().text_content_ = builder.ToString(); + MutableData().is_bidi_enabled_ = + !Data().text_content_.IsEmpty() && + !(Data().text_content_.Is8Bit() && !builder.HasBidiControls()); +} + void NGInlineNode::SegmentText() { NGInlineNodeData& data = MutableData(); if (!data.is_bidi_enabled_) {
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc index b277bea9..f2543da 100644 --- a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc +++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc
@@ -417,8 +417,9 @@ RefPtr<NGUnpositionedFloat> unpositioned_float = NGUnpositionedFloat::Create( constraint_space_->AvailableSize(), constraint_space_->PercentageResolutionSize(), - constraint_space_->BfcOffset(), constraint_space_->BfcOffset(), margins, - node, /* break_token */ nullptr); + constraint_space_->BfcOffset().inline_offset, + constraint_space_->BfcOffset().inline_offset, margins, node, + /* break_token */ nullptr); LayoutUnit inline_size = ComputeInlineSizeForUnpositionedFloat( constraint_space_, unpositioned_float.Get()); @@ -438,14 +439,12 @@ } else { NGLogicalOffset container_bfc_offset = container_builder_->BfcOffset().value(); - unpositioned_float->origin_offset = container_bfc_offset + content_offset_; - unpositioned_float->from_offset.block_offset = - container_bfc_offset.block_offset; - unpositioned_float->parent_bfc_block_offset = - container_bfc_offset.block_offset; + LayoutUnit origin_block_offset = + container_bfc_offset.block_offset + content_offset_.block_offset; container_builder_->AddPositionedFloat( - PositionFloat(unpositioned_float.Get(), constraint_space_)); + PositionFloat(origin_block_offset, container_bfc_offset.block_offset, + unpositioned_float.Get(), constraint_space_)); // We need to recalculate the available_width as the float probably // consumed space on the line.
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_base_layout_algorithm_test.h b/third_party/WebKit/Source/core/layout/ng/ng_base_layout_algorithm_test.h index 1e007240..e56f692 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_base_layout_algorithm_test.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_base_layout_algorithm_test.h
@@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef NG_BASE_LAYOUT_ALGORITHM_TEST_H_ +#define NG_BASE_LAYOUT_ALGORITHM_TEST_H_ + #include "core/layout/LayoutTestHelper.h" #include "core/dom/Element.h" @@ -28,3 +31,5 @@ }; } // namespace blink + +#endif // NG_BASE_LAYOUT_ALGORITHM_TEST_H_
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc index 45e959e..24d4112 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
@@ -91,32 +91,21 @@ } } -void PositionPendingFloatsFromOffset(LayoutUnit origin_block_offset, - LayoutUnit from_block_offset, - NGFragmentBuilder* container_builder, - NGConstraintSpace* space) { - DCHECK(container_builder->BfcOffset()) - << "Parent BFC offset should be known here"; - const auto& unpositioned_floats = container_builder->UnpositionedFloats(); - const auto positioned_floats = - PositionFloats(origin_block_offset, from_block_offset, - container_builder->BfcOffset().value().block_offset, - unpositioned_floats, space); - for (const auto& positioned_float : positioned_floats) - container_builder->AddPositionedFloat(positioned_float); - - container_builder->MutableUnpositionedFloats().clear(); -} - void PositionPendingFloats(LayoutUnit origin_block_offset, NGFragmentBuilder* container_builder, NGConstraintSpace* space) { DCHECK(container_builder->BfcOffset()) << "Parent BFC offset should be known here"; - LayoutUnit from_block_offset = - container_builder->BfcOffset().value().block_offset; - PositionPendingFloatsFromOffset(origin_block_offset, from_block_offset, - container_builder, space); + + const auto& unpositioned_floats = container_builder->UnpositionedFloats(); + const auto positioned_floats = PositionFloats( + origin_block_offset, container_builder->BfcOffset().value().block_offset, + unpositioned_floats, space); + + for (const auto& positioned_float : positioned_floats) + container_builder->AddPositionedFloat(positioned_float); + + container_builder->MutableUnpositionedFloats().clear(); } NGBlockLayoutAlgorithm::NGBlockLayoutAlgorithm(NGBlockNode node, @@ -374,11 +363,13 @@ // Calculate margins in the BFC's writing mode. NGBoxStrut margins = CalculateMargins(child); - NGLogicalOffset origin_offset = constraint_space_->BfcOffset(); - origin_offset.inline_offset += border_scrollbar_padding_.inline_start; + LayoutUnit origin_inline_offset = + constraint_space_->BfcOffset().inline_offset + + border_scrollbar_padding_.inline_start; + RefPtr<NGUnpositionedFloat> unpositioned_float = NGUnpositionedFloat::Create( - child_available_size_, child_percentage_size_, origin_offset, - constraint_space_->BfcOffset(), margins, child, token); + child_available_size_, child_percentage_size_, origin_inline_offset, + constraint_space_->BfcOffset().inline_offset, margins, child, token); container_builder_.AddUnpositionedFloat(unpositioned_float); // If there is a break token for a float we must be resuming layout, we must @@ -536,7 +527,6 @@ .SetIsNewFormattingContext(false) .ToConstraintSpace(child_space.WritingMode()); PositionFloats(child_bfc_offset_estimate, child_bfc_offset_estimate, - child_bfc_offset_estimate, container_builder_.UnpositionedFloats(), tmp_space.Get()); NGLogicalOffset origin_offset = {ConstraintSpace().BfcOffset().inline_offset + @@ -610,9 +600,8 @@ layout_result.EndMarginStrut().Sum()}; AdjustToClearance(space.ClearanceOffset(), &child_bfc_offset); - PositionPendingFloatsFromOffset( - child_bfc_offset.block_offset, child_bfc_offset.block_offset, - &container_builder_, MutableConstraintSpace()); + PositionPendingFloats(child_bfc_offset.block_offset, &container_builder_, + MutableConstraintSpace()); return child_bfc_offset; }
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc index b2761b84..fdb1e5d5 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc
@@ -24,8 +24,8 @@ namespace blink { namespace { -using testing::ElementsAre; -using testing::Pointee; +using ::testing::ElementsAre; +using ::testing::Pointee; RefPtr<NGConstraintSpace> ConstructConstraintSpace( NGWritingMode writing_mode,
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc index 59a32a2..5652b301 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc
@@ -27,6 +27,7 @@ bool is_anonymous, const NGMarginStrut& margin_strut, const NGLogicalOffset& bfc_offset, + const WTF::Optional<NGLogicalOffset>& floats_bfc_offset, const std::shared_ptr<NGExclusions>& exclusions, Vector<RefPtr<NGUnpositionedFloat>>& unpositioned_floats, const WTF::Optional<LayoutUnit>& clearance_offset) @@ -48,6 +49,7 @@ direction_(static_cast<unsigned>(direction)), margin_strut_(margin_strut), bfc_offset_(bfc_offset), + floats_bfc_offset_(floats_bfc_offset), exclusions_(exclusions), clearance_offset_(clearance_offset) { unpositioned_floats_.swap(unpositioned_floats); @@ -165,6 +167,7 @@ direction_ == other.direction_ && margin_strut_ == other.margin_strut_ && bfc_offset_ == other.bfc_offset_ && + floats_bfc_offset_ == other.floats_bfc_offset_ && clearance_offset_ == other.clearance_offset_; }
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h index ae3eb064..e33bdc9 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h
@@ -94,6 +94,7 @@ // grid). These flags represented whether a layout needs to produce a // fragment that satisfies a fixed constraint in the inline and block // direction respectively. + // // If these flags are true, the AvailableSize() is interpreted as the fixed // border-box size of this box in the respective dimension. bool IsFixedSizeInline() const { return is_fixed_size_inline_; } @@ -116,8 +117,36 @@ NGMarginStrut MarginStrut() const { return margin_strut_; } + // The BfcOffset is where the MarginStrut is placed within the block + // formatting context. + // + // The current layout or a descendant layout may "resolve" the BFC offset, + // i.e. decide where the current fragment should be placed within the BFC. + // + // This is done by: + // bfc_block_offset = + // space.BfcOffset().block_offset + space.MarginStrut().Sum(); + // + // The BFC offset can get "resolved" in many circumstances (including, but + // not limited to): + // - block_start border or padding in the current layout. + // - Text content, atomic inlines, (see NGLineBreaker). + // - The current layout having a block_size. NGLogicalOffset BfcOffset() const { return bfc_offset_; } + // If present, and the current layout hasn't resolved its BFC offset yet (see + // BfcOffset), the layout should position all of its unpositioned floats at + // this offset. + // + // This value should be propogated to child layouts if the current layout + // hasn't resolved its BFC offset yet. + // + // This value is calculated *after* an initial pass of the tree, this value + // should only be present during the second pass. + WTF::Optional<NGLogicalOffset> FloatsBfcOffset() const { + return floats_bfc_offset_; + } + Vector<RefPtr<NGUnpositionedFloat>>& UnpositionedFloats() { return unpositioned_floats_; } @@ -150,6 +179,7 @@ bool is_anonymous, const NGMarginStrut& margin_strut, const NGLogicalOffset& bfc_offset, + const WTF::Optional<NGLogicalOffset>& floats_bfc_offset, const std::shared_ptr<NGExclusions>& exclusions, Vector<RefPtr<NGUnpositionedFloat>>& unpositioned_floats, const WTF::Optional<LayoutUnit>& clearance_offset); @@ -185,6 +215,8 @@ NGMarginStrut margin_strut_; NGLogicalOffset bfc_offset_; + WTF::Optional<NGLogicalOffset> floats_bfc_offset_; + const std::shared_ptr<NGExclusions> exclusions_; WTF::Optional<LayoutUnit> clearance_offset_; Vector<RefPtr<NGUnpositionedFloat>> unpositioned_floats_;
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc index 621fdaa4..6b04a0c7 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc
@@ -74,8 +74,14 @@ } NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetBfcOffset( - const NGLogicalOffset& offset) { - bfc_offset_ = offset; + const NGLogicalOffset& bfc_offset) { + bfc_offset_ = bfc_offset; + return *this; +} + +NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetFloatsBfcOffset( + const WTF::Optional<NGLogicalOffset>& floats_bfc_offset) { + floats_bfc_offset_ = floats_bfc_offset; return *this; } @@ -188,6 +194,13 @@ NGMarginStrut margin_strut = is_new_fc_ ? NGMarginStrut() : margin_strut_; WTF::Optional<LayoutUnit> clearance_offset = is_new_fc_ ? WTF::nullopt : clearance_offset_; + WTF::Optional<NGLogicalOffset> floats_bfc_offset = + is_new_fc_ ? WTF::nullopt : floats_bfc_offset_; + + // The inline_offsets of the bfc_offset and floats_bfc_offset should match. + if (floats_bfc_offset) + DCHECK_EQ(bfc_offset.inline_offset, + floats_bfc_offset.value().inline_offset); if (is_in_parallel_flow) { return AdoptRef(new NGConstraintSpace( @@ -199,7 +212,7 @@ is_inline_direction_triggers_scrollbar_, is_block_direction_triggers_scrollbar_, static_cast<NGFragmentationType>(fragmentation_type_), is_new_fc_, - is_anonymous_, margin_strut, bfc_offset, exclusions, + is_anonymous_, margin_strut, bfc_offset, floats_bfc_offset, exclusions, unpositioned_floats_, clearance_offset)); } return AdoptRef(new NGConstraintSpace( @@ -210,8 +223,8 @@ is_block_direction_triggers_scrollbar_, is_inline_direction_triggers_scrollbar_, static_cast<NGFragmentationType>(fragmentation_type_), is_new_fc_, - is_anonymous_, margin_strut, bfc_offset, exclusions, unpositioned_floats_, - clearance_offset)); + is_anonymous_, margin_strut, bfc_offset, floats_bfc_offset, exclusions, + unpositioned_floats_, clearance_offset)); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.h b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.h index bfe179a..60006fdf 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.h
@@ -53,7 +53,9 @@ NGConstraintSpaceBuilder& SetMarginStrut(const NGMarginStrut& margin_strut); - NGConstraintSpaceBuilder& SetBfcOffset(const NGLogicalOffset& offset); + NGConstraintSpaceBuilder& SetBfcOffset(const NGLogicalOffset& bfc_offset); + NGConstraintSpaceBuilder& SetFloatsBfcOffset( + const WTF::Optional<NGLogicalOffset>& floats_bfc_offset); NGConstraintSpaceBuilder& SetClearanceOffset( const WTF::Optional<LayoutUnit>& clearance_offset); @@ -89,6 +91,7 @@ NGMarginStrut margin_strut_; NGLogicalOffset bfc_offset_; + WTF::Optional<NGLogicalOffset> floats_bfc_offset_; std::shared_ptr<NGExclusions> exclusions_; WTF::Optional<LayoutUnit> clearance_offset_; Vector<RefPtr<NGUnpositionedFloat>> unpositioned_floats_;
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_floats_utils.cc b/third_party/WebKit/Source/core/layout/ng/ng_floats_utils.cc index 44b48823..c46fc02 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_floats_utils.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_floats_utils.cc
@@ -35,11 +35,12 @@ } NGLayoutOpportunity FindLayoutOpportunityForFloat( + const NGLogicalOffset& origin_offset, const NGConstraintSpace& space, const NGUnpositionedFloat& unpositioned_float, LayoutUnit inline_size) { NGLogicalOffset adjusted_origin_point = - AdjustToTopEdgeAlignmentRule(space, unpositioned_float.origin_offset); + AdjustToTopEdgeAlignmentRule(space, origin_offset); WTF::Optional<LayoutUnit> clearance_offset = GetClearanceOffset(space.Exclusions(), unpositioned_float.ClearType()); @@ -55,6 +56,7 @@ NGLogicalOffset CalculateLogicalOffsetForOpportunity( const NGLayoutOpportunity& opportunity, const LayoutUnit float_offset, + const LayoutUnit parent_bfc_block_offset, const NGUnpositionedFloat* unpositioned_float) { DCHECK(unpositioned_float); auto margins = unpositioned_float->margins; @@ -67,7 +69,8 @@ // Adjust to float: right offset if needed. result.inline_offset += float_offset; - result -= unpositioned_float->from_offset; + result -= {unpositioned_float->bfc_inline_offset, parent_bfc_block_offset}; + return result; } @@ -94,17 +97,16 @@ const NGConstraintSpace& new_parent_space, const NGLogicalOffset& float_logical_offset, const NGUnpositionedFloat& unpositioned_float) { - LayoutUnit inline_offset = unpositioned_float.from_offset.inline_offset - + LayoutUnit inline_offset = unpositioned_float.bfc_inline_offset - new_parent_space.BfcOffset().inline_offset + float_logical_offset.inline_offset; - DCHECK(unpositioned_float.parent_bfc_block_offset); - LayoutUnit block_offset = unpositioned_float.from_offset.block_offset - - unpositioned_float.parent_bfc_block_offset.value() + - float_logical_offset.block_offset; + LayoutUnit block_offset = float_logical_offset.block_offset; return {inline_offset, block_offset}; } +// TODO(ikilpatrick): origin_block_offset looks wrong for fragmentation here. WTF::Optional<LayoutUnit> CalculateFragmentationOffset( + const LayoutUnit origin_block_offset, const NGUnpositionedFloat& unpositioned_float, const NGConstraintSpace& parent_space) { const ComputedStyle& style = unpositioned_float.node.Style(); @@ -112,8 +114,7 @@ parent_space.WritingMode()); if (parent_space.HasBlockFragmentation()) { - return parent_space.FragmentainerSpaceAvailable() - - unpositioned_float.origin_offset.block_offset; + return parent_space.FragmentainerSpaceAvailable() - origin_block_offset; } return WTF::nullopt; @@ -198,15 +199,20 @@ .InlineSize(); } -NGPositionedFloat PositionFloat(NGUnpositionedFloat* unpositioned_float, +NGPositionedFloat PositionFloat(LayoutUnit origin_block_offset, + LayoutUnit parent_bfc_block_offset, + NGUnpositionedFloat* unpositioned_float, NGConstraintSpace* new_parent_space) { DCHECK(unpositioned_float); LayoutUnit inline_size = ComputeInlineSizeForUnpositionedFloat( new_parent_space, unpositioned_float); + NGLogicalOffset origin_offset = {unpositioned_float->origin_bfc_inline_offset, + origin_block_offset}; + // Find a layout opportunity that will fit our float. NGLayoutOpportunity opportunity = FindLayoutOpportunityForFloat( - *new_parent_space, *unpositioned_float, inline_size); + origin_offset, *new_parent_space, *unpositioned_float, inline_size); #if DCHECK_IS_ON() bool is_same_writing_mode = @@ -228,7 +234,8 @@ DCHECK(is_same_writing_mode); #endif WTF::Optional<LayoutUnit> fragmentation_offset = - CalculateFragmentationOffset(*unpositioned_float, *new_parent_space); + CalculateFragmentationOffset(origin_block_offset, *unpositioned_float, + *new_parent_space); RefPtr<NGConstraintSpace> space = CreateConstraintSpaceForFloat( *unpositioned_float, new_parent_space, fragmentation_offset); @@ -268,7 +275,7 @@ new_parent_space->AddExclusion(exclusion); NGLogicalOffset logical_offset = CalculateLogicalOffsetForOpportunity( - opportunity, float_offset, unpositioned_float); + opportunity, float_offset, parent_bfc_block_offset, unpositioned_float); NGLogicalOffset paint_offset = CalculateFloatingObjectPaintOffset( *new_parent_space, logical_offset, *unpositioned_float); @@ -278,18 +285,16 @@ const Vector<NGPositionedFloat> PositionFloats( LayoutUnit origin_block_offset, - LayoutUnit from_block_offset, - LayoutUnit parent_bfc_offset, + LayoutUnit parent_bfc_block_offset, const Vector<RefPtr<NGUnpositionedFloat>>& unpositioned_floats, NGConstraintSpace* space) { Vector<NGPositionedFloat> positioned_floats; positioned_floats.ReserveCapacity(unpositioned_floats.size()); for (auto& unpositioned_float : unpositioned_floats) { - unpositioned_float->origin_offset.block_offset = origin_block_offset; - unpositioned_float->from_offset.block_offset = from_block_offset; - unpositioned_float->parent_bfc_block_offset = parent_bfc_offset; - positioned_floats.push_back(PositionFloat(unpositioned_float.Get(), space)); + positioned_floats.push_back(PositionFloat(origin_block_offset, + parent_bfc_block_offset, + unpositioned_float.Get(), space)); } return positioned_floats;
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_floats_utils.h b/third_party/WebKit/Source/core/layout/ng/ng_floats_utils.h index 0a32b6f..98c7faf3 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_floats_utils.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_floats_utils.h
@@ -23,13 +23,15 @@ // Positions {@code unpositioned_float} into {@code new_parent_space}. // @returns A positioned float. CORE_EXPORT NGPositionedFloat -PositionFloat(NGUnpositionedFloat*, NGConstraintSpace* new_parent_space); +PositionFloat(LayoutUnit origin_block_offset, + LayoutUnit parent_bfc_block_offset, + NGUnpositionedFloat*, + NGConstraintSpace* new_parent_space); // Positions the list of {@code unpositioned_floats}. Adds them as exclusions to // {@code space}. CORE_EXPORT const Vector<NGPositionedFloat> PositionFloats( LayoutUnit origin_block_offset, - LayoutUnit from_block_offset, LayoutUnit container_block_offset, const Vector<RefPtr<NGUnpositionedFloat>>& unpositioned_floats, NGConstraintSpace* space);
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc index 9e5d76a..a6b7fd2 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc
@@ -22,8 +22,11 @@ // This check is technically too broad (fill-available does not need intrinsic // size computation) but that's a rare case and only affects performance, not // correctness. - return constraint_space.IsShrinkToFit() || - style.LogicalWidth().IsIntrinsic() || + return constraint_space.IsShrinkToFit() || NeedMinMaxContentSize(style); +} + +bool NeedMinMaxContentSize(const ComputedStyle& style) { + return style.LogicalWidth().IsIntrinsic() || style.LogicalMinWidth().IsIntrinsic() || style.LogicalMaxWidth().IsIntrinsic(); }
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_length_utils.h b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.h index 597e563..9f7d85f3 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_length_utils.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.h
@@ -35,6 +35,8 @@ CORE_EXPORT bool NeedMinMaxContentSize(const NGConstraintSpace&, const ComputedStyle&); +CORE_EXPORT bool NeedMinMaxContentSize(const ComputedStyle&); + // Like NeedMinMaxContentSize, but for use when calling // ComputeMinAndMaxContentContribution. CORE_EXPORT bool NeedMinMaxContentSizeForContentContribution(
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc b/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc index 21e540fa..99db2c0 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc
@@ -101,22 +101,22 @@ // relative to the container's padding box. static_position.offset -= container_border_physical_offset_; - // The inline and block estimates are in the descendant's writing mode. - Optional<MinMaxContentSize> inline_estimate; + // The block estimate is in the descendant's writing mode. + Optional<MinMaxContentSize> min_max_size; Optional<LayoutUnit> block_estimate; RefPtr<NGLayoutResult> layout_result = nullptr; NGWritingMode descendant_writing_mode( FromPlatformWritingMode(descendant.Style().GetWritingMode())); - if (AbsoluteNeedsChildInlineSize(descendant.Style())) { - inline_estimate = descendant.ComputeMinMaxContentSize(); + if (AbsoluteNeedsChildInlineSize(descendant.Style()) || + NeedMinMaxContentSize(descendant.Style())) { + min_max_size = descendant.ComputeMinMaxContentSize(); } NGAbsolutePhysicalPosition node_position = ComputePartialAbsoluteWithChildInlineSize( - *container_space_, descendant.Style(), static_position, - inline_estimate); + *container_space_, descendant.Style(), static_position, min_max_size); if (AbsoluteNeedsChildBlockSize(descendant.Style())) { layout_result = GenerateFragment(descendant, block_estimate, node_position);
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_unpositioned_float.h b/third_party/WebKit/Source/core/layout/ng/ng_unpositioned_float.h index 166578c..c7f486f 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_unpositioned_float.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_unpositioned_float.h
@@ -24,14 +24,14 @@ public: static RefPtr<NGUnpositionedFloat> Create(NGLogicalSize available_size, NGLogicalSize percentage_size, - NGLogicalOffset origin_offset, - NGLogicalOffset from_offset, + LayoutUnit origin_bfc_inline_offset, + LayoutUnit bfc_inline_offset, NGBoxStrut margins, NGBlockNode node, NGBlockBreakToken* token) { - return AdoptRef(new NGUnpositionedFloat(margins, available_size, - percentage_size, origin_offset, - from_offset, node, token)); + return AdoptRef(new NGUnpositionedFloat( + margins, available_size, percentage_size, origin_bfc_inline_offset, + bfc_inline_offset, node, token)); } NGBlockNode node; @@ -42,42 +42,13 @@ NGLogicalSize available_size; NGLogicalSize percentage_size; - // To correctly position a float we need 2 offsets: - // - origin_offset which represents the layout point for this float. - // - from_offset which represents the point from where we need to calculate - // the relative logical offset for this float. - // Layout details: - // At the time when this float is created only *inline* offsets are known. - // Block offset will be set when we are about to place this float, i.e. when - // we resolved MarginStrut, adjusted the offset to clearance line etc. - NGLogicalOffset origin_offset; - NGLogicalOffset from_offset; + // This is the BFC inline-offset for where we begin searching for layout + // opportunities for this float. + LayoutUnit origin_bfc_inline_offset; - // To correctly **paint** a float we need to know the BFC offset of the - // container to which we are attaching this float. It's used to calculate - // {@code paint_offset}. - // In most situations {@code paint_offset} equals to float's logical - // offset except the cases where a float needs to be re-attached to a non-zero - // height parent. - // - // Example: - // <body> - // <p style="height: 60px">Example</p> - // <div id="zero-height-div"><float></div> - // - // Here the float's logical offset is 0 relative to its #zero-height-div - // parent. Because of the "zero height" div this float is re-attached to the - // 1st non-empty parent => body. To paint this float correctly we provide the - // modified {@code paint_offset} which is relative to the float's new - // parent. - // I.e. for our example {@code paint_offset.top} == - // #zero-height-div's BFC offset - // - body's BFC offset + float's logical offset - // - // For code safety reasons {@code parent_bfc_block_offset} is Optional here - // because the block's offset can be only determined before the actual float's - // placement event. - WTF::Optional<LayoutUnit> parent_bfc_block_offset; + // This is the BFC inline-offset for the float's parent. This is used for + // calculating the offset between the float and its parent. + LayoutUnit bfc_inline_offset; // The margins are relative to the writing mode of the block formatting // context. They are stored for convinence and could be recomputed with other @@ -96,16 +67,16 @@ NGUnpositionedFloat(const NGBoxStrut& margins, const NGLogicalSize& available_size, const NGLogicalSize& percentage_size, - const NGLogicalOffset& origin_offset, - const NGLogicalOffset& from_offset, + LayoutUnit origin_bfc_inline_offset, + LayoutUnit bfc_inline_offset, NGBlockNode node, NGBlockBreakToken* token) : node(node), token(token), available_size(available_size), percentage_size(percentage_size), - origin_offset(origin_offset), - from_offset(from_offset), + origin_bfc_inline_offset(origin_bfc_inline_offset), + bfc_inline_offset(bfc_inline_offset), margins(margins) {} };
diff --git a/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp index 5d89317..089b1dcb 100644 --- a/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp +++ b/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp
@@ -265,7 +265,7 @@ kContentSecurityPolicyHeaderTypeReport, kContentSecurityPolicyHeaderSourceHTTP); - KURL url(KURL(), "http://baz.test"); + KURL url(NullURL(), "http://baz.test"); ResourceRequest resource_request(url); resource_request.SetRequestContext(WebURLRequest::kRequestContextScript); resource_request.SetFetchCredentialsMode( @@ -292,7 +292,7 @@ kContentSecurityPolicyHeaderTypeReport, kContentSecurityPolicyHeaderSourceHTTP); - KURL url(KURL(), "http://baz.test"); + KURL url(NullURL(), "http://baz.test"); ResourceRequest resource_request(url); resource_request.SetRequestContext(WebURLRequest::kRequestContextScript); resource_request.SetFetchCredentialsMode( @@ -307,7 +307,7 @@ } TEST_F(BaseFetchContextTest, CanRequestWhenDetached) { - KURL url(KURL(), "http://www.example.com/"); + KURL url(NullURL(), "http://www.example.com/"); ResourceRequest request(url); ResourceRequest keepalive_request(url); keepalive_request.SetKeepalive(true);
diff --git a/third_party/WebKit/Source/core/loader/CookieJar.cpp b/third_party/WebKit/Source/core/loader/CookieJar.cpp index 24b9633..2c697070 100644 --- a/third_party/WebKit/Source/core/loader/CookieJar.cpp +++ b/third_party/WebKit/Source/core/loader/CookieJar.cpp
@@ -42,7 +42,7 @@ static WebCookieJar* ToCookieJar(const Document* document) { if (!document || !document->GetFrame()) return 0; - return document->GetFrame()->Loader().Client()->CookieJar(); + return document->GetFrame()->Client()->CookieJar(); } String Cookies(const Document* document, const KURL& url) {
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoadTimingTest.cpp b/third_party/WebKit/Source/core/loader/DocumentLoadTimingTest.cpp index ee9c033..daec4e64 100644 --- a/third_party/WebKit/Source/core/loader/DocumentLoadTimingTest.cpp +++ b/third_party/WebKit/Source/core/loader/DocumentLoadTimingTest.cpp
@@ -11,7 +11,7 @@ namespace blink { -class DocumentLoadTimingTest : public testing::Test {}; +class DocumentLoadTimingTest : public ::testing::Test {}; TEST_F(DocumentLoadTimingTest, ensureValidNavigationStartAfterEmbedder) { std::unique_ptr<DummyPageHolder> dummy_page = DummyPageHolder::Create();
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp index c98bbdc..1561744d 100644 --- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp +++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -1110,8 +1110,14 @@ // FeaturePolicy is reset in the browser process on commit, so this needs to // be initialized and replicated to the browser process after commit messages // are sent in didCommitNavigation(). + // Feature-Policy header is currently disabled while the details of the policy + // syntax are being worked out. Unless the Feature Policy experimental + // features flag is enabled, then ignore any header received. + // TODO(iclelland): Re-enable once the syntax is finalized. (crbug.com/737643) document->SetFeaturePolicy( - response_.HttpHeaderField(HTTPNames::Feature_Policy)); + RuntimeEnabledFeatures::FeaturePolicyExperimentalFeaturesEnabled() + ? response_.HttpHeaderField(HTTPNames::Feature_Policy) + : g_empty_string); GetFrameLoader().DispatchDidClearDocumentOfWindowObject(); } @@ -1130,7 +1136,7 @@ InstallNewDocument(init, MimeType(), writer_ ? writer_->Encoding() : g_empty_atom, InstallNewDocumentReason::kJavascriptURL, - kForceSynchronousParsing, KURL()); + kForceSynchronousParsing, NullURL()); if (!source.IsNull()) writer_->AppendReplacingData(source); EndWriting();
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoaderTest.cpp b/third_party/WebKit/Source/core/loader/DocumentLoaderTest.cpp index 17f0a36..1b8ed02 100644 --- a/third_party/WebKit/Source/core/loader/DocumentLoaderTest.cpp +++ b/third_party/WebKit/Source/core/loader/DocumentLoaderTest.cpp
@@ -26,7 +26,7 @@ web_view_helper_.Initialize(); URLTestHelpers::RegisterMockedURLLoad( URLTestHelpers::ToKURL("https://example.com/foo.html"), - testing::WebTestDataPath("foo.html")); + testing::CoreTestDataPath("foo.html")); } void TearDown() override {
diff --git a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp index 999fb2c..7f8ab5a 100644 --- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp +++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
@@ -834,7 +834,7 @@ if (!frame) return; DocumentLoader* loader = frame->Loader().GetDocumentLoader(); - probe::didReceiveResourceResponse(frame, identifier, loader, response, + probe::didReceiveResourceResponse(GetDocument(), identifier, loader, response, GetResource()); frame->Console().ReportResourceResponseReceived(loader, identifier, response); }
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp index a56696f..51dc68b 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -398,8 +398,9 @@ GetFrame()->Loader().Progress().WillStartLoading(identifier, request.Priority()); } - probe::willSendRequest(GetFrame(), identifier, MasterDocumentLoader(), - request, redirect_response, initiator_info); + probe::willSendRequest(GetFrame()->GetDocument(), identifier, + MasterDocumentLoader(), request, redirect_response, + initiator_info); if (GetFrame()->FrameScheduler()) GetFrame()->FrameScheduler()->DidStartLoading(identifier); } @@ -451,8 +452,8 @@ GetFrame()->Loader().Progress().IncrementProgress(identifier, response); GetLocalFrameClient()->DispatchDidReceiveResponse(response); DocumentLoader* document_loader = MasterDocumentLoader(); - probe::didReceiveResourceResponse(GetFrame(), identifier, document_loader, - response, resource); + probe::didReceiveResourceResponse(GetFrame()->GetDocument(), identifier, + document_loader, response, resource); // It is essential that inspector gets resource response BEFORE console. GetFrame()->Console().ReportResourceResponseReceived(document_loader, identifier, response); @@ -477,15 +478,15 @@ return; GetFrame()->Loader().Progress().IncrementProgress(identifier, data_length); - probe::didReceiveData(GetFrame(), identifier, data, data_length); + probe::didReceiveData(GetFrame()->GetDocument(), identifier, + MasterDocumentLoader(), data, data_length); } void FrameFetchContext::DispatchDidReceiveEncodedData(unsigned long identifier, int encoded_data_length) { if (IsDetached()) return; - - probe::didReceiveEncodedDataLength(GetFrame(), identifier, + probe::didReceiveEncodedDataLength(GetFrame()->GetDocument(), identifier, encoded_data_length); } @@ -496,8 +497,9 @@ return; GetFrame()->Loader().Progress().IncrementProgress(identifier, data_length); - probe::didReceiveData(GetFrame(), identifier, 0, data_length); - probe::didReceiveEncodedDataLength(GetFrame(), identifier, + probe::didReceiveData(GetFrame()->GetDocument(), identifier, + MasterDocumentLoader(), 0, data_length); + probe::didReceiveEncodedDataLength(GetFrame()->GetDocument(), identifier, encoded_data_length); } @@ -509,7 +511,8 @@ return; GetFrame()->Loader().Progress().CompleteProgress(identifier); - probe::didFinishLoading(GetFrame(), identifier, finish_time, + probe::didFinishLoading(GetFrame()->GetDocument(), identifier, + MasterDocumentLoader(), finish_time, encoded_data_length, decoded_body_length); if (GetFrame()->FrameScheduler()) GetFrame()->FrameScheduler()->DidStopLoading(identifier); @@ -523,7 +526,7 @@ return; GetFrame()->Loader().Progress().CompleteProgress(identifier); - probe::didFailLoading(GetFrame(), identifier, error); + probe::didFailLoading(GetFrame()->GetDocument(), identifier, error); // Notification to FrameConsole should come AFTER InspectorInstrumentation // call, DevTools front-end relies on this. if (!is_internal_request) @@ -899,7 +902,7 @@ if (IsDetached()) return false; bool should_block_request = false; - probe::shouldBlockRequest(GetFrame(), resource_request, + probe::shouldBlockRequest(GetFrame()->GetDocument(), resource_request, &should_block_request); return should_block_request; } @@ -910,8 +913,9 @@ ResourceRequestBlockedReason blocked_reason) const { if (IsDetached()) return; - probe::didBlockRequest(GetFrame(), resource_request, MasterDocumentLoader(), - fetch_initiator_info, blocked_reason); + probe::didBlockRequest(GetFrame()->GetDocument(), resource_request, + MasterDocumentLoader(), fetch_initiator_info, + blocked_reason); } bool FrameFetchContext::ShouldBypassMainWorldCSP() const { @@ -1110,7 +1114,7 @@ } else { // Some getters are unavailable in this case. frozen_state_ = new FrozenState( - kReferrerPolicyDefault, String(), KURL(), GetSecurityOrigin(), + kReferrerPolicyDefault, String(), NullURL(), GetSecurityOrigin(), GetParentSecurityOrigin(), GetAddressSpace(), GetContentSecurityPolicy(), GetFirstPartyForCookies(), SecurityOrigin::CreateUnique(), SecurityOrigin::CreateUnique(),
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp index eaec6655..730549d2 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp +++ b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
@@ -60,7 +60,7 @@ namespace blink { -using Checkpoint = testing::StrictMock<testing::MockFunction<void(int)>>; +using Checkpoint = ::testing::StrictMock<testing::MockFunction<void(int)>>; class StubLocalFrameClientWithParent final : public EmptyLocalFrameClient { public: @@ -212,9 +212,9 @@ : public FrameFetchContextTest { protected: void SetUp() override { - url = KURL(KURL(), "https://example.test/foo"); - main_resource_url = KURL(KURL(), "https://www.example.test"); - client = new testing::NiceMock<MockLocalFrameClient>(); + url = KURL(NullURL(), "https://example.test/foo"); + main_resource_url = KURL(NullURL(), "https://www.example.test"); + client = new ::testing::NiceMock<MockLocalFrameClient>(); dummy_page_holder = DummyPageHolder::Create(IntSize(500, 500), nullptr, client); dummy_page_holder->GetPage().SetDeviceScaleFactorDeprecated(1.0); @@ -494,7 +494,7 @@ policy->DidReceiveHeader("script-src https://bar.test", kContentSecurityPolicyHeaderTypeReport, kContentSecurityPolicyHeaderSourceHTTP); - KURL url(KURL(), "http://baz.test"); + KURL url(NullURL(), "http://baz.test"); ResourceRequest resource_request(url); resource_request.SetRequestContext(WebURLRequest::kRequestContextScript); resource_request.SetFetchCredentialsMode( @@ -506,7 +506,7 @@ SecurityViolationReportingPolicy::kReport, resource_request); EXPECT_EQ(1u, policy->violation_reports_sent_.size()); // Check that the resource was upgraded to a secure URL. - EXPECT_EQ(KURL(KURL(), "https://baz.test"), resource_request.Url()); + EXPECT_EQ(KURL(NullURL(), "https://baz.test"), resource_request.Url()); } class FrameFetchContextHintsTest : public FrameFetchContextTest { @@ -901,12 +901,12 @@ Resource* resource = MockResource::Create(resource_request); EXPECT_CALL(*client, DispatchDidLoadResourceFromMemoryCache( - testing::AllOf( - testing::Property(&ResourceRequest::Url, url), - testing::Property(&ResourceRequest::GetFrameType, - WebURLRequest::kFrameTypeNone), - testing::Property(&ResourceRequest::GetRequestContext, - WebURLRequest::kRequestContextImage)), + ::testing::AllOf( + ::testing::Property(&ResourceRequest::Url, url), + ::testing::Property(&ResourceRequest::GetFrameType, + WebURLRequest::kFrameTypeNone), + ::testing::Property(&ResourceRequest::GetRequestContext, + WebURLRequest::kRequestContextImage)), ResourceResponse())); fetch_context->DispatchDidLoadResourceFromMemoryCache( CreateUniqueIdentifier(), resource_request, resource->GetResponse()); @@ -968,14 +968,14 @@ } TEST_F(FrameFetchContextTest, AddAdditionalRequestHeadersWhenDetached) { - const KURL document_url(KURL(), "https://www2.example.com/fuga/hoge.html"); + const KURL document_url(NullURL(), "https://www2.example.com/fuga/hoge.html"); const String origin = "https://www2.example.com"; - ResourceRequest request(KURL(KURL(), "https://localhost/")); + ResourceRequest request(KURL(NullURL(), "https://localhost/")); request.SetHTTPMethod("PUT"); Settings* settings = document->GetFrame()->GetSettings(); settings->SetDataSaverEnabled(true); - document->SetSecurityOrigin(SecurityOrigin::Create(KURL(KURL(), origin))); + document->SetSecurityOrigin(SecurityOrigin::Create(KURL(NullURL(), origin))); document->SetURL(document_url); document->SetReferrerPolicy(kReferrerPolicyOrigin); document->SetAddressSpace(kWebAddressSpacePublic); @@ -993,7 +993,7 @@ } TEST_F(FrameFetchContextTest, ResourceRequestCachePolicyWhenDetached) { - ResourceRequest request(KURL(KURL(), "https://localhost/")); + ResourceRequest request(KURL(NullURL(), "https://localhost/")); dummy_page_holder = nullptr; @@ -1022,7 +1022,7 @@ dummy_page_holder = nullptr; checkpoint.Call(2); - ResourceRequest request(KURL(KURL(), "https://localhost/")); + ResourceRequest request(KURL(NullURL(), "https://localhost/")); fetch_context->PrepareRequest(request, FetchContext::RedirectType::kNotForRedirect); @@ -1030,7 +1030,7 @@ } TEST_F(FrameFetchContextTest, DispatchWillSendRequestWhenDetached) { - ResourceRequest request(KURL(KURL(), "https://www.example.com/")); + ResourceRequest request(KURL(NullURL(), "https://www.example.com/")); ResourceResponse response; FetchInitiatorInfo initiator_info; @@ -1042,7 +1042,7 @@ TEST_F(FrameFetchContextTest, DispatchDidLoadResourceFromMemoryCacheWhenDetached) { - ResourceRequest request(KURL(KURL(), "https://www.example.com/")); + ResourceRequest request(KURL(NullURL(), "https://www.example.com/")); ResourceResponse response; FetchInitiatorInfo initiator_info; @@ -1053,7 +1053,7 @@ } TEST_F(FrameFetchContextTest, DispatchDidReceiveResponseWhenDetached) { - ResourceRequest request(KURL(KURL(), "https://www.example.com/")); + ResourceRequest request(KURL(NullURL(), "https://www.example.com/")); request.SetFetchCredentialsMode(WebURLRequest::kFetchCredentialsModeOmit); Resource* resource = MockResource::Create(request); ResourceResponse response; @@ -1112,7 +1112,7 @@ } TEST_F(FrameFetchContextTest, RecordLoadingActivityWhenDetached) { - ResourceRequest request(KURL(KURL(), "https://www.example.com/")); + ResourceRequest request(KURL(NullURL(), "https://www.example.com/")); dummy_page_holder = nullptr; @@ -1126,7 +1126,7 @@ } TEST_F(FrameFetchContextTest, DidLoadResourceWhenDetached) { - ResourceRequest request(KURL(KURL(), "https://www.example.com/")); + ResourceRequest request(KURL(NullURL(), "https://www.example.com/")); request.SetFetchCredentialsMode(WebURLRequest::kFetchCredentialsModeOmit); Resource* resource = MockResource::Create(request); @@ -1147,7 +1147,7 @@ } TEST_F(FrameFetchContextTest, AllowImageWhenDetached) { - KURL url(KURL(), "https://www.example.com/"); + KURL url(NullURL(), "https://www.example.com/"); dummy_page_holder = nullptr; @@ -1211,7 +1211,7 @@ } TEST_F(FrameFetchContextTest, SendImagePingWhenDetached) { - KURL url(KURL(), "https://www.example.com/"); + KURL url(NullURL(), "https://www.example.com/"); dummy_page_holder = nullptr; @@ -1228,7 +1228,7 @@ TEST_F(FrameFetchContextTest, GetSecurityOriginWhenDetached) { RefPtr<SecurityOrigin> origin = - SecurityOrigin::Create(KURL(KURL(), "https://www.example.com")); + SecurityOrigin::Create(KURL(NullURL(), "https://www.example.com")); document->SetSecurityOrigin(origin); dummy_page_holder = nullptr; @@ -1236,7 +1236,7 @@ } TEST_F(FrameFetchContextTest, PopulateResourceRequestWhenDetached) { - KURL url(KURL(), "https://www.example.com/"); + KURL url(NullURL(), "https://www.example.com/"); ResourceRequest request(url); request.SetFetchCredentialsMode(WebURLRequest::kFetchCredentialsModeOmit); @@ -1264,9 +1264,9 @@ TEST_F(FrameFetchContextTest, SetFirstPartyCookieAndRequestorOriginWhenDetached) { - KURL url(KURL(), "https://www.example.com/hoge/fuga"); + KURL url(NullURL(), "https://www.example.com/hoge/fuga"); ResourceRequest request(url); - KURL document_url(KURL(), "https://www2.example.com/foo/bar"); + KURL document_url(NullURL(), "https://www2.example.com/foo/bar"); RefPtr<SecurityOrigin> origin = SecurityOrigin::Create(document_url); document->SetSecurityOrigin(origin);
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp index b9b284a..b97e24561 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp +++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -902,7 +902,7 @@ CString encoded_srcdoc = srcdoc.Utf8(); return SubstituteData( SharedBuffer::Create(encoded_srcdoc.data(), encoded_srcdoc.length()), - "text/html", "UTF-8", KURL()); + "text/html", "UTF-8", NullURL()); } void FrameLoader::StopAllLoaders() { @@ -1141,7 +1141,7 @@ String FrameLoader::UserAgent() const { String user_agent = Client()->UserAgent(); - probe::applyUserAgentOverride(frame_, &user_agent); + probe::applyUserAgentOverride(frame_->GetDocument(), &user_agent); return user_agent; }
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.h b/third_party/WebKit/Source/core/loader/FrameLoader.h index 0827dc3..9f1d0e37 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoader.h +++ b/third_party/WebKit/Source/core/loader/FrameLoader.h
@@ -122,8 +122,6 @@ bool ShouldTreatURLAsSameAsCurrent(const KURL&) const; bool ShouldTreatURLAsSrcdocDocument(const KURL&) const; - LocalFrameClient* Client() const; - void SetDefersLoading(bool); void DidExplicitOpen(); @@ -263,6 +261,8 @@ FrameLoadType, NavigationType); + LocalFrameClient* Client() const; + Member<LocalFrame> frame_; AtomicString required_csp_;
diff --git a/third_party/WebKit/Source/core/loader/HttpEquiv.cpp b/third_party/WebKit/Source/core/loader/HttpEquiv.cpp index fbecc31d..fe11fe2 100644 --- a/third_party/WebKit/Source/core/loader/HttpEquiv.cpp +++ b/third_party/WebKit/Source/core/loader/HttpEquiv.cpp
@@ -107,7 +107,7 @@ Element* element) { UseCounter::Count(document, WebFeature::kMetaRefresh); if (!document.GetContentSecurityPolicy()->AllowInlineScript( - element, KURL(), "", OrdinalNumber(), "", + element, NullURL(), "", OrdinalNumber(), "", SecurityViolationReportingPolicy::kSuppressReporting)) { UseCounter::Count(document, WebFeature::kMetaRefreshWhenCSPBlocksInlineScript); @@ -126,7 +126,7 @@ UseCounter::Count(document, WebFeature::kMetaSetCookie); if (!document.GetContentSecurityPolicy()->AllowInlineScript( - element, KURL(), "", OrdinalNumber(), "", + element, NullURL(), "", OrdinalNumber(), "", SecurityViolationReportingPolicy::kSuppressReporting)) { UseCounter::Count(document, WebFeature::kMetaSetCookieWhenCSPBlocksInlineScript);
diff --git a/third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp b/third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp index fe995f5f..f1c61ad 100644 --- a/third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp +++ b/third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp
@@ -116,7 +116,7 @@ Persistent<MockLinkLoaderClient> loader_client = MockLinkLoaderClient::Create(test_case.link_loader_should_load_value); LinkLoader* loader = LinkLoader::Create(loader_client.Get()); - KURL href_url = KURL(KURL(), test_case.href); + KURL href_url = KURL(NullURL(), test_case.href); URLTestHelpers::RegisterMockedErrorURLLoad(href_url); loader->LoadLink(LinkRelAttribute("preload"), kCrossOriginAttributeNotSet, test_case.type, test_case.as, test_case.media, @@ -303,7 +303,7 @@ Persistent<MockLinkLoaderClient> loader_client = MockLinkLoaderClient::Create(test_case.link_loader_should_load_value); LinkLoader* loader = LinkLoader::Create(loader_client.Get()); - KURL href_url = KURL(KURL(), test_case.href); + KURL href_url = KURL(NullURL(), test_case.href); URLTestHelpers::RegisterMockedErrorURLLoad(href_url); loader->LoadLink(LinkRelAttribute("prefetch"), kCrossOriginAttributeNotSet, test_case.type, "", test_case.media,
diff --git a/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp b/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp index 00601ff..5764ef7 100644 --- a/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp +++ b/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
@@ -37,7 +37,6 @@ #include "core/frame/UseCounter.h" #include "core/inspector/ConsoleMessage.h" #include "core/loader/DocumentLoader.h" -#include "core/loader/FrameLoader.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/network/NetworkUtils.h" #include "platform/weborigin/SchemeRegistry.h" @@ -57,7 +56,7 @@ // messages about mixed content. KURL MainResourceUrlForFrame(Frame* frame) { if (frame->IsRemoteFrame()) { - return KURL(KURL(), + return KURL(NullURL(), frame->GetSecurityContext()->GetSecurityOrigin()->ToString()); } return ToLocalFrame(frame)->GetDocument()->Url(); @@ -326,7 +325,7 @@ Settings* settings = mixed_frame->GetSettings(); // Use the current local frame's client; the embedder doesn't distinguish // mixed content signals from different frames on the same page. - LocalFrameClient* client = frame->Loader().Client(); + LocalFrameClient* client = frame->Client(); ContentSettingsClient* content_settings_client = frame->GetContentSettingsClient(); SecurityOrigin* security_origin = @@ -509,7 +508,7 @@ // Use the current local frame's client; the embedder doesn't distinguish // mixed content signals from different frames on the same page. - frame->Loader().Client()->DidContainInsecureFormAction(); + frame->Client()->DidContainInsecureFormAction(); if (reporting_policy == SecurityViolationReportingPolicy::kReport) { String message = String::Format( @@ -573,7 +572,7 @@ // Use the current local frame's client; the embedder doesn't distinguish // mixed content signals from different frames on the same page. - LocalFrameClient* client = frame->Loader().Client(); + LocalFrameClient* client = frame->Client(); bool strict_mixed_content_checking_for_plugin = effective_frame->GetSettings() && effective_frame->GetSettings()->GetStrictMixedContentCheckingForPlugin();
diff --git a/third_party/WebKit/Source/core/loader/MixedContentCheckerTest.cpp b/third_party/WebKit/Source/core/loader/MixedContentCheckerTest.cpp index c3341fc..d10c9684 100644 --- a/third_party/WebKit/Source/core/loader/MixedContentCheckerTest.cpp +++ b/third_party/WebKit/Source/core/loader/MixedContentCheckerTest.cpp
@@ -58,9 +58,9 @@ SCOPED_TRACE(::testing::Message() << "Origin: " << test.origin << ", Target: " << test.target << ", Expectation: " << test.expectation); - KURL origin_url(KURL(), test.origin); + KURL origin_url(NullURL(), test.origin); RefPtr<SecurityOrigin> security_origin(SecurityOrigin::Create(origin_url)); - KURL target_url(KURL(), test.target); + KURL target_url(NullURL(), test.target); EXPECT_EQ(test.expectation, MixedContentChecker::IsMixedContent( security_origin.Get(), target_url)); } @@ -120,9 +120,9 @@ std::unique_ptr<DummyPageHolder> dummy_page_holder = DummyPageHolder::Create(IntSize(1, 1), nullptr, client); - KURL main_resource_url(KURL(), "https://example.test"); - KURL displayed_url(KURL(), "https://example-displayed.test"); - KURL ran_url(KURL(), "https://example-ran.test"); + KURL main_resource_url(NullURL(), "https://example.test"); + KURL displayed_url(NullURL(), "https://example-displayed.test"); + KURL ran_url(NullURL(), "https://example-ran.test"); dummy_page_holder->GetFrame().GetDocument()->SetURL(main_resource_url); ResourceResponse response1; @@ -153,12 +153,12 @@ std::unique_ptr<DummyPageHolder> dummy_page_holder = DummyPageHolder::Create(IntSize(1, 1), nullptr, client); - KURL main_resource_url(KURL(), "https://example.test/"); + KURL main_resource_url(NullURL(), "https://example.test/"); - KURL http_form_action_url(KURL(), "http://example-action.test/"); - KURL https_form_action_url(KURL(), "https://example-action.test/"); - KURL javascript_form_action_url(KURL(), "javascript:void(0);"); - KURL mailto_form_action_url(KURL(), "mailto:action@example-action.test"); + KURL http_form_action_url(NullURL(), "http://example-action.test/"); + KURL https_form_action_url(NullURL(), "https://example-action.test/"); + KURL javascript_form_action_url(NullURL(), "javascript:void(0);"); + KURL mailto_form_action_url(NullURL(), "mailto:action@example-action.test"); dummy_page_holder->GetFrame().GetDocument()->SetSecurityOrigin( SecurityOrigin::Create(main_resource_url));
diff --git a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp index c1b4509..cbe6a65 100644 --- a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp +++ b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
@@ -268,20 +268,14 @@ std::unique_ptr<UserGestureIndicator> gesture_indicator = CreateUserGestureIndicator(); ResourceRequest resource_request = frame->Loader().ResourceRequestForReload( - RuntimeEnabledFeatures::LocationHardReloadEnabled() - ? kFrameLoadTypeReloadBypassingCache - : kFrameLoadTypeReload, - KURL(), ClientRedirectPolicy::kClientRedirect); + kFrameLoadTypeReload, KURL(), ClientRedirectPolicy::kClientRedirect); if (resource_request.IsNull()) return; FrameLoadRequest request = FrameLoadRequest(nullptr, resource_request); request.SetClientRedirect(ClientRedirectPolicy::kClientRedirect); MaybeLogScheduledNavigationClobber( ScheduledNavigationType::kScheduledReload, frame); - frame->Loader().Load(request, - RuntimeEnabledFeatures::LocationHardReloadEnabled() - ? kFrameLoadTypeReloadBypassingCache - : kFrameLoadTypeReload); + frame->Loader().Load(request, kFrameLoadTypeReload); } private: @@ -295,7 +289,7 @@ } void Fire(LocalFrame* frame) override { - frame->Loader().Client()->LoadErrorPage(reason_); + frame->Client()->LoadErrorPage(reason_); } private:
diff --git a/third_party/WebKit/Source/core/loader/NetworkQuietDetectorTest.cpp b/third_party/WebKit/Source/core/loader/NetworkQuietDetectorTest.cpp index aaf5f0f..e515201 100644 --- a/third_party/WebKit/Source/core/loader/NetworkQuietDetectorTest.cpp +++ b/third_party/WebKit/Source/core/loader/NetworkQuietDetectorTest.cpp
@@ -10,7 +10,7 @@ namespace blink { -class NetworkQuietDetectorTest : public testing::Test { +class NetworkQuietDetectorTest : public ::testing::Test { protected: void SetUp() override { platform_->AdvanceClockSeconds(1);
diff --git a/third_party/WebKit/Source/core/loader/PingLoader.cpp b/third_party/WebKit/Source/core/loader/PingLoader.cpp index 58d4552..de46c8c 100644 --- a/third_party/WebKit/Source/core/loader/PingLoader.cpp +++ b/third_party/WebKit/Source/core/loader/PingLoader.cpp
@@ -31,26 +31,13 @@ #include "core/loader/PingLoader.h" -#include "core/dom/ContextLifecycleObserver.h" #include "core/dom/DOMArrayBufferView.h" #include "core/dom/Document.h" -#include "core/dom/SecurityContext.h" #include "core/fileapi/File.h" -#include "core/frame/FrameConsole.h" #include "core/frame/LocalFrame.h" #include "core/frame/LocalFrameClient.h" #include "core/frame/csp/ContentSecurityPolicy.h" #include "core/html/FormData.h" -#include "core/inspector/ConsoleMessage.h" -#include "core/inspector/InspectorTraceEvents.h" -#include "core/loader/FrameLoader.h" -#include "core/loader/MixedContentChecker.h" -#include "core/page/Page.h" -#include "core/probe/CoreProbes.h" -#include "platform/WebFrameScheduler.h" -#include "platform/exported/WrappedResourceRequest.h" -#include "platform/exported/WrappedResourceResponse.h" -#include "platform/loader/fetch/CrossOriginAccessControl.h" #include "platform/loader/fetch/FetchContext.h" #include "platform/loader/fetch/FetchInitiatorTypeNames.h" #include "platform/loader/fetch/FetchUtils.h" @@ -59,8 +46,6 @@ #include "platform/loader/fetch/ResourceFetcher.h" #include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/loader/fetch/ResourceRequest.h" -#include "platform/loader/fetch/ResourceResponse.h" -#include "platform/loader/fetch/UniqueIdentifier.h" #include "platform/network/EncodedFormData.h" #include "platform/network/ParsedContentType.h" #include "platform/weborigin/SecurityOrigin.h" @@ -68,10 +53,7 @@ #include "platform/wtf/Compiler.h" #include "platform/wtf/Functional.h" #include "platform/wtf/PtrUtil.h" -#include "public/platform/Platform.h" -#include "public/platform/WebURLLoader.h" #include "public/platform/WebURLRequest.h" -#include "public/platform/WebURLResponse.h" namespace blink { @@ -189,256 +171,6 @@ AtomicString content_type_; }; -class PingLoaderImpl : public GarbageCollectedFinalized<PingLoaderImpl>, - public ContextClient, - private WebURLLoaderClient { - USING_GARBAGE_COLLECTED_MIXIN(PingLoaderImpl); - WTF_MAKE_NONCOPYABLE(PingLoaderImpl); - - public: - PingLoaderImpl(LocalFrame*, ResourceRequest&, const AtomicString&); - ~PingLoaderImpl() override; - - DECLARE_VIRTUAL_TRACE(); - - private: - void Dispose(); - - // WebURLLoaderClient - bool WillFollowRedirect(WebURLRequest&, const WebURLResponse&) override; - void DidReceiveResponse(const WebURLResponse&) final; - void DidReceiveData(const char*, int) final; - void DidFinishLoading(double, - int64_t encoded_data_length, - int64_t encoded_body_length, - int64_t decoded_body_length) final; - void DidFail(const WebURLError&, - int64_t encoded_data_length, - int64_t encoded_body_length, - int64_t decoded_body_length) final; - - void Timeout(TimerBase*); - - void DidFailLoading(LocalFrame*); - - std::unique_ptr<WebURLLoader> loader_; - Timer<PingLoaderImpl> timeout_; - String url_; - unsigned long identifier_; - SelfKeepAlive<PingLoaderImpl> keep_alive_; - AtomicString initiator_; - - RefPtr<SecurityOrigin> origin_; - bool cors_enabled_; -}; - -PingLoaderImpl::PingLoaderImpl(LocalFrame* frame, - ResourceRequest& request, - const AtomicString& initiator) - : ContextClient(frame), - timeout_(this, &PingLoaderImpl::Timeout), - url_(request.Url()), - identifier_(CreateUniqueIdentifier()), - keep_alive_(this), - initiator_(initiator), - origin_(frame->GetDocument()->GetSecurityOrigin()), - cors_enabled_(true) { - const AtomicString content_type = request.HttpContentType(); - if (!content_type.IsNull() && FetchUtils::IsCORSSafelistedHeader( - AtomicString("content-type"), content_type)) - cors_enabled_ = false; - - frame->Loader().Client()->DidDispatchPingLoader(request.Url()); - - FetchContext& fetch_context = frame->GetDocument()->Fetcher()->Context(); - - fetch_context.PrepareRequest(request, - FetchContext::RedirectType::kNotForRedirect); - fetch_context.RecordLoadingActivity(identifier_, request, Resource::kImage, - initiator); - - FetchInitiatorInfo initiator_info; - initiator_info.name = initiator; - fetch_context.DispatchWillSendRequest(identifier_, request, - ResourceResponse(), initiator_info); - - // Make sure the scheduler doesn't wait for the ping. - if (frame->FrameScheduler()) - frame->FrameScheduler()->DidStopLoading(identifier_); - - loader_ = fetch_context.CreateURLLoader(request); - DCHECK(loader_); - - WrappedResourceRequest wrapped_request(request); - - bool allow_stored_credentials = false; - switch (request.GetFetchCredentialsMode()) { - case WebURLRequest::kFetchCredentialsModeOmit: - NOTREACHED(); - break; - case WebURLRequest::kFetchCredentialsModeSameOrigin: - allow_stored_credentials = - frame->GetDocument()->GetSecurityOrigin()->CanRequestNoSuborigin( - request.Url()); - break; - case WebURLRequest::kFetchCredentialsModeInclude: - allow_stored_credentials = true; - break; - case WebURLRequest::kFetchCredentialsModePassword: - NOTREACHED(); - break; - } - request.SetAllowStoredCredentials(allow_stored_credentials); - - loader_->LoadAsynchronously(wrapped_request, this); - - // If the server never responds, FrameLoader won't be able to cancel this load - // and we'll sit here waiting forever. Set a very generous timeout, just in - // case. - timeout_.StartOneShot(60000, BLINK_FROM_HERE); -} - -PingLoaderImpl::~PingLoaderImpl() { - DCHECK(!loader_); -} - -void PingLoaderImpl::Dispose() { - if (loader_) { - loader_->Cancel(); - loader_ = nullptr; - } - timeout_.Stop(); - keep_alive_.Clear(); -} - -bool PingLoaderImpl::WillFollowRedirect( - WebURLRequest& passed_new_request, - const WebURLResponse& passed_redirect_response) { - if (cors_enabled_) { - DCHECK(passed_new_request.AllowStoredCredentials()); - - ResourceRequest& new_request(passed_new_request.ToMutableResourceRequest()); - const ResourceResponse& redirect_response( - passed_redirect_response.ToResourceResponse()); - - DCHECK(!new_request.IsNull()); - DCHECK(!redirect_response.IsNull()); - - String error_description; - ResourceLoaderOptions options; - // TODO(tyoshino): Save updated data in options.security_origin and pass it - // on the next time. - if (!CrossOriginAccessControl::HandleRedirect( - origin_, new_request, redirect_response, - passed_new_request.GetFetchCredentialsMode(), options, - error_description)) { - if (GetFrame()) { - if (GetFrame()->GetDocument()) { - GetFrame()->GetDocument()->AddConsoleMessage(ConsoleMessage::Create( - kJSMessageSource, kErrorMessageLevel, error_description)); - } - } - // Cancel the load and self destruct. - Dispose(); - - return false; - } - } - // FIXME: http://crbug.com/427429 is needed to correctly propagate updates of - // Origin: following this successful redirect. - - if (GetFrame() && GetFrame()->GetDocument()) { - FetchInitiatorInfo initiator_info; - initiator_info.name = initiator_; - FetchContext& fetch_context = - GetFrame()->GetDocument()->Fetcher()->Context(); - fetch_context.PrepareRequest(passed_new_request.ToMutableResourceRequest(), - FetchContext::RedirectType::kForRedirect); - fetch_context.DispatchWillSendRequest( - identifier_, passed_new_request.ToMutableResourceRequest(), - passed_redirect_response.ToResourceResponse(), initiator_info); - } - - return true; -} - -void PingLoaderImpl::DidReceiveResponse(const WebURLResponse& response) { - if (GetFrame()) { - const ResourceResponse& resource_response = response.ToResourceResponse(); - probe::didReceiveResourceResponse(GetFrame(), identifier_, 0, - resource_response, 0); - DidFailLoading(GetFrame()); - } - Dispose(); -} - -void PingLoaderImpl::DidReceiveData(const char*, int data_length) { - if (GetFrame()) - DidFailLoading(GetFrame()); - Dispose(); -} - -void PingLoaderImpl::DidFinishLoading(double, - int64_t encoded_data_length, - int64_t encoded_body_length, - int64_t decoded_body_length) { - if (GetFrame()) - DidFailLoading(GetFrame()); - Dispose(); -} - -void PingLoaderImpl::DidFail(const WebURLError& resource_error, - int64_t encoded_data_length, - int64_t encoded_body_length, - int64_t decoded_body_length) { - if (GetFrame()) - DidFailLoading(GetFrame()); - Dispose(); -} - -void PingLoaderImpl::Timeout(TimerBase*) { - if (GetFrame()) - DidFailLoading(GetFrame()); - Dispose(); -} - -void PingLoaderImpl::DidFailLoading(LocalFrame* frame) { - probe::didFailLoading(frame, identifier_, - ResourceError::CancelledError(url_)); - frame->Console().DidFailLoading(identifier_, - ResourceError::CancelledError(url_)); -} - -DEFINE_TRACE(PingLoaderImpl) { - ContextClient::Trace(visitor); -} - -void FinishPingRequestInitialization( - ResourceRequest& request, - LocalFrame* frame, - WebURLRequest::RequestContext request_context) { - request.SetRequestContext(request_context); - FetchContext& fetch_context = frame->GetDocument()->Fetcher()->Context(); - fetch_context.AddAdditionalRequestHeaders(request, kFetchSubresource); - // TODO(tyoshino): Call populateResourceRequest() if appropriate. - fetch_context.SetFirstPartyCookieAndRequestorOrigin(request); -} - -bool SendPingCommon(LocalFrame* frame, - ResourceRequest& request, - const AtomicString& initiator) { - request.SetKeepalive(true); - if (MixedContentChecker::ShouldBlockFetch(frame, request, request.Url())) - return false; - - // The loader keeps itself alive until it receives a response and disposes - // itself. - PingLoaderImpl* loader = new PingLoaderImpl(frame, request, initiator); - DCHECK(loader); - - return true; -} - // Decide if a beacon with the given size is allowed to go ahead // given some overall allowance limit. bool AllowBeaconWithSize(int allowance, unsigned long long size) { @@ -488,7 +220,7 @@ Resource* resource = RawResource::Fetch(params, frame->GetDocument()->Fetcher()); if (resource && resource->GetStatus() != ResourceStatus::kLoadError) { - frame->Loader().Client()->DidDispatchPingLoader(request.Url()); + frame->Client()->DidDispatchPingLoader(request.Url()); return true; } @@ -500,10 +232,17 @@ void PingLoader::LoadImage(LocalFrame* frame, const KURL& url) { ResourceRequest request(url); request.SetHTTPHeaderField(HTTPNames::Cache_Control, "max-age=0"); - FinishPingRequestInitialization(request, frame, - WebURLRequest::kRequestContextPing); + request.SetKeepalive(true); + request.SetRequestContext(WebURLRequest::kRequestContextPing); + FetchParameters params(request); + params.MutableOptions().initiator_info.name = FetchInitiatorTypeNames::ping; + // TODO(mkwst): Reevaluate this. + params.SetContentSecurityCheck(kDoNotCheckContentSecurityPolicy); - SendPingCommon(frame, request, FetchInitiatorTypeNames::ping); + Resource* resource = + RawResource::Fetch(params, frame->GetDocument()->Fetcher()); + if (resource && resource->GetStatus() != ResourceStatus::kLoadError) + frame->Client()->DidDispatchPingLoader(request.Url()); } // http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#hyperlink-auditing @@ -513,27 +252,13 @@ if (!ping_url.ProtocolIsInHTTPFamily()) return; - if (ContentSecurityPolicy* policy = - frame->GetSecurityContext()->GetContentSecurityPolicy()) { - if (!policy->AllowConnectToSource(ping_url)) - return; - } - ResourceRequest request(ping_url); request.SetHTTPMethod(HTTPNames::POST); request.SetHTTPContentType("text/ping"); request.SetHTTPBody(EncodedFormData::Create("PING")); request.SetHTTPHeaderField(HTTPNames::Cache_Control, "max-age=0"); - FinishPingRequestInitialization(request, frame, - WebURLRequest::kRequestContextPing); - - // addAdditionalRequestHeaders() will have added a referrer for same origin - // requests, but the spec omits the referrer. - request.ClearHTTPReferrer(); - request.SetHTTPHeaderField(HTTPNames::Ping_To, AtomicString(destination_url.GetString())); - RefPtr<SecurityOrigin> ping_origin = SecurityOrigin::Create(ping_url); if (ProtocolIs(frame->GetDocument()->Url().GetString(), "http") || frame->GetDocument()->GetSecurityOrigin()->CanAccess(ping_origin.Get())) { @@ -542,7 +267,17 @@ AtomicString(frame->GetDocument()->Url().GetString())); } - SendPingCommon(frame, request, FetchInitiatorTypeNames::ping); + request.SetKeepalive(true); + request.SetHTTPReferrer( + Referrer(Referrer::NoReferrer(), kReferrerPolicyNever)); + request.SetRequestContext(WebURLRequest::kRequestContextPing); + FetchParameters params(request); + params.MutableOptions().initiator_info.name = FetchInitiatorTypeNames::ping; + + Resource* resource = + RawResource::Fetch(params, frame->GetDocument()->Fetcher()); + if (resource && resource->GetStatus() != ResourceStatus::kLoadError) + frame->Client()->DidDispatchPingLoader(request.Url()); } void PingLoader::SendViolationReport(LocalFrame* frame, @@ -562,10 +297,18 @@ request.SetHTTPBody(std::move(report)); request.SetFetchCredentialsMode( WebURLRequest::kFetchCredentialsModeSameOrigin); - FinishPingRequestInitialization(request, frame, - WebURLRequest::kRequestContextCSPReport); + request.SetRequestContext(WebURLRequest::kRequestContextCSPReport); + request.SetFetchRedirectMode(WebURLRequest::kFetchRedirectModeError); + FetchParameters params(request); + params.MutableOptions().initiator_info.name = + FetchInitiatorTypeNames::violationreport; + params.MutableOptions().security_origin = + frame->GetDocument()->GetSecurityOrigin(); - SendPingCommon(frame, request, FetchInitiatorTypeNames::violationreport); + Resource* resource = + RawResource::Fetch(params, frame->GetDocument()->Fetcher()); + if (resource && resource->GetStatus() != ResourceStatus::kLoadError) + frame->Client()->DidDispatchPingLoader(request.Url()); } bool PingLoader::SendBeacon(LocalFrame* frame,
diff --git a/third_party/WebKit/Source/core/loader/PingLoaderTest.cpp b/third_party/WebKit/Source/core/loader/PingLoaderTest.cpp index 0d3254e..a6e72f6 100644 --- a/third_party/WebKit/Source/core/loader/PingLoaderTest.cpp +++ b/third_party/WebKit/Source/core/loader/PingLoaderTest.cpp
@@ -47,9 +47,9 @@ } void SetDocumentURL(const KURL& url) { - FrameLoadRequest request( - nullptr, ResourceRequest(url), - SubstituteData(SharedBuffer::Create(), "text/html", "UTF-8", KURL())); + FrameLoadRequest request(nullptr, ResourceRequest(url), + SubstituteData(SharedBuffer::Create(), "text/html", + "UTF-8", NullURL())); page_holder_->GetFrame().Loader().Load(request); blink::testing::RunPendingTasks(); ASSERT_EQ(url.GetString(), page_holder_->GetDocument().Url().GetString()); @@ -58,7 +58,7 @@ const ResourceRequest& PingAndGetRequest(const KURL& ping_url) { KURL destination_url(kParsedURLString, "http://navigation.destination"); URLTestHelpers::RegisterMockedURLLoad( - ping_url, testing::WebTestDataPath("bar.html"), "text/html"); + ping_url, testing::CoreTestDataPath("bar.html"), "text/html"); PingLoader::SendLinkAuditPing(&page_holder_->GetFrame(), ping_url, destination_url); const ResourceRequest& ping_request = client_->PingRequest();
diff --git a/third_party/WebKit/Source/core/loader/ProgrammaticScrollTest.cpp b/third_party/WebKit/Source/core/loader/ProgrammaticScrollTest.cpp new file mode 100644 index 0000000..ca0d4569 --- /dev/null +++ b/third_party/WebKit/Source/core/loader/ProgrammaticScrollTest.cpp
@@ -0,0 +1,107 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/exported/WebViewBase.h" +#include "core/frame/FrameTestHelpers.h" +#include "core/frame/LocalFrameView.h" +#include "core/frame/WebLocalFrameBase.h" +#include "core/loader/DocumentLoader.h" +#include "core/loader/FrameLoader.h" +#include "platform/testing/URLTestHelpers.h" +#include "platform/testing/UnitTestHelpers.h" +#include "public/platform/Platform.h" +#include "public/platform/WebInputEvent.h" +#include "public/platform/WebURLLoaderMockFactory.h" +#include "public/web/WebFrame.h" +#include "public/web/WebFrameClient.h" +#include "public/web/WebHistoryItem.h" +#include "public/web/WebScriptSource.h" +#include "public/web/WebSettings.h" +#include "public/web/WebView.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace blink { + +class ProgrammaticScrollTest : public ::testing::Test { + public: + ProgrammaticScrollTest() : base_url_("http://www.test.com/") {} + + void TearDown() override { + Platform::Current() + ->GetURLLoaderMockFactory() + ->UnregisterAllURLsAndClearMemoryCache(); + } + + protected: + void RegisterMockedHttpURLLoad(const std::string& file_name) { + URLTestHelpers::RegisterMockedURLLoadFromBase( + WebString::FromUTF8(base_url_), testing::CoreTestDataPath(), + WebString::FromUTF8(file_name)); + } + + std::string base_url_; +}; + +TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithScale) { + RegisterMockedHttpURLLoad("long_scroll.html"); + + FrameTestHelpers::WebViewHelper web_view_helper; + WebViewBase* web_view = + web_view_helper.InitializeAndLoad(base_url_ + "long_scroll.html"); + web_view->Resize(WebSize(1000, 1000)); + web_view->UpdateAllLifecyclePhases(); + + FrameLoader& loader = web_view->MainFrameImpl()->GetFrame()->Loader(); + loader.GetDocumentLoader()->SetLoadType(kFrameLoadTypeBackForward); + + web_view->SetPageScaleFactor(3.0f); + web_view->MainFrameImpl()->SetScrollOffset(WebSize(0, 500)); + loader.GetDocumentLoader()->GetInitialScrollState().was_scrolled_by_user = + false; + loader.GetDocumentLoader()->GetHistoryItem()->SetPageScaleFactor(2); + loader.GetDocumentLoader()->GetHistoryItem()->SetScrollOffset( + ScrollOffset(0, 200)); + + // Flip back the wasScrolledByUser flag which was set to true by + // setPageScaleFactor because otherwise + // FrameLoader::restoreScrollPositionAndViewState does nothing. + loader.GetDocumentLoader()->GetInitialScrollState().was_scrolled_by_user = + false; + loader.RestoreScrollPositionAndViewState(); + + // Expect that both scroll and scale were restored. + EXPECT_EQ(2.0f, web_view->PageScaleFactor()); + EXPECT_EQ(200, web_view->MainFrameImpl()->GetScrollOffset().height); +} + +TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithoutScale) { + RegisterMockedHttpURLLoad("long_scroll.html"); + + FrameTestHelpers::WebViewHelper web_view_helper; + WebViewBase* web_view = + web_view_helper.InitializeAndLoad(base_url_ + "long_scroll.html"); + web_view->Resize(WebSize(1000, 1000)); + web_view->UpdateAllLifecyclePhases(); + + FrameLoader& loader = web_view->MainFrameImpl()->GetFrame()->Loader(); + loader.GetDocumentLoader()->SetLoadType(kFrameLoadTypeBackForward); + + web_view->SetPageScaleFactor(3.0f); + web_view->MainFrameImpl()->SetScrollOffset(WebSize(0, 500)); + loader.GetDocumentLoader()->GetInitialScrollState().was_scrolled_by_user = + false; + loader.GetDocumentLoader()->GetHistoryItem()->SetPageScaleFactor(0); + loader.GetDocumentLoader()->GetHistoryItem()->SetScrollOffset( + ScrollOffset(0, 400)); + + // FrameLoader::restoreScrollPositionAndViewState flows differently if scale + // is zero. + loader.RestoreScrollPositionAndViewState(); + + // Expect that only the scroll position was restored. + EXPECT_EQ(3.0f, web_view->PageScaleFactor()); + EXPECT_EQ(400, web_view->MainFrameImpl()->GetScrollOffset().height); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilderTest.cpp b/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilderTest.cpp index 0f1ec3e..26219bb4 100644 --- a/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilderTest.cpp +++ b/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilderTest.cpp
@@ -14,7 +14,7 @@ std::unique_ptr<DummyPageHolder> page_holder = DummyPageHolder::Create(IntSize(0, 0)); Document& document = page_holder->GetDocument(); - document.SetURL(KURL(KURL(), url)); + document.SetURL(KURL(NullURL(), url)); TextResourceDecoderBuilder decoder_builder("text/html", g_null_atom); return decoder_builder.BuildFor(&document)->Encoding(); }
diff --git a/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp b/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp index 420e433..fcd6e6c0 100644 --- a/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp +++ b/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
@@ -88,16 +88,16 @@ } KURL SuccessURL() { - return KURL(KURL(), "http://example.com/success"); + return KURL(NullURL(), "http://example.com/success"); } KURL ErrorURL() { - return KURL(KURL(), "http://example.com/error"); + return KURL(NullURL(), "http://example.com/error"); } KURL RedirectURL() { - return KURL(KURL(), "http://example.com/redirect"); + return KURL(NullURL(), "http://example.com/redirect"); } KURL RedirectLoopURL() { - return KURL(KURL(), "http://example.com/loop"); + return KURL(NullURL(), "http://example.com/loop"); } enum ThreadableLoaderToTest { @@ -259,7 +259,8 @@ BLINK_FROM_HERE, CrossThreadBind(&WaitableEvent::Signal, CrossThreadUnretained(&event))); event.Wait(); - worker_thread_->TerminateAndWait(); + worker_thread_->Terminate(); + worker_thread_->WaitForShutdownForTesting(); // Needed to clean up the things on the main thread side and // avoid Resource leaks. @@ -381,7 +382,7 @@ void SetUpSuccessURL() { URLTestHelpers::RegisterMockedURLLoad( - SuccessURL(), testing::WebTestDataPath(kFileName), "text/html"); + SuccessURL(), testing::CoreTestDataPath(kFileName), "text/html"); } void SetUpErrorURL() { @@ -402,7 +403,7 @@ response.AddHTTPHeaderField("Access-Control-Allow-Origin", "null"); URLTestHelpers::RegisterMockedURLLoadWithCustomResponse( - url, testing::WebTestDataPath(kFileName), response); + url, testing::CoreTestDataPath(kFileName), response); } void SetUpRedirectLoopURL() { @@ -419,7 +420,7 @@ response.AddHTTPHeaderField("Access-Control-Allow-Origin", "null"); URLTestHelpers::RegisterMockedURLLoadWithCustomResponse( - url, testing::WebTestDataPath(kFileName), response); + url, testing::CoreTestDataPath(kFileName), response); } std::unique_ptr<MockThreadableLoaderClient> client_; @@ -850,7 +851,7 @@ // test is not saying that didFailAccessControlCheck should be dispatched // synchronously, but is saying that even when a response is served // synchronously it should not lead to a crash. - StartLoader(KURL(KURL(), "about:blank"), + StartLoader(KURL(NullURL(), "about:blank"), WebURLRequest::kFetchRequestModeCORS); CallCheckpoint(2); }
diff --git a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp index 0e08b428..1f5efbc0 100644 --- a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp +++ b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
@@ -8,12 +8,17 @@ #include "core/frame/Deprecation.h" #include "core/frame/UseCounter.h" #include "core/loader/MixedContentChecker.h" +#include "core/probe/CoreProbes.h" #include "core/timing/WorkerGlobalScopePerformance.h" #include "core/workers/WorkerClients.h" +#include "core/workers/WorkerGlobalScope.h" +#include "platform/RuntimeEnabledFeatures.h" #include "platform/Supplementable.h" #include "platform/WebTaskRunner.h" #include "platform/exported/WrappedResourceRequest.h" #include "platform/loader/fetch/ResourceFetcher.h" +#include "platform/weborigin/SecurityPolicy.h" +#include "public/platform/Platform.h" #include "public/platform/WebMixedContent.h" #include "public/platform/WebMixedContentContextType.h" #include "public/platform/WebURLRequest.h" @@ -112,15 +117,18 @@ bool WorkerFetchContext::ShouldBlockRequestByInspector( const ResourceRequest& resource_request) const { - // TODO(horo): Implement this. - return false; + bool should_block_request = false; + probe::shouldBlockRequest(global_scope_, resource_request, + &should_block_request); + return should_block_request; } void WorkerFetchContext::DispatchDidBlockRequest( const ResourceRequest& resource_request, const FetchInitiatorInfo& fetch_initiator_info, ResourceRequestBlockedReason blocked_reason) const { - // TODO(horo): Implement this. + probe::didBlockRequest(global_scope_, resource_request, nullptr, + fetch_initiator_info, blocked_reason); } bool WorkerFetchContext::ShouldBypassMainWorldCSP() const { @@ -221,6 +229,11 @@ void WorkerFetchContext::PrepareRequest(ResourceRequest& request, RedirectType) { + String user_agent = global_scope_->UserAgent(); + probe::applyUserAgentOverride(global_scope_, &user_agent); + DCHECK(!user_agent.IsNull()); + request.SetHTTPUserAgent(AtomicString(user_agent)); + request.OverrideLoadingIPCType(WebURLRequest::LoadingIPCType::kMojo); WrappedResourceRequest webreq(request); web_context_->WillSendRequest(webreq); @@ -238,6 +251,15 @@ request.SetHTTPHeaderField("Save-Data", "on"); } +void WorkerFetchContext::DispatchWillSendRequest( + unsigned long identifier, + ResourceRequest& request, + const ResourceResponse& redirect_response, + const FetchInitiatorInfo& initiator_info) { + probe::willSendRequest(global_scope_, identifier, nullptr, request, + redirect_response, initiator_info); +} + void WorkerFetchContext::DispatchDidReceiveResponse( unsigned long identifier, const ResourceResponse& response, @@ -255,6 +277,36 @@ web_context_->DidDisplayContentWithCertificateErrors(response.Url()); } } + probe::didReceiveResourceResponse(global_scope_, identifier, nullptr, + response, resource); +} + +void WorkerFetchContext::DispatchDidReceiveData(unsigned long identifier, + const char* data, + int data_length) { + probe::didReceiveData(global_scope_, identifier, nullptr, data, data_length); +} + +void WorkerFetchContext::DispatchDidReceiveEncodedData( + unsigned long identifier, + int encoded_data_length) { + probe::didReceiveEncodedDataLength(global_scope_, identifier, + encoded_data_length); +} + +void WorkerFetchContext::DispatchDidFinishLoading(unsigned long identifier, + double finish_time, + int64_t encoded_data_length, + int64_t decoded_body_length) { + probe::didFinishLoading(global_scope_, identifier, nullptr, finish_time, + encoded_data_length, decoded_body_length); +} + +void WorkerFetchContext::DispatchDidFail(unsigned long identifier, + const ResourceError& error, + int64_t encoded_data_length, + bool is_internal_request) { + probe::didFailLoading(global_scope_, identifier, error); } void WorkerFetchContext::AddResourceTiming(const ResourceTimingInfo& info) {
diff --git a/third_party/WebKit/Source/core/loader/WorkerFetchContext.h b/third_party/WebKit/Source/core/loader/WorkerFetchContext.h index e092ffa..18972615 100644 --- a/third_party/WebKit/Source/core/loader/WorkerFetchContext.h +++ b/third_party/WebKit/Source/core/loader/WorkerFetchContext.h
@@ -64,21 +64,36 @@ void AddConsoleMessage(ConsoleMessage*) const override; // FetchContext implementation: - // TODO(horo): Implement more methods. SecurityOrigin* GetSecurityOrigin() const override; std::unique_ptr<WebURLLoader> CreateURLLoader( const ResourceRequest&) override; void PrepareRequest(ResourceRequest&, RedirectType) override; bool IsControlledByServiceWorker() const override; - void AddAdditionalRequestHeaders(ResourceRequest&, FetchResourceType) override; + void DispatchWillSendRequest(unsigned long, + ResourceRequest&, + const ResourceResponse&, + const FetchInitiatorInfo&) override; void DispatchDidReceiveResponse(unsigned long identifier, const ResourceResponse&, WebURLRequest::FrameType, WebURLRequest::RequestContext, Resource*, ResourceResponseType) override; + void DispatchDidReceiveData(unsigned long identifier, + const char* data, + int dataLength) override; + void DispatchDidReceiveEncodedData(unsigned long identifier, + int encodedDataLength) override; + void DispatchDidFinishLoading(unsigned long identifier, + double finishTime, + int64_t encodedDataLength, + int64_t decodedBodyLength) override; + void DispatchDidFail(unsigned long identifier, + const ResourceError&, + int64_t encodedDataLength, + bool isInternalRequest) override; void AddResourceTiming(const ResourceTimingInfo&) override; void PopulateResourceRequest(const KURL&, Resource::Type,
diff --git a/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.cpp b/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.cpp index be133459..b5d1466 100644 --- a/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.cpp +++ b/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.cpp
@@ -35,6 +35,8 @@ #include "core/loader/ThreadableLoadingContext.h" #include "core/timing/WorkerGlobalScopePerformance.h" #include "core/workers/WorkerGlobalScope.h" +#include "core/workers/WorkerThread.h" +#include "core/workers/WorkerThreadLifecycleContext.h" #include "platform/CrossThreadFunctional.h" #include "platform/heap/SafePoint.h" #include "platform/loader/fetch/ResourceError.h"
diff --git a/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h b/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h index dc452388..5b5acf64a 100644 --- a/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h +++ b/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h
@@ -52,6 +52,7 @@ class ResourceRequest; class ResourceResponse; class WorkerGlobalScope; +class WorkerThreadLifecycleContext; struct CrossThreadResourceRequestData; struct CrossThreadResourceTimingInfoData;
diff --git a/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp b/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp index 6c25e3b5..3e3d959 100644 --- a/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp +++ b/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp
@@ -97,7 +97,7 @@ DCHECK(document_loader_->GetFrame()); LocalFrame& frame = *document_loader_->GetFrame(); - host_ = frame.Loader().Client()->CreateApplicationCacheHost(this); + host_ = frame.Client()->CreateApplicationCacheHost(this); if (!host_) return; @@ -235,7 +235,7 @@ ApplicationCacheHost::CacheInfo ApplicationCacheHost::ApplicationCacheInfo() { if (!host_) - return CacheInfo(KURL(), 0, 0, 0); + return CacheInfo(NullURL(), 0, 0, 0); WebApplicationCacheHost::CacheInfo web_info; host_->GetAssociatedCacheInfo(&web_info);
diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp index 2b81fc5..5ee8a06 100644 --- a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp +++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp
@@ -87,6 +87,9 @@ Vector<ModuleRequest> ModuleRequestsFromScriptModule(ScriptModule) override { return requests_; } + ScriptModuleState GetRecordStatus(ScriptModule) override { + return ScriptModuleState::kUninstantiated; + } DECLARE_TRACE(); @@ -124,7 +127,7 @@ void ModuleScriptLoaderTest::SetUp() { platform_->AdvanceClockSeconds(1.); // For non-zero DocumentParserTimings dummy_page_holder_ = DummyPageHolder::Create(IntSize(500, 500)); - GetDocument().SetURL(KURL(KURL(), "https://example.test")); + GetDocument().SetURL(KURL(NullURL(), "https://example.test")); auto* context = MockFetchContext::Create(MockFetchContext::kShouldLoadNewResource); fetcher_ = ResourceFetcher::Create(context, context->GetTaskRunner().Get()); @@ -135,7 +138,7 @@ TEST_F(ModuleScriptLoaderTest, fetchDataURL) { ModuleScriptLoaderRegistry* registry = ModuleScriptLoaderRegistry::Create(); - KURL url(KURL(), "data:text/javascript,export default 'grapes';"); + KURL url(NullURL(), "data:text/javascript,export default 'grapes';"); ModuleScriptFetchRequest module_request( url, String(), kParserInserted, WebURLRequest::kFetchCredentialsModeOmit); TestModuleScriptLoaderClient* client = new TestModuleScriptLoaderClient; @@ -145,13 +148,12 @@ EXPECT_TRUE(client->WasNotifyFinished()) << "ModuleScriptLoader should finish synchronously."; ASSERT_TRUE(client->GetModuleScript()); - EXPECT_EQ(client->GetModuleScript()->State(), - ModuleInstantiationState::kUninstantiated); + EXPECT_FALSE(client->GetModuleScript()->IsErrored()); } TEST_F(ModuleScriptLoaderTest, InvalidSpecifier) { ModuleScriptLoaderRegistry* registry = ModuleScriptLoaderRegistry::Create(); - KURL url(KURL(), + KURL url(NullURL(), "data:text/javascript,import 'invalid';export default 'grapes';"); ModuleScriptFetchRequest module_request( url, String(), kParserInserted, WebURLRequest::kFetchCredentialsModeOmit); @@ -184,7 +186,7 @@ TEST_F(ModuleScriptLoaderTest, fetchURL) { KURL url(kParsedURLString, "http://127.0.0.1:8000/module.js"); URLTestHelpers::RegisterMockedURLLoad( - url, testing::WebTestDataPath("module.js"), "text/javascript"); + url, testing::CoreTestDataPath("module.js"), "text/javascript"); ModuleScriptLoaderRegistry* registry = ModuleScriptLoaderRegistry::Create(); ModuleScriptFetchRequest module_request(
diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp b/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp index 1662a7a..7211247 100644 --- a/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp +++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp
@@ -27,9 +27,9 @@ AncestorList ancestor_list_with_url = ancestor_list; ancestor_list_with_url.insert(request.Url()); - ModuleTreeLinker* fetcher = - new ModuleTreeLinker(ancestor_list_with_url, modulator, registry, client); - fetcher->FetchSelf(request, level); + ModuleTreeLinker* fetcher = new ModuleTreeLinker( + ancestor_list_with_url, level, modulator, registry, client); + fetcher->FetchSelf(request); return fetcher; } @@ -45,8 +45,9 @@ DCHECK(module_script); // 4. "Fetch the descendants of script (using an empty ancestor list)." - ModuleTreeLinker* fetcher = - new ModuleTreeLinker(empty_ancestor_list, modulator, registry, client); + ModuleTreeLinker* fetcher = new ModuleTreeLinker( + empty_ancestor_list, ModuleGraphLevel::kTopLevelModuleFetch, modulator, + registry, client); fetcher->module_script_ = module_script; fetcher->AdvanceState(State::kFetchingSelf); @@ -65,6 +66,7 @@ } ModuleTreeLinker::ModuleTreeLinker(const AncestorList& ancestor_list_with_url, + ModuleGraphLevel level, Modulator* modulator, ModuleTreeLinkerRegistry* registry, ModuleTreeClient* client) @@ -72,8 +74,8 @@ registry_(registry), client_(client), ancestor_list_with_url_(ancestor_list_with_url), - module_script_(this, nullptr), - descendants_module_script_(this, nullptr) { + level_(level), + module_script_(this, nullptr) { CHECK(modulator); CHECK(registry); CHECK(client); @@ -84,14 +86,12 @@ visitor->Trace(registry_); visitor->Trace(client_); visitor->Trace(module_script_); - visitor->Trace(descendants_module_script_); visitor->Trace(dependency_clients_); SingleModuleClient::Trace(visitor); } DEFINE_TRACE_WRAPPERS(ModuleTreeLinker) { visitor->TraceWrappers(module_script_); - visitor->TraceWrappers(descendants_module_script_); } #if DCHECK_IS_ON() @@ -145,22 +145,25 @@ state_ = new_state; if (state_ == State::kFinished) { - RESOURCE_LOADING_DVLOG(1) - << "ModuleTreeLinker[" << this << "] finished with final result " - << descendants_module_script_; + if (module_script_) { + RESOURCE_LOADING_DVLOG(1) + << "ModuleTreeLinker[" << this << "] finished with final result " + << *module_script_; + } else { + RESOURCE_LOADING_DVLOG(1) + << "ModuleTreeLinker[" << this << "] finished with nullptr."; + } registry_->ReleaseFinishedFetcher(this); // https://html.spec.whatwg.org/multipage/webappapis.html#internal-module-script-graph-fetching-procedure - // Step 7. When the "fetch the descendants of and instantiate a module - // script" algorithm asynchronously completes with final result, - // asynchronously complete this algorithm with final result. - client_->NotifyModuleTreeLoadFinished(descendants_module_script_); + // Step 6. When the appropriate algorithm asynchronously completes with + // final result, asynchronously complete this algorithm with final result. + client_->NotifyModuleTreeLoadFinished(module_script_); } } -void ModuleTreeLinker::FetchSelf(const ModuleScriptFetchRequest& request, - ModuleGraphLevel level) { +void ModuleTreeLinker::FetchSelf(const ModuleScriptFetchRequest& request) { // https://html.spec.whatwg.org/multipage/webappapis.html#internal-module-script-graph-fetching-procedure // Step 1. Fetch a single module script given url, fetch client settings @@ -169,7 +172,7 @@ // If the caller of this algorithm specified custom perform the fetch steps, // pass those along while fetching a single module script. AdvanceState(State::kFetchingSelf); - modulator_->FetchSingle(request, level, this); + modulator_->FetchSingle(request, level_, this); // Step 2. Return from this algorithm, and run the following steps when // fetching a single module script asynchronously completes with result. @@ -180,23 +183,26 @@ void ModuleTreeLinker::NotifyModuleLoadFinished(ModuleScript* result) { // https://html.spec.whatwg.org/multipage/webappapis.html#internal-module-script-graph-fetching-procedure - // Step 3. "If result is null, ..." - // Step 4. "If result's state is "instantiated" or "errored", ..." - // TODO(kouhei): Update the spec references. - if (!result || result->State() == ModuleInstantiationState::kInstantiated || - result->IsErrored()) { + // Step 3. "If result is null, is errored, or has instantiated, asynchronously + // complete this algorithm with result, and abort these steps. + if (!result || result->IsErrored() || result->HasInstantiated()) { // "asynchronously complete this algorithm with result, and abort these // steps." - descendants_module_script_ = result; + module_script_ = result; AdvanceState(State::kFinished); return; } - // Step 5. Assert: result's state is "uninstantiated". - DCHECK_EQ(ModuleInstantiationState::kUninstantiated, result->State()); + // Step 4. Assert: result's state is "uninstantiated". + DCHECK_EQ(ScriptModuleState::kUninstantiated, result->RecordStatus()); - // Step 6. Fetch the descendants of and instantiate result given destination - // and an ancestor list obtained by appending url to ancestor list. + // Step 5. If the top-level module fetch flag is set, fetch the descendants of + // and instantiate result given destination and an ancestor list obtained by + // appending url to ancestor list. Otherwise, fetch the descendants of result + // given the same arguments. + // Note: top-level module fetch flag is checked at Instantiate(), where + // "fetch the descendants of and instantiate" procedure and + // "fetch the descendants" procedure actually diverge. module_script_ = result; FetchDescendants(); } @@ -210,9 +216,12 @@ DEFINE_INLINE_TRACE() { visitor->Trace(module_tree_linker_); + visitor->Trace(result_); ModuleTreeClient::Trace(visitor); } + ModuleScript* Result() { return result_.Get(); } + private: explicit DependencyModuleClient(ModuleTreeLinker* module_tree_linker) : module_tree_linker_(module_tree_linker) { @@ -223,6 +232,7 @@ void NotifyModuleTreeLoadFinished(ModuleScript*) override; Member<ModuleTreeLinker> module_tree_linker_; + Member<ModuleScript> result_; }; void ModuleTreeLinker::FetchDescendants() { @@ -231,86 +241,60 @@ // [nospec] Abort the steps if the browsing context is discarded. if (!modulator_->HasValidContext()) { - descendants_module_script_ = nullptr; + module_script_ = nullptr; AdvanceState(State::kFinished); return; } - // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-the-descendants-of-and-instantiate-a-module-script + // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-the-descendants-of-a-module-script // Step 1. If ancestor list was not given, let it be the empty list. // Note: The "ancestor list" in spec corresponds to |ancestor_list_with_url_|. - // Step 2. If module script's state is "instantiated" or "errored", + // Step 2. If module script is errored or has instantiated, // asynchronously complete this algorithm with module script, and abort these // steps. - // TODO(kouhei): Update spec references - if (module_script_->State() == ModuleInstantiationState::kInstantiated || - module_script_->IsErrored()) { - descendants_module_script_ = module_script_; + if (module_script_->IsErrored() || module_script_->HasInstantiated()) { AdvanceState(State::kFinished); return; } - // Step 3. Assert: module script's state is "uninstantiated" - DCHECK_EQ(ModuleInstantiationState::kUninstantiated, module_script_->State()); - - // Step 4. Let record be module script's module record. + // Step 3. Let record be module script's module record. ScriptModule record = module_script_->Record(); DCHECK(!record.IsNull()); - // Step 5. If record.[[RequestedModules]] is empty, asynchronously complete + // Step 4. If record.[[RequestedModules]] is empty, asynchronously complete // this algorithm with module script. - // Note: We defer this bail-out until Step 9. Step 6-9 will be no-op anyway if - // record.[[RequestedModules]] is empty. + // Note: We defer this bail-out until the end of the procedure. The rest of + // the procedure will be no-op anyway if record.[[RequestedModules]] + // is empty. - // Step 6. Let urls be a new empty list. + // Step 5. Let urls be a new empty list. Vector<KURL> urls; Vector<TextPosition> positions; - // Step 7. For each string requested of record.[[RequestedModules]], + // Step 6. For each string requested of record.[[RequestedModules]], Vector<Modulator::ModuleRequest> module_requests = modulator_->ModuleRequestsFromScriptModule(record); for (const auto& module_request : module_requests) { - // Step 7.1. Let url be the result of resolving a module specifier given + // Step 6.1. Let url be the result of resolving a module specifier given // module script and requested. KURL url = Modulator::ResolveModuleSpecifier(module_request.specifier, module_script_->BaseURL()); - // Step 7.2. If url is failure: ... - if (url.IsNull()) { - // Step 7.2.1. Let error be a new TypeError exception. - ScriptState::Scope scope(modulator_->GetScriptState()); - v8::Isolate* isolate = modulator_->GetScriptState()->GetIsolate(); - v8::Local<v8::Value> error = V8ThrowException::CreateTypeError( - isolate, "Failed to resolve module specifier \'" + - module_request.specifier + "'"); - - // Step 7.2.2. Error module script with error. - module_script_->SetErrorAndClearRecord( - ScriptValue(modulator_->GetScriptState(), error)); - - // Step 7.2.3. Abort this algorithm, and asynchronously complete it with - // module_sript_. Note: The return variable for "internal module script - // graph fetching procedure" is descendants_module_script_ per Step 7. - descendants_module_script_ = module_script_; - AdvanceState(State::kFinished); - return; - } - - // Step 7.3. Otherwise, if ancestor list does not contain url, append url to - // urls. + // Step 6.2. Assert: url is never failure, because resolving a module + // specifier must have been previously successful with these same two + // arguments. CHECK(url.IsValid()) << "Modulator::resolveModuleSpecifier() impl must " "return either a valid url or null."; + + // Step 6.3. if ancestor list does not contain url, append url to urls. if (!ancestor_list_with_url_.Contains(url)) { urls.push_back(url); positions.push_back(module_request.position); } } - // Step 8. Let descendants result be null. - DCHECK(!descendants_module_script_); - - // Step 9. For each url in urls, perform the internal module script graph + // Step 7. For each url in urls, perform the internal module script graph // fetching procedure given url, module script's credentials mode, module // script's cryptographic nonce, module script's parser state, destination, // module script's settings object, module script's settings object, ancestor @@ -320,19 +304,16 @@ // fetching procedure. if (urls.IsEmpty()) { - // Step 5. If record.[[RequestedModules]] is empty, asynchronously + // Step 4. If record.[[RequestedModules]] is empty, asynchronously // complete this algorithm with module script. [spec text] - // Note: We actually proceed to Step 10 here. [nospec, but a pending PR - // fixes this.] // Also, if record.[[RequestedModules]] is not empty but |urls| is - // empty here, we can proceed to Step 10. - descendants_module_script_ = module_script_; + // empty here, we complete this algorithm. Instantiate(); return; } - // Step 9, when "urls" is non-empty. + // Step 7, when "urls" is non-empty. // These invocations of the internal module script graph fetching procedure // should be performed in parallel to each other. [spec text] CHECK_EQ(num_incomplete_descendants_, 0u); @@ -358,11 +339,22 @@ void ModuleTreeLinker::DependencyModuleClient::NotifyModuleTreeLoadFinished( ModuleScript* module_script) { - module_tree_linker_->NotifyOneDescendantFinished(module_script); + result_ = module_script; + if (module_script) { + RESOURCE_LOADING_DVLOG(1) + << "ModuleTreeLinker[" << module_tree_linker_.Get() + << "]::DependencyModuleClient::NotifyModuleTreeLoadFinished() with " + << *module_script; + } else { + RESOURCE_LOADING_DVLOG(1) + << "ModuleTreeLinker[" << module_tree_linker_.Get() + << "]::DependencyModuleClient::NotifyModuleTreeLoadFinished() with " + << "nullptr."; + } + module_tree_linker_->NotifyOneDescendantFinished(); } -void ModuleTreeLinker::NotifyOneDescendantFinished( - ModuleScript* module_script) { +void ModuleTreeLinker::NotifyOneDescendantFinished() { if (state_ != State::kFetchingDependencies) { // We may reach here if one of the descendant failed to load, and the other // descendants fetches were in flight. @@ -374,207 +366,95 @@ CHECK_GT(num_incomplete_descendants_, 0u); --num_incomplete_descendants_; - // Step 9 of - // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-the-descendants-of-and-instantiate-a-module-script - // "If any invocation of the internal module script graph fetching procedure - // asynchronously completes with null, then ..." [spec text] - if (!module_script) { - RESOURCE_LOADING_DVLOG(1) - << "ModuleTreeLinker[" << this - << "]::NotifyOneDescendantFinished with null. " - << num_incomplete_descendants_ << " remaining descendants."; - - // "optionally abort all other invocations, " [spec text] - // TODO(kouhei) Implement this. - - // "set descendants result to null, and ... " [spec text] - DCHECK(!descendants_module_script_); - - // "proceed to the next step. (The un-fetched descendant will cause errors - // during instantiation.)" [spec text] - Instantiate(); - return; - } - RESOURCE_LOADING_DVLOG(1) - << "ModuleTreeLinker[" << this - << "]::NotifyOneDescendantFinished with a module script of state \"" - << ModuleInstantiationStateToString(module_script->State()) << "\". " + << "ModuleTreeLinker[" << this << "]::NotifyOneDescendantFinished. " << num_incomplete_descendants_ << " remaining descendants."; - // "If any invocation of the internal module script graph fetching procedure - // asynchronously completes with a module script whose state is "errored", - // then ..." [spec text] - // TODO(kouhei): Update spec references. - if (module_script->IsErrored()) { - // "optionally abort all other invocations, ..." [spec text] - // TODO(kouhei) Implement this. - - // "set descendants result to module script, ..." [spec text] - descendants_module_script_ = module_script_; - - // "and proceed to the next step. (The errored descendant will cause errors - // during instantiation.)" [spec text] - Instantiate(); + // Step 7 of + // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-the-descendants-of-a-module-script + // "Wait for all invocations of the internal module script graph fetching + // procedure to asynchronously complete, and ..." [spec text] + if (num_incomplete_descendants_) return; + + // "let results be a list of the results, corresponding to the same order they + // appeared in urls. Then, for each result of results:" [spec text] + for (const auto& client : dependency_clients_) { + ModuleScript* result = client->Result(); + + // Step 7.1: "If result is null, ..." [spec text] + if (!result) { + // "asynchronously complete this algorithm with null, aborting these + // steps." [spec text] + module_script_ = nullptr; + AdvanceState(State::kFinished); + return; + } + + // Step 7.2: "If result is errored, ..." [spec text] + if (result->IsErrored()) { + // "then set the pre-instantiation error for module script to result's + // error ..." [spec text] + ScriptValue error = modulator_->GetError(result); + module_script_->SetErrorAndClearRecord(error); + + // "Asynchronously complete this algorithm with module script, aborting + // these steps." [spec text] + AdvanceState(State::kFinished); + return; + } } - // "Otherwise, wait for all of the internal module script graph fetching - // procedure invocations to asynchronously complete, with module scripts whose - // states are not "errored"." [spec text] - if (!num_incomplete_descendants_) { - // "Then, set descendants result to module script, and proceed to the next - // step." [spec text] - descendants_module_script_ = module_script_; - Instantiate(); - } + Instantiate(); } void ModuleTreeLinker::Instantiate() { CHECK(module_script_); AdvanceState(State::kInstantiating); - // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-the-descendants-of-and-instantiate-a-module-script + // https://html.spec.whatwg.org/multipage/webappapis.html#internal-module-script-graph-fetching-procedure + // Step 5. "If the top-level module fetch flag is set, fetch the descendants + // of and instantiate result given destination and an ancestor list obtained + // by appending url to ancestor list. Otherwise, fetch the descendants of + // result given the same arguments." [spec text] + if (level_ != ModuleGraphLevel::kTopLevelModuleFetch) { + // We don't proceed to instantiate steps if this is descendants module graph + // fetch. + DCHECK_EQ(level_, ModuleGraphLevel::kDependentModuleFetch); + AdvanceState(State::kFinished); + return; + } + // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-the-descendants-of-and-instantiate-a-module-script // [nospec] Abort the steps if the browsing context is discarded. if (!modulator_->HasValidContext()) { - descendants_module_script_ = nullptr; + module_script_ = nullptr; AdvanceState(State::kFinished); return; } - // Contrary to the spec, we don't store the "record" in Step 4 for its use in - // Step 10. If Instantiate() was called on descendant ModuleTreeLinker and - // failed, module_script_->Record() may be already cleared. - if (module_script_->IsErrored()) { + // Step 1-2 are "fetching the descendants of a module script", which we just + // executed. + + // Step 3. "If result is null or is errored, ..." [spec text] + if (!module_script_ || module_script_->IsErrored()) { + // "then asynchronously complete this algorithm with result." [spec text] + module_script_ = nullptr; AdvanceState(State::kFinished); return; } - // Step 4. Let record be result's module record. + // Step 4. "Let record be result's module record." [spec text] ScriptModule record = module_script_->Record(); - // Step 10. Let instantiationStatus be record.ModuleDeclarationInstantiation. - // Note: The |error| variable corresponds to spec variable - // "instantiationStatus". If |error| is empty, it indicates successful - // completion. - ScriptValue error = modulator_->InstantiateModule(record); + // Step 5. "Perform record.ModuleDeclarationInstantiation()." [spec text] - // Step 11. For each script in module script's uninstantiated inclusive - // descendant module scripts, perform the following steps: - HeapHashSet<Member<ModuleScript>> uninstantiated_set = - UninstantiatedInclusiveDescendants(); - for (const auto& descendant : uninstantiated_set) { - if (!error.IsEmpty()) { - // Step 11.1. If instantiationStatus is an abrupt completion, then - // error script with instantiationStatus.[[Value]] - descendant->SetErrorAndClearRecord(error); - } else { - // Step 11.2. Otherwise, set script's instantiation state to - // "instantiated". - descendant->SetInstantiationSuccess(); - } - } + // "If this throws an exception, ignore it for now; it is stored as result's + // error, and will be reported when we run result." [spec text] + modulator_->InstantiateModule(record); - // Step 12. Asynchronously complete this algorithm with descendants result. + // Step 6. Asynchronously complete this algorithm with descendants result. AdvanceState(State::kFinished); } -HeapHashSet<Member<ModuleScript>> -ModuleTreeLinker::UninstantiatedInclusiveDescendants() { - // https://html.spec.whatwg.org/multipage/webappapis.html#uninstantiated-inclusive-descendant-module-scripts - // Step 1. If script's module record is null, return the empty set. - if (module_script_->HasEmptyRecord()) - return HeapHashSet<Member<ModuleScript>>(); - - // Step 2. Let moduleMap be script's settings object's module map. - // Note: Modulator is our "settings object". - // Note: We won't reference the ModuleMap directly here to aid testing. - - // Step 3. Let stack be the stack << script >>. - // TODO(kouhei): Make stack a HeapLinkedHashSet for O(1) lookups. - HeapDeque<Member<ModuleScript>> stack; - stack.push_front(module_script_); - - // Step 4. Let inclusive descendants be an empty set. - // Note: We use unordered set here as the order is not observable from web - // platform. - // This is allowed per spec: https://infra.spec.whatwg.org/#sets - HeapHashSet<Member<ModuleScript>> inclusive_descendants; - - // Step 5. While stack is not empty: - while (!stack.IsEmpty()) { - // Step 5.1. Let current the result of popping from stack. - ModuleScript* current = stack.TakeFirst(); - - // Step 5.2. Assert: current is a module script (i.e., it is not "fetching" - // or null). - DCHECK(current); - - // Step 5.3. If inclusive descendants and stack both do not contain current, - // then: - if (inclusive_descendants.Contains(current)) - continue; - if (std::find(stack.begin(), stack.end(), current) != stack.end()) - continue; - - // Step 5.3.1. Append current to inclusive descendants. - inclusive_descendants.insert(current); - - // TODO(kouhei): This implementation is a direct transliteration of the - // spec. Omit intermediate vectors at the least. - - // Step 5.3.2. Let child specifiers be the value of current's module - // record's [[RequestedModules]] internal slot. - Vector<Modulator::ModuleRequest> child_requests = - modulator_->ModuleRequestsFromScriptModule(current->Record()); - // Step 5.3.3. Let child URLs be the list obtained by calling resolve a - // module specifier once for each item of child specifiers, given current - // and that item. Omit any failures. - Vector<KURL> child_urls; - for (const auto& child_request : child_requests) { - KURL child_url = modulator_->ResolveModuleSpecifier( - child_request.specifier, current->BaseURL()); - if (child_url.IsValid()) - child_urls.push_back(child_url); - } - // Step 5.3.4. Let child modules be the list obtained by getting each value - // in moduleMap whose key is given by an item of child URLs. - HeapVector<Member<ModuleScript>> child_modules; - for (const auto& child_url : child_urls) { - ModuleScript* module_script = - modulator_->GetFetchedModuleScript(child_url); - - child_modules.push_back(module_script); - } - // Step 5.3.5. For each s of child modules: - for (const auto& s : child_modules) { - // Step 5.3.5.2. If s is null, continue. - // Note: We do null check first, as Blink HashSet can't contain nullptr. - - // Step 5.3.5.3. Assert: s is a module script (i.e., it is not "fetching", - // since by this point all child modules must have been fetched). Note: - // GetFetchedModuleScript returns nullptr if "fetching" - if (!s) - continue; - - // Step 5.3.5.1. If inclusive descendants already contains s, continue. - if (inclusive_descendants.Contains(s)) - continue; - - // Step 5.3.5.4. Push s onto stack. - stack.push_front(s); - } - } - - // Step 6. Return a set containing all items of inclusive descendants whose - // instantiation state is "uninstantiated". - HeapHashSet<Member<ModuleScript>> uninstantiated_set; - for (const auto& script : inclusive_descendants) { - if (script->State() == ModuleInstantiationState::kUninstantiated) - uninstantiated_set.insert(script); - } - return uninstantiated_set; -} - } // namespace blink
diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.h b/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.h index 292628babe..b4a4346 100644 --- a/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.h +++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.h
@@ -46,6 +46,7 @@ private: ModuleTreeLinker(const AncestorList& ancestor_list_with_url, + ModuleGraphLevel, Modulator*, ModuleTreeLinkerRegistry*, ModuleTreeClient*); @@ -65,30 +66,27 @@ #endif void AdvanceState(State); - void FetchSelf(const ModuleScriptFetchRequest&, ModuleGraphLevel); + void FetchSelf(const ModuleScriptFetchRequest&); // Implements SingleModuleClient void NotifyModuleLoadFinished(ModuleScript*) override; void FetchDescendants(); - void NotifyOneDescendantFinished(ModuleScript*); + void NotifyOneDescendantFinished(); void Instantiate(); - HeapHashSet<Member<ModuleScript>> UninstantiatedInclusiveDescendants(); class DependencyModuleClient; friend class DependencyModuleClient; - Member<Modulator> modulator_; - Member<ModuleTreeLinkerRegistry> registry_; - Member<ModuleTreeClient> client_; - HashSet<KURL> ancestor_list_with_url_; + const Member<Modulator> modulator_; + const Member<ModuleTreeLinkerRegistry> registry_; + const Member<ModuleTreeClient> client_; + const HashSet<KURL> ancestor_list_with_url_; + const ModuleGraphLevel level_; State state_ = State::kInitial; // Correspond to _result_ in // https://html.spec.whatwg.org/multipage/webappapis.html#internal-module-script-graph-fetching-procedure TraceWrapperMember<ModuleScript> module_script_; - // Correspond to _descendants result_ in - // https://html.spec.whatwg.org/multipage/webappapis.html#internal-module-script-graph-fetching-procedure - TraceWrapperMember<ModuleScript> descendants_module_script_; size_t num_incomplete_descendants_ = 0; HeapHashSet<Member<DependencyModuleClient>> dependency_clients_; };
diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerTest.cpp b/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerTest.cpp index 5f6e38e..d2cc943 100644 --- a/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerTest.cpp +++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerTest.cpp
@@ -64,7 +64,7 @@ ModuleScript* ResolveSingleModuleScriptFetch( const KURL& url, const Vector<String>& dependency_module_specifiers, - ModuleInstantiationState state) { + ScriptModuleState state) { ScriptState::Scope scope(script_state_.Get()); StringBuilder source_text; @@ -93,7 +93,7 @@ auto result_map = module_map_.insert(url, module_script); EXPECT_TRUE(result_map.is_new_entry); - if (state == ModuleInstantiationState::kErrored) { + if (state == ScriptModuleState::kErrored) { v8::Local<v8::Value> error = V8ThrowException::CreateError( script_state_->GetIsolate(), "Instantiation failure."); module_script->SetErrorAndClearRecord( @@ -101,10 +101,8 @@ } EXPECT_EQ(url, pending_request_url_); - if (state == ModuleInstantiationState::kErrored) { + if (state == ScriptModuleState::kErrored) { EXPECT_TRUE(module_script->IsErrored()); - } else { - EXPECT_EQ(state, module_script->State()); } EXPECT_TRUE(pending_client_); pending_client_->NotifyModuleLoadFinished(module_script); @@ -189,16 +187,26 @@ return it->value; } - ScriptValue InstantiateModule(ScriptModule) override { + ScriptValue InstantiateModule(ScriptModule record) override { if (instantiate_should_fail_) { ScriptState::Scope scope(script_state_.Get()); v8::Local<v8::Value> error = V8ThrowException::CreateError( script_state_->GetIsolate(), "Instantiation failure."); + errored_records_.insert(record); return ScriptValue(script_state_.Get(), error); } + instantiated_records_.insert(record); return ScriptValue(); } + ScriptModuleState GetRecordStatus(ScriptModule record) override { + if (instantiated_records_.Contains(record)) + return ScriptModuleState::kInstantiated; + if (errored_records_.Contains(record)) + return ScriptModuleState::kErrored; + return ScriptModuleState::kUninstantiated; + } + ScriptValue GetError(const ModuleScript* module_script) override { ScriptState::Scope scope(script_state_.Get()); return ScriptValue(script_state_.Get(), module_script->CreateErrorInternal( @@ -224,6 +232,8 @@ HeapHashMap<KURL, Member<ModuleScript>> module_map_; HeapHashMap<KURL, Member<ModuleTreeClient>> pending_tree_client_map_; HashMap<KURL, AncestorList> pending_tree_ancestor_list_; + HashSet<ScriptModule> instantiated_records_; + HashSet<ScriptModule> errored_records_; bool instantiate_should_fail_ = false; }; @@ -271,11 +281,10 @@ EXPECT_FALSE(client->GetModuleScript()); GetModulator()->ResolveSingleModuleScriptFetch( - url, {}, ModuleInstantiationState::kUninstantiated); + url, {}, ScriptModuleState::kUninstantiated); EXPECT_TRUE(client->WasNotifyFinished()); ASSERT_TRUE(client->GetModuleScript()); - EXPECT_EQ(client->GetModuleScript()->State(), - ModuleInstantiationState::kInstantiated); + EXPECT_TRUE(client->GetModuleScript()->HasInstantiated()); } TEST_F(ModuleTreeLinkerTest, FetchTreeInstantiationFailure) { @@ -296,14 +305,16 @@ EXPECT_FALSE(client->GetModuleScript()); GetModulator()->ResolveSingleModuleScriptFetch( - url, {}, ModuleInstantiationState::kUninstantiated); + url, {}, ScriptModuleState::kUninstantiated); // Modulator::InstantiateModule() fails here, as // we SetInstantiateShouldFail(true) earlier. EXPECT_TRUE(client->WasNotifyFinished()); ASSERT_TRUE(client->GetModuleScript()); - EXPECT_TRUE(client->GetModuleScript()->IsErrored()); + EXPECT_TRUE(client->GetModuleScript()->IsErrored()) + << "Expected errored module script but got " + << *client->GetModuleScript(); } TEST_F(ModuleTreeLinkerTest, FetchTreePreviousInstantiationFailure) { @@ -323,8 +334,8 @@ // This emulates "previous instantiation failure", where // Modulator::FetchSingle resolves w/ "errored" module script. - GetModulator()->ResolveSingleModuleScriptFetch( - url, {}, ModuleInstantiationState::kErrored); + GetModulator()->ResolveSingleModuleScriptFetch(url, {}, + ScriptModuleState::kErrored); EXPECT_TRUE(client->WasNotifyFinished()); ASSERT_TRUE(client->GetModuleScript()); EXPECT_TRUE(client->GetModuleScript()->IsErrored()); @@ -346,7 +357,7 @@ EXPECT_FALSE(client->GetModuleScript()); GetModulator()->ResolveSingleModuleScriptFetch( - url, {"./dep1.js"}, ModuleInstantiationState::kUninstantiated); + url, {"./dep1.js"}, ScriptModuleState::kUninstantiated); EXPECT_FALSE(client->WasNotifyFinished()); KURL url_dep1(kParsedURLString, "http://example.com/dep1.js"); @@ -360,8 +371,7 @@ EXPECT_TRUE(client->WasNotifyFinished()); ASSERT_TRUE(client->GetModuleScript()); - EXPECT_EQ(client->GetModuleScript()->State(), - ModuleInstantiationState::kInstantiated); + EXPECT_TRUE(client->GetModuleScript()->HasInstantiated()); } TEST_F(ModuleTreeLinkerTest, FetchTreeWith3Deps) { @@ -381,7 +391,7 @@ GetModulator()->ResolveSingleModuleScriptFetch( url, {"./dep1.js", "./dep2.js", "./dep3.js"}, - ModuleInstantiationState::kUninstantiated); + ScriptModuleState::kUninstantiated); EXPECT_FALSE(client->WasNotifyFinished()); Vector<KURL> url_deps; @@ -411,8 +421,7 @@ EXPECT_TRUE(client->WasNotifyFinished()); ASSERT_TRUE(client->GetModuleScript()); - EXPECT_EQ(client->GetModuleScript()->State(), - ModuleInstantiationState::kInstantiated); + EXPECT_TRUE(client->GetModuleScript()->HasInstantiated()); } TEST_F(ModuleTreeLinkerTest, FetchTreeWith3Deps1Fail) { @@ -432,7 +441,7 @@ GetModulator()->ResolveSingleModuleScriptFetch( url, {"./dep1.js", "./dep2.js", "./dep3.js"}, - ModuleInstantiationState::kUninstantiated); + ScriptModuleState::kUninstantiated); EXPECT_FALSE(client->WasNotifyFinished()); Vector<KURL> url_deps; @@ -464,8 +473,8 @@ GetModulator()->ResolveDependentTreeFetch( url_dep, ModuleTreeLinkerTestModulator::ResolveResult::kFailure); - EXPECT_TRUE(client->WasNotifyFinished()); - EXPECT_FALSE(client->GetModuleScript()); + // TODO(kouhei): This may not hold once we implement early failure reporting. + EXPECT_FALSE(client->WasNotifyFinished()); // Check below doesn't crash. url_dep = url_deps.back(); @@ -473,6 +482,9 @@ GetModulator()->ResolveDependentTreeFetch( url_dep, ModuleTreeLinkerTestModulator::ResolveResult::kSuccess); EXPECT_TRUE(url_deps.IsEmpty()); + + EXPECT_TRUE(client->WasNotifyFinished()); + EXPECT_FALSE(client->GetModuleScript()); } TEST_F(ModuleTreeLinkerTest, FetchDependencyTree) { @@ -492,7 +504,7 @@ EXPECT_FALSE(client->GetModuleScript()); GetModulator()->ResolveSingleModuleScriptFetch( - url, {"./depth2.js"}, ModuleInstantiationState::kUninstantiated); + url, {"./depth2.js"}, ScriptModuleState::kUninstantiated); KURL url_dep2(kParsedURLString, "http://example.com/depth2.js"); auto ancestor_list = GetModulator()->GetAncestorListForTreeFetch(url_dep2); @@ -507,8 +519,7 @@ EXPECT_TRUE(client->WasNotifyFinished()); ASSERT_TRUE(client->GetModuleScript()); - EXPECT_EQ(client->GetModuleScript()->State(), - ModuleInstantiationState::kInstantiated); + EXPECT_FALSE(client->GetModuleScript()->HasInstantiated()); } TEST_F(ModuleTreeLinkerTest, FetchDependencyOfCyclicGraph) { @@ -528,15 +539,14 @@ EXPECT_FALSE(client->GetModuleScript()); GetModulator()->ResolveSingleModuleScriptFetch( - url, {"./a.js"}, ModuleInstantiationState::kUninstantiated); + url, {"./a.js"}, ScriptModuleState::kUninstantiated); auto ancestor_list = GetModulator()->GetAncestorListForTreeFetch(url); EXPECT_EQ(0u, ancestor_list.size()); EXPECT_TRUE(client->WasNotifyFinished()); ASSERT_TRUE(client->GetModuleScript()); - EXPECT_EQ(client->GetModuleScript()->State(), - ModuleInstantiationState::kInstantiated); + EXPECT_FALSE(client->GetModuleScript()->HasInstantiated()); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResourceTest.cpp b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResourceTest.cpp index b3115e0..e24f93d 100644 --- a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResourceTest.cpp +++ b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResourceTest.cpp
@@ -49,7 +49,7 @@ original_memory_cache_ = ReplaceMemoryCacheForTesting(MemoryCache::Create()); page_ = DummyPageHolder::Create(); - GetDocument().SetURL(KURL(KURL(), "https://localhost/")); + GetDocument().SetURL(KURL(NullURL(), "https://localhost/")); } ~CSSStyleSheetResourceTest() override { @@ -64,8 +64,8 @@ TEST_F(CSSStyleSheetResourceTest, DuplicateResourceNotCached) { const char kUrl[] = "https://localhost/style.css"; - KURL image_url(KURL(), kUrl); - KURL css_url(KURL(), kUrl); + KURL image_url(NullURL(), kUrl); + KURL css_url(NullURL(), kUrl); // Emulate using <img> to do async stylesheet preloads.
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp b/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp index b59dcbb4..1d00e49 100644 --- a/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp +++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
@@ -158,7 +158,7 @@ constexpr char kTestURL[] = "http://www.test.com/cancelTest.html"; String GetTestFilePath() { - return testing::WebTestDataPath("cancelTest.html"); + return testing::CoreTestDataPath("cancelTest.html"); } constexpr char kSvgImageWithSubresource[] = @@ -361,7 +361,7 @@ // Send the multipart response. No image or data buffer is created. Note that // the response must be routed through ResourceLoader to ensure the load is // flagged as multipart. - ResourceResponse multipart_response(KURL(), "multipart/x-mixed-replace", 0, + ResourceResponse multipart_response(NullURL(), "multipart/x-mixed-replace", 0, g_null_atom); multipart_response.SetMultipartBoundary("boundary", strlen("boundary")); image_resource->Loader()->DidReceiveResponse( @@ -439,7 +439,7 @@ image_resource->SetIdentifier(CreateUniqueIdentifier()); fetcher->StartLoad(image_resource); - ResourceResponse multipart_response(KURL(), "multipart/x-mixed-replace", 0, + ResourceResponse multipart_response(NullURL(), "multipart/x-mixed-replace", 0, g_null_atom); multipart_response.SetMultipartBoundary("boundary", strlen("boundary")); image_resource->Loader()->DidReceiveResponse( @@ -493,7 +493,7 @@ } TEST(ImageResourceTest, DecodedDataRemainsWhileHasClients) { - ImageResource* image_resource = ImageResource::CreateForTest(KURL()); + ImageResource* image_resource = ImageResource::CreateForTest(NullURL()); image_resource->SetStatus(ResourceStatus::kPending); image_resource->NotifyStartLoad(); @@ -502,11 +502,12 @@ // Send the image response. image_resource->ResponseReceived( - ResourceResponse(KURL(), "multipart/x-mixed-replace", 0, g_null_atom), + ResourceResponse(NullURL(), "multipart/x-mixed-replace", 0, g_null_atom), nullptr); image_resource->ResponseReceived( - ResourceResponse(KURL(), "image/jpeg", sizeof(kJpegImage), g_null_atom), + ResourceResponse(NullURL(), "image/jpeg", sizeof(kJpegImage), + g_null_atom), nullptr); image_resource->AppendData(reinterpret_cast<const char*>(kJpegImage), sizeof(kJpegImage)); @@ -536,7 +537,7 @@ } TEST(ImageResourceTest, UpdateBitmapImages) { - ImageResource* image_resource = ImageResource::CreateForTest(KURL()); + ImageResource* image_resource = ImageResource::CreateForTest(NullURL()); image_resource->SetStatus(ResourceStatus::kPending); image_resource->NotifyStartLoad(); @@ -545,7 +546,8 @@ // Send the image response. image_resource->ResponseReceived( - ResourceResponse(KURL(), "image/jpeg", sizeof(kJpegImage), g_null_atom), + ResourceResponse(NullURL(), "image/jpeg", sizeof(kJpegImage), + g_null_atom), nullptr); image_resource->AppendData(reinterpret_cast<const char*>(kJpegImage), sizeof(kJpegImage)); @@ -570,8 +572,8 @@ ResourceFetcher* fetcher = CreateFetcher(); // Send the image response. - ResourceResponse resource_response(KURL(), "image/jpeg", sizeof(kJpegImage), - g_null_atom); + ResourceResponse resource_response(NullURL(), "image/jpeg", + sizeof(kJpegImage), g_null_atom); resource_response.AddHTTPHeaderField("chrome-proxy-content-transform", "empty-image"); @@ -614,8 +616,8 @@ ResourceFetcher* fetcher = CreateFetcher(); // Send the image response. - ResourceResponse resource_response(KURL(), "image/jpeg", sizeof(kJpegImage), - g_null_atom); + ResourceResponse resource_response(NullURL(), "image/jpeg", + sizeof(kJpegImage), g_null_atom); resource_response.AddHTTPHeaderField("chrome-proxy", "q=low"); image_resource->ResponseReceived(resource_response, nullptr); @@ -662,7 +664,8 @@ // Send the image response, without any LoFi image response headers. image_resource->ResponseReceived( - ResourceResponse(KURL(), "image/jpeg", sizeof(kJpegImage), g_null_atom), + ResourceResponse(NullURL(), "image/jpeg", sizeof(kJpegImage), + g_null_atom), nullptr); image_resource->AppendData(reinterpret_cast<const char*>(kJpegImage), sizeof(kJpegImage)); @@ -706,8 +709,8 @@ MockImageResourceObserver::Create(content); // Send the image response. - ResourceResponse resource_response(KURL(), "image/jpeg", sizeof(kJpegImage), - g_null_atom); + ResourceResponse resource_response(NullURL(), "image/jpeg", + sizeof(kJpegImage), g_null_atom); resource_response.AddHTTPHeaderField("chrome-proxy-content-transform", "empty-image"); @@ -1691,8 +1694,8 @@ MockImageResourceObserver::Create(image_resource->GetContent()); // Send the image response. - ResourceResponse resource_response(KURL(), "image/jpeg", sizeof(kJpegImage2), - g_null_atom); + ResourceResponse resource_response(NullURL(), "image/jpeg", + sizeof(kJpegImage2), g_null_atom); resource_response.AddHTTPHeaderField("chrome-proxy", "q=low"); image_resource->ResponseReceived(resource_response, nullptr);
diff --git a/third_party/WebKit/Source/core/loader/resource/ScriptResource.h b/third_party/WebKit/Source/core/loader/resource/ScriptResource.h index 9f6c1cd5..3fa422f 100644 --- a/third_party/WebKit/Source/core/loader/resource/ScriptResource.h +++ b/third_party/WebKit/Source/core/loader/resource/ScriptResource.h
@@ -36,8 +36,6 @@ namespace blink { -enum class ScriptIntegrityDisposition { kNotChecked = 0, kFailed, kPassed }; - class FetchParameters; class KURL; class ResourceFetcher;
diff --git a/third_party/WebKit/Source/core/page/ChromeClientTest.cpp b/third_party/WebKit/Source/core/page/ChromeClientTest.cpp index 8d00f9b..f2cbf4d 100644 --- a/third_party/WebKit/Source/core/page/ChromeClientTest.cpp +++ b/third_party/WebKit/Source/core/page/ChromeClientTest.cpp
@@ -32,7 +32,7 @@ } // anonymous namespace -class ChromeClientTest : public testing::Test {}; +class ChromeClientTest : public ::testing::Test {}; TEST_F(ChromeClientTest, SetToolTipFlood) { ChromeClientToolTipLogger logger;
diff --git a/third_party/WebKit/Source/core/page/EffectiveNavigationPolicyTest.cpp b/third_party/WebKit/Source/core/page/EffectiveNavigationPolicyTest.cpp index 7752ccb..357fde7a 100644 --- a/third_party/WebKit/Source/core/page/EffectiveNavigationPolicyTest.cpp +++ b/third_party/WebKit/Source/core/page/EffectiveNavigationPolicyTest.cpp
@@ -35,7 +35,7 @@ namespace blink { -class EffectiveNavigationPolicyTest : public testing::Test { +class EffectiveNavigationPolicyTest : public ::testing::Test { protected: NavigationPolicy GetNavigationPolicyWithMouseEvent( int modifiers,
diff --git a/third_party/WebKit/Source/core/page/FocusController.cpp b/third_party/WebKit/Source/core/page/FocusController.cpp index 9a427c50..82e8ad3 100644 --- a/third_party/WebKit/Source/core/page/FocusController.cpp +++ b/third_party/WebKit/Source/core/page/FocusController.cpp
@@ -47,6 +47,7 @@ #include "core/frame/RemoteFrame.h" #include "core/frame/Settings.h" #include "core/html/HTMLAreaElement.h" +#include "core/html/HTMLFormElement.h" #include "core/html/HTMLImageElement.h" #include "core/html/HTMLPlugInElement.h" #include "core/html/HTMLShadowElement.h" @@ -54,6 +55,7 @@ #include "core/html/TextControlElement.h" #include "core/input/EventHandler.h" #include "core/layout/HitTestResult.h" +#include "core/layout/LayoutObject.h" #include "core/page/ChromeClient.h" #include "core/page/FocusChangedObserver.h" #include "core/page/FrameTree.h" @@ -1066,6 +1068,51 @@ return FindFocusableElementAcrossFocusScopes(type, scope); } +Element* FocusController::NextFocusableElementInForm(Element* element, + WebFocusType focus_type) { + element->GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets(); + if (!element->IsHTMLElement()) + return nullptr; + + if (!element->IsFormControlElement() && + !ToHTMLElement(element)->isContentEditableForBinding()) + return nullptr; + + HTMLFormElement* form_owner = nullptr; + if (ToHTMLElement(element)->isContentEditableForBinding()) + form_owner = Traversal<HTMLFormElement>::FirstAncestor(*element); + else + form_owner = ToHTMLFormControlElement(element)->formOwner(); + + if (!form_owner) + return nullptr; + + Element* next_element = element; + for (next_element = FindFocusableElement(focus_type, *next_element); + next_element; + next_element = FindFocusableElement(focus_type, *next_element)) { + if (!next_element->IsHTMLElement()) + continue; + if (ToHTMLElement(next_element)->isContentEditableForBinding() && + next_element->IsDescendantOf(form_owner)) + return next_element; + if (!next_element->IsFormControlElement()) + continue; + HTMLFormControlElement* form_element = + ToHTMLFormControlElement(next_element); + if (form_element->formOwner() != form_owner || + form_element->IsDisabledOrReadOnly()) + continue; + LayoutObject* layout = next_element->GetLayoutObject(); + if (layout && layout->IsTextControl()) { + // TODO(ajith.v) Extend it for select elements, radio buttons and check + // boxes + return next_element; + } + } + return nullptr; +} + Element* FocusController::FindFocusableElementInShadowHost( const Element& shadow_host) { DCHECK(shadow_host.AuthorShadowRoot());
diff --git a/third_party/WebKit/Source/core/page/FocusController.h b/third_party/WebKit/Source/core/page/FocusController.h index dafb9ea..141b393 100644 --- a/third_party/WebKit/Source/core/page/FocusController.h +++ b/third_party/WebKit/Source/core/page/FocusController.h
@@ -82,6 +82,7 @@ LocalFrame* to, InputDeviceCapabilities* source_capabilities = nullptr); Element* FindFocusableElementInShadowHost(const Element& shadow_host); + Element* NextFocusableElementInForm(Element*, WebFocusType); bool SetFocusedElement(Element*, Frame*, const FocusParams&); // |setFocusedElement| variant with SelectionBehaviorOnFocus::None,
diff --git a/third_party/WebKit/Source/core/page/FocusControllerTest.cpp b/third_party/WebKit/Source/core/page/FocusControllerTest.cpp index 1f648b9..2737dbb 100644 --- a/third_party/WebKit/Source/core/page/FocusControllerTest.cpp +++ b/third_party/WebKit/Source/core/page/FocusControllerTest.cpp
@@ -13,7 +13,7 @@ namespace blink { -class FocusControllerTest : public testing::Test { +class FocusControllerTest : public ::testing::Test { public: Document& GetDocument() const { return page_holder_->GetDocument(); } FocusController& GetFocusController() const { @@ -94,4 +94,30 @@ PageHolder()->GetPage().GetFocusController().SetActive(true); } +// This test is for crbug.com/733218 +TEST_F(FocusControllerTest, SVGFocusableElementInForm) { + GetDocument().body()->setInnerHTML( + "<form>" + "<input id='first'>" + "<svg width='100px' height='100px' tabindex='0'>" + "<circle cx='50' cy='50' r='30' />" + "</svg>" + "<input id='last'>" + "</form>"); + + Element* form = ToElement(GetDocument().body()->firstChild()); + Element* first = ToElement(form->firstChild()); + Element* last = ToElement(form->lastChild()); + + Element* next = GetFocusController().NextFocusableElementInForm( + first, kWebFocusTypeForward); + EXPECT_EQ(next, last) + << "SVG Element should be skipped even when focusable in form."; + + Element* prev = GetFocusController().NextFocusableElementInForm( + next, kWebFocusTypeBackward); + EXPECT_EQ(prev, first) + << "SVG Element should be skipped even when focusable in form."; +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/page/PageOverlayTest.cpp b/third_party/WebKit/Source/core/page/PageOverlayTest.cpp index 0e96a55..84fdf70 100644 --- a/third_party/WebKit/Source/core/page/PageOverlayTest.cpp +++ b/third_party/WebKit/Source/core/page/PageOverlayTest.cpp
@@ -24,9 +24,9 @@ #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkPaint.h" -using testing::_; -using testing::AtLeast; -using testing::Property; +using ::testing::_; +using ::testing::AtLeast; +using ::testing::Property; namespace blink { namespace {
diff --git a/third_party/WebKit/Source/core/page/ViewportTest.cpp b/third_party/WebKit/Source/core/page/ViewportTest.cpp index 7a8550e..2ad0797 100644 --- a/third_party/WebKit/Source/core/page/ViewportTest.cpp +++ b/third_party/WebKit/Source/core/page/ViewportTest.cpp
@@ -69,13 +69,13 @@ void RegisterMockedHttpURLLoad(const std::string& file_name) { URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url_), testing::WebTestDataPath(), + WebString::FromUTF8(base_url_), testing::CoreTestDataPath(), WebString::FromUTF8(file_name)); } void RegisterMockedChromeURLLoad(const std::string& file_name) { URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(chrome_url_), testing::WebTestDataPath(), + WebString::FromUTF8(chrome_url_), testing::CoreTestDataPath(), WebString::FromUTF8(file_name)); }
diff --git a/third_party/WebKit/Source/core/page/scrolling/RootScrollerTest.cpp b/third_party/WebKit/Source/core/page/scrolling/RootScrollerTest.cpp index 9f8437e9..09a88a1b 100644 --- a/third_party/WebKit/Source/core/page/scrolling/RootScrollerTest.cpp +++ b/third_party/WebKit/Source/core/page/scrolling/RootScrollerTest.cpp
@@ -36,7 +36,7 @@ #include "testing/gtest/include/gtest/gtest.h" using blink::testing::RunPendingTasks; -using testing::Mock; +using ::testing::Mock; namespace blink { @@ -89,7 +89,7 @@ void RegisterMockedHttpURLLoad(const std::string& file_name) { URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url_), testing::WebTestDataPath(), + WebString::FromUTF8(base_url_), testing::CoreTestDataPath(), WebString::FromUTF8(file_name)); }
diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollStateTest.cpp b/third_party/WebKit/Source/core/page/scrolling/ScrollStateTest.cpp index 545836cc..d00a66d 100644 --- a/third_party/WebKit/Source/core/page/scrolling/ScrollStateTest.cpp +++ b/third_party/WebKit/Source/core/page/scrolling/ScrollStateTest.cpp
@@ -27,7 +27,7 @@ return ScrollState::Create(std::move(scroll_state_data)); } -class ScrollStateTest : public testing::Test {}; +class ScrollStateTest : public ::testing::Test {}; TEST_F(ScrollStateTest, ConsumeDeltaNative) { const float kDeltaX = 12.3;
diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinatorTest.cpp b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinatorTest.cpp index bf95ec4..29a30c5 100644 --- a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinatorTest.cpp +++ b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinatorTest.cpp
@@ -100,7 +100,7 @@ void RegisterMockedHttpURLLoad(const std::string& file_name) { URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url_), testing::WebTestDataPath(), + WebString::FromUTF8(base_url_), testing::CoreTestDataPath(), WebString::FromUTF8(file_name)); }
diff --git a/third_party/WebKit/Source/core/page/scrolling/SnapCoordinatorTest.cpp b/third_party/WebKit/Source/core/page/scrolling/SnapCoordinatorTest.cpp index 4f7c9ef..6f9120b 100644 --- a/third_party/WebKit/Source/core/page/scrolling/SnapCoordinatorTest.cpp +++ b/third_party/WebKit/Source/core/page/scrolling/SnapCoordinatorTest.cpp
@@ -22,7 +22,7 @@ typedef bool TestParamRootLayerScrolling; class SnapCoordinatorTest - : public testing::TestWithParam<TestParamRootLayerScrolling>, + : public ::testing::TestWithParam<TestParamRootLayerScrolling>, private ScopedRootLayerScrollingForTest { protected: SnapCoordinatorTest() : ScopedRootLayerScrollingForTest(GetParam()) {}
diff --git a/third_party/WebKit/Source/core/paint/BoxPainterBase.cpp b/third_party/WebKit/Source/core/paint/BoxPainterBase.cpp index 2f29252..996ea46 100644 --- a/third_party/WebKit/Source/core/paint/BoxPainterBase.cpp +++ b/third_party/WebKit/Source/core/paint/BoxPainterBase.cpp
@@ -351,7 +351,7 @@ FloatRoundedRect BoxPainterBase::RoundedBorderRectForClip( const ComputedStyle& style, - const BoxPainterBase::FillLayerInfo info, + const BoxPainterBase::FillLayerInfo& info, const FillLayer& bg_layer, const LayoutRect& rect, BackgroundBleedAvoidance bleed_avoidance,
diff --git a/third_party/WebKit/Source/core/paint/BoxPainterBase.h b/third_party/WebKit/Source/core/paint/BoxPainterBase.h index 49990d54..6e54429 100644 --- a/third_party/WebKit/Source/core/paint/BoxPainterBase.h +++ b/third_party/WebKit/Source/core/paint/BoxPainterBase.h
@@ -86,7 +86,9 @@ struct FillLayerInfo { STACK_ALLOCATED(); + WTF_MAKE_NONCOPYABLE(FillLayerInfo); + public: FillLayerInfo(const Document&, const ComputedStyle&, bool has_overflow_clip, @@ -129,7 +131,7 @@ bool include_logical_right_edge); static FloatRoundedRect RoundedBorderRectForClip( const ComputedStyle&, - const FillLayerInfo, + const FillLayerInfo&, const FillLayer&, const LayoutRect&, BackgroundBleedAvoidance,
diff --git a/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp b/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp index 4b598e9..72bb641 100644 --- a/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp +++ b/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp
@@ -12,7 +12,7 @@ namespace blink { -class FirstMeaningfulPaintDetectorTest : public testing::Test { +class FirstMeaningfulPaintDetectorTest : public ::testing::Test { protected: void SetUp() override { platform_->AdvanceClockSeconds(1);
diff --git a/third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp b/third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp index f3e8ec5..89460972 100644 --- a/third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp +++ b/third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp
@@ -26,7 +26,7 @@ namespace blink { class HTMLCanvasPainterTestForSPv2 : public ::testing::Test, - public testing::WithParamInterface<bool>, + public ::testing::WithParamInterface<bool>, private ScopedSlimmingPaintV2ForTest, private ScopedRootLayerScrollingForTest { public:
diff --git a/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp b/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp index 91c57c6..7fe7f7a 100644 --- a/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp +++ b/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
@@ -322,8 +322,12 @@ inline_text_box_.LogicalHeight())); int length = inline_text_box_.Len(); - StringView string = StringView(inline_text_box_.GetLineLayoutItem().GetText(), - inline_text_box_.Start(), length); + const String& layout_item_string = + inline_text_box_.GetLineLayoutItem().GetText(); + // TODO(szager): Figure out why this CHECK sometimes fails, it shouldn't. + CHECK(inline_text_box_.Start() + length <= layout_item_string.length()); + StringView string = + StringView(layout_item_string, inline_text_box_.Start(), length); int maximum_length = inline_text_box_.GetLineLayoutItem().TextLength() - inline_text_box_.Start();
diff --git a/third_party/WebKit/Source/core/paint/LinkHighlightImplTest.cpp b/third_party/WebKit/Source/core/paint/LinkHighlightImplTest.cpp index 4bba5d5..7bcdd4c3 100644 --- a/third_party/WebKit/Source/core/paint/LinkHighlightImplTest.cpp +++ b/third_party/WebKit/Source/core/paint/LinkHighlightImplTest.cpp
@@ -68,7 +68,7 @@ std::string RegisterMockedURLLoad() { WebURL url = URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8("http://www.test.com/"), testing::WebTestDataPath(), + WebString::FromUTF8("http://www.test.com/"), testing::CoreTestDataPath(), WebString::FromUTF8("test_touch_link_highlight.html")); return url.GetString().Utf8(); }
diff --git a/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.h b/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.h index 0654872..f7dde2a 100644 --- a/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.h +++ b/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.h
@@ -96,7 +96,7 @@ class PaintControllerPaintTestForSlimmingPaintV2 : public PaintControllerPaintTestBase, - public testing::WithParamInterface<bool>, + public ::testing::WithParamInterface<bool>, private ScopedRootLayerScrollingForTest { public: PaintControllerPaintTestForSlimmingPaintV2() @@ -106,7 +106,7 @@ class PaintControllerPaintTestForSlimmingPaintV1AndV2 : public PaintControllerPaintTestBase, - public testing::WithParamInterface<bool> { + public ::testing::WithParamInterface<bool> { public: PaintControllerPaintTestForSlimmingPaintV1AndV2() : PaintControllerPaintTestBase(GetParam()) {} @@ -124,28 +124,24 @@ } }; -#ifndef NDEBUG -#define TRACE_DISPLAY_ITEMS(i, expected, actual) \ - String trace = String::Format("%d: ", (int)i) + \ - "Expected: " + (expected).AsDebugString() + \ - " Actual: " + (actual).AsDebugString(); \ - SCOPED_TRACE(trace.Utf8().data()); -#else -#define TRACE_DISPLAY_ITEMS(i, expected, actual) -#endif - -#define EXPECT_DISPLAY_LIST(actual, expectedSize, ...) \ - do { \ - EXPECT_EQ((size_t)expectedSize, actual.size()); \ - if (expectedSize != actual.size()) \ - break; \ - const TestDisplayItem expected[] = {__VA_ARGS__}; \ - for (size_t index = 0; \ - index < std::min<size_t>(actual.size(), expectedSize); index++) { \ - TRACE_DISPLAY_ITEMS(index, expected[index], actual[index]); \ - EXPECT_EQ(expected[index].Client(), actual[index].Client()); \ - EXPECT_EQ(expected[index].GetType(), actual[index].GetType()); \ - } \ +#define EXPECT_DISPLAY_LIST(actual, expected_size, ...) \ + do { \ + EXPECT_EQ((size_t)expected_size, actual.size()); \ + if (expected_size != actual.size()) \ + break; \ + const TestDisplayItem expected[] = {__VA_ARGS__}; \ + for (size_t i = 0; i < expected_size; ++i) { \ + SCOPED_TRACE( \ + String::Format("%d: Expected:(client=%p:\"%s\" type=%d) " \ + "Actual:(client=%p:%s type=%d)", \ + (int)i, &expected[i].Client(), \ + expected[i].Client().DebugName().Ascii().data(), \ + (int)expected[i].GetType(), &actual[i].Client(), \ + actual[i].Client().DebugName().Ascii().data(), \ + (int)actual[i].GetType())); \ + EXPECT_EQ(&expected[i].Client(), &actual[i].Client()); \ + EXPECT_EQ(expected[i].GetType(), actual[i].GetType()); \ + } \ } while (false); // Shorter names for frequently used display item types in tests.
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp index 287fb345..6d10c585 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -524,11 +524,8 @@ properties.property_tree_state = *local_border_box_properties; properties.backface_hidden = paint_layer_.GetLayoutObject().HasHiddenBackface(); - content_scoped_paint_chunk_properties.emplace( - context.GetPaintController(), paint_layer_, properties, - // Force a new paint chunk, since it is required for subsequence - // caching. - should_create_subsequence ? kForceNewChunk : kDontForceNewChunk); + content_scoped_paint_chunk_properties.emplace(context.GetPaintController(), + paint_layer_, properties); } bool selection_only =
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp index 90fe6f1..2de0131 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
@@ -22,7 +22,7 @@ }; class PaintLayerPainterTest - : public testing::WithParamInterface<PaintLayerPainterTestParam>, + : public ::testing::WithParamInterface<PaintLayerPainterTestParam>, private ScopedRootLayerScrollingForTest, public PaintControllerPaintTestBase { USING_FAST_MALLOC(PaintLayerPainterTest); @@ -65,43 +65,41 @@ } }; -INSTANTIATE_TEST_CASE_P( - All, - PaintLayerPainterTest, - ::testing::Values(PaintLayerPainterTestParam( - false, - false), // non-root-layer-scrolls, slimming-paint-v1 - PaintLayerPainterTestParam( - false, - true), // non-root-layer-scrolls, slimming-paint-v2 - PaintLayerPainterTestParam( - true, - false), // root-layer-scrolls, slimming-paint-v1 - PaintLayerPainterTestParam( - true, - true))); // root-layer-scrolls, slimming-paint-v2 +INSTANTIATE_TEST_CASE_P(All, + PaintLayerPainterTest, + ::testing::Values( + // non-root-layer-scrolls, slimming-paint-v1 + PaintLayerPainterTestParam(false, false), + // non-root-layer-scrolls, slimming-paint-v2 + PaintLayerPainterTestParam(false, true), + // root-layer-scrolls, slimming-paint-v1 + PaintLayerPainterTestParam(true, false), + // root-layer-scrolls, slimming-paint-v2 + PaintLayerPainterTestParam(true, true))); TEST_P(PaintLayerPainterTest, CachedSubsequence) { SetBodyInnerHTML( - "<div id='container1' style='position: relative; z-index: 1; width: " - "200px; height: 200px; background-color: blue'>" - " <div id='content1' style='position: absolute; width: 100px; height: " - "100px; background-color: red'></div>" + "<div id='container1' style='position: relative; z-index: 1;" + " width: 200px; height: 200px; background-color: blue'>" + " <div id='content1' style='position: absolute; width: 100px;" + " height: 100px; background-color: red'></div>" "</div>" - "<div id='container2' style='position: relative; z-index: 1; width: " - "200px; height: 200px; background-color: blue'>" - " <div id='content2' style='position: absolute; width: 100px; height: " - "100px; background-color: green'></div>" - "</div>"); + "<div id='filler1' style='position: relative; z-index: 2;" + " width: 20px; height: 20px; background-color: gray'></div>" + "<div id='container2' style='position: relative; z-index: 3;" + " width: 200px; height: 200px; background-color: blue'>" + " <div id='content2' style='position: absolute; width: 100px;" + " height: 100px; background-color: green;'></div>" + "</div>" + "<div id='filler2' style='position: relative; z-index: 4;" + " width: 20px; height: 20px; background-color: gray'></div>"); - LayoutObject& container1 = - *GetDocument().getElementById("container1")->GetLayoutObject(); - LayoutObject& content1 = - *GetDocument().getElementById("content1")->GetLayoutObject(); - LayoutObject& container2 = - *GetDocument().getElementById("container2")->GetLayoutObject(); - LayoutObject& content2 = - *GetDocument().getElementById("content2")->GetLayoutObject(); + auto& container1 = *GetLayoutObjectByElementId("container1"); + auto& content1 = *GetLayoutObjectByElementId("content1"); + auto& filler1 = *GetLayoutObjectByElementId("filler1"); + auto& container2 = *GetLayoutObjectByElementId("container2"); + auto& content2 = *GetLayoutObjectByElementId("content2"); + auto& filler2 = *GetLayoutObjectByElementId("filler2"); if (!RuntimeEnabledFeatures::SlimmingPaintV2Enabled() && RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { @@ -111,32 +109,42 @@ MainGraphicsLayerPaintController().GetDisplayItemList(), 1, TestDisplayItem(GetLayoutView(), kDocumentBackgroundType)); - EXPECT_DISPLAY_LIST(RootPaintController().GetDisplayItemList(), 4, + EXPECT_DISPLAY_LIST(RootPaintController().GetDisplayItemList(), 6, TestDisplayItem(container1, kBackgroundType), TestDisplayItem(content1, kBackgroundType), + TestDisplayItem(filler1, kBackgroundType), TestDisplayItem(container2, kBackgroundType), - TestDisplayItem(content2, kBackgroundType)); + TestDisplayItem(content2, kBackgroundType), + TestDisplayItem(filler2, kBackgroundType)); } else { EXPECT_DISPLAY_LIST( - RootPaintController().GetDisplayItemList(), 5, + RootPaintController().GetDisplayItemList(), 7, TestDisplayItem(GetLayoutView(), kDocumentBackgroundType), TestDisplayItem(container1, kBackgroundType), TestDisplayItem(content1, kBackgroundType), + TestDisplayItem(filler1, kBackgroundType), TestDisplayItem(container2, kBackgroundType), - TestDisplayItem(content2, kBackgroundType)); + TestDisplayItem(content2, kBackgroundType), + TestDisplayItem(filler2, kBackgroundType)); } + auto* root_layer = GetLayoutView().Layer(); + auto* container1_layer = ToLayoutBoxModelObject(container1).Layer(); + auto* filler1_layer = ToLayoutBoxModelObject(filler1).Layer(); + auto* container2_layer = ToLayoutBoxModelObject(container2).Layer(); + auto* filler2_layer = ToLayoutBoxModelObject(filler2).Layer(); + if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { - // check that new paint chunks were forced for |container1| and + // Check that new paint chunks were forced for |container1| and // |container2|. Vector<PaintChunk> paint_chunks = RootPaintController().GetPaintArtifact().PaintChunks(); - EXPECT_EQ(3u, paint_chunks.size()); - EXPECT_EQ(GetLayoutView().Layer(), &paint_chunks[0].id.client); - EXPECT_EQ(ToLayoutBoxModelObject(container1).Layer(), - &paint_chunks[1].id.client); - EXPECT_EQ(ToLayoutBoxModelObject(container2).Layer(), - &paint_chunks[2].id.client); + EXPECT_EQ(5u, paint_chunks.size()); + EXPECT_EQ(root_layer, &paint_chunks[0].id.client); + EXPECT_EQ(container1_layer, &paint_chunks[1].id.client); + EXPECT_EQ(filler1_layer, &paint_chunks[2].id.client); + EXPECT_EQ(container2_layer, &paint_chunks[3].id.client); + EXPECT_EQ(filler2_layer, &paint_chunks[4].id.client); } ToHTMLElement(content1.GetNode()) @@ -150,9 +158,9 @@ // so it doesn't contribute to NumCachedNewItems since it isn't invalidated. if (!RuntimeEnabledFeatures::SlimmingPaintV2Enabled() && RuntimeEnabledFeatures::RootLayerScrollingEnabled()) - EXPECT_EQ(3, NumCachedNewItems()); + EXPECT_EQ(5, NumCachedNewItems()); else - EXPECT_EQ(4, NumCachedNewItems()); + EXPECT_EQ(6, NumCachedNewItems()); Commit(); @@ -162,19 +170,35 @@ MainGraphicsLayerPaintController().GetDisplayItemList(), 1, TestDisplayItem(GetLayoutView(), kDocumentBackgroundType)); - EXPECT_DISPLAY_LIST(RootPaintController().GetDisplayItemList(), 4, + EXPECT_DISPLAY_LIST(RootPaintController().GetDisplayItemList(), 6, TestDisplayItem(container1, kBackgroundType), TestDisplayItem(content1, kBackgroundType), + TestDisplayItem(filler1, kBackgroundType), TestDisplayItem(container2, kBackgroundType), - TestDisplayItem(content2, kBackgroundType)); + TestDisplayItem(content2, kBackgroundType), + TestDisplayItem(filler2, kBackgroundType)); } else { EXPECT_DISPLAY_LIST( - RootPaintController().GetDisplayItemList(), 5, + RootPaintController().GetDisplayItemList(), 7, TestDisplayItem(GetLayoutView(), kDocumentBackgroundType), TestDisplayItem(container1, kBackgroundType), TestDisplayItem(content1, kBackgroundType), + TestDisplayItem(filler1, kBackgroundType), TestDisplayItem(container2, kBackgroundType), - TestDisplayItem(content2, kBackgroundType)); + TestDisplayItem(content2, kBackgroundType), + TestDisplayItem(filler2, kBackgroundType)); + } + + if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { + // We should still have the paint chunks forced by the cached subsequences. + Vector<PaintChunk> paint_chunks = + RootPaintController().GetPaintArtifact().PaintChunks(); + EXPECT_EQ(5u, paint_chunks.size()); + EXPECT_EQ(root_layer, &paint_chunks[0].id.client); + EXPECT_EQ(container1_layer, &paint_chunks[1].id.client); + EXPECT_EQ(filler1_layer, &paint_chunks[2].id.client); + EXPECT_EQ(container2_layer, &paint_chunks[3].id.client); + EXPECT_EQ(filler2_layer, &paint_chunks[4].id.client); } } @@ -185,22 +209,23 @@ return; SetBodyInnerHTML( - "<div id='container1' style='position: relative; z-index: 1; width: " - "200px; height: 200px; background-color: blue'>" - " <div id='content1' style='position: absolute; width: 100px; height: " - "100px; background-color: green'></div>" + "<div id='container1' style='position: relative; z-index: 1;" + " width: 200px; height: 200px; background-color: blue'>" + " <div id='content1' style='position: absolute; width: 100px;" + " height: 100px; background-color: green'></div>" "</div>" - "<div id='container2' style='position: relative; z-index: 1; width: " - "200px; height: 200px; background-color: blue'>" - " <div id='content2a' style='position: absolute; width: 100px; height: " - "100px; background-color: green'></div>" - " <div id='content2b' style='position: absolute; top: 200px; width: " - "100px; height: 100px; background-color: green'></div>" + "<div id='container2' style='position: relative; z-index: 1;" + " width: 200px; height: 200px; background-color: blue'>" + " <div id='content2a' style='position: absolute; width: 100px;" + " height: 100px; background-color: green'></div>" + " <div id='content2b' style='position: absolute; top: 200px;" + " width: 100px; height: 100px; background-color: green'></div>" "</div>" - "<div id='container3' style='position: absolute; z-index: 2; left: " - "300px; top: 0; width: 200px; height: 200px; background-color: blue'>" - " <div id='content3' style='position: absolute; width: 200px; height: " - "200px; background-color: green'></div>" + "<div id='container3' style='position: absolute; z-index: 2;" + " left: 300px; top: 0; width: 200px; height: 200px;" + " background-color: blue'>" + " <div id='content3' style='position: absolute; width: 200px;" + " height: 200px; background-color: green'></div>" "</div>"); RootPaintController().InvalidateAll(); @@ -297,15 +322,15 @@ TEST_P(PaintLayerPainterTest, CachedSubsequenceOnStyleChangeWithInterestRectClipping) { SetBodyInnerHTML( - "<div id='container1' style='position: relative; z-index: 1; width: " - "200px; height: 200px; background-color: blue'>" - " <div id='content1' style='position: absolute; width: 100px; height: " - "100px; background-color: red'></div>" + "<div id='container1' style='position: relative; z-index: 1;" + " width: 200px; height: 200px; background-color: blue'>" + " <div id='content1' style='position: absolute; width: 100px;" + " height: 100px; background-color: red'></div>" "</div>" - "<div id='container2' style='position: relative; z-index: 1; width: " - "200px; height: 200px; background-color: blue'>" - " <div id='content2' style='position: absolute; width: 100px; height: " - "100px; background-color: green'></div>" + "<div id='container2' style='position: relative; z-index: 1;" + " width: 200px; height: 200px; background-color: blue'>" + " <div id='content2' style='position: absolute; width: 100px;" + " height: 100px; background-color: green'></div>" "</div>"); GetDocument().View()->UpdateAllLifecyclePhasesExceptPaint(); // PaintResult of all subsequences will be MayBeClippedByPaintDirtyRect. @@ -454,7 +479,7 @@ " <div id='non-self-painting-layer' style='overflow: hidden'>" " <div>" " <div id='float' style='width: 10px; height: 10px; " - "background-color: blue'></div>" + " background-color: blue'></div>" " </div>" " </div>" "</div>"); @@ -505,7 +530,7 @@ " <div id='non-self-painting-layer' style='overflow: hidden'>" " <span id='span' style='position: relative'>" " <div id='float' style='width: 10px; height: 10px; " - "background-color: blue; float: left'></div>" + " background-color: blue; float: left'></div>" " </span>" " </div>" "</div>"); @@ -615,8 +640,8 @@ SetBodyInnerHTML( "<div id='layer' style='position: relative'>" " <div style='height: 100px'>" - " <div style='height: 20px; outline: 1px solid red; background-color: " - "green'>outline and background</div>" + " <div style='height: 20px; outline: 1px solid red;" + " background-color: green'>outline and background</div>" " <div style='float: left'>float</div>" " </div>" "</div>"); @@ -650,8 +675,8 @@ SetBodyInnerHTML( "<div id='will-be-layer'>" " <div style='height: 100px'>" - " <div style='height: 20px; outline: 1px solid red; background-color: " - "green'>outline and background</div>" + " <div style='height: 20px; outline: 1px solid red;" + " background-color: green'>outline and background</div>" " <div style='float: left'>float</div>" " </div>" "</div>"); @@ -684,8 +709,9 @@ "<div id='will-be-self-painting' style='width: 100px; height: 100px; " "overflow: hidden'>" " <div>" - " <div style='outline: 1px solid red; background-color: " - "green'>outline and background</div>" + " <div style='outline: 1px solid red; background-color: green'>" + " outline and background" + " </div>" " </div>" "</div>"); @@ -717,8 +743,9 @@ "<div id='will-be-non-self-painting' style='width: 100px; height: 100px; " "overflow: hidden; position: relative'>" " <div>" - " <div style='outline: 1px solid red; background-color: " - "green'>outline and background</div>" + " <div style='outline: 1px solid red; background-color: green'>" + " outline and background" + " </div>" " </div>" "</div>"); @@ -760,8 +787,9 @@ // because it will paint collapsed borders in the phase. SetBodyInnerHTML( "<table id='table' style='position: relative; border-collapse: collapse'>" - " <tr><td style='position: relative; border: 1px solid " - "green'>Cell</td></tr>" + " <tr><td style='position: relative; border: 1px solid green'>" + " Cell" + " </td></tr>" "</table>"); LayoutBoxModelObject& table = @@ -781,8 +809,9 @@ SetBodyInnerHTML( "<table id='table' style='position: relative'>" - " <tr><td style='position: relative; border: 1px solid " - "green'>Cell</td></tr>" + " <tr><td style='position: relative; border: 1px solid green'>" + " Cell" + " </td></tr>" "</table>"); LayoutBoxModelObject& table = @@ -808,14 +837,14 @@ TEST_P(PaintLayerPainterTest, DoPaintWithTinyOpacityAndWillChangeOpacity) { SetBodyInnerHTML( "<div id='target' style='background: blue; opacity: 0.0001; " - "will-change: opacity'></div>"); + " will-change: opacity'></div>"); ExpectPaintedOutputInvisible("target", false); } TEST_P(PaintLayerPainterTest, DoPaintWithTinyOpacityAndBackdropFilter) { SetBodyInnerHTML( "<div id='target' style='background: blue; opacity: 0.0001;" - " backdrop-filter: blur(2px);'></div>"); + " backdrop-filter: blur(2px);'></div>"); ExpectPaintedOutputInvisible("target", false); } @@ -823,14 +852,14 @@ DoPaintWithTinyOpacityAndBackdropFilterAndWillChangeOpacity) { SetBodyInnerHTML( "<div id='target' style='background: blue; opacity: 0.0001;" - " backdrop-filter: blur(2px); will-change: opacity'></div>"); + " backdrop-filter: blur(2px); will-change: opacity'></div>"); ExpectPaintedOutputInvisible("target", false); } TEST_P(PaintLayerPainterTest, DoPaintWithCompositedTinyOpacity) { SetBodyInnerHTML( "<div id='target' style='background: blue; opacity: 0.0001;" - " will-change: transform'></div>"); + " will-change: transform'></div>"); ExpectPaintedOutputInvisible("target", false); } @@ -867,8 +896,8 @@ " opacity: 0.0; " "} " "@keyframes example { " - " from { transform: translate(0px, 0px); } " - " to { transform: translate(3em, 0px); } " + " from { transform: translate(0px, 0px); } " + " to { transform: translate(3em, 0px); } " "} " "</style> " "<div id='target'>x</div></div>"); @@ -886,8 +915,8 @@ " will-change: opacity; " "} " "@keyframes example { " - " from { transform: translate(0px, 0px); } " - " to { transform: translate(3em, 0px); } " + " from { transform: translate(0px, 0px); } " + " to { transform: translate(3em, 0px); } " "} " "</style> " "<div id='target'>x</div></div>");
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp index c87ab2c0..3d2a99f 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
@@ -14,7 +14,7 @@ #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "testing/gmock/include/gmock/gmock.h" -using testing::_; +using ::testing::_; namespace blink { namespace { @@ -38,7 +38,7 @@ chrome_client_(new MockChromeClient) {} ~PaintLayerScrollableAreaTest() { - testing::Mock::VerifyAndClearExpectations(&GetChromeClient()); + ::testing::Mock::VerifyAndClearExpectations(&GetChromeClient()); } MockChromeClient& GetChromeClient() const override { return *chrome_client_; }
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.h b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.h index ccd7f34a..aeb697a 100644 --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.h +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.h
@@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef PaintPropertyTreeBuilderTest_h +#define PaintPropertyTreeBuilderTest_h + #include "core/layout/LayoutTestHelper.h" #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" @@ -49,3 +52,5 @@ }; } // namespace blink + +#endif // PaintPropertyTreeBuilderTest_h
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinterTest.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinterTest.cpp index 9b13621..de7b253 100644 --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinterTest.cpp +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinterTest.cpp
@@ -48,16 +48,16 @@ String transform_tree_as_string = transformPropertyTreeAsString(*GetDocument().View()); EXPECT_THAT(transform_tree_as_string.Ascii().data(), - testing::MatchesRegex("root .*" - " .*Translation \\(.*\\) .*")); + ::testing::MatchesRegex("root .*" + " .*Translation \\(.*\\) .*")); } TEST_P(PaintPropertyTreePrinterTest, SimpleClipTree) { SetBodyInnerHTML("hello world"); String clip_tree_as_string = clipPropertyTreeAsString(*GetDocument().View()); EXPECT_THAT(clip_tree_as_string.Ascii().data(), - testing::MatchesRegex("root .*" - " .*Clip \\(.*\\) .*")); + ::testing::MatchesRegex("root .*" + " .*Clip \\(.*\\) .*")); } TEST_P(PaintPropertyTreePrinterTest, SimpleEffectTree) { @@ -65,8 +65,8 @@ String effect_tree_as_string = effectPropertyTreeAsString(*GetDocument().View()); EXPECT_THAT(effect_tree_as_string.Ascii().data(), - testing::MatchesRegex("root .*" - " Effect \\(LayoutBlockFlow DIV\\) .*")); + ::testing::MatchesRegex("root .*" + " Effect \\(LayoutBlockFlow DIV\\) .*")); } TEST_P(PaintPropertyTreePrinterTest, SimpleScrollTree) { @@ -74,8 +74,8 @@ String scroll_tree_as_string = scrollPropertyTreeAsString(*GetDocument().View()); EXPECT_THAT(scroll_tree_as_string.Ascii().data(), - testing::MatchesRegex("root .*" - " Scroll \\(.*\\) .*")); + ::testing::MatchesRegex("root .*" + " Scroll \\(.*\\) .*")); } TEST_P(PaintPropertyTreePrinterTest, SimpleTransformTreePath) { @@ -89,10 +89,10 @@ String transform_path_as_string = transformed_object_properties->Transform()->ToTreeString(); EXPECT_THAT(transform_path_as_string.Ascii().data(), - testing::MatchesRegex("root .* transform.*" - " .* transform.*" - " .* transform.*" - " .* transform.*")); + ::testing::MatchesRegex("root .* transform.*" + " .* transform.*" + " .* transform.*" + " .* transform.*")); } TEST_P(PaintPropertyTreePrinterTest, SimpleClipTreePath) { @@ -105,9 +105,9 @@ String clip_path_as_string = clipped_object_properties->CssClip()->ToTreeString(); EXPECT_THAT(clip_path_as_string.Ascii().data(), - testing::MatchesRegex("root .* rect.*" - " .* rect.*" - " .* rect.*")); + ::testing::MatchesRegex("root .* rect.*" + " .* rect.*" + " .* rect.*")); } TEST_P(PaintPropertyTreePrinterTest, SimpleEffectTreePath) { @@ -118,8 +118,8 @@ String effect_path_as_string = effect_object_properties->Effect()->ToTreeString(); EXPECT_THAT(effect_path_as_string.Ascii().data(), - testing::MatchesRegex("root .* opacity.*" - " .* opacity.*")); + ::testing::MatchesRegex("root .* opacity.*" + " .* opacity.*")); } TEST_P(PaintPropertyTreePrinterTest, SimpleScrollTreePath) { @@ -134,8 +134,8 @@ ->ScrollNode() ->ToTreeString(); EXPECT_THAT(scroll_path_as_string.Ascii().data(), - testing::MatchesRegex("root .* parent.*" - " .* parent.*")); + ::testing::MatchesRegex("root .* parent.*" + " .* parent.*")); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/VideoPainterTest.cpp b/third_party/WebKit/Source/core/paint/VideoPainterTest.cpp index 79f4433a..a222bc65a 100644 --- a/third_party/WebKit/Source/core/paint/VideoPainterTest.cpp +++ b/third_party/WebKit/Source/core/paint/VideoPainterTest.cpp
@@ -79,7 +79,7 @@ }); GetDocument().View()->SetParentVisible(true); GetDocument().View()->SetSelfVisible(true); - GetDocument().SetURL(KURL(KURL(), "https://example.com/")); + GetDocument().SetURL(KURL(NullURL(), "https://example.com/")); } Document& GetDocument() { return page_holder_->GetDocument(); }
diff --git a/third_party/WebKit/Source/core/probe/CoreProbes.cpp b/third_party/WebKit/Source/core/probe/CoreProbes.cpp index 27d41ba..3f67b1e 100644 --- a/third_party/WebKit/Source/core/probe/CoreProbes.cpp +++ b/third_party/WebKit/Source/core/probe/CoreProbes.cpp
@@ -118,7 +118,8 @@ unsigned long identifier, const ResourceResponse& r, Resource* resource) { - didReceiveResourceResponse(frame, identifier, loader, r, resource); + didReceiveResourceResponse(frame->GetDocument(), identifier, loader, r, + resource); } void CanceledAfterReceivedResourceResponse(LocalFrame* frame,
diff --git a/third_party/WebKit/Source/core/probe/CoreProbes.pidl b/third_party/WebKit/Source/core/probe/CoreProbes.pidl index 40c01ab..89899f9 100644 --- a/third_party/WebKit/Source/core/probe/CoreProbes.pidl +++ b/third_party/WebKit/Source/core/probe/CoreProbes.pidl
@@ -85,17 +85,17 @@ void didFireWebGLErrorOrWarning(Element*, const String& message); void didResizeMainFrame(LocalFrame*); void didPaint(LocalFrame*, const GraphicsLayer*, GraphicsContext&, const LayoutRect&); - void applyUserAgentOverride(LocalFrame*, String* userAgent); - void didBlockRequest([Keep] LocalFrame*, const ResourceRequest&, DocumentLoader*, const FetchInitiatorInfo&, ResourceRequestBlockedReason); + void applyUserAgentOverride(ExecutionContext*, String* userAgent); + void didBlockRequest([Keep] ExecutionContext*, const ResourceRequest&, DocumentLoader*, const FetchInitiatorInfo&, ResourceRequestBlockedReason); void didChangeResourcePriority(LocalFrame*, unsigned long identifier, ResourceLoadPriority loadPriority); - void willSendRequest([Keep] LocalFrame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo&); + void willSendRequest([Keep] ExecutionContext*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo&); void markResourceAsCached(LocalFrame*, unsigned long identifier); - void didReceiveResourceResponse([Keep] LocalFrame*, unsigned long identifier, DocumentLoader*, const ResourceResponse&, Resource*); - void didReceiveData([Keep] LocalFrame*, unsigned long identifier, const char* data, int dataLength); - void didReceiveEncodedDataLength([Keep] LocalFrame*, unsigned long identifier, int encodedDataLength); - void didFinishLoading([Keep] LocalFrame* frame, unsigned long identifier, double finishTime, int64_t encodedDataLength, int64_t decodedBodyLength); + void didReceiveResourceResponse(ExecutionContext*, unsigned long identifier, DocumentLoader*, const ResourceResponse&, Resource*); + void didReceiveData(ExecutionContext*, unsigned long identifier, DocumentLoader*, const char* data, int dataLength); + void didReceiveEncodedDataLength(ExecutionContext*, unsigned long identifier, int encodedDataLength); + void didFinishLoading(ExecutionContext*, unsigned long identifier, DocumentLoader*, double finishTime, int64_t encodedDataLength, int64_t decodedBodyLength); void didReceiveCORSRedirectResponse([Keep] LocalFrame*, unsigned long identifier, DocumentLoader*, const ResourceResponse&, Resource*); - void didFailLoading(LocalFrame* frame, unsigned long identifier, const ResourceError&); + void didFailLoading(ExecutionContext*, unsigned long identifier, const ResourceError&); void documentThreadableLoaderStartedLoadingForClient(ExecutionContext*, unsigned long identifier, ThreadableLoaderClient* client); void documentThreadableLoaderFailedToStartLoadingForClient(ExecutionContext*, ThreadableLoaderClient* client); void willSendEventSourceRequest(ExecutionContext*, ThreadableLoaderClient* eventSource); @@ -156,5 +156,5 @@ void forcePseudoState([Keep] Element* element, CSSSelector::PseudoType pseudoState, bool* result); void shouldWaitForDebuggerOnWorkerStart(ExecutionContext* context, bool* result); void shouldForceCORSPreflight(Document*, bool* result); - void shouldBlockRequest(LocalFrame*, const ResourceRequest&, bool* result); + void shouldBlockRequest(ExecutionContext*, const ResourceRequest&, bool* result); }
diff --git a/third_party/WebKit/Source/core/scheduler/ActiveConnectionThrottlingTest.cpp b/third_party/WebKit/Source/core/scheduler/ActiveConnectionThrottlingTest.cpp new file mode 100644 index 0000000..1f32df2 --- /dev/null +++ b/third_party/WebKit/Source/core/scheduler/ActiveConnectionThrottlingTest.cpp
@@ -0,0 +1,62 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code if governed by a BSD-style license that can be +// found in LICENSE file. + +#include "core/exported/WebViewBase.h" +#include "core/frame/WebLocalFrameBase.h" +#include "core/testing/sim/SimRequest.h" +#include "core/testing/sim/SimTest.h" +#include "platform/scheduler/renderer/web_view_scheduler.h" +#include "platform/testing/TestingPlatformSupport.h" +#include "platform/testing/TestingPlatformSupportWithWebRTC.h" +#include "platform/wtf/PtrUtil.h" +#include "public/web/WebScriptSource.h" +#include "testing/gtest/include/gtest/gtest.h" + +using ::testing::_; + +namespace blink { + +class ActiveConnectionThrottlingTest : public SimTest {}; + +TEST_F(ActiveConnectionThrottlingTest, WebSocketStopsThrottling) { + SimRequest main_resource("https://example.com/", "text/html"); + + LoadURL("https://example.com/"); + + EXPECT_FALSE(WebView().Scheduler()->HasActiveConnectionForTest()); + + main_resource.Complete( + "(<script>" + " var socket = new WebSocket(\"ws://www.example.com/websocket\");" + "</script>)"); + + EXPECT_TRUE(WebView().Scheduler()->HasActiveConnectionForTest()); + + MainFrame().ExecuteScript(WebString("socket.close();")); + + EXPECT_FALSE(WebView().Scheduler()->HasActiveConnectionForTest()); +} + +TEST_F(ActiveConnectionThrottlingTest, WebRTCStopsThrottling) { + ScopedTestingPlatformSupport<TestingPlatformSupportWithWebRTC> platform; + + SimRequest main_resource("https://example.com/", "text/html"); + + LoadURL("https://example.com/"); + + EXPECT_FALSE(WebView().Scheduler()->HasActiveConnectionForTest()); + + main_resource.Complete( + "(<script>" + " var data_channel = new RTCPeerConnection();" + "</script>)"); + + EXPECT_TRUE(WebView().Scheduler()->HasActiveConnectionForTest()); + + MainFrame().ExecuteScript(WebString("data_channel.close();")); + + EXPECT_FALSE(WebView().Scheduler()->HasActiveConnectionForTest()); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/scheduler/FrameThrottlingTest.cpp b/third_party/WebKit/Source/core/scheduler/FrameThrottlingTest.cpp new file mode 100644 index 0000000..36409f0f --- /dev/null +++ b/third_party/WebKit/Source/core/scheduler/FrameThrottlingTest.cpp
@@ -0,0 +1,1234 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "bindings/core/v8/ScriptController.h" +#include "bindings/core/v8/ScriptSourceCode.h" +#include "core/dom/Document.h" +#include "core/dom/Element.h" +#include "core/exported/WebRemoteFrameImpl.h" +#include "core/frame/LocalFrame.h" +#include "core/frame/LocalFrameView.h" +#include "core/frame/WebLocalFrameBase.h" +#include "core/html/HTMLIFrameElement.h" +#include "core/layout/api/LayoutViewItem.h" +#include "core/layout/compositing/CompositedLayerMapping.h" +#include "core/page/FocusController.h" +#include "core/page/Page.h" +#include "core/paint/PaintLayer.h" +#include "core/testing/sim/SimCompositor.h" +#include "core/testing/sim/SimDisplayItemList.h" +#include "core/testing/sim/SimRequest.h" +#include "core/testing/sim/SimTest.h" +#include "platform/graphics/paint/TransformPaintPropertyNode.h" +#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/URLTestHelpers.h" +#include "platform/testing/UnitTestHelpers.h" +#include "public/platform/WebDisplayItemList.h" +#include "public/platform/WebLayer.h" +#include "public/web/WebFrameContentDumper.h" +#include "public/web/WebHitTestResult.h" +#include "public/web/WebSettings.h" +#include "testing/gtest/include/gtest/gtest.h" + +using ::testing::_; + +namespace blink { + +using namespace HTMLNames; + +// NOTE: This test uses <iframe sandbox> to create cross origin iframes. + +namespace { + +class MockWebDisplayItemList : public WebDisplayItemList { + public: + ~MockWebDisplayItemList() override {} + + MOCK_METHOD3(AppendDrawingItem, + void(const WebRect& visual_rect, + sk_sp<const cc::PaintRecord>, + const WebRect& record_bounds)); +}; + +void PaintRecursively(GraphicsLayer* layer, WebDisplayItemList* display_items) { + if (layer->DrawsContent()) { + layer->SetNeedsDisplay(); + layer->ContentLayerDelegateForTesting()->PaintContents( + display_items, ContentLayerDelegate::kPaintDefaultBehaviorForTest); + } + for (const auto& child : layer->Children()) + PaintRecursively(child, display_items); +} + +} // namespace + +class FrameThrottlingTest : public SimTest, + public ::testing::WithParamInterface<bool>, + private ScopedRootLayerScrollingForTest { + protected: + FrameThrottlingTest() : ScopedRootLayerScrollingForTest(GetParam()) {} + + void SetUp() override { + SimTest::SetUp(); + WebView().Resize(WebSize(640, 480)); + } + + SimDisplayItemList CompositeFrame() { + SimDisplayItemList display_items = Compositor().BeginFrame(); + // Ensure intersection observer notifications get delivered. + testing::RunPendingTasks(); + return display_items; + } + + // Number of rectangles that make up the root layer's touch handler region. + size_t TouchHandlerRegionSize() { + size_t result = 0; + PaintLayer* layer = + WebView().MainFrameImpl()->GetFrame()->ContentLayoutObject()->Layer(); + GraphicsLayer* own_graphics_layer = + layer->GraphicsLayerBacking(&layer->GetLayoutObject()); + if (own_graphics_layer) { + result += + own_graphics_layer->PlatformLayer()->TouchEventHandlerRegion().size(); + } + GraphicsLayer* child_graphics_layer = layer->GraphicsLayerBacking(); + if (child_graphics_layer && child_graphics_layer != own_graphics_layer) { + result += child_graphics_layer->PlatformLayer() + ->TouchEventHandlerRegion() + .size(); + } + return result; + } +}; + +INSTANTIATE_TEST_CASE_P(All, FrameThrottlingTest, ::testing::Bool()); + +TEST_P(FrameThrottlingTest, ThrottleInvisibleFrames) { + SimRequest main_resource("https://example.com/", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe sandbox id=frame></iframe>"); + + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + auto* frame_document = frame_element->contentDocument(); + + // Initially both frames are visible. + EXPECT_FALSE(GetDocument().View()->IsHiddenForThrottling()); + EXPECT_FALSE(frame_document->View()->IsHiddenForThrottling()); + + // Moving the child fully outside the parent makes it invisible. + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + CompositeFrame(); + EXPECT_FALSE(GetDocument().View()->IsHiddenForThrottling()); + EXPECT_TRUE(frame_document->View()->IsHiddenForThrottling()); + + // A partially visible child is considered visible. + frame_element->setAttribute(styleAttr, + "transform: translate(-50px, 0px, 0px)"); + CompositeFrame(); + EXPECT_FALSE(GetDocument().View()->IsHiddenForThrottling()); + EXPECT_FALSE(frame_document->View()->IsHiddenForThrottling()); +} + +TEST_P(FrameThrottlingTest, HiddenSameOriginFramesAreNotThrottled) { + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame src=iframe.html></iframe>"); + frame_resource.Complete("<iframe id=innerFrame></iframe>"); + + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + auto* frame_document = frame_element->contentDocument(); + + HTMLIFrameElement* inner_frame_element = + toHTMLIFrameElement(frame_document->getElementById("innerFrame")); + auto* inner_frame_document = inner_frame_element->contentDocument(); + + EXPECT_FALSE(GetDocument().View()->CanThrottleRendering()); + EXPECT_FALSE(frame_document->View()->CanThrottleRendering()); + EXPECT_FALSE(inner_frame_document->View()->CanThrottleRendering()); + + // Hidden same origin frames are not throttled. + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + CompositeFrame(); + EXPECT_FALSE(GetDocument().View()->CanThrottleRendering()); + EXPECT_FALSE(frame_document->View()->CanThrottleRendering()); + EXPECT_FALSE(inner_frame_document->View()->CanThrottleRendering()); +} + +TEST_P(FrameThrottlingTest, HiddenCrossOriginFramesAreThrottled) { + // Create a document with doubly nested iframes. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame src=iframe.html></iframe>"); + frame_resource.Complete("<iframe id=innerFrame sandbox></iframe>"); + + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + auto* frame_document = frame_element->contentDocument(); + + auto* inner_frame_element = + toHTMLIFrameElement(frame_document->getElementById("innerFrame")); + auto* inner_frame_document = inner_frame_element->contentDocument(); + + EXPECT_FALSE(GetDocument().View()->CanThrottleRendering()); + EXPECT_FALSE(frame_document->View()->CanThrottleRendering()); + EXPECT_FALSE(inner_frame_document->View()->CanThrottleRendering()); + + // Hidden cross origin frames are throttled. + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + CompositeFrame(); + EXPECT_FALSE(GetDocument().View()->CanThrottleRendering()); + EXPECT_FALSE(frame_document->View()->CanThrottleRendering()); + EXPECT_TRUE(inner_frame_document->View()->CanThrottleRendering()); +} + +TEST_P(FrameThrottlingTest, HiddenCrossOriginZeroByZeroFramesAreNotThrottled) { + // Create a document with doubly nested iframes. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame src=iframe.html></iframe>"); + frame_resource.Complete( + "<iframe id=innerFrame width=0 height=0 sandbox></iframe>"); + + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + auto* frame_document = frame_element->contentDocument(); + + auto* inner_frame_element = + toHTMLIFrameElement(frame_document->getElementById("innerFrame")); + auto* inner_frame_document = inner_frame_element->contentDocument(); + + EXPECT_FALSE(GetDocument().View()->CanThrottleRendering()); + EXPECT_FALSE(frame_document->View()->CanThrottleRendering()); + EXPECT_FALSE(inner_frame_document->View()->CanThrottleRendering()); + + // The frame is not throttled because its dimensions are 0x0. + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + CompositeFrame(); + EXPECT_FALSE(GetDocument().View()->CanThrottleRendering()); + EXPECT_FALSE(frame_document->View()->CanThrottleRendering()); + EXPECT_FALSE(inner_frame_document->View()->CanThrottleRendering()); +} + +TEST_P(FrameThrottlingTest, ThrottledLifecycleUpdate) { + SimRequest main_resource("https://example.com/", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe sandbox id=frame></iframe>"); + + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + auto* frame_document = frame_element->contentDocument(); + + // Enable throttling for the child frame. + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + CompositeFrame(); + EXPECT_TRUE(frame_document->View()->CanThrottleRendering()); + EXPECT_EQ(DocumentLifecycle::kPaintClean, + frame_document->Lifecycle().GetState()); + + // Mutating the throttled frame followed by a beginFrame will not result in + // a complete lifecycle update. + // TODO(skyostil): these expectations are either wrong, or the test is + // not exercising the code correctly. PaintClean means the entire lifecycle + // ran. + frame_element->setAttribute(widthAttr, "50"); + CompositeFrame(); + EXPECT_EQ(DocumentLifecycle::kPaintClean, + frame_document->Lifecycle().GetState()); + + // A hit test will not force a complete lifecycle update. + WebView().HitTestResultAt(WebPoint(0, 0)); + EXPECT_EQ(DocumentLifecycle::kPaintClean, + frame_document->Lifecycle().GetState()); +} + +TEST_P(FrameThrottlingTest, UnthrottlingFrameSchedulesAnimation) { + SimRequest main_resource("https://example.com/", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe sandbox id=frame></iframe>"); + + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + + // First make the child hidden to enable throttling. + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + CompositeFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + EXPECT_FALSE(Compositor().NeedsBeginFrame()); + + // Then bring it back on-screen. This should schedule an animation update. + frame_element->setAttribute(styleAttr, ""); + CompositeFrame(); + EXPECT_TRUE(Compositor().NeedsBeginFrame()); +} + +TEST_P(FrameThrottlingTest, MutatingThrottledFrameDoesNotCauseAnimation) { + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); + frame_resource.Complete("<style> html { background: red; } </style>"); + + // Check that the frame initially shows up. + auto display_items1 = CompositeFrame(); + EXPECT_TRUE(display_items1.Contains(SimCanvas::kRect, "red")); + + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + + // Move the frame offscreen to throttle it. + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + CompositeFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + + // Mutating the throttled frame should not cause an animation to be scheduled. + frame_element->contentDocument()->documentElement()->setAttribute( + styleAttr, "background: green"); + EXPECT_FALSE(Compositor().NeedsBeginFrame()); + + // Move the frame back on screen to unthrottle it. + frame_element->setAttribute(styleAttr, ""); + EXPECT_TRUE(Compositor().NeedsBeginFrame()); + + // The first frame we composite after unthrottling won't contain the + // frame's new contents because unthrottling happens at the end of the + // lifecycle update. We need to do another composite to refresh the frame's + // contents. + auto display_items2 = CompositeFrame(); + EXPECT_FALSE(display_items2.Contains(SimCanvas::kRect, "green")); + EXPECT_TRUE(Compositor().NeedsBeginFrame()); + + auto display_items3 = CompositeFrame(); + EXPECT_TRUE(display_items3.Contains(SimCanvas::kRect, "green")); +} + +TEST_P(FrameThrottlingTest, SynchronousLayoutInThrottledFrame) { + // Create a hidden frame which is throttled. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); + frame_resource.Complete("<div id=div></div>"); + + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + CompositeFrame(); + + // Change the size of a div in the throttled frame. + auto* div_element = frame_element->contentDocument()->getElementById("div"); + div_element->setAttribute(styleAttr, "width: 50px"); + + // Querying the width of the div should do a synchronous layout update even + // though the frame is being throttled. + EXPECT_EQ(50, div_element->clientWidth()); +} + +TEST_P(FrameThrottlingTest, UnthrottlingTriggersRepaint) { + // Create a hidden frame which is throttled. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); + frame_resource.Complete("<style> html { background: green; } </style>"); + + // Move the frame offscreen to throttle it. + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); + CompositeFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + + // Scroll down to unthrottle the frame. The first frame we composite after + // scrolling won't contain the frame yet, but will schedule another repaint. + WebView() + .MainFrameImpl() + ->GetFrameView() + ->LayoutViewportScrollableArea() + ->SetScrollOffset(ScrollOffset(0, 480), kProgrammaticScroll); + auto display_items = CompositeFrame(); + EXPECT_FALSE(display_items.Contains(SimCanvas::kRect, "green")); + + // Now the frame contents should be visible again. + auto display_items2 = CompositeFrame(); + EXPECT_TRUE(display_items2.Contains(SimCanvas::kRect, "green")); +} + +TEST_P(FrameThrottlingTest, UnthrottlingTriggersRepaintInCompositedChild) { + // Create a hidden frame with a composited child layer. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); + frame_resource.Complete( + "<style>" + "div { " + " width: 100px;" + " height: 100px;" + " background-color: green;" + " transform: translateZ(0);" + "}" + "</style><div></div>"); + + // Move the frame offscreen to throttle it. + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); + CompositeFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + + // Scroll down to unthrottle the frame. The first frame we composite after + // scrolling won't contain the frame yet, but will schedule another repaint. + WebView() + .MainFrameImpl() + ->GetFrameView() + ->LayoutViewportScrollableArea() + ->SetScrollOffset(ScrollOffset(0, 480), kProgrammaticScroll); + auto display_items = CompositeFrame(); + EXPECT_FALSE(display_items.Contains(SimCanvas::kRect, "green")); + + // Now the composited child contents should be visible again. + auto display_items2 = CompositeFrame(); + EXPECT_TRUE(display_items2.Contains(SimCanvas::kRect, "green")); +} + +TEST_P(FrameThrottlingTest, ChangeStyleInThrottledFrame) { + // Create a hidden frame which is throttled. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); + frame_resource.Complete("<style> html { background: red; } </style>"); + + // Move the frame offscreen to throttle it. + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); + CompositeFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + + // Change the background color of the frame's contents from red to green. + frame_element->contentDocument()->body()->setAttribute(styleAttr, + "background: green"); + + // Scroll down to unthrottle the frame. + WebView() + .MainFrameImpl() + ->GetFrameView() + ->LayoutViewportScrollableArea() + ->SetScrollOffset(ScrollOffset(0, 480), kProgrammaticScroll); + auto display_items = CompositeFrame(); + EXPECT_FALSE(display_items.Contains(SimCanvas::kRect, "red")); + EXPECT_FALSE(display_items.Contains(SimCanvas::kRect, "green")); + + // Make sure the new style shows up instead of the old one. + auto display_items2 = CompositeFrame(); + EXPECT_TRUE(display_items2.Contains(SimCanvas::kRect, "green")); +} + +TEST_P(FrameThrottlingTest, ChangeOriginInThrottledFrame) { + // Create a hidden frame which is throttled. + SimRequest main_resource("http://example.com/", "text/html"); + SimRequest frame_resource("http://sub.example.com/iframe.html", "text/html"); + LoadURL("http://example.com/"); + main_resource.Complete( + "<iframe style='position: absolute; top: 10000px' id=frame " + "src=http://sub.example.com/iframe.html></iframe>"); + frame_resource.Complete(""); + + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + + CompositeFrame(); + + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + EXPECT_TRUE( + frame_element->contentDocument()->GetFrame()->IsCrossOriginSubframe()); + EXPECT_FALSE(frame_element->contentDocument() + ->View() + ->GetLayoutView() + ->NeedsPaintPropertyUpdate()); + + NonThrowableExceptionState exception_state; + + // Security policy requires setting domain on both frames. + GetDocument().setDomain(String("example.com"), exception_state); + frame_element->contentDocument()->setDomain(String("example.com"), + exception_state); + + EXPECT_FALSE( + frame_element->contentDocument()->GetFrame()->IsCrossOriginSubframe()); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); + EXPECT_TRUE(frame_element->contentDocument() + ->View() + ->GetLayoutView() + ->NeedsPaintPropertyUpdate()); +} + +TEST_P(FrameThrottlingTest, ThrottledFrameWithFocus) { + WebView().GetSettings()->SetJavaScriptEnabled(true); + WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); + RuntimeEnabledFeatures::SetCompositedSelectionUpdateEnabled(true); + + // Create a hidden frame which is throttled and has a text selection. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete( + "<iframe id=frame sandbox=allow-scripts src=iframe.html></iframe>"); + frame_resource.Complete( + "some text to select\n" + "<script>\n" + "var range = document.createRange();\n" + "range.selectNode(document.body);\n" + "window.getSelection().addRange(range);\n" + "</script>\n"); + + // Move the frame offscreen to throttle it. + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); + CompositeFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + + // Give the frame focus and do another composite. The selection in the + // compositor should be cleared because the frame is throttled. + EXPECT_FALSE(Compositor().HasSelection()); + GetDocument().GetPage()->GetFocusController().SetFocusedFrame( + frame_element->contentDocument()->GetFrame()); + GetDocument().body()->setAttribute(styleAttr, "background: green"); + CompositeFrame(); + EXPECT_FALSE(Compositor().HasSelection()); +} + +TEST_P(FrameThrottlingTest, ScrollingCoordinatorShouldSkipThrottledFrame) { + WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); + + // Create a hidden frame which is throttled. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); + frame_resource.Complete( + "<style> html { background-image: linear-gradient(red, blue); " + "background-attachment: fixed; } </style>"); + + // Move the frame offscreen to throttle it. + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); + CompositeFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + + // Change style of the frame's content to make it in VisualUpdatePending + // state. + frame_element->contentDocument()->body()->setAttribute(styleAttr, + "background: green"); + // Change root frame's layout so that the next lifecycle update will call + // ScrollingCoordinator::updateAfterCompositingChangeIfNeeded(). + GetDocument().body()->setAttribute(styleAttr, "margin: 20px"); + EXPECT_EQ(DocumentLifecycle::kVisualUpdatePending, + frame_element->contentDocument()->Lifecycle().GetState()); + + DocumentLifecycle::AllowThrottlingScope throttling_scope( + GetDocument().Lifecycle()); + // This will call ScrollingCoordinator::updateAfterCompositingChangeIfNeeded() + // and should not cause assert failure about + // isAllowedToQueryCompositingState() in the throttled frame. + GetDocument().View()->UpdateAllLifecyclePhases(); + testing::RunPendingTasks(); + EXPECT_EQ(DocumentLifecycle::kVisualUpdatePending, + frame_element->contentDocument()->Lifecycle().GetState()); + // The fixed background in the throttled sub frame should not cause main + // thread scrolling. + EXPECT_FALSE(GetDocument() + .View() + ->LayoutViewportScrollableArea() + ->ShouldScrollOnMainThread()); + + // Make the frame visible by changing its transform. This doesn't cause a + // layout, but should still unthrottle the frame. + frame_element->setAttribute(styleAttr, "transform: translateY(0px)"); + CompositeFrame(); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); + // The fixed background in the throttled sub frame should be considered. + EXPECT_TRUE(frame_element->contentDocument() + ->View() + ->LayoutViewportScrollableArea() + ->ShouldScrollOnMainThread()); + EXPECT_FALSE(GetDocument() + .View() + ->LayoutViewportScrollableArea() + ->ShouldScrollOnMainThread()); +} + +TEST_P(FrameThrottlingTest, ScrollingCoordinatorShouldSkipThrottledLayer) { + WebView().GetSettings()->SetJavaScriptEnabled(true); + WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); + WebView().GetSettings()->SetPreferCompositingToLCDTextEnabled(true); + + // Create a hidden frame which is throttled and has a touch handler inside a + // composited layer. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete( + "<iframe id=frame sandbox=allow-scripts src=iframe.html></iframe>"); + frame_resource.Complete( + "<div id=div style='transform: translateZ(0)' ontouchstart='foo()'>touch " + "handler</div>"); + + // Move the frame offscreen to throttle it. + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); + CompositeFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + + // Change style of the frame's content to make it in VisualUpdatePending + // state. + frame_element->contentDocument()->body()->setAttribute(styleAttr, + "background: green"); + // Change root frame's layout so that the next lifecycle update will call + // ScrollingCoordinator::updateAfterCompositingChangeIfNeeded(). + GetDocument().body()->setAttribute(styleAttr, "margin: 20px"); + EXPECT_EQ(DocumentLifecycle::kVisualUpdatePending, + frame_element->contentDocument()->Lifecycle().GetState()); + + DocumentLifecycle::AllowThrottlingScope throttling_scope( + GetDocument().Lifecycle()); + // This will call ScrollingCoordinator::updateAfterCompositingChangeIfNeeded() + // and should not cause assert failure about + // isAllowedToQueryCompositingState() in the throttled frame. + GetDocument().View()->UpdateAllLifecyclePhases(); + testing::RunPendingTasks(); + EXPECT_EQ(DocumentLifecycle::kVisualUpdatePending, + frame_element->contentDocument()->Lifecycle().GetState()); +} + +TEST_P(FrameThrottlingTest, + ScrollingCoordinatorShouldSkipCompositedThrottledFrame) { + WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); + WebView().GetSettings()->SetPreferCompositingToLCDTextEnabled(true); + + // Create a hidden frame which is throttled. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); + frame_resource.Complete("<div style='height: 2000px'></div>"); + + // Move the frame offscreen to throttle it. + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); + CompositeFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + + // Change style of the frame's content to make it in VisualUpdatePending + // state. + frame_element->contentDocument()->body()->setAttribute(styleAttr, + "background: green"); + // Change root frame's layout so that the next lifecycle update will call + // ScrollingCoordinator::updateAfterCompositingChangeIfNeeded(). + GetDocument().body()->setAttribute(styleAttr, "margin: 20px"); + EXPECT_EQ(DocumentLifecycle::kVisualUpdatePending, + frame_element->contentDocument()->Lifecycle().GetState()); + + DocumentLifecycle::AllowThrottlingScope throttling_scope( + GetDocument().Lifecycle()); + // This will call ScrollingCoordinator::updateAfterCompositingChangeIfNeeded() + // and should not cause assert failure about + // isAllowedToQueryCompositingState() in the throttled frame. + CompositeFrame(); + EXPECT_EQ(DocumentLifecycle::kVisualUpdatePending, + frame_element->contentDocument()->Lifecycle().GetState()); + + // Make the frame visible by changing its transform. This doesn't cause a + // layout, but should still unthrottle the frame. + frame_element->setAttribute(styleAttr, "transform: translateY(0px)"); + CompositeFrame(); // Unthrottle the frame. + CompositeFrame(); // Handle the pending visual update of the unthrottled + // frame. + EXPECT_EQ(DocumentLifecycle::kPaintClean, + frame_element->contentDocument()->Lifecycle().GetState()); + EXPECT_TRUE( + frame_element->contentDocument()->View()->UsesCompositedScrolling()); +} + +TEST_P(FrameThrottlingTest, UnthrottleByTransformingWithoutLayout) { + WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); + + // Create a hidden frame which is throttled. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); + frame_resource.Complete(""); + + // Move the frame offscreen to throttle it. + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); + CompositeFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + + // Make the frame visible by changing its transform. This doesn't cause a + // layout, but should still unthrottle the frame. + frame_element->setAttribute(styleAttr, "transform: translateY(0px)"); + CompositeFrame(); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); +} + +TEST_P(FrameThrottlingTest, ThrottledTopLevelEventHandlerIgnored) { + WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); + WebView().GetSettings()->SetJavaScriptEnabled(true); + EXPECT_EQ(0u, TouchHandlerRegionSize()); + + // Create a frame which is throttled and has two different types of + // top-level touchstart handlers. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete( + "<iframe id=frame sandbox=allow-scripts src=iframe.html></iframe>"); + frame_resource.Complete( + "<script>" + "window.addEventListener('touchstart', function(){}, {passive: false});" + "document.addEventListener('touchstart', function(){}, {passive: false});" + "</script>"); + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + CompositeFrame(); // Throttle the frame. + CompositeFrame(); // Update touch handler regions. + + // The touch handlers in the throttled frame should have been ignored. + EXPECT_EQ(0u, TouchHandlerRegionSize()); + + // Unthrottling the frame makes the touch handlers active again. Note that + // both handlers get combined into the same rectangle in the region, so + // there is only one rectangle in total. + frame_element->setAttribute(styleAttr, "transform: translateY(0px)"); + CompositeFrame(); // Unthrottle the frame. + CompositeFrame(); // Update touch handler regions. + EXPECT_EQ(1u, TouchHandlerRegionSize()); +} + +TEST_P(FrameThrottlingTest, ThrottledEventHandlerIgnored) { + WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); + WebView().GetSettings()->SetJavaScriptEnabled(true); + EXPECT_EQ(0u, TouchHandlerRegionSize()); + + // Create a frame which is throttled and has a non-top-level touchstart + // handler. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete( + "<iframe id=frame sandbox=allow-scripts src=iframe.html></iframe>"); + frame_resource.Complete( + "<div id=d>touch handler</div>" + "<script>" + "document.querySelector('#d').addEventListener('touchstart', " + "function(){});" + "</script>"); + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + CompositeFrame(); // Throttle the frame. + CompositeFrame(); // Update touch handler regions. + + // The touch handler in the throttled frame should have been ignored. + EXPECT_EQ(0u, TouchHandlerRegionSize()); + + // Unthrottling the frame makes the touch handler active again. + frame_element->setAttribute(styleAttr, "transform: translateY(0px)"); + CompositeFrame(); // Unthrottle the frame. + CompositeFrame(); // Update touch handler regions. + EXPECT_EQ(1u, TouchHandlerRegionSize()); +} + +TEST_P(FrameThrottlingTest, DumpThrottledFrame) { + WebView().GetSettings()->SetJavaScriptEnabled(true); + + // Create a frame which is throttled. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete( + "main <iframe id=frame sandbox=allow-scripts src=iframe.html></iframe>"); + frame_resource.Complete(""); + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + CompositeFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + + LocalFrame* local_frame = ToLocalFrame(frame_element->ContentFrame()); + local_frame->GetScriptController().ExecuteScriptInMainWorld( + "document.body.innerHTML = 'throttled'"); + EXPECT_FALSE(Compositor().NeedsBeginFrame()); + + // The dumped contents should not include the throttled frame. + DocumentLifecycle::AllowThrottlingScope throttling_scope( + GetDocument().Lifecycle()); + WebString result = WebFrameContentDumper::DeprecatedDumpFrameTreeAsText( + WebView().MainFrameImpl(), 1024); + EXPECT_NE(std::string::npos, result.Utf8().find("main")); + EXPECT_EQ(std::string::npos, result.Utf8().find("throttled")); +} + +TEST_P(FrameThrottlingTest, PaintingViaContentLayerDelegateIsThrottled) { + WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); + WebView().GetSettings()->SetPreferCompositingToLCDTextEnabled(true); + + // Create a hidden frame which is throttled. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); + frame_resource.Complete("throttled"); + CompositeFrame(); + + // Before the iframe is throttled, we should create all drawing items. + MockWebDisplayItemList display_items_not_throttled; + EXPECT_CALL(display_items_not_throttled, AppendDrawingItem(_, _, _)).Times(3); + PaintRecursively(WebView().RootGraphicsLayer(), &display_items_not_throttled); + + // Move the frame offscreen to throttle it and make sure it is backed by a + // graphics layer. + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + frame_element->setAttribute(styleAttr, + "transform: translateY(480px) translateZ(0px)"); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); + CompositeFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + + // If painting of the iframe is throttled, we should only receive two + // drawing items. + MockWebDisplayItemList display_items_throttled; + EXPECT_CALL(display_items_throttled, AppendDrawingItem(_, _, _)).Times(2); + PaintRecursively(WebView().RootGraphicsLayer(), &display_items_throttled); +} + +TEST_P(FrameThrottlingTest, ThrottleInnerCompositedLayer) { + WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); + WebView().GetSettings()->SetPreferCompositingToLCDTextEnabled(true); + + // Create a hidden frame which is throttled. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); + frame_resource.Complete( + "<div id=div style='will-change: transform; background: blue'>DIV</div>"); + CompositeFrame(); + + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + // The inner div is composited. + auto* inner_div = frame_element->contentDocument()->getElementById("div"); + EXPECT_NE(nullptr, + inner_div->GetLayoutBox()->Layer()->GraphicsLayerBacking()); + + // Before the iframe is throttled, we should create all drawing items. + MockWebDisplayItemList display_items_not_throttled; + EXPECT_CALL(display_items_not_throttled, AppendDrawingItem(_, _, _)).Times(4); + PaintRecursively(WebView().RootGraphicsLayer(), &display_items_not_throttled); + + // Move the frame offscreen to throttle it. + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); + CompositeFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + // The inner div should still be composited. + EXPECT_NE(nullptr, + inner_div->GetLayoutBox()->Layer()->GraphicsLayerBacking()); + + // If painting of the iframe is throttled, we should only receive two + // drawing items. + MockWebDisplayItemList display_items_throttled; + EXPECT_CALL(display_items_throttled, AppendDrawingItem(_, _, _)).Times(2); + PaintRecursively(WebView().RootGraphicsLayer(), &display_items_throttled); + + // Remove compositing trigger of inner_div. + inner_div->setAttribute(styleAttr, "background: yellow; overflow: hidden"); + // Do an unthrottled style and layout update, simulating the situation + // triggered by script style/layout access. + GetDocument().View()->UpdateLifecycleToLayoutClean(); + { + // And a throttled full lifecycle update. + DocumentLifecycle::AllowThrottlingScope throttling_scope( + GetDocument().Lifecycle()); + GetDocument().View()->UpdateAllLifecyclePhases(); + } + // The inner div should still be composited because compositing update is + // throttled, though the inner_div's self-painting status has been updated. + EXPECT_FALSE(inner_div->GetLayoutBox()->Layer()->IsSelfPaintingLayer()); + { + DisableCompositingQueryAsserts disabler; + EXPECT_NE(nullptr, + inner_div->GetLayoutBox()->Layer()->GraphicsLayerBacking()); + } + + MockWebDisplayItemList display_items_throttled1; + EXPECT_CALL(display_items_throttled1, AppendDrawingItem(_, _, _)).Times(2); + PaintRecursively(WebView().RootGraphicsLayer(), &display_items_throttled1); + + // Move the frame back on screen. + frame_element->setAttribute(styleAttr, ""); + CompositeFrame(); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); + CompositeFrame(); + // The inner div is no longer composited. + EXPECT_EQ(nullptr, + inner_div->GetLayoutBox()->Layer()->GraphicsLayerBacking()); + + // After the iframe is unthrottled, we should create all drawing items. + MockWebDisplayItemList display_items_not_throttled1; + EXPECT_CALL(display_items_not_throttled1, AppendDrawingItem(_, _, _)) + .Times(4); + PaintRecursively(WebView().RootGraphicsLayer(), + &display_items_not_throttled1); +} + +TEST_P(FrameThrottlingTest, ThrottleSubtreeAtomically) { + // Create two nested frames which are throttled. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + SimRequest child_frame_resource("https://example.com/child-iframe.html", + "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); + frame_resource.Complete( + "<iframe id=child-frame sandbox src=child-iframe.html></iframe>"); + child_frame_resource.Complete(""); + + // Move both frames offscreen, but don't run the intersection observers yet. + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + auto* child_frame_element = toHTMLIFrameElement( + frame_element->contentDocument()->getElementById("child-frame")); + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + Compositor().BeginFrame(); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); + EXPECT_FALSE( + child_frame_element->contentDocument()->View()->CanThrottleRendering()); + + // Only run the intersection observer for the parent frame. Both frames + // should immediately become throttled. This simulates the case where a task + // such as BeginMainFrame runs in the middle of dispatching intersection + // observer notifications. + frame_element->contentDocument() + ->View() + ->UpdateRenderThrottlingStatusForTesting(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + EXPECT_TRUE( + child_frame_element->contentDocument()->View()->CanThrottleRendering()); + + // Both frames should still be throttled after the second notification. + child_frame_element->contentDocument() + ->View() + ->UpdateRenderThrottlingStatusForTesting(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + EXPECT_TRUE( + child_frame_element->contentDocument()->View()->CanThrottleRendering()); + + // Move the frame back on screen but don't update throttling yet. + frame_element->setAttribute(styleAttr, "transform: translateY(0px)"); + Compositor().BeginFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + EXPECT_TRUE( + child_frame_element->contentDocument()->View()->CanThrottleRendering()); + + // Update throttling for the child. It should remain throttled because the + // parent is still throttled. + child_frame_element->contentDocument() + ->View() + ->UpdateRenderThrottlingStatusForTesting(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + EXPECT_TRUE( + child_frame_element->contentDocument()->View()->CanThrottleRendering()); + + // Updating throttling on the parent should unthrottle both frames. + frame_element->contentDocument() + ->View() + ->UpdateRenderThrottlingStatusForTesting(); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); + EXPECT_FALSE( + child_frame_element->contentDocument()->View()->CanThrottleRendering()); +} + +TEST_P(FrameThrottlingTest, SkipPaintingLayersInThrottledFrames) { + WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); + WebView().GetSettings()->SetPreferCompositingToLCDTextEnabled(true); + + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); + frame_resource.Complete( + "<div id=div style='transform: translateZ(0); background: " + "red'>layer</div>"); + auto display_items = CompositeFrame(); + EXPECT_TRUE(display_items.Contains(SimCanvas::kRect, "red")); + + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + CompositeFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + + auto* frame_document = frame_element->contentDocument(); + EXPECT_EQ(DocumentLifecycle::kPaintClean, + frame_document->Lifecycle().GetState()); + + // Simulate the paint for a graphics layer being externally invalidated + // (e.g., by video playback). + frame_document->View() + ->GetLayoutViewItem() + .InvalidatePaintForViewAndCompositedLayers(); + + // The layer inside the throttled frame should not get painted. + auto display_items2 = CompositeFrame(); + EXPECT_FALSE(display_items2.Contains(SimCanvas::kRect, "red")); +} + +TEST_P(FrameThrottlingTest, SynchronousLayoutInAnimationFrameCallback) { + WebView().GetSettings()->SetJavaScriptEnabled(true); + + // Prepare a page with two cross origin frames (from the same origin so they + // are able to access eachother). + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest first_frame_resource("https://thirdparty.com/first.html", + "text/html"); + SimRequest second_frame_resource("https://thirdparty.com/second.html", + "text/html"); + LoadURL("https://example.com/"); + main_resource.Complete( + "<iframe id=first name=first " + "src='https://thirdparty.com/first.html'></iframe>\n" + "<iframe id=second name=second " + "src='https://thirdparty.com/second.html'></iframe>"); + + // The first frame contains just a simple div. This frame will be made + // throttled. + first_frame_resource.Complete("<div id=d>first frame</div>"); + + // The second frame just used to execute a requestAnimationFrame callback. + second_frame_resource.Complete(""); + + // Throttle the first frame. + auto* first_frame_element = + toHTMLIFrameElement(GetDocument().getElementById("first")); + first_frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + CompositeFrame(); + EXPECT_TRUE( + first_frame_element->contentDocument()->View()->CanThrottleRendering()); + + // Run a animation frame callback in the second frame which mutates the + // contents of the first frame and causes a synchronous style update. This + // should not result in an unexpected lifecycle state even if the first + // frame is throttled during the animation frame callback. + auto* second_frame_element = + toHTMLIFrameElement(GetDocument().getElementById("second")); + LocalFrame* local_frame = ToLocalFrame(second_frame_element->ContentFrame()); + local_frame->GetScriptController().ExecuteScriptInMainWorld( + "window.requestAnimationFrame(function() {\n" + " var throttledFrame = window.parent.frames.first;\n" + " throttledFrame.document.documentElement.style = 'margin: 50px';\n" + " throttledFrame.document.querySelector('#d').getBoundingClientRect();\n" + "});\n"); + CompositeFrame(); +} + +TEST_P(FrameThrottlingTest, AllowOneAnimationFrame) { + WebView().GetSettings()->SetJavaScriptEnabled(true); + + // Prepare a page with two cross origin frames (from the same origin so they + // are able to access eachother). + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://thirdparty.com/frame.html", "text/html"); + LoadURL("https://example.com/"); + main_resource.Complete( + "<iframe id=frame style=\"position: fixed; top: -10000px\" " + "src='https://thirdparty.com/frame.html'></iframe>"); + + frame_resource.Complete( + "<script>" + "window.requestAnimationFrame(() => { window.didRaf = true; });" + "</script>"); + + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + CompositeFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + + LocalFrame* local_frame = ToLocalFrame(frame_element->ContentFrame()); + v8::HandleScope scope(v8::Isolate::GetCurrent()); + v8::Local<v8::Value> result = + local_frame->GetScriptController().ExecuteScriptInMainWorldAndReturnValue( + ScriptSourceCode("window.didRaf;")); + EXPECT_TRUE(result->IsTrue()); +} + +TEST_P(FrameThrottlingTest, UpdatePaintPropertiesOnUnthrottling) { + if (!RuntimeEnabledFeatures::SlimmingPaintInvalidationEnabled()) + return; + + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); + frame_resource.Complete("<div id='div'>Inner</div>"); + CompositeFrame(); + + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + auto* frame_document = frame_element->contentDocument(); + auto* inner_div = frame_document->getElementById("div"); + auto* inner_div_object = inner_div->GetLayoutObject(); + EXPECT_FALSE(frame_document->View()->ShouldThrottleRendering()); + + frame_element->setAttribute(HTMLNames::styleAttr, + "transform: translateY(1000px)"); + CompositeFrame(); + EXPECT_TRUE(frame_document->View()->CanThrottleRendering()); + EXPECT_FALSE(inner_div_object->PaintProperties()); + + // Mutating the throttled frame should not cause paint property update. + inner_div->setAttribute(HTMLNames::styleAttr, "transform: translateY(20px)"); + EXPECT_FALSE(Compositor().NeedsBeginFrame()); + EXPECT_TRUE(frame_document->View()->CanThrottleRendering()); + { + DocumentLifecycle::AllowThrottlingScope throttling_scope( + GetDocument().Lifecycle()); + GetDocument().View()->UpdateAllLifecyclePhases(); + } + EXPECT_FALSE(inner_div_object->PaintProperties()); + + // Move the frame back on screen to unthrottle it. + frame_element->setAttribute(HTMLNames::styleAttr, ""); + // The first update unthrottles the frame, the second actually update layout + // and paint properties etc. + CompositeFrame(); + CompositeFrame(); + EXPECT_FALSE(frame_document->View()->CanThrottleRendering()); + EXPECT_EQ( + TransformationMatrix().Translate(0, 20), + inner_div->GetLayoutObject()->PaintProperties()->Transform()->Matrix()); +} + +TEST_P(FrameThrottlingTest, DisplayNoneNotThrottled) { + SimRequest main_resource("https://example.com/", "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete( + "<style>iframe { transform: translateY(480px); }</style>" + "<iframe sandbox id=frame></iframe>"); + + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + auto* frame_document = frame_element->contentDocument(); + + // Initially the frame is throttled as it is offscreen. + CompositeFrame(); + EXPECT_TRUE(frame_document->View()->CanThrottleRendering()); + + // Setting display:none unthrottles the frame. + frame_element->setAttribute(styleAttr, "display: none"); + CompositeFrame(); + EXPECT_FALSE(frame_document->View()->CanThrottleRendering()); +} + +TEST_P(FrameThrottlingTest, DisplayNoneChildrenRemainThrottled) { + // Create two nested frames which are throttled. + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + SimRequest child_frame_resource("https://example.com/child-iframe.html", + "text/html"); + + LoadURL("https://example.com/"); + main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); + frame_resource.Complete( + "<iframe id=child-frame sandbox src=child-iframe.html></iframe>"); + child_frame_resource.Complete(""); + + // Move both frames offscreen to make them throttled. + auto* frame_element = + toHTMLIFrameElement(GetDocument().getElementById("frame")); + auto* child_frame_element = toHTMLIFrameElement( + frame_element->contentDocument()->getElementById("child-frame")); + frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); + CompositeFrame(); + EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); + EXPECT_TRUE( + child_frame_element->contentDocument()->View()->CanThrottleRendering()); + + // Setting display:none for the parent frame unthrottles the parent but not + // the child. This behavior matches Safari. + frame_element->setAttribute(styleAttr, "display: none"); + CompositeFrame(); + EXPECT_FALSE( + frame_element->contentDocument()->View()->CanThrottleRendering()); + EXPECT_TRUE( + child_frame_element->contentDocument()->View()->CanThrottleRendering()); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/web/tests/scheduler/OWNERS b/third_party/WebKit/Source/core/scheduler/OWNERS similarity index 100% rename from third_party/WebKit/Source/web/tests/scheduler/OWNERS rename to third_party/WebKit/Source/core/scheduler/OWNERS
diff --git a/third_party/WebKit/Source/core/scheduler/README.md b/third_party/WebKit/Source/core/scheduler/README.md new file mode 100644 index 0000000..2e2a069 --- /dev/null +++ b/third_party/WebKit/Source/core/scheduler/README.md
@@ -0,0 +1,3 @@ +This directory contains scheduler simulation tests. +They can be considered end-to-end tests for the Blink Scheduler and +unlike other scheduler tests they need to have access to core/ layer.
diff --git a/third_party/WebKit/Source/core/scheduler/ThrottlingTest.cpp b/third_party/WebKit/Source/core/scheduler/ThrottlingTest.cpp new file mode 100644 index 0000000..514bf76 --- /dev/null +++ b/third_party/WebKit/Source/core/scheduler/ThrottlingTest.cpp
@@ -0,0 +1,101 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code if governed by a BSD-style license that can be +// found in LICENSE file. + +#include "core/testing/sim/SimRequest.h" +#include "core/testing/sim/SimTest.h" +#include "platform/scheduler/child/web_scheduler.h" +#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/UnitTestHelpers.h" +#include "public/platform/Platform.h" +#include "public/platform/WebThread.h" +#include "public/platform/scheduler/renderer/renderer_scheduler.h" +#include "testing/gtest/include/gtest/gtest.h" + +using ::testing::ElementsAre; + +namespace blink { + +class DisableBackgroundThrottlingIsRespectedTest : public SimTest { + public: + void SetUp() override { + background_tab_timer_throttling_feature_ = + WTF::MakeUnique<ScopedBackgroundTabTimerThrottlingForTest>(false); + SimTest::SetUp(); + } + + void TearDown() { background_tab_timer_throttling_feature_.reset(); } + + private: + typedef ScopedRuntimeEnabledFeatureForTest< + RuntimeEnabledFeatures::TimerThrottlingForBackgroundTabsEnabled, + RuntimeEnabledFeatures::SetTimerThrottlingForBackgroundTabsEnabled> + ScopedBackgroundTabTimerThrottlingForTest; + + std::unique_ptr<ScopedBackgroundTabTimerThrottlingForTest> + background_tab_timer_throttling_feature_; +}; + +TEST_F(DisableBackgroundThrottlingIsRespectedTest, + DisableBackgroundThrottlingIsRespected) { + SimRequest main_resource("https://example.com/", "text/html"); + + LoadURL("https://example.com/"); + + main_resource.Complete( + "(<script>" + " function f(repetitions) {" + " if (repetitions == 0) return;" + " console.log('called f');" + " setTimeout(f, 10, repetitions - 1);" + " }" + " f(5);" + "</script>)"); + + Platform::Current() + ->CurrentThread() + ->Scheduler() + ->GetRendererSchedulerForTest() + ->SetRendererBackgrounded(true); + + // Run delayed tasks for 1 second. All tasks should be completed + // with throttling disabled. + testing::RunDelayedTasks(1000); + + EXPECT_THAT(ConsoleMessages(), ElementsAre("called f", "called f", "called f", + "called f", "called f")); +} + +class BackgroundRendererThrottlingTest : public SimTest {}; + +TEST_F(BackgroundRendererThrottlingTest, + DISABLED_BackgroundRenderersAreThrottled) { + SimRequest main_resource("https://example.com/", "text/html"); + + LoadURL("https://example.com/"); + + main_resource.Complete( + "(<script>" + " function f(repetitions) {" + " if (repetitions == 0) return;" + " console.log('called f');" + " setTimeout(f, 10, repetitions - 1);" + " }" + " setTimeout(f, 10, 3);" + "</script>)"); + + Platform::Current() + ->CurrentThread() + ->Scheduler() + ->GetRendererSchedulerForTest() + ->SetRendererBackgrounded(true); + + // Make sure that we run a task once a second. + for (int i = 0; i < 3; ++i) { + testing::RunDelayedTasks(1000); + EXPECT_THAT(ConsoleMessages(), ElementsAre("called f")); + ConsoleMessages().clear(); + } +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h index 13978b9d..99186c69 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyle.h +++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -820,15 +820,6 @@ } // Text decoration properties. - // text-decoration-line - static TextDecoration InitialTextDecoration() { - return TextDecoration::kNone; - } - TextDecoration GetTextDecoration() const { - return static_cast<TextDecoration>(TextDecorationInternal()); - } - void SetTextDecoration(TextDecoration v) { SetTextDecorationInternal(v); } - // text-decoration-skip static TextDecorationSkip InitialTextDecorationSkip() { return TextDecorationSkip::kObjects;
diff --git a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h index 7e77268..60579728 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h +++ b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h
@@ -149,27 +149,6 @@ enum EAnimPlayState { kAnimPlayStatePlaying, kAnimPlayStatePaused }; -static const size_t kTextDecorationBits = 4; -enum class TextDecoration : unsigned { - kNone = 0x0, - kUnderline = 0x1, - kOverline = 0x2, - kLineThrough = 0x4, - kBlink = 0x8 -}; -inline TextDecoration operator|(TextDecoration a, TextDecoration b) { - return static_cast<TextDecoration>(static_cast<unsigned>(a) | - static_cast<unsigned>(b)); -} -inline TextDecoration& operator|=(TextDecoration& a, TextDecoration b) { - return a = static_cast<TextDecoration>(static_cast<unsigned>(a) | - static_cast<unsigned>(b)); -} -inline TextDecoration& operator^=(TextDecoration& a, TextDecoration b) { - return a = static_cast<TextDecoration>(static_cast<unsigned>(a) ^ - static_cast<unsigned>(b)); -} - static const size_t kTextDecorationSkipBits = 3; enum class TextDecorationSkip { kNone = 0x0, kObjects = 0x1, kInk = 0x2 }; inline TextDecorationSkip operator&(TextDecorationSkip a,
diff --git a/third_party/WebKit/Source/core/style/OWNERS b/third_party/WebKit/Source/core/style/OWNERS index 43df7038..d294f42b 100644 --- a/third_party/WebKit/Source/core/style/OWNERS +++ b/third_party/WebKit/Source/core/style/OWNERS
@@ -1,7 +1,12 @@ bugsnash@chromium.org -meade@chromium.org +ericwilligers@chromium.org nainar@chromium.org -suzyh@chromium.org shend@chromium.org +suzyh@chromium.org +rjwright@chromium.org + +# Also core owners +alancutter@chromium.org +meade@chromium.org # COMPONENT: Blink>CSS
diff --git a/third_party/WebKit/Source/core/style/StylePath.cpp b/third_party/WebKit/Source/core/style/StylePath.cpp index 13cb5975..031eacf 100644 --- a/third_party/WebKit/Source/core/style/StylePath.cpp +++ b/third_party/WebKit/Source/core/style/StylePath.cpp
@@ -51,7 +51,7 @@ } CSSValue* StylePath::ComputedCSSValue() const { - return CSSPathValue::Create(const_cast<StylePath*>(this)); + return cssvalue::CSSPathValue::Create(const_cast<StylePath*>(this)); } bool StylePath::operator==(const BasicShape& o) const {
diff --git a/third_party/WebKit/Source/core/svg/LinearGradientAttributes.h b/third_party/WebKit/Source/core/svg/LinearGradientAttributes.h index 75bba5e..c10b3189 100644 --- a/third_party/WebKit/Source/core/svg/LinearGradientAttributes.h +++ b/third_party/WebKit/Source/core/svg/LinearGradientAttributes.h
@@ -112,6 +112,4 @@ } // namespace blink -#endif - -// vim:ts=4:noet +#endif // LinearGradientAttributes_h
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedPath.cpp b/third_party/WebKit/Source/core/svg/SVGAnimatedPath.cpp index dfaa99b..24473a7 100644 --- a/third_party/WebKit/Source/core/svg/SVGAnimatedPath.cpp +++ b/third_party/WebKit/Source/core/svg/SVGAnimatedPath.cpp
@@ -45,7 +45,7 @@ SVGAnimatedPath::~SVGAnimatedPath() {} const CSSValue* SVGAnimatedPath::CssValue() const { - const CSSPathValue* path_value = CurrentValue()->PathValue(); + const cssvalue::CSSPathValue* path_value = CurrentValue()->PathValue(); if (path_value->GetStylePath()->ByteStream().IsEmpty()) return CSSIdentifierValue::Create(CSSValueNone); return path_value;
diff --git a/third_party/WebKit/Source/core/svg/SVGPath.cpp b/third_party/WebKit/Source/core/svg/SVGPath.cpp index 2ee72a5..5c4e6b04 100644 --- a/third_party/WebKit/Source/core/svg/SVGPath.cpp +++ b/third_party/WebKit/Source/core/svg/SVGPath.cpp
@@ -35,6 +35,8 @@ namespace blink { +using cssvalue::CSSPathValue; + namespace { std::unique_ptr<SVGPathByteStream> BlendPathByteStreams(
diff --git a/third_party/WebKit/Source/core/svg/SVGPath.h b/third_party/WebKit/Source/core/svg/SVGPath.h index 30ccbdba..bdbd261d 100644 --- a/third_party/WebKit/Source/core/svg/SVGPath.h +++ b/third_party/WebKit/Source/core/svg/SVGPath.h
@@ -43,7 +43,7 @@ typedef void TearOffType; static SVGPath* Create() { return new SVGPath(); } - static SVGPath* Create(CSSPathValue* path_value) { + static SVGPath* Create(cssvalue::CSSPathValue* path_value) { return new SVGPath(path_value); } @@ -53,7 +53,7 @@ return path_value_->ByteStream(); } StylePath* GetStylePath() const { return path_value_->GetStylePath(); } - CSSPathValue* PathValue() const { return path_value_.Get(); } + cssvalue::CSSPathValue* PathValue() const { return path_value_.Get(); } // SVGPropertyBase: SVGPath* Clone() const; @@ -78,9 +78,9 @@ private: SVGPath(); - explicit SVGPath(CSSPathValue*); + explicit SVGPath(cssvalue::CSSPathValue*); - Member<CSSPathValue> path_value_; + Member<cssvalue::CSSPathValue> path_value_; }; DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGPath);
diff --git a/third_party/WebKit/Source/core/svg/SVGPathByteStreamSource.h b/third_party/WebKit/Source/core/svg/SVGPathByteStreamSource.h index e56dc4c..6d372ff 100644 --- a/third_party/WebKit/Source/core/svg/SVGPathByteStreamSource.h +++ b/third_party/WebKit/Source/core/svg/SVGPathByteStreamSource.h
@@ -20,6 +20,7 @@ #ifndef SVGPathByteStreamSource_h #define SVGPathByteStreamSource_h +#include "build/build_config.h" #include "core/svg/SVGPathByteStream.h" #include "core/svg/SVGPathData.h" #include "platform/geometry/FloatPoint.h" @@ -38,7 +39,7 @@ PathSegmentData ParseSegment(); private: -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) #pragma warning(disable : 4701) #endif template <typename DataType>
diff --git a/third_party/WebKit/Source/core/svg/SVGScriptElement.cpp b/third_party/WebKit/Source/core/svg/SVGScriptElement.cpp index da7ed19..dfce8152 100644 --- a/third_party/WebKit/Source/core/svg/SVGScriptElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGScriptElement.cpp
@@ -117,10 +117,6 @@ return Element::TextFromChildren(); } -String SVGScriptElement::TextContent() const { - return Node::textContent(); -} - bool SVGScriptElement::HasSourceAttribute() const { return href()->IsSpecified(); }
diff --git a/third_party/WebKit/Source/core/svg/SVGScriptElement.h b/third_party/WebKit/Source/core/svg/SVGScriptElement.h index 5b687390..64d66950 100644 --- a/third_party/WebKit/Source/core/svg/SVGScriptElement.h +++ b/third_party/WebKit/Source/core/svg/SVGScriptElement.h
@@ -82,7 +82,6 @@ String SourceAttributeValue() const override; String TypeAttributeValue() const override; String TextFromChildren() override; - String TextContent() const override; bool HasSourceAttribute() const override; bool IsConnected() const override; bool HasChildren() const override;
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp index 359ecc54..57399bc 100644 --- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp +++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -315,7 +315,7 @@ } sk_sp<SkImage> SVGImage::ImageForCurrentFrame() { - return ImageForCurrentFrameForContainer(KURL(), Size()); + return ImageForCurrentFrameForContainer(NullURL(), Size()); } void SVGImage::DrawPatternForContainer(GraphicsContext& context, @@ -416,7 +416,7 @@ } bool SVGImage::ApplyShader(PaintFlags& flags, const SkMatrix& local_matrix) { - return ApplyShaderInternal(flags, local_matrix, KURL()); + return ApplyShaderInternal(flags, local_matrix, NullURL()); } bool SVGImage::ApplyShaderForContainer(const FloatSize& container_size, @@ -448,7 +448,7 @@ return; DrawInternal(canvas, flags, dst_rect, src_rect, - should_respect_image_orientation, clamp_mode, KURL()); + should_respect_image_orientation, clamp_mode, NullURL()); } sk_sp<PaintRecord> SVGImage::PaintRecordForCurrentFrame(const IntRect& bounds, @@ -769,10 +769,11 @@ page_ = page; TRACE_EVENT0("blink", "SVGImage::dataChanged::load"); - loader.Load(FrameLoadRequest( - 0, ResourceRequest(BlankURL()), - SubstituteData(Data(), AtomicString("image/svg+xml"), - AtomicString("UTF-8"), KURL(), kForceSynchronousLoad))); + loader.Load( + FrameLoadRequest(0, ResourceRequest(BlankURL()), + SubstituteData(Data(), AtomicString("image/svg+xml"), + AtomicString("UTF-8"), NullURL(), + kForceSynchronousLoad))); // Set the concrete object size before a container size is available. intrinsic_size_ = RoundedIntSize(ConcreteObjectSize(FloatSize(
diff --git a/third_party/WebKit/Source/core/testing/DummyModulator.cpp b/third_party/WebKit/Source/core/testing/DummyModulator.cpp index f2dbd09..ac51a15 100644 --- a/third_party/WebKit/Source/core/testing/DummyModulator.cpp +++ b/third_party/WebKit/Source/core/testing/DummyModulator.cpp
@@ -115,6 +115,11 @@ return ScriptValue(); } +ScriptModuleState DummyModulator::GetRecordStatus(ScriptModule) { + NOTREACHED(); + return ScriptModuleState::kErrored; +} + ScriptValue DummyModulator::GetError(const ModuleScript*) { NOTREACHED(); return ScriptValue();
diff --git a/third_party/WebKit/Source/core/testing/DummyModulator.h b/third_party/WebKit/Source/core/testing/DummyModulator.h index 6059718..e7f123a0 100644 --- a/third_party/WebKit/Source/core/testing/DummyModulator.h +++ b/third_party/WebKit/Source/core/testing/DummyModulator.h
@@ -58,6 +58,7 @@ const TextPosition&, ExceptionState&) override; ScriptValue InstantiateModule(ScriptModule) override; + ScriptModuleState GetRecordStatus(ScriptModule) override; ScriptValue GetError(const ModuleScript*) override; Vector<ModuleRequest> ModuleRequestsFromScriptModule(ScriptModule) override; void ExecuteModule(const ModuleScript*) override;
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp index 466b6b5..be475e92 100644 --- a/third_party/WebKit/Source/core/testing/Internals.cpp +++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -472,7 +472,7 @@ bool Internals::isValidContentSelect(Element* insertion_point, ExceptionState& exception_state) { DCHECK(insertion_point); - if (!insertion_point->IsInsertionPoint()) { + if (!insertion_point->IsV0InsertionPoint()) { exception_state.ThrowDOMException(kInvalidAccessError, "The element is not an insertion point."); return false;
diff --git a/third_party/WebKit/Source/web/tests/data/0-by-0.html b/third_party/WebKit/Source/core/testing/data/0-by-0.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/0-by-0.html rename to third_party/WebKit/Source/core/testing/data/0-by-0.html
diff --git a/third_party/WebKit/Source/web/tests/data/200-by-300-min-scale-2.html b/third_party/WebKit/Source/core/testing/data/200-by-300-min-scale-2.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/200-by-300-min-scale-2.html rename to third_party/WebKit/Source/core/testing/data/200-by-300-min-scale-2.html
diff --git a/third_party/WebKit/Source/web/tests/data/200-by-300-viewport.html b/third_party/WebKit/Source/core/testing/data/200-by-300-viewport.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/200-by-300-viewport.html rename to third_party/WebKit/Source/core/testing/data/200-by-300-viewport.html
diff --git a/third_party/WebKit/Source/web/tests/data/200-by-300.html b/third_party/WebKit/Source/core/testing/data/200-by-300.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/200-by-300.html rename to third_party/WebKit/Source/core/testing/data/200-by-300.html
diff --git a/third_party/WebKit/Source/web/tests/data/200-by-800-viewport.html b/third_party/WebKit/Source/core/testing/data/200-by-800-viewport.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/200-by-800-viewport.html rename to third_party/WebKit/Source/core/testing/data/200-by-800-viewport.html
diff --git a/third_party/WebKit/Source/web/tests/data/Ahem.ttf b/third_party/WebKit/Source/core/testing/data/Ahem.ttf similarity index 100% rename from third_party/WebKit/Source/web/tests/data/Ahem.ttf rename to third_party/WebKit/Source/core/testing/data/Ahem.ttf Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/add_frame_in_unload.html b/third_party/WebKit/Source/core/testing/data/add_frame_in_unload.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/add_frame_in_unload.html rename to third_party/WebKit/Source/core/testing/data/add_frame_in_unload.html
diff --git a/third_party/WebKit/Source/web/tests/data/add_frame_in_unload_wrapper.html b/third_party/WebKit/Source/core/testing/data/add_frame_in_unload_wrapper.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/add_frame_in_unload_wrapper.html rename to third_party/WebKit/Source/core/testing/data/add_frame_in_unload_wrapper.html
diff --git a/third_party/WebKit/Source/web/tests/data/autofocus_input_field_iframe.html b/third_party/WebKit/Source/core/testing/data/autofocus_input_field_iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/autofocus_input_field_iframe.html rename to third_party/WebKit/Source/core/testing/data/autofocus_input_field_iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/back_forward_restore_scroll.html b/third_party/WebKit/Source/core/testing/data/back_forward_restore_scroll.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/back_forward_restore_scroll.html rename to third_party/WebKit/Source/core/testing/data/back_forward_restore_scroll.html
diff --git a/third_party/WebKit/Source/web/tests/data/bar.html b/third_party/WebKit/Source/core/testing/data/bar.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/bar.html rename to third_party/WebKit/Source/core/testing/data/bar.html
diff --git a/third_party/WebKit/Source/web/tests/data/black-and-white.ico b/third_party/WebKit/Source/core/testing/data/black-and-white.ico similarity index 100% rename from third_party/WebKit/Source/web/tests/data/black-and-white.ico rename to third_party/WebKit/Source/core/testing/data/black-and-white.ico Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/blink_caret_on_typing_after_long_press.html b/third_party/WebKit/Source/core/testing/data/blink_caret_on_typing_after_long_press.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/blink_caret_on_typing_after_long_press.html rename to third_party/WebKit/Source/core/testing/data/blink_caret_on_typing_after_long_press.html
diff --git a/third_party/WebKit/Source/web/tests/data/block_bound.html b/third_party/WebKit/Source/core/testing/data/block_bound.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/block_bound.html rename to third_party/WebKit/Source/core/testing/data/block_bound.html
diff --git a/third_party/WebKit/Source/web/tests/data/body-overflow-hidden-short.html b/third_party/WebKit/Source/core/testing/data/body-overflow-hidden-short.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/body-overflow-hidden-short.html rename to third_party/WebKit/Source/core/testing/data/body-overflow-hidden-short.html
diff --git a/third_party/WebKit/Source/web/tests/data/body-overflow-hidden.html b/third_party/WebKit/Source/core/testing/data/body-overflow-hidden.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/body-overflow-hidden.html rename to third_party/WebKit/Source/core/testing/data/body-overflow-hidden.html
diff --git a/third_party/WebKit/Source/web/tests/data/button.html b/third_party/WebKit/Source/core/testing/data/button.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/button.html rename to third_party/WebKit/Source/core/testing/data/button.html
diff --git a/third_party/WebKit/Source/web/tests/data/cancelTest.html b/third_party/WebKit/Source/core/testing/data/cancelTest.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/cancelTest.html rename to third_party/WebKit/Source/core/testing/data/cancelTest.html
diff --git a/third_party/WebKit/Source/web/tests/data/canvas-copy-image.html b/third_party/WebKit/Source/core/testing/data/canvas-copy-image.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/canvas-copy-image.html rename to third_party/WebKit/Source/core/testing/data/canvas-copy-image.html
diff --git a/third_party/WebKit/Source/web/tests/data/clipped-body.html b/third_party/WebKit/Source/core/testing/data/clipped-body.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/clipped-body.html rename to third_party/WebKit/Source/core/testing/data/clipped-body.html
diff --git a/third_party/WebKit/Source/web/tests/data/composited_selection_bounds_basic.html b/third_party/WebKit/Source/core/testing/data/composited_selection_bounds_basic.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/composited_selection_bounds_basic.html rename to third_party/WebKit/Source/core/testing/data/composited_selection_bounds_basic.html
diff --git a/third_party/WebKit/Source/web/tests/data/composited_selection_bounds_detached_frame.html b/third_party/WebKit/Source/core/testing/data/composited_selection_bounds_detached_frame.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/composited_selection_bounds_detached_frame.html rename to third_party/WebKit/Source/core/testing/data/composited_selection_bounds_detached_frame.html
diff --git a/third_party/WebKit/Source/web/tests/data/composited_selection_bounds_editable.html b/third_party/WebKit/Source/core/testing/data/composited_selection_bounds_editable.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/composited_selection_bounds_editable.html rename to third_party/WebKit/Source/core/testing/data/composited_selection_bounds_editable.html
diff --git a/third_party/WebKit/Source/web/tests/data/composited_selection_bounds_editable_div.html b/third_party/WebKit/Source/core/testing/data/composited_selection_bounds_editable_div.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/composited_selection_bounds_editable_div.html rename to third_party/WebKit/Source/core/testing/data/composited_selection_bounds_editable_div.html
diff --git a/third_party/WebKit/Source/web/tests/data/composited_selection_bounds_iframe.html b/third_party/WebKit/Source/core/testing/data/composited_selection_bounds_iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/composited_selection_bounds_iframe.html rename to third_party/WebKit/Source/core/testing/data/composited_selection_bounds_iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/composited_selection_bounds_none.html b/third_party/WebKit/Source/core/testing/data/composited_selection_bounds_none.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/composited_selection_bounds_none.html rename to third_party/WebKit/Source/core/testing/data/composited_selection_bounds_none.html
diff --git a/third_party/WebKit/Source/web/tests/data/composited_selection_bounds_none_readonly_caret.html b/third_party/WebKit/Source/core/testing/data/composited_selection_bounds_none_readonly_caret.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/composited_selection_bounds_none_readonly_caret.html rename to third_party/WebKit/Source/core/testing/data/composited_selection_bounds_none_readonly_caret.html
diff --git a/third_party/WebKit/Source/web/tests/data/composited_selection_bounds_split_layer.html b/third_party/WebKit/Source/core/testing/data/composited_selection_bounds_split_layer.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/composited_selection_bounds_split_layer.html rename to third_party/WebKit/Source/core/testing/data/composited_selection_bounds_split_layer.html
diff --git a/third_party/WebKit/Source/web/tests/data/composited_selection_bounds_transformed.html b/third_party/WebKit/Source/core/testing/data/composited_selection_bounds_transformed.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/composited_selection_bounds_transformed.html rename to third_party/WebKit/Source/core/testing/data/composited_selection_bounds_transformed.html
diff --git a/third_party/WebKit/Source/web/tests/data/composited_selection_bounds_vertical_lr.html b/third_party/WebKit/Source/core/testing/data/composited_selection_bounds_vertical_lr.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/composited_selection_bounds_vertical_lr.html rename to third_party/WebKit/Source/core/testing/data/composited_selection_bounds_vertical_lr.html
diff --git a/third_party/WebKit/Source/web/tests/data/composited_selection_bounds_vertical_rl.html b/third_party/WebKit/Source/core/testing/data/composited_selection_bounds_vertical_rl.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/composited_selection_bounds_vertical_rl.html rename to third_party/WebKit/Source/core/testing/data/composited_selection_bounds_vertical_rl.html
diff --git a/third_party/WebKit/Source/web/tests/data/composition_not_cancelled_by_backspace.html b/third_party/WebKit/Source/core/testing/data/composition_not_cancelled_by_backspace.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/composition_not_cancelled_by_backspace.html rename to third_party/WebKit/Source/core/testing/data/composition_not_cancelled_by_backspace.html
diff --git a/third_party/WebKit/Source/web/tests/data/compositor-proxy-basic-disconnected.html b/third_party/WebKit/Source/core/testing/data/compositor-proxy-basic-disconnected.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/compositor-proxy-basic-disconnected.html rename to third_party/WebKit/Source/core/testing/data/compositor-proxy-basic-disconnected.html
diff --git a/third_party/WebKit/Source/web/tests/data/compositor-proxy-plumbing-no-proxies.html b/third_party/WebKit/Source/core/testing/data/compositor-proxy-plumbing-no-proxies.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/compositor-proxy-plumbing-no-proxies.html rename to third_party/WebKit/Source/core/testing/data/compositor-proxy-plumbing-no-proxies.html
diff --git a/third_party/WebKit/Source/web/tests/data/compositor-worker-basic.html b/third_party/WebKit/Source/core/testing/data/compositor-worker-basic.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/compositor-worker-basic.html rename to third_party/WebKit/Source/core/testing/data/compositor-worker-basic.html
diff --git a/third_party/WebKit/Source/web/tests/data/content-editable-image-maps.html b/third_party/WebKit/Source/core/testing/data/content-editable-image-maps.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/content-editable-image-maps.html rename to third_party/WebKit/Source/core/testing/data/content-editable-image-maps.html
diff --git a/third_party/WebKit/Source/web/tests/data/content-width-1000-min-scale.html b/third_party/WebKit/Source/core/testing/data/content-width-1000-min-scale.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/content-width-1000-min-scale.html rename to third_party/WebKit/Source/core/testing/data/content-width-1000-min-scale.html
diff --git a/third_party/WebKit/Source/web/tests/data/content-width-1000.html b/third_party/WebKit/Source/core/testing/data/content-width-1000.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/content-width-1000.html rename to third_party/WebKit/Source/core/testing/data/content-width-1000.html
diff --git a/third_party/WebKit/Source/web/tests/data/content_editable_populated.html b/third_party/WebKit/Source/core/testing/data/content_editable_populated.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/content_editable_populated.html rename to third_party/WebKit/Source/core/testing/data/content_editable_populated.html
diff --git a/third_party/WebKit/Source/web/tests/data/content_editable_rich_text.html b/third_party/WebKit/Source/core/testing/data/content_editable_rich_text.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/content_editable_rich_text.html rename to third_party/WebKit/Source/core/testing/data/content_editable_rich_text.html
diff --git a/third_party/WebKit/Source/web/tests/data/context_notifications_test.html b/third_party/WebKit/Source/core/testing/data/context_notifications_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/context_notifications_test.html rename to third_party/WebKit/Source/core/testing/data/context_notifications_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/context_notifications_test_frame.html b/third_party/WebKit/Source/core/testing/data/context_notifications_test_frame.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/context_notifications_test_frame.html rename to third_party/WebKit/Source/core/testing/data/context_notifications_test_frame.html
diff --git a/third_party/WebKit/Source/web/tests/data/create_child_frame_fail.html b/third_party/WebKit/Source/core/testing/data/create_child_frame_fail.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/create_child_frame_fail.html rename to third_party/WebKit/Source/core/testing/data/create_child_frame_fail.html
diff --git a/third_party/WebKit/Source/web/tests/data/ctrl_click.html b/third_party/WebKit/Source/core/testing/data/ctrl_click.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/ctrl_click.html rename to third_party/WebKit/Source/core/testing/data/ctrl_click.html
diff --git a/third_party/WebKit/Source/web/tests/data/custom-scrollbar-dcheck-failed-when-paint-scroll-corner.html b/third_party/WebKit/Source/core/testing/data/custom-scrollbar-dcheck-failed-when-paint-scroll-corner.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/custom-scrollbar-dcheck-failed-when-paint-scroll-corner.html rename to third_party/WebKit/Source/core/testing/data/custom-scrollbar-dcheck-failed-when-paint-scroll-corner.html
diff --git a/third_party/WebKit/Source/web/tests/data/custom-scrollbar-hover.html b/third_party/WebKit/Source/core/testing/data/custom-scrollbar-hover.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/custom-scrollbar-hover.html rename to third_party/WebKit/Source/core/testing/data/custom-scrollbar-hover.html
diff --git a/third_party/WebKit/Source/web/tests/data/custom_scrollbar.html b/third_party/WebKit/Source/core/testing/data/custom_scrollbar.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/custom_scrollbar.html rename to third_party/WebKit/Source/core/testing/data/custom_scrollbar.html
diff --git a/third_party/WebKit/Source/web/tests/data/date_time_chooser.html b/third_party/WebKit/Source/core/testing/data/date_time_chooser.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/date_time_chooser.html rename to third_party/WebKit/Source/core/testing/data/date_time_chooser.html
diff --git a/third_party/WebKit/Source/web/tests/data/device_emulation.html b/third_party/WebKit/Source/core/testing/data/device_emulation.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/device_emulation.html rename to third_party/WebKit/Source/core/testing/data/device_emulation.html
diff --git a/third_party/WebKit/Source/web/tests/data/device_media_queries.html b/third_party/WebKit/Source/core/testing/data/device_media_queries.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/device_media_queries.html rename to third_party/WebKit/Source/core/testing/data/device_media_queries.html
diff --git a/third_party/WebKit/Source/web/tests/data/disambiguation_popup.html b/third_party/WebKit/Source/core/testing/data/disambiguation_popup.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/disambiguation_popup.html rename to third_party/WebKit/Source/core/testing/data/disambiguation_popup.html
diff --git a/third_party/WebKit/Source/web/tests/data/disambiguation_popup_200_by_800.html b/third_party/WebKit/Source/core/testing/data/disambiguation_popup_200_by_800.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/disambiguation_popup_200_by_800.html rename to third_party/WebKit/Source/core/testing/data/disambiguation_popup_200_by_800.html
diff --git a/third_party/WebKit/Source/web/tests/data/disambiguation_popup_blacklist.html b/third_party/WebKit/Source/core/testing/data/disambiguation_popup_blacklist.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/disambiguation_popup_blacklist.html rename to third_party/WebKit/Source/core/testing/data/disambiguation_popup_blacklist.html
diff --git a/third_party/WebKit/Source/web/tests/data/disambiguation_popup_mobile_site.html b/third_party/WebKit/Source/core/testing/data/disambiguation_popup_mobile_site.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/disambiguation_popup_mobile_site.html rename to third_party/WebKit/Source/core/testing/data/disambiguation_popup_mobile_site.html
diff --git a/third_party/WebKit/Source/web/tests/data/disambiguation_popup_no_container.html b/third_party/WebKit/Source/core/testing/data/disambiguation_popup_no_container.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/disambiguation_popup_no_container.html rename to third_party/WebKit/Source/core/testing/data/disambiguation_popup_no_container.html
diff --git a/third_party/WebKit/Source/web/tests/data/disambiguation_popup_page_scale.html b/third_party/WebKit/Source/core/testing/data/disambiguation_popup_page_scale.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/disambiguation_popup_page_scale.html rename to third_party/WebKit/Source/core/testing/data/disambiguation_popup_page_scale.html
diff --git a/third_party/WebKit/Source/web/tests/data/disambiguation_popup_viewport_site.html b/third_party/WebKit/Source/core/testing/data/disambiguation_popup_viewport_site.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/disambiguation_popup_viewport_site.html rename to third_party/WebKit/Source/core/testing/data/disambiguation_popup_viewport_site.html
diff --git a/third_party/WebKit/Source/web/tests/data/display-none.html b/third_party/WebKit/Source/core/testing/data/display-none.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/display-none.html rename to third_party/WebKit/Source/core/testing/data/display-none.html
diff --git a/third_party/WebKit/Source/web/tests/data/display_mode.html b/third_party/WebKit/Source/core/testing/data/display_mode.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/display_mode.html rename to third_party/WebKit/Source/core/testing/data/display_mode.html
diff --git a/third_party/WebKit/Source/web/tests/data/div_with_image.html b/third_party/WebKit/Source/core/testing/data/div_with_image.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/div_with_image.html rename to third_party/WebKit/Source/core/testing/data/div_with_image.html
diff --git a/third_party/WebKit/Source/web/tests/data/domfocusout_domfocusin_events.html b/third_party/WebKit/Source/core/testing/data/domfocusout_domfocusin_events.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/domfocusout_domfocusin_events.html rename to third_party/WebKit/Source/core/testing/data/domfocusout_domfocusin_events.html
diff --git a/third_party/WebKit/Source/web/tests/data/editable_elements.html b/third_party/WebKit/Source/core/testing/data/editable_elements.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/editable_elements.html rename to third_party/WebKit/Source/core/testing/data/editable_elements.html
diff --git a/third_party/WebKit/Source/web/tests/data/email-form.html b/third_party/WebKit/Source/core/testing/data/email-form.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/email-form.html rename to third_party/WebKit/Source/core/testing/data/email-form.html
diff --git a/third_party/WebKit/Source/web/tests/data/fallback.html b/third_party/WebKit/Source/core/testing/data/fallback.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/fallback.html rename to third_party/WebKit/Source/core/testing/data/fallback.html
diff --git a/third_party/WebKit/Source/web/tests/data/find.html b/third_party/WebKit/Source/core/testing/data/find.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/find.html rename to third_party/WebKit/Source/core/testing/data/find.html
diff --git a/third_party/WebKit/Source/web/tests/data/find_in_generated_frame.html b/third_party/WebKit/Source/core/testing/data/find_in_generated_frame.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/find_in_generated_frame.html rename to third_party/WebKit/Source/core/testing/data/find_in_generated_frame.html
diff --git a/third_party/WebKit/Source/web/tests/data/find_in_page.html b/third_party/WebKit/Source/core/testing/data/find_in_page.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/find_in_page.html rename to third_party/WebKit/Source/core/testing/data/find_in_page.html
diff --git a/third_party/WebKit/Source/web/tests/data/find_in_page_frame.html b/third_party/WebKit/Source/core/testing/data/find_in_page_frame.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/find_in_page_frame.html rename to third_party/WebKit/Source/core/testing/data/find_in_page_frame.html
diff --git a/third_party/WebKit/Source/web/tests/data/find_match_count.html b/third_party/WebKit/Source/core/testing/data/find_match_count.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/find_match_count.html rename to third_party/WebKit/Source/core/testing/data/find_match_count.html
diff --git a/third_party/WebKit/Source/web/tests/data/first_party.html b/third_party/WebKit/Source/core/testing/data/first_party.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/first_party.html rename to third_party/WebKit/Source/core/testing/data/first_party.html
diff --git a/third_party/WebKit/Source/web/tests/data/first_party/empty.html b/third_party/WebKit/Source/core/testing/data/first_party/empty.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/first_party/empty.html rename to third_party/WebKit/Source/core/testing/data/first_party/empty.html
diff --git a/third_party/WebKit/Source/web/tests/data/first_party/nested-data.html b/third_party/WebKit/Source/core/testing/data/first_party/nested-data.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/first_party/nested-data.html rename to third_party/WebKit/Source/core/testing/data/first_party/nested-data.html
diff --git a/third_party/WebKit/Source/web/tests/data/first_party/nested-originA-in-originA.html b/third_party/WebKit/Source/core/testing/data/first_party/nested-originA-in-originA.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/first_party/nested-originA-in-originA.html rename to third_party/WebKit/Source/core/testing/data/first_party/nested-originA-in-originA.html
diff --git a/third_party/WebKit/Source/web/tests/data/first_party/nested-originA-in-originB.html b/third_party/WebKit/Source/core/testing/data/first_party/nested-originA-in-originB.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/first_party/nested-originA-in-originB.html rename to third_party/WebKit/Source/core/testing/data/first_party/nested-originA-in-originB.html
diff --git a/third_party/WebKit/Source/web/tests/data/first_party/nested-originA.html b/third_party/WebKit/Source/core/testing/data/first_party/nested-originA.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/first_party/nested-originA.html rename to third_party/WebKit/Source/core/testing/data/first_party/nested-originA.html
diff --git a/third_party/WebKit/Source/web/tests/data/first_party/nested-originB-in-originA.html b/third_party/WebKit/Source/core/testing/data/first_party/nested-originB-in-originA.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/first_party/nested-originB-in-originA.html rename to third_party/WebKit/Source/core/testing/data/first_party/nested-originB-in-originA.html
diff --git a/third_party/WebKit/Source/web/tests/data/first_party/nested-originB-in-originB.html b/third_party/WebKit/Source/core/testing/data/first_party/nested-originB-in-originB.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/first_party/nested-originB-in-originB.html rename to third_party/WebKit/Source/core/testing/data/first_party/nested-originB-in-originB.html
diff --git a/third_party/WebKit/Source/web/tests/data/first_party/nested-originB.html b/third_party/WebKit/Source/core/testing/data/first_party/nested-originB.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/first_party/nested-originB.html rename to third_party/WebKit/Source/core/testing/data/first_party/nested-originB.html
diff --git a/third_party/WebKit/Source/web/tests/data/first_party/nested-originSecureA.html b/third_party/WebKit/Source/core/testing/data/first_party/nested-originSecureA.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/first_party/nested-originSecureA.html rename to third_party/WebKit/Source/core/testing/data/first_party/nested-originSecureA.html
diff --git a/third_party/WebKit/Source/web/tests/data/first_party/nested-originSubA.html b/third_party/WebKit/Source/core/testing/data/first_party/nested-originSubA.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/first_party/nested-originSubA.html rename to third_party/WebKit/Source/core/testing/data/first_party/nested-originSubA.html
diff --git a/third_party/WebKit/Source/web/tests/data/first_party/nested-srcdoc.html b/third_party/WebKit/Source/core/testing/data/first_party/nested-srcdoc.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/first_party/nested-srcdoc.html rename to third_party/WebKit/Source/core/testing/data/first_party/nested-srcdoc.html
diff --git a/third_party/WebKit/Source/web/tests/data/fixed-position-in-fixed-viewport.html b/third_party/WebKit/Source/core/testing/data/fixed-position-in-fixed-viewport.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/fixed-position-in-fixed-viewport.html rename to third_party/WebKit/Source/core/testing/data/fixed-position-in-fixed-viewport.html
diff --git a/third_party/WebKit/Source/web/tests/data/fixed-position-losing-backing.html b/third_party/WebKit/Source/core/testing/data/fixed-position-losing-backing.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/fixed-position-losing-backing.html rename to third_party/WebKit/Source/core/testing/data/fixed-position-losing-backing.html
diff --git a/third_party/WebKit/Source/web/tests/data/fixed-position.html b/third_party/WebKit/Source/core/testing/data/fixed-position.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/fixed-position.html rename to third_party/WebKit/Source/core/testing/data/fixed-position.html
diff --git a/third_party/WebKit/Source/web/tests/data/fixed_layout.html b/third_party/WebKit/Source/core/testing/data/fixed_layout.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/fixed_layout.html rename to third_party/WebKit/Source/core/testing/data/fixed_layout.html
diff --git a/third_party/WebKit/Source/web/tests/data/focus_blur_events.html b/third_party/WebKit/Source/core/testing/data/focus_blur_events.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/focus_blur_events.html rename to third_party/WebKit/Source/core/testing/data/focus_blur_events.html
diff --git a/third_party/WebKit/Source/web/tests/data/focusout_focusin_events.html b/third_party/WebKit/Source/core/testing/data/focusout_focusin_events.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/focusout_focusin_events.html rename to third_party/WebKit/Source/core/testing/data/focusout_focusin_events.html
diff --git a/third_party/WebKit/Source/web/tests/data/foo.html b/third_party/WebKit/Source/core/testing/data/foo.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/foo.html rename to third_party/WebKit/Source/core/testing/data/foo.html
diff --git a/third_party/WebKit/Source/web/tests/data/foo_with_image.html b/third_party/WebKit/Source/core/testing/data/foo_with_image.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/foo_with_image.html rename to third_party/WebKit/Source/core/testing/data/foo_with_image.html
diff --git a/third_party/WebKit/Source/web/tests/data/form.html b/third_party/WebKit/Source/core/testing/data/form.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/form.html rename to third_party/WebKit/Source/core/testing/data/form.html
diff --git a/third_party/WebKit/Source/web/tests/data/form_with_input.html b/third_party/WebKit/Source/core/testing/data/form_with_input.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/form_with_input.html rename to third_party/WebKit/Source/core/testing/data/form_with_input.html
diff --git a/third_party/WebKit/Source/web/tests/data/fox-null-terminated.html b/third_party/WebKit/Source/core/testing/data/fox-null-terminated.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/fox-null-terminated.html rename to third_party/WebKit/Source/core/testing/data/fox-null-terminated.html Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/fractional-scroll-div.html b/third_party/WebKit/Source/core/testing/data/fractional-scroll-div.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/fractional-scroll-div.html rename to third_party/WebKit/Source/core/testing/data/fractional-scroll-div.html
diff --git a/third_party/WebKit/Source/web/tests/data/fractional-scroll-fixed-position.html b/third_party/WebKit/Source/core/testing/data/fractional-scroll-fixed-position.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/fractional-scroll-fixed-position.html rename to third_party/WebKit/Source/core/testing/data/fractional-scroll-fixed-position.html
diff --git a/third_party/WebKit/Source/web/tests/data/fragment_middle_click.html b/third_party/WebKit/Source/core/testing/data/fragment_middle_click.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/fragment_middle_click.html rename to third_party/WebKit/Source/core/testing/data/fragment_middle_click.html
diff --git a/third_party/WebKit/Source/web/tests/data/frame-a-b-c.html b/third_party/WebKit/Source/core/testing/data/frame-a-b-c.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frame-a-b-c.html rename to third_party/WebKit/Source/core/testing/data/frame-a-b-c.html
diff --git a/third_party/WebKit/Source/web/tests/data/frame.html b/third_party/WebKit/Source/core/testing/data/frame.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frame.html rename to third_party/WebKit/Source/core/testing/data/frame.html
diff --git a/third_party/WebKit/Source/web/tests/data/frame_owner_properties.html b/third_party/WebKit/Source/core/testing/data/frame_owner_properties.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frame_owner_properties.html rename to third_party/WebKit/Source/core/testing/data/frame_owner_properties.html
diff --git a/third_party/WebKit/Source/web/tests/data/frame_timing_1.html b/third_party/WebKit/Source/core/testing/data/frame_timing_1.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frame_timing_1.html rename to third_party/WebKit/Source/core/testing/data/frame_timing_1.html
diff --git a/third_party/WebKit/Source/web/tests/data/frame_timing_2.html b/third_party/WebKit/Source/core/testing/data/frame_timing_2.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frame_timing_2.html rename to third_party/WebKit/Source/core/testing/data/frame_timing_2.html
diff --git a/third_party/WebKit/Source/web/tests/data/frame_timing_3.html b/third_party/WebKit/Source/core/testing/data/frame_timing_3.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frame_timing_3.html rename to third_party/WebKit/Source/core/testing/data/frame_timing_3.html
diff --git a/third_party/WebKit/Source/web/tests/data/frame_timing_b.html b/third_party/WebKit/Source/core/testing/data/frame_timing_b.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frame_timing_b.html rename to third_party/WebKit/Source/core/testing/data/frame_timing_b.html
diff --git a/third_party/WebKit/Source/web/tests/data/frame_timing_inner.html b/third_party/WebKit/Source/core/testing/data/frame_timing_inner.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frame_timing_inner.html rename to third_party/WebKit/Source/core/testing/data/frame_timing_inner.html
diff --git a/third_party/WebKit/Source/web/tests/data/frame_with_frame.html b/third_party/WebKit/Source/core/testing/data/frame_with_frame.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frame_with_frame.html rename to third_party/WebKit/Source/core/testing/data/frame_with_frame.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/1x.png b/third_party/WebKit/Source/core/testing/data/frameserialization/1x.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/1x.png rename to third_party/WebKit/Source/core/testing/data/frameserialization/1x.png Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/2x.png b/third_party/WebKit/Source/core/testing/data/frameserialization/2x.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/2x.png rename to third_party/WebKit/Source/core/testing/data/frameserialization/2x.png Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/awesome.png b/third_party/WebKit/Source/core/testing/data/frameserialization/awesome.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/awesome.png rename to third_party/WebKit/Source/core/testing/data/frameserialization/awesome.png
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/beautifull.css b/third_party/WebKit/Source/core/testing/data/frameserialization/beautifull.css similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/beautifull.css rename to third_party/WebKit/Source/core/testing/data/frameserialization/beautifull.css
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/broken-image.png b/third_party/WebKit/Source/core/testing/data/frameserialization/broken-image.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/broken-image.png rename to third_party/WebKit/Source/core/testing/data/frameserialization/broken-image.png
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/embed_iframe.html b/third_party/WebKit/Source/core/testing/data/frameserialization/embed_iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/embed_iframe.html rename to third_party/WebKit/Source/core/testing/data/frameserialization/embed_iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/encoding_normalization.html b/third_party/WebKit/Source/core/testing/data/frameserialization/encoding_normalization.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/encoding_normalization.html rename to third_party/WebKit/Source/core/testing/data/frameserialization/encoding_normalization.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/form.html b/third_party/WebKit/Source/core/testing/data/frameserialization/form.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/form.html rename to third_party/WebKit/Source/core/testing/data/frameserialization/form.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/hidden_elements.html b/third_party/WebKit/Source/core/testing/data/frameserialization/hidden_elements.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/hidden_elements.html rename to third_party/WebKit/Source/core/testing/data/frameserialization/hidden_elements.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/img_srcset.html b/third_party/WebKit/Source/core/testing/data/frameserialization/img_srcset.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/img_srcset.html rename to third_party/WebKit/Source/core/testing/data/frameserialization/img_srcset.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/object_iframe.html b/third_party/WebKit/Source/core/testing/data/frameserialization/object_iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/object_iframe.html rename to third_party/WebKit/Source/core/testing/data/frameserialization/object_iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/popup.html b/third_party/WebKit/Source/core/testing/data/frameserialization/popup.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/popup.html rename to third_party/WebKit/Source/core/testing/data/frameserialization/popup.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/remove_attributes.html b/third_party/WebKit/Source/core/testing/data/frameserialization/remove_attributes.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/remove_attributes.html rename to third_party/WebKit/Source/core/testing/data/frameserialization/remove_attributes.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/remove_elements.html b/third_party/WebKit/Source/core/testing/data/frameserialization/remove_elements.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/remove_elements.html rename to third_party/WebKit/Source/core/testing/data/frameserialization/remove_elements.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/script_in_attributes.html b/third_party/WebKit/Source/core/testing/data/frameserialization/script_in_attributes.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/script_in_attributes.html rename to third_party/WebKit/Source/core/testing/data/frameserialization/script_in_attributes.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/shadow_dom.html b/third_party/WebKit/Source/core/testing/data/frameserialization/shadow_dom.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/shadow_dom.html rename to third_party/WebKit/Source/core/testing/data/frameserialization/shadow_dom.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/simple_iframe.html b/third_party/WebKit/Source/core/testing/data/frameserialization/simple_iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/simple_iframe.html rename to third_party/WebKit/Source/core/testing/data/frameserialization/simple_iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/simple_page.html b/third_party/WebKit/Source/core/testing/data/frameserialization/simple_page.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/simple_page.html rename to third_party/WebKit/Source/core/testing/data/frameserialization/simple_page.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/text_only_page.html b/third_party/WebKit/Source/core/testing/data/frameserialization/text_only_page.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/text_only_page.html rename to third_party/WebKit/Source/core/testing/data/frameserialization/text_only_page.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/top_frame.html b/third_party/WebKit/Source/core/testing/data/frameserialization/top_frame.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/top_frame.html rename to third_party/WebKit/Source/core/testing/data/frameserialization/top_frame.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserialization/url_attribute_values.html b/third_party/WebKit/Source/core/testing/data/frameserialization/url_attribute_values.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserialization/url_attribute_values.html rename to third_party/WebKit/Source/core/testing/data/frameserialization/url_attribute_values.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/css/css_test_page.html b/third_party/WebKit/Source/core/testing/data/frameserializer/css/css_test_page.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/css/css_test_page.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/css/css_test_page.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/css/encoding.css b/third_party/WebKit/Source/core/testing/data/frameserializer/css/encoding.css similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/css/encoding.css rename to third_party/WebKit/Source/core/testing/data/frameserializer/css/encoding.css
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/css/image.png b/third_party/WebKit/Source/core/testing/data/frameserializer/css/image.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/css/image.png rename to third_party/WebKit/Source/core/testing/data/frameserializer/css/image.png Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/css/import.html b/third_party/WebKit/Source/core/testing/data/frameserializer/css/import.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/css/import.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/css/import.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/css/import/absolute/green-header.css b/third_party/WebKit/Source/core/testing/data/frameserializer/css/import/absolute/green-header.css similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/css/import/absolute/green-header.css rename to third_party/WebKit/Source/core/testing/data/frameserializer/css/import/absolute/green-header.css
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/css/import/base.css b/third_party/WebKit/Source/core/testing/data/frameserializer/css/import/base.css similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/css/import/base.css rename to third_party/WebKit/Source/core/testing/data/frameserializer/css/import/base.css
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/css/import/relative/red-background.css b/third_party/WebKit/Source/core/testing/data/frameserializer/css/import/relative/red-background.css similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/css/import/relative/red-background.css rename to third_party/WebKit/Source/core/testing/data/frameserializer/css/import/relative/red-background.css
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/css/import_style_from_link.css b/third_party/WebKit/Source/core/testing/data/frameserializer/css/import_style_from_link.css similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/css/import_style_from_link.css rename to third_party/WebKit/Source/core/testing/data/frameserializer/css/import_style_from_link.css
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/css/import_styles.css b/third_party/WebKit/Source/core/testing/data/frameserializer/css/import_styles.css similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/css/import_styles.css rename to third_party/WebKit/Source/core/testing/data/frameserializer/css/import_styles.css
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/css/included_in_another_frame.css b/third_party/WebKit/Source/core/testing/data/frameserializer/css/included_in_another_frame.css similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/css/included_in_another_frame.css rename to third_party/WebKit/Source/core/testing/data/frameserializer/css/included_in_another_frame.css
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/css/link_styles.css b/third_party/WebKit/Source/core/testing/data/frameserializer/css/link_styles.css similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/css/link_styles.css rename to third_party/WebKit/Source/core/testing/data/frameserializer/css/link_styles.css
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/datauri/page_with_data.html b/third_party/WebKit/Source/core/testing/data/frameserializer/datauri/page_with_data.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/datauri/page_with_data.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/datauri/page_with_data.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/datauri/page_with_morphing_data.html b/third_party/WebKit/Source/core/testing/data/frameserializer/datauri/page_with_morphing_data.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/datauri/page_with_morphing_data.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/datauri/page_with_morphing_data.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/dtd/html5.html b/third_party/WebKit/Source/core/testing/data/frameserializer/dtd/html5.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/dtd/html5.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/dtd/html5.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/elements/elements.html b/third_party/WebKit/Source/core/testing/data/frameserializer/elements/elements.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/elements/elements.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/elements/elements.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/elements/empty.txt b/third_party/WebKit/Source/core/testing/data/frameserializer/elements/empty.txt similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/elements/empty.txt rename to third_party/WebKit/Source/core/testing/data/frameserializer/elements/empty.txt
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/elements/image.png b/third_party/WebKit/Source/core/testing/data/frameserializer/elements/image.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/elements/image.png rename to third_party/WebKit/Source/core/testing/data/frameserializer/elements/image.png Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/elements/style.css b/third_party/WebKit/Source/core/testing/data/frameserializer/elements/style.css similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/elements/style.css rename to third_party/WebKit/Source/core/testing/data/frameserializer/elements/style.css
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/font/font.html b/third_party/WebKit/Source/core/testing/data/frameserializer/font/font.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/font/font.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/font/font.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/font/font.ttf b/third_party/WebKit/Source/core/testing/data/frameserializer/font/font.ttf similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/font/font.ttf rename to third_party/WebKit/Source/core/testing/data/frameserializer/font/font.ttf Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/frames/blank_frames.html b/third_party/WebKit/Source/core/testing/data/frameserializer/frames/blank_frames.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/frames/blank_frames.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/frames/blank_frames.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/frames/embed_iframe.html b/third_party/WebKit/Source/core/testing/data/frameserializer/frames/embed_iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/frames/embed_iframe.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/frames/embed_iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/frames/encoded_iframe.html b/third_party/WebKit/Source/core/testing/data/frameserializer/frames/encoded_iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/frames/encoded_iframe.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/frames/encoded_iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/frames/image.png b/third_party/WebKit/Source/core/testing/data/frameserializer/frames/image.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/frames/image.png rename to third_party/WebKit/Source/core/testing/data/frameserializer/frames/image.png Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/frames/object_iframe.html b/third_party/WebKit/Source/core/testing/data/frameserializer/frames/object_iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/frames/object_iframe.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/frames/object_iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/frames/simple_frames.html b/third_party/WebKit/Source/core/testing/data/frameserializer/frames/simple_frames.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/frames/simple_frames.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/frames/simple_frames.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/frames/simple_frames_1.html b/third_party/WebKit/Source/core/testing/data/frameserializer/frames/simple_frames_1.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/frames/simple_frames_1.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/frames/simple_frames_1.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/frames/simple_frames_3.html b/third_party/WebKit/Source/core/testing/data/frameserializer/frames/simple_frames_3.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/frames/simple_frames_3.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/frames/simple_frames_3.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/frames/simple_frames_top.html b/third_party/WebKit/Source/core/testing/data/frameserializer/frames/simple_frames_top.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/frames/simple_frames_top.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/frames/simple_frames_top.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/frames/simple_iframe.html b/third_party/WebKit/Source/core/testing/data/frameserializer/frames/simple_iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/frames/simple_iframe.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/frames/simple_iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/frames/top_frame.html b/third_party/WebKit/Source/core/testing/data/frameserializer/frames/top_frame.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/frames/top_frame.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/frames/top_frame.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/image/error_image.png b/third_party/WebKit/Source/core/testing/data/frameserializer/image/error_image.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/image/error_image.png rename to third_party/WebKit/Source/core/testing/data/frameserializer/image/error_image.png Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/image/page_with_img_error.html b/third_party/WebKit/Source/core/testing/data/frameserializer/image/page_with_img_error.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/image/page_with_img_error.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/image/page_with_img_error.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/namespace/namespace_element.html b/third_party/WebKit/Source/core/testing/data/frameserializer/namespace/namespace_element.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/namespace/namespace_element.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/namespace/namespace_element.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/rewritelinks/image.png b/third_party/WebKit/Source/core/testing/data/frameserializer/rewritelinks/image.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/rewritelinks/image.png rename to third_party/WebKit/Source/core/testing/data/frameserializer/rewritelinks/image.png Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/rewritelinks/rewritelinks_simple.html b/third_party/WebKit/Source/core/testing/data/frameserializer/rewritelinks/rewritelinks_simple.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/rewritelinks/rewritelinks_simple.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/rewritelinks/rewritelinks_simple.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/svg/green_rectangle.svg b/third_party/WebKit/Source/core/testing/data/frameserializer/svg/green_rectangle.svg similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/svg/green_rectangle.svg rename to third_party/WebKit/Source/core/testing/data/frameserializer/svg/green_rectangle.svg
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/svg/page_with_svg_image.html b/third_party/WebKit/Source/core/testing/data/frameserializer/svg/page_with_svg_image.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/svg/page_with_svg_image.html rename to third_party/WebKit/Source/core/testing/data/frameserializer/svg/page_with_svg_image.html
diff --git a/third_party/WebKit/Source/web/tests/data/frameserializer/xml/xmldecl.xml b/third_party/WebKit/Source/core/testing/data/frameserializer/xml/xmldecl.xml similarity index 100% rename from third_party/WebKit/Source/web/tests/data/frameserializer/xml/xmldecl.xml rename to third_party/WebKit/Source/core/testing/data/frameserializer/xml/xmldecl.xml
diff --git a/third_party/WebKit/Source/web/tests/data/fullscreen_div.html b/third_party/WebKit/Source/core/testing/data/fullscreen_div.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/fullscreen_div.html rename to third_party/WebKit/Source/core/testing/data/fullscreen_div.html
diff --git a/third_party/WebKit/Source/web/tests/data/fullscreen_iframe.html b/third_party/WebKit/Source/core/testing/data/fullscreen_iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/fullscreen_iframe.html rename to third_party/WebKit/Source/core/testing/data/fullscreen_iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/fullscreen_restore_scale_factor.html b/third_party/WebKit/Source/core/testing/data/fullscreen_restore_scale_factor.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/fullscreen_restore_scale_factor.html rename to third_party/WebKit/Source/core/testing/data/fullscreen_restore_scale_factor.html
diff --git a/third_party/WebKit/Source/web/tests/data/fullscreen_style.html b/third_party/WebKit/Source/core/testing/data/fullscreen_style.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/fullscreen_style.html rename to third_party/WebKit/Source/core/testing/data/fullscreen_style.html
diff --git a/third_party/WebKit/Source/web/tests/data/fullscreen_video.html b/third_party/WebKit/Source/core/testing/data/fullscreen_video.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/fullscreen_video.html rename to third_party/WebKit/Source/core/testing/data/fullscreen_video.html
diff --git a/third_party/WebKit/Source/web/tests/data/get_multiple_divs_for_auto_zoom_test.html b/third_party/WebKit/Source/core/testing/data/get_multiple_divs_for_auto_zoom_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/get_multiple_divs_for_auto_zoom_test.html rename to third_party/WebKit/Source/core/testing/data/get_multiple_divs_for_auto_zoom_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/get_scale_bounds_check_for_auto_zoom_test.html b/third_party/WebKit/Source/core/testing/data/get_scale_bounds_check_for_auto_zoom_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/get_scale_bounds_check_for_auto_zoom_test.html rename to third_party/WebKit/Source/core/testing/data/get_scale_bounds_check_for_auto_zoom_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/get_scale_for_auto_zoom_into_div_test.html b/third_party/WebKit/Source/core/testing/data/get_scale_for_auto_zoom_into_div_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/get_scale_for_auto_zoom_into_div_test.html rename to third_party/WebKit/Source/core/testing/data/get_scale_for_auto_zoom_into_div_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/get_scale_for_zoom_into_editable_test.html b/third_party/WebKit/Source/core/testing/data/get_scale_for_zoom_into_editable_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/get_scale_for_zoom_into_editable_test.html rename to third_party/WebKit/Source/core/testing/data/get_scale_for_zoom_into_editable_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/get_wide_div_for_auto_zoom_test.html b/third_party/WebKit/Source/core/testing/data/get_wide_div_for_auto_zoom_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/get_wide_div_for_auto_zoom_test.html rename to third_party/WebKit/Source/core/testing/data/get_wide_div_for_auto_zoom_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/has-non-layer-viewport-constrained-objects.html b/third_party/WebKit/Source/core/testing/data/has-non-layer-viewport-constrained-objects.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/has-non-layer-viewport-constrained-objects.html rename to third_party/WebKit/Source/core/testing/data/has-non-layer-viewport-constrained-objects.html
diff --git a/third_party/WebKit/Source/web/tests/data/has_touch_event_handlers.html b/third_party/WebKit/Source/core/testing/data/has_touch_event_handlers.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/has_touch_event_handlers.html rename to third_party/WebKit/Source/core/testing/data/has_touch_event_handlers.html
diff --git a/third_party/WebKit/Source/web/tests/data/hello_world.html b/third_party/WebKit/Source/core/testing/data/hello_world.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/hello_world.html rename to third_party/WebKit/Source/core/testing/data/hello_world.html
diff --git a/third_party/WebKit/Source/web/tests/data/hidden_frames.html b/third_party/WebKit/Source/core/testing/data/hidden_frames.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/hidden_frames.html rename to third_party/WebKit/Source/core/testing/data/hidden_frames.html
diff --git a/third_party/WebKit/Source/web/tests/data/history.html b/third_party/WebKit/Source/core/testing/data/history.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/history.html rename to third_party/WebKit/Source/core/testing/data/history.html
diff --git a/third_party/WebKit/Source/web/tests/data/hit-test.html b/third_party/WebKit/Source/core/testing/data/hit-test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/hit-test.html rename to third_party/WebKit/Source/core/testing/data/hit-test.html
diff --git a/third_party/WebKit/Source/web/tests/data/hit_test.html b/third_party/WebKit/Source/core/testing/data/hit_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/hit_test.html rename to third_party/WebKit/Source/core/testing/data/hit_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/hover-root-scrollbar.html b/third_party/WebKit/Source/core/testing/data/hover-root-scrollbar.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/hover-root-scrollbar.html rename to third_party/WebKit/Source/core/testing/data/hover-root-scrollbar.html
diff --git a/third_party/WebKit/Source/web/tests/data/icb-relative-content.html b/third_party/WebKit/Source/core/testing/data/icb-relative-content.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/icb-relative-content.html rename to third_party/WebKit/Source/core/testing/data/icb-relative-content.html
diff --git a/third_party/WebKit/Source/web/tests/data/iframe-background-attachment-fixed-inner.html b/third_party/WebKit/Source/core/testing/data/iframe-background-attachment-fixed-inner.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/iframe-background-attachment-fixed-inner.html rename to third_party/WebKit/Source/core/testing/data/iframe-background-attachment-fixed-inner.html
diff --git a/third_party/WebKit/Source/web/tests/data/iframe-background-attachment-fixed.html b/third_party/WebKit/Source/core/testing/data/iframe-background-attachment-fixed.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/iframe-background-attachment-fixed.html rename to third_party/WebKit/Source/core/testing/data/iframe-background-attachment-fixed.html
diff --git a/third_party/WebKit/Source/web/tests/data/iframe-scrolling-inner.html b/third_party/WebKit/Source/core/testing/data/iframe-scrolling-inner.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/iframe-scrolling-inner.html rename to third_party/WebKit/Source/core/testing/data/iframe-scrolling-inner.html
diff --git a/third_party/WebKit/Source/web/tests/data/iframe-scrolling.html b/third_party/WebKit/Source/core/testing/data/iframe-scrolling.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/iframe-scrolling.html rename to third_party/WebKit/Source/core/testing/data/iframe-scrolling.html
diff --git a/third_party/WebKit/Source/web/tests/data/iframe_clear_focused_node_test.html b/third_party/WebKit/Source/core/testing/data/iframe_clear_focused_node_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/iframe_clear_focused_node_test.html rename to third_party/WebKit/Source/core/testing/data/iframe_clear_focused_node_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/iframe_pdf.html b/third_party/WebKit/Source/core/testing/data/iframe_pdf.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/iframe_pdf.html rename to third_party/WebKit/Source/core/testing/data/iframe_pdf.html
diff --git a/third_party/WebKit/Source/web/tests/data/iframe_redirect.html b/third_party/WebKit/Source/core/testing/data/iframe_redirect.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/iframe_redirect.html rename to third_party/WebKit/Source/core/testing/data/iframe_redirect.html
diff --git a/third_party/WebKit/Source/web/tests/data/iframe_reload.html b/third_party/WebKit/Source/core/testing/data/iframe_reload.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/iframe_reload.html rename to third_party/WebKit/Source/core/testing/data/iframe_reload.html
diff --git a/third_party/WebKit/Source/web/tests/data/iframes_test.html b/third_party/WebKit/Source/core/testing/data/iframes_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/iframes_test.html rename to third_party/WebKit/Source/core/testing/data/iframes_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/image-broken.html b/third_party/WebKit/Source/core/testing/data/image-broken.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/image-broken.html rename to third_party/WebKit/Source/core/testing/data/image-broken.html
diff --git a/third_party/WebKit/Source/web/tests/data/image-map.html b/third_party/WebKit/Source/core/testing/data/image-map.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/image-map.html rename to third_party/WebKit/Source/core/testing/data/image-map.html
diff --git a/third_party/WebKit/Source/web/tests/data/image-with-data-url.html b/third_party/WebKit/Source/core/testing/data/image-with-data-url.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/image-with-data-url.html rename to third_party/WebKit/Source/core/testing/data/image-with-data-url.html
diff --git a/third_party/WebKit/Source/web/tests/data/image_slow.pl b/third_party/WebKit/Source/core/testing/data/image_slow.pl similarity index 100% rename from third_party/WebKit/Source/web/tests/data/image_slow.pl rename to third_party/WebKit/Source/core/testing/data/image_slow.pl
diff --git a/third_party/WebKit/Source/web/tests/data/image_slow_out_of_viewport.pl b/third_party/WebKit/Source/core/testing/data/image_slow_out_of_viewport.pl similarity index 100% rename from third_party/WebKit/Source/web/tests/data/image_slow_out_of_viewport.pl rename to third_party/WebKit/Source/core/testing/data/image_slow_out_of_viewport.pl
diff --git a/third_party/WebKit/Source/web/tests/data/ime-on-focus-after-first-gesture.html b/third_party/WebKit/Source/core/testing/data/ime-on-focus-after-first-gesture.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/ime-on-focus-after-first-gesture.html rename to third_party/WebKit/Source/core/testing/data/ime-on-focus-after-first-gesture.html
diff --git a/third_party/WebKit/Source/web/tests/data/ime-on-focus-after-frame-load-on-gesture.html b/third_party/WebKit/Source/core/testing/data/ime-on-focus-after-frame-load-on-gesture.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/ime-on-focus-after-frame-load-on-gesture.html rename to third_party/WebKit/Source/core/testing/data/ime-on-focus-after-frame-load-on-gesture.html
diff --git a/third_party/WebKit/Source/web/tests/data/ime-on-focus-after-navigation-within-page.html b/third_party/WebKit/Source/core/testing/data/ime-on-focus-after-navigation-within-page.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/ime-on-focus-after-navigation-within-page.html rename to third_party/WebKit/Source/core/testing/data/ime-on-focus-after-navigation-within-page.html
diff --git a/third_party/WebKit/Source/web/tests/data/ime-on-focus-on-autofocus.html b/third_party/WebKit/Source/core/testing/data/ime-on-focus-on-autofocus.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/ime-on-focus-on-autofocus.html rename to third_party/WebKit/Source/core/testing/data/ime-on-focus-on-autofocus.html
diff --git a/third_party/WebKit/Source/web/tests/data/ime-on-focus-on-load.html b/third_party/WebKit/Source/core/testing/data/ime-on-focus-on-load.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/ime-on-focus-on-load.html rename to third_party/WebKit/Source/core/testing/data/ime-on-focus-on-load.html
diff --git a/third_party/WebKit/Source/web/tests/data/ime-on-focus-on-user-gesture.html b/third_party/WebKit/Source/core/testing/data/ime-on-focus-on-user-gesture.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/ime-on-focus-on-user-gesture.html rename to third_party/WebKit/Source/core/testing/data/ime-on-focus-on-user-gesture.html
diff --git a/third_party/WebKit/Source/web/tests/data/input-image-broken.html b/third_party/WebKit/Source/core/testing/data/input-image-broken.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input-image-broken.html rename to third_party/WebKit/Source/core/testing/data/input-image-broken.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_field_default.html b/third_party/WebKit/Source/core/testing/data/input_field_default.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_field_default.html rename to third_party/WebKit/Source/core/testing/data/input_field_default.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_field_email.html b/third_party/WebKit/Source/core/testing/data/input_field_email.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_field_email.html rename to third_party/WebKit/Source/core/testing/data/input_field_email.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_field_number.html b/third_party/WebKit/Source/core/testing/data/input_field_number.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_field_number.html rename to third_party/WebKit/Source/core/testing/data/input_field_number.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_field_password.html b/third_party/WebKit/Source/core/testing/data/input_field_password.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_field_password.html rename to third_party/WebKit/Source/core/testing/data/input_field_password.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_field_populated.html b/third_party/WebKit/Source/core/testing/data/input_field_populated.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_field_populated.html rename to third_party/WebKit/Source/core/testing/data/input_field_populated.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_field_search.html b/third_party/WebKit/Source/core/testing/data/input_field_search.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_field_search.html rename to third_party/WebKit/Source/core/testing/data/input_field_search.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_field_tel.html b/third_party/WebKit/Source/core/testing/data/input_field_tel.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_field_tel.html rename to third_party/WebKit/Source/core/testing/data/input_field_tel.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_field_url.html b/third_party/WebKit/Source/core/testing/data/input_field_url.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_field_url.html rename to third_party/WebKit/Source/core/testing/data/input_field_url.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_default.html b/third_party/WebKit/Source/core/testing/data/input_mode_default.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_default.html rename to third_party/WebKit/Source/core/testing/data/input_mode_default.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_default_unknown.html b/third_party/WebKit/Source/core/testing/data/input_mode_default_unknown.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_default_unknown.html rename to third_party/WebKit/Source/core/testing/data/input_mode_default_unknown.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_default_verbatim.html b/third_party/WebKit/Source/core/testing/data/input_mode_default_verbatim.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_default_verbatim.html rename to third_party/WebKit/Source/core/testing/data/input_mode_default_verbatim.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_textarea_verbatim.html b/third_party/WebKit/Source/core/testing/data/input_mode_textarea_verbatim.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_textarea_verbatim.html rename to third_party/WebKit/Source/core/testing/data/input_mode_textarea_verbatim.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_type_email.html b/third_party/WebKit/Source/core/testing/data/input_mode_type_email.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_type_email.html rename to third_party/WebKit/Source/core/testing/data/input_mode_type_email.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_type_full_width_latin.html b/third_party/WebKit/Source/core/testing/data/input_mode_type_full_width_latin.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_type_full_width_latin.html rename to third_party/WebKit/Source/core/testing/data/input_mode_type_full_width_latin.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_type_kana.html b/third_party/WebKit/Source/core/testing/data/input_mode_type_kana.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_type_kana.html rename to third_party/WebKit/Source/core/testing/data/input_mode_type_kana.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_type_kana_name.html b/third_party/WebKit/Source/core/testing/data/input_mode_type_kana_name.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_type_kana_name.html rename to third_party/WebKit/Source/core/testing/data/input_mode_type_kana_name.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_type_kata_kana.html b/third_party/WebKit/Source/core/testing/data/input_mode_type_kata_kana.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_type_kata_kana.html rename to third_party/WebKit/Source/core/testing/data/input_mode_type_kata_kana.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_type_latin.html b/third_party/WebKit/Source/core/testing/data/input_mode_type_latin.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_type_latin.html rename to third_party/WebKit/Source/core/testing/data/input_mode_type_latin.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_type_latin_name.html b/third_party/WebKit/Source/core/testing/data/input_mode_type_latin_name.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_type_latin_name.html rename to third_party/WebKit/Source/core/testing/data/input_mode_type_latin_name.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_type_latin_prose.html b/third_party/WebKit/Source/core/testing/data/input_mode_type_latin_prose.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_type_latin_prose.html rename to third_party/WebKit/Source/core/testing/data/input_mode_type_latin_prose.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_type_numeric.html b/third_party/WebKit/Source/core/testing/data/input_mode_type_numeric.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_type_numeric.html rename to third_party/WebKit/Source/core/testing/data/input_mode_type_numeric.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_type_search_verbatim.html b/third_party/WebKit/Source/core/testing/data/input_mode_type_search_verbatim.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_type_search_verbatim.html rename to third_party/WebKit/Source/core/testing/data/input_mode_type_search_verbatim.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_type_tel.html b/third_party/WebKit/Source/core/testing/data/input_mode_type_tel.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_type_tel.html rename to third_party/WebKit/Source/core/testing/data/input_mode_type_tel.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_type_text_verbatim.html b/third_party/WebKit/Source/core/testing/data/input_mode_type_text_verbatim.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_type_text_verbatim.html rename to third_party/WebKit/Source/core/testing/data/input_mode_type_text_verbatim.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_type_url.html b/third_party/WebKit/Source/core/testing/data/input_mode_type_url.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_type_url.html rename to third_party/WebKit/Source/core/testing/data/input_mode_type_url.html
diff --git a/third_party/WebKit/Source/web/tests/data/input_mode_type_url_verbatim.html b/third_party/WebKit/Source/core/testing/data/input_mode_type_url_verbatim.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/input_mode_type_url_verbatim.html rename to third_party/WebKit/Source/core/testing/data/input_mode_type_url_verbatim.html
diff --git a/third_party/WebKit/Source/web/tests/data/invisible_iframe.html b/third_party/WebKit/Source/core/testing/data/invisible_iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/invisible_iframe.html rename to third_party/WebKit/Source/core/testing/data/invisible_iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/large-div.html b/third_party/WebKit/Source/core/testing/data/large-div.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/large-div.html rename to third_party/WebKit/Source/core/testing/data/large-div.html
diff --git a/third_party/WebKit/Source/web/tests/data/link-manifest-change.html b/third_party/WebKit/Source/core/testing/data/link-manifest-change.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/link-manifest-change.html rename to third_party/WebKit/Source/core/testing/data/link-manifest-change.html
diff --git a/third_party/WebKit/Source/web/tests/data/link-manifest-fetch.json b/third_party/WebKit/Source/core/testing/data/link-manifest-fetch.json similarity index 100% rename from third_party/WebKit/Source/web/tests/data/link-manifest-fetch.json rename to third_party/WebKit/Source/core/testing/data/link-manifest-fetch.json
diff --git a/third_party/WebKit/Source/web/tests/data/listener/listener_leak1.html b/third_party/WebKit/Source/core/testing/data/listener/listener_leak1.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/listener/listener_leak1.html rename to third_party/WebKit/Source/core/testing/data/listener/listener_leak1.html
diff --git a/third_party/WebKit/Source/web/tests/data/listener/listener_leak2.html b/third_party/WebKit/Source/core/testing/data/listener/listener_leak2.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/listener/listener_leak2.html rename to third_party/WebKit/Source/core/testing/data/listener/listener_leak2.html
diff --git a/third_party/WebKit/Source/web/tests/data/listener/mutation_event_listener.html b/third_party/WebKit/Source/core/testing/data/listener/mutation_event_listener.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/listener/mutation_event_listener.html rename to third_party/WebKit/Source/core/testing/data/listener/mutation_event_listener.html
diff --git a/third_party/WebKit/Source/web/tests/data/long_press_empty_div.html b/third_party/WebKit/Source/core/testing/data/long_press_empty_div.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/long_press_empty_div.html rename to third_party/WebKit/Source/core/testing/data/long_press_empty_div.html
diff --git a/third_party/WebKit/Source/web/tests/data/long_press_empty_editable_selection.html b/third_party/WebKit/Source/core/testing/data/long_press_empty_editable_selection.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/long_press_empty_editable_selection.html rename to third_party/WebKit/Source/core/testing/data/long_press_empty_editable_selection.html
diff --git a/third_party/WebKit/Source/web/tests/data/long_press_image.html b/third_party/WebKit/Source/core/testing/data/long_press_image.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/long_press_image.html rename to third_party/WebKit/Source/core/testing/data/long_press_image.html
diff --git a/third_party/WebKit/Source/web/tests/data/long_press_link.html b/third_party/WebKit/Source/core/testing/data/long_press_link.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/long_press_link.html rename to third_party/WebKit/Source/core/testing/data/long_press_link.html
diff --git a/third_party/WebKit/Source/web/tests/data/long_press_links_and_images.html b/third_party/WebKit/Source/core/testing/data/long_press_links_and_images.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/long_press_links_and_images.html rename to third_party/WebKit/Source/core/testing/data/long_press_links_and_images.html
diff --git a/third_party/WebKit/Source/web/tests/data/long_press_object.html b/third_party/WebKit/Source/core/testing/data/long_press_object.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/long_press_object.html rename to third_party/WebKit/Source/core/testing/data/long_press_object.html
diff --git a/third_party/WebKit/Source/web/tests/data/long_press_object_fallback.html b/third_party/WebKit/Source/core/testing/data/long_press_object_fallback.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/long_press_object_fallback.html rename to third_party/WebKit/Source/core/testing/data/long_press_object_fallback.html
diff --git a/third_party/WebKit/Source/web/tests/data/long_press_video.html b/third_party/WebKit/Source/core/testing/data/long_press_video.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/long_press_video.html rename to third_party/WebKit/Source/core/testing/data/long_press_video.html
diff --git a/third_party/WebKit/Source/web/tests/data/long_scroll.html b/third_party/WebKit/Source/core/testing/data/long_scroll.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/long_scroll.html rename to third_party/WebKit/Source/core/testing/data/long_scroll.html
diff --git a/third_party/WebKit/Source/web/tests/data/longpress_image_contenteditable.html b/third_party/WebKit/Source/core/testing/data/longpress_image_contenteditable.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/longpress_image_contenteditable.html rename to third_party/WebKit/Source/core/testing/data/longpress_image_contenteditable.html
diff --git a/third_party/WebKit/Source/web/tests/data/longpress_selection.html b/third_party/WebKit/Source/core/testing/data/longpress_selection.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/longpress_selection.html rename to third_party/WebKit/Source/core/testing/data/longpress_selection.html
diff --git a/third_party/WebKit/Source/web/tests/data/longpress_textarea.html b/third_party/WebKit/Source/core/testing/data/longpress_textarea.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/longpress_textarea.html rename to third_party/WebKit/Source/core/testing/data/longpress_textarea.html
diff --git a/third_party/WebKit/Source/web/tests/data/manifest-dummy.html b/third_party/WebKit/Source/core/testing/data/manifest-dummy.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/manifest-dummy.html rename to third_party/WebKit/Source/core/testing/data/manifest-dummy.html
diff --git a/third_party/WebKit/Source/web/tests/data/max-frames-detach.html b/third_party/WebKit/Source/core/testing/data/max-frames-detach.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/max-frames-detach.html rename to third_party/WebKit/Source/core/testing/data/max-frames-detach.html
diff --git a/third_party/WebKit/Source/web/tests/data/mhtml/.gitattributes b/third_party/WebKit/Source/core/testing/data/mhtml/.gitattributes similarity index 100% rename from third_party/WebKit/Source/web/tests/data/mhtml/.gitattributes rename to third_party/WebKit/Source/core/testing/data/mhtml/.gitattributes
diff --git a/third_party/WebKit/Source/web/tests/data/mhtml/page_with_javascript.mht b/third_party/WebKit/Source/core/testing/data/mhtml/page_with_javascript.mht similarity index 100% rename from third_party/WebKit/Source/web/tests/data/mhtml/page_with_javascript.mht rename to third_party/WebKit/Source/core/testing/data/mhtml/page_with_javascript.mht
diff --git a/third_party/WebKit/Source/web/tests/data/mhtml/shadow.mht b/third_party/WebKit/Source/core/testing/data/mhtml/shadow.mht similarity index 100% rename from third_party/WebKit/Source/web/tests/data/mhtml/shadow.mht rename to third_party/WebKit/Source/core/testing/data/mhtml/shadow.mht
diff --git a/third_party/WebKit/Source/web/tests/data/mhtml/simple_test.mht b/third_party/WebKit/Source/core/testing/data/mhtml/simple_test.mht similarity index 100% rename from third_party/WebKit/Source/web/tests/data/mhtml/simple_test.mht rename to third_party/WebKit/Source/core/testing/data/mhtml/simple_test.mht
diff --git a/third_party/WebKit/Source/web/tests/data/module.js b/third_party/WebKit/Source/core/testing/data/module.js similarity index 100% rename from third_party/WebKit/Source/web/tests/data/module.js rename to third_party/WebKit/Source/core/testing/data/module.js
diff --git a/third_party/WebKit/Source/web/tests/data/mouse-wheel-overflow-body.html b/third_party/WebKit/Source/core/testing/data/mouse-wheel-overflow-body.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/mouse-wheel-overflow-body.html rename to third_party/WebKit/Source/core/testing/data/mouse-wheel-overflow-body.html
diff --git a/third_party/WebKit/Source/web/tests/data/move_caret.html b/third_party/WebKit/Source/core/testing/data/move_caret.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/move_caret.html rename to third_party/WebKit/Source/core/testing/data/move_caret.html
diff --git a/third_party/WebKit/Source/web/tests/data/move_range.html b/third_party/WebKit/Source/core/testing/data/move_range.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/move_range.html rename to third_party/WebKit/Source/core/testing/data/move_range.html
diff --git a/third_party/WebKit/Source/web/tests/data/move_range_selection_extent.html b/third_party/WebKit/Source/core/testing/data/move_range_selection_extent.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/move_range_selection_extent.html rename to third_party/WebKit/Source/core/testing/data/move_range_selection_extent.html
diff --git a/third_party/WebKit/Source/web/tests/data/move_range_selection_extent_input_field.html b/third_party/WebKit/Source/core/testing/data/move_range_selection_extent_input_field.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/move_range_selection_extent_input_field.html rename to third_party/WebKit/Source/core/testing/data/move_range_selection_extent_input_field.html
diff --git a/third_party/WebKit/Source/web/tests/data/navigate_to_same.html b/third_party/WebKit/Source/core/testing/data/navigate_to_same.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/navigate_to_same.html rename to third_party/WebKit/Source/core/testing/data/navigate_to_same.html
diff --git a/third_party/WebKit/Source/web/tests/data/no_scale_for_you.html b/third_party/WebKit/Source/core/testing/data/no_scale_for_you.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/no_scale_for_you.html rename to third_party/WebKit/Source/core/testing/data/no_scale_for_you.html
diff --git a/third_party/WebKit/Source/web/tests/data/no_viewport_tag.html b/third_party/WebKit/Source/core/testing/data/no_viewport_tag.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/no_viewport_tag.html rename to third_party/WebKit/Source/core/testing/data/no_viewport_tag.html
diff --git a/third_party/WebKit/Source/web/tests/data/nodeimage.html b/third_party/WebKit/Source/core/testing/data/nodeimage.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/nodeimage.html rename to third_party/WebKit/Source/core/testing/data/nodeimage.html
diff --git a/third_party/WebKit/Source/web/tests/data/non-scrollable.html b/third_party/WebKit/Source/core/testing/data/non-scrollable.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/non-scrollable.html rename to third_party/WebKit/Source/core/testing/data/non-scrollable.html
diff --git a/third_party/WebKit/Source/web/tests/data/non_user_input_text_update.html b/third_party/WebKit/Source/core/testing/data/non_user_input_text_update.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/non_user_input_text_update.html rename to third_party/WebKit/Source/core/testing/data/non_user_input_text_update.html
diff --git a/third_party/WebKit/Source/web/tests/data/not_an_image.ico b/third_party/WebKit/Source/core/testing/data/not_an_image.ico similarity index 100% rename from third_party/WebKit/Source/web/tests/data/not_an_image.ico rename to third_party/WebKit/Source/core/testing/data/not_an_image.ico
diff --git a/third_party/WebKit/Source/web/tests/data/notifications/100x100.png b/third_party/WebKit/Source/core/testing/data/notifications/100x100.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/notifications/100x100.png rename to third_party/WebKit/Source/core/testing/data/notifications/100x100.png Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/notifications/110x110.png b/third_party/WebKit/Source/core/testing/data/notifications/110x110.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/notifications/110x110.png rename to third_party/WebKit/Source/core/testing/data/notifications/110x110.png Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/notifications/120x120.png b/third_party/WebKit/Source/core/testing/data/notifications/120x120.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/notifications/120x120.png rename to third_party/WebKit/Source/core/testing/data/notifications/120x120.png Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/notifications/3000x1000.png b/third_party/WebKit/Source/core/testing/data/notifications/3000x1000.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/notifications/3000x1000.png rename to third_party/WebKit/Source/core/testing/data/notifications/3000x1000.png Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/notifications/3000x2000.png b/third_party/WebKit/Source/core/testing/data/notifications/3000x2000.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/notifications/3000x2000.png rename to third_party/WebKit/Source/core/testing/data/notifications/3000x2000.png Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/notifications/48x48.png b/third_party/WebKit/Source/core/testing/data/notifications/48x48.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/notifications/48x48.png rename to third_party/WebKit/Source/core/testing/data/notifications/48x48.png Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/notifications/500x500.png b/third_party/WebKit/Source/core/testing/data/notifications/500x500.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/notifications/500x500.png rename to third_party/WebKit/Source/core/testing/data/notifications/500x500.png Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/noviewport-2-div.html b/third_party/WebKit/Source/core/testing/data/noviewport-2-div.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/noviewport-2-div.html rename to third_party/WebKit/Source/core/testing/data/noviewport-2-div.html
diff --git a/third_party/WebKit/Source/web/tests/data/orientation-frame-detach.html b/third_party/WebKit/Source/core/testing/data/orientation-frame-detach.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/orientation-frame-detach.html rename to third_party/WebKit/Source/core/testing/data/orientation-frame-detach.html
diff --git a/third_party/WebKit/Source/web/tests/data/overflow-hidden.html b/third_party/WebKit/Source/core/testing/data/overflow-hidden.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/overflow-hidden.html rename to third_party/WebKit/Source/core/testing/data/overflow-hidden.html
diff --git a/third_party/WebKit/Source/web/tests/data/overflow-scrolling.html b/third_party/WebKit/Source/core/testing/data/overflow-scrolling.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/overflow-scrolling.html rename to third_party/WebKit/Source/core/testing/data/overflow-scrolling.html
diff --git a/third_party/WebKit/Source/web/tests/data/overscroll/div-overscroll.html b/third_party/WebKit/Source/core/testing/data/overscroll/div-overscroll.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/overscroll/div-overscroll.html rename to third_party/WebKit/Source/core/testing/data/overscroll/div-overscroll.html
diff --git a/third_party/WebKit/Source/web/tests/data/overscroll/iframe-overscroll.html b/third_party/WebKit/Source/core/testing/data/overscroll/iframe-overscroll.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/overscroll/iframe-overscroll.html rename to third_party/WebKit/Source/core/testing/data/overscroll/iframe-overscroll.html
diff --git a/third_party/WebKit/Source/web/tests/data/overscroll/no-overscroll-on-nonscrollable-axes.html b/third_party/WebKit/Source/core/testing/data/overscroll/no-overscroll-on-nonscrollable-axes.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/overscroll/no-overscroll-on-nonscrollable-axes.html rename to third_party/WebKit/Source/core/testing/data/overscroll/no-overscroll-on-nonscrollable-axes.html
diff --git a/third_party/WebKit/Source/web/tests/data/overscroll/overscroll.html b/third_party/WebKit/Source/core/testing/data/overscroll/overscroll.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/overscroll/overscroll.html rename to third_party/WebKit/Source/core/testing/data/overscroll/overscroll.html
diff --git a/third_party/WebKit/Source/web/tests/data/overscroll/scrollable-iframe.html b/third_party/WebKit/Source/core/testing/data/overscroll/scrollable-iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/overscroll/scrollable-iframe.html rename to third_party/WebKit/Source/core/testing/data/overscroll/scrollable-iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/page_with_blank_iframe.html b/third_party/WebKit/Source/core/testing/data/page_with_blank_iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/page_with_blank_iframe.html rename to third_party/WebKit/Source/core/testing/data/page_with_blank_iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/parent_detaching_frame.html b/third_party/WebKit/Source/core/testing/data/parent_detaching_frame.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/parent_detaching_frame.html rename to third_party/WebKit/Source/core/testing/data/parent_detaching_frame.html
diff --git a/third_party/WebKit/Source/web/tests/data/percent-height-descendants.html b/third_party/WebKit/Source/core/testing/data/percent-height-descendants.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/percent-height-descendants.html rename to third_party/WebKit/Source/core/testing/data/percent-height-descendants.html
diff --git a/third_party/WebKit/Source/web/tests/data/percent-height.html b/third_party/WebKit/Source/core/testing/data/percent-height.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/percent-height.html rename to third_party/WebKit/Source/core/testing/data/percent-height.html
diff --git a/third_party/WebKit/Source/web/tests/data/pinch-viewport-fixed-pos.html b/third_party/WebKit/Source/core/testing/data/pinch-viewport-fixed-pos.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/pinch-viewport-fixed-pos.html rename to third_party/WebKit/Source/core/testing/data/pinch-viewport-fixed-pos.html
diff --git a/third_party/WebKit/Source/web/tests/data/pinch-viewport-input-field-long-and-wide.html b/third_party/WebKit/Source/core/testing/data/pinch-viewport-input-field-long-and-wide.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/pinch-viewport-input-field-long-and-wide.html rename to third_party/WebKit/Source/core/testing/data/pinch-viewport-input-field-long-and-wide.html
diff --git a/third_party/WebKit/Source/web/tests/data/pinch-viewport-input-field.html b/third_party/WebKit/Source/core/testing/data/pinch-viewport-input-field.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/pinch-viewport-input-field.html rename to third_party/WebKit/Source/core/testing/data/pinch-viewport-input-field.html
diff --git a/third_party/WebKit/Source/web/tests/data/plugin.html b/third_party/WebKit/Source/core/testing/data/plugin.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/plugin.html rename to third_party/WebKit/Source/core/testing/data/plugin.html
diff --git a/third_party/WebKit/Source/web/tests/data/plugin_container.html b/third_party/WebKit/Source/core/testing/data/plugin_container.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/plugin_container.html rename to third_party/WebKit/Source/core/testing/data/plugin_container.html
diff --git a/third_party/WebKit/Source/web/tests/data/plugin_containing_page.html b/third_party/WebKit/Source/core/testing/data/plugin_containing_page.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/plugin_containing_page.html rename to third_party/WebKit/Source/core/testing/data/plugin_containing_page.html
diff --git a/third_party/WebKit/Source/web/tests/data/plugin_scroll.html b/third_party/WebKit/Source/core/testing/data/plugin_scroll.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/plugin_scroll.html rename to third_party/WebKit/Source/core/testing/data/plugin_scroll.html
diff --git a/third_party/WebKit/Source/web/tests/data/popup/select.html b/third_party/WebKit/Source/core/testing/data/popup/select.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/popup/select.html rename to third_party/WebKit/Source/core/testing/data/popup/select.html
diff --git a/third_party/WebKit/Source/web/tests/data/popup/select_event.html b/third_party/WebKit/Source/core/testing/data/popup/select_event.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/popup/select_event.html rename to third_party/WebKit/Source/core/testing/data/popup/select_event.html
diff --git a/third_party/WebKit/Source/web/tests/data/popup/select_event_remove_on_change.html b/third_party/WebKit/Source/core/testing/data/popup/select_event_remove_on_change.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/popup/select_event_remove_on_change.html rename to third_party/WebKit/Source/core/testing/data/popup/select_event_remove_on_change.html
diff --git a/third_party/WebKit/Source/web/tests/data/popup/select_event_remove_on_click.html b/third_party/WebKit/Source/core/testing/data/popup/select_event_remove_on_click.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/popup/select_event_remove_on_click.html rename to third_party/WebKit/Source/core/testing/data/popup/select_event_remove_on_click.html
diff --git a/third_party/WebKit/Source/web/tests/data/popup/select_mid_screen.html b/third_party/WebKit/Source/core/testing/data/popup/select_mid_screen.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/popup/select_mid_screen.html rename to third_party/WebKit/Source/core/testing/data/popup/select_mid_screen.html
diff --git a/third_party/WebKit/Source/web/tests/data/popup/select_rtl.html b/third_party/WebKit/Source/core/testing/data/popup/select_rtl.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/popup/select_rtl.html rename to third_party/WebKit/Source/core/testing/data/popup/select_rtl.html
diff --git a/third_party/WebKit/Source/web/tests/data/popup/select_rtl_width.html b/third_party/WebKit/Source/core/testing/data/popup/select_rtl_width.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/popup/select_rtl_width.html rename to third_party/WebKit/Source/core/testing/data/popup/select_rtl_width.html
diff --git a/third_party/WebKit/Source/web/tests/data/postmessage_test.html b/third_party/WebKit/Source/core/testing/data/postmessage_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/postmessage_test.html rename to third_party/WebKit/Source/core/testing/data/postmessage_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/prerender/multiple_prerenders.html b/third_party/WebKit/Source/core/testing/data/prerender/multiple_prerenders.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/prerender/multiple_prerenders.html rename to third_party/WebKit/Source/core/testing/data/prerender/multiple_prerenders.html
diff --git a/third_party/WebKit/Source/web/tests/data/prerender/rel_next_prerender.html b/third_party/WebKit/Source/core/testing/data/prerender/rel_next_prerender.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/prerender/rel_next_prerender.html rename to third_party/WebKit/Source/core/testing/data/prerender/rel_next_prerender.html
diff --git a/third_party/WebKit/Source/web/tests/data/prerender/single_prerender.html b/third_party/WebKit/Source/core/testing/data/prerender/single_prerender.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/prerender/single_prerender.html rename to third_party/WebKit/Source/core/testing/data/prerender/single_prerender.html
diff --git a/third_party/WebKit/Source/web/tests/data/print-location-href.html b/third_party/WebKit/Source/core/testing/data/print-location-href.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/print-location-href.html rename to third_party/WebKit/Source/core/testing/data/print-location-href.html
diff --git a/third_party/WebKit/Source/web/tests/data/print_with_xhr_inflight.html b/third_party/WebKit/Source/core/testing/data/print_with_xhr_inflight.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/print_with_xhr_inflight.html rename to third_party/WebKit/Source/core/testing/data/print_with_xhr_inflight.html
diff --git a/third_party/WebKit/Source/web/tests/data/priorities/async.js b/third_party/WebKit/Source/core/testing/data/priorities/async.js similarity index 100% rename from third_party/WebKit/Source/web/tests/data/priorities/async.js rename to third_party/WebKit/Source/core/testing/data/priorities/async.js
diff --git a/third_party/WebKit/Source/web/tests/data/priorities/body.js b/third_party/WebKit/Source/core/testing/data/priorities/body.js similarity index 100% rename from third_party/WebKit/Source/web/tests/data/priorities/body.js rename to third_party/WebKit/Source/core/testing/data/priorities/body.js
diff --git a/third_party/WebKit/Source/web/tests/data/priorities/defer.js b/third_party/WebKit/Source/core/testing/data/priorities/defer.js similarity index 100% rename from third_party/WebKit/Source/web/tests/data/priorities/defer.js rename to third_party/WebKit/Source/core/testing/data/priorities/defer.js
diff --git a/third_party/WebKit/Source/web/tests/data/priorities/document-write.js b/third_party/WebKit/Source/core/testing/data/priorities/document-write.js similarity index 100% rename from third_party/WebKit/Source/web/tests/data/priorities/document-write.js rename to third_party/WebKit/Source/core/testing/data/priorities/document-write.js
diff --git a/third_party/WebKit/Source/web/tests/data/priorities/head.js b/third_party/WebKit/Source/core/testing/data/priorities/head.js similarity index 100% rename from third_party/WebKit/Source/web/tests/data/priorities/head.js rename to third_party/WebKit/Source/core/testing/data/priorities/head.js
diff --git a/third_party/WebKit/Source/web/tests/data/priorities/injected-async.js b/third_party/WebKit/Source/core/testing/data/priorities/injected-async.js similarity index 100% rename from third_party/WebKit/Source/web/tests/data/priorities/injected-async.js rename to third_party/WebKit/Source/core/testing/data/priorities/injected-async.js
diff --git a/third_party/WebKit/Source/web/tests/data/priorities/injected.js b/third_party/WebKit/Source/core/testing/data/priorities/injected.js similarity index 100% rename from third_party/WebKit/Source/web/tests/data/priorities/injected.js rename to third_party/WebKit/Source/core/testing/data/priorities/injected.js
diff --git a/third_party/WebKit/Source/web/tests/data/promote_img_in_viewport_priority.html b/third_party/WebKit/Source/core/testing/data/promote_img_in_viewport_priority.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/promote_img_in_viewport_priority.html rename to third_party/WebKit/Source/core/testing/data/promote_img_in_viewport_priority.html
diff --git a/third_party/WebKit/Source/web/tests/data/push_state.html b/third_party/WebKit/Source/core/testing/data/push_state.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/push_state.html rename to third_party/WebKit/Source/core/testing/data/push_state.html
diff --git a/third_party/WebKit/Source/web/tests/data/reload_post.html b/third_party/WebKit/Source/core/testing/data/reload_post.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/reload_post.html rename to third_party/WebKit/Source/core/testing/data/reload_post.html
diff --git a/third_party/WebKit/Source/web/tests/data/resize_scroll_fixed_layout.html b/third_party/WebKit/Source/core/testing/data/resize_scroll_fixed_layout.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/resize_scroll_fixed_layout.html rename to third_party/WebKit/Source/core/testing/data/resize_scroll_fixed_layout.html
diff --git a/third_party/WebKit/Source/web/tests/data/resize_scroll_fixed_width.html b/third_party/WebKit/Source/core/testing/data/resize_scroll_fixed_width.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/resize_scroll_fixed_width.html rename to third_party/WebKit/Source/core/testing/data/resize_scroll_fixed_width.html
diff --git a/third_party/WebKit/Source/web/tests/data/resize_scroll_minimum_scale.html b/third_party/WebKit/Source/core/testing/data/resize_scroll_minimum_scale.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/resize_scroll_minimum_scale.html rename to third_party/WebKit/Source/core/testing/data/resize_scroll_minimum_scale.html
diff --git a/third_party/WebKit/Source/web/tests/data/resize_scroll_mobile.html b/third_party/WebKit/Source/core/testing/data/resize_scroll_mobile.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/resize_scroll_mobile.html rename to third_party/WebKit/Source/core/testing/data/resize_scroll_mobile.html
diff --git a/third_party/WebKit/Source/web/tests/data/rgm_column_test.html b/third_party/WebKit/Source/core/testing/data/rgm_column_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/rgm_column_test.html rename to third_party/WebKit/Source/core/testing/data/rgm_column_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/rgm_contains_fixed_position_test.html b/third_party/WebKit/Source/core/testing/data/rgm_contains_fixed_position_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/rgm_contains_fixed_position_test.html rename to third_party/WebKit/Source/core/testing/data/rgm_contains_fixed_position_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/rgm_fixed_position_test.html b/third_party/WebKit/Source/core/testing/data/rgm_fixed_position_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/rgm_fixed_position_test.html rename to third_party/WebKit/Source/core/testing/data/rgm_fixed_position_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/rgm_float_under_inline.html b/third_party/WebKit/Source/core/testing/data/rgm_float_under_inline.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/rgm_float_under_inline.html rename to third_party/WebKit/Source/core/testing/data/rgm_float_under_inline.html
diff --git a/third_party/WebKit/Source/web/tests/data/rgm_iframe_test.html b/third_party/WebKit/Source/core/testing/data/rgm_iframe_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/rgm_iframe_test.html rename to third_party/WebKit/Source/core/testing/data/rgm_iframe_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/rgm_test.html b/third_party/WebKit/Source/core/testing/data/rgm_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/rgm_test.html rename to third_party/WebKit/Source/core/testing/data/rgm_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/rgm_transformed_test.html b/third_party/WebKit/Source/core/testing/data/rgm_transformed_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/rgm_transformed_test.html rename to third_party/WebKit/Source/core/testing/data/rgm_transformed_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/root-scroller-child.html b/third_party/WebKit/Source/core/testing/data/root-scroller-child.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/root-scroller-child.html rename to third_party/WebKit/Source/core/testing/data/root-scroller-child.html
diff --git a/third_party/WebKit/Source/web/tests/data/root-scroller-div.html b/third_party/WebKit/Source/core/testing/data/root-scroller-div.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/root-scroller-div.html rename to third_party/WebKit/Source/core/testing/data/root-scroller-div.html
diff --git a/third_party/WebKit/Source/web/tests/data/root-scroller-iframe.html b/third_party/WebKit/Source/core/testing/data/root-scroller-iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/root-scroller-iframe.html rename to third_party/WebKit/Source/core/testing/data/root-scroller-iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/root-scroller-rotation.html b/third_party/WebKit/Source/core/testing/data/root-scroller-rotation.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/root-scroller-rotation.html rename to third_party/WebKit/Source/core/testing/data/root-scroller-rotation.html
diff --git a/third_party/WebKit/Source/web/tests/data/root-scroller.html b/third_party/WebKit/Source/core/testing/data/root-scroller.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/root-scroller.html rename to third_party/WebKit/Source/core/testing/data/root-scroller.html
diff --git a/third_party/WebKit/Source/web/tests/data/rtl-iframe-inner.html b/third_party/WebKit/Source/core/testing/data/rtl-iframe-inner.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/rtl-iframe-inner.html rename to third_party/WebKit/Source/core/testing/data/rtl-iframe-inner.html
diff --git a/third_party/WebKit/Source/web/tests/data/rtl-iframe.html b/third_party/WebKit/Source/core/testing/data/rtl-iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/rtl-iframe.html rename to third_party/WebKit/Source/core/testing/data/rtl-iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/rtl-overview-mode.html b/third_party/WebKit/Source/core/testing/data/rtl-overview-mode.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/rtl-overview-mode.html rename to third_party/WebKit/Source/core/testing/data/rtl-overview-mode.html
diff --git a/third_party/WebKit/Source/web/tests/data/scale_oscillate.html b/third_party/WebKit/Source/core/testing/data/scale_oscillate.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/scale_oscillate.html rename to third_party/WebKit/Source/core/testing/data/scale_oscillate.html
diff --git a/third_party/WebKit/Source/web/tests/data/script_priority.html b/third_party/WebKit/Source/core/testing/data/script_priority.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/script_priority.html rename to third_party/WebKit/Source/core/testing/data/script_priority.html
diff --git a/third_party/WebKit/Source/web/tests/data/scroll-event-handler-window.html b/third_party/WebKit/Source/core/testing/data/scroll-event-handler-window.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/scroll-event-handler-window.html rename to third_party/WebKit/Source/core/testing/data/scroll-event-handler-window.html
diff --git a/third_party/WebKit/Source/web/tests/data/scroll-event-handler.html b/third_party/WebKit/Source/core/testing/data/scroll-event-handler.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/scroll-event-handler.html rename to third_party/WebKit/Source/core/testing/data/scroll-event-handler.html
diff --git a/third_party/WebKit/Source/web/tests/data/scroll-into-view.html b/third_party/WebKit/Source/core/testing/data/scroll-into-view.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/scroll-into-view.html rename to third_party/WebKit/Source/core/testing/data/scroll-into-view.html
diff --git a/third_party/WebKit/Source/web/tests/data/scrollbar-and-element-hover.html b/third_party/WebKit/Source/core/testing/data/scrollbar-and-element-hover.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/scrollbar-and-element-hover.html rename to third_party/WebKit/Source/core/testing/data/scrollbar-and-element-hover.html
diff --git a/third_party/WebKit/Source/web/tests/data/scrollbar-and-iframe-hover.html b/third_party/WebKit/Source/core/testing/data/scrollbar-and-iframe-hover.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/scrollbar-and-iframe-hover.html rename to third_party/WebKit/Source/core/testing/data/scrollbar-and-iframe-hover.html
diff --git a/third_party/WebKit/Source/web/tests/data/search_form_http.html b/third_party/WebKit/Source/core/testing/data/search_form_http.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/search_form_http.html rename to third_party/WebKit/Source/core/testing/data/search_form_http.html
diff --git a/third_party/WebKit/Source/web/tests/data/search_form_https.html b/third_party/WebKit/Source/core/testing/data/search_form_https.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/search_form_https.html rename to third_party/WebKit/Source/core/testing/data/search_form_https.html
diff --git a/third_party/WebKit/Source/web/tests/data/select_range_basic.html b/third_party/WebKit/Source/core/testing/data/select_range_basic.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/select_range_basic.html rename to third_party/WebKit/Source/core/testing/data/select_range_basic.html
diff --git a/third_party/WebKit/Source/web/tests/data/select_range_div_editable.html b/third_party/WebKit/Source/core/testing/data/select_range_div_editable.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/select_range_div_editable.html rename to third_party/WebKit/Source/core/testing/data/select_range_div_editable.html
diff --git a/third_party/WebKit/Source/web/tests/data/select_range_iframe.html b/third_party/WebKit/Source/core/testing/data/select_range_iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/select_range_iframe.html rename to third_party/WebKit/Source/core/testing/data/select_range_iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/select_range_scroll.html b/third_party/WebKit/Source/core/testing/data/select_range_scroll.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/select_range_scroll.html rename to third_party/WebKit/Source/core/testing/data/select_range_scroll.html
diff --git a/third_party/WebKit/Source/web/tests/data/select_range_span_editable.html b/third_party/WebKit/Source/core/testing/data/select_range_span_editable.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/select_range_span_editable.html rename to third_party/WebKit/Source/core/testing/data/select_range_span_editable.html
diff --git a/third_party/WebKit/Source/web/tests/data/selection_readonly.html b/third_party/WebKit/Source/core/testing/data/selection_readonly.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/selection_readonly.html rename to third_party/WebKit/Source/core/testing/data/selection_readonly.html
diff --git a/third_party/WebKit/Source/web/tests/data/send_beacon.html b/third_party/WebKit/Source/core/testing/data/send_beacon.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/send_beacon.html rename to third_party/WebKit/Source/core/testing/data/send_beacon.html
diff --git a/third_party/WebKit/Source/web/tests/data/setup_scrollbar_layer_crash.html b/third_party/WebKit/Source/core/testing/data/setup_scrollbar_layer_crash.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/setup_scrollbar_layer_crash.html rename to third_party/WebKit/Source/core/testing/data/setup_scrollbar_layer_crash.html
diff --git a/third_party/WebKit/Source/web/tests/data/show_unhandled_tap.html b/third_party/WebKit/Source/core/testing/data/show_unhandled_tap.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/show_unhandled_tap.html rename to third_party/WebKit/Source/core/testing/data/show_unhandled_tap.html
diff --git a/third_party/WebKit/Source/web/tests/data/simple_div.html b/third_party/WebKit/Source/core/testing/data/simple_div.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/simple_div.html rename to third_party/WebKit/Source/core/testing/data/simple_div.html
diff --git a/third_party/WebKit/Source/web/tests/data/single_iframe.html b/third_party/WebKit/Source/core/testing/data/single_iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/single_iframe.html rename to third_party/WebKit/Source/core/testing/data/single_iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/smartclip.html b/third_party/WebKit/Source/core/testing/data/smartclip.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/smartclip.html rename to third_party/WebKit/Source/core/testing/data/smartclip.html
diff --git a/third_party/WebKit/Source/web/tests/data/smartclip_reversed_positions.html b/third_party/WebKit/Source/core/testing/data/smartclip_reversed_positions.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/smartclip_reversed_positions.html rename to third_party/WebKit/Source/core/testing/data/smartclip_reversed_positions.html
diff --git a/third_party/WebKit/Source/web/tests/data/smartclip_user_select_none.html b/third_party/WebKit/Source/core/testing/data/smartclip_user_select_none.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/smartclip_user_select_none.html rename to third_party/WebKit/Source/core/testing/data/smartclip_user_select_none.html
diff --git a/third_party/WebKit/Source/web/tests/data/sometext.html b/third_party/WebKit/Source/core/testing/data/sometext.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/sometext.html rename to third_party/WebKit/Source/core/testing/data/sometext.html
diff --git a/third_party/WebKit/Source/web/tests/data/specify_size.html b/third_party/WebKit/Source/core/testing/data/specify_size.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/specify_size.html rename to third_party/WebKit/Source/core/testing/data/specify_size.html
diff --git a/third_party/WebKit/Source/web/tests/data/spell.html b/third_party/WebKit/Source/core/testing/data/spell.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/spell.html rename to third_party/WebKit/Source/core/testing/data/spell.html
diff --git a/third_party/WebKit/Source/web/tests/data/sticky-position.html b/third_party/WebKit/Source/core/testing/data/sticky-position.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/sticky-position.html rename to third_party/WebKit/Source/core/testing/data/sticky-position.html
diff --git a/third_party/WebKit/Source/web/tests/data/subframe-a.html b/third_party/WebKit/Source/core/testing/data/subframe-a.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/subframe-a.html rename to third_party/WebKit/Source/core/testing/data/subframe-a.html
diff --git a/third_party/WebKit/Source/web/tests/data/subframe-b.html b/third_party/WebKit/Source/core/testing/data/subframe-b.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/subframe-b.html rename to third_party/WebKit/Source/core/testing/data/subframe-b.html
diff --git a/third_party/WebKit/Source/web/tests/data/subframe-c.html b/third_party/WebKit/Source/core/testing/data/subframe-c.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/subframe-c.html rename to third_party/WebKit/Source/core/testing/data/subframe-c.html
diff --git a/third_party/WebKit/Source/web/tests/data/subframe-hello.html b/third_party/WebKit/Source/core/testing/data/subframe-hello.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/subframe-hello.html rename to third_party/WebKit/Source/core/testing/data/subframe-hello.html
diff --git a/third_party/WebKit/Source/web/tests/data/subtree-layout.html b/third_party/WebKit/Source/core/testing/data/subtree-layout.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/subtree-layout.html rename to third_party/WebKit/Source/core/testing/data/subtree-layout.html
diff --git a/third_party/WebKit/Source/web/tests/data/test.pdf b/third_party/WebKit/Source/core/testing/data/test.pdf similarity index 100% rename from third_party/WebKit/Source/web/tests/data/test.pdf rename to third_party/WebKit/Source/core/testing/data/test.pdf Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/test.webm b/third_party/WebKit/Source/core/testing/data/test.webm similarity index 100% rename from third_party/WebKit/Source/web/tests/data/test.webm rename to third_party/WebKit/Source/core/testing/data/test.webm Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/test_touch_link_highlight.html b/third_party/WebKit/Source/core/testing/data/test_touch_link_highlight.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/test_touch_link_highlight.html rename to third_party/WebKit/Source/core/testing/data/test_touch_link_highlight.html
diff --git a/third_party/WebKit/Source/web/tests/data/text_area_populated.html b/third_party/WebKit/Source/core/testing/data/text_area_populated.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/text_area_populated.html rename to third_party/WebKit/Source/core/testing/data/text_area_populated.html
diff --git a/third_party/WebKit/Source/web/tests/data/text_input_flags.html b/third_party/WebKit/Source/core/testing/data/text_input_flags.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/text_input_flags.html rename to third_party/WebKit/Source/core/testing/data/text_input_flags.html
diff --git a/third_party/WebKit/Source/web/tests/data/text_selection.html b/third_party/WebKit/Source/core/testing/data/text_selection.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/text_selection.html rename to third_party/WebKit/Source/core/testing/data/text_selection.html
diff --git a/third_party/WebKit/Source/web/tests/data/textbox.html b/third_party/WebKit/Source/core/testing/data/textbox.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/textbox.html rename to third_party/WebKit/Source/core/testing/data/textbox.html
diff --git a/third_party/WebKit/Source/web/tests/data/textbox_in_touch_action.html b/third_party/WebKit/Source/core/testing/data/textbox_in_touch_action.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/textbox_in_touch_action.html rename to third_party/WebKit/Source/core/testing/data/textbox_in_touch_action.html
diff --git a/third_party/WebKit/Source/web/tests/data/theme_color_test.html b/third_party/WebKit/Source/core/testing/data/theme_color_test.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/theme_color_test.html rename to third_party/WebKit/Source/core/testing/data/theme_color_test.html
diff --git a/third_party/WebKit/Source/web/tests/data/touch-action-iframe.html b/third_party/WebKit/Source/core/testing/data/touch-action-iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/touch-action-iframe.html rename to third_party/WebKit/Source/core/testing/data/touch-action-iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/touch-action-overflow.html b/third_party/WebKit/Source/core/testing/data/touch-action-overflow.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/touch-action-overflow.html rename to third_party/WebKit/Source/core/testing/data/touch-action-overflow.html
diff --git a/third_party/WebKit/Source/web/tests/data/touch-action-pan.html b/third_party/WebKit/Source/core/testing/data/touch-action-pan.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/touch-action-pan.html rename to third_party/WebKit/Source/core/testing/data/touch-action-pan.html
diff --git a/third_party/WebKit/Source/web/tests/data/touch-action-shadow-dom.html b/third_party/WebKit/Source/core/testing/data/touch-action-shadow-dom.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/touch-action-shadow-dom.html rename to third_party/WebKit/Source/core/testing/data/touch-action-shadow-dom.html
diff --git a/third_party/WebKit/Source/web/tests/data/touch-action-simple.html b/third_party/WebKit/Source/core/testing/data/touch-action-simple.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/touch-action-simple.html rename to third_party/WebKit/Source/core/testing/data/touch-action-simple.html
diff --git a/third_party/WebKit/Source/web/tests/data/touch-action-tests.css b/third_party/WebKit/Source/core/testing/data/touch-action-tests.css similarity index 100% rename from third_party/WebKit/Source/web/tests/data/touch-action-tests.css rename to third_party/WebKit/Source/core/testing/data/touch-action-tests.css
diff --git a/third_party/WebKit/Source/web/tests/data/touch-action-tests.js b/third_party/WebKit/Source/core/testing/data/touch-action-tests.js similarity index 100% rename from third_party/WebKit/Source/web/tests/data/touch-action-tests.js rename to third_party/WebKit/Source/core/testing/data/touch-action-tests.js
diff --git a/third_party/WebKit/Source/web/tests/data/touch-event-handler-both.html b/third_party/WebKit/Source/core/testing/data/touch-event-handler-both.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/touch-event-handler-both.html rename to third_party/WebKit/Source/core/testing/data/touch-event-handler-both.html
diff --git a/third_party/WebKit/Source/web/tests/data/touch-event-handler-passive.html b/third_party/WebKit/Source/core/testing/data/touch-event-handler-passive.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/touch-event-handler-passive.html rename to third_party/WebKit/Source/core/testing/data/touch-event-handler-passive.html
diff --git a/third_party/WebKit/Source/web/tests/data/touch-event-handler.html b/third_party/WebKit/Source/core/testing/data/touch-event-handler.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/touch-event-handler.html rename to third_party/WebKit/Source/core/testing/data/touch-event-handler.html
diff --git a/third_party/WebKit/Source/web/tests/data/transition_exit.css b/third_party/WebKit/Source/core/testing/data/transition_exit.css similarity index 100% rename from third_party/WebKit/Source/web/tests/data/transition_exit.css rename to third_party/WebKit/Source/core/testing/data/transition_exit.css
diff --git a/third_party/WebKit/Source/web/tests/data/transition_exit.html b/third_party/WebKit/Source/core/testing/data/transition_exit.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/transition_exit.html rename to third_party/WebKit/Source/core/testing/data/transition_exit.html
diff --git a/third_party/WebKit/Source/web/tests/data/transition_hide_and_show.html b/third_party/WebKit/Source/core/testing/data/transition_hide_and_show.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/transition_hide_and_show.html rename to third_party/WebKit/Source/core/testing/data/transition_hide_and_show.html
diff --git a/third_party/WebKit/Source/web/tests/data/trivial-scroller.html b/third_party/WebKit/Source/core/testing/data/trivial-scroller.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/trivial-scroller.html rename to third_party/WebKit/Source/core/testing/data/trivial-scroller.html
diff --git a/third_party/WebKit/Source/web/tests/data/two_scrollable_area.html b/third_party/WebKit/Source/core/testing/data/two_scrollable_area.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/two_scrollable_area.html rename to third_party/WebKit/Source/core/testing/data/two_scrollable_area.html
diff --git a/third_party/WebKit/Source/web/tests/data/valid_header_missing_bitmap.ico b/third_party/WebKit/Source/core/testing/data/valid_header_missing_bitmap.ico similarity index 100% rename from third_party/WebKit/Source/web/tests/data/valid_header_missing_bitmap.ico rename to third_party/WebKit/Source/core/testing/data/valid_header_missing_bitmap.ico Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/very_tall_div.html b/third_party/WebKit/Source/core/testing/data/very_tall_div.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/very_tall_div.html rename to third_party/WebKit/Source/core/testing/data/very_tall_div.html
diff --git a/third_party/WebKit/Source/web/tests/data/vh-height-width-800-extra-wide.html b/third_party/WebKit/Source/core/testing/data/vh-height-width-800-extra-wide.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/vh-height-width-800-extra-wide.html rename to third_party/WebKit/Source/core/testing/data/vh-height-width-800-extra-wide.html
diff --git a/third_party/WebKit/Source/web/tests/data/vh-height-width-800.html b/third_party/WebKit/Source/core/testing/data/vh-height-width-800.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/vh-height-width-800.html rename to third_party/WebKit/Source/core/testing/data/vh-height-width-800.html
diff --git a/third_party/WebKit/Source/web/tests/data/vh-height.html b/third_party/WebKit/Source/core/testing/data/vh-height.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/vh-height.html rename to third_party/WebKit/Source/core/testing/data/vh-height.html
diff --git a/third_party/WebKit/Source/web/tests/data/video_200x200.html b/third_party/WebKit/Source/core/testing/data/video_200x200.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/video_200x200.html rename to third_party/WebKit/Source/core/testing/data/video_200x200.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-2-div.html b/third_party/WebKit/Source/core/testing/data/viewport-2-div.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-2-div.html rename to third_party/WebKit/Source/core/testing/data/viewport-2-div.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-2x-initial-scale-non-user-scalable.html b/third_party/WebKit/Source/core/testing/data/viewport-2x-initial-scale-non-user-scalable.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-2x-initial-scale-non-user-scalable.html rename to third_party/WebKit/Source/core/testing/data/viewport-2x-initial-scale-non-user-scalable.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-2x-initial-scale.html b/third_party/WebKit/Source/core/testing/data/viewport-2x-initial-scale.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-2x-initial-scale.html rename to third_party/WebKit/Source/core/testing/data/viewport-2x-initial-scale.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-and-media.html b/third_party/WebKit/Source/core/testing/data/viewport-and-media.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-and-media.html rename to third_party/WebKit/Source/core/testing/data/viewport-and-media.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-auto-initial-scale.html b/third_party/WebKit/Source/core/testing/data/viewport-auto-initial-scale.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-auto-initial-scale.html rename to third_party/WebKit/Source/core/testing/data/viewport-auto-initial-scale.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-device-0.5x-initial-scale.html b/third_party/WebKit/Source/core/testing/data/viewport-device-0.5x-initial-scale.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-device-0.5x-initial-scale.html rename to third_party/WebKit/Source/core/testing/data/viewport-device-0.5x-initial-scale.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-device-width.html b/third_party/WebKit/Source/core/testing/data/viewport-device-width.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-device-width.html rename to third_party/WebKit/Source/core/testing/data/viewport-device-width.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-height-1000.html b/third_party/WebKit/Source/core/testing/data/viewport-height-1000.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-height-1000.html rename to third_party/WebKit/Source/core/testing/data/viewport-height-1000.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-initial-scale-1.html b/third_party/WebKit/Source/core/testing/data/viewport-initial-scale-1.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-initial-scale-1.html rename to third_party/WebKit/Source/core/testing/data/viewport-initial-scale-1.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-initial-scale-and-user-scalable-no.html b/third_party/WebKit/Source/core/testing/data/viewport-initial-scale-and-user-scalable-no.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-initial-scale-and-user-scalable-no.html rename to third_party/WebKit/Source/core/testing/data/viewport-initial-scale-and-user-scalable-no.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-initial-scale-less-than-1-device-width.html b/third_party/WebKit/Source/core/testing/data/viewport-initial-scale-less-than-1-device-width.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-initial-scale-less-than-1-device-width.html rename to third_party/WebKit/Source/core/testing/data/viewport-initial-scale-less-than-1-device-width.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-initial-scale-less-than-1.html b/third_party/WebKit/Source/core/testing/data/viewport-initial-scale-less-than-1.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-initial-scale-less-than-1.html rename to third_party/WebKit/Source/core/testing/data/viewport-initial-scale-less-than-1.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-inside-media.html b/third_party/WebKit/Source/core/testing/data/viewport-inside-media.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-inside-media.html rename to third_party/WebKit/Source/core/testing/data/viewport-inside-media.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-lengths.html b/third_party/WebKit/Source/core/testing/data/viewport-lengths.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-lengths.html rename to third_party/WebKit/Source/core/testing/data/viewport-lengths.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-nonzero-values.html b/third_party/WebKit/Source/core/testing/data/viewport-nonzero-values.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-nonzero-values.html rename to third_party/WebKit/Source/core/testing/data/viewport-nonzero-values.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-select.html b/third_party/WebKit/Source/core/testing/data/viewport-select.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-select.html rename to third_party/WebKit/Source/core/testing/data/viewport-select.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-target-densitydpi-device-and-fixed-width.html b/third_party/WebKit/Source/core/testing/data/viewport-target-densitydpi-device-and-fixed-width.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-target-densitydpi-device-and-fixed-width.html rename to third_party/WebKit/Source/core/testing/data/viewport-target-densitydpi-device-and-fixed-width.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-target-densitydpi-device.html b/third_party/WebKit/Source/core/testing/data/viewport-target-densitydpi-device.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-target-densitydpi-device.html rename to third_party/WebKit/Source/core/testing/data/viewport-target-densitydpi-device.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-target-densitydpi-high.html b/third_party/WebKit/Source/core/testing/data/viewport-target-densitydpi-high.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-target-densitydpi-high.html rename to third_party/WebKit/Source/core/testing/data/viewport-target-densitydpi-high.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-tiny.html b/third_party/WebKit/Source/core/testing/data/viewport-tiny.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-tiny.html rename to third_party/WebKit/Source/core/testing/data/viewport-tiny.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-wide-2x-initial-scale.html b/third_party/WebKit/Source/core/testing/data/viewport-wide-2x-initial-scale.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-wide-2x-initial-scale.html rename to third_party/WebKit/Source/core/testing/data/viewport-wide-2x-initial-scale.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport-zero-values.html b/third_party/WebKit/Source/core/testing/data/viewport-zero-values.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport-zero-values.html rename to third_party/WebKit/Source/core/testing/data/viewport-zero-values.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-1.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-1.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-1.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-1.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-10.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-10.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-10.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-10.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-100.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-100.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-100.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-100.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-101.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-101.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-101.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-101.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-102.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-102.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-102.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-102.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-103.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-103.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-103.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-103.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-104.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-104.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-104.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-104.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-105.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-105.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-105.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-105.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-106.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-106.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-106.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-106.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-107.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-107.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-107.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-107.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-108.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-108.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-108.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-108.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-109.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-109.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-109.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-109.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-11.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-11.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-11.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-11.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-110.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-110.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-110.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-110.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-111.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-111.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-111.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-111.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-112.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-112.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-112.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-112.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-113.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-113.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-113.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-113.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-114.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-114.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-114.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-114.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-115.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-115.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-115.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-115.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-116.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-116.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-116.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-116.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-117.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-117.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-117.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-117.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-118.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-118.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-118.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-118.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-119.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-119.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-119.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-119.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-12.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-12.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-12.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-12.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-120.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-120.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-120.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-120.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-121.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-121.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-121.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-121.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-122.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-122.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-122.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-122.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-123.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-123.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-123.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-123.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-124.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-124.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-124.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-124.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-125.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-125.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-125.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-125.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-126.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-126.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-126.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-126.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-127.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-127.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-127.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-127.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-129.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-129.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-129.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-129.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-13.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-13.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-13.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-13.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-130.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-130.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-130.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-130.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-131.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-131.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-131.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-131.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-132.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-132.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-132.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-132.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-133.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-133.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-133.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-133.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-134.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-134.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-134.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-134.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-135.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-135.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-135.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-135.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-136.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-136.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-136.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-136.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-137.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-137.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-137.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-137.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-138.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-138.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-138.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-138.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-14.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-14.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-14.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-14.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-15.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-15.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-15.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-15.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-16.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-16.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-16.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-16.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-17.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-17.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-17.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-17.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-18.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-18.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-18.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-18.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-19.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-19.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-19.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-19.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-2.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-2.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-2.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-2.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-20.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-20.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-20.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-20.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-21.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-21.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-21.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-21.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-22.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-22.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-22.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-22.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-23.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-23.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-23.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-23.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-24.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-24.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-24.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-24.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-25.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-25.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-25.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-25.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-26.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-26.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-26.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-26.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-27.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-27.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-27.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-27.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-28.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-28.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-28.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-28.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-29.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-29.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-29.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-29.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-3.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-3.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-3.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-3.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-30.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-30.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-30.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-30.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-31.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-31.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-31.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-31.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-32.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-32.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-32.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-32.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-33.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-33.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-33.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-33.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-34.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-34.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-34.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-34.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-35.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-35.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-35.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-35.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-36.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-36.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-36.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-36.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-37.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-37.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-37.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-37.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-38.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-38.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-38.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-38.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-39.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-39.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-39.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-39.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-4.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-4.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-4.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-4.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-40.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-40.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-40.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-40.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-41.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-41.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-41.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-41.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-42.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-42.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-42.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-42.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-43.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-43.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-43.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-43.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-44.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-44.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-44.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-44.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-45.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-45.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-45.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-45.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-46.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-46.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-46.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-46.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-47.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-47.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-47.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-47.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-48.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-48.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-48.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-48.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-49.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-49.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-49.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-49.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-5.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-5.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-5.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-5.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-50.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-50.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-50.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-50.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-51.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-51.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-51.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-51.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-52.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-52.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-52.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-52.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-53.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-53.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-53.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-53.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-54.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-54.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-54.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-54.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-55.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-55.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-55.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-55.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-56.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-56.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-56.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-56.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-57.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-57.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-57.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-57.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-58.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-58.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-58.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-58.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-59.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-59.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-59.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-59.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-6.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-6.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-6.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-6.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-60.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-60.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-60.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-60.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-61.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-61.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-61.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-61.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-62.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-62.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-62.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-62.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-63.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-63.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-63.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-63.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-64.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-64.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-64.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-64.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-65.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-65.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-65.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-65.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-66.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-66.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-66.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-66.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-67.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-67.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-67.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-67.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-68.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-68.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-68.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-68.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-69.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-69.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-69.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-69.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-7.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-7.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-7.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-7.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-70.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-70.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-70.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-70.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-71.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-71.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-71.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-71.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-72.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-72.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-72.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-72.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-73.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-73.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-73.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-73.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-74.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-74.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-74.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-74.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-75.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-75.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-75.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-75.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-76.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-76.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-76.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-76.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-77.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-77.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-77.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-77.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-78.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-78.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-78.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-78.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-79.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-79.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-79.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-79.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-8.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-8.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-8.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-8.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-80.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-80.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-80.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-80.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-81.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-81.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-81.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-81.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-82.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-82.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-82.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-82.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-83.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-83.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-83.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-83.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-84.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-84.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-84.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-84.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-85.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-85.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-85.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-85.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-86.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-86.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-86.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-86.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-87.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-87.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-87.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-87.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-88.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-88.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-88.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-88.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-9.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-9.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-9.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-9.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-90.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-90.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-90.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-90.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-gpu-rasterization-disabled-without-viewport.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-gpu-rasterization-disabled-without-viewport.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-gpu-rasterization-disabled-without-viewport.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-gpu-rasterization-disabled-without-viewport.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-gpu-rasterization-expanded-heuristics.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-gpu-rasterization-expanded-heuristics.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-gpu-rasterization-expanded-heuristics.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-gpu-rasterization-expanded-heuristics.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-gpu-rasterization.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-gpu-rasterization.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-gpu-rasterization.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-gpu-rasterization.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-handheldfriendly.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-handheldfriendly.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-handheldfriendly.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-handheldfriendly.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-merge-quirk-1.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-merge-quirk-1.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-merge-quirk-1.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-merge-quirk-1.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-merge-quirk-2.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-merge-quirk-2.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-merge-quirk-2.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-merge-quirk-2.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-mobileoptimized-2.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-mobileoptimized-2.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-mobileoptimized-2.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-mobileoptimized-2.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-mobileoptimized-3.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-mobileoptimized-3.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-mobileoptimized-3.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-mobileoptimized-3.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-mobileoptimized.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-mobileoptimized.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-mobileoptimized.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-mobileoptimized.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-1.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-1.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-1.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-1.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-10.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-10.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-10.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-10.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-2.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-2.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-2.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-2.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-3.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-3.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-3.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-3.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-4.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-4.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-4.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-4.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-5.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-5.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-5.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-5.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-6.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-6.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-6.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-6.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-7.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-7.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-7.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-7.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-8.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-8.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-8.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-8.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-9.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-9.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-ordering-9.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-ordering-9.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-xhtmlmp-misplaced-doctype.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-xhtmlmp-misplaced-doctype.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-xhtmlmp-misplaced-doctype.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-xhtmlmp-misplaced-doctype.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-xhtmlmp-ordering.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-xhtmlmp-ordering.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-xhtmlmp-ordering.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-xhtmlmp-ordering.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-xhtmlmp.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-xhtmlmp.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-legacy-xhtmlmp.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-legacy-xhtmlmp.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-limits-adjusted-for-no-user-scale.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-limits-adjusted-for-no-user-scale.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-limits-adjusted-for-no-user-scale.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-limits-adjusted-for-no-user-scale.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-limits-adjusted-for-user-scale.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-limits-adjusted-for-user-scale.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-limits-adjusted-for-user-scale.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-limits-adjusted-for-user-scale.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-warnings-1.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-warnings-1.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-warnings-1.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-warnings-1.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-warnings-2.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-warnings-2.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-warnings-2.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-warnings-2.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-warnings-3.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-warnings-3.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-warnings-3.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-warnings-3.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-warnings-4.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-warnings-4.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-warnings-4.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-warnings-4.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-warnings-5.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-warnings-5.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-warnings-5.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-warnings-5.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-warnings-6.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-warnings-6.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-warnings-6.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-warnings-6.html
diff --git a/third_party/WebKit/Source/web/tests/data/viewport/viewport-warnings-7.html b/third_party/WebKit/Source/core/testing/data/viewport/viewport-warnings-7.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/viewport/viewport-warnings-7.html rename to third_party/WebKit/Source/core/testing/data/viewport/viewport-warnings-7.html
diff --git a/third_party/WebKit/Source/web/tests/data/visible_frames.html b/third_party/WebKit/Source/core/testing/data/visible_frames.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/visible_frames.html rename to third_party/WebKit/Source/core/testing/data/visible_frames.html
diff --git a/third_party/WebKit/Source/web/tests/data/visible_iframe.html b/third_party/WebKit/Source/core/testing/data/visible_iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/visible_iframe.html rename to third_party/WebKit/Source/core/testing/data/visible_iframe.html
diff --git a/third_party/WebKit/Source/web/tests/data/wheel-event-handler-both.html b/third_party/WebKit/Source/core/testing/data/wheel-event-handler-both.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/wheel-event-handler-both.html rename to third_party/WebKit/Source/core/testing/data/wheel-event-handler-both.html
diff --git a/third_party/WebKit/Source/web/tests/data/wheel-event-handler-passive.html b/third_party/WebKit/Source/core/testing/data/wheel-event-handler-passive.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/wheel-event-handler-passive.html rename to third_party/WebKit/Source/core/testing/data/wheel-event-handler-passive.html
diff --git a/third_party/WebKit/Source/web/tests/data/wheel-event-handler.html b/third_party/WebKit/Source/core/testing/data/wheel-event-handler.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/wheel-event-handler.html rename to third_party/WebKit/Source/core/testing/data/wheel-event-handler.html
diff --git a/third_party/WebKit/Source/web/tests/data/white-1x1.png b/third_party/WebKit/Source/core/testing/data/white-1x1.png similarity index 100% rename from third_party/WebKit/Source/web/tests/data/white-1x1.png rename to third_party/WebKit/Source/core/testing/data/white-1x1.png Binary files differ
diff --git a/third_party/WebKit/Source/web/tests/data/wide_document.html b/third_party/WebKit/Source/core/testing/data/wide_document.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/wide_document.html rename to third_party/WebKit/Source/core/testing/data/wide_document.html
diff --git a/third_party/WebKit/Source/web/tests/data/wide_document_width_viewport.html b/third_party/WebKit/Source/core/testing/data/wide_document_width_viewport.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/wide_document_width_viewport.html rename to third_party/WebKit/Source/core/testing/data/wide_document_width_viewport.html
diff --git a/third_party/WebKit/Source/web/tests/data/window_dimensions.html b/third_party/WebKit/Source/core/testing/data/window_dimensions.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/window_dimensions.html rename to third_party/WebKit/Source/core/testing/data/window_dimensions.html
diff --git a/third_party/WebKit/Source/web/tests/data/window_dimensions_wide_div.html b/third_party/WebKit/Source/core/testing/data/window_dimensions_wide_div.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/window_dimensions_wide_div.html rename to third_party/WebKit/Source/core/testing/data/window_dimensions_wide_div.html
diff --git a/third_party/WebKit/Source/web/tests/data/zero_sized_iframe.html b/third_party/WebKit/Source/core/testing/data/zero_sized_iframe.html similarity index 100% rename from third_party/WebKit/Source/web/tests/data/zero_sized_iframe.html rename to third_party/WebKit/Source/core/testing/data/zero_sized_iframe.html
diff --git a/third_party/WebKit/Source/core/timing/PerformanceTest.cpp b/third_party/WebKit/Source/core/timing/PerformanceTest.cpp index f3d75d7..c26eb671 100644 --- a/third_party/WebKit/Source/core/timing/PerformanceTest.cpp +++ b/third_party/WebKit/Source/core/timing/PerformanceTest.cpp
@@ -17,13 +17,13 @@ protected: void SetUp() override { page_holder_ = DummyPageHolder::Create(IntSize(800, 600)); - page_holder_->GetDocument().SetURL(KURL(KURL(), "https://example.com")); + page_holder_->GetDocument().SetURL(KURL(NullURL(), "https://example.com")); performance_ = Performance::Create(&page_holder_->GetFrame()); // Create another dummy page holder and pretend this is the iframe. another_page_holder_ = DummyPageHolder::Create(IntSize(400, 300)); another_page_holder_->GetDocument().SetURL( - KURL(KURL(), "https://iframed.com/bar")); + KURL(NullURL(), "https://iframed.com/bar")); } bool ObservingLongTasks() { @@ -116,7 +116,7 @@ EXPECT_TRUE(ObservingLongTasks()); // Simulate navigation commit. - DocumentInit init(KURL(), GetFrame()); + DocumentInit init(NullURL(), GetFrame()); GetDocument()->Shutdown(); GetFrame()->SetDOMWindow(LocalDOMWindow::Create(*GetFrame())); GetFrame()->DomWindow()->InstallNewDocument(AtomicString(), init); @@ -150,7 +150,7 @@ // Simulate changing the document while keeping the window. page_holder->GetDocument().Shutdown(); page_holder->GetFrame().DomWindow()->InstallNewDocument( - AtomicString(), DocumentInit(KURL(), &page_holder->GetFrame())); + AtomicString(), DocumentInit(NullURL(), &page_holder->GetFrame())); EXPECT_EQ(perf, DOMWindowPerformance::performance( *page_holder->GetFrame().DomWindow()));
diff --git a/third_party/WebKit/Source/core/workers/BUILD.gn b/third_party/WebKit/Source/core/workers/BUILD.gn index b747d62..d6157b7 100644 --- a/third_party/WebKit/Source/core/workers/BUILD.gn +++ b/third_party/WebKit/Source/core/workers/BUILD.gn
@@ -20,6 +20,7 @@ "InProcessWorkerMessagingProxy.h", "InProcessWorkerObjectProxy.cpp", "InProcessWorkerObjectProxy.h", + "InstalledScriptsManager.h", "MainThreadWorkletGlobalScope.cpp", "MainThreadWorkletGlobalScope.h", "ParentFrameTaskRunners.cpp", @@ -69,6 +70,8 @@ "WorkerSettings.h", "WorkerThread.cpp", "WorkerThread.h", + "WorkerThreadLifecycleContext.cpp", + "WorkerThreadLifecycleContext.h", "WorkerThreadLifecycleObserver.cpp", "WorkerThreadLifecycleObserver.h", "WorkerThreadStartupData.cpp",
diff --git a/third_party/WebKit/Source/core/workers/InstalledScriptsManager.h b/third_party/WebKit/Source/core/workers/InstalledScriptsManager.h new file mode 100644 index 0000000..7bc0eca1 --- /dev/null +++ b/third_party/WebKit/Source/core/workers/InstalledScriptsManager.h
@@ -0,0 +1,40 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef InstalledScriptsManager_h +#define InstalledScriptsManager_h + +#include "platform/network/HTTPHeaderMap.h" +#include "platform/weborigin/KURL.h" +#include "platform/wtf/Optional.h" +#include "platform/wtf/Vector.h" + +namespace blink { + +// InstalledScriptsManager provides the scripts of workers that have been +// installed. Currently it is only used for installed service workers. +class InstalledScriptsManager { + public: + InstalledScriptsManager() = default; + + struct ScriptData { + HTTPHeaderMap headers; + String source_text; + std::unique_ptr<Vector<char>> meta_data; + }; + + // Used on the main or worker thread. Returns true if the script has been + // installed. + virtual bool IsScriptInstalled(const KURL& script_url) const = 0; + + // Used on the worker thread. This is possible to return WTF::nullopt when the + // script has already been served from this manager (i.e. the same script is + // read more than once). This can be blocked if the script is not streamed + // yet. + virtual Optional<ScriptData> GetScriptData(const KURL& script_url) = 0; +}; + +} // namespace blink + +#endif // WorkerInstalledScriptsManager_h
diff --git a/third_party/WebKit/Source/core/workers/SharedWorker.cpp b/third_party/WebKit/Source/core/workers/SharedWorker.cpp index 87eedb00..8884896 100644 --- a/third_party/WebKit/Source/core/workers/SharedWorker.cpp +++ b/third_party/WebKit/Source/core/workers/SharedWorker.cpp
@@ -38,7 +38,6 @@ #include "core/frame/LocalFrame.h" #include "core/frame/LocalFrameClient.h" #include "core/frame/UseCounter.h" -#include "core/loader/FrameLoader.h" #include "core/probe/CoreProbes.h" #include "core/workers/SharedWorkerRepositoryClient.h" #include "platform/weborigin/KURL.h" @@ -81,15 +80,9 @@ if (script_url.IsEmpty()) return nullptr; - if (document->GetFrame() - ->Loader() - .Client() - ->GetSharedWorkerRepositoryClient()) { - document->GetFrame() - ->Loader() - .Client() - ->GetSharedWorkerRepositoryClient() - ->Connect(worker, std::move(remote_port), script_url, name); + if (document->GetFrame()->Client()->GetSharedWorkerRepositoryClient()) { + document->GetFrame()->Client()->GetSharedWorkerRepositoryClient()->Connect( + worker, std::move(remote_port), script_url, name); } return worker;
diff --git a/third_party/WebKit/Source/core/workers/ThreadedWorkletTest.cpp b/third_party/WebKit/Source/core/workers/ThreadedWorkletTest.cpp index 5079797..874baed 100644 --- a/third_party/WebKit/Source/core/workers/ThreadedWorkletTest.cpp +++ b/third_party/WebKit/Source/core/workers/ThreadedWorkletTest.cpp
@@ -166,7 +166,8 @@ } void TearDown() override { - GetWorkerThread()->TerminateAndWait(); + GetWorkerThread()->Terminate(); + GetWorkerThread()->WaitForShutdownForTesting(); testing::RunPendingTasks(); messaging_proxy_ = nullptr; }
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp index 4a3768d..5a6411d7e 100644 --- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
@@ -270,6 +270,8 @@ } CoreProbeSink* WorkerGlobalScope::GetProbeSink() { + if (IsClosing()) + return nullptr; if (WorkerInspectorController* controller = GetThread()->GetWorkerInspectorController()) return controller->GetProbeSink();
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.cpp b/third_party/WebKit/Source/core/workers/WorkerThread.cpp index c57e067..ae873e0 100644 --- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -37,6 +37,7 @@ #include "core/inspector/WorkerThreadDebugger.h" #include "core/origin_trials/OriginTrialContext.h" #include "core/probe/CoreProbes.h" +#include "core/workers/InstalledScriptsManager.h" #include "core/workers/ThreadedWorkletGlobalScope.h" #include "core/workers/WorkerBackingThread.h" #include "core/workers/WorkerClients.h" @@ -79,21 +80,6 @@ return next_worker_thread_id++; } -WorkerThreadLifecycleContext::WorkerThreadLifecycleContext() { - DCHECK(IsMainThread()); -} - -WorkerThreadLifecycleContext::~WorkerThreadLifecycleContext() { - DCHECK(IsMainThread()); -} - -void WorkerThreadLifecycleContext::NotifyContextDestroyed() { - DCHECK(IsMainThread()); - DCHECK(!was_context_destroyed_); - was_context_destroyed_ = true; - LifecycleNotifier::NotifyContextDestroyed(); -} - WorkerThread::~WorkerThread() { DCHECK(IsMainThread()); MutexLocker lock(ThreadSetMutex()); @@ -137,18 +123,6 @@ TerminateInternal(TerminationMode::kGraceful); } -void WorkerThread::TerminateAndWait() { - DCHECK(IsMainThread()); - - // The main thread will be blocked, so asynchronous graceful shutdown does - // not work. - TerminateInternal(TerminationMode::kForcible); - shutdown_event_->Wait(); - - // Destruct base::Thread and join the underlying system thread. - ClearWorkerBackingThread(); -} - void WorkerThread::TerminateAndWaitForAllWorkers() { DCHECK(IsMainThread()); @@ -409,17 +383,8 @@ void WorkerThread::MayForciblyTerminateExecution() { DCHECK(IsMainThread()); MutexLocker lock(thread_state_mutex_); - if (thread_state_ == ThreadState::kReadyToShutdown) { - // Shutdown sequence is now running. Just return. - return; - } - if (running_debugger_task_) { - // Any debugger task is guaranteed to finish, so we can wait for the - // completion. Shutdown sequence will start after that. - return; - } - - ForciblyTerminateExecution(lock, ExitCode::kAsyncForciblyTerminated); + if (ShouldScheduleToTerminateExecution(lock)) + ForciblyTerminateExecution(lock, ExitCode::kAsyncForciblyTerminated); } void WorkerThread::ForciblyTerminateExecution(const MutexLocker& lock, @@ -454,10 +419,10 @@ DCHECK_EQ(ThreadState::kNotStarted, thread_state_); KURL script_url = startup_data->script_url_; - String source_code = startup_data->source_code_; - WorkerThreadStartMode start_mode = startup_data->start_mode_; - std::unique_ptr<Vector<char>> cached_meta_data = + String given_source_code = startup_data->source_code_; + std::unique_ptr<Vector<char>> given_cached_meta_data = std::move(startup_data->cached_meta_data_); + WorkerThreadStartMode start_mode = startup_data->start_mode_; V8CacheOptions v8_cache_options = startup_data->worker_v8_settings_.v8_cache_options_; bool heap_limit_increased_for_debugging = @@ -512,19 +477,40 @@ return; } - if (GlobalScope()->IsWorkerGlobalScope()) { - WorkerGlobalScope* worker_global_scope = ToWorkerGlobalScope(GlobalScope()); - CachedMetadataHandler* handler = - worker_global_scope->CreateWorkerScriptCachedMetadataHandler( - script_url, cached_meta_data.get()); - worker_reporting_proxy_.WillEvaluateWorkerScript( - source_code.length(), - cached_meta_data.get() ? cached_meta_data->size() : 0); - bool success = worker_global_scope->ScriptController()->Evaluate( - ScriptSourceCode(source_code, script_url), nullptr, handler, - v8_cache_options); - worker_reporting_proxy_.DidEvaluateWorkerScript(success); + if (!GlobalScope()->IsWorkerGlobalScope()) + return; + + String source_code; + std::unique_ptr<Vector<char>> cached_meta_data; + if (GetInstalledScriptsManager() && + GetInstalledScriptsManager()->IsScriptInstalled(script_url)) { + // TODO(shimazu): Set ContentSecurityPolicy, ReferrerPolicy and + // OriginTrialTokens to |startup_data|. + // TODO(shimazu): Add a post task to the main thread for setting + // ContentSecurityPolicy and ReferrerPolicy. + auto script_data = GetInstalledScriptsManager()->GetScriptData(script_url); + DCHECK(script_data); + DCHECK(source_code.IsEmpty()); + DCHECK(!cached_meta_data); + source_code = std::move(script_data->source_text); + cached_meta_data = std::move(script_data->meta_data); + } else { + source_code = std::move(given_source_code); + cached_meta_data = std::move(given_cached_meta_data); } + DCHECK(!source_code.IsNull()); + + WorkerGlobalScope* worker_global_scope = ToWorkerGlobalScope(GlobalScope()); + CachedMetadataHandler* handler = + worker_global_scope->CreateWorkerScriptCachedMetadataHandler( + script_url, cached_meta_data.get()); + worker_reporting_proxy_.WillEvaluateWorkerScript( + source_code.length(), + cached_meta_data.get() ? cached_meta_data->size() : 0); + bool success = worker_global_scope->ScriptController()->Evaluate( + ScriptSourceCode(source_code, script_url), nullptr, handler, + v8_cache_options); + worker_reporting_proxy_.DidEvaluateWorkerScript(success); } void WorkerThread::PrepareForShutdownOnWorkerThread() {
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.h b/third_party/WebKit/Source/core/workers/WorkerThread.h index d91f4483..fcc6520ba 100644 --- a/third_party/WebKit/Source/core/workers/WorkerThread.h +++ b/third_party/WebKit/Source/core/workers/WorkerThread.h
@@ -33,8 +33,8 @@ #include "core/frame/csp/ContentSecurityPolicy.h" #include "core/loader/ThreadableLoadingContext.h" #include "core/workers/ParentFrameTaskRunners.h" +#include "core/workers/WorkerThreadLifecycleContext.h" #include "core/workers/WorkerThreadLifecycleObserver.h" -#include "platform/LifecycleNotifier.h" #include "platform/WaitableEvent.h" #include "platform/WebTaskRunner.h" #include "platform/scheduler/child/worker_global_scope_scheduler.h" @@ -48,6 +48,7 @@ class ConsoleMessageStorage; class InspectorTaskRunner; +class InstalledScriptsManager; class InterfaceProvider; class WorkerBackingThread; class WorkerInspectorController; @@ -60,26 +61,6 @@ kPauseWorkerGlobalScopeOnStart }; -// Used for notifying observers on the main thread of worker thread termination. -// The lifetime of this class is equal to that of WorkerThread. Created and -// destructed on the main thread. -class CORE_EXPORT WorkerThreadLifecycleContext final - : public GarbageCollectedFinalized<WorkerThreadLifecycleContext>, - public LifecycleNotifier<WorkerThreadLifecycleContext, - WorkerThreadLifecycleObserver> { - USING_GARBAGE_COLLECTED_MIXIN(WorkerThreadLifecycleContext); - WTF_MAKE_NONCOPYABLE(WorkerThreadLifecycleContext); - - public: - WorkerThreadLifecycleContext(); - ~WorkerThreadLifecycleContext() override; - void NotifyContextDestroyed() override; - - private: - friend class WorkerThreadLifecycleObserver; - bool was_context_destroyed_ = false; -}; - // WorkerThread is a kind of WorkerBackingThread client. Each worker mechanism // can access the lower thread infrastructure via an implementation of this // abstract class. Multiple WorkerThreads can share one WorkerBackingThread. @@ -111,9 +92,8 @@ void Start(std::unique_ptr<WorkerThreadStartupData>, ParentFrameTaskRunners*); void Terminate(); - // Called on the main thread. Internally calls terminateInternal() and wait - // (by *blocking* the calling thread) until the worker(s) is/are shut down. - void TerminateAndWait(); + // Called on the main thread for the leak detector. Waits by *blocking* the + // calling thread until the workers are shut down. static void TerminateAndWaitForAllWorkers(); // WebThread::TaskObserver. @@ -178,6 +158,11 @@ InterfaceProvider* GetInterfaceProvider(); + // For ServiceWorkerScriptStreaming. Returns nullptr otherwise. + virtual InstalledScriptsManager* GetInstalledScriptsManager() { + return nullptr; + } + protected: WorkerThread(ThreadableLoadingContext*, WorkerReportingProxy&);
diff --git a/third_party/WebKit/Source/core/workers/WorkerThreadLifecycleContext.cpp b/third_party/WebKit/Source/core/workers/WorkerThreadLifecycleContext.cpp new file mode 100644 index 0000000..791611fc --- /dev/null +++ b/third_party/WebKit/Source/core/workers/WorkerThreadLifecycleContext.cpp
@@ -0,0 +1,26 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/workers/WorkerThreadLifecycleContext.h" + +#include "core/workers/WorkerThreadLifecycleObserver.h" + +namespace blink { + +WorkerThreadLifecycleContext::WorkerThreadLifecycleContext() { + DCHECK(IsMainThread()); +} + +WorkerThreadLifecycleContext::~WorkerThreadLifecycleContext() { + DCHECK(IsMainThread()); +} + +void WorkerThreadLifecycleContext::NotifyContextDestroyed() { + DCHECK(IsMainThread()); + DCHECK(!was_context_destroyed_); + was_context_destroyed_ = true; + LifecycleNotifier::NotifyContextDestroyed(); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/workers/WorkerThreadLifecycleContext.h b/third_party/WebKit/Source/core/workers/WorkerThreadLifecycleContext.h new file mode 100644 index 0000000..df13fe3d --- /dev/null +++ b/third_party/WebKit/Source/core/workers/WorkerThreadLifecycleContext.h
@@ -0,0 +1,39 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WorkerThreadLifecycleContext_h +#define WorkerThreadLifecycleContext_h + +#include "core/CoreExport.h" +#include "platform/LifecycleNotifier.h" +#include "platform/heap/GarbageCollected.h" +#include "platform/wtf/Noncopyable.h" + +namespace blink { + +class WorkerThreadLifecycleObserver; + +// Used for notifying observers on the main thread of worker thread termination. +// The lifetime of this class is equal to that of WorkerThread. Created and +// destructed on the main thread. +class CORE_EXPORT WorkerThreadLifecycleContext final + : public GarbageCollectedFinalized<WorkerThreadLifecycleContext>, + public LifecycleNotifier<WorkerThreadLifecycleContext, + WorkerThreadLifecycleObserver> { + USING_GARBAGE_COLLECTED_MIXIN(WorkerThreadLifecycleContext); + WTF_MAKE_NONCOPYABLE(WorkerThreadLifecycleContext); + + public: + WorkerThreadLifecycleContext(); + ~WorkerThreadLifecycleContext() override; + void NotifyContextDestroyed() override; + + private: + friend class WorkerThreadLifecycleObserver; + bool was_context_destroyed_ = false; +}; + +} // namespace blink + +#endif // WorkerThreadLifecycleContext_h
diff --git a/third_party/WebKit/Source/core/workers/WorkerThreadLifecycleObserver.cpp b/third_party/WebKit/Source/core/workers/WorkerThreadLifecycleObserver.cpp index c0d1b83b..dbf7869 100644 --- a/third_party/WebKit/Source/core/workers/WorkerThreadLifecycleObserver.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerThreadLifecycleObserver.cpp
@@ -5,6 +5,7 @@ #include "core/workers/WorkerThreadLifecycleObserver.h" #include "core/workers/WorkerThread.h" +#include "core/workers/WorkerThreadLifecycleContext.h" #include "platform/wtf/Assertions.h" #include "platform/wtf/WTF.h"
diff --git a/third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp b/third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp index 6c87a6c..1c608538 100644 --- a/third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp
@@ -13,8 +13,8 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using testing::_; -using testing::AtMost; +using ::testing::_; +using ::testing::AtMost; namespace blink { @@ -189,7 +189,7 @@ // idle. worker_thread_->WaitForInit(); - worker_thread_->TerminateAndWait(); + WorkerThread::TerminateAndWaitForAllWorkers(); EXPECT_EQ(ExitCode::kSyncForciblyTerminated, GetExitCode()); } @@ -218,7 +218,7 @@ // TODO(nhiroki): Make this test deterministically pass through the case 1), // that is, terminateAndWait() is called before initializeOnWorkerThread(). // Then, rename this test to SyncTerminate_BeforeInitialization. - worker_thread_->TerminateAndWait(); + WorkerThread::TerminateAndWaitForAllWorkers(); ExitCode exit_code = GetExitCode(); EXPECT_TRUE(ExitCode::kGracefullyTerminated == exit_code || ExitCode::kSyncForciblyTerminated == exit_code); @@ -254,7 +254,7 @@ reporting_proxy_->WaitUntilScriptEvaluation(); // terminateAndWait() synchronously terminates the worker execution. - worker_thread_->TerminateAndWait(); + WorkerThread::TerminateAndWaitForAllWorkers(); EXPECT_EQ(ExitCode::kSyncForciblyTerminated, GetExitCode()); } @@ -273,7 +273,7 @@ EXPECT_EQ(ExitCode::kNotTerminated, GetExitCode()); // terminateAndWait() should overtake the scheduled force termination task. - worker_thread_->TerminateAndWait(); + WorkerThread::TerminateAndWaitForAllWorkers(); EXPECT_FALSE(IsForcibleTerminationTaskScheduled()); EXPECT_EQ(ExitCode::kSyncForciblyTerminated, GetExitCode()); } @@ -379,6 +379,4 @@ EXPECT_EQ(ExitCode::kGracefullyTerminated, GetExitCode()); } -// TODO(nhiroki): Add tests for terminateAndWaitForAllWorkers. - } // namespace blink
diff --git a/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h b/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h index b5fd6dd47..7bbdecd 100644 --- a/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h +++ b/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h
@@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef WorkerThreadTestHelper_h +#define WorkerThreadTestHelper_h + #include <memory> #include "bindings/core/v8/SourceLocation.h" @@ -134,3 +137,5 @@ } } // namespace blink + +#endif // WorkerThreadTestHelper_h
diff --git a/third_party/WebKit/Source/core/xml/DOMParser.cpp b/third_party/WebKit/Source/core/xml/DOMParser.cpp index 865ab26..e0c31f7 100644 --- a/third_party/WebKit/Source/core/xml/DOMParser.cpp +++ b/third_party/WebKit/Source/core/xml/DOMParser.cpp
@@ -27,7 +27,7 @@ Document* DOMParser::parseFromString(const String& str, const String& type) { Document* doc = DOMImplementation::createDocument( - type, DocumentInit(KURL(), nullptr, context_document_), false); + type, DocumentInit(NullURL(), nullptr, context_document_), false); doc->SetContent(str); doc->SetMimeType(AtomicString(type)); if (context_document_) {
diff --git a/third_party/WebKit/Source/core/xml/XSLTProcessor.cpp b/third_party/WebKit/Source/core/xml/XSLTProcessor.cpp index 14035e6..0304ce25 100644 --- a/third_party/WebKit/Source/core/xml/XSLTProcessor.cpp +++ b/third_party/WebKit/Source/core/xml/XSLTProcessor.cpp
@@ -84,7 +84,7 @@ old_document->Shutdown(); // Re-create the LocalFrameView if needed. if (has_view) - frame->Loader().Client()->TransitionToCommittedForNewPage(); + frame->Client()->TransitionToCommittedForNewPage(); result = frame->DomWindow()->InstallNewDocument(source_mime_type, init, force_xhtml);
diff --git a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp index e362be8..071c7027 100644 --- a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp +++ b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
@@ -456,7 +456,10 @@ if (error_occurred) { script_loader->DispatchErrorEvent(); - } else if (!was_canceled) { + } else { + // TODO(hiroshige): Remove |was_canceled| once it is confirmed that this + // CHECK never fails. + CHECK(!was_canceled); if (script_parser_blocking_time > 0.0) { DocumentParserTiming::From(*GetDocument()) .RecordParserBlockedOnScriptLoadDuration( @@ -464,10 +467,16 @@ script_loader->WasCreatedDuringDocumentWrite()); } - if (!script_loader->ExecuteScript(ClassicScript::Create(source_code))) - script_loader->DispatchErrorEvent(); - else - script_loader->DispatchLoadEvent(); + switch (script_loader->ExecuteScript(ClassicScript::Create(source_code))) { + case ScriptLoader::ExecuteScriptResult::kShouldFireErrorEvent: + script_loader->DispatchErrorEvent(); + break; + case ScriptLoader::ExecuteScriptResult::kShouldFireLoadEvent: + script_loader->DispatchLoadEvent(); + break; + case ScriptLoader::ExecuteScriptResult::kShouldFireNone: + break; + } } script_element_ = nullptr; @@ -634,7 +643,7 @@ DCHECK(XMLDocumentParserScope::current_document_); DCHECK_EQ(CurrentThread(), g_libxml_loader_thread); - KURL url(KURL(), uri); + KURL url(NullURL(), uri); if (!ShouldAllowExternalLoad(url)) return &g_global_descriptor; @@ -1127,13 +1136,22 @@ // the libxml2 and Qt XMLDocumentParser implementations. if (script_loader->ReadyToBeParserExecuted()) { - if (!script_loader->ExecuteScript(ClassicScript::Create(ScriptSourceCode( - script_loader->ScriptContent(), GetDocument()->Url(), - script_start_position_)))) { - script_loader->DispatchErrorEvent(); - return; + // 5th Clause, Step 23 of https://html.spec.whatwg.org/#prepare-a-script + switch (script_loader->ExecuteScript(ClassicScript::Create( + ScriptSourceCode(script_element_base->TextFromChildren(), + GetDocument()->Url(), script_start_position_)))) { + case ScriptLoader::ExecuteScriptResult::kShouldFireErrorEvent: + script_loader->DispatchErrorEvent(); + return; + case ScriptLoader::ExecuteScriptResult::kShouldFireLoadEvent: + // The load event is not fired because this is an inline script. + break; + case ScriptLoader::ExecuteScriptResult::kShouldFireNone: + break; } } else if (script_loader->WillBeParserExecuted()) { + // 1st/2nd Clauses, Step 23 of + // https://html.spec.whatwg.org/#prepare-a-script pending_script_ = script_loader->GetResource(); DCHECK_EQ(parser_blocking_pending_script_load_start_time_, 0.0); parser_blocking_pending_script_load_start_time_ =
diff --git a/third_party/WebKit/Source/devtools/front_end/main/Main.js b/third_party/WebKit/Source/devtools/front_end/main/Main.js index 217e11c..33288ac9 100644 --- a/third_party/WebKit/Source/devtools/front_end/main/Main.js +++ b/third_party/WebKit/Source/devtools/front_end/main/Main.js
@@ -122,6 +122,7 @@ Runtime.experiments.register('liveSASS', 'Live SASS'); Runtime.experiments.register('networkGroupingRequests', 'Network request groups support', true); Runtime.experiments.register('objectPreviews', 'Object previews', true); + Runtime.experiments.register('networkInWorkers', 'Network in workers', true); Runtime.experiments.register('persistence2', 'Persistence 2.0'); Runtime.experiments.register('sourceDiff', 'Source diff'); Runtime.experiments.register('terminalInDrawer', 'Terminal in drawer', true);
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js index 64bbd62..96d50d9 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js
@@ -340,7 +340,6 @@ /** * @override * @param {!Protocol.Network.RequestId} requestId - * @param {!Protocol.Page.FrameId} frameId * @param {!Protocol.Network.LoaderId} loaderId * @param {string} documentURL * @param {!Protocol.Network.Request} request @@ -349,28 +348,21 @@ * @param {!Protocol.Network.Initiator} initiator * @param {!Protocol.Network.Response=} redirectResponse * @param {!Protocol.Page.ResourceType=} resourceType + * @param {!Protocol.Page.FrameId=} frameId */ requestWillBeSent( - requestId, - frameId, - loaderId, - documentURL, - request, - time, - wallTime, - initiator, - redirectResponse, - resourceType) { + requestId, loaderId, documentURL, request, time, wallTime, initiator, redirectResponse, resourceType, frameId) { var networkRequest = this._inflightRequestsById[requestId]; if (networkRequest) { // FIXME: move this check to the backend. if (!redirectResponse) return; - this.responseReceived(requestId, frameId, loaderId, time, Protocol.Page.ResourceType.Other, redirectResponse); + this.responseReceived(requestId, loaderId, time, Protocol.Page.ResourceType.Other, redirectResponse, frameId); networkRequest = this._appendRedirect(requestId, time, request.url); this._manager.dispatchEventToListeners(SDK.NetworkManager.Events.RequestRedirected, networkRequest); } else { - networkRequest = this._createNetworkRequest(requestId, frameId, loaderId, request.url, documentURL, initiator); + networkRequest = + this._createNetworkRequest(requestId, frameId || '', loaderId, request.url, documentURL, initiator); } networkRequest.hasNetworkData = true; this._updateNetworkRequestWithRequest(networkRequest, request); @@ -396,19 +388,19 @@ /** * @override * @param {!Protocol.Network.RequestId} requestId - * @param {!Protocol.Page.FrameId} frameId * @param {!Protocol.Network.LoaderId} loaderId * @param {!Protocol.Network.Timestamp} time * @param {!Protocol.Page.ResourceType} resourceType * @param {!Protocol.Network.Response} response + * @param {!Protocol.Page.FrameId=} frameId */ - responseReceived(requestId, frameId, loaderId, time, resourceType, response) { + responseReceived(requestId, loaderId, time, resourceType, response, frameId) { var networkRequest = this._inflightRequestsById[requestId]; if (!networkRequest) { // We missed the requestWillBeSent. var eventData = {}; eventData.url = response.url; - eventData.frameId = frameId; + eventData.frameId = frameId || ''; eventData.loaderId = loaderId; eventData.resourceType = resourceType; eventData.mimeType = response.mimeType;
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js index f8c7e9e..00a05b0 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
@@ -468,8 +468,12 @@ * @return {number} */ _capabilitiesForType(type) { - if (type === 'worker') - return SDK.Target.Capability.JS | SDK.Target.Capability.Log; + if (type === 'worker') { + if (Runtime.experiments.isEnabled('networkInWorkers')) + return SDK.Target.Capability.JS | SDK.Target.Capability.Log | SDK.Target.Capability.Network; + else + return SDK.Target.Capability.JS | SDK.Target.Capability.Log; + } if (type === 'service_worker') return SDK.Target.Capability.Log | SDK.Target.Capability.Network | SDK.Target.Capability.Target; if (type === 'iframe') {
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js index b5e3377..b6134c5 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js
@@ -1021,7 +1021,7 @@ var types = TimelineModel.TimelineModel.RecordType; var resourceTypes = new Set( [types.ResourceSendRequest, types.ResourceReceiveResponse, types.ResourceReceivedData, types.ResourceFinish]); - var events = this.mainThreadEvents(); + var events = this.inspectedTargetEvents(); for (var i = 0; i < events.length; ++i) { var e = events[i]; if (!resourceTypes.has(e.name))
diff --git a/third_party/WebKit/Source/modules/BUILD.gn b/third_party/WebKit/Source/modules/BUILD.gn index 58845ec..b52c1d5 100644 --- a/third_party/WebKit/Source/modules/BUILD.gn +++ b/third_party/WebKit/Source/modules/BUILD.gn
@@ -194,8 +194,6 @@ "navigatorcontentutils/testing/NavigatorContentUtilsClientMock.h", "peerconnection/testing/InternalsRTCCertificate.cpp", "peerconnection/testing/InternalsRTCCertificate.h", - "peerconnection/testing/TestingPlatformSupportWithWebRTC.cpp", - "peerconnection/testing/TestingPlatformSupportWithWebRTC.h", "serviceworkers/testing/InternalsServiceWorker.cpp", "serviceworkers/testing/InternalsServiceWorker.h", "speech/testing/InternalsSpeechSynthesis.cpp",
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp index f7145d1..8a99193 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
@@ -1527,8 +1527,7 @@ LayoutObject* container_layout_object = nullptr; while (container) { container_layout_object = container->GetLayoutObject(); - if (container_layout_object && - container_layout_object->IsBoxModelObject() && + if (container_layout_object && container_layout_object->IsBox() && layout_object->IsDescendantOf(container_layout_object)) { if (container->IsScrollableContainer() || container_layout_object->HasLayer())
diff --git a/third_party/WebKit/Source/modules/cachestorage/Cache.cpp b/third_party/WebKit/Source/modules/cachestorage/Cache.cpp index 1115f90..debadfa 100644 --- a/third_party/WebKit/Source/modules/cachestorage/Cache.cpp +++ b/third_party/WebKit/Source/modules/cachestorage/Cache.cpp
@@ -625,7 +625,7 @@ new BarrierCallbackForPut(requests.size(), this, resolver); for (size_t i = 0; i < requests.size(); ++i) { - KURL url(KURL(), requests[i]->url()); + KURL url(NullURL(), requests[i]->url()); if (!url.ProtocolIsInHTTPFamily()) { barrier_callback->OnError("Request scheme '" + url.Protocol() + "' is unsupported");
diff --git a/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScopeTest.cpp b/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScopeTest.cpp index 3a5ee57..276ffba 100644 --- a/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScopeTest.cpp +++ b/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScopeTest.cpp
@@ -69,7 +69,8 @@ CrossThreadUnretained(&waitable_event))); waitable_event.Wait(); - worklet->TerminateAndWait(); + worklet->Terminate(); + worklet->WaitForShutdownForTesting(); } void RunBasicParsingTestOnWorklet(WorkerThread* thread,
diff --git a/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletThreadTest.cpp b/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletThreadTest.cpp index 19d3280..c35fa6b0 100644 --- a/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletThreadTest.cpp +++ b/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletThreadTest.cpp
@@ -124,7 +124,8 @@ std::unique_ptr<AnimationWorkletThread> worklet = CreateAnimationWorkletThread(); CheckWorkletCanExecuteScript(worklet.get()); - worklet->TerminateAndWait(); + worklet->Terminate(); + worklet->WaitForShutdownForTesting(); } // Tests that the same WebThread is used for new worklets if the WebThread is @@ -159,7 +160,8 @@ // Verify that the worklet can still successfully execute script. CheckWorkletCanExecuteScript(second_worklet.get()); - second_worklet->TerminateAndWait(); + second_worklet->Terminate(); + second_worklet->WaitForShutdownForTesting(); } // Tests that a new WebThread is created if all existing worklets are @@ -183,7 +185,8 @@ EXPECT_EQ(first_thread, second_thread); CheckWorkletCanExecuteScript(worklet.get()); - worklet->TerminateAndWait(); + worklet->Terminate(); + worklet->WaitForShutdownForTesting(); } // Tests that v8::Isolate and WebThread are correctly set-up if a worklet is @@ -212,7 +215,8 @@ // Verify that the isolate can run some scripts correctly in the second // worklet. CheckWorkletCanExecuteScript(second_worklet.get()); - second_worklet->TerminateAndWait(); + second_worklet->Terminate(); + second_worklet->WaitForShutdownForTesting(); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp index 8e3ad5ad..6622674 100644 --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp
@@ -156,7 +156,8 @@ std::unique_ptr<CompositorWorkerThread> compositor_worker = CreateCompositorWorker(); CheckWorkerCanExecuteScript(compositor_worker.get()); - compositor_worker->TerminateAndWait(); + compositor_worker->Terminate(); + compositor_worker->WaitForShutdownForTesting(); } // Tests that the same WebThread is used for new workers if the WebThread is @@ -191,7 +192,8 @@ // Verify that the worker can still successfully execute script. CheckWorkerCanExecuteScript(second_worker.get()); - second_worker->TerminateAndWait(); + second_worker->Terminate(); + second_worker->WaitForShutdownForTesting(); } // Tests that a new WebThread is created if all existing workers are terminated @@ -215,7 +217,8 @@ EXPECT_EQ(first_thread, second_thread); CheckWorkerCanExecuteScript(compositor_worker.get()); - compositor_worker->TerminateAndWait(); + compositor_worker->Terminate(); + compositor_worker->WaitForShutdownForTesting(); } // Tests that v8::Isolate and WebThread are correctly set-up if a worker is @@ -244,7 +247,8 @@ // Verify that the isolate can run some scripts correctly in the second // worker. CheckWorkerCanExecuteScript(second_worker.get()); - second_worker->TerminateAndWait(); + second_worker->Terminate(); + second_worker->WaitForShutdownForTesting(); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/credentialmanager/Credential.cpp b/third_party/WebKit/Source/modules/credentialmanager/Credential.cpp index 522a222d..f898dc1 100644 --- a/third_party/WebKit/Source/modules/credentialmanager/Credential.cpp +++ b/third_party/WebKit/Source/modules/credentialmanager/Credential.cpp
@@ -21,7 +21,7 @@ ExceptionState& exception_state) { if (url.IsEmpty()) return KURL(); - KURL parsed_url = KURL(KURL(), url); + KURL parsed_url = KURL(NullURL(), url); if (!parsed_url.IsValid()) exception_state.ThrowDOMException(kSyntaxError, "'" + url + "' is not a valid URL.");
diff --git a/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp b/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp index 04fdaf1..37b6fef 100644 --- a/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp +++ b/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp
@@ -199,7 +199,7 @@ Vector<KURL> providers; if (options.hasFederated() && options.federated().hasProviders()) { for (const auto& string : options.federated().providers()) { - KURL url = KURL(KURL(), string); + KURL url = KURL(NullURL(), string); if (url.IsValid()) providers.push_back(std::move(url)); }
diff --git a/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.cpp b/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.cpp index 490c346..05637b67e 100644 --- a/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.cpp +++ b/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.cpp
@@ -63,9 +63,9 @@ String NavigatorDoNotTrack::doNotTrack() { LocalFrame* frame = GetSupplementable()->GetFrame(); - if (!frame || !frame->Loader().Client()) + if (!frame || !frame->Client()) return String(); - return frame->Loader().Client()->DoNotTrackValue(); + return frame->Client()->DoNotTrackValue(); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp b/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp index 9b2f5e9..7878372 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp +++ b/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
@@ -327,6 +327,10 @@ "The context provided is not associated with a page.")); } + UseCounter::Count(*document, WebFeature::kEncryptedMediaSecureOrigin); + UseCounter::CountCrossOriginIframe( + *document, WebFeature::kEncryptedMediaCrossOriginIframe); + // 4. Let origin be the origin of document. // (Passed with the execution context.)
diff --git a/third_party/WebKit/Source/modules/exported/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/modules/exported/WebEmbeddedWorkerImpl.cpp index 9ef1d70..ff0faa6 100644 --- a/third_party/WebKit/Source/modules/exported/WebEmbeddedWorkerImpl.cpp +++ b/third_party/WebKit/Source/modules/exported/WebEmbeddedWorkerImpl.cpp
@@ -54,11 +54,13 @@ #include "modules/serviceworkers/ServiceWorkerContainerClient.h" #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" #include "modules/serviceworkers/ServiceWorkerGlobalScopeProxy.h" +#include "modules/serviceworkers/ServiceWorkerInstalledScriptsManager.h" #include "modules/serviceworkers/ServiceWorkerThread.h" #include "platform/Histogram.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/SharedBuffer.h" #include "platform/heap/Handle.h" +#include "platform/instrumentation/tracing/TraceEvent.h" #include "platform/loader/fetch/SubstituteData.h" #include "platform/network/ContentSecurityPolicyParsers.h" #include "platform/network/ContentSecurityPolicyResponseHeaders.h" @@ -82,11 +84,14 @@ template class MODULES_EXPORT WorkerClientsInitializer<WebEmbeddedWorkerImpl>; -WebEmbeddedWorker* WebEmbeddedWorker::Create( - WebServiceWorkerContextClient* client, - WebContentSettingsClient* content_settings_client) { - return new WebEmbeddedWorkerImpl(WTF::WrapUnique(client), - WTF::WrapUnique(content_settings_client)); +std::unique_ptr<WebEmbeddedWorker> WebEmbeddedWorker::Create( + std::unique_ptr<WebServiceWorkerContextClient> client, + std::unique_ptr<WebServiceWorkerInstalledScriptsManager> + installed_scripts_manager, + std::unique_ptr<WebContentSettingsClient> content_settings_client) { + return WTF::MakeUnique<WebEmbeddedWorkerImpl>( + std::move(client), std::move(installed_scripts_manager), + std::move(content_settings_client)); } static HashSet<WebEmbeddedWorkerImpl*>& RunningWorkerInstances() { @@ -96,8 +101,13 @@ WebEmbeddedWorkerImpl::WebEmbeddedWorkerImpl( std::unique_ptr<WebServiceWorkerContextClient> client, + std::unique_ptr<WebServiceWorkerInstalledScriptsManager> + installed_scripts_manager, std::unique_ptr<WebContentSettingsClient> content_settings_client) : worker_context_client_(std::move(client)), + installed_scripts_manager_( + WTF::MakeUnique<ServiceWorkerInstalledScriptsManager>( + std::move(installed_scripts_manager))), content_settings_client_(std::move(content_settings_client)), worker_inspector_proxy_(WorkerInspectorProxy::Create()), web_view_(nullptr), @@ -110,11 +120,8 @@ } WebEmbeddedWorkerImpl::~WebEmbeddedWorkerImpl() { - // Prevent onScriptLoaderFinished from deleting 'this'. - asked_to_terminate_ = true; - - if (worker_thread_) - worker_thread_->TerminateAndWait(); + // TerminateWorkerContext() must be called before the destructor. + DCHECK(asked_to_terminate_); DCHECK(RunningWorkerInstances().Contains(this)); RunningWorkerInstances().erase(this); @@ -308,9 +315,9 @@ RefPtr<SharedBuffer> buffer( SharedBuffer::Create(content.data(), content.length())); loading_shadow_page_ = true; - main_frame_->GetFrame()->Loader().Load( - FrameLoadRequest(0, ResourceRequest(worker_start_data_.script_url), - SubstituteData(buffer, "text/html", "UTF-8", KURL()))); + main_frame_->GetFrame()->Loader().Load(FrameLoadRequest( + 0, ResourceRequest(worker_start_data_.script_url), + SubstituteData(buffer, "text/html", "UTF-8", NullURL()))); } void WebEmbeddedWorkerImpl::FrameDetached(WebLocalFrame* frame, @@ -329,6 +336,23 @@ loading_shadow_page_ = false; main_frame_->DataSource()->SetServiceWorkerNetworkProvider( worker_context_client_->CreateServiceWorkerNetworkProvider()); + + // Kickstart the worker before loading the script when the script has been + // installed. + if (installed_scripts_manager_->IsScriptInstalled( + worker_start_data_.script_url)) { + // TODO(shimazu): Move WorkerScriptLoaded to the correct place which is + // after InstalledScriptsManager::GetScriptData() called at + // WorkerThread::InitializeOnWorkerThread(). + worker_context_client_->WorkerScriptLoaded(); + if (pause_after_download_state_ == kDoPauseAfterDownload) { + pause_after_download_state_ = kIsPausedAfterDownload; + return; + } + StartWorkerThread(); + return; + } + main_script_loader_ = WorkerScriptLoader::Create(); main_script_loader_->LoadAsynchronously( *main_frame_->GetFrame()->GetDocument(), worker_start_data_.script_url, @@ -374,9 +398,7 @@ // loading code. if (!worker_context_client_->HasAssociatedRegistration() || main_script_loader_->Failed()) { - main_script_loader_.Clear(); - // This deletes 'this'. - worker_context_client_->WorkerContextFailedToStart(); + TerminateWorkerContext(); return; } worker_context_client_->WorkerScriptLoaded(); @@ -430,42 +452,53 @@ std::move(web_worker_fetch_context)); } - // We need to set the CSP to both the shadow page's document and the - // ServiceWorkerGlobalScope. - document->InitContentSecurityPolicy( - main_script_loader_->ReleaseContentSecurityPolicy()); - if (!main_script_loader_->GetReferrerPolicy().IsNull()) { - document->ParseAndSetReferrerPolicy( - main_script_loader_->GetReferrerPolicy()); - } - - KURL script_url = main_script_loader_->Url(); WorkerThreadStartMode start_mode = worker_inspector_proxy_->WorkerStartMode(document); std::unique_ptr<WorkerSettings> worker_settings = WTF::WrapUnique(new WorkerSettings(document->GetSettings())); - WorkerV8Settings worker_v8_settings = WorkerV8Settings::Default(); worker_v8_settings.v8_cache_options_ = static_cast<V8CacheOptions>(worker_start_data_.v8_cache_options); - std::unique_ptr<WorkerThreadStartupData> startup_data = - WorkerThreadStartupData::Create( - script_url, worker_start_data_.user_agent, - main_script_loader_->SourceText(), - main_script_loader_->ReleaseCachedMetadata(), start_mode, - document->GetContentSecurityPolicy()->Headers().get(), - main_script_loader_->GetReferrerPolicy(), starter_origin, - worker_clients, main_script_loader_->ResponseAddressSpace(), - main_script_loader_->OriginTrialTokens(), std::move(worker_settings), - worker_v8_settings); - - main_script_loader_.Clear(); + std::unique_ptr<WorkerThreadStartupData> startup_data; + // |main_script_loader_| isn't created if the InstalledScriptsManager had the + // script. + if (main_script_loader_) { + // We need to set the CSP to both the shadow page's document and the + // ServiceWorkerGlobalScope. + document->InitContentSecurityPolicy( + main_script_loader_->ReleaseContentSecurityPolicy()); + if (!main_script_loader_->GetReferrerPolicy().IsNull()) { + document->ParseAndSetReferrerPolicy( + main_script_loader_->GetReferrerPolicy()); + } + startup_data = WorkerThreadStartupData::Create( + worker_start_data_.script_url, worker_start_data_.user_agent, + main_script_loader_->SourceText(), + main_script_loader_->ReleaseCachedMetadata(), start_mode, + document->GetContentSecurityPolicy()->Headers().get(), + main_script_loader_->GetReferrerPolicy(), starter_origin, + worker_clients, main_script_loader_->ResponseAddressSpace(), + main_script_loader_->OriginTrialTokens(), std::move(worker_settings), + worker_v8_settings); + main_script_loader_.Clear(); + } else { + // TODO(shimazu): Set ContentSecurityPolicy, ReferrerPolicy to |document| + // before evaluating the main script. + startup_data = WorkerThreadStartupData::Create( + worker_start_data_.script_url, worker_start_data_.user_agent, + "" /* SourceText */, nullptr /* CachedMetadata */, start_mode, + nullptr /* ContentSecurityPolicy */, "" /* ReferrerPolicy */, + starter_origin, worker_clients, worker_start_data_.address_space, + nullptr /* OriginTrialTokens */, std::move(worker_settings), + worker_v8_settings); + } worker_global_scope_proxy_ = ServiceWorkerGlobalScopeProxy::Create(*this, *worker_context_client_); worker_thread_ = WTF::MakeUnique<ServiceWorkerThread>( - ThreadableLoadingContext::Create(*document), *worker_global_scope_proxy_); + ThreadableLoadingContext::Create(*document), *worker_global_scope_proxy_, + std::move(installed_scripts_manager_)); // We have a dummy document here for loading but it doesn't really represent // the document/frame of associated document(s) for this worker. Here we @@ -475,7 +508,7 @@ ParentFrameTaskRunners::Create(nullptr)); worker_inspector_proxy_->WorkerThreadCreated(document, worker_thread_.get(), - script_url); + worker_start_data_.script_url); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/exported/WebEmbeddedWorkerImpl.h b/third_party/WebKit/Source/modules/exported/WebEmbeddedWorkerImpl.h index 1b33a0dd..45a614ac 100644 --- a/third_party/WebKit/Source/modules/exported/WebEmbeddedWorkerImpl.h +++ b/third_party/WebKit/Source/modules/exported/WebEmbeddedWorkerImpl.h
@@ -47,6 +47,7 @@ class ThreadableLoadingContext; class ServiceWorkerGlobalScopeProxy; +class ServiceWorkerInstalledScriptsManager; class WebLocalFrameBase; class WebView; class WorkerInspectorProxy; @@ -60,8 +61,10 @@ WTF_MAKE_NONCOPYABLE(WebEmbeddedWorkerImpl); public: - WebEmbeddedWorkerImpl(std::unique_ptr<WebServiceWorkerContextClient>, - std::unique_ptr<WebContentSettingsClient>); + WebEmbeddedWorkerImpl( + std::unique_ptr<WebServiceWorkerContextClient>, + std::unique_ptr<WebServiceWorkerInstalledScriptsManager>, + std::unique_ptr<WebContentSettingsClient>); ~WebEmbeddedWorkerImpl() override; // WebEmbeddedWorker overrides. @@ -111,6 +114,11 @@ std::unique_ptr<WebServiceWorkerContextClient> worker_context_client_; + // This is valid until the worker thread is created. After the worker thread + // is created, this is passed to the worker thread. + std::unique_ptr<ServiceWorkerInstalledScriptsManager> + installed_scripts_manager_; + // This is kept until startWorkerContext is called, and then passed on // to WorkerContext. std::unique_ptr<WebContentSettingsClient> content_settings_client_;
diff --git a/third_party/WebKit/Source/modules/fetch/FormDataBytesConsumerTest.cpp b/third_party/WebKit/Source/modules/fetch/FormDataBytesConsumerTest.cpp index e0642f9..31d64f5f 100644 --- a/third_party/WebKit/Source/modules/fetch/FormDataBytesConsumerTest.cpp +++ b/third_party/WebKit/Source/modules/fetch/FormDataBytesConsumerTest.cpp
@@ -38,7 +38,8 @@ data->AppendData("foo", 3); data->AppendFileRange("/foo/bar/baz", 3, 4, 5); - data->AppendFileSystemURLRange(KURL(KURL(), "file:///foo/bar/baz"), 6, 7, 8); + data->AppendFileSystemURLRange(KURL(NullURL(), "file:///foo/bar/baz"), 6, 7, + 8); std::unique_ptr<BlobData> blob_data = BlobData::Create(); blob_data->AppendText("hello", false); auto size = blob_data->length();
diff --git a/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp b/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp index 720a709..927dc7d 100644 --- a/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp +++ b/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp
@@ -154,7 +154,7 @@ return; } KURL storage_partition = - KURL(KURL(), context->GetSecurityOrigin()->ToString()); + KURL(NullURL(), context->GetSecurityOrigin()->ToString()); file_system->OpenFileSystem(storage_partition, static_cast<WebFileSystemType>(type), callbacks->Release());
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp index de54d55..1fcf203c 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp
@@ -64,7 +64,7 @@ void SetUp() override { url_loader_mock_factory_ = Platform::Current()->GetURLLoaderMockFactory(); WebURLResponse response; - response.SetURL(KURL(KURL(), "blob:")); + response.SetURL(KURL(NullURL(), "blob:")); url_loader_mock_factory_->RegisterURLProtocol(WebString("blob"), response, ""); }
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp index c5780aa..683d45b9 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp
@@ -82,7 +82,7 @@ void SetUp() override { url_loader_mock_factory_ = Platform::Current()->GetURLLoaderMockFactory(); WebURLResponse response; - response.SetURL(KURL(KURL(), "blob:")); + response.SetURL(KURL(NullURL(), "blob:")); url_loader_mock_factory_->RegisterURLProtocol(WebString("blob"), response, ""); }
diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp index 6af62fd..dbb1c82 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp +++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
@@ -805,7 +805,7 @@ << " failed: tracks mismatch the first init segment."; return false; } -#if !LOG_DISABLED +#if DCHECK_IS_ON() const char* log_track_type_str = (track_info.track_type == WebMediaPlayer::kAudioTrack) ? "audio" : "video";
diff --git a/third_party/WebKit/Source/modules/nfc/NFC.cpp b/third_party/WebKit/Source/modules/nfc/NFC.cpp index 2c7a679..fff6f4f0 100644 --- a/third_party/WebKit/Source/modules/nfc/NFC.cpp +++ b/third_party/WebKit/Source/modules/nfc/NFC.cpp
@@ -403,7 +403,8 @@ } blink::V8StringResource<> string_resource = record.data().V8Value(); - if (!string_resource.Prepare() || !KURL(KURL(), string_resource).IsValid()) { + if (!string_resource.Prepare() || + !KURL(NullURL(), string_resource).IsValid()) { return RejectWithDOMException(script_state, kSyntaxError, "Cannot parse data for 'url' record."); }
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.cpp b/third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.cpp index 57daafd..fe2a3736 100644 --- a/third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.cpp +++ b/third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.cpp
@@ -54,7 +54,7 @@ // directory. WebURL RegisterMockedURL(const String& file_name) { WebURL registered_url = URLTestHelpers::RegisterMockedURLLoadFromBase( - kBaseUrl, testing::WebTestDataPath(kBaseDir), file_name, "image/png"); + kBaseUrl, testing::CoreTestDataPath(kBaseDir), file_name, "image/png"); return registered_url; }
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp b/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp index b50eae3..8b2935b8 100644 --- a/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp +++ b/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp
@@ -67,7 +67,7 @@ // test data directory. WebURL RegisterMockedURL(const String& file_name) { WebURL registered_url = URLTestHelpers::RegisterMockedURLLoadFromBase( - kBaseUrl, testing::WebTestDataPath(kBaseDir), file_name, "image/png"); + kBaseUrl, testing::CoreTestDataPath(kBaseDir), file_name, "image/png"); return registered_url; }
diff --git a/third_party/WebKit/Source/modules/payments/PaymentManager.cpp b/third_party/WebKit/Source/modules/payments/PaymentManager.cpp index 4be03f6..8b04369 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentManager.cpp +++ b/third_party/WebKit/Source/modules/payments/PaymentManager.cpp
@@ -6,6 +6,10 @@ #include "bindings/core/v8/ScriptPromise.h" #include "core/dom/DOMException.h" +#include "core/dom/Document.h" +#include "core/frame/LocalFrame.h" +#include "core/workers/WorkerGlobalScope.h" +#include "core/workers/WorkerThread.h" #include "modules/payments/PaymentInstruments.h" #include "modules/serviceworkers/ServiceWorkerRegistration.h" #include "platform/bindings/ScriptState.h" @@ -34,12 +38,21 @@ PaymentManager::PaymentManager(ServiceWorkerRegistration* registration) : registration_(registration), instruments_(nullptr) { DCHECK(registration); - Platform::Current()->GetInterfaceProvider()->GetInterface( - mojo::MakeRequest(&manager_)); + + auto request = mojo::MakeRequest(&manager_); + ExecutionContext* context = registration->GetExecutionContext(); + if (context && context->IsDocument()) { + LocalFrame* frame = ToDocument(context)->GetFrame(); + if (frame) + frame->GetInterfaceProvider()->GetInterface(std::move(request)); + } else if (context && context->IsWorkerGlobalScope()) { + WorkerThread* thread = ToWorkerGlobalScope(context)->GetThread(); + if (thread) + thread->GetInterfaceProvider()->GetInterface(std::move(request)); + } manager_.set_connection_error_handler(ConvertToBaseCallback(WTF::Bind( &PaymentManager::OnServiceConnectionError, WrapWeakPersistent(this)))); - manager_->Init(registration_->scope()); }
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequestDetailsTest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequestDetailsTest.cpp index 8402231..3f821bc 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentRequestDetailsTest.cpp +++ b/third_party/WebKit/Source/modules/payments/PaymentRequestDetailsTest.cpp
@@ -128,7 +128,7 @@ TEST_P(PaymentRequestDetailsTest, ValidatesDetails) { V8TestingScope scope; scope.GetDocument().SetSecurityOrigin( - SecurityOrigin::Create(KURL(KURL(), "https://www.example.com/"))); + SecurityOrigin::Create(KURL(NullURL(), "https://www.example.com/"))); PaymentOptions options; options.setRequestShipping(true); PaymentRequest::Create(
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp index 6f684a76..79cd4496 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp +++ b/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp
@@ -17,7 +17,7 @@ TEST(PaymentRequestTest, SecureContextRequired) { V8TestingScope scope; scope.GetDocument().SetSecurityOrigin( - SecurityOrigin::Create(KURL(KURL(), "http://www.example.com/"))); + SecurityOrigin::Create(KURL(NullURL(), "http://www.example.com/"))); PaymentRequest::Create( scope.GetExecutionContext(), BuildPaymentMethodDataForTest(),
diff --git a/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp b/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp index e1b2397a..a2a53ee 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp +++ b/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp
@@ -203,7 +203,7 @@ void MakePaymentRequestOriginSecure(Document& document) { document.SetSecurityOrigin( - SecurityOrigin::Create(KURL(KURL(), "https://www.example.com/"))); + SecurityOrigin::Create(KURL(NullURL(), "https://www.example.com/"))); } PaymentRequestMockFunctionScope::PaymentRequestMockFunctionScope(
diff --git a/third_party/WebKit/Source/modules/payments/PaymentsValidators.cpp b/third_party/WebKit/Source/modules/payments/PaymentsValidators.cpp index 7aac315f..02df6c8 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentsValidators.cpp +++ b/third_party/WebKit/Source/modules/payments/PaymentsValidators.cpp
@@ -30,7 +30,7 @@ return false; } - if (!KURL(KURL(), system).IsValid()) { + if (!KURL(NullURL(), system).IsValid()) { if (optional_error_message) *optional_error_message = "The currency system is not a valid URL";
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp index 8b1f298..e4d4603 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
@@ -52,7 +52,6 @@ #include "core/frame/LocalFrameClient.h" #include "core/frame/UseCounter.h" #include "core/html/VoidCallback.h" -#include "core/loader/FrameLoader.h" #include "modules/crypto/CryptoResultImpl.h" #include "modules/mediastream/MediaConstraintsImpl.h" #include "modules/mediastream/MediaStreamEvent.h" @@ -297,7 +296,7 @@ String credential = ice_server.credential(); for (const String& url_string : url_strings) { - KURL url(KURL(), url_string); + KURL url(NullURL(), url_string); if (!url.IsValid()) { exception_state.ThrowDOMException( kSyntaxError, "'" + url_string + "' is not a valid URL."); @@ -516,10 +515,8 @@ return; } - document->GetFrame() - ->Loader() - .Client() - ->DispatchWillStartUsingPeerConnectionHandler(peer_handler_.get()); + document->GetFrame()->Client()->DispatchWillStartUsingPeerConnectionHandler( + peer_handler_.get()); if (!peer_handler_->Initialize(configuration, constraints)) { closed_ = true;
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnectionTest.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnectionTest.cpp index 7346788..693da916 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnectionTest.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnectionTest.cpp
@@ -12,9 +12,9 @@ #include "modules/mediastream/MediaStreamTrack.h" #include "modules/peerconnection/RTCConfiguration.h" #include "modules/peerconnection/RTCIceServer.h" -#include "modules/peerconnection/testing/TestingPlatformSupportWithWebRTC.h" #include "platform/heap/HeapAllocator.h" #include "platform/testing/TestingPlatformSupport.h" +#include "platform/testing/TestingPlatformSupportWithWebRTC.h" #include "public/platform/Platform.h" #include "public/platform/WebRTCError.h" #include "public/platform/WebRTCPeerConnectionHandler.h"
diff --git a/third_party/WebKit/Source/modules/peerconnection/testing/TestingPlatformSupportWithWebRTC.cpp b/third_party/WebKit/Source/modules/peerconnection/testing/TestingPlatformSupportWithWebRTC.cpp deleted file mode 100644 index ffbd1a0c..0000000 --- a/third_party/WebKit/Source/modules/peerconnection/testing/TestingPlatformSupportWithWebRTC.cpp +++ /dev/null
@@ -1,102 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "modules/peerconnection/testing/TestingPlatformSupportWithWebRTC.h" - -#include "public/platform/WebRTCError.h" -#include "public/platform/WebRTCRtpReceiver.h" -#include "public/platform/WebRTCRtpSender.h" -#include "public/platform/WebRTCSessionDescription.h" -#include "public/platform/WebVector.h" - -namespace blink { - -MockWebRTCPeerConnectionHandler::MockWebRTCPeerConnectionHandler() {} - -MockWebRTCPeerConnectionHandler::~MockWebRTCPeerConnectionHandler() {} - -bool MockWebRTCPeerConnectionHandler::Initialize(const WebRTCConfiguration&, - const WebMediaConstraints&) { - return true; -} - -void MockWebRTCPeerConnectionHandler::CreateOffer( - const WebRTCSessionDescriptionRequest&, - const WebMediaConstraints&) {} - -void MockWebRTCPeerConnectionHandler::CreateOffer( - const WebRTCSessionDescriptionRequest&, - const WebRTCOfferOptions&) {} - -void MockWebRTCPeerConnectionHandler::CreateAnswer( - const WebRTCSessionDescriptionRequest&, - const WebMediaConstraints&) {} - -void MockWebRTCPeerConnectionHandler::CreateAnswer( - const WebRTCSessionDescriptionRequest&, - const WebRTCAnswerOptions&) {} - -void MockWebRTCPeerConnectionHandler::SetLocalDescription( - const WebRTCVoidRequest&, - const WebRTCSessionDescription&) {} - -void MockWebRTCPeerConnectionHandler::SetRemoteDescription( - const WebRTCVoidRequest&, - const WebRTCSessionDescription&) {} - -WebRTCSessionDescription MockWebRTCPeerConnectionHandler::LocalDescription() { - return WebRTCSessionDescription(); -} - -WebRTCSessionDescription MockWebRTCPeerConnectionHandler::RemoteDescription() { - return WebRTCSessionDescription(); -} - -WebRTCErrorType MockWebRTCPeerConnectionHandler::SetConfiguration( - const WebRTCConfiguration&) { - return WebRTCErrorType::kNone; -} - -bool MockWebRTCPeerConnectionHandler::AddStream(const WebMediaStream&, - const WebMediaConstraints&) { - return true; -} - -void MockWebRTCPeerConnectionHandler::RemoveStream(const WebMediaStream&) {} - -void MockWebRTCPeerConnectionHandler::GetStats(const WebRTCStatsRequest&) {} - -void MockWebRTCPeerConnectionHandler::GetStats( - std::unique_ptr<WebRTCStatsReportCallback>) {} - -WebVector<std::unique_ptr<WebRTCRtpSender>> -MockWebRTCPeerConnectionHandler::GetSenders() { - return WebVector<std::unique_ptr<WebRTCRtpSender>>(); -} - -WebVector<std::unique_ptr<WebRTCRtpReceiver>> -MockWebRTCPeerConnectionHandler::GetReceivers() { - return WebVector<std::unique_ptr<WebRTCRtpReceiver>>(); -} - -WebRTCDataChannelHandler* MockWebRTCPeerConnectionHandler::CreateDataChannel( - const WebString& label, - const WebRTCDataChannelInit&) { - return nullptr; -} - -WebRTCDTMFSenderHandler* MockWebRTCPeerConnectionHandler::CreateDTMFSender( - const WebMediaStreamTrack&) { - return nullptr; -} - -void MockWebRTCPeerConnectionHandler::Stop() {} - -std::unique_ptr<WebRTCPeerConnectionHandler> -TestingPlatformSupportWithWebRTC::CreateRTCPeerConnectionHandler( - WebRTCPeerConnectionHandlerClient*) { - return WTF::MakeUnique<MockWebRTCPeerConnectionHandler>(); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/modules/peerconnection/testing/TestingPlatformSupportWithWebRTC.h b/third_party/WebKit/Source/modules/peerconnection/testing/TestingPlatformSupportWithWebRTC.h deleted file mode 100644 index 52608f9..0000000 --- a/third_party/WebKit/Source/modules/peerconnection/testing/TestingPlatformSupportWithWebRTC.h +++ /dev/null
@@ -1,54 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "bindings/core/v8/V8BindingForTesting.h" -#include "platform/testing/TestingPlatformSupport.h" -#include "public/platform/WebRTCPeerConnectionHandler.h" - -namespace blink { - -class MockWebRTCPeerConnectionHandler : public WebRTCPeerConnectionHandler { - public: - MockWebRTCPeerConnectionHandler(); - ~MockWebRTCPeerConnectionHandler() override; - - bool Initialize(const WebRTCConfiguration&, - const WebMediaConstraints&) override; - - void CreateOffer(const WebRTCSessionDescriptionRequest&, - const WebMediaConstraints&) override; - void CreateOffer(const WebRTCSessionDescriptionRequest&, - const WebRTCOfferOptions&) override; - void CreateAnswer(const WebRTCSessionDescriptionRequest&, - const WebMediaConstraints&) override; - void CreateAnswer(const WebRTCSessionDescriptionRequest&, - const WebRTCAnswerOptions&) override; - void SetLocalDescription(const WebRTCVoidRequest&, - const WebRTCSessionDescription&) override; - void SetRemoteDescription(const WebRTCVoidRequest&, - const WebRTCSessionDescription&) override; - WebRTCSessionDescription LocalDescription() override; - WebRTCSessionDescription RemoteDescription() override; - WebRTCErrorType SetConfiguration(const WebRTCConfiguration&) override; - bool AddStream(const WebMediaStream&, const WebMediaConstraints&) override; - void RemoveStream(const WebMediaStream&) override; - void GetStats(const WebRTCStatsRequest&) override; - void GetStats(std::unique_ptr<WebRTCStatsReportCallback>) override; - WebVector<std::unique_ptr<WebRTCRtpSender>> GetSenders() override; - WebVector<std::unique_ptr<WebRTCRtpReceiver>> GetReceivers() override; - WebRTCDataChannelHandler* CreateDataChannel( - const WebString& label, - const WebRTCDataChannelInit&) override; - WebRTCDTMFSenderHandler* CreateDTMFSender( - const WebMediaStreamTrack&) override; - void Stop() override; -}; - -class TestingPlatformSupportWithWebRTC : public TestingPlatformSupport { - public: - std::unique_ptr<WebRTCPeerConnectionHandler> CreateRTCPeerConnectionHandler( - WebRTCPeerConnectionHandlerClient*) override; -}; - -} // namespace blink
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationReceiverTest.cpp b/third_party/WebKit/Source/modules/presentation/PresentationReceiverTest.cpp index 914337a..17d4c8cd 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationReceiverTest.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationReceiverTest.cpp
@@ -92,7 +92,7 @@ // Receive first connection. receiver->OnReceiverConnectionAvailable( - WebPresentationInfo(KURL(KURL(), "http://example.com"), "id")); + WebPresentationInfo(KURL(NullURL(), "http://example.com"), "id")); VerifyConnectionListPropertyState(ScriptPromisePropertyBase::kResolved, receiver); @@ -110,7 +110,7 @@ receiver->connectionList(scope.GetScriptState()); - WebPresentationInfo presentation_info(KURL(KURL(), "http://example.com"), + WebPresentationInfo presentation_info(KURL(NullURL(), "http://example.com"), "id"); // Receive first connection. receiver->OnReceiverConnectionAvailable(presentation_info); @@ -129,7 +129,7 @@ AddConnectionavailableEventListener(event_handler, receiver); EXPECT_CALL(*event_handler, handleEvent(testing::_, testing::_)).Times(0); - WebPresentationInfo presentation_info(KURL(KURL(), "http://example.com"), + WebPresentationInfo presentation_info(KURL(NullURL(), "http://example.com"), "id"); // Receive first connection. auto* connection1 = @@ -160,14 +160,14 @@ auto receiver = new PresentationReceiver(&scope.GetFrame(), nullptr); // Receive first connection. - WebPresentationInfo presentation_info1(KURL(KURL(), "http://example1.com"), + WebPresentationInfo presentation_info1(KURL(NullURL(), "http://example1.com"), "id1"); auto* connection1 = receiver->OnReceiverConnectionAvailable(presentation_info1); EXPECT_TRUE(connection1); // Receive second connection. - WebPresentationInfo presentation_info2(KURL(KURL(), "http://example2.com"), + WebPresentationInfo presentation_info2(KURL(NullURL(), "http://example2.com"), "id2"); auto* connection2 = receiver->OnReceiverConnectionAvailable(presentation_info2);
diff --git a/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuota.cpp b/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuota.cpp index 0ba7747..90c86fe9 100644 --- a/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuota.cpp +++ b/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuota.cpp
@@ -76,7 +76,7 @@ return; } - KURL storage_partition = KURL(KURL(), security_origin->ToString()); + KURL storage_partition = KURL(NullURL(), security_origin->ToString()); StorageQuotaCallbacks* callbacks = DeprecatedStorageQuotaCallbacksImpl::Create(success_callback, error_callback);
diff --git a/third_party/WebKit/Source/modules/quota/StorageManager.cpp b/third_party/WebKit/Source/modules/quota/StorageManager.cpp index 00c4b32c..56ca095 100644 --- a/third_party/WebKit/Source/modules/quota/StorageManager.cpp +++ b/third_party/WebKit/Source/modules/quota/StorageManager.cpp
@@ -134,7 +134,7 @@ return promise; } - KURL storage_partition = KURL(KURL(), security_origin->ToString()); + KURL storage_partition = KURL(NullURL(), security_origin->ToString()); Platform::Current()->QueryStorageUsageAndQuota( storage_partition, kWebStorageQuotaTypeTemporary, new EstimateCallbacks(resolver));
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.cpp b/third_party/WebKit/Source/modules/sensor/Sensor.cpp index 565d96d..8438589 100644 --- a/third_party/WebKit/Source/modules/sensor/Sensor.cpp +++ b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
@@ -189,7 +189,7 @@ // We also avoid scheduling if the elapsed time is slightly behind the // polling period. auto sensor_reading_changed = - WTF::Bind(&Sensor::NotifyChange, WrapWeakPersistent(this)); + WTF::Bind(&Sensor::NotifyReading, WrapWeakPersistent(this)); if (waitingTime < kMinWaitingInterval) { // Invoke JS callbacks in a different callchain to obviate // possible modifications of SensorProxy::observers_ container @@ -302,9 +302,9 @@ } } -void Sensor::NotifyChange() { +void Sensor::NotifyReading() { last_reported_timestamp_ = sensor_proxy_->reading().timestamp; - DispatchEvent(Event::Create(EventTypeNames::change)); + DispatchEvent(Event::Create(EventTypeNames::reading)); } void Sensor::NotifyActivate() {
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.h b/third_party/WebKit/Source/modules/sensor/Sensor.h index b5255d41..ff9d2ac 100644 --- a/third_party/WebKit/Source/modules/sensor/Sensor.h +++ b/third_party/WebKit/Source/modules/sensor/Sensor.h
@@ -52,7 +52,7 @@ DOMHighResTimeStamp timestamp(ScriptState*, bool& is_null) const; DEFINE_ATTRIBUTE_EVENT_LISTENER(error); - DEFINE_ATTRIBUTE_EVENT_LISTENER(change); + DEFINE_ATTRIBUTE_EVENT_LISTENER(reading); DEFINE_ATTRIBUTE_EVENT_LISTENER(activate); // ActiveScriptWrappable overrides. @@ -104,7 +104,7 @@ const String& sanitized_message = String(), const String& unsanitized_message = String()); - void NotifyChange(); + void NotifyReading(); void NotifyActivate(); void NotifyError(DOMException* error);
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.idl b/third_party/WebKit/Source/modules/sensor/Sensor.idl index 0de84ae..cac33522 100644 --- a/third_party/WebKit/Source/modules/sensor/Sensor.idl +++ b/third_party/WebKit/Source/modules/sensor/Sensor.idl
@@ -17,6 +17,6 @@ [MeasureAs=GenericSensorStop] void stop(); [MeasureAs=GenericSensorOnError] attribute EventHandler onerror; - [MeasureAs=GenericSensorOnChange] attribute EventHandler onchange; + [MeasureAs=GenericSensorOnChange] attribute EventHandler onreading; [MeasureAs=GenericSensorOnActivate] attribute EventHandler onactivate; };
diff --git a/third_party/WebKit/Source/modules/serviceworkers/BUILD.gn b/third_party/WebKit/Source/modules/serviceworkers/BUILD.gn index 235e2dc..32eb11c 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/BUILD.gn +++ b/third_party/WebKit/Source/modules/serviceworkers/BUILD.gn
@@ -46,6 +46,8 @@ "ServiceWorkerGlobalScopeClient.h", "ServiceWorkerGlobalScopeProxy.cpp", "ServiceWorkerGlobalScopeProxy.h", + "ServiceWorkerInstalledScriptsManager.cpp", + "ServiceWorkerInstalledScriptsManager.h", "ServiceWorkerLinkResource.cpp", "ServiceWorkerLinkResource.h", "ServiceWorkerRegistration.cpp",
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp index 2444c9d..f939ee9 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
@@ -176,7 +176,7 @@ return; } - KURL page_url = KURL(KURL(), document_origin->ToString()); + KURL page_url = KURL(NullURL(), document_origin->ToString()); if (!SchemeRegistry::ShouldTreatURLSchemeAsAllowingServiceWorkers( page_url.Protocol())) { callbacks->OnError(WebServiceWorkerError( @@ -330,7 +330,7 @@ return promise; } - KURL page_url = KURL(KURL(), document_origin->ToString()); + KURL page_url = KURL(NullURL(), document_origin->ToString()); if (!SchemeRegistry::ShouldTreatURLSchemeAsAllowingServiceWorkers( page_url.Protocol())) { resolver->Reject(DOMException::Create( @@ -383,7 +383,7 @@ return promise; } - KURL page_url = KURL(KURL(), document_origin->ToString()); + KURL page_url = KURL(NullURL(), document_origin->ToString()); if (!SchemeRegistry::ShouldTreatURLSchemeAsAllowingServiceWorkers( page_url.Protocol())) { resolver->Reject(DOMException::Create(
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerClient.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerClient.cpp index 5707199..c95d38b 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerClient.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerClient.cpp
@@ -53,7 +53,7 @@ if (!client) { client = new ServiceWorkerContainerClient( *document, - document->GetFrame()->Loader().Client()->CreateServiceWorkerProvider()); + document->GetFrame()->Client()->CreateServiceWorkerProvider()); Supplement<Document>::ProvideTo(*document, SupplementName(), client); } return client;
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp index 14a6cfb..b3af2f8 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp
@@ -172,7 +172,7 @@ void SetPageURL(const String& url) { // For URL completion. - page_->GetDocument().SetURL(KURL(KURL(), url)); + page_->GetDocument().SetURL(KURL(NullURL(), url)); // The basis for security checks. page_->GetDocument().SetSecurityOrigin( @@ -353,9 +353,9 @@ options); EXPECT_EQ(1ul, stub_provider.RegisterCallCount()); - EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/y/")), + EXPECT_EQ(WebURL(KURL(NullURL(), "http://localhost/x/y/")), stub_provider.RegisterScope()); - EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/y/worker.js")), + EXPECT_EQ(WebURL(KURL(NullURL(), "http://localhost/x/y/worker.js")), stub_provider.RegisterScriptURL()); } } @@ -374,7 +374,7 @@ ScriptState::Scope script_scope(GetScriptState()); container->getRegistration(GetScriptState(), ""); EXPECT_EQ(1ul, stub_provider.GetRegistrationCallCount()); - EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/index.html")), + EXPECT_EQ(WebURL(KURL(NullURL(), "http://localhost/x/index.html")), stub_provider.GetRegistrationURL()); } }
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerInstalledScriptsManager.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerInstalledScriptsManager.cpp new file mode 100644 index 0000000..d705994 --- /dev/null +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerInstalledScriptsManager.cpp
@@ -0,0 +1,61 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "modules/serviceworkers/ServiceWorkerInstalledScriptsManager.h" + +#include "core/html/parser/TextResourceDecoder.h" +#include "modules/serviceworkers/ServiceWorkerThread.h" + +namespace blink { + +ServiceWorkerInstalledScriptsManager::ServiceWorkerInstalledScriptsManager( + std::unique_ptr<WebServiceWorkerInstalledScriptsManager> manager) + : manager_(std::move(manager)) {} + +bool ServiceWorkerInstalledScriptsManager::IsScriptInstalled( + const KURL& script_url) const { + return manager_->IsScriptInstalled(script_url); +} + +Optional<InstalledScriptsManager::ScriptData> +ServiceWorkerInstalledScriptsManager::GetScriptData(const KURL& script_url) { + DCHECK(!IsMainThread()); + // This blocks until the script is received from the browser. + std::unique_ptr<WebServiceWorkerInstalledScriptsManager::RawScriptData> + raw_script_data = manager_->GetRawScriptData(script_url); + + if (!raw_script_data) + return WTF::nullopt; + + // This is from WorkerScriptLoader::DidReceiveData. + std::unique_ptr<TextResourceDecoder> decoder; + if (!raw_script_data->Encoding().IsEmpty()) { + decoder = TextResourceDecoder::Create(TextResourceDecoderOptions( + TextResourceDecoderOptions::kPlainTextContent, + WTF::TextEncoding(raw_script_data->Encoding()))); + } else { + decoder = TextResourceDecoder::Create(TextResourceDecoderOptions( + TextResourceDecoderOptions::kPlainTextContent)); + } + + InstalledScriptsManager::ScriptData script_data; + // TODO(shimazu): Read the headers for ContentSecurityPolicy, ReferrerPolicy, + // and OriginTrialTokens and set them to |script_data|. + for (const auto& chunk : raw_script_data->ScriptTextChunks()) { + script_data.source_text.append(decoder->Decode(chunk.Data(), chunk.size())); + } + if (raw_script_data->MetaDataChunks().size() > 0) { + size_t total_metadata_size = 0; + for (const auto& chunk : raw_script_data->MetaDataChunks()) + total_metadata_size += chunk.size(); + script_data.meta_data = WTF::MakeUnique<Vector<char>>(); + script_data.meta_data->ReserveInitialCapacity(total_metadata_size); + for (const auto& chunk : raw_script_data->MetaDataChunks()) + script_data.meta_data->Append(chunk.Data(), chunk.size()); + } + script_data.headers.Adopt(raw_script_data->TakeHeaders()); + return Optional<ScriptData>(std::move(script_data)); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerInstalledScriptsManager.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerInstalledScriptsManager.h new file mode 100644 index 0000000..b306fb34 --- /dev/null +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerInstalledScriptsManager.h
@@ -0,0 +1,31 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ServiceWorkerInstalledScriptsManager_h +#define ServiceWorkerInstalledScriptsManager_h + +#include "core/workers/InstalledScriptsManager.h" +#include "public/platform/modules/serviceworker/WebServiceWorkerInstalledScriptsManager.h" + +namespace blink { + +// ServiceWorkerInstalledScriptsManager provides the main script and imported +// scripts of an installed service worker. The scripts are streamed from the +// browser process in parallel with worker thread initialization. +class ServiceWorkerInstalledScriptsManager : public InstalledScriptsManager { + public: + explicit ServiceWorkerInstalledScriptsManager( + std::unique_ptr<WebServiceWorkerInstalledScriptsManager>); + + // InstalledScriptsManager implementation. + bool IsScriptInstalled(const KURL& script_url) const override; + Optional<ScriptData> GetScriptData(const KURL& script_url) override; + + private: + std::unique_ptr<WebServiceWorkerInstalledScriptsManager> manager_; +}; + +} // namespace blink + +#endif // WorkerInstalledScriptsManager_h
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerThread.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerThread.cpp index e98d2c6..f10688e 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerThread.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerThread.cpp
@@ -34,16 +34,20 @@ #include "core/workers/WorkerBackingThread.h" #include "core/workers/WorkerThreadStartupData.h" #include "modules/serviceworkers/ServiceWorkerGlobalScope.h" +#include "modules/serviceworkers/ServiceWorkerInstalledScriptsManager.h" #include "platform/wtf/PtrUtil.h" namespace blink { ServiceWorkerThread::ServiceWorkerThread( ThreadableLoadingContext* loading_context, - WorkerReportingProxy& worker_reporting_proxy) + WorkerReportingProxy& worker_reporting_proxy, + std::unique_ptr<ServiceWorkerInstalledScriptsManager> + installed_scripts_manager) : WorkerThread(loading_context, worker_reporting_proxy), worker_backing_thread_( - WorkerBackingThread::Create("ServiceWorker Thread")) {} + WorkerBackingThread::Create("ServiceWorker Thread")), + installed_scripts_manager_(std::move(installed_scripts_manager)) {} ServiceWorkerThread::~ServiceWorkerThread() {} @@ -56,4 +60,8 @@ return ServiceWorkerGlobalScope::Create(this, std::move(startup_data)); } +InstalledScriptsManager* ServiceWorkerThread::GetInstalledScriptsManager() { + return installed_scripts_manager_.get(); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerThread.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerThread.h index fc438b2..070969b 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerThread.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerThread.h
@@ -37,11 +37,14 @@ namespace blink { +class ServiceWorkerInstalledScriptsManager; class WorkerThreadStartupData; class MODULES_EXPORT ServiceWorkerThread final : public WorkerThread { public: - ServiceWorkerThread(ThreadableLoadingContext*, WorkerReportingProxy&); + ServiceWorkerThread(ThreadableLoadingContext*, + WorkerReportingProxy&, + std::unique_ptr<ServiceWorkerInstalledScriptsManager>); ~ServiceWorkerThread() override; WorkerBackingThread& GetWorkerBackingThread() override { @@ -53,8 +56,12 @@ WorkerOrWorkletGlobalScope* CreateWorkerGlobalScope( std::unique_ptr<WorkerThreadStartupData>) override; + InstalledScriptsManager* GetInstalledScriptsManager() override; + private: std::unique_ptr<WorkerBackingThread> worker_backing_thread_; + std::unique_ptr<ServiceWorkerInstalledScriptsManager> + installed_scripts_manager_; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/serviceworkers/WebEmbeddedWorkerImplTest.cpp b/third_party/WebKit/Source/modules/serviceworkers/WebEmbeddedWorkerImplTest.cpp index 2a8860d..64fd62f 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/WebEmbeddedWorkerImplTest.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/WebEmbeddedWorkerImplTest.cpp
@@ -5,12 +5,16 @@ #include "public/web/WebEmbeddedWorker.h" #include <memory> +#include "platform/WaitableEvent.h" +#include "platform/WebTaskRunner.h" #include "platform/testing/URLTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" #include "platform/wtf/PtrUtil.h" #include "public/platform/Platform.h" +#include "public/platform/WebContentSettingsClient.h" #include "public/platform/WebURLLoaderMockFactory.h" #include "public/platform/WebURLResponse.h" +#include "public/platform/modules/serviceworker/WebServiceWorkerInstalledScriptsManager.h" #include "public/platform/modules/serviceworker/WebServiceWorkerNetworkProvider.h" #include "public/platform/modules/serviceworker/WebServiceWorkerProvider.h" #include "public/web/WebEmbeddedWorkerStartData.h" @@ -24,12 +28,17 @@ class MockServiceWorkerContextClient : public WebServiceWorkerContextClient { public: - MockServiceWorkerContextClient() : has_associated_registration_(true) {} - ~MockServiceWorkerContextClient() override {} + MockServiceWorkerContextClient() = default; + ~MockServiceWorkerContextClient() override = default; + MOCK_METHOD0(WorkerReadyForInspection, void()); MOCK_METHOD0(WorkerContextFailedToStart, void()); MOCK_METHOD0(WorkerScriptLoaded, void()); + void DidEvaluateWorkerScript(bool /* success */) override { + script_evaluated_event_.Signal(); + } + // Work-around for mocking a method that return unique_ptr. MOCK_METHOD0(CreateServiceWorkerNetworkProviderProxy, WebServiceWorkerNetworkProvider*()); @@ -95,15 +104,35 @@ NOTREACHED(); } + void WorkerContextDestroyed() override { termination_event_.Signal(); } + + void WaitUntilScriptEvaluated() { script_evaluated_event_.Wait(); } + void WaitUntilThreadTermination() { termination_event_.Wait(); } + private: - bool has_associated_registration_; + bool has_associated_registration_ = true; + WaitableEvent script_evaluated_event_; + WaitableEvent termination_event_; +}; + +class MockServiceWorkerInstalledScriptsManager + : public WebServiceWorkerInstalledScriptsManager { + public: + MOCK_CONST_METHOD1(IsScriptInstalled, bool(const WebURL& script_url)); + MOCK_METHOD1(GetRawScriptData, + std::unique_ptr<RawScriptData>(const WebURL& script_url)); }; class WebEmbeddedWorkerImplTest : public ::testing::Test { protected: void SetUp() override { - mock_client_ = new MockServiceWorkerContextClient(); - worker_ = WTF::WrapUnique(WebEmbeddedWorker::Create(mock_client_, nullptr)); + auto client = WTF::MakeUnique<MockServiceWorkerContextClient>(); + auto installed_scripts_manager = + WTF::MakeUnique<MockServiceWorkerInstalledScriptsManager>(); + mock_client_ = client.get(); + mock_installed_scripts_manager_ = installed_scripts_manager.get(); + worker_ = WebEmbeddedWorker::Create( + std::move(client), std::move(installed_scripts_manager), nullptr); WebURL script_url = URLTestHelpers::ToKURL("https://www.example.com/sw.js"); WebURLResponse response; @@ -129,6 +158,7 @@ WebEmbeddedWorkerStartData start_data_; MockServiceWorkerContextClient* mock_client_; + MockServiceWorkerInstalledScriptsManager* mock_installed_scripts_manager_; std::unique_ptr<WebEmbeddedWorker> worker_; }; @@ -138,6 +168,7 @@ EXPECT_CALL(*mock_client_, WorkerReadyForInspection()).Times(1); worker_->StartWorkerContext(start_data_); ::testing::Mock::VerifyAndClearExpectations(mock_client_); + ::testing::Mock::VerifyAndClearExpectations(mock_installed_scripts_manager_); EXPECT_CALL(*mock_client_, WorkerContextFailedToStart()).Times(1); worker_->TerminateWorkerContext(); @@ -150,6 +181,7 @@ WebEmbeddedWorkerStartData::kWaitForDebugger; worker_->StartWorkerContext(start_data_); ::testing::Mock::VerifyAndClearExpectations(mock_client_); + ::testing::Mock::VerifyAndClearExpectations(mock_installed_scripts_manager_); EXPECT_CALL(*mock_client_, WorkerContextFailedToStart()).Times(1); worker_->TerminateWorkerContext(); @@ -160,12 +192,18 @@ EXPECT_CALL(*mock_client_, WorkerReadyForInspection()).Times(1); worker_->StartWorkerContext(start_data_); ::testing::Mock::VerifyAndClearExpectations(mock_client_); + ::testing::Mock::VerifyAndClearExpectations(mock_installed_scripts_manager_); // Load the shadow page. EXPECT_CALL(*mock_client_, CreateServiceWorkerNetworkProviderProxy()) .WillOnce(::testing::Return(nullptr)); + EXPECT_CALL(*mock_installed_scripts_manager_, + IsScriptInstalled(start_data_.script_url)) + .Times(1) + .WillOnce(::testing::Return(false)); Platform::Current()->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); ::testing::Mock::VerifyAndClearExpectations(mock_client_); + ::testing::Mock::VerifyAndClearExpectations(mock_installed_scripts_manager_); // Terminate before loading the script. EXPECT_CALL(*mock_client_, WorkerContextFailedToStart()).Times(1); @@ -183,8 +221,13 @@ // Load the shadow page. EXPECT_CALL(*mock_client_, CreateServiceWorkerNetworkProviderProxy()) .WillOnce(::testing::Return(nullptr)); + EXPECT_CALL(*mock_installed_scripts_manager_, + IsScriptInstalled(start_data_.script_url)) + .Times(1) + .WillOnce(::testing::Return(false)); Platform::Current()->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); ::testing::Mock::VerifyAndClearExpectations(mock_client_); + ::testing::Mock::VerifyAndClearExpectations(mock_installed_scripts_manager_); // Load the script. EXPECT_CALL(*mock_client_, WorkerScriptLoaded()).Times(1); @@ -219,8 +262,13 @@ // Load the shadow page. EXPECT_CALL(*mock_client_, CreateServiceWorkerNetworkProviderProxy()) .WillOnce(::testing::Return(nullptr)); + EXPECT_CALL(*mock_installed_scripts_manager_, + IsScriptInstalled(start_data_.script_url)) + .Times(1) + .WillOnce(::testing::Return(false)); Platform::Current()->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); ::testing::Mock::VerifyAndClearExpectations(mock_client_); + ::testing::Mock::VerifyAndClearExpectations(mock_installed_scripts_manager_); // Load the script. EXPECT_CALL(*mock_client_, WorkerScriptLoaded()).Times(0); @@ -240,8 +288,13 @@ // Load the shadow page. EXPECT_CALL(*mock_client_, CreateServiceWorkerNetworkProviderProxy()) .WillOnce(::testing::Return(nullptr)); + EXPECT_CALL(*mock_installed_scripts_manager_, + IsScriptInstalled(start_data_.script_url)) + .Times(1) + .WillOnce(::testing::Return(false)); Platform::Current()->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); ::testing::Mock::VerifyAndClearExpectations(mock_client_); + ::testing::Mock::VerifyAndClearExpectations(mock_installed_scripts_manager_); // Load the script. mock_client_->SetHasAssociatedRegistration(false); @@ -267,15 +320,32 @@ // Load the shadow page. EXPECT_CALL(*mock_client_, CreateServiceWorkerNetworkProviderProxy()) .WillOnce(::testing::Return(nullptr)); + EXPECT_CALL(*mock_installed_scripts_manager_, + IsScriptInstalled(start_data_.script_url)) + .Times(1) + .WillOnce(::testing::Return(false)); Platform::Current()->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); ::testing::Mock::VerifyAndClearExpectations(mock_client_); + ::testing::Mock::VerifyAndClearExpectations(mock_installed_scripts_manager_); // Load the script. EXPECT_CALL(*mock_client_, WorkerScriptLoaded()).Times(1); EXPECT_CALL(*mock_client_, CreateServiceWorkerProviderProxy()) .WillOnce(::testing::Return(nullptr)); + // This is called on the worker thread. + EXPECT_CALL(*mock_installed_scripts_manager_, + IsScriptInstalled(start_data_.script_url)) + .Times(1) + .WillOnce(::testing::Return(false)); Platform::Current()->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); + mock_client_->WaitUntilScriptEvaluated(); ::testing::Mock::VerifyAndClearExpectations(mock_client_); + ::testing::Mock::VerifyAndClearExpectations(mock_installed_scripts_manager_); + + // Terminate the running worker thread. + EXPECT_CALL(*mock_client_, WorkerContextFailedToStart()).Times(0); + worker_->TerminateWorkerContext(); + mock_client_->WaitUntilThreadTermination(); } // The running worker is detected as a memory leak. crbug.com/586897 @@ -295,6 +365,10 @@ // Load the shadow page. EXPECT_CALL(*mock_client_, CreateServiceWorkerNetworkProviderProxy()) .WillOnce(::testing::Return(nullptr)); + EXPECT_CALL(*mock_installed_scripts_manager_, + IsScriptInstalled(start_data_.script_url)) + .Times(1) + .WillOnce(::testing::Return(false)); Platform::Current()->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); ::testing::Mock::VerifyAndClearExpectations(mock_client_); @@ -307,8 +381,20 @@ // Resume after download. EXPECT_CALL(*mock_client_, CreateServiceWorkerProviderProxy()) .WillOnce(::testing::Return(nullptr)); + // This is called on the worker thread. + EXPECT_CALL(*mock_installed_scripts_manager_, + IsScriptInstalled(start_data_.script_url)) + .Times(1) + .WillOnce(::testing::Return(false)); worker_->ResumeAfterDownload(); + mock_client_->WaitUntilScriptEvaluated(); ::testing::Mock::VerifyAndClearExpectations(mock_client_); + ::testing::Mock::VerifyAndClearExpectations(mock_installed_scripts_manager_); + + // Terminate the running worker thread. + EXPECT_CALL(*mock_client_, WorkerContextFailedToStart()).Times(0); + worker_->TerminateWorkerContext(); + mock_client_->WaitUntilThreadTermination(); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/speech/SpeechGrammarList.cpp b/third_party/WebKit/Source/modules/speech/SpeechGrammarList.cpp index cc1c9176..3269202 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechGrammarList.cpp +++ b/third_party/WebKit/Source/modules/speech/SpeechGrammarList.cpp
@@ -53,7 +53,8 @@ void SpeechGrammarList::addFromString(const String& string, double weight) { String url_string = String("data:application/xml,") + EncodeWithURLEscapeSequences(string); - grammars_.push_back(SpeechGrammar::Create(KURL(KURL(), url_string), weight)); + grammars_.push_back( + SpeechGrammar::Create(KURL(NullURL(), url_string), weight)); } SpeechGrammarList::SpeechGrammarList() {}
diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp index e161005..ffb6b1e 100644 --- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp +++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
@@ -183,9 +183,7 @@ doc->RequestAnimationFrame(new VRDisplayFrameRequestCallback(this)); return; } - - if (!pending_vrdisplay_raf_) - return; + DCHECK(vr_presentation_provider_.is_bound()); // The logic here is a bit subtle. We get called from one of the following // four contexts: @@ -495,7 +493,11 @@ Platform::Current()->RecordRapporURL("VR.WebVR.PresentSuccess", WebURL(doc->Url())); } - + if (!FocusedOrPresenting() && display_blurred_) { + // Presentation doesn't care about focus, so if we're blurred because of + // focus, then unblur. + OnFocus(); + } is_presenting_ = true; // Call RequestVSync to switch from the (internal) document rAF to the // VrPresentationProvider VSync. @@ -965,11 +967,9 @@ void VRDisplay::FocusChanged() { DVLOG(1) << __FUNCTION__; - if (is_presenting_) - return; if (navigator_vr_->IsFocused()) { OnFocus(); - } else { + } else if (!is_presenting_) { OnBlur(); } }
diff --git a/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLockTest.cpp b/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLockTest.cpp index 619b338c..ed9eb27 100644 --- a/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLockTest.cpp +++ b/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLockTest.cpp
@@ -86,7 +86,7 @@ void SetUp() override { web_view_helper_.Initialize(&test_web_frame_client_); URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8("http://example.com/"), testing::WebTestDataPath(), + WebString::FromUTF8("http://example.com/"), testing::CoreTestDataPath(), WebString::FromUTF8("foo.html")); LoadFrame(); }
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp index 768273d..56785ad 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
@@ -24,16 +24,18 @@ */ #include "modules/webaudio/AudioParamTimeline.h" + #include <algorithm> #include "bindings/core/v8/ExceptionMessages.h" #include "bindings/core/v8/ExceptionState.h" +#include "build/build_config.h" #include "core/dom/ExceptionCode.h" #include "platform/audio/AudioUtilities.h" #include "platform/wtf/CPU.h" #include "platform/wtf/MathExtras.h" #include "platform/wtf/PtrUtil.h" -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) #include <emmintrin.h> #endif @@ -1288,7 +1290,7 @@ size_t current_frame, float value, unsigned write_index) { -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) auto number_of_values = current_state.number_of_values; #endif auto fill_to_frame = current_state.fill_to_frame; @@ -1301,7 +1303,7 @@ double delta_time = time2 - time1; float k = delta_time > 0 ? 1 / delta_time : 0; const float value_delta = value2 - value1; -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) if (fill_to_frame > write_index) { // Minimize in-loop operations. Calculate starting value and increment. // Next step: value += inc. @@ -1429,7 +1431,7 @@ size_t current_frame, float value, unsigned write_index) { -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) auto number_of_values = current_state.number_of_values; #endif auto fill_to_frame = current_state.fill_to_frame; @@ -1480,7 +1482,7 @@ for (; write_index < fill_to_frame; ++write_index) values[write_index] = target; } else { -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) if (fill_to_frame > write_index) { // Resolve recursion by expanding constants to achieve a 4-step // loop unrolling. @@ -1614,7 +1616,7 @@ // Oversampled curve data can be provided if sharp discontinuities are // desired. unsigned k = 0; -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) if (fill_to_frame > write_index) { const __m128 v_curve_virtual_index = _mm_set_ps1(curve_virtual_index); const __m128 v_curve_points_per_frame = _mm_set_ps1(curve_points_per_frame);
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScopeTest.cpp b/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScopeTest.cpp index 4a78437..d002990 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScopeTest.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScopeTest.cpp
@@ -312,25 +312,29 @@ TEST_F(AudioWorkletGlobalScopeTest, Basic) { std::unique_ptr<AudioWorkletThread> thread = CreateAudioWorkletThread(); RunBasicTest(thread.get()); - thread->TerminateAndWait(); + thread->Terminate(); + thread->WaitForShutdownForTesting(); } TEST_F(AudioWorkletGlobalScopeTest, Parsing) { std::unique_ptr<AudioWorkletThread> thread = CreateAudioWorkletThread(); RunParsingTest(thread.get()); - thread->TerminateAndWait(); + thread->Terminate(); + thread->WaitForShutdownForTesting(); } TEST_F(AudioWorkletGlobalScopeTest, BufferProcessing) { std::unique_ptr<AudioWorkletThread> thread = CreateAudioWorkletThread(); RunSimpleProcessTest(thread.get()); - thread->TerminateAndWait(); + thread->Terminate(); + thread->WaitForShutdownForTesting(); } TEST_F(AudioWorkletGlobalScopeTest, ParsingParameterDescriptor) { std::unique_ptr<AudioWorkletThread> thread = CreateAudioWorkletThread(); RunParsingParameterDescriptorTest(thread.get()); - thread->TerminateAndWait(); + thread->Terminate(); + thread->WaitForShutdownForTesting(); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletThreadTest.cpp b/third_party/WebKit/Source/modules/webaudio/AudioWorkletThreadTest.cpp index a5ead726..9723af46 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioWorkletThreadTest.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletThreadTest.cpp
@@ -79,7 +79,8 @@ TEST_F(AudioWorkletThreadTest, Basic) { std::unique_ptr<AudioWorkletThread> worklet = CreateAudioWorkletThread(); CheckWorkletCanExecuteScript(worklet.get()); - worklet->TerminateAndWait(); + worklet->Terminate(); + worklet->WaitForShutdownForTesting(); } // Tests that the same WebThread is used for new worklets if the WebThread is @@ -114,7 +115,8 @@ // Verify that the worklet can still successfully execute script. CheckWorkletCanExecuteScript(second_worklet.get()); - second_worklet->TerminateAndWait(); + second_worklet->Terminate(); + second_worklet->WaitForShutdownForTesting(); } // Tests that a new WebThread is created if all existing worklets are @@ -137,7 +139,8 @@ EXPECT_EQ(first_thread, second_thread); CheckWorkletCanExecuteScript(worklet.get()); - worklet->TerminateAndWait(); + worklet->Terminate(); + worklet->WaitForShutdownForTesting(); } // Tests that v8::Isolate and WebThread are correctly set-up if a worklet is @@ -164,7 +167,8 @@ // Verify that the isolate can run some scripts correctly in the second // worklet. CheckWorkletCanExecuteScript(second_worklet.get()); - second_worklet->TerminateAndWait(); + second_worklet->Terminate(); + second_worklet->WaitForShutdownForTesting(); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webauth/BUILD.gn b/third_party/WebKit/Source/modules/webauth/BUILD.gn index eaa78b4..317a7305 100644 --- a/third_party/WebKit/Source/modules/webauth/BUILD.gn +++ b/third_party/WebKit/Source/modules/webauth/BUILD.gn
@@ -14,9 +14,4 @@ "WebAuthentication.cpp", "WebAuthentication.h", ] - - deps = [ - "//components/webauth:authenticator_blink", - "//device/usb/public/interfaces:interfaces_blink", - ] }
diff --git a/third_party/WebKit/Source/modules/webauth/DEPS b/third_party/WebKit/Source/modules/webauth/DEPS index 9bcda18..1e6ebea1 100644 --- a/third_party/WebKit/Source/modules/webauth/DEPS +++ b/third_party/WebKit/Source/modules/webauth/DEPS
@@ -1,5 +1,4 @@ include_rules = [ - "+components/webauth", "+device/usb/public/interfaces", "+mojo/public/cpp/bindings", ]
diff --git a/third_party/WebKit/Source/modules/webauth/OWNERS b/third_party/WebKit/Source/modules/webauth/OWNERS new file mode 100644 index 0000000..20777b74 --- /dev/null +++ b/third_party/WebKit/Source/modules/webauth/OWNERS
@@ -0,0 +1,3 @@ +mkwst@chromium.org + +# COMPONENT: Blink>WebAuthentication
diff --git a/third_party/WebKit/Source/modules/webauth/WebAuthentication.cpp b/third_party/WebKit/Source/modules/webauth/WebAuthentication.cpp index 06cba2c..b2f17e44 100644 --- a/third_party/WebKit/Source/modules/webauth/WebAuthentication.cpp +++ b/third_party/WebKit/Source/modules/webauth/WebAuthentication.cpp
@@ -1,4 +1,4 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. +// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -20,23 +20,26 @@ namespace { const char kNoAuthenticatorError[] = "Authenticator unavailable."; +// Time to wait for an authenticator to successfully complete an operation. +const int kAdjustedTimeoutLowerInSeconds = 60; +const int kAdjustedTimeoutUpperInSeconds = 120; } // anonymous namespace namespace mojo { - using webauth::mojom::blink::RelyingPartyAccount; using webauth::mojom::blink::RelyingPartyAccountPtr; +using webauth::mojom::blink::AuthenticatorStatus; +using webauth::mojom::blink::ScopedCredentialDescriptor; using webauth::mojom::blink::ScopedCredentialOptions; using webauth::mojom::blink::ScopedCredentialOptionsPtr; using webauth::mojom::blink::ScopedCredentialParameters; using webauth::mojom::blink::ScopedCredentialParametersPtr; -using webauth::mojom::blink::ScopedCredentialDescriptor; using webauth::mojom::blink::ScopedCredentialType; using webauth::mojom::blink::Transport; // TODO(kpaulhamus): Make this a TypeConverter Vector<uint8_t> ConvertBufferSource(const blink::BufferSource& buffer) { - DCHECK(buffer.isNull()); + DCHECK(!buffer.isNull()); Vector<uint8_t> vector; if (buffer.isArrayBuffer()) { vector.Append(static_cast<uint8_t*>(buffer.getAsArrayBuffer()->Data()), @@ -69,6 +72,7 @@ return Transport::USB; } +// TODO(kpaulhamus): Make this a TypeConverter RelyingPartyAccountPtr ConvertRelyingPartyAccount( const blink::RelyingPartyAccount& account_information, blink::ScriptPromiseResolver* resolver) { @@ -88,17 +92,32 @@ const blink::ScopedCredentialOptions options, blink::ScriptPromiseResolver* resolver) { auto mojo_options = ScopedCredentialOptions::New(); - mojo_options->timeout_seconds = options.timeoutSeconds(); - mojo_options->relying_party_id = options.rpId(); + if (options.hasRpId()) { + // if rpID is missing, it will later be set to the origin of the page + // in the secure browser process. + mojo_options->relying_party_id = options.rpId(); + } - // Adds the excludeList members (which are ScopedCredentialDescriptors) - for (const auto& descriptor : options.excludeList()) { - auto mojo_descriptor = ScopedCredentialDescriptor::New(); - mojo_descriptor->type = ConvertScopedCredentialType(descriptor.type()); - mojo_descriptor->id = ConvertBufferSource(descriptor.id()); - for (const auto& transport : descriptor.transports()) - mojo_descriptor->transports.push_back(ConvertTransport(transport)); - mojo_options->exclude_list.push_back(std::move(mojo_descriptor)); + // Step 4 of https://w3c.github.io/webauthn/#createCredential + int predicted_timeout = kAdjustedTimeoutLowerInSeconds; + if (options.hasTimeoutSeconds()) { + predicted_timeout = static_cast<int>(options.timeoutSeconds()); + } + + mojo_options->adjusted_timeout = static_cast<double>( + std::max(kAdjustedTimeoutLowerInSeconds, + std::min(kAdjustedTimeoutUpperInSeconds, predicted_timeout))); + + if (options.hasExcludeList()) { + // Adds the excludeList members (which are ScopedCredentialDescriptors) + for (const auto& descriptor : options.excludeList()) { + auto mojo_descriptor = ScopedCredentialDescriptor::New(); + mojo_descriptor->type = ConvertScopedCredentialType(descriptor.type()); + mojo_descriptor->id = ConvertBufferSource(descriptor.id()); + for (const auto& transport : descriptor.transports()) + mojo_descriptor->transports.push_back(ConvertTransport(transport)); + mojo_options->exclude_list.push_back(std::move(mojo_descriptor)); + } } // TODO(kpaulhamus): add AuthenticationExtensions; return mojo_options; @@ -113,18 +132,40 @@ // TODO(kpaulhamus): add AlgorithmIdentifier return mojo_parameter; } + +blink::DOMException* CreateExceptionFromStatus(AuthenticatorStatus status) { + switch (status) { + case AuthenticatorStatus::NOT_IMPLEMENTED: + return blink::DOMException::Create(blink::kNotSupportedError, + "Not implemented."); + case AuthenticatorStatus::NOT_ALLOWED_ERROR: + return blink::DOMException::Create(blink::kNotAllowedError, + "Not allowed."); + case AuthenticatorStatus::NOT_SUPPORTED_ERROR: + return blink::DOMException::Create( + blink::kNotSupportedError, + "Parameters for this operation are not supported."); + case AuthenticatorStatus::SECURITY_ERROR: + return blink::DOMException::Create(blink::kSecurityError, + "The operation was not allowed."); + case AuthenticatorStatus::UNKNOWN_ERROR: + return blink::DOMException::Create(blink::kUnknownError, + "Request failed."); + case AuthenticatorStatus::CANCELLED: + return blink::DOMException::Create(blink::kNotAllowedError, + "User canceled the operation."); + case AuthenticatorStatus::SUCCESS: + return nullptr; + default: + NOTREACHED(); + return nullptr; + } +} } // namespace mojo namespace blink { - WebAuthentication::WebAuthentication(LocalFrame& frame) - : ContextLifecycleObserver(frame.GetDocument()) { - frame.GetInterfaceProvider()->GetInterface( - mojo::MakeRequest(&authenticator_)); - authenticator_.set_connection_error_handler(ConvertToBaseCallback( - WTF::Bind(&WebAuthentication::OnAuthenticatorConnectionError, - WrapWeakPersistent(this)))); -} + : ContextLifecycleObserver(frame.GetDocument()) {} WebAuthentication::~WebAuthentication() { // |authenticator_| may still be valid but there should be no more @@ -132,40 +173,36 @@ DCHECK(authenticator_requests_.IsEmpty()); } -void WebAuthentication::Dispose() {} - ScriptPromise WebAuthentication::makeCredential( ScriptState* script_state, const RelyingPartyAccount& account_information, const HeapVector<ScopedCredentialParameters> crypto_parameters, const BufferSource& attestation_challenge, ScopedCredentialOptions& options) { - if (!authenticator_) { - return ScriptPromise::RejectWithDOMException( - script_state, DOMException::Create(kNotSupportedError)); - } + ScriptPromise promise = RejectIfNotSupported(script_state); + if (!promise.IsEmpty()) + return promise; ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state); - ScriptPromise promise = resolver->Promise(); - // TODO(kpaulhamus) validate parameters according to spec - auto account = - mojo::ConvertRelyingPartyAccount(account_information, resolver); Vector<uint8_t> buffer = mojo::ConvertBufferSource(attestation_challenge); auto opts = mojo::ConvertScopedCredentialOptions(options, resolver); Vector<webauth::mojom::blink::ScopedCredentialParametersPtr> parameters; for (const auto& parameter : crypto_parameters) { - parameters.push_back( - mojo::ConvertScopedCredentialParameter(parameter, resolver)); + if (parameter.hasType()) { + parameters.push_back( + mojo::ConvertScopedCredentialParameter(parameter, resolver)); + } } - + auto account = + mojo::ConvertRelyingPartyAccount(account_information, resolver); authenticator_requests_.insert(resolver); authenticator_->MakeCredential( std::move(account), std::move(parameters), buffer, std::move(opts), - ConvertToBaseCallback(Bind(&WebAuthentication::OnMakeCredential, - WrapPersistent(this), - WrapPersistent(resolver)))); - return promise; + ConvertToBaseCallback(WTF::Bind(&WebAuthentication::OnMakeCredential, + WrapPersistent(this), + WrapPersistent(resolver)))); + return resolver->Promise(); } ScriptPromise WebAuthentication::getAssertion( @@ -177,44 +214,66 @@ } void WebAuthentication::ContextDestroyed(ExecutionContext*) { - authenticator_.reset(); - authenticator_requests_.clear(); -} - -void WebAuthentication::OnAuthenticatorConnectionError() { - authenticator_.reset(); - for (ScriptPromiseResolver* resolver : authenticator_requests_) { - resolver->Reject( - DOMException::Create(kNotFoundError, kNoAuthenticatorError)); - } - authenticator_requests_.clear(); + Cleanup(); } void WebAuthentication::OnMakeCredential( ScriptPromiseResolver* resolver, - Vector<webauth::mojom::blink::ScopedCredentialInfoPtr> credentials) { + webauth::mojom::blink::AuthenticatorStatus status, + webauth::mojom::blink::ScopedCredentialInfoPtr credential) { if (!MarkRequestComplete(resolver)) return; - HeapVector<Member<ScopedCredentialInfo>> scoped_credentials; - for (auto& credential : credentials) { - if (credential->client_data.IsEmpty() || - credential->attestation.IsEmpty()) { - resolver->Reject( - DOMException::Create(kNotFoundError, "No credentials returned.")); - } - DOMArrayBuffer* client_data_buffer = DOMArrayBuffer::Create( - static_cast<void*>(&credential->client_data.front()), - credential->client_data.size()); - - DOMArrayBuffer* attestation_buffer = DOMArrayBuffer::Create( - static_cast<void*>(&credential->attestation.front()), - credential->attestation.size()); - - scoped_credentials.push_back( - ScopedCredentialInfo::Create(client_data_buffer, attestation_buffer)); + DOMException* error = mojo::CreateExceptionFromStatus(status); + if (error) { + DCHECK(!credential); + resolver->Reject(error); + Cleanup(); + return; } - resolver->Resolve(); + + if (credential->client_data.IsEmpty() || credential->attestation.IsEmpty()) { + resolver->Reject( + DOMException::Create(kNotFoundError, "No credential returned.")); + return; + } + + DOMArrayBuffer* clientDataBuffer = DOMArrayBuffer::Create( + static_cast<void*>(&credential->client_data.front()), + credential->client_data.size()); + + DOMArrayBuffer* attestationBuffer = DOMArrayBuffer::Create( + static_cast<void*>(&credential->attestation.front()), + credential->attestation.size()); + + ScopedCredentialInfo* scopedCredential = + ScopedCredentialInfo::Create(clientDataBuffer, attestationBuffer); + resolver->Resolve(scopedCredential); +} + +ScriptPromise WebAuthentication::RejectIfNotSupported( + ScriptState* script_state) { + if (!authenticator_) { + if (!GetFrame()) { + return ScriptPromise::RejectWithDOMException( + script_state, DOMException::Create(kNotSupportedError)); + } + GetFrame()->GetInterfaceProvider()->GetInterface( + mojo::MakeRequest(&authenticator_)); + + authenticator_.set_connection_error_handler(ConvertToBaseCallback( + WTF::Bind(&WebAuthentication::OnAuthenticatorConnectionError, + WrapWeakPersistent(this)))); + } + return ScriptPromise(); +} + +void WebAuthentication::OnAuthenticatorConnectionError() { + for (ScriptPromiseResolver* resolver : authenticator_requests_) { + resolver->Reject( + DOMException::Create(kNotFoundError, kNoAuthenticatorError)); + } + Cleanup(); } bool WebAuthentication::MarkRequestComplete(ScriptPromiseResolver* resolver) { @@ -230,4 +289,10 @@ ContextLifecycleObserver::Trace(visitor); } +// Clears the promise resolver, timer, and closes the Mojo connection. +void WebAuthentication::Cleanup() { + authenticator_.reset(); + authenticator_requests_.clear(); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webauth/WebAuthentication.h b/third_party/WebKit/Source/modules/webauth/WebAuthentication.h index 262bc8b8..0c0c2b3d 100644 --- a/third_party/WebKit/Source/modules/webauth/WebAuthentication.h +++ b/third_party/WebKit/Source/modules/webauth/WebAuthentication.h
@@ -7,12 +7,12 @@ #include "bindings/core/v8/ArrayBufferOrArrayBufferView.h" #include "bindings/core/v8/ScriptPromise.h" -#include "components/webauth/authenticator.mojom-blink.h" #include "core/dom/ContextLifecycleObserver.h" #include "core/dom/DOMArrayBuffer.h" #include "modules/webauth/AuthenticationAssertionOptions.h" #include "modules/webauth/ScopedCredentialInfo.h" #include "platform/bindings/ScriptWrappable.h" +#include "public/platform/modules/webauth/authenticator.mojom-blink.h" namespace blink { @@ -38,8 +38,6 @@ virtual ~WebAuthentication(); - void Dispose(); - // WebAuthentication.idl ScriptPromise makeCredential(ScriptState*, const RelyingPartyAccount&, @@ -50,24 +48,26 @@ const BufferSource&, const AuthenticationAssertionOptions&); - // ContextLifecycleObserver overrides. - void ContextDestroyed(ExecutionContext*) override; - webauth::mojom::blink::Authenticator* Authenticator() const { return authenticator_.get(); } - void OnMakeCredential(ScriptPromiseResolver*, - Vector<webauth::mojom::blink::ScopedCredentialInfoPtr>); - bool MarkRequestComplete(ScriptPromiseResolver*); - - void OnAuthenticatorConnectionError(); + // ContextLifecycleObserver overrides. + void ContextDestroyed(ExecutionContext*) override; DECLARE_VIRTUAL_TRACE(); private: explicit WebAuthentication(LocalFrame&); + void OnMakeCredential(ScriptPromiseResolver*, + webauth::mojom::blink::AuthenticatorStatus, + webauth::mojom::blink::ScopedCredentialInfoPtr); + ScriptPromise RejectIfNotSupported(ScriptState*); + void OnAuthenticatorConnectionError(); + bool MarkRequestComplete(ScriptPromiseResolver*); + void Cleanup(); + webauth::mojom::blink::AuthenticatorPtr authenticator_; HeapHashSet<Member<ScriptPromiseResolver>> authenticator_requests_; };
diff --git a/third_party/WebKit/Source/modules/webdatabase/sqlite/SQLiteDatabase.h b/third_party/WebKit/Source/modules/webdatabase/sqlite/SQLiteDatabase.h index 2b174c47..2cf123e 100644 --- a/third_party/WebKit/Source/modules/webdatabase/sqlite/SQLiteDatabase.h +++ b/third_party/WebKit/Source/modules/webdatabase/sqlite/SQLiteDatabase.h
@@ -27,13 +27,14 @@ #ifndef SQLiteDatabase_h #define SQLiteDatabase_h +#include "build/build_config.h" #include "platform/heap/Handle.h" #include "platform/wtf/Threading.h" #include "platform/wtf/ThreadingPrimitives.h" #include "platform/wtf/text/CString.h" #include "platform/wtf/text/WTFString.h" -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) #pragma warning(disable : 4800) #endif
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp index 79fb154c..07bb7fc 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -46,7 +46,6 @@ #include "core/imagebitmap/ImageBitmap.h" #include "core/inspector/ConsoleMessage.h" #include "core/layout/LayoutBox.h" -#include "core/loader/FrameLoader.h" #include "core/origin_trials/OriginTrials.h" #include "core/probe/CoreProbes.h" #include "gpu/command_buffer/client/gles2_interface.h" @@ -7442,8 +7441,7 @@ Settings* settings = frame->GetSettings(); - if (!frame->Loader().Client()->AllowWebGL(settings && - settings->GetWebGLEnabled())) + if (!frame->Client()->AllowWebGL(settings && settings->GetWebGLEnabled())) return; }
diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp index 6346d8e..8c80192 100644 --- a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp +++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp
@@ -290,7 +290,7 @@ UseCounter::Count(GetExecutionContext(), WebFeature::kWebSocket); NETWORK_DVLOG(1) << "WebSocket " << this << " connect() url=" << url; - url_ = KURL(KURL(), url); + url_ = KURL(NullURL(), url); if (GetExecutionContext()->GetSecurityContext().GetInsecureRequestPolicy() & kUpgradeInsecureRequests &&
diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp b/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp index 0b5ffa46d..9a28f76 100644 --- a/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp +++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp
@@ -209,8 +209,9 @@ DOMWebSocketTestScope web_socket_scope(scope.GetExecutionContext()); { InSequence s; - EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "wss://example.com/endpoint"), String())) + EXPECT_CALL( + web_socket_scope.Channel(), + Connect(KURL(NullURL(), "wss://example.com/endpoint"), String())) .WillOnce(Return(true)); } @@ -220,7 +221,7 @@ EXPECT_FALSE(scope.GetExceptionState().HadException()); EXPECT_EQ(DOMWebSocket::kConnecting, web_socket_scope.Socket().readyState()); - EXPECT_EQ(KURL(KURL(), "wss://example.com/endpoint"), + EXPECT_EQ(KURL(NullURL(), "wss://example.com/endpoint"), web_socket_scope.Socket().url()); } @@ -230,7 +231,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/endpoint"), String())) + Connect(KURL(NullURL(), "ws://example.com/endpoint"), String())) .WillOnce(Return(true)); } @@ -240,7 +241,7 @@ EXPECT_FALSE(scope.GetExceptionState().HadException()); EXPECT_EQ(DOMWebSocket::kConnecting, web_socket_scope.Socket().readyState()); - EXPECT_EQ(KURL(KURL(), "ws://example.com/endpoint"), + EXPECT_EQ(KURL(NullURL(), "ws://example.com/endpoint"), web_socket_scope.Socket().url()); } @@ -255,7 +256,7 @@ InSequence s; EXPECT_CALL( web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/hoge"), String("aa, bb"))) + Connect(KURL(NullURL(), "ws://example.com/hoge"), String("aa, bb"))) .WillOnce(Return(true)); } @@ -265,7 +266,7 @@ EXPECT_FALSE(scope.GetExceptionState().HadException()); EXPECT_EQ(DOMWebSocket::kConnecting, web_socket_scope.Socket().readyState()); - EXPECT_EQ(KURL(KURL(), "ws://example.com/hoge"), + EXPECT_EQ(KURL(NullURL(), "ws://example.com/hoge"), web_socket_scope.Socket().url()); } @@ -279,7 +280,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String("aa, bb"))) + Connect(KURL(NullURL(), "ws://example.com/"), String("aa, bb"))) .WillOnce(Return(false)); EXPECT_CALL(web_socket_scope.Channel(), Disconnect()); } @@ -332,7 +333,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String("aa, bb"))) + Connect(KURL(NullURL(), "ws://example.com/"), String("aa, bb"))) .WillOnce(Return(true)); } web_socket_scope.Socket().Connect("ws://example.com/", subprotocols, @@ -354,7 +355,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); EXPECT_CALL(web_socket_scope.Channel(), Disconnect()); } @@ -376,7 +377,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); EXPECT_CALL(web_socket_scope.Channel(), FailMock(_, _, _)); } @@ -402,7 +403,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); } StringBuilder reason; @@ -430,7 +431,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); EXPECT_CALL( web_socket_scope.Channel(), @@ -456,7 +457,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); EXPECT_CALL(web_socket_scope.Channel(), Close(3005, String("bye"))); } @@ -480,7 +481,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); EXPECT_CALL(web_socket_scope.Channel(), Close(3005, String())); } @@ -504,7 +505,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); EXPECT_CALL(web_socket_scope.Channel(), Close(-1, String())); } @@ -528,7 +529,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); EXPECT_CALL(web_socket_scope.Channel(), Close(-1, String())); } @@ -556,7 +557,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); EXPECT_CALL(web_socket_scope.Channel(), Close(-1, String())); EXPECT_CALL(web_socket_scope.Channel(), Disconnect()); @@ -588,7 +589,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); } web_socket_scope.Socket().Connect("ws://example.com/", Vector<String>(), @@ -611,7 +612,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); EXPECT_CALL(web_socket_scope.Channel(), FailMock(_, _, _)); } @@ -636,7 +637,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); EXPECT_CALL(web_socket_scope.Channel(), Disconnect()); EXPECT_CALL(checkpoint, Call(1)); @@ -662,7 +663,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); EXPECT_CALL(web_socket_scope.Channel(), Send(CString("hello"))); } @@ -684,7 +685,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); EXPECT_CALL(web_socket_scope.Channel(), Send(CString("\xe7\x8b\x90\xe0\xa4\x94"))); @@ -709,7 +710,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); } web_socket_scope.Socket().Connect("ws://example.com/", Vector<String>(), @@ -732,7 +733,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); EXPECT_CALL(web_socket_scope.Channel(), FailMock(_, _, _)); } @@ -758,7 +759,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); EXPECT_CALL(web_socket_scope.Channel(), Disconnect()); EXPECT_CALL(checkpoint, Call(1)); @@ -785,7 +786,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); EXPECT_CALL(web_socket_scope.Channel(), Send(Ref(*view->buffer()), 0, 8)); } @@ -833,7 +834,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); EXPECT_CALL(web_socket_scope.Channel(), FailMock(_, _, _)); } @@ -862,7 +863,7 @@ { InSequence s; EXPECT_CALL(web_socket_scope.Channel(), - Connect(KURL(KURL(), "ws://example.com/"), String())) + Connect(KURL(NullURL(), "ws://example.com/"), String())) .WillOnce(Return(true)); } web_socket_scope.Socket().Connect("ws://example.com/", Vector<String>(),
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp index c1fb7fc..1bcfe18 100644 --- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp +++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
@@ -51,6 +51,7 @@ #include "modules/websockets/WebSocketChannelClient.h" #include "modules/websockets/WebSocketFrame.h" #include "modules/websockets/WebSocketHandleImpl.h" +#include "mojo/public/cpp/bindings/interface_request.h" #include "platform/WebFrameScheduler.h" #include "platform/WebTaskRunner.h" #include "platform/loader/fetch/UniqueIdentifier.h" @@ -193,7 +194,8 @@ } bool DocumentWebSocketChannel::Connect(const KURL& url, - const String& protocol) { + const String& protocol, + mojom::blink::WebSocketPtr socket_ptr) { NETWORK_DVLOG(1) << this << " Connect()"; if (!handle_) return false; @@ -243,19 +245,7 @@ return true; } - // TODO(kinuko): document() should return nullptr if we don't - // have valid document/frame that returns non-empty interface provider. - if (GetDocument() && GetDocument()->GetFrame() && - GetDocument()->GetFrame()->GetInterfaceProvider() != - InterfaceProvider::GetEmptyInterfaceProvider()) { - // Initialize the WebSocketHandle with the frame's InterfaceProvider to - // provide the WebSocket implementation with context about this frame. - // This is important so that the browser can show UI associated with - // the WebSocket (e.g., for certificate errors). - handle_->Initialize(GetDocument()->GetFrame()->GetInterfaceProvider()); - } else { - handle_->Initialize(Platform::Current()->GetInterfaceProvider()); - } + handle_->Initialize(std::move(socket_ptr)); handle_->Connect(url, protocols, loading_context_->GetSecurityOrigin(), loading_context_->FirstPartyForCookies(), loading_context_->UserAgent(), this); @@ -285,6 +275,18 @@ return true; } +bool DocumentWebSocketChannel::Connect(const KURL& url, + const String& protocol) { + mojom::blink::WebSocketPtr socket_ptr; + auto socket_request = mojo::MakeRequest(&socket_ptr); + if (GetDocument() && GetDocument()->GetFrame()) { + GetDocument()->GetFrame()->GetInterfaceProvider()->GetInterface( + std::move(socket_request)); + } + + return Connect(url, protocol, std::move(socket_ptr)); +} + void DocumentWebSocketChannel::Send(const CString& message) { NETWORK_DVLOG(1) << this << " Send(" << message << ") (CString argument)"; // FIXME: Change the inspector API to show the entire message instead
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h index 8e05203c..5aa19b3 100644 --- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h +++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h
@@ -52,6 +52,7 @@ #include "platform/wtf/text/CString.h" #include "platform/wtf/text/WTFString.h" #include "public/platform/WebCallbacks.h" +#include "public/platform/modules/websockets/websocket.mojom-blink.h" namespace blink { @@ -90,6 +91,10 @@ ~DocumentWebSocketChannel() override; + // Allows the caller to provide the Mojo pipe through which the socket is + // connected, overriding the interface provider of the Document. + bool Connect(const KURL&, const String& protocol, mojom::blink::WebSocketPtr); + // WebSocketChannel functions. bool Connect(const KURL&, const String& protocol) override; void Send(const CString& message) override;
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp index 079360f..bdcb50b 100644 --- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp +++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp
@@ -79,7 +79,11 @@ ~MockWebSocketHandle() override {} - MOCK_METHOD1(Initialize, void(InterfaceProvider*)); + MOCK_METHOD1(DoInitialize, void(mojom::blink::WebSocketPtr*)); + void Initialize(mojom::blink::WebSocketPtr websocket) override { + DoInitialize(&websocket); + } + MOCK_METHOD6(Connect, void(const KURL&, const Vector<String>&, @@ -156,13 +160,13 @@ void Connect() { { InSequence s; - EXPECT_CALL(*Handle(), Initialize(_)); - EXPECT_CALL(*Handle(), Connect(KURL(KURL(), "ws://localhost/"), _, _, _, - _, HandleClient())); + EXPECT_CALL(*Handle(), DoInitialize(_)); + EXPECT_CALL(*Handle(), Connect(KURL(NullURL(), "ws://localhost/"), _, _, + _, _, HandleClient())); EXPECT_CALL(*Handle(), FlowControl(65536)); EXPECT_CALL(*ChannelClient(), DidConnect(String("a"), String("b"))); } - EXPECT_TRUE(Channel()->Connect(KURL(KURL(), "ws://localhost/"), "x")); + EXPECT_TRUE(Channel()->Connect(KURL(NullURL(), "ws://localhost/"), "x")); HandleClient()->DidConnect(Handle(), String("a"), String("b")); ::testing::Mock::VerifyAndClearExpectations(this); } @@ -193,7 +197,7 @@ std::string(negation ? "doesn't equal" : "equals") + " to \"" + url_string + "\"") { - KURL url(KURL(), url_string); + KURL url(NullURL(), url_string); *result_listener << "where the url is \"" << arg.GetString().Utf8().data() << "\""; return arg == url; @@ -206,7 +210,7 @@ Checkpoint checkpoint; { InSequence s; - EXPECT_CALL(*Handle(), Initialize(_)); + EXPECT_CALL(*Handle(), DoInitialize(_)); EXPECT_CALL(*Handle(), Connect(KURLEq("ws://localhost/"), _, _, KURLEq("http://example.com/"), _, HandleClient())) @@ -216,7 +220,7 @@ EXPECT_CALL(*ChannelClient(), DidConnect(String("a"), String("b"))); } - KURL page_url(KURL(), "http://example.com/"); + KURL page_url(NullURL(), "http://example.com/"); page_holder_->GetFrame().GetSecurityContext()->SetSecurityOrigin( SecurityOrigin::Create(page_url)); Document& document = page_holder_->GetDocument(); @@ -225,7 +229,7 @@ EXPECT_STREQ("http://example.com/", document.FirstPartyForCookies().GetString().Utf8().data()); - EXPECT_TRUE(Channel()->Connect(KURL(KURL(), "ws://localhost/"), "x")); + EXPECT_TRUE(Channel()->Connect(KURL(NullURL(), "ws://localhost/"), "x")); EXPECT_EQ(1U, protocols.size()); EXPECT_STREQ("x", protocols[0].Utf8().data()); @@ -817,17 +821,17 @@ // Expectations for the normal result of calling Channel()->Connect() with a // non-null throttle. void NormalHandshakeExpectations() { - EXPECT_CALL(*Handle(), Initialize(_)); + EXPECT_CALL(*Handle(), DoInitialize(_)); EXPECT_CALL(*Handle(), Connect(_, _, _, _, _, _)); EXPECT_CALL(*Handle(), FlowControl(_)); EXPECT_CALL(*handshake_throttle_, ThrottleHandshake(_, _, _)); } - static KURL url() { return KURL(KURL(), "ws://localhost/"); } + static KURL url() { return KURL(NullURL(), "ws://localhost/"); } }; TEST_F(DocumentWebSocketChannelHandshakeThrottleTest, ThrottleArguments) { - EXPECT_CALL(*Handle(), Initialize(_)); + EXPECT_CALL(*Handle(), DoInitialize(_)); EXPECT_CALL(*Handle(), Connect(_, _, _, _, _, _)); EXPECT_CALL(*Handle(), FlowControl(_)); EXPECT_CALL(*handshake_throttle_,
diff --git a/third_party/WebKit/Source/modules/websockets/WebSocketHandle.h b/third_party/WebKit/Source/modules/websockets/WebSocketHandle.h index dd311ff..bb79f22 100644 --- a/third_party/WebKit/Source/modules/websockets/WebSocketHandle.h +++ b/third_party/WebKit/Source/modules/websockets/WebSocketHandle.h
@@ -34,10 +34,10 @@ #include <stdint.h> #include "platform/wtf/Forward.h" #include "platform/wtf/Vector.h" +#include "public/platform/modules/websockets/websocket.mojom-blink.h" namespace blink { -class InterfaceProvider; class KURL; class SecurityOrigin; class WebSocketHandleClient; @@ -60,11 +60,7 @@ virtual ~WebSocketHandle() {} - // This method may optionally be called before connect() to specify an - // InterfaceProvider to get a WebSocket instance. By default, connect() will - // use Platform::interfaceProvider(). - virtual void Initialize(InterfaceProvider*) = 0; - + virtual void Initialize(mojom::blink::WebSocketPtr) = 0; virtual void Connect(const KURL&, const Vector<String>& protocols, SecurityOrigin*,
diff --git a/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp b/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp index 06ea65c..bd3556a 100644 --- a/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp +++ b/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp
@@ -14,7 +14,6 @@ #include "platform/weborigin/SecurityOrigin.h" #include "platform/wtf/Functional.h" #include "platform/wtf/text/WTFString.h" -#include "public/platform/InterfaceProvider.h" #include "public/platform/Platform.h" namespace blink { @@ -36,12 +35,11 @@ websocket_->StartClosingHandshake(kAbnormalShutdownOpCode, g_empty_string); } -void WebSocketHandleImpl::Initialize(InterfaceProvider* interface_provider) { +void WebSocketHandleImpl::Initialize(mojom::blink::WebSocketPtr websocket) { NETWORK_DVLOG(1) << this << " initialize(...)"; DCHECK(!websocket_); - interface_provider->GetInterface(mojo::MakeRequest(&websocket_)); - + websocket_ = std::move(websocket); websocket_.set_connection_error_with_reason_handler( ConvertToBaseCallback(WTF::Bind(&WebSocketHandleImpl::OnConnectionError, WTF::Unretained(this))));
diff --git a/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.h b/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.h index 5a4dd9e..e89ce81 100644 --- a/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.h +++ b/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.h
@@ -43,7 +43,7 @@ WebSocketHandleImpl(); ~WebSocketHandleImpl() override; - void Initialize(InterfaceProvider*) override; + void Initialize(mojom::blink::WebSocketPtr) override; void Connect(const KURL&, const Vector<String>& protocols, SecurityOrigin*,
diff --git a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp index 3181935..46fe4d4 100644 --- a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp +++ b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp
@@ -37,6 +37,7 @@ #include "core/loader/ThreadableLoadingContext.h" #include "core/workers/WorkerGlobalScope.h" #include "core/workers/WorkerThread.h" +#include "core/workers/WorkerThreadLifecycleContext.h" #include "platform/CrossThreadFunctional.h" #include "platform/WaitableEvent.h" #include "platform/heap/SafePoint.h" @@ -45,7 +46,7 @@ #include "platform/wtf/PtrUtil.h" #include "platform/wtf/text/CString.h" #include "platform/wtf/text/WTFString.h" -#include "public/platform/Platform.h" +#include "public/platform/InterfaceProvider.h" namespace blink { @@ -182,11 +183,13 @@ return true; } -bool MainChannelClient::Connect(const KURL& url, const String& protocol) { +bool MainChannelClient::Connect(const KURL& url, + const String& protocol, + mojom::blink::WebSocketPtr socket_ptr) { DCHECK(IsMainThread()); if (!main_channel_) return false; - return main_channel_->Connect(url, protocol); + return main_channel_->Connect(url, protocol, std::move(socket_ptr)); } void MainChannelClient::SendTextAsCharVector( @@ -374,6 +377,7 @@ WorkerThreadLifecycleContext* worker_thread_lifecycle_context, const KURL& url, const String& protocol, + mojom::blink::WebSocketPtrInfo socket_ptr_info, WebSocketChannelSyncHelper* sync_helper) { DCHECK(IsMainThread()); DCHECK(!main_channel_client_); @@ -382,8 +386,8 @@ worker_thread_lifecycle_context); if (main_channel_client->Initialize(std::move(location), loading_context)) { main_channel_client_ = main_channel_client; - sync_helper->SetConnectRequestResult( - main_channel_client_->Connect(url, protocol)); + sync_helper->SetConnectRequestResult(main_channel_client_->Connect( + url, protocol, mojo::MakeProxy(std::move(socket_ptr_info)))); } sync_helper->SignalWorkerThread(); } @@ -398,6 +402,9 @@ RefPtr<WebTaskRunner> worker_networking_task_runner = TaskRunnerHelper::Get(TaskType::kNetworking, worker_global_scope_.Get()); WorkerThread* worker_thread = worker_global_scope_->GetThread(); + mojom::blink::WebSocketPtrInfo socket_ptr_info; + worker_thread->GetInterfaceProvider()->GetInterface( + mojo::MakeRequest(&socket_ptr_info)); parent_frame_task_runners_->Get(TaskType::kNetworking) ->PostTask( BLINK_FROM_HERE, @@ -408,7 +415,8 @@ std::move(worker_networking_task_runner), WrapCrossThreadPersistent( worker_thread->GetWorkerThreadLifecycleContext()), - url, protocol, CrossThreadUnretained(&sync_helper))); + url, protocol, WTF::Passed(std::move(socket_ptr_info)), + CrossThreadUnretained(&sync_helper))); sync_helper.Wait(); return sync_helper.ConnectRequestResult(); }
diff --git a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h index ef95d50..4007cac 100644 --- a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h +++ b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h
@@ -46,6 +46,7 @@ #include "platform/wtf/Vector.h" #include "platform/wtf/text/WTFString.h" #include "public/platform/WebTraceLocation.h" +#include "public/platform/modules/websockets/websocket.mojom-blink.h" namespace blink { @@ -54,6 +55,7 @@ class ThreadableLoadingContext; class WebSocketChannelSyncHelper; class WorkerGlobalScope; +class WorkerThreadLifecycleContext; class WorkerWebSocketChannel final : public WebSocketChannel { WTF_MAKE_NONCOPYABLE(WorkerWebSocketChannel); @@ -111,7 +113,9 @@ // SourceLocation parameter may be shown when the connection fails. bool Initialize(std::unique_ptr<SourceLocation>, ThreadableLoadingContext*); - bool Connect(const KURL&, const String& protocol); + bool Connect(const KURL&, + const String& protocol, + mojom::blink::WebSocketPtr); void SendTextAsCharVector(std::unique_ptr<Vector<char>>); void SendBinaryAsCharVector(std::unique_ptr<Vector<char>>); void SendBlob(PassRefPtr<BlobDataHandle>); @@ -178,6 +182,7 @@ WorkerThreadLifecycleContext*, const KURL&, const String& protocol, + mojom::blink::WebSocketPtrInfo, WebSocketChannelSyncHelper*); // Returns null when |disconnect| has already been called.
diff --git a/third_party/WebKit/Source/platform/BUILD.gn b/third_party/WebKit/Source/platform/BUILD.gn index 00273c0..093d6e6 100644 --- a/third_party/WebKit/Source/platform/BUILD.gn +++ b/third_party/WebKit/Source/platform/BUILD.gn
@@ -617,6 +617,7 @@ "exported/WebScrollbarThemeGeometryNative.h", "exported/WebScrollbarThemePainter.cpp", "exported/WebSecurityOrigin.cpp", + "exported/WebServiceWorkerInstalledScriptsManager.cpp", "exported/WebServiceWorkerRequest.cpp", "exported/WebServiceWorkerResponse.cpp", "exported/WebServiceWorkerStreamHandle.cpp", @@ -1096,6 +1097,7 @@ "graphics/paint/PaintChunker.h", "graphics/paint/PaintController.cpp", "graphics/paint/PaintController.h", + "graphics/paint/PaintControllerDebugData.cpp", "graphics/paint/PaintFlags.h", "graphics/paint/PaintPropertyNode.cpp", "graphics/paint/PaintPropertyNode.h", @@ -1113,7 +1115,6 @@ "graphics/paint/ScrollDisplayItem.h", "graphics/paint/ScrollPaintPropertyNode.cpp", "graphics/paint/ScrollPaintPropertyNode.h", - "graphics/paint/SubsequenceRecorder.cpp", "graphics/paint/SubsequenceRecorder.h", "graphics/paint/Transform3DDisplayItem.cpp", "graphics/paint/Transform3DDisplayItem.h", @@ -1748,6 +1749,8 @@ "testing/TestPaintArtifact.h", "testing/TestingPlatformSupport.cpp", "testing/TestingPlatformSupport.h", + "testing/TestingPlatformSupportWithWebRTC.cpp", + "testing/TestingPlatformSupportWithWebRTC.h", "testing/TransformPrinters.cpp", "testing/TransformPrinters.h", "testing/URLTestHelpers.cpp",
diff --git a/third_party/WebKit/Source/platform/CrossThreadCopier.h b/third_party/WebKit/Source/platform/CrossThreadCopier.h index b121abf..7f73fcd 100644 --- a/third_party/WebKit/Source/platform/CrossThreadCopier.h +++ b/third_party/WebKit/Source/platform/CrossThreadCopier.h
@@ -32,6 +32,7 @@ #define CrossThreadCopier_h #include <memory> +#include "mojo/public/cpp/bindings/interface_ptr_info.h" #include "platform/PlatformExport.h" #include "platform/wtf/Assertions.h" #include "platform/wtf/Forward.h" @@ -230,6 +231,16 @@ PLATFORM_EXPORT static Type Copy(const ResourceResponse&); }; +// mojo::InterfacePtrInfo is a cross-thread safe mojo::InterfacePtr. +template <typename Interface> +struct CrossThreadCopier<mojo::InterfacePtrInfo<Interface>> { + STATIC_ONLY(CrossThreadCopier); + using Type = mojo::InterfacePtrInfo<Interface>; + static Type Copy(Type ptr_info) { + return ptr_info; // This is in fact a move. + } +}; + } // namespace blink #endif // CrossThreadCopier_h
diff --git a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 index 8bc92e4..343e739 100644 --- a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 +++ b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5
@@ -577,9 +577,6 @@ name: "LoadingWithMojo", }, { - name: "LocationHardReload", - }, - { name: "LongTaskObserver", status: "stable", }, @@ -664,7 +661,7 @@ }, { name: "ModuleScripts", - status: "experimental", + status: "stable", }, { name: "MojoBlobs",
diff --git a/third_party/WebKit/Source/platform/WebTaskRunnerTest.cpp b/third_party/WebKit/Source/platform/WebTaskRunnerTest.cpp index 8010a7b..9e4ed4c 100644 --- a/third_party/WebKit/Source/platform/WebTaskRunnerTest.cpp +++ b/third_party/WebKit/Source/platform/WebTaskRunnerTest.cpp
@@ -95,14 +95,14 @@ count = 0; handle = task_runner->PostCancellableTask( BLINK_FROM_HERE, WTF::Bind(&Increment, WTF::Unretained(&count))); -#if COMPILER(CLANG) +#if defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wself-move" handle = std::move(handle); #pragma GCC diagnostic pop #else handle = std::move(handle); -#endif // COMPILER(CLANG) +#endif // defined(__clang__) EXPECT_EQ(0, count); task_runner->RunUntilIdle(); EXPECT_EQ(1, count);
diff --git a/third_party/WebKit/Source/platform/audio/DenormalDisabler.h b/third_party/WebKit/Source/platform/audio/DenormalDisabler.h index ceb14de..5678bc9 100644 --- a/third_party/WebKit/Source/platform/audio/DenormalDisabler.h +++ b/third_party/WebKit/Source/platform/audio/DenormalDisabler.h
@@ -27,8 +27,8 @@ #define DenormalDisabler_h #include <float.h> +#include "build/build_config.h" #include "platform/wtf/Allocator.h" -#include "platform/wtf/CPU.h" #include "platform/wtf/MathExtras.h" namespace blink { @@ -37,17 +37,17 @@ // Define HAVE_DENORMAL if we support flushing denormals to zero. -#if OS(WIN) && COMPILER(MSVC) +#if defined(OS_WIN) && defined(COMPILER_MSVC) // Windows compiled using MSVC with SSE2 #define HAVE_DENORMAL 1 #endif -#if COMPILER(GCC) && (CPU(X86) || CPU(X86_64)) +#if defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY) // X86 chips can flush denormals #define HAVE_DENORMAL 1 #endif -#if CPU(ARM) || CPU(ARM64) +#if defined(ARCH_CPU_ARM_FAMILY) #define HAVE_DENORMAL 1 #endif @@ -66,7 +66,7 @@ private: unsigned saved_csr_; -#if COMPILER(GCC) && (CPU(X86) || CPU(X86_64)) +#if defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY) inline void DisableDenormals() { saved_csr_ = GetCSR(); SetCSR(saved_csr_ | 0x8040); @@ -85,7 +85,7 @@ asm volatile("ldmxcsr %0" : : "m"(temp)); } -#elif OS(WIN) && COMPILER(MSVC) +#elif defined(OS_WIN) && defined(COMPILER_MSVC) inline void DisableDenormals() { // Save the current state, and set mode to flush denormals. // @@ -99,7 +99,7 @@ unsigned unused; _controlfp_s(&unused, saved_csr_, _MCW_DN); } -#elif CPU(ARM) || CPU(ARM64) +#elif defined(ARCH_CPU_ARM_FAMILY) inline void DisableDenormals() { saved_csr_ = GetStatusWord(); // Bit 24 is the flush-to-zero mode control bit. Setting it to 1 flushes @@ -111,7 +111,7 @@ inline int GetStatusWord() { int result; -#if CPU(ARM64) +#if defined(ARCH_CPU_ARM64) asm volatile("mrs %x[result], FPCR" : [result] "=r"(result)); #else asm volatile("vmrs %[result], FPSCR" : [result] "=r"(result)); @@ -120,7 +120,7 @@ } inline void SetStatusWord(int a) { -#if CPU(ARM64) +#if defined(ARCH_CPU_ARM64) asm volatile("msr FPCR, %x[src]" : : [src] "r"(a)); #else asm volatile("vmsr FPSCR, %[src]" : : [src] "r"(a));
diff --git a/third_party/WebKit/Source/platform/audio/DirectConvolver.cpp b/third_party/WebKit/Source/platform/audio/DirectConvolver.cpp index 3afce0a..80bbf90 100644 --- a/third_party/WebKit/Source/platform/audio/DirectConvolver.cpp +++ b/third_party/WebKit/Source/platform/audio/DirectConvolver.cpp
@@ -28,14 +28,14 @@ #include "platform/audio/DirectConvolver.h" -#if OS(MACOSX) +#include "build/build_config.h" +#include "platform/audio/VectorMath.h" + +#if defined(OS_MACOSX) #include <Accelerate/Accelerate.h> #endif -#include "platform/audio/VectorMath.h" -#include "platform/wtf/CPU.h" - -#if (CPU(X86) || CPU(X86_64)) && !OS(MACOSX) +#if defined(ARCH_CPU_X86_FAMILY) && !defined(OS_MACOSX) #include <emmintrin.h> #endif @@ -73,17 +73,17 @@ // Copy samples to 2nd half of input buffer. memcpy(input_p, source_p, sizeof(float) * frames_to_process); -#if OS(MACOSX) -#if CPU(X86) +#if defined(OS_MACOSX) +#if defined(ARCH_CPU_X86) conv(inputP - kernelSize + 1, 1, kernelP + kernelSize - 1, -1, destP, 1, framesToProcess, kernelSize); #else vDSP_conv(input_p - kernel_size + 1, 1, kernel_p + kernel_size - 1, -1, dest_p, 1, frames_to_process, kernel_size); -#endif // CPU(X86) +#endif // ARCH_CPU_X86 #else size_t i = 0; -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) // Convolution using SSE2. Currently only do this if both |kernelSize| and // |framesToProcess| are multiples of 4. If not, use the straightforward loop // below. @@ -397,10 +397,10 @@ } dest_p[i++] = sum; } -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) } #endif -#endif // OS(MACOSX) +#endif // OS_MACOSX // Copy 2nd half of input buffer to 1st half. memcpy(buffer_.Data(), input_p, sizeof(float) * frames_to_process);
diff --git a/third_party/WebKit/Source/platform/audio/SincResampler.cpp b/third_party/WebKit/Source/platform/audio/SincResampler.cpp index 9aa69974..2a2862b 100644 --- a/third_party/WebKit/Source/platform/audio/SincResampler.cpp +++ b/third_party/WebKit/Source/platform/audio/SincResampler.cpp
@@ -27,11 +27,12 @@ */ #include "platform/audio/SincResampler.h" + +#include "build/build_config.h" #include "platform/audio/AudioBus.h" -#include "platform/wtf/CPU.h" #include "platform/wtf/MathExtras.h" -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) #include <emmintrin.h> #endif @@ -275,7 +276,7 @@ { float input; -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) // If the sourceP address is not 16-byte aligned, the first several // frames (at most three) should be processed seperately. while ((reinterpret_cast<uintptr_t>(input_p) & 0x0F) && n) {
diff --git a/third_party/WebKit/Source/platform/audio/VectorMath.cpp b/third_party/WebKit/Source/platform/audio/VectorMath.cpp index 88704c4ef..75c7169 100644 --- a/third_party/WebKit/Source/platform/audio/VectorMath.cpp +++ b/third_party/WebKit/Source/platform/audio/VectorMath.cpp
@@ -26,6 +26,7 @@ #include "platform/audio/VectorMath.h" #include <stdint.h> +#include "build/build_config.h" #include "platform/wtf/Assertions.h" #include "platform/wtf/CPU.h" #include "platform/wtf/MathExtras.h" @@ -34,11 +35,11 @@ #include <Accelerate/Accelerate.h> #endif -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) #include <emmintrin.h> #endif -#if CPU(ARM_NEON) +#if WTF_CPU_ARM_NEON #include <arm_neon.h> #endif @@ -66,7 +67,7 @@ float* dest_p, int dest_stride, size_t frames_to_process) { -#if CPU(X86) +#if defined(ARCH_CPU_X86) ::vsmul(sourceP, sourceStride, scale, destP, destStride, framesToProcess); #else vDSP_vsmul(source_p, source_stride, scale, dest_p, dest_stride, @@ -81,7 +82,7 @@ float* dest_p, int dest_stride, size_t frames_to_process) { -#if CPU(X86) +#if defined(ARCH_CPU_X86) ::vadd(source1P, sourceStride1, source2P, sourceStride2, destP, destStride, framesToProcess); #else @@ -97,7 +98,7 @@ float* dest_p, int dest_stride, size_t frames_to_process) { -#if CPU(X86) +#if defined(ARCH_CPU_X86) ::vmul(source1P, sourceStride1, source2P, sourceStride2, destP, destStride, framesToProcess); #else @@ -122,7 +123,7 @@ sc2.imagp = const_cast<float*>(imag2p); dest.realp = real_dest_p; dest.imagp = imag_dest_p; -#if CPU(X86) +#if defined(ARCH_CPU_X86) ::zvmul(&sc1, 1, &sc2, 1, &dest, 1, framesToProcess, 1); #else vDSP_zvmul(&sc1, 1, &sc2, 1, &dest, 1, frames_to_process, 1); @@ -176,7 +177,7 @@ size_t frames_to_process) { int n = frames_to_process; -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) if ((source_stride == 1) && (dest_stride == 1)) { float k = *scale; @@ -218,7 +219,7 @@ n = tail_frames; } -#elif CPU(ARM_NEON) +#elif WTF_CPU_ARM_NEON if ((source_stride == 1) && (dest_stride == 1)) { int tail_frames = n % 4; const float* end_p = dest_p + n - tail_frames; @@ -274,7 +275,7 @@ size_t frames_to_process) { int n = frames_to_process; -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) if ((source_stride == 1) && (dest_stride == 1)) { float k = *scale; @@ -323,7 +324,7 @@ n--; } } else { // If strides are not 1, rollback to normal algorithm. -#elif CPU(ARM_NEON) +#elif WTF_CPU_ARM_NEON if ((source_stride == 1) && (dest_stride == 1)) { float k = *scale; int tail_frames = n % 4; @@ -363,7 +364,7 @@ source_p += source_stride; dest_p += dest_stride; } -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) } #endif } @@ -377,7 +378,7 @@ size_t frames_to_process) { int n = frames_to_process; -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) if ((source_stride1 == 1) && (source_stride2 == 1) && (dest_stride == 1)) { // If the sourceP address is not 16-byte aligned, the first several frames // (at most three) should be processed separately. @@ -461,7 +462,7 @@ n--; } } else { // if strides are not 1, rollback to normal algorithm -#elif CPU(ARM_NEON) +#elif WTF_CPU_ARM_NEON if ((source_stride1 == 1) && (source_stride2 == 1) && (dest_stride == 1)) { int tail_frames = n % 4; const float* end_p = dest_p + n - tail_frames; @@ -504,7 +505,7 @@ source2p += source_stride2; dest_p += dest_stride; } -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) } #endif } @@ -518,7 +519,7 @@ size_t frames_to_process) { int n = frames_to_process; -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) if ((source_stride1 == 1) && (source_stride2 == 1) && (dest_stride == 1)) { // If the source1P address is not 16-byte aligned, the first several frames // (at most three) should be processed separately. @@ -564,7 +565,7 @@ n = tail_frames; } -#elif CPU(ARM_NEON) +#elif WTF_CPU_ARM_NEON if ((source_stride1 == 1) && (source_stride2 == 1) && (dest_stride == 1)) { int tail_frames = n % 4; const float* end_p = dest_p + n - tail_frames; @@ -618,7 +619,7 @@ float* imag_dest_p, size_t frames_to_process) { unsigned i = 0; -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) // Only use the SSE optimization in the very common case that all addresses // are 16-byte aligned. Otherwise, fall through to the scalar code below. if (!(reinterpret_cast<uintptr_t>(real1p) & 0x0F) && @@ -642,7 +643,7 @@ i += 4; } } -#elif CPU(ARM_NEON) +#elif WTF_CPU_ARM_NEON unsigned end_size = frames_to_process - frames_to_process % 4; while (i < end_size) { float32x4_t real1 = vld1q_f32(real1p + i); @@ -677,7 +678,7 @@ int n = frames_to_process; float sum = 0; -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) if (source_stride == 1) { // If the sourceP address is not 16-byte aligned, the first several frames // (at most three) should be processed separately. @@ -707,7 +708,7 @@ n = tail_frames; } -#elif CPU(ARM_NEON) +#elif WTF_CPU_ARM_NEON if (source_stride == 1) { int tail_frames = n % 4; const float* end_p = source_p + n - tail_frames; @@ -746,7 +747,7 @@ int n = frames_to_process; float max = 0; -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) if (source_stride == 1) { // If the sourceP address is not 16-byte aligned, the first several frames // (at most three) should be processed separately. @@ -782,7 +783,7 @@ n = tail_frames; } -#elif CPU(ARM_NEON) +#elif WTF_CPU_ARM_NEON if (source_stride == 1) { int tail_frames = n % 4; const float* end_p = source_p + n - tail_frames; @@ -847,7 +848,7 @@ float high_threshold = *high_threshold_p; // FIXME: Optimize for SSE2. -#if CPU(ARM_NEON) +#if WTF_CPU_ARM_NEON if ((source_stride == 1) && (dest_stride == 1)) { int tail_frames = n % 4; const float* end_p = dest_p + n - tail_frames;
diff --git a/third_party/WebKit/Source/platform/bindings/ScriptWrappable.h b/third_party/WebKit/Source/platform/bindings/ScriptWrappable.h index 762b8d0..cc1358d 100644 --- a/third_party/WebKit/Source/platform/bindings/ScriptWrappable.h +++ b/third_party/WebKit/Source/platform/bindings/ScriptWrappable.h
@@ -31,11 +31,11 @@ #ifndef ScriptWrappable_h #define ScriptWrappable_h +#include "build/build_config.h" #include "platform/PlatformExport.h" #include "platform/bindings/ScriptWrappableVisitor.h" #include "platform/bindings/WrapperTypeInfo.h" #include "platform/heap/Handle.h" -#include "platform/wtf/Compiler.h" #include "platform/wtf/Noncopyable.h" #include "platform/wtf/TypeTraits.h" #include "v8/include/v8.h" @@ -78,7 +78,7 @@ // have two or more ScriptWrappable as superclasses. If T has two // ScriptWrappable as superclasses, conversions from T* to // ScriptWrappable* are ambiguous. -#if !COMPILER(MSVC) +#if !defined(COMPILER_MSVC) // MSVC 2013 doesn't support static_assert + constexpr well. static_assert(!static_cast<ScriptWrappable*>(static_cast<T*>(nullptr)), "Class T must not have two or more ScriptWrappable as its "
diff --git a/third_party/WebKit/Source/platform/blob/BlobDataTest.cpp b/third_party/WebKit/Source/platform/blob/BlobDataTest.cpp index e88a65d..5c37d41 100644 --- a/third_party/WebKit/Source/platform/blob/BlobDataTest.cpp +++ b/third_party/WebKit/Source/platform/blob/BlobDataTest.cpp
@@ -375,7 +375,7 @@ data->AppendBytes(small_test_data_.data(), 0); data->AppendBlob(empty_blob_, 0, 0); data->AppendFile("path", 0, 0, 0.0); - data->AppendFileSystemURL(KURL(), 0, 0, 0.0); + data->AppendFileSystemURL(NullURL(), 0, 0, 0.0); TestCreateBlob(std::move(data), {}); } @@ -451,7 +451,7 @@ TEST_F(BlobDataHandleTest, CreateFromFileAndFileSystemURL) { double timestamp1 = CurrentTime(); double timestamp2 = timestamp1 + 1; - KURL url(KURL(), "http://example.com/"); + KURL url(NullURL(), "http://example.com/"); std::unique_ptr<BlobData> data = BlobData::Create(); data->AppendFile("path", 4, 32, timestamp1); data->AppendFileSystemURL(url, 15, 876, timestamp2); @@ -476,7 +476,7 @@ TEST_F(BlobDataHandleTest, CreateFromFilesystemFileWithUnknownSize) { double timestamp = CurrentTime(); - KURL url(KURL(), "http://example.com/"); + KURL url(NullURL(), "http://example.com/"); Vector<ExpectedElement> expected_elements; expected_elements.push_back(ExpectedElement::FileFilesystem( url, 0, uint64_t(-1), WTF::Time::FromDoubleT(timestamp)));
diff --git a/third_party/WebKit/Source/platform/exported/WebImageTest.cpp b/third_party/WebKit/Source/platform/exported/WebImageTest.cpp index f2e7454..df9d6f3d 100644 --- a/third_party/WebKit/Source/platform/exported/WebImageTest.cpp +++ b/third_party/WebKit/Source/platform/exported/WebImageTest.cpp
@@ -39,7 +39,7 @@ namespace blink { static RefPtr<SharedBuffer> ReadFile(const char* file_name) { - String file_path = testing::WebTestDataPath(file_name); + String file_path = testing::CoreTestDataPath(file_name); return testing::ReadFromFile(file_path); }
diff --git a/third_party/WebKit/Source/platform/exported/WebRuntimeFeatures.cpp b/third_party/WebKit/Source/platform/exported/WebRuntimeFeatures.cpp index 2eedb74..7a0bd44 100644 --- a/third_party/WebKit/Source/platform/exported/WebRuntimeFeatures.cpp +++ b/third_party/WebKit/Source/platform/exported/WebRuntimeFeatures.cpp
@@ -172,6 +172,10 @@ RuntimeEnabledFeatures::SetMediaSessionEnabled(enable); } +void WebRuntimeFeatures::EnableModuleScripts(bool enable) { + RuntimeEnabledFeatures::SetModuleScriptsEnabled(enable); +} + void WebRuntimeFeatures::EnableMojoBlobs(bool enable) { RuntimeEnabledFeatures::SetMojoBlobsEnabled(enable); } @@ -406,10 +410,6 @@ RuntimeEnabledFeatures::SetMediaControlsOverlayPlayButtonEnabled(enable); } -void WebRuntimeFeatures::EnableLocationHardReload(bool enable) { - RuntimeEnabledFeatures::SetLocationHardReloadEnabled(enable); -} - void WebRuntimeFeatures::EnableRemotePlaybackBackend(bool enable) { RuntimeEnabledFeatures::SetRemotePlaybackBackendEnabled(enable); } @@ -418,4 +418,8 @@ RuntimeEnabledFeatures::SetMediaCastOverlayButtonEnabled(enable); } +void WebRuntimeFeatures::EnableWebAuth(bool enable) { + RuntimeEnabledFeatures::SetWebAuthEnabled(enable); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/platform/exported/WebServiceWorkerInstalledScriptsManager.cpp b/third_party/WebKit/Source/platform/exported/WebServiceWorkerInstalledScriptsManager.cpp new file mode 100644 index 0000000..511fba327 --- /dev/null +++ b/third_party/WebKit/Source/platform/exported/WebServiceWorkerInstalledScriptsManager.cpp
@@ -0,0 +1,24 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "public/platform/modules/serviceworker/WebServiceWorkerInstalledScriptsManager.h" + +namespace blink { + +WebServiceWorkerInstalledScriptsManager::RawScriptData::RawScriptData( + WebString encoding, + WebVector<BytesChunk> script_text, + WebVector<BytesChunk> meta_data) + : encoding_(std::move(encoding)), + script_text_(std::move(script_text)), + meta_data_(std::move(meta_data)), + headers_(WTF::MakeUnique<CrossThreadHTTPHeaderMapData>()) {} + +void WebServiceWorkerInstalledScriptsManager::RawScriptData::AddHeader( + const WebString& key, + const WebString& value) { + headers_->emplace_back(key, value); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp index 9fcc268..3498cc3e 100644 --- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp +++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
@@ -107,34 +107,28 @@ WebFeaturePolicyFeature::kFullscreen); default_feature_name_map.Set("payment", WebFeaturePolicyFeature::kPayment); default_feature_name_map.Set("usb", WebFeaturePolicyFeature::kUsb); + default_feature_name_map.Set("camera", WebFeaturePolicyFeature::kCamera); + default_feature_name_map.Set("encrypted-media", + WebFeaturePolicyFeature::kEme); + default_feature_name_map.Set("microphone", + WebFeaturePolicyFeature::kMicrophone); + default_feature_name_map.Set("speaker", WebFeaturePolicyFeature::kSpeaker); + default_feature_name_map.Set("geolocation", + WebFeaturePolicyFeature::kGeolocation); + default_feature_name_map.Set("midi", WebFeaturePolicyFeature::kMidiFeature); if (RuntimeEnabledFeatures::FeaturePolicyExperimentalFeaturesEnabled()) { default_feature_name_map.Set("vibrate", WebFeaturePolicyFeature::kVibrate); - default_feature_name_map.Set("camera", WebFeaturePolicyFeature::kCamera); - default_feature_name_map.Set("encrypted-media", - WebFeaturePolicyFeature::kEme); - default_feature_name_map.Set("microphone", - WebFeaturePolicyFeature::kMicrophone); - default_feature_name_map.Set("speaker", - WebFeaturePolicyFeature::kSpeaker); default_feature_name_map.Set("cookie", WebFeaturePolicyFeature::kDocumentCookie); default_feature_name_map.Set("domain", WebFeaturePolicyFeature::kDocumentDomain); default_feature_name_map.Set("docwrite", WebFeaturePolicyFeature::kDocumentWrite); - default_feature_name_map.Set("geolocation", - WebFeaturePolicyFeature::kGeolocation); - default_feature_name_map.Set("midi", - WebFeaturePolicyFeature::kMidiFeature); - default_feature_name_map.Set("notifications", - WebFeaturePolicyFeature::kNotifications); - default_feature_name_map.Set("push", WebFeaturePolicyFeature::kPush); default_feature_name_map.Set("sync-script", WebFeaturePolicyFeature::kSyncScript); default_feature_name_map.Set("sync-xhr", WebFeaturePolicyFeature::kSyncXHR); - default_feature_name_map.Set("webrtc", WebFeaturePolicyFeature::kWebRTC); } } return default_feature_name_map;
diff --git a/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp b/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp index 9e3a878..fac7f50 100644 --- a/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp +++ b/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp
@@ -30,6 +30,7 @@ #include "platform/fonts/WebFontDecoder.h" +#include "build/build_config.h" #include "platform/Histogram.h" #include "platform/SharedBuffer.h" #include "platform/fonts/FontCache.h" @@ -63,7 +64,7 @@ va_list args; va_start(args, format); -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) int result = _vscprintf(format, args); #else char ch;
diff --git a/third_party/WebKit/Source/platform/graphics/Color.cpp b/third_party/WebKit/Source/platform/graphics/Color.cpp index cb155f5..61102c6b 100644 --- a/third_party/WebKit/Source/platform/graphics/Color.cpp +++ b/third_party/WebKit/Source/platform/graphics/Color.cpp
@@ -25,6 +25,7 @@ #include "platform/graphics/Color.h" +#include "build/build_config.h" #include "platform/Decimal.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/wtf/Assertions.h" @@ -36,7 +37,7 @@ namespace blink { // VS 2015 and above allow these definitions and in this case require them -#if !COMPILER(MSVC) || _MSC_VER >= 1900 +#if !defined(COMPILER_MSVC) || _MSC_VER >= 1900 // FIXME: Use C++11 enum classes to avoid static data member initializer // definition problems. const RGBA32 Color::kBlack;
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp index 2d721e29..d265df4 100644 --- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
@@ -749,7 +749,7 @@ // Node #0 reserved for null; #1 for root render surface. ASSERT_EQ(3u, scroll_tree.size()); const cc::ScrollNode& scroll_node = *scroll_tree.Node(2); - EXPECT_EQ(gfx::Size(11, 13), scroll_node.scroll_clip_layer_bounds); + EXPECT_EQ(gfx::Size(11, 13), scroll_node.container_bounds); EXPECT_EQ(gfx::Size(27, 31), scroll_node.bounds); EXPECT_TRUE(scroll_node.user_scrollable_horizontal); EXPECT_FALSE(scroll_node.user_scrollable_vertical); @@ -769,7 +769,6 @@ scroll_node.main_thread_scrolling_reasons); auto* layer = ContentLayerAt(0); - EXPECT_EQ(layer->id(), scroll_node.owning_layer_id); auto scroll_node_index = layer->scroll_tree_index(); EXPECT_EQ(scroll_node_index, scroll_node.id); @@ -865,7 +864,7 @@ // Node #0 reserved for null; #1 for root render surface. ASSERT_EQ(3u, scroll_tree.size()); const cc::ScrollNode& scroll_node = *scroll_tree.Node(2); - EXPECT_EQ(gfx::Size(2, 3), scroll_node.scroll_clip_layer_bounds); + EXPECT_EQ(gfx::Size(2, 3), scroll_node.container_bounds); EXPECT_EQ(gfx::Size(5, 7), scroll_node.bounds); EXPECT_FALSE(scroll_node.user_scrollable_horizontal); EXPECT_TRUE(scroll_node.user_scrollable_vertical);
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp index 944bdde..726fe2c 100644 --- a/third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp +++ b/third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp
@@ -137,7 +137,6 @@ cc::ScrollNode& scroll_node = *scroll_tree.Node(scroll_tree.Insert(cc::ScrollNode(), kRealRootNodeId)); DCHECK_EQ(scroll_node.id, kSecondaryRootNodeId); - scroll_node.owning_layer_id = root_layer_->id(); scroll_node.transform_id = kSecondaryRootNodeId; scroll_node_map_.Set(ScrollPaintPropertyNode::Root(), scroll_node.id); @@ -250,7 +249,7 @@ cc::ScrollNode& compositor_node = *GetScrollTree().Node(id); compositor_node.scrollable = true; - compositor_node.scroll_clip_layer_bounds = scroll_node->ContainerBounds(); + compositor_node.container_bounds = scroll_node->ContainerBounds(); compositor_node.bounds = scroll_node->Bounds(); compositor_node.user_scrollable_horizontal = scroll_node->UserScrollableHorizontal(); @@ -307,28 +306,26 @@ auto* enclosing_scroll_node = transform->FindEnclosingScrollNode(); int scroll_node_id = EnsureCompositorScrollNode(enclosing_scroll_node); layer->SetScrollTreeIndex(scroll_node_id); - int layer_id = layer->id(); auto& compositor_scroll_node = *GetScrollTree().Node(scroll_node_id); if (!transform->IsScrollTranslation()) return; - // TODO(pdr): Remove the scroll node's owning_layer_id. This approach of - // setting owning_layer_id only when it is not set lets us maintain a 1:1 - // mapping from layer to scroll node. - if (compositor_scroll_node.owning_layer_id == cc::Layer::INVALID_ID) { - compositor_scroll_node.owning_layer_id = layer_id; - auto& compositor_transform_node = - *GetTransformTree().Node(compositor_scroll_node.transform_id); - // TODO(pdr): Set this in updateScrollAndScrollTranslationNodes once the - // layer id is no longer needed. - GetScrollTree().SetScrollOffset(transform->GetCompositorElementId(), - compositor_transform_node.scroll_offset); - if (auto* scroll_client = enclosing_scroll_node->ScrollClient()) { - layer->set_did_scroll_callback( - base::Bind(&blink::WebLayerScrollClient::DidScroll, - base::Unretained(scroll_client))); - } + auto& compositor_transform_node = + *GetTransformTree().Node(compositor_scroll_node.transform_id); + // TODO(pdr): Set this in updateScrollAndScrollTranslationNodes once the + // layer id is no longer needed. + GetScrollTree().SetScrollOffset(transform->GetCompositorElementId(), + compositor_transform_node.scroll_offset); + + // TODO(pdr): This approach of setting a callback on all Layers with a scroll + // node is wrong because only the base scrollable layer needs this callback. + // This should be fixed as part of correctly creating scrollable layers in + // https://crbug.com/738613. + if (auto* scroll_client = enclosing_scroll_node->ScrollClient()) { + layer->set_did_scroll_callback( + base::Bind(&blink::WebLayerScrollClient::DidScroll, + base::Unretained(scroll_client))); } }
diff --git a/third_party/WebKit/Source/platform/graphics/cpu/arm/WebGLImageConversionNEON.h b/third_party/WebKit/Source/platform/graphics/cpu/arm/WebGLImageConversionNEON.h index 15a3981..6a6a7dd7 100644 --- a/third_party/WebKit/Source/platform/graphics/cpu/arm/WebGLImageConversionNEON.h +++ b/third_party/WebKit/Source/platform/graphics/cpu/arm/WebGLImageConversionNEON.h
@@ -27,7 +27,7 @@ #ifndef WebGLImageConversionNEON_h #define WebGLImageConversionNEON_h -#if CPU(ARM_NEON) +#if WTF_CPU_ARM_NEON #include <arm_neon.h> @@ -292,6 +292,6 @@ } // namespace blink -#endif // CPU(ARM_NEON) +#endif // WTF_CPU_ARM_NEON #endif // WebGLImageConversionNEON_h
diff --git a/third_party/WebKit/Source/platform/graphics/cpu/x86/WebGLImageConversionSSE.h b/third_party/WebKit/Source/platform/graphics/cpu/x86/WebGLImageConversionSSE.h index 38ae747..0c5e7fe 100644 --- a/third_party/WebKit/Source/platform/graphics/cpu/x86/WebGLImageConversionSSE.h +++ b/third_party/WebKit/Source/platform/graphics/cpu/x86/WebGLImageConversionSSE.h
@@ -5,8 +5,9 @@ #ifndef WebGLImageConversionSSE_h #define WebGLImageConversionSSE_h -#if CPU(X86) || CPU(X86_64) +#include "build/build_config.h" +#if defined(ARCH_CPU_X86_FAMILY) #include <emmintrin.h> namespace blink { @@ -194,6 +195,6 @@ } // namespace SIMD } // namespace blink -#endif // CPU(X86) || CPU(X86_64) +#endif // ARCH_CPU_X86_FAMILY #endif // WebGLImageConversionSSE_h
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTestHelpers.h b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTestHelpers.h index bd42a86..ec89a02 100644 --- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTestHelpers.h +++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTestHelpers.h
@@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef DrawingBufferTestHelpers_h +#define DrawingBufferTestHelpers_h + #include "gpu/command_buffer/common/capabilities.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/graphics/CanvasColorParams.h" @@ -423,3 +426,5 @@ }; } // blink + +#endif // DrawingBufferTestHelpers_h
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp index 0135af0..a26354e4 100644 --- a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp +++ b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
@@ -5,6 +5,7 @@ #include "platform/graphics/gpu/WebGLImageConversion.h" #include <memory> +#include "build/build_config.h" #include "platform/graphics/ImageObserver.h" #include "platform/graphics/cpu/arm/WebGLImageConversionNEON.h" #include "platform/graphics/cpu/mips/WebGLImageConversionMSA.h" @@ -442,7 +443,7 @@ const uint32_t* source32 = reinterpret_cast_ptr<const uint32_t*>(source); uint32_t* destination32 = reinterpret_cast_ptr<uint32_t*>(destination); -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) SIMD::UnpackOneRowOfBGRA8LittleToRGBA8(source32, destination32, pixels_per_row); #endif @@ -452,7 +453,7 @@ #endif for (unsigned i = 0; i < pixels_per_row; ++i) { uint32_t bgra = source32[i]; -#if CPU(BIG_ENDIAN) +#if defined(ARCH_CPU_BIG_ENDIAN) uint32_t brMask = 0xff00ff00; uint32_t gaMask = 0x00ff00ff; #else @@ -470,11 +471,11 @@ const uint16_t* source, uint8_t* destination, unsigned pixels_per_row) { -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) SIMD::UnpackOneRowOfRGBA5551LittleToRGBA8(source, destination, pixels_per_row); #endif -#if CPU(ARM_NEON) +#if WTF_CPU_ARM_NEON SIMD::UnpackOneRowOfRGBA5551ToRGBA8(source, destination, pixels_per_row); #endif #if HAVE(MIPS_MSA_INTRINSICS) @@ -500,7 +501,7 @@ const uint16_t* source, uint8_t* destination, unsigned pixels_per_row) { -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) SIMD::UnpackOneRowOfRGBA4444LittleToRGBA8(source, destination, pixels_per_row); #endif @@ -716,7 +717,7 @@ uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixels_per_row) { -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) SIMD::PackOneRowOfRGBA8LittleToR8(source, destination, pixels_per_row); #endif #if HAVE(MIPS_MSA_INTRINSICS) @@ -773,7 +774,7 @@ uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixels_per_row) { -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) SIMD::PackOneRowOfRGBA8LittleToRA8(source, destination, pixels_per_row); #endif #if HAVE(MIPS_MSA_INTRINSICS) @@ -885,7 +886,7 @@ uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixels_per_row) { -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) SIMD::PackOneRowOfRGBA8LittleToRGBA8(source, destination, pixels_per_row); #endif #if HAVE(MIPS_MSA_INTRINSICS)
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversionTest.cpp b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversionTest.cpp index 51a5d43..128ae15 100644 --- a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversionTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversionTest.cpp
@@ -4,6 +4,7 @@ #include "platform/graphics/gpu/WebGLImageConversion.h" +#include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink { @@ -74,7 +75,7 @@ uint32_t source_data[9] = {0x12345678, 0x34567888, 0x12345678, 0x34567888, 0x12345678, 0x34567888, 0x12345678, 0x34567888, 0x12345678}; -#if CPU(BIG_ENDIAN) +#if defined(ARCH_CPU_BIG_ENDIAN) uint32_t expectedData[9] = {0x56341278, 0x78563488, 0x56341278, 0x78563488, 0x56341278, 0x78563488, 0x56341278, 0x78563488, 0x56341278};
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp index a2fd70da..279bd0b 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp
@@ -30,17 +30,43 @@ size_t begin_index, size_t end_index, JsonFlags options) const { - std::unique_ptr<JSONArray> json_array = JSONArray::Create(); - size_t i = 0; - for (auto it = begin() + begin_index; it != begin() + end_index; ++it, ++i) { + auto json_array = JSONArray::Create(); + AppendSubsequenceAsJSON(begin_index, end_index, options, *json_array); + return json_array; +} + +void DisplayItemList::AppendSubsequenceAsJSON(size_t begin_index, + size_t end_index, + JsonFlags options, + JSONArray& json_array) const { + for (size_t i = begin_index; i < end_index; ++i) { std::unique_ptr<JSONObject> json = JSONObject::Create(); - const DisplayItem& display_item = *it; + const auto& display_item = (*this)[i]; if ((options & kSkipNonDrawings) && !display_item.IsDrawing()) continue; json->SetInteger("index", i); -#ifndef NDEBUG + + bool show_client_debug_name = options & kShowClientDebugName; +#if DCHECK_IS_ON() + if (display_item.HasValidClient()) { + if (display_item.Client().IsAlive()) + show_client_debug_name = true; + else + json->SetBoolean("clientIsAlive", false); + } +#endif + +#ifdef NDEBUG + // This is for NDEBUG only because DisplayItem::DumpPropertiesAsDebugString + // will output these information. + if (show_client_debug_name) + json->SetString("clientDebugName", display_item.Client().DebugName()); + + json->SetInteger("type", static_cast<int>(display_item.GetType())); + json->SetString("visualRect", display_item.VisualRect().ToString()); +#else StringBuilder string_builder; display_item.DumpPropertiesAsDebugString(string_builder); @@ -51,37 +77,17 @@ json->SetString("properties", string_builder.ToString()); } -#endif - if (display_item.HasValidClient()) { -#if DCHECK_IS_ON() - if (!display_item.Client().IsAlive()) { - json->SetBoolean("clientIsAlive", false); - } else { -#else - if (options & kShowClientDebugName) { -#endif + if ((options & kShowPaintRecords) && display_item.IsDrawing()) { + const auto& item = static_cast<const DrawingDisplayItem&>(display_item); + if (const PaintRecord* record = item.GetPaintRecord().get()) { json->SetString( - "clientDebugName", - String::Format("clientDebugName: \"%s\"", - display_item.Client().DebugName().Ascii().data())); + "record", RecordAsDebugString(record, item.GetPaintRecordBounds())); } -#ifndef NDEBUG - if ((options & kShowPaintRecords) && display_item.IsDrawing()) { - const DrawingDisplayItem& item = - static_cast<const DrawingDisplayItem&>(display_item); - if (const PaintRecord* record = item.GetPaintRecord().get()) { - json->SetString("record", RecordAsDebugString( - record, item.GetPaintRecordBounds())); - } - } -#endif } +#endif - json->SetString("visualRect", display_item.VisualRect().ToString()); - - json_array->PushObject(std::move(json)); + json_array.PushObject(std::move(json)); } - return json_array; } } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.h b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.h index aaf7a39..da4caa9 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.h +++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.h
@@ -85,7 +85,11 @@ std::unique_ptr<JSONArray> SubsequenceAsJSON(size_t begin_index, size_t end_index, - JsonFlags options) const; + JsonFlags) const; + void AppendSubsequenceAsJSON(size_t begin_index, + size_t end_index, + JsonFlags, + JSONArray&) const; }; } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp index b844cd25..b0a65e9 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp
@@ -8,21 +8,19 @@ namespace blink { -PaintChunker::PaintChunker() : force_new_chunk_(kDontForceNewChunk) {} +PaintChunker::PaintChunker() : force_new_chunk_(false) {} PaintChunker::~PaintChunker() {} void PaintChunker::UpdateCurrentPaintChunkProperties( const PaintChunk::Id* chunk_id, - const PaintChunkProperties& properties, - NewChunkForceState force_new_chunk) { + const PaintChunkProperties& properties) { DCHECK(RuntimeEnabledFeatures::SlimmingPaintV2Enabled()); current_chunk_id_ = WTF::nullopt; if (chunk_id) current_chunk_id_.emplace(*chunk_id); current_properties_ = properties; - force_new_chunk_ = force_new_chunk; } bool PaintChunker::IncrementDisplayItemIndex(const DisplayItem& item) { @@ -38,16 +36,14 @@ DCHECK(current_properties_.property_tree_state.Effect()); #endif - ItemBehavior behavior; - if (DisplayItem::IsForeignLayerType(item.GetType())) { - behavior = kRequiresSeparateChunk; + bool is_foreign_layer = DisplayItem::IsForeignLayerType(item.GetType()); + if (is_foreign_layer) { + force_new_chunk_ = true; // Clear current_chunk_id_ so that we will use the current display item's id // as the chunk id, and any display items after the foreign layer without a // new chunk id will be treated as having no id to avoid the chunk from // using the same id as the chunk before the foreign layer chunk. current_chunk_id_ = WTF::nullopt; - } else { - behavior = kDefaultBehavior; } size_t new_chunk_begin_index; @@ -55,47 +51,31 @@ new_chunk_begin_index = 0; } else { auto& last_chunk = chunks_.back(); - bool can_continue_chunk = - current_properties_ == last_chunk.properties && - behavior != kRequiresSeparateChunk && - chunk_behavior_.back() != kRequiresSeparateChunk && - force_new_chunk_ == kDontForceNewChunk; - if (can_continue_chunk) { + if (!force_new_chunk_ && current_properties_ == last_chunk.properties) { + // Continue the current chunk. last_chunk.end_index++; return false; } new_chunk_begin_index = last_chunk.end_index; } - force_new_chunk_ = kDontForceNewChunk; - auto cacheable = item.SkippedCache() ? PaintChunk::kUncacheable : PaintChunk::kCacheable; PaintChunk new_chunk(new_chunk_begin_index, new_chunk_begin_index + 1, current_chunk_id_ ? *current_chunk_id_ : item.GetId(), current_properties_, cacheable); chunks_.push_back(new_chunk); - chunk_behavior_.push_back(behavior); + + // For foreign layer display item, we still need to force new chunk for the + // next display item. Otherwise reset force_new_chunk_ to false. + if (!is_foreign_layer) + force_new_chunk_ = false; + return true; } -void PaintChunker::DecrementDisplayItemIndex() { - DCHECK(RuntimeEnabledFeatures::SlimmingPaintV2Enabled()); - DCHECK(!chunks_.IsEmpty()); - - auto& last_chunk = chunks_.back(); - if ((last_chunk.end_index - last_chunk.begin_index) > 1) { - last_chunk.end_index--; - return; - } - - chunks_.pop_back(); - chunk_behavior_.pop_back(); -} - void PaintChunker::Clear() { chunks_.clear(); - chunk_behavior_.clear(); current_chunk_id_ = WTF::nullopt; current_properties_ = PaintChunkProperties(); } @@ -103,7 +83,6 @@ Vector<PaintChunk> PaintChunker::ReleasePaintChunks() { Vector<PaintChunk> chunks; chunks.swap(chunks_); - chunk_behavior_.clear(); current_chunk_id_ = WTF::nullopt; current_properties_ = PaintChunkProperties(); return chunks;
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h b/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h index 946dde8..97352a0 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h
@@ -15,8 +15,6 @@ namespace blink { -enum NewChunkForceState { kDontForceNewChunk, kForceNewChunk }; - // Accepts information about changes to |PaintChunkProperties| as drawings are // accumulated, and produces a series of paint chunks: contiguous ranges of the // display list with identical |PaintChunkProperties|. @@ -35,15 +33,15 @@ const PaintChunkProperties& CurrentPaintChunkProperties() const { return current_properties_; } - void UpdateCurrentPaintChunkProperties( - const PaintChunk::Id*, - const PaintChunkProperties&, - NewChunkForceState force_new_chunk = kDontForceNewChunk); + void UpdateCurrentPaintChunkProperties(const PaintChunk::Id*, + const PaintChunkProperties&); + + void ForceNewChunk() { force_new_chunk_ = true; } // Returns true if a new chunk is created. bool IncrementDisplayItemIndex(const DisplayItem&); - void DecrementDisplayItemIndex(); + const Vector<PaintChunk>& PaintChunks() const { return chunks_; } PaintChunk& PaintChunkAt(size_t i) { return chunks_[i]; } size_t LastChunkIndex() const { @@ -64,19 +62,10 @@ Vector<PaintChunk> ReleasePaintChunks(); private: - enum ItemBehavior { - // Can be combined with adjacent items when building chunks. - kDefaultBehavior = 0, - - // Item requires its own paint chunk. - kRequiresSeparateChunk, - }; - Vector<PaintChunk> chunks_; - Vector<ItemBehavior> chunk_behavior_; Optional<PaintChunk::Id> current_chunk_id_; PaintChunkProperties current_properties_; - NewChunkForceState force_new_chunk_; + bool force_new_chunk_; }; } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp index 4402a8f..d01c130f 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp
@@ -83,20 +83,6 @@ ElementsAre(PaintChunk(0, 3, id, DefaultPaintChunkProperties()))); } -TEST_F(PaintChunkerTest, CanRewindDisplayItemIndex) { - PaintChunker chunker; - PaintChunk::Id id(client_, DisplayItemType(1)); - chunker.UpdateCurrentPaintChunkProperties(&id, DefaultPaintChunkProperties()); - chunker.IncrementDisplayItemIndex(TestDisplayItem(client_)); - chunker.IncrementDisplayItemIndex(TestDisplayItem(client_)); - chunker.DecrementDisplayItemIndex(); - chunker.IncrementDisplayItemIndex(TestDisplayItem(client_)); - Vector<PaintChunk> chunks = chunker.ReleasePaintChunks(); - - EXPECT_THAT(chunks, - ElementsAre(PaintChunk(0, 2, id, DefaultPaintChunkProperties()))); -} - TEST_F(PaintChunkerTest, BuildMultipleChunksWithSinglePropertyChanging) { PaintChunker chunker; PaintChunk::Id id1(client_, DisplayItemType(1)); @@ -289,12 +275,6 @@ TestDisplayItemRequiringSeparateChunk i2(client2); TestDisplayItemClient client3; TestDisplayItemRequiringSeparateChunk i3(client3); - TestDisplayItemClient client4; - TestDisplayItemRequiringSeparateChunk i4(client4); - TestDisplayItemClient client5; - TestDisplayItemRequiringSeparateChunk i5(client5); - TestDisplayItemClient client6; - TestDisplayItemRequiringSeparateChunk i6(client6); PaintChunk::Id id0(client_, DisplayItemType(0)); chunker.UpdateCurrentPaintChunkProperties(&id0, @@ -302,17 +282,10 @@ chunker.IncrementDisplayItemIndex(TestDisplayItem(client_)); chunker.IncrementDisplayItemIndex(i1); chunker.IncrementDisplayItemIndex(i2); + TestDisplayItem after_i2(client_, DisplayItemType(10)); + chunker.IncrementDisplayItemIndex(after_i2); + chunker.IncrementDisplayItemIndex(TestDisplayItem(client_)); chunker.IncrementDisplayItemIndex(i3); - TestDisplayItem after_i3(client_, DisplayItemType(10)); - chunker.IncrementDisplayItemIndex(after_i3); - chunker.IncrementDisplayItemIndex(TestDisplayItem(client_)); - chunker.IncrementDisplayItemIndex(i4); - chunker.IncrementDisplayItemIndex(i5); - chunker.DecrementDisplayItemIndex(); - chunker.DecrementDisplayItemIndex(); - chunker.DecrementDisplayItemIndex(); - chunker.IncrementDisplayItemIndex(TestDisplayItem(client_)); - chunker.IncrementDisplayItemIndex(i6); Vector<PaintChunk> chunks = chunker.ReleasePaintChunks(); EXPECT_THAT( @@ -321,9 +294,38 @@ PaintChunk(0, 1, id0, DefaultPaintChunkProperties()), PaintChunk(1, 2, i1.GetId(), DefaultPaintChunkProperties()), PaintChunk(2, 3, i2.GetId(), DefaultPaintChunkProperties()), - PaintChunk(3, 4, i3.GetId(), DefaultPaintChunkProperties()), - PaintChunk(4, 6, after_i3.GetId(), DefaultPaintChunkProperties()), - PaintChunk(6, 7, i6.GetId(), DefaultPaintChunkProperties()))); + PaintChunk(3, 5, after_i2.GetId(), DefaultPaintChunkProperties()), + PaintChunk(5, 6, i3.GetId(), DefaultPaintChunkProperties()))); +} + +TEST_F(PaintChunkerTest, ForceNewChunk) { + PaintChunker chunker; + PaintChunk::Id id0(client_, DisplayItemType(0)); + chunker.UpdateCurrentPaintChunkProperties(&id0, + DefaultPaintChunkProperties()); + chunker.IncrementDisplayItemIndex(TestDisplayItem(client_)); + chunker.IncrementDisplayItemIndex(TestDisplayItem(client_)); + + chunker.ForceNewChunk(); + PaintChunk::Id id1(client_, DisplayItemType(10)); + chunker.UpdateCurrentPaintChunkProperties(&id1, + DefaultPaintChunkProperties()); + chunker.IncrementDisplayItemIndex(TestDisplayItem(client_)); + chunker.IncrementDisplayItemIndex(TestDisplayItem(client_)); + + PaintChunk::Id id2(client_, DisplayItemType(20)); + chunker.UpdateCurrentPaintChunkProperties(&id2, + DefaultPaintChunkProperties()); + chunker.ForceNewChunk(); + chunker.IncrementDisplayItemIndex(TestDisplayItem(client_)); + chunker.IncrementDisplayItemIndex(TestDisplayItem(client_)); + + Vector<PaintChunk> chunks = chunker.ReleasePaintChunks(); + EXPECT_THAT( + chunks, + ElementsAre(PaintChunk(0, 2, id0, DefaultPaintChunkProperties()), + PaintChunk(2, 4, id1, DefaultPaintChunkProperties()), + PaintChunk(4, 6, id2, DefaultPaintChunkProperties()))); } TEST_F(PaintChunkerTest, ChunkIdsSkippingCache) {
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp index 028684a..d40ed26 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
@@ -13,7 +13,6 @@ #ifndef NDEBUG #include "platform/graphics/LoggingCanvas.h" -#include <stdio.h> #endif namespace blink { @@ -126,30 +125,30 @@ return false; } - // |cachedItem| will point to the first item after the subsequence or end of - // the current list. EnsureNewDisplayItemListInitialCapacity(); - size_t size_before_copy = new_display_item_list_.size(); - CopyCachedSubsequence(markers->start, markers->end); - - if (!RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled()) { - AddCachedSubsequence(client, size_before_copy, - new_display_item_list_.size() - 1); - } - - next_item_to_match_ = markers->end + 1; - // Items before |m_nextItemToMatch| have been copied so we don't need to index - // them. + next_item_to_match_ = markers->end; + // Items before |next_item_to_match_| have been copied so we don't need to + // index them. if (next_item_to_match_ > next_item_to_index_) next_item_to_index_ = next_item_to_match_; + num_cached_new_items_ += markers->end - markers->start; + if (RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled()) { + DCHECK(!IsCheckingUnderInvalidation()); + under_invalidation_checking_begin_ = markers->start; + under_invalidation_checking_end_ = markers->end; + under_invalidation_message_prefix_ = + "(In cached subsequence for " + client.DebugName() + ")"; // Return false to let the painter actually paint. We will check if the new // painting is the same as the cached one. return false; } + size_t start = BeginSubsequence(); + CopyCachedSubsequence(markers->start, markers->end); + EndSubsequence(client, start); return true; } @@ -161,11 +160,26 @@ return &result->value; } -void PaintController::AddCachedSubsequence(const DisplayItemClient& client, - unsigned start, - unsigned end) { - DCHECK(start <= end); - DCHECK(end < new_display_item_list_.size()); +size_t PaintController::BeginSubsequence() { + // Force new paint chunk which is required for subsequence caching. + new_paint_chunks_.ForceNewChunk(); + return new_display_item_list_.size(); +} + +void PaintController::EndSubsequence(const DisplayItemClient& client, + size_t start) { + size_t end = new_display_item_list_.size(); + if (start == end) { + // Omit the empty subsequence. The forcing-new-chunk flag set by + // BeginSubsequence() still applies, but this not a big deal because empty + // subsequences are not common. Also we should not clear the flag because + // there might be unhandled flag that was set before this empty subsequence. + return; + } + + // Force new paint chunk which is required for subsequence caching. + new_paint_chunks_.ForceNewChunk(); + if (IsCheckingUnderInvalidation()) { SubsequenceMarkers* markers = GetSubsequenceMarkers(client); if (!markers) { @@ -189,6 +203,8 @@ } bool PaintController::LastDisplayItemIsNoopBegin() const { + DCHECK(!RuntimeEnabledFeatures::SlimmingPaintV2Enabled()); + if (new_display_item_list_.IsEmpty()) return false; @@ -198,10 +214,12 @@ bool PaintController::LastDisplayItemIsSubsequenceEnd() const { return !new_cached_subsequences_.IsEmpty() && - last_cached_subsequence_end_ == new_display_item_list_.size() - 1; + last_cached_subsequence_end_ == new_display_item_list_.size(); } void PaintController::RemoveLastDisplayItem() { + DCHECK(!RuntimeEnabledFeatures::SlimmingPaintV2Enabled()); + if (new_display_item_list_.IsEmpty()) return; @@ -227,9 +245,6 @@ } } new_display_item_list_.RemoveLast(); - - if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) - new_paint_chunks_.DecrementDisplayItemIndex(); } const DisplayItem* PaintController::LastDisplayItem(unsigned offset) { @@ -314,10 +329,8 @@ void PaintController::UpdateCurrentPaintChunkProperties( const PaintChunk::Id* id, - const PaintChunkProperties& new_properties, - NewChunkForceState force_new_chunk) { - new_paint_chunks_.UpdateCurrentPaintChunkProperties(id, new_properties, - force_new_chunk); + const PaintChunkProperties& new_properties) { + new_paint_chunks_.UpdateCurrentPaintChunkProperties(id, new_properties); } const PaintChunkProperties& PaintController::CurrentPaintChunkProperties() @@ -463,35 +476,33 @@ // under-invalidation checking. void PaintController::CopyCachedSubsequence(size_t begin_index, size_t end_index) { + DCHECK(!RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled()); + AutoReset<size_t> subsequence_begin_index( ¤t_cached_subsequence_begin_index_in_new_list_, new_display_item_list_.size()); DisplayItem* cached_item = ¤t_paint_artifact_.GetDisplayItemList()[begin_index]; - if (RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled()) { - DCHECK(!IsCheckingUnderInvalidation()); - under_invalidation_checking_begin_ = begin_index; - under_invalidation_message_prefix_ = - "(In cached subsequence starting with " + - cached_item->Client().DebugName() + ")"; - } - Vector<PaintChunk>::const_iterator cached_chunk; + PaintChunkProperties properties_before_subsequence; if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { cached_chunk = current_paint_artifact_.FindChunkByDisplayItemIndex(begin_index); DCHECK(cached_chunk != current_paint_artifact_.PaintChunks().end()); + properties_before_subsequence = + new_paint_chunks_.CurrentPaintChunkProperties(); + new_paint_chunks_.ForceNewChunk(); UpdateCurrentPaintChunkProperties( cached_chunk->is_cacheable ? &cached_chunk->id : nullptr, - cached_chunk->properties, kForceNewChunk); + cached_chunk->properties); } else { // Avoid uninitialized variable error on Windows. cached_chunk = current_paint_artifact_.PaintChunks().begin(); } - for (size_t current_index = begin_index; current_index <= end_index; + for (size_t current_index = begin_index; current_index < end_index; ++current_index) { cached_item = ¤t_paint_artifact_.GetDisplayItemList()[current_index]; DCHECK(cached_item->HasValidClient()); @@ -501,41 +512,45 @@ #if DCHECK_IS_ON() DCHECK(cached_item->Client().IsAlive()); #endif - ++num_cached_new_items_; - if (!RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled()) { - if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled() && - current_index == cached_chunk->end_index) { - ++cached_chunk; - DCHECK(cached_chunk != current_paint_artifact_.PaintChunks().end()); - UpdateCurrentPaintChunkProperties( - cached_chunk->is_cacheable ? &cached_chunk->id : nullptr, - cached_chunk->properties, kForceNewChunk); - } + + if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled() && + current_index == cached_chunk->end_index) { + ++cached_chunk; + DCHECK(cached_chunk != current_paint_artifact_.PaintChunks().end()); + new_paint_chunks_.ForceNewChunk(); + UpdateCurrentPaintChunkProperties( + cached_chunk->is_cacheable ? &cached_chunk->id : nullptr, + cached_chunk->properties); + } #if DCHECK_IS_ON() - // Visual rect change should not happen in a cached subsequence. - // However, because of different method of pixel snapping in different - // paths, there are false positives. Just log an error. - if (cached_item->VisualRect() != cached_item->Client().VisualRect()) { - LOG(ERROR) << "Visual rect changed in a cached subsequence: " - << cached_item->Client().DebugName() - << " old=" << cached_item->VisualRect().ToString() - << " new=" << cached_item->Client().VisualRect().ToString(); - } + // Visual rect change should not happen in a cached subsequence. + // However, because of different method of pixel snapping in different + // paths, there are false positives. Just log an error. + if (cached_item->VisualRect() != cached_item->Client().VisualRect()) { + LOG(ERROR) << "Visual rect changed in a cached subsequence: " + << cached_item->Client().DebugName() + << " old=" << cached_item->VisualRect().ToString() + << " new=" << cached_item->Client().VisualRect().ToString(); + } #endif - ProcessNewItem(MoveItemFromCurrentListToNewList(current_index)); - if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { - DCHECK((!new_paint_chunks_.LastChunk().is_cacheable && - !cached_chunk->is_cacheable) || - new_paint_chunks_.LastChunk().Matches(*cached_chunk)); - } + ProcessNewItem(MoveItemFromCurrentListToNewList(current_index)); + if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { + DCHECK((!new_paint_chunks_.LastChunk().is_cacheable && + !cached_chunk->is_cacheable) || + new_paint_chunks_.LastChunk().Matches(*cached_chunk)); } } if (RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled()) { - under_invalidation_checking_end_ = end_index + 1; + under_invalidation_checking_end_ = end_index; DCHECK(IsCheckingUnderInvalidation()); + } else if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { + // Restore properties and force new chunk for any trailing display items + // after the cached subsequence without new properties. + new_paint_chunks_.ForceNewChunk(); + UpdateCurrentPaintChunkProperties(nullptr, properties_before_subsequence); } } @@ -1052,34 +1067,6 @@ ++under_invalidation_checking_begin_; } -void PaintController::ShowDebugDataInternal(bool show_paint_records) const { - WTFLogAlways("current display item list: [%s]\n", - current_paint_artifact_.GetDisplayItemList() - .SubsequenceAsJSON( - 0, current_paint_artifact_.GetDisplayItemList().size(), - show_paint_records - ? DisplayItemList::JsonOptions::kShowPaintRecords - : DisplayItemList::JsonOptions::kDefault) - ->ToPrettyJSONString() - .Utf8() - .data()); - // debugName() and clientCacheIsValid() can only be called on a live - // client, so only output it for m_newDisplayItemList, in which we are - // sure the clients are all alive. - WTFLogAlways( - "new display item list: [%s]\n", - new_display_item_list_ - .SubsequenceAsJSON( - 0, new_display_item_list_.size(), - show_paint_records - ? (DisplayItemList::JsonOptions::kShowPaintRecords | - DisplayItemList::JsonOptions::kShowClientDebugName) - : DisplayItemList::JsonOptions::kShowClientDebugName) - ->ToPrettyJSONString() - .Utf8() - .data()); -} - void PaintController::SetFirstPainted() { frame_first_paints_.back().first_painted = true; }
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.h b/third_party/WebKit/Source/platform/graphics/paint/PaintController.h index 4b05f07..01fd6b3f 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.h +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.h
@@ -71,10 +71,8 @@ // Provide a new set of paint chunk properties to apply to recorded display // items, for Slimming Paint v2. - void UpdateCurrentPaintChunkProperties( - const PaintChunk::Id*, - const PaintChunkProperties&, - NewChunkForceState force_new_chunk = kDontForceNewChunk); + void UpdateCurrentPaintChunkProperties(const PaintChunk::Id*, + const PaintChunkProperties&); // Retrieve the current paint properties. const PaintChunkProperties& CurrentPaintChunkProperties() const; @@ -104,6 +102,8 @@ // item construction is disabled, no list mutations will be performed. template <typename DisplayItemClass, typename... Args> void EndItem(Args&&... args) { + DCHECK(!RuntimeEnabledFeatures::SlimmingPaintV2Enabled()); + if (DisplayItemConstructionIsDisabled()) return; if (LastDisplayItemIsNoopBegin()) @@ -122,9 +122,10 @@ // true. Otherwise returns false. bool UseCachedSubsequenceIfPossible(const DisplayItemClient&); - void AddCachedSubsequence(const DisplayItemClient&, - unsigned start, - unsigned end); + size_t BeginSubsequence(); + // The |start| parameter should be the return value of the corresponding + // BeginSubsequence(). + void EndSubsequence(const DisplayItemClient&, size_t start); // True if the last display item is a begin that doesn't draw content. void RemoveLastDisplayItem(); @@ -175,17 +176,17 @@ void SetTextPainted(); void SetImagePainted(); - // Returns displayItemList added using createAndAppend() since beginning or - // the last commitNewDisplayItems(). Use with care. + // Returns DisplayItemList added using CreateAndAppend() since beginning or + // the last CommitNewDisplayItems(). Use with care. DisplayItemList& NewDisplayItemList() { return new_display_item_list_; } void AppendDebugDrawingAfterCommit(const DisplayItemClient&, sk_sp<PaintRecord>, const FloatRect& record_bounds); - void ShowDebugData() const { ShowDebugDataInternal(false); } + void ShowDebugData() const; #ifndef NDEBUG - void ShowDebugDataWithRecords() const { ShowDebugDataInternal(true); } + void ShowDebugDataWithRecords() const; #endif #if DCHECK_IS_ON() @@ -250,10 +251,6 @@ void ProcessNewItem(DisplayItem&); DisplayItem& MoveItemFromCurrentListToNewList(size_t); - void ShowDebugDataInternal(bool show_paint_records) const; - String DisplayItemListAsDebugString(const DisplayItemList&, - bool show_paint_records) const; - // Maps clients to indices of display items or chunks of each client. using IndicesByClientMap = HashMap<const DisplayItemClient*, Vector<size_t>>; @@ -268,9 +265,9 @@ size_t FindOutOfOrderCachedItemForward(const DisplayItem::Id&); void CopyCachedSubsequence(size_t begin_index, size_t end_index); - // Resets the indices (e.g. m_nextItemToMatch) of - // m_currentPaintArtifact.getDisplayItemList() to their initial values. This - // should be called when the DisplayItemList in m_currentPaintArtifact is + // Resets the indices (e.g. next_item_to_match_) of + // current_paint_artifact_.GetDisplayItemList() to their initial values. This + // should be called when the DisplayItemList in current_paint_artifact_ is // newly created, or is changed causing the previous indices to be invalid. void ResetCurrentListIndices(); @@ -318,14 +315,16 @@ SubsequenceMarkers() : start(0), end(0) {} SubsequenceMarkers(size_t start_arg, size_t end_arg) : start(start_arg), end(end_arg) {} - // The start and end index within m_currentPaintArtifact of this - // subsequence. + // The start and end (not included) index within current_paint_artifact_ + // of this subsequence. size_t start; size_t end; }; SubsequenceMarkers* GetSubsequenceMarkers(const DisplayItemClient&); + void ShowDebugDataInternal(bool show_paint_records) const; + // The last complete paint artifact. // In SPv2, this includes paint chunks as well as display items. PaintArtifact current_paint_artifact_; @@ -334,8 +333,8 @@ DisplayItemList new_display_item_list_; PaintChunker new_paint_chunks_; - // Stores indices into m_newDisplayItemList for display items that have been - // moved from m_currentPaintArtifact.getDisplayItemList(), indexed by the + // Stores indices into new_display_item_list_ for display items that have been + // moved from current_paint_artifact_.GetDisplayItemList(), indexed by the // positions of the display items before the move. The values are undefined // for display items that are not moved. Vector<size_t> items_moved_into_new_list_; @@ -356,9 +355,9 @@ int num_cached_new_items_; // Stores indices to valid cacheable display items in - // m_currentPaintArtifact.displayItemList() that have not been matched by - // requests of cached display items (using useCachedDrawingIfPossible() and - // useCachedSubsequenceIfPossible()) during sequential matching. The indexed + // current_paint_artifact_.GetDisplayItemList() that have not been matched by + // requests of cached display items (using UseCachedDrawingIfPossible() and + // UseCachedSubsequenceIfPossible()) during sequential matching. The indexed // items will be matched by later out-of-order requests of cached display // items. This ensures that when out-of-order cached display items are // requested, we only traverse at most once over the current display list @@ -373,8 +372,8 @@ // requests. size_t next_item_to_index_; - // Similar to m_outOfOrderItemIndices but - // - the indices are chunk indices in m_currentPaintArtifacts.paintChunks(); + // Similar to out_of_order_item_indices_ but + // - the indices are chunk indices in current_paint_artifacts_.PaintChunks(); // - chunks are matched not only for requests of cached display items, but // also non-cached display items. IndicesByClientMap out_of_order_chunk_indices_; @@ -392,14 +391,14 @@ #endif #if DCHECK_IS_ON() - // This is used to check duplicated ids during createAndAppend(). + // This is used to check duplicated ids during CreateAndAppend(). IndicesByClientMap new_display_item_indices_by_client_; Usage usage_ = kForNormalUsage; #endif - // These are set in useCachedDrawingIfPossible() and - // useCachedSubsequenceIfPossible() when we could use cached drawing or + // These are set in UseCachedDrawingIfPossible() and + // UseCachedSubsequenceIfPossible() when we could use cached drawing or // subsequence and under-invalidation checking is on, indicating the begin and // end of the cached drawing or subsequence in the current list. The functions // return false to let the client do actual painting, and PaintController will @@ -421,12 +420,14 @@ std::unique_ptr<RasterInvalidationTrackingInfo> raster_invalidation_tracking_info_; - typedef HashMap<const DisplayItemClient*, SubsequenceMarkers> - CachedSubsequenceMap; + using CachedSubsequenceMap = + HashMap<const DisplayItemClient*, SubsequenceMarkers>; CachedSubsequenceMap current_cached_subsequences_; CachedSubsequenceMap new_cached_subsequences_; size_t last_cached_subsequence_end_; + class DisplayItemListAsJSON; + FRIEND_TEST_ALL_PREFIXES(PaintControllerTest, CachedSubsequenceSwapOrder); FRIEND_TEST_ALL_PREFIXES(PaintControllerTest, CachedNestedSubsequenceUpdate); };
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerDebugData.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerDebugData.cpp new file mode 100644 index 0000000..419994c --- /dev/null +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerDebugData.cpp
@@ -0,0 +1,199 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "platform/graphics/paint/PaintController.h" + +#include "platform/graphics/paint/DrawingDisplayItem.h" + +namespace blink { + +class PaintController::DisplayItemListAsJSON { + STACK_ALLOCATED(); + + public: + DisplayItemListAsJSON(const DisplayItemList&, + const CachedSubsequenceMap&, + const Vector<PaintChunk>&, + DisplayItemList::JsonFlags); + + String ToString() { + return SubsequenceAsJSONArrayRecursive(0, list_.size()) + ->ToPrettyJSONString(); + } + + private: + std::unique_ptr<JSONObject> SubsequenceAsJSONObjectRecursive(); + std::unique_ptr<JSONArray> SubsequenceAsJSONArrayRecursive(size_t, size_t); + void AppendSubsequenceAsJSON(size_t, size_t, JSONArray&); + String ClientName(const DisplayItemClient&) const; + + struct SubsequenceInfo { + SubsequenceInfo(const DisplayItemClient* client, size_t start, size_t end) + : client(client), start(start), end(end) {} + const DisplayItemClient* client; + size_t start; + size_t end; + }; + + const DisplayItemList& list_; + Vector<SubsequenceInfo> subsequences_; + Vector<SubsequenceInfo>::const_iterator current_subsequence_; + const Vector<PaintChunk>& chunks_; + Vector<PaintChunk>::const_iterator current_chunk_; + DisplayItemList::JsonFlags flags_; +}; + +PaintController::DisplayItemListAsJSON::DisplayItemListAsJSON( + const DisplayItemList& list, + const CachedSubsequenceMap& subsequence_map, + const Vector<PaintChunk>& chunks, + DisplayItemList::JsonFlags flags) + : list_(list), + chunks_(chunks), + current_chunk_(chunks.begin()), + flags_(flags) { + for (const auto& item : subsequence_map) { + subsequences_.push_back( + SubsequenceInfo(item.key, item.value.start, item.value.end)); + } + std::sort(subsequences_.begin(), subsequences_.end(), + [](const SubsequenceInfo& a, const SubsequenceInfo& b) { + return a.start == b.start ? a.end > b.end : a.start < b.start; + }); + + current_subsequence_ = subsequences_.begin(); +} + +std::unique_ptr<JSONObject> +PaintController::DisplayItemListAsJSON::SubsequenceAsJSONObjectRecursive() { + const auto& subsequence = *current_subsequence_; + ++current_subsequence_; + + auto json_object = JSONObject::Create(); + + json_object->SetString("subsequence", ClientName(*subsequence.client)); + json_object->SetArray( + RuntimeEnabledFeatures::SlimmingPaintV2Enabled() ? "chunks" + : "displayItems", + SubsequenceAsJSONArrayRecursive(subsequence.start, subsequence.end)); + + return json_object; +} + +std::unique_ptr<JSONArray> +PaintController::DisplayItemListAsJSON::SubsequenceAsJSONArrayRecursive( + size_t start_item, + size_t end_item) { + std::unique_ptr<JSONArray> array = JSONArray::Create(); + size_t item_index = start_item; + + while (current_subsequence_ != subsequences_.end() && + current_subsequence_->start < end_item) { + const auto& subsequence = *current_subsequence_; + DCHECK(subsequence.start >= item_index); + DCHECK(subsequence.end <= end_item); + + if (item_index < subsequence.start) + AppendSubsequenceAsJSON(item_index, subsequence.start, *array); + array->PushObject(SubsequenceAsJSONObjectRecursive()); + item_index = subsequence.end; + } + + if (item_index < end_item) + AppendSubsequenceAsJSON(item_index, end_item, *array); + + return array; +} + +void PaintController::DisplayItemListAsJSON::AppendSubsequenceAsJSON( + size_t start_item, + size_t end_item, + JSONArray& json_array) { + DCHECK(end_item > start_item); + + if (!RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { + list_.AppendSubsequenceAsJSON(start_item, end_item, flags_, json_array); + return; + } + + DCHECK(current_chunk_ != chunks_.end()); + DCHECK(current_chunk_->begin_index == start_item); + + while (current_chunk_ != chunks_.end() && + current_chunk_->end_index <= end_item) { + const auto& chunk = *current_chunk_; + auto json_object = JSONObject::Create(); + + String chunk_name = ClientName(chunk.id.client); + if (chunk.id.type != DisplayItem::kUninitializedType) { +#ifndef NDEBUG + chunk_name.append(" type: "); + chunk_name.append(DisplayItem::TypeAsDebugString(chunk.id.type)); +#else + chunk_name.append(String::Format(" type: %d", chunk.id.type)); +#endif + } + json_object->SetString("chunk", chunk_name); + + json_object->SetArray( + "displayItems", + list_.SubsequenceAsJSON(chunk.begin_index, chunk.end_index, flags_)); + + json_array.PushObject(std::move(json_object)); + ++current_chunk_; + } +} + +String PaintController::DisplayItemListAsJSON::ClientName( + const DisplayItemClient& client) const { + bool show_client_debug_name = flags_ & DisplayItemList::kShowClientDebugName; +#if DCHECK_IS_ON() + if (client.IsAlive()) + show_client_debug_name = true; +#endif + String result = String::Format("client: %p", &client); + if (show_client_debug_name) { + result.append(' '); + result.append(client.DebugName()); + } + return result; +} + +void PaintController::ShowDebugDataInternal(bool show_paint_records) const { + DisplayItemList::JsonFlags flags = + show_paint_records ? DisplayItemList::JsonOptions::kShowPaintRecords + : DisplayItemList::JsonOptions::kDefault; + + WTFLogAlways( + "current display item list: %s\n", + DisplayItemListAsJSON(current_paint_artifact_.GetDisplayItemList(), + current_cached_subsequences_, + current_paint_artifact_.PaintChunks(), flags) + .ToString() + .Utf8() + .data()); + // DebugName() and ClientCacheIsValid() can only be called on a live client, + // so only output it for new_display_item_list_, in which we are sure the + // clients are all alive. + WTFLogAlways( + "new display item list: %s\n", + DisplayItemListAsJSON(new_display_item_list_, new_cached_subsequences_, + new_paint_chunks_.PaintChunks(), + flags | DisplayItemList::kShowClientDebugName) + .ToString() + .Utf8() + .data()); +} + +void PaintController::ShowDebugData() const { + return ShowDebugDataInternal(false); +} + +#ifndef NDEBUG +void PaintController::ShowDebugDataWithRecords() const { + return ShowDebugDataInternal(true); +} +#endif + +} // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp index 1e1acd3..d2921ee4 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
@@ -1118,6 +1118,10 @@ DrawRect(context, container, kForegroundDrawingType, FloatRect(100, 100, 100, 100)); } + + DrawRect(context, root, kForegroundDrawingType, + FloatRect(100, 100, 100, 100)); + GetPaintController().CommitNewDisplayItems(); root_properties.backface_hidden = true; @@ -1127,15 +1131,19 @@ DrawRect(context, root, kBackgroundDrawingType, FloatRect(100, 100, 100, 100)); EXPECT_TRUE(GetPaintController().UseCachedSubsequenceIfPossible(container)); + DrawRect(context, root, kForegroundDrawingType, + FloatRect(100, 100, 100, 100)); GetPaintController().CommitNewDisplayItems(); // Even though the paint properties match, |container| should receive its // own PaintChunk because it is a cached subsequence. - EXPECT_EQ(2u, GetPaintController().GetPaintArtifact().PaintChunks().size()); + EXPECT_EQ(3u, GetPaintController().GetPaintArtifact().PaintChunks().size()); EXPECT_EQ(root, GetPaintController().GetPaintArtifact().PaintChunks()[0].id.client); EXPECT_EQ(container, GetPaintController().GetPaintArtifact().PaintChunks()[1].id.client); + EXPECT_EQ(root, + GetPaintController().GetPaintArtifact().PaintChunks()[2].id.client); } TEST_P(PaintControllerTest, CachedSubsequenceSwapOrder) { @@ -1203,12 +1211,12 @@ GetPaintController().GetSubsequenceMarkers(container1); CHECK(markers); EXPECT_EQ(0u, markers->start); - EXPECT_EQ(3u, markers->end); + EXPECT_EQ(4u, markers->end); markers = GetPaintController().GetSubsequenceMarkers(container2); CHECK(markers); EXPECT_EQ(4u, markers->start); - EXPECT_EQ(7u, markers->end); + EXPECT_EQ(8u, markers->end); if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { EXPECT_EQ(2u, GetPaintController().PaintChunks().size()); @@ -1297,12 +1305,12 @@ markers = GetPaintController().GetSubsequenceMarkers(container2); CHECK(markers); EXPECT_EQ(0u, markers->start); - EXPECT_EQ(3u, markers->end); + EXPECT_EQ(4u, markers->end); markers = GetPaintController().GetSubsequenceMarkers(container1); CHECK(markers); EXPECT_EQ(4u, markers->start); - EXPECT_EQ(7u, markers->end); + EXPECT_EQ(8u, markers->end); if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { EXPECT_EQ(2u, GetPaintController().PaintChunks().size()); @@ -1557,22 +1565,22 @@ GetPaintController().GetSubsequenceMarkers(container1); CHECK(markers); EXPECT_EQ(0u, markers->start); - EXPECT_EQ(3u, markers->end); + EXPECT_EQ(4u, markers->end); markers = GetPaintController().GetSubsequenceMarkers(content1); CHECK(markers); EXPECT_EQ(1u, markers->start); - EXPECT_EQ(2u, markers->end); + EXPECT_EQ(3u, markers->end); markers = GetPaintController().GetSubsequenceMarkers(container2); CHECK(markers); EXPECT_EQ(4u, markers->start); - EXPECT_EQ(5u, markers->end); + EXPECT_EQ(6u, markers->end); markers = GetPaintController().GetSubsequenceMarkers(content2); CHECK(markers); EXPECT_EQ(5u, markers->start); - EXPECT_EQ(5u, markers->end); + EXPECT_EQ(6u, markers->end); if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { EXPECT_EQ(5u, GetPaintController().PaintChunks().size()); @@ -1681,17 +1689,17 @@ markers = GetPaintController().GetSubsequenceMarkers(content2); CHECK(markers); EXPECT_EQ(0u, markers->start); - EXPECT_EQ(0u, markers->end); + EXPECT_EQ(1u, markers->end); markers = GetPaintController().GetSubsequenceMarkers(container1); CHECK(markers); EXPECT_EQ(1u, markers->start); - EXPECT_EQ(3u, markers->end); + EXPECT_EQ(4u, markers->end); markers = GetPaintController().GetSubsequenceMarkers(content1); CHECK(markers); EXPECT_EQ(1u, markers->start); - EXPECT_EQ(2u, markers->end); + EXPECT_EQ(3u, markers->end); if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { EXPECT_EQ(3u, GetPaintController().PaintChunks().size());
diff --git a/third_party/WebKit/Source/platform/graphics/paint/ScopedPaintChunkProperties.h b/third_party/WebKit/Source/platform/graphics/paint/ScopedPaintChunkProperties.h index bc270d6..ca2d823 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/ScopedPaintChunkProperties.h +++ b/third_party/WebKit/Source/platform/graphics/paint/ScopedPaintChunkProperties.h
@@ -19,31 +19,25 @@ WTF_MAKE_NONCOPYABLE(ScopedPaintChunkProperties); public: - ScopedPaintChunkProperties( - PaintController& paint_controller, - const DisplayItemClient& client, - DisplayItem::Type type, - const PaintChunkProperties& properties, - NewChunkForceState force_new_chunk = kDontForceNewChunk) + ScopedPaintChunkProperties(PaintController& paint_controller, + const DisplayItemClient& client, + DisplayItem::Type type, + const PaintChunkProperties& properties) : paint_controller_(paint_controller), previous_properties_(paint_controller.CurrentPaintChunkProperties()) { PaintChunk::Id id(client, type); - paint_controller_.UpdateCurrentPaintChunkProperties(&id, properties, - force_new_chunk); + paint_controller_.UpdateCurrentPaintChunkProperties(&id, properties); } // Omits the type parameter, in case that the client creates only one // PaintChunkProperties node during each painting. - ScopedPaintChunkProperties( - PaintController& paint_controller, - const DisplayItemClient& client, - const PaintChunkProperties& properties, - NewChunkForceState force_new_chunk = kDontForceNewChunk) + ScopedPaintChunkProperties(PaintController& paint_controller, + const DisplayItemClient& client, + const PaintChunkProperties& properties) : ScopedPaintChunkProperties(paint_controller, client, DisplayItem::kUninitializedType, - properties, - force_new_chunk) {} + properties) {} ~ScopedPaintChunkProperties() { // We should not return to the previous id, because that may cause a new
diff --git a/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h b/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h index 99c49c2a..6b762d6 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h +++ b/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h
@@ -76,12 +76,11 @@ return true; } - // The area that contains the scrolled content. For typical scrolling cases, - // this is the size of the clipped overflow. + // Size of the container area that the contents scrolls in, not including + // non-overlay scrollbars. Overlay scrollbars do not affect these bounds. const IntSize& ContainerBounds() const { return container_bounds_; } - // The bounds of the content that is scrolled within - // |container_bounds|. + // Size of the content that is scrolled within the container bounds. const IntSize& Bounds() const { return bounds_; } bool UserScrollableHorizontal() const { return user_scrollable_horizontal_; }
diff --git a/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp b/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp deleted file mode 100644 index 3c2386c..0000000 --- a/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp +++ /dev/null
@@ -1,37 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "platform/graphics/paint/SubsequenceRecorder.h" - -#include "platform/RuntimeEnabledFeatures.h" -#include "platform/graphics/GraphicsContext.h" -#include "platform/graphics/paint/PaintController.h" - -namespace blink { - -SubsequenceRecorder::SubsequenceRecorder(GraphicsContext& context, - const DisplayItemClient& client) - : paint_controller_(context.GetPaintController()), - client_(client), - begin_subsequence_index_(0) { - if (paint_controller_.DisplayItemConstructionIsDisabled()) - return; - - begin_subsequence_index_ = paint_controller_.NewDisplayItemList().size(); -} - -SubsequenceRecorder::~SubsequenceRecorder() { - if (paint_controller_.DisplayItemConstructionIsDisabled()) - return; - - // Skip empty subsequences. - if (paint_controller_.NewDisplayItemList().size() == begin_subsequence_index_) - return; - - paint_controller_.AddCachedSubsequence( - client_, begin_subsequence_index_, - paint_controller_.NewDisplayItemList().size() - 1); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.h b/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.h index 0a47630a..cdef0f5 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.h +++ b/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.h
@@ -26,7 +26,7 @@ // responsible for checking that none of the DisplayItemClients that contribute // to the subsequence have been invalidated. // -class PLATFORM_EXPORT SubsequenceRecorder final { +class SubsequenceRecorder final { DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); WTF_MAKE_NONCOPYABLE(SubsequenceRecorder); @@ -36,13 +36,23 @@ return context.GetPaintController().UseCachedSubsequenceIfPossible(client); } - SubsequenceRecorder(GraphicsContext&, const DisplayItemClient&); - ~SubsequenceRecorder(); + SubsequenceRecorder(GraphicsContext& context, const DisplayItemClient& client) + : paint_controller_(context.GetPaintController()), + client_(client), + start_(0) { + if (!paint_controller_.DisplayItemConstructionIsDisabled()) + start_ = paint_controller_.BeginSubsequence(); + } + + ~SubsequenceRecorder() { + if (!paint_controller_.DisplayItemConstructionIsDisabled()) + paint_controller_.EndSubsequence(client_, start_); + } private: PaintController& paint_controller_; const DisplayItemClient& client_; - size_t begin_subsequence_index_; + size_t start_; }; } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/test/FakeWebGraphicsContext3DProvider.h b/third_party/WebKit/Source/platform/graphics/test/FakeWebGraphicsContext3DProvider.h index a4e0050..da1e3d60 100644 --- a/third_party/WebKit/Source/platform/graphics/test/FakeWebGraphicsContext3DProvider.h +++ b/third_party/WebKit/Source/platform/graphics/test/FakeWebGraphicsContext3DProvider.h
@@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef FakeWebGraphicsContext3DProvider_h +#define FakeWebGraphicsContext3DProvider_h + #include "gpu/command_buffer/client/gles2_interface.h" #include "gpu/command_buffer/common/capabilities.h" #include "public/platform/WebGraphicsContext3DProvider.h" @@ -40,3 +43,5 @@ }; } // namespace blink + +#endif // FakeWebGraphicsContext3DProvider_h
diff --git a/third_party/WebKit/Source/platform/heap/GarbageCollected.h b/third_party/WebKit/Source/platform/heap/GarbageCollected.h index bcd2f23..79827e8e 100644 --- a/third_party/WebKit/Source/platform/heap/GarbageCollected.h +++ b/third_party/WebKit/Source/platform/heap/GarbageCollected.h
@@ -19,7 +19,7 @@ // field when checking for proper usage. When using GC_PLUGIN_IGNORE // a bug-number should be provided as an argument where the bug describes // what needs to happen to remove the GC_PLUGIN_IGNORE again. -#if COMPILER(CLANG) +#if defined(__clang__) #define GC_PLUGIN_IGNORE(bug) \ __attribute__((annotate("blink_gc_plugin_ignore"))) #else
diff --git a/third_party/WebKit/Source/platform/heap/Heap.h b/third_party/WebKit/Source/platform/heap/Heap.h index 0a2f9fa..cd0322f 100644 --- a/third_party/WebKit/Source/platform/heap/Heap.h +++ b/third_party/WebKit/Source/platform/heap/Heap.h
@@ -32,6 +32,7 @@ #define Heap_h #include <memory> +#include "build/build_config.h" #include "platform/PlatformExport.h" #include "platform/heap/GCInfo.h" #include "platform/heap/HeapPage.h" @@ -488,7 +489,7 @@ // For now direct allocation of arrays on the heap is not allowed. void* operator new[](size_t size); -#if OS(WIN) && COMPILER(MSVC) +#if defined(OS_WIN) && defined(COMPILER_MSVC) // Due to some quirkiness in the MSVC compiler we have to provide // the delete[] operator in the GarbageCollected subclasses as it // is called when a class is exported in a DLL.
diff --git a/third_party/WebKit/Source/platform/heap/HeapAllocator.h b/third_party/WebKit/Source/platform/heap/HeapAllocator.h index 7acd10e8..adf87f5b 100644 --- a/third_party/WebKit/Source/platform/heap/HeapAllocator.h +++ b/third_party/WebKit/Source/platform/heap/HeapAllocator.h
@@ -5,6 +5,7 @@ #ifndef HeapAllocator_h #define HeapAllocator_h +#include "build/build_config.h" #include "platform/heap/Heap.h" #include "platform/heap/Persistent.h" #include "platform/heap/TraceTraits.h" @@ -129,7 +130,7 @@ size, IsEagerlyFinalizedType<Metadata>::value)); } -#if OS(WIN) && COMPILER(MSVC) +#if defined(OS_WIN) && defined(COMPILER_MSVC) // MSVC eagerly instantiates the unused 'operator delete', // provide a version that asserts and fails at run-time if // used.
diff --git a/third_party/WebKit/Source/platform/heap/HeapPage.cpp b/third_party/WebKit/Source/platform/heap/HeapPage.cpp index d632988..a9a73038 100644 --- a/third_party/WebKit/Source/platform/heap/HeapPage.cpp +++ b/third_party/WebKit/Source/platform/heap/HeapPage.cpp
@@ -88,7 +88,7 @@ namespace blink { -#if DCHECK_IS_ON() && CPU(64BIT) +#if DCHECK_IS_ON() && defined(ARCH_CPU_64_BITS) NO_SANITIZE_ADDRESS void HeapObjectHeader::ZapMagic() { CheckHeader();
diff --git a/third_party/WebKit/Source/platform/heap/HeapPage.h b/third_party/WebKit/Source/platform/heap/HeapPage.h index 21158986..8041ef2 100644 --- a/third_party/WebKit/Source/platform/heap/HeapPage.h +++ b/third_party/WebKit/Source/platform/heap/HeapPage.h
@@ -33,6 +33,7 @@ #include <stdint.h> #include "base/trace_event/memory_allocator_dump.h" +#include "build/build_config.h" #include "platform/PlatformExport.h" #include "platform/heap/BlinkGC.h" #include "platform/heap/GCInfo.h" @@ -181,7 +182,7 @@ static_assert( sizeof(HeapObjectHeader) <= kAllocationGranularity, "size of HeapObjectHeader must be smaller than allocationGranularity"); -#if CPU(64BIT) +#if defined(ARCH_CPU_64_BITS) static_assert(sizeof(HeapObjectHeader) == 8, "sizeof(HeapObjectHeader) must be 8 bytes"); magic_ = GetMagic(); @@ -249,7 +250,7 @@ static const uint32_t kZappedMagic = 0xDEAD4321; protected: -#if DCHECK_IS_ON() && CPU(64BIT) +#if DCHECK_IS_ON() && defined(ARCH_CPU_64_BITS) // Zap |m_magic| with a new magic number that means there was once an object // allocated here, but it was freed because nobody marked it during GC. void ZapMagic(); @@ -258,7 +259,7 @@ private: void CheckHeader() const; -#if CPU(64BIT) +#if defined(ARCH_CPU_64_BITS) // Returns a random value. // // The implementation gets its randomness from the locations of 2 independent @@ -269,7 +270,7 @@ // arbitrary infoleak bug (used twice). uint32_t GetMagic() const; uint32_t magic_; -#endif // CPU(64BIT) +#endif // defined(ARCH_CPU_64_BITS) uint32_t encoded_; }; @@ -279,7 +280,7 @@ NO_SANITIZE_ADDRESS explicit FreeListEntry(size_t size) : HeapObjectHeader(size, kGcInfoIndexForFreeListHeader), next_(nullptr) { -#if DCHECK_IS_ON() && CPU(64BIT) +#if DCHECK_IS_ON() && defined(ARCH_CPU_64_BITS) DCHECK_GE(size, sizeof(HeapObjectHeader)); ZapMagic(); #endif @@ -867,7 +868,7 @@ } NO_SANITIZE_ADDRESS inline bool HeapObjectHeader::IsValid() const { -#if CPU(64BIT) +#if defined(ARCH_CPU_64_BITS) return GetMagic() == magic_; #else return true; @@ -875,7 +876,7 @@ } NO_SANITIZE_ADDRESS inline void HeapObjectHeader::CheckHeader() const { -#if CPU(64BIT) +#if defined(ARCH_CPU_64_BITS) DCHECK(IsValid()); #endif } @@ -912,9 +913,9 @@ (void)FromPayload(payload); } -#if CPU(64BIT) +#if defined(ARCH_CPU_64_BITS) ALWAYS_INLINE uint32_t RotateLeft16(uint32_t x) { -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) return _lrotr(x, 16); #else // http://blog.regehr.org/archives/1063 @@ -925,7 +926,7 @@ inline uint32_t HeapObjectHeader::GetMagic() const { // Ignore C4319: It is OK to 0-extend into the high-order bits of the uintptr_t // on 64-bit, in this case. -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) #pragma warning(push) #pragma warning(disable : 4319) #endif @@ -943,12 +944,12 @@ #error OS not supported #endif -#if CPU(64BIT) +#if defined(ARCH_CPU_64_BITS) static_assert(sizeof(uintptr_t) == sizeof(uint64_t), "uintptr_t is not uint64_t"); const uint32_t random = static_cast<uint32_t>( (random1 & 0x0FFFFULL) | ((random2 >> 32) & 0x0FFFF0000ULL)); -#elif CPU(32BIT) +#elif defined(ARCH_CPU_32_BITS) // Although we don't use heap metadata canaries on 32-bit due to memory // pressure, keep this code around just in case we do, someday. static_assert(sizeof(uintptr_t) == sizeof(uint32_t), @@ -958,13 +959,13 @@ #error architecture not supported #endif -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) #pragma warning(pop) #endif return random; } -#endif // CPU(64BIT) +#endif // defined(ARCH_CPU_64_BITS) NO_SANITIZE_ADDRESS inline bool HeapObjectHeader::IsWrapperHeaderMarked() const {
diff --git a/third_party/WebKit/Source/platform/heap/StackFrameDepth.h b/third_party/WebKit/Source/platform/heap/StackFrameDepth.h index b63ca09..4e0d5678 100644 --- a/third_party/WebKit/Source/platform/heap/StackFrameDepth.h +++ b/third_party/WebKit/Source/platform/heap/StackFrameDepth.h
@@ -7,6 +7,7 @@ #include <stdint.h> #include <cstddef> +#include "build/build_config.h" #include "platform/PlatformExport.h" #include "platform/wtf/Allocator.h" #include "platform/wtf/Assertions.h" @@ -46,23 +47,23 @@ #endif } -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) // Ignore C4172: returning address of local variable or temporary: dummy. This // warning suppression has to go outside of the function to take effect. #pragma warning(push) #pragma warning(disable : 4172) #endif static uintptr_t CurrentStackFrame(const char* dummy = nullptr) { -#if COMPILER(GCC) +#if defined(COMPILER_GCC) return reinterpret_cast<uintptr_t>(__builtin_frame_address(0)); -#elif COMPILER(MSVC) +#elif defined(COMPILER_MSVC) return reinterpret_cast<uintptr_t>(&dummy) - sizeof(void*); #else #error "Stack frame pointer estimation not supported on this platform." return 0; #endif } -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) #pragma warning(pop) #endif
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoderTestHelpers.h b/third_party/WebKit/Source/platform/image-decoders/ImageDecoderTestHelpers.h index 6530b95..4a6a262 100644 --- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoderTestHelpers.h +++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoderTestHelpers.h
@@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef ImageDecoderTestHelpers_h +#define ImageDecoderTestHelpers_h + #include <memory> #include "platform/image-decoders/ImageDecoder.h" #include "platform/wtf/Vector.h" @@ -109,3 +112,5 @@ void TestAlphaBlending(DecoderCreatorWithAlpha, const char*); } // namespace blink + +#endif // ImageDecoderTestHelpers_h
diff --git a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp index 52d8e10..a2268e1 100644 --- a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp +++ b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -38,6 +38,7 @@ #include "platform/image-decoders/jpeg/JPEGImageDecoder.h" #include <memory> +#include "build/build_config.h" #include "platform/instrumentation/PlatformInstrumentation.h" #include "platform/wtf/PtrUtil.h" @@ -48,7 +49,7 @@ #include <setjmp.h> } -#if CPU(BIG_ENDIAN) +#if defined(ARCH_CPU_BIG_ENDIAN) #error Blink assumes a little-endian target. #endif
diff --git a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp index 2e1afd63..06aee19 100644 --- a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp +++ b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -28,9 +28,10 @@ #include "platform/image-decoders/webp/WEBPImageDecoder.h" +#include "build/build_config.h" #include "third_party/skia/include/core/SkData.h" -#if CPU(BIG_ENDIAN) +#if defined(ARCH_CPU_BIG_ENDIAN) #error Blink assumes a little-endian target. #endif
diff --git a/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp b/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp index 1d93cb8..0fa9816 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp
@@ -169,7 +169,7 @@ kNotFound) { return kMultipleAllowOriginValues; } - KURL header_origin(KURL(), allow_origin_header_value); + KURL header_origin(NullURL(), allow_origin_header_value); if (!header_origin.IsValid()) return kInvalidAllowOriginValue;
diff --git a/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheTest.cpp index 60ab2c8..9da1652 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheTest.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheTest.cpp
@@ -360,7 +360,7 @@ EXPECT_EQ(resource1, GetMemoryCache()->ResourceForURL( url, GetMemoryCache()->DefaultCacheIdentifier())); EXPECT_EQ(resource2, GetMemoryCache()->ResourceForURL(url, "foo")); - EXPECT_EQ(0, GetMemoryCache()->ResourceForURL(KURL())); + EXPECT_EQ(0, GetMemoryCache()->ResourceForURL(NullURL())); FakeResource* resource3 = FakeResource::Create("http://test/resource", Resource::kRaw);
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp index 9381596..c825a15e 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
@@ -592,29 +592,22 @@ if (params.Options().cors_handling_by_resource_fetcher == kEnableCORSHandlingByResourceFetcher) { - if (resource_request.GetFetchRequestMode() == - WebURLRequest::kFetchRequestModeCORS) { - bool allow_stored_credentials = false; - switch (resource_request.GetFetchCredentialsMode()) { - case WebURLRequest::kFetchCredentialsModeOmit: - break; - case WebURLRequest::kFetchCredentialsModeSameOrigin: - allow_stored_credentials = - !params.Options().cors_flag || - (origin && - origin->HasSuboriginAndShouldAllowCredentialsFor(params.Url())); - break; - case WebURLRequest::kFetchCredentialsModeInclude: - case WebURLRequest::kFetchCredentialsModePassword: - allow_stored_credentials = true; - break; - } - resource_request.SetAllowStoredCredentials(allow_stored_credentials); - } else { - resource_request.SetAllowStoredCredentials( - resource_request.GetFetchCredentialsMode() != - WebURLRequest::kFetchCredentialsModeOmit); + bool allow_stored_credentials = false; + switch (resource_request.GetFetchCredentialsMode()) { + case WebURLRequest::kFetchCredentialsModeOmit: + break; + case WebURLRequest::kFetchCredentialsModeSameOrigin: + allow_stored_credentials = + !params.Options().cors_flag || + (origin && + origin->HasSuboriginAndShouldAllowCredentialsFor(params.Url())); + break; + case WebURLRequest::kFetchCredentialsModeInclude: + case WebURLRequest::kFetchCredentialsModePassword: + allow_stored_credentials = true; + break; } + resource_request.SetAllowStoredCredentials(allow_stored_credentials); } return kContinue;
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp index 826b860..62af3c5 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp
@@ -40,7 +40,7 @@ double ResourceRequest::default_timeout_interval_ = INT_MAX; -ResourceRequest::ResourceRequest() : ResourceRequest(KURL()) {} +ResourceRequest::ResourceRequest() : ResourceRequest(NullURL()) {} ResourceRequest::ResourceRequest(const String& url_string) : ResourceRequest(KURL(kParsedURLString, url_string)) {}
diff --git a/third_party/WebKit/Source/platform/loader/fetch/TextResourceDecoderOptions.cpp b/third_party/WebKit/Source/platform/loader/fetch/TextResourceDecoderOptions.cpp index 8e0de55f..5b1cb674 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/TextResourceDecoderOptions.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/TextResourceDecoderOptions.cpp
@@ -19,7 +19,7 @@ TextResourceDecoderOptions TextResourceDecoderOptions::CreateAlwaysUseUTF8ForText() { return TextResourceDecoderOptions(kAlwaysUseUTF8ForText, kPlainTextContent, - UTF8Encoding(), nullptr, KURL()); + UTF8Encoding(), nullptr, NullURL()); } TextResourceDecoderOptions TextResourceDecoderOptions::CreateWithAutoDetection(
diff --git a/third_party/WebKit/Source/platform/mac/BlockExceptions.h b/third_party/WebKit/Source/platform/mac/BlockExceptions.h index 5d91253f..3448926 100644 --- a/third_party/WebKit/Source/platform/mac/BlockExceptions.h +++ b/third_party/WebKit/Source/platform/mac/BlockExceptions.h
@@ -23,6 +23,9 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef BlockExceptions_h +#define BlockExceptions_h + #import <Foundation/NSException.h> #import "platform/PlatformExport.h" #import "platform/wtf/Assertions.h" @@ -35,3 +38,5 @@ @catch (NSException * localException) { \ ReportBlockedObjCException(localException); \ } + +#endif // BlockExceptions_h
diff --git a/third_party/WebKit/Source/platform/mac/LocalCurrentGraphicsContext.h b/third_party/WebKit/Source/platform/mac/LocalCurrentGraphicsContext.h index 16db276..32ed0ac3 100644 --- a/third_party/WebKit/Source/platform/mac/LocalCurrentGraphicsContext.h +++ b/third_party/WebKit/Source/platform/mac/LocalCurrentGraphicsContext.h
@@ -17,6 +17,9 @@ * Boston, MA 02110-1301, USA. */ +#ifndef LocalCurrentGraphicsContext_h +#define LocalCurrentGraphicsContext_h + #include "platform/PlatformExport.h" #include "platform/geometry/IntRect.h" #include "platform/graphics/paint/PaintCanvas.h" @@ -50,3 +53,5 @@ GraphicsContextCanvas graphics_context_canvas_; }; } + +#endif // LocalCurrentGraphicsContext_h
diff --git a/third_party/WebKit/Source/platform/mac/WebCoreNSCellExtras.h b/third_party/WebKit/Source/platform/mac/WebCoreNSCellExtras.h index 1bf9660..29fd58a1 100644 --- a/third_party/WebKit/Source/platform/mac/WebCoreNSCellExtras.h +++ b/third_party/WebKit/Source/platform/mac/WebCoreNSCellExtras.h
@@ -23,8 +23,13 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef WebCoreNSCellExtras_h +#define WebCoreNSCellExtras_h + #import <AppKit/AppKit.h> @interface NSCell (BlinkFocusRingDrawing) - (void)cr_drawFocusRingWithFrame:(NSRect)cellFrame inView:(NSView*)controlView; @end + +#endif // WebCoreNSCellExtras_h
diff --git a/third_party/WebKit/Source/platform/mhtml/MHTMLParser.cpp b/third_party/WebKit/Source/platform/mhtml/MHTMLParser.cpp index f1e3d25..9ed6ec9 100644 --- a/third_party/WebKit/Source/platform/mhtml/MHTMLParser.cpp +++ b/third_party/WebKit/Source/platform/mhtml/MHTMLParser.cpp
@@ -361,7 +361,7 @@ // if it is. The specs mentions 5 ways to resolve a URL: // http://tools.ietf.org/html/rfc2557#section-5 // IE and Firefox (UNMht) seem to generate only absolute URLs. - KURL location = KURL(KURL(), mime_header.ContentLocation()); + KURL location = KURL(NullURL(), mime_header.ContentLocation()); return ArchiveResource::Create(content_buffer, location, mime_header.ContentID(), AtomicString(mime_header.ContentType()), @@ -387,7 +387,7 @@ StringBuilder uri_builder; uri_builder.Append("cid:"); uri_builder.Append(content_id, 1, content_id.length() - 2); - return KURL(KURL(), uri_builder.ToString()); + return KURL(NullURL(), uri_builder.ToString()); } } // namespace blink
diff --git a/third_party/WebKit/Source/platform/mojo/KURLSecurityOriginTest.cpp b/third_party/WebKit/Source/platform/mojo/KURLSecurityOriginTest.cpp index 139fb7d..0530ea8 100644 --- a/third_party/WebKit/Source/platform/mojo/KURLSecurityOriginTest.cpp +++ b/third_party/WebKit/Source/platform/mojo/KURLSecurityOriginTest.cpp
@@ -45,7 +45,7 @@ }; for (const char* test_case : serialize_cases) { - KURL input(KURL(), test_case); + KURL input(NullURL(), test_case); KURL output; EXPECT_TRUE(proxy->BounceUrl(input, &output)); @@ -67,7 +67,7 @@ { const std::string url = std::string("http://example.org/").append(url::kMaxURLChars + 1, 'a'); - KURL input(KURL(), url.c_str()); + KURL input(NullURL(), url.c_str()); KURL output; EXPECT_TRUE(proxy->BounceUrl(input, &output)); EXPECT_TRUE(output.IsEmpty());
diff --git a/third_party/WebKit/Source/platform/network/EncodedFormDataTest.cpp b/third_party/WebKit/Source/platform/network/EncodedFormDataTest.cpp index ef49f6cd..4bb72d69 100644 --- a/third_party/WebKit/Source/platform/network/EncodedFormDataTest.cpp +++ b/third_party/WebKit/Source/platform/network/EncodedFormDataTest.cpp
@@ -38,7 +38,7 @@ original->AppendData("Foo", 3); original->AppendFileRange("example.txt", 12345, 56789, 9999.0); original->AppendBlob("originalUUID", nullptr); - original->AppendFileSystemURLRange(KURL(KURL(), "ws://localhost/"), 23456, + original->AppendFileSystemURLRange(KURL(NullURL(), "ws://localhost/"), 23456, 34567, 1111.0); Vector<char> boundary_vector; @@ -70,7 +70,7 @@ EXPECT_EQ(String("originalUUID"), copy_elements[2].blob_uuid_); EXPECT_EQ(FormDataElement::kEncodedFileSystemURL, copy_elements[3].type_); - EXPECT_EQ(KURL(KURL(), String("ws://localhost/")), + EXPECT_EQ(KURL(NullURL(), String("ws://localhost/")), copy_elements[3].file_system_url_); EXPECT_EQ(23456ll, copy_elements[3].file_start_); EXPECT_EQ(34567ll, copy_elements[3].file_length_);
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc index 693971e2..9f462b75 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
@@ -226,12 +226,28 @@ task_duration_reporter(TASK_DURATION_METRIC_NAME), foreground_task_duration_reporter(TASK_DURATION_METRIC_NAME ".Foreground"), + foreground_first_minute_task_duration_reporter(TASK_DURATION_METRIC_NAME + ".Foreground.FirstMinute"), + foreground_second_minute_task_duration_reporter( + TASK_DURATION_METRIC_NAME ".Foreground.SecondMinute"), + foreground_third_minute_task_duration_reporter(TASK_DURATION_METRIC_NAME + ".Foreground.ThirdMinute"), + foreground_after_third_minute_task_duration_reporter( + TASK_DURATION_METRIC_NAME ".Foreground.AfterThirdMinute"), background_task_duration_reporter(TASK_DURATION_METRIC_NAME ".Background"), background_first_minute_task_duration_reporter(TASK_DURATION_METRIC_NAME ".Background.FirstMinute"), - background_after_first_minute_task_duration_reporter( - TASK_DURATION_METRIC_NAME ".Background.AfterFirstMinute"), + background_second_minute_task_duration_reporter( + TASK_DURATION_METRIC_NAME ".Background.SecondMinute"), + background_third_minute_task_duration_reporter(TASK_DURATION_METRIC_NAME + ".Background.ThirdMinute"), + background_fourth_minute_task_duration_reporter( + TASK_DURATION_METRIC_NAME ".Background.FourthMinute"), + background_fifth_minute_task_duration_reporter(TASK_DURATION_METRIC_NAME + ".Background.FifthMinute"), + background_after_fifth_minute_task_duration_reporter( + TASK_DURATION_METRIC_NAME ".Background.AfterFifthMinute"), hidden_task_duration_reporter(TASK_DURATION_METRIC_NAME ".Hidden"), visible_task_duration_reporter(TASK_DURATION_METRIC_NAME ".Visible"), hidden_music_task_duration_reporter(TASK_DURATION_METRIC_NAME @@ -1985,29 +2001,90 @@ GetMainThreadOnly().background_task_duration_reporter.RecordTask(queue_type, duration); - // One minute is long enough for the majority of pages to complete their - // loading during this period. - base::TimeTicks one_minute_after_backgrounding = - GetMainThreadOnly().background_status_changed_at + - base::TimeDelta::FromMinutes(1); + // Collect detailed breakdown for first five minutes given that we suspend + // timers on mobile after five minutes. + base::TimeTicks backgrounded_at = + GetMainThreadOnly().background_status_changed_at; GetMainThreadOnly() .background_first_minute_task_duration_reporter.RecordTask( queue_type, DurationOfIntervalOverlap( - start_time, end_time, - GetMainThreadOnly().background_status_changed_at, - one_minute_after_backgrounding)); + start_time, end_time, backgrounded_at, + backgrounded_at + base::TimeDelta::FromMinutes(1))); GetMainThreadOnly() - .background_after_first_minute_task_duration_reporter.RecordTask( + .background_second_minute_task_duration_reporter.RecordTask( + queue_type, DurationOfIntervalOverlap( + start_time, end_time, + backgrounded_at + base::TimeDelta::FromMinutes(1), + backgrounded_at + base::TimeDelta::FromMinutes(2))); + + GetMainThreadOnly() + .background_third_minute_task_duration_reporter.RecordTask( + queue_type, DurationOfIntervalOverlap( + start_time, end_time, + backgrounded_at + base::TimeDelta::FromMinutes(2), + backgrounded_at + base::TimeDelta::FromMinutes(3))); + + GetMainThreadOnly() + .background_fourth_minute_task_duration_reporter.RecordTask( + queue_type, DurationOfIntervalOverlap( + start_time, end_time, + backgrounded_at + base::TimeDelta::FromMinutes(3), + backgrounded_at + base::TimeDelta::FromMinutes(4))); + + GetMainThreadOnly() + .background_fifth_minute_task_duration_reporter.RecordTask( + queue_type, DurationOfIntervalOverlap( + start_time, end_time, + backgrounded_at + base::TimeDelta::FromMinutes(4), + backgrounded_at + base::TimeDelta::FromMinutes(5))); + + GetMainThreadOnly() + .background_after_fifth_minute_task_duration_reporter.RecordTask( queue_type, DurationOfIntervalOverlap( - start_time, end_time, one_minute_after_backgrounding, - std::max(one_minute_after_backgrounding, end_time))); - + start_time, end_time, + backgrounded_at + base::TimeDelta::FromMinutes(5), + std::max(backgrounded_at + base::TimeDelta::FromMinutes(5), + end_time))); } else { GetMainThreadOnly().foreground_task_duration_reporter.RecordTask(queue_type, duration); + + // For foreground tabs we do not expect such a notable difference as it is + // the case with background tabs, so we limit breakdown to three minutes. + base::TimeTicks foregrounded_at = + GetMainThreadOnly().background_status_changed_at; + + GetMainThreadOnly() + .foreground_first_minute_task_duration_reporter.RecordTask( + queue_type, DurationOfIntervalOverlap( + start_time, end_time, foregrounded_at, + foregrounded_at + base::TimeDelta::FromMinutes(1))); + + GetMainThreadOnly() + .foreground_second_minute_task_duration_reporter.RecordTask( + queue_type, DurationOfIntervalOverlap( + start_time, end_time, + foregrounded_at + base::TimeDelta::FromMinutes(1), + foregrounded_at + base::TimeDelta::FromMinutes(2))); + + GetMainThreadOnly() + .foreground_third_minute_task_duration_reporter.RecordTask( + queue_type, DurationOfIntervalOverlap( + start_time, end_time, + foregrounded_at + base::TimeDelta::FromMinutes(2), + foregrounded_at + base::TimeDelta::FromMinutes(3))); + + GetMainThreadOnly() + .foreground_after_third_minute_task_duration_reporter.RecordTask( + queue_type, + DurationOfIntervalOverlap( + start_time, end_time, + foregrounded_at + base::TimeDelta::FromMinutes(3), + std::max(foregrounded_at + base::TimeDelta::FromMinutes(3), + end_time))); } if (GetMainThreadOnly().renderer_hidden) {
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h index 741118c..c9929be 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h +++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
@@ -523,10 +523,19 @@ WakeUpBudgetPool* wake_up_budget_pool; // Not owned. TaskDurationMetricReporter task_duration_reporter; TaskDurationMetricReporter foreground_task_duration_reporter; + TaskDurationMetricReporter foreground_first_minute_task_duration_reporter; + TaskDurationMetricReporter foreground_second_minute_task_duration_reporter; + TaskDurationMetricReporter foreground_third_minute_task_duration_reporter; + TaskDurationMetricReporter + foreground_after_third_minute_task_duration_reporter; TaskDurationMetricReporter background_task_duration_reporter; TaskDurationMetricReporter background_first_minute_task_duration_reporter; + TaskDurationMetricReporter background_second_minute_task_duration_reporter; + TaskDurationMetricReporter background_third_minute_task_duration_reporter; + TaskDurationMetricReporter background_fourth_minute_task_duration_reporter; + TaskDurationMetricReporter background_fifth_minute_task_duration_reporter; TaskDurationMetricReporter - background_after_first_minute_task_duration_reporter; + background_after_fifth_minute_task_duration_reporter; TaskDurationMetricReporter hidden_task_duration_reporter; TaskDurationMetricReporter visible_task_duration_reporter; TaskDurationMetricReporter hidden_music_task_duration_reporter;
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc index 26c98e0..dab7680d 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc
@@ -188,8 +188,8 @@ base::TimeTicks next_wake_up) { if (!control_task_queue_->RunsTasksInCurrentSequence()) { control_task_queue_->PostTask( - FROM_HERE, - base::Bind(forward_immediate_work_callback_, queue, next_wake_up)); + FROM_HERE, base::Bind(forward_immediate_work_callback_, + base::RetainedRef(queue), next_wake_up)); return; }
diff --git a/third_party/WebKit/Source/platform/testing/PaintPropertyTestHelpers.h b/third_party/WebKit/Source/platform/testing/PaintPropertyTestHelpers.h index c43a7ee..7c697da 100644 --- a/third_party/WebKit/Source/platform/testing/PaintPropertyTestHelpers.h +++ b/third_party/WebKit/Source/platform/testing/PaintPropertyTestHelpers.h
@@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef PaintPropertyTestHelpers_h +#define PaintPropertyTestHelpers_h + #include "platform/graphics/paint/ClipPaintPropertyNode.h" #include "platform/graphics/paint/EffectPaintPropertyNode.h" #include "platform/graphics/paint/PaintChunkProperties.h" @@ -31,3 +34,5 @@ } // namespace testing } // namespace blink + +#endif // PaintPropertyTestHelpers_h
diff --git a/third_party/WebKit/Source/platform/testing/TestingPlatformSupportWithWebRTC.cpp b/third_party/WebKit/Source/platform/testing/TestingPlatformSupportWithWebRTC.cpp new file mode 100644 index 0000000..ab9338d --- /dev/null +++ b/third_party/WebKit/Source/platform/testing/TestingPlatformSupportWithWebRTC.cpp
@@ -0,0 +1,102 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "platform/testing/TestingPlatformSupportWithWebRTC.h" + +#include "public/platform/WebRTCError.h" +#include "public/platform/WebRTCRtpReceiver.h" +#include "public/platform/WebRTCRtpSender.h" +#include "public/platform/WebRTCSessionDescription.h" +#include "public/platform/WebVector.h" + +namespace blink { + +MockWebRTCPeerConnectionHandler::MockWebRTCPeerConnectionHandler() {} + +MockWebRTCPeerConnectionHandler::~MockWebRTCPeerConnectionHandler() {} + +bool MockWebRTCPeerConnectionHandler::Initialize(const WebRTCConfiguration&, + const WebMediaConstraints&) { + return true; +} + +void MockWebRTCPeerConnectionHandler::CreateOffer( + const WebRTCSessionDescriptionRequest&, + const WebMediaConstraints&) {} + +void MockWebRTCPeerConnectionHandler::CreateOffer( + const WebRTCSessionDescriptionRequest&, + const WebRTCOfferOptions&) {} + +void MockWebRTCPeerConnectionHandler::CreateAnswer( + const WebRTCSessionDescriptionRequest&, + const WebMediaConstraints&) {} + +void MockWebRTCPeerConnectionHandler::CreateAnswer( + const WebRTCSessionDescriptionRequest&, + const WebRTCAnswerOptions&) {} + +void MockWebRTCPeerConnectionHandler::SetLocalDescription( + const WebRTCVoidRequest&, + const WebRTCSessionDescription&) {} + +void MockWebRTCPeerConnectionHandler::SetRemoteDescription( + const WebRTCVoidRequest&, + const WebRTCSessionDescription&) {} + +WebRTCSessionDescription MockWebRTCPeerConnectionHandler::LocalDescription() { + return WebRTCSessionDescription(); +} + +WebRTCSessionDescription MockWebRTCPeerConnectionHandler::RemoteDescription() { + return WebRTCSessionDescription(); +} + +WebRTCErrorType MockWebRTCPeerConnectionHandler::SetConfiguration( + const WebRTCConfiguration&) { + return WebRTCErrorType::kNone; +} + +bool MockWebRTCPeerConnectionHandler::AddStream(const WebMediaStream&, + const WebMediaConstraints&) { + return true; +} + +void MockWebRTCPeerConnectionHandler::RemoveStream(const WebMediaStream&) {} + +void MockWebRTCPeerConnectionHandler::GetStats(const WebRTCStatsRequest&) {} + +void MockWebRTCPeerConnectionHandler::GetStats( + std::unique_ptr<WebRTCStatsReportCallback>) {} + +WebVector<std::unique_ptr<WebRTCRtpSender>> +MockWebRTCPeerConnectionHandler::GetSenders() { + return WebVector<std::unique_ptr<WebRTCRtpSender>>(); +} + +WebVector<std::unique_ptr<WebRTCRtpReceiver>> +MockWebRTCPeerConnectionHandler::GetReceivers() { + return WebVector<std::unique_ptr<WebRTCRtpReceiver>>(); +} + +WebRTCDataChannelHandler* MockWebRTCPeerConnectionHandler::CreateDataChannel( + const WebString& label, + const WebRTCDataChannelInit&) { + return nullptr; +} + +WebRTCDTMFSenderHandler* MockWebRTCPeerConnectionHandler::CreateDTMFSender( + const WebMediaStreamTrack&) { + return nullptr; +} + +void MockWebRTCPeerConnectionHandler::Stop() {} + +std::unique_ptr<WebRTCPeerConnectionHandler> +TestingPlatformSupportWithWebRTC::CreateRTCPeerConnectionHandler( + WebRTCPeerConnectionHandlerClient*) { + return WTF::MakeUnique<MockWebRTCPeerConnectionHandler>(); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/platform/testing/TestingPlatformSupportWithWebRTC.h b/third_party/WebKit/Source/platform/testing/TestingPlatformSupportWithWebRTC.h new file mode 100644 index 0000000..e5c5e2b --- /dev/null +++ b/third_party/WebKit/Source/platform/testing/TestingPlatformSupportWithWebRTC.h
@@ -0,0 +1,58 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef TestingPlatformSupportWithWebRTC_h +#define TestingPlatformSupportWithWebRTC_h + +#include "platform/testing/TestingPlatformSupport.h" +#include "public/platform/WebRTCPeerConnectionHandler.h" + +namespace blink { + +class MockWebRTCPeerConnectionHandler : public WebRTCPeerConnectionHandler { + public: + MockWebRTCPeerConnectionHandler(); + ~MockWebRTCPeerConnectionHandler() override; + + bool Initialize(const WebRTCConfiguration&, + const WebMediaConstraints&) override; + + void CreateOffer(const WebRTCSessionDescriptionRequest&, + const WebMediaConstraints&) override; + void CreateOffer(const WebRTCSessionDescriptionRequest&, + const WebRTCOfferOptions&) override; + void CreateAnswer(const WebRTCSessionDescriptionRequest&, + const WebMediaConstraints&) override; + void CreateAnswer(const WebRTCSessionDescriptionRequest&, + const WebRTCAnswerOptions&) override; + void SetLocalDescription(const WebRTCVoidRequest&, + const WebRTCSessionDescription&) override; + void SetRemoteDescription(const WebRTCVoidRequest&, + const WebRTCSessionDescription&) override; + WebRTCSessionDescription LocalDescription() override; + WebRTCSessionDescription RemoteDescription() override; + WebRTCErrorType SetConfiguration(const WebRTCConfiguration&) override; + bool AddStream(const WebMediaStream&, const WebMediaConstraints&) override; + void RemoveStream(const WebMediaStream&) override; + void GetStats(const WebRTCStatsRequest&) override; + void GetStats(std::unique_ptr<WebRTCStatsReportCallback>) override; + WebVector<std::unique_ptr<WebRTCRtpSender>> GetSenders() override; + WebVector<std::unique_ptr<WebRTCRtpReceiver>> GetReceivers() override; + WebRTCDataChannelHandler* CreateDataChannel( + const WebString& label, + const WebRTCDataChannelInit&) override; + WebRTCDTMFSenderHandler* CreateDTMFSender( + const WebMediaStreamTrack&) override; + void Stop() override; +}; + +class TestingPlatformSupportWithWebRTC : public TestingPlatformSupport { + public: + std::unique_ptr<WebRTCPeerConnectionHandler> CreateRTCPeerConnectionHandler( + WebRTCPeerConnectionHandlerClient*) override; +}; + +} // namespace blink + +#endif // TestingPlatformSupportWithWebRTC_h
diff --git a/third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp b/third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp index b2ec3e8..cc8a2b2 100644 --- a/third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp +++ b/third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp
@@ -89,13 +89,10 @@ return FilePathToWebString(BlinkRootFilePath()); } -// TODO(sashab): Once all tests from web/ are removed, add CoreTestDataPath() at -// Source/core/testing/data and update callers to use CoreTestDataPath() or -// PlatformTestDataPath() as required. -String WebTestDataPath(const String& relative_path) { +String CoreTestDataPath(const String& relative_path) { return FilePathToWebString( BlinkRootFilePath() - .Append(FILE_PATH_LITERAL("Source/web/tests/data")) + .Append(FILE_PATH_LITERAL("Source/core/testing/data")) .Append(WebStringToFilePath(relative_path))); }
diff --git a/third_party/WebKit/Source/platform/testing/UnitTestHelpers.h b/third_party/WebKit/Source/platform/testing/UnitTestHelpers.h index 3b94f961..f2df9867 100644 --- a/third_party/WebKit/Source/platform/testing/UnitTestHelpers.h +++ b/third_party/WebKit/Source/platform/testing/UnitTestHelpers.h
@@ -52,10 +52,10 @@ // /src/third_party/WebKit. String BlinkRootDir(); -// Returns test data absolute path for webkit_unit_tests, i.e. -// <blinkRootDir>/Source/web/tests/data/<relativePath>. +// Returns test data absolute path for webkit_unit_tests in core, i.e. +// <blinkRootDir>/Source/core/testing/data/<relativePath>. // It returns the top web test directory if |relativePath| was not specified. -String WebTestDataPath(const String& relative_path = String()); +String CoreTestDataPath(const String& relative_path = String()); // Returns test data absolute path for blink_platform_unittests, i.e. // <blinkRootDir>/Source/platform/testing/data/<relativePath>.
diff --git a/third_party/WebKit/Source/platform/text/CharacterProperty.h b/third_party/WebKit/Source/platform/text/CharacterProperty.h index 2408512..d5e674c5 100644 --- a/third_party/WebKit/Source/platform/text/CharacterProperty.h +++ b/third_party/WebKit/Source/platform/text/CharacterProperty.h
@@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef CharacterProperty_h +#define CharacterProperty_h + #include <cstdint> namespace blink { @@ -30,3 +33,5 @@ } } // namespace blink + +#endif // CharacterProperty_h
diff --git a/third_party/WebKit/Source/platform/text/TextEncodingDetectorTest.cpp b/third_party/WebKit/Source/platform/text/TextEncodingDetectorTest.cpp index a38b469..9dd0972 100644 --- a/third_party/WebKit/Source/platform/text/TextEncodingDetectorTest.cpp +++ b/third_party/WebKit/Source/platform/text/TextEncodingDetectorTest.cpp
@@ -17,7 +17,7 @@ "$BKL3$F;F|K\\%O%`%U%!%$%?!<%:$,%=%U%H%P%s%/$H$N%W%l!<%*%U$r@)$7!\""; WTF::TextEncoding encoding; bool result = DetectTextEncoding(iso2022jp.c_str(), iso2022jp.length(), - nullptr, KURL(), nullptr, &encoding); + nullptr, NullURL(), nullptr, &encoding); EXPECT_TRUE(result); EXPECT_EQ(WTF::TextEncoding("ISO-2022-JP"), encoding); } @@ -29,7 +29,7 @@ " ~{\x54\x42\x31\x7D\x37\x22\x55\x39\x35\x3D\x3D\x71~} abc"; WTF::TextEncoding encoding; bool result = DetectTextEncoding(hz_gb2312.c_str(), hz_gb2312.length(), - nullptr, KURL(), nullptr, &encoding); + nullptr, NullURL(), nullptr, &encoding); EXPECT_TRUE(result); EXPECT_EQ(WTF::TextEncoding("US-ASCII"), encoding); } @@ -42,7 +42,7 @@ "\x87\x01\xd7\xff\x01\x57\x33\x44\x55\x66\x77\xed\xcb\xa9"; WTF::TextEncoding encoding; bool result = DetectTextEncoding(pseudo_jpg.c_str(), pseudo_jpg.length(), - nullptr, KURL(), nullptr, &encoding); + nullptr, NullURL(), nullptr, &encoding); EXPECT_TRUE(result); EXPECT_EQ(WTF::TextEncoding("US-ASCII"), encoding); } @@ -55,7 +55,7 @@ "TITLE>"; WTF::TextEncoding encoding; bool result = DetectTextEncoding(eucjp_bytes.c_str(), eucjp_bytes.length(), - nullptr, KURL(), nullptr, &encoding); + nullptr, NullURL(), nullptr, &encoding); EXPECT_TRUE(result); EXPECT_EQ(WTF::TextEncoding("GBK"), encoding) << "Without language hint, it's detected as GBK"; @@ -76,7 +76,7 @@ "TITLE>"; WTF::TextEncoding encoding; bool result = DetectTextEncoding(eucjp_bytes.c_str(), eucjp_bytes.length(), - nullptr, KURL(), nullptr, &encoding); + nullptr, NullURL(), nullptr, &encoding); EXPECT_TRUE(result); EXPECT_EQ(WTF::TextEncoding("GBK"), encoding) << "Without language hint, it's detected as GBK"; @@ -102,7 +102,7 @@ "\xA1llit artihkkaliid. Maid don s\xC3\xA1ht\xC3\xA1t dievasmah"; WTF::TextEncoding encoding; bool result = DetectTextEncoding(utf8_bytes.c_str(), utf8_bytes.length(), - nullptr, KURL(), nullptr, &encoding); + nullptr, NullURL(), nullptr, &encoding); EXPECT_FALSE(result); }
diff --git a/third_party/WebKit/Source/platform/text/hyphenation/HyphenationMinikin.h b/third_party/WebKit/Source/platform/text/hyphenation/HyphenationMinikin.h index 678f4abe4..d866251 100644 --- a/third_party/WebKit/Source/platform/text/hyphenation/HyphenationMinikin.h +++ b/third_party/WebKit/Source/platform/text/hyphenation/HyphenationMinikin.h
@@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef HyphenationMinikin_h +#define HyphenationMinikin_h + #include "platform/text/Hyphenation.h" #include "base/files/memory_mapped_file.h" @@ -37,3 +40,5 @@ }; } // namespace blink + +#endif // HyphenationMinikin_h
diff --git a/third_party/WebKit/Source/platform/text/hyphenation/HyphenatorAOSP.h b/third_party/WebKit/Source/platform/text/hyphenation/HyphenatorAOSP.h index 8d5277b..443a2b3 100644 --- a/third_party/WebKit/Source/platform/text/hyphenation/HyphenatorAOSP.h +++ b/third_party/WebKit/Source/platform/text/hyphenation/HyphenatorAOSP.h
@@ -16,6 +16,9 @@ * * ***** END LICENSE BLOCK ***** */ +#ifndef HyphenatorAOSP_h +#define HyphenatorAOSP_h + /** * An implementation of Liang's hyphenation algorithm. */ @@ -23,9 +26,6 @@ #include <memory> #include <unordered_map> -#ifndef MINIKIN_HYPHENATOR_H -#define MINIKIN_HYPHENATOR_H - namespace android { // hyb file header; implementation details are in the .cpp file @@ -87,4 +87,4 @@ } // namespace android -#endif // MINIKIN_HYPHENATOR_H +#endif // HyphenatorAOSP_h
diff --git a/third_party/WebKit/Source/platform/transforms/TransformationMatrix.cpp b/third_party/WebKit/Source/platform/transforms/TransformationMatrix.cpp index ea506cf..6952eba 100644 --- a/third_party/WebKit/Source/platform/transforms/TransformationMatrix.cpp +++ b/third_party/WebKit/Source/platform/transforms/TransformationMatrix.cpp
@@ -45,7 +45,7 @@ #include <cmath> #include <cstdlib> -#if CPU(X86_64) +#if defined(ARCH_CPU_X86_64) #include <emmintrin.h> #endif @@ -150,7 +150,7 @@ d1 * Determinant3x3(a2, a3, a4, b2, b3, b4, c2, c3, c4); } -#if !CPU(ARM64) && !HAVE(MIPS_MSA_INTRINSICS) +#if !defined(ARCH_CPU_ARM64) && !HAVE(MIPS_MSA_INTRINSICS) // adjoint( original_matrix, inverse_matrix ) // // calculate the adjoint of a 4x4 matrix @@ -225,7 +225,7 @@ if (fabs(det) < kSmallNumber) return false; -#if CPU(ARM64) +#if defined(ARCH_CPU_ARM64) double rdet = 1 / det; const double* mat = &(matrix[0][0]); double* pr = &(result[0][0]); @@ -1280,7 +1280,7 @@ // blink_platform_unittests, therefore the ARM64 branch is not tested by CQ. TransformationMatrix& TransformationMatrix::Multiply( const TransformationMatrix& mat) { -#if CPU(ARM64) +#if defined(ARCH_CPU_ARM64) double* left_matrix = &(matrix_[0][0]); const double* right_matrix = &(mat.matrix_[0][0]); asm volatile(
diff --git a/third_party/WebKit/Source/platform/transforms/TransformationMatrix.h b/third_party/WebKit/Source/platform/transforms/TransformationMatrix.h index 8975c7c..f0ea1fe 100644 --- a/third_party/WebKit/Source/platform/transforms/TransformationMatrix.h +++ b/third_party/WebKit/Source/platform/transforms/TransformationMatrix.h
@@ -29,12 +29,11 @@ #include <string.h> // for memcpy #include <memory> #include "SkMatrix44.h" +#include "build/build_config.h" #include "platform/geometry/FloatPoint.h" #include "platform/geometry/FloatPoint3D.h" #include "platform/wtf/Alignment.h" #include "platform/wtf/Allocator.h" -#include "platform/wtf/CPU.h" -#include "platform/wtf/Compiler.h" #include "platform/wtf/PtrUtil.h" namespace blink { @@ -46,7 +45,7 @@ class FloatQuad; class FloatBox; struct Rotation; -#if CPU(X86_64) +#if defined(ARCH_CPU_X86_64) #define TRANSFORMATION_MATRIX_USE_X86_64_SSE2 #endif
diff --git a/third_party/WebKit/Source/platform/weborigin/KURL.cpp b/third_party/WebKit/Source/platform/weborigin/KURL.cpp index 29455a4..40c7887 100644 --- a/third_party/WebKit/Source/platform/weborigin/KURL.cpp +++ b/third_party/WebKit/Source/platform/weborigin/KURL.cpp
@@ -192,7 +192,7 @@ } const KURL& NullURL() { - DEFINE_STATIC_LOCAL(KURL, static_null_url, ()); + DEFINE_THREAD_SAFE_STATIC_LOCAL(KURL, static_null_url, ()); return static_null_url; } @@ -212,7 +212,7 @@ // UTF-8 just in case. KURL::KURL(ParsedURLStringTag, const String& url) { if (!url.IsNull()) - Init(KURL(), url, 0); + Init(NullURL(), url, 0); else { // WebCore expects us to preserve the nullness of strings when this // constructor is used. In all other cases, it expects a non-null
diff --git a/third_party/WebKit/Source/platform/weborigin/KURLTest.cpp b/third_party/WebKit/Source/platform/weborigin/KURLTest.cpp index be834d4..5fb73ad1 100644 --- a/third_party/WebKit/Source/platform/weborigin/KURLTest.cpp +++ b/third_party/WebKit/Source/platform/weborigin/KURLTest.cpp
@@ -433,8 +433,8 @@ for (const auto& test : cases) { SCOPED_TRACE(::testing::Message() << test.input << ", " << test.expected); - const KURL input(KURL(), test.input); - const KURL expected(KURL(), test.expected); + const KURL input(NullURL(), test.input); + const KURL expected(NullURL(), test.expected); EXPECT_EQ(input, expected) << input.GetString() << expected.GetString(); EXPECT_EQ(test.potentially_dangling_markup, input.PotentiallyDanglingMarkup()); @@ -529,59 +529,59 @@ EXPECT_TRUE(kurl.ProtocolIs("ftp")); EXPECT_TRUE(kurl.IsValid()); - kurl = KURL(KURL(), "http://"); + kurl = KURL(NullURL(), "http://"); EXPECT_FALSE(kurl.ProtocolIs("http")); - kurl = KURL(KURL(), "http://wide#鸡"); + kurl = KURL(NullURL(), "http://wide#鸡"); EXPECT_TRUE(kurl.ProtocolIs("http")); EXPECT_EQ(kurl.Protocol(), "http"); - kurl = KURL(KURL(), "http-so://foo"); + kurl = KURL(NullURL(), "http-so://foo"); EXPECT_TRUE(kurl.ProtocolIs("http-so")); - kurl = KURL(KURL(), "https://foo"); + kurl = KURL(NullURL(), "https://foo"); EXPECT_TRUE(kurl.ProtocolIs("https")); - kurl = KURL(KURL(), "https-so://foo"); + kurl = KURL(NullURL(), "https-so://foo"); EXPECT_TRUE(kurl.ProtocolIs("https-so")); - kurl = KURL(KURL(), "ftp://foo"); + kurl = KURL(NullURL(), "ftp://foo"); EXPECT_TRUE(kurl.ProtocolIs("ftp")); - kurl = KURL(KURL(), "http://host/"); + kurl = KURL(NullURL(), "http://host/"); EXPECT_TRUE(kurl.IsValid()); kurl.SetHost(""); EXPECT_FALSE(kurl.IsValid()); - kurl = KURL(KURL(), "http-so://host/"); + kurl = KURL(NullURL(), "http-so://host/"); EXPECT_TRUE(kurl.IsValid()); kurl.SetHost(""); EXPECT_FALSE(kurl.IsValid()); - kurl = KURL(KURL(), "https://host/"); + kurl = KURL(NullURL(), "https://host/"); EXPECT_TRUE(kurl.IsValid()); kurl.SetHost(""); EXPECT_FALSE(kurl.IsValid()); - kurl = KURL(KURL(), "https-so://host/"); + kurl = KURL(NullURL(), "https-so://host/"); EXPECT_TRUE(kurl.IsValid()); kurl.SetHost(""); EXPECT_FALSE(kurl.IsValid()); - kurl = KURL(KURL(), "ftp://host/"); + kurl = KURL(NullURL(), "ftp://host/"); EXPECT_TRUE(kurl.IsValid()); kurl.SetHost(""); EXPECT_FALSE(kurl.IsValid()); - kurl = KURL(KURL(), "http:///noodles/pho.php"); + kurl = KURL(NullURL(), "http:///noodles/pho.php"); EXPECT_STREQ("http://noodles/pho.php", kurl.GetString().Utf8().data()); EXPECT_STREQ("noodles", kurl.Host().Utf8().data()); EXPECT_TRUE(kurl.IsValid()); - kurl = KURL(KURL(), "https://username:password@/"); + kurl = KURL(NullURL(), "https://username:password@/"); EXPECT_FALSE(kurl.IsValid()); - kurl = KURL(KURL(), "https://username:password@host/"); + kurl = KURL(NullURL(), "https://username:password@host/"); EXPECT_TRUE(kurl.IsValid()); } @@ -702,7 +702,7 @@ EXPECT_TRUE(kurl4.GetString().IsEmpty()); // Resolving an empty URL on an invalid string. - KURL kurl5(KURL(), "foo.js"); + KURL kurl5(NullURL(), "foo.js"); // We'll be empty in this case, but KURL won't be. Should be OK. // EXPECT_EQ(kurl5.isEmpty(), kurl5.isEmpty()); // EXPECT_EQ(kurl5.getString().isEmpty(), kurl5.getString().isEmpty()); @@ -840,7 +840,7 @@ KURL invalid_utf8(kParsedURLString, "http://a@9%aa%:"); EXPECT_FALSE(invalid_utf8.ProtocolIs("http")); - KURL capital(KURL(), "HTTP://www.example.text"); + KURL capital(NullURL(), "HTTP://www.example.text"); EXPECT_TRUE(capital.ProtocolIs("http")); EXPECT_EQ(capital.Protocol(), "http"); }
diff --git a/third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.cpp b/third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.cpp index 18d9e04..0458d15a 100644 --- a/third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.cpp +++ b/third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.cpp
@@ -49,7 +49,7 @@ return false; String protocol("https://"); - KURL url(KURL(), protocol + host + "/"); + KURL url(NullURL(), protocol + host + "/"); if (!url.IsValid()) return false;
diff --git a/third_party/WebKit/Source/platform/weborigin/Referrer.h b/third_party/WebKit/Source/platform/weborigin/Referrer.h index 57c54387..dae16e0 100644 --- a/third_party/WebKit/Source/platform/weborigin/Referrer.h +++ b/third_party/WebKit/Source/platform/weborigin/Referrer.h
@@ -42,7 +42,7 @@ DISALLOW_NEW(); Referrer(const String& referrer, ReferrerPolicy referrer_policy) : referrer(referrer), referrer_policy(referrer_policy) { - DCHECK(referrer == NoReferrer() || KURL(KURL(), referrer).IsValid()); + DCHECK(referrer == NoReferrer() || KURL(NullURL(), referrer).IsValid()); } Referrer() : referrer_policy(kReferrerPolicyDefault) {} static String NoReferrer() { return String(); }
diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp index ceea0d09..b20bc80 100644 --- a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp +++ b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
@@ -522,7 +522,7 @@ RefPtr<SecurityOrigin> SecurityOrigin::CreateFromString( const String& origin_string) { - return SecurityOrigin::Create(KURL(KURL(), origin_string)); + return SecurityOrigin::Create(KURL(NullURL(), origin_string)); } RefPtr<SecurityOrigin> SecurityOrigin::Create(const String& protocol, @@ -534,7 +534,7 @@ DCHECK_EQ(host, DecodeURLEscapeSequences(host)); String port_part = port ? ":" + String::Number(port) : String(); - return Create(KURL(KURL(), protocol + "://" + host + port_part + "/")); + return Create(KURL(NullURL(), protocol + "://" + host + port_part + "/")); } RefPtr<SecurityOrigin> SecurityOrigin::Create(const String& protocol,
diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp b/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp index 67bc353..81b1f2c6 100644 --- a/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp +++ b/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp
@@ -206,7 +206,7 @@ SecurityOrigin::IsSecure(KURL(kParsedURLString, test.url))) << "URL: '" << test.url << "'"; - EXPECT_FALSE(SecurityOrigin::IsSecure(KURL())); + EXPECT_FALSE(SecurityOrigin::IsSecure(NullURL())); } TEST_F(SecurityOriginTest, IsSecureViaTrustworthy) {
diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp b/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp index 256900c..27d32e1 100644 --- a/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp +++ b/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp
@@ -94,7 +94,7 @@ return Referrer(Referrer::NoReferrer(), referrer_policy_no_default); DCHECK(!referrer.IsEmpty()); - KURL referrer_url = KURL(KURL(), referrer); + KURL referrer_url = KURL(NullURL(), referrer); String scheme = referrer_url.Protocol(); if (!SchemeRegistry::ShouldTreatURLSchemeAsAllowedForReferrer(scheme)) return Referrer(Referrer::NoReferrer(), referrer_policy_no_default);
diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityPolicyTest.cpp b/third_party/WebKit/Source/platform/weborigin/SecurityPolicyTest.cpp index e9aeefb..1b07ec5f 100644 --- a/third_party/WebKit/Source/platform/weborigin/SecurityPolicyTest.cpp +++ b/third_party/WebKit/Source/platform/weborigin/SecurityPolicyTest.cpp
@@ -62,7 +62,7 @@ TEST(SecurityPolicyTest, ShouldHideReferrerRespectsReferrerSchemesRegistry) { const KURL example_http_url = KURL(kParsedURLString, "http://example.com/"); - const KURL foobar_url = KURL(KURL(), "foobar://somepage/"); + const KURL foobar_url = KURL(NullURL(), "foobar://somepage/"); const String foobar_scheme = String::FromUTF8("foobar"); EXPECT_TRUE(SecurityPolicy::ShouldHideReferrer(example_http_url, foobar_url));
diff --git a/third_party/WebKit/Source/platform/wtf/Alignment.h b/third_party/WebKit/Source/platform/wtf/Alignment.h index 4c634f1..045d0dd 100644 --- a/third_party/WebKit/Source/platform/wtf/Alignment.h +++ b/third_party/WebKit/Source/platform/wtf/Alignment.h
@@ -21,18 +21,17 @@ #ifndef WTF_Alignment_h #define WTF_Alignment_h -#include "platform/wtf/Compiler.h" -#include <algorithm> #include <stdint.h> #include <utility> +#include "build/build_config.h" namespace WTF { -#if COMPILER(GCC) +#if defined(COMPILER_GCC) #define WTF_ALIGN_OF(type) __alignof__(type) #define WTF_ALIGNED(variable_type, variable, n) \ variable_type variable __attribute__((__aligned__(n))) -#elif COMPILER(MSVC) +#elif defined(COMPILER_MSVC) #define WTF_ALIGN_OF(type) __alignof(type) #define WTF_ALIGNED(variable_type, variable, n) \ __declspec(align(n)) variable_type variable @@ -40,7 +39,7 @@ #error WTF_ALIGN macros need alignment control. #endif -#if COMPILER(GCC) +#if defined(COMPILER_GCC) typedef char __attribute__((__may_alias__)) AlignedBufferChar; // NOLINT #else typedef char AlignedBufferChar;
diff --git a/third_party/WebKit/Source/platform/wtf/Allocator.h b/third_party/WebKit/Source/platform/wtf/Allocator.h index ec03c21..e9d3a73 100644 --- a/third_party/WebKit/Source/platform/wtf/Allocator.h +++ b/third_party/WebKit/Source/platform/wtf/Allocator.h
@@ -70,7 +70,7 @@ private: \ friend class ::WTF::internal::__thisIsHereToForceASemicolonAfterThisMacro -#if COMPILER(CLANG) +#if defined(__clang__) #define STACK_ALLOCATED() \ __attribute__((annotate("blink_stack_allocated"))) void* operator new( \ size_t) = delete; \
diff --git a/third_party/WebKit/Source/platform/wtf/Assertions.cpp b/third_party/WebKit/Source/platform/wtf/Assertions.cpp index 20c783c..7585960c5 100644 --- a/third_party/WebKit/Source/platform/wtf/Assertions.cpp +++ b/third_party/WebKit/Source/platform/wtf/Assertions.cpp
@@ -34,15 +34,15 @@ #include "platform/wtf/Assertions.h" -#include "platform/wtf/Compiler.h" -#include "platform/wtf/PtrUtil.h" -#include "platform/wtf/ThreadSpecific.h" -#include "platform/wtf/Threading.h" -#include <memory> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <memory> +#include "build/build_config.h" +#include "platform/wtf/PtrUtil.h" +#include "platform/wtf/ThreadSpecific.h" +#include "platform/wtf/Threading.h" #if OS(MACOSX) #include <AvailabilityMacros.h> @@ -52,7 +52,7 @@ #endif #endif // OS(MACOSX) -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) #include <crtdbg.h> #endif @@ -102,7 +102,7 @@ vfprintf(stderr, format, args); } -#if COMPILER(GCC) +#if defined(COMPILER_GCC) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" #endif @@ -124,11 +124,11 @@ vprintf_stderr_common(formatWithNewline.get(), args); } -#if COMPILER(GCC) +#if defined(COMPILER_GCC) #pragma GCC diagnostic pop #endif -#if !LOG_DISABLED +#if DCHECK_IS_ON() namespace WTF { ScopedLogger::ScopedLogger(bool condition, const char* format, ...) @@ -216,7 +216,7 @@ vprintf_stderr_common; } // namespace WTF -#endif // !LOG_DISABLED +#endif // DCHECK_IS_ON void WTFLogAlways(const char* format, ...) { va_list args;
diff --git a/third_party/WebKit/Source/platform/wtf/Assertions.h b/third_party/WebKit/Source/platform/wtf/Assertions.h index 528d275..cb506e514 100644 --- a/third_party/WebKit/Source/platform/wtf/Assertions.h +++ b/third_party/WebKit/Source/platform/wtf/Assertions.h
@@ -43,17 +43,13 @@ #include <windows.h> #endif -#ifndef LOG_DISABLED -#define LOG_DISABLED !DCHECK_IS_ON() -#endif - // WTFLogAlways() is deprecated. crbug.com/638849 WTF_EXPORT PRINTF_FORMAT(1, 2) // NOLINT void WTFLogAlways(const char* format, ...); namespace WTF { -#if LOG_DISABLED +#if !DCHECK_IS_ON() #define WTF_CREATE_SCOPED_LOGGER(...) ((void)0) #define WTF_CREATE_SCOPED_LOGGER_IF(...) ((void)0) @@ -105,7 +101,7 @@ WTF::ScopedLogger name(condition, __VA_ARGS__) #define WTF_APPEND_SCOPED_LOGGER(name, ...) (name.Log(__VA_ARGS__)) -#endif // LOG_DISABLED +#endif // !DCHECK_IS_ON() } // namespace WTF
diff --git a/third_party/WebKit/Source/platform/wtf/AssertionsTest.cpp b/third_party/WebKit/Source/platform/wtf/AssertionsTest.cpp index 3a7a4ebc..fd4e9562 100644 --- a/third_party/WebKit/Source/platform/wtf/AssertionsTest.cpp +++ b/third_party/WebKit/Source/platform/wtf/AssertionsTest.cpp
@@ -36,7 +36,7 @@ EXPECT_DEATH_IF_SUPPORTED(SECURITY_CHECK(false), ""); }; -#if !LOG_DISABLED +#if DCHECK_IS_ON() static const int kPrinterBufferSize = 256; static char g_buffer[kPrinterBufferSize]; static StringBuilder g_builder; @@ -71,6 +71,6 @@ ")\n", g_builder.ToString()); }; -#endif // !LOG_DISABLED +#endif // DCHECK_IS_ON() } // namespace WTF
diff --git a/third_party/WebKit/Source/platform/wtf/Atomics.h b/third_party/WebKit/Source/platform/wtf/Atomics.h index e7e4e23..0ae5c2c 100644 --- a/third_party/WebKit/Source/platform/wtf/Atomics.h +++ b/third_party/WebKit/Source/platform/wtf/Atomics.h
@@ -30,13 +30,13 @@ #ifndef Atomics_h #define Atomics_h +#include <stdint.h> +#include "build/build_config.h" #include "platform/wtf/AddressSanitizer.h" #include "platform/wtf/Assertions.h" #include "platform/wtf/CPU.h" -#include <stdint.h> - -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) #include <windows.h> #endif @@ -50,7 +50,7 @@ namespace WTF { -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) // atomicAdd returns the result of the addition. ALWAYS_INLINE int AtomicAdd(int volatile* addend, int increment) { @@ -176,7 +176,7 @@ #if defined(THREAD_SANITIZER) // The definitions below assume an LP64 data model. This is fine because // TSan is only supported on x86_64 Linux. -#if CPU(64BIT) && OS(LINUX) +#if defined(ARCH_CPU_64_BITS) && defined(OS_LINUX) ALWAYS_INLINE void ReleaseStore(volatile int* ptr, int value) { __tsan_atomic32_store(ptr, value, __tsan_memory_order_release); } @@ -257,9 +257,9 @@ #else // defined(THREAD_SANITIZER) -#if CPU(X86) || CPU(X86_64) +#if defined(ARCH_CPU_X86_FAMILY) // Only compiler barrier is needed. -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) // Starting from Visual Studio 2005 compiler guarantees acquire and release // semantics for operations on volatile variables. See MSDN entry for // MemoryBarrier macro. @@ -289,7 +289,7 @@ MEMORY_BARRIER(); *ptr = value; } -#if CPU(64BIT) +#if defined(ARCH_CPU_64_BITS) ALWAYS_INLINE void ReleaseStore(volatile unsigned long long* ptr, unsigned long long value) { MEMORY_BARRIER(); @@ -321,7 +321,7 @@ MEMORY_BARRIER(); return value; } -#if CPU(64BIT) +#if defined(ARCH_CPU_64_BITS) ALWAYS_INLINE unsigned long long AcquireLoad( volatile const unsigned long long* ptr) { unsigned long long value = *ptr;
diff --git a/third_party/WebKit/Source/platform/wtf/BitwiseOperations.h b/third_party/WebKit/Source/platform/wtf/BitwiseOperations.h index 8d5d86a..7af284c 100644 --- a/third_party/WebKit/Source/platform/wtf/BitwiseOperations.h +++ b/third_party/WebKit/Source/platform/wtf/BitwiseOperations.h
@@ -36,14 +36,14 @@ #define WTF_BitwiseOperations_h #include "base/bits.h" -#include "platform/wtf/CPU.h" +#include "build/build_config.h" namespace WTF { using base::bits::CountLeadingZeroBits32; using base::bits::CountLeadingZeroBitsSizeT; -#if CPU(64BIT) +#if defined(ARCH_CPU_64_BITS) using base::bits::CountLeadingZeroBits64; #endif
diff --git a/third_party/WebKit/Source/platform/wtf/ByteOrder.h b/third_party/WebKit/Source/platform/wtf/ByteOrder.h index 279efbc9b..e2f3b10 100644 --- a/third_party/WebKit/Source/platform/wtf/ByteOrder.h +++ b/third_party/WebKit/Source/platform/wtf/ByteOrder.h
@@ -31,6 +31,7 @@ #ifndef WTF_ByteOrder_h #define WTF_ByteOrder_h +#include "build/build_config.h" #include "platform/wtf/build_config.h" #if OS(POSIX) @@ -40,9 +41,8 @@ #if OS(WIN) #include "platform/wtf/ByteSwap.h" -#include "platform/wtf/CPU.h" -#if CPU(BIG_ENDIAN) +#if defined(ARCH_CPU_BIG_ENDIAN) inline uint16_t ntohs(uint16_t x) { return x; }
diff --git a/third_party/WebKit/Source/platform/wtf/ByteSwap.h b/third_party/WebKit/Source/platform/wtf/ByteSwap.h index 330da2b..ab958ce1 100644 --- a/third_party/WebKit/Source/platform/wtf/ByteSwap.h +++ b/third_party/WebKit/Source/platform/wtf/ByteSwap.h
@@ -31,12 +31,12 @@ #ifndef WTF_ByteSwap_h #define WTF_ByteSwap_h +#include <stdint.h> +#include "build/build_config.h" #include "platform/wtf/CPU.h" #include "platform/wtf/Compiler.h" -#include <stdint.h> - -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) #include <stdlib.h> #endif @@ -46,7 +46,7 @@ return ((x & 0xffff0000) >> 16) | ((x & 0x0000ffff) << 16); } -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) ALWAYS_INLINE uint64_t Bswap64(uint64_t x) { return _byteswap_uint64(x); @@ -72,20 +72,6 @@ #endif -#if CPU(64BIT) - -ALWAYS_INLINE size_t Bswapuintptrt(size_t x) { - return Bswap64(x); -} - -#else - -ALWAYS_INLINE size_t Bswapuintptrt(size_t x) { - return Bswap32(x); -} - -#endif - } // namespace WTF #endif // WTF_ByteSwap_h
diff --git a/third_party/WebKit/Source/platform/wtf/CPU.h b/third_party/WebKit/Source/platform/wtf/CPU.h index e249199..ba1d340 100644 --- a/third_party/WebKit/Source/platform/wtf/CPU.h +++ b/third_party/WebKit/Source/platform/wtf/CPU.h
@@ -29,60 +29,22 @@ #ifndef WTF_CPU_h #define WTF_CPU_h -#include "platform/wtf/Compiler.h" - -/* CPU() - the target CPU architecture */ -#define CPU(WTF_FEATURE) \ - (defined WTF_CPU_##WTF_FEATURE && WTF_CPU_##WTF_FEATURE) - -/* ==== CPU() - the target CPU architecture ==== */ - -/* This defines CPU(BIG_ENDIAN) or nothing, as appropriate. */ -/* This defines CPU(32BIT) or CPU(64BIT), as appropriate. */ - -/* CPU(X86) - i386 / x86 32-bit */ -#if defined(__i386__) || defined(i386) || defined(_M_IX86) || \ - defined(_X86_) || defined(__THW_INTEL) -#define WTF_CPU_X86 1 -#endif - -/* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */ -#if defined(__x86_64__) || defined(_M_X64) -#define WTF_CPU_X86_64 1 -#define WTF_CPU_64BIT 1 -#endif - -/* CPU(ARM) - ARM, any version*/ #if defined(arm) || defined(__arm__) || defined(ARM) || defined(_ARM_) -#define WTF_CPU_ARM 1 -#if defined(__ARMEB__) -#define WTF_CPU_BIG_ENDIAN 1 - -#elif !defined(__ARM_EABI__) && !defined(__EABI__) && !defined(__VFP_FP__) && \ - !defined(_WIN32_WCE) && !defined(ANDROID) +#if !defined(__ARMEB__) && !defined(__ARM_EABI__) && !defined(__EABI__) && \ + !defined(__VFP_FP__) && !defined(_WIN32_WCE) && !defined(ANDROID) #error Chromium does not support middle endian architecture - #endif +// WTF_CPU_ARM_NEON is 0 or 1, and should not use defined(WTF_CPU_ARM_NEON). #if defined(__ARM_NEON__) && !defined(WTF_CPU_ARM_NEON) #define WTF_CPU_ARM_NEON 1 #endif #endif /* ARM */ -/* CPU(ARM64) - AArch64 64-bit */ -#if defined(__aarch64__) -#define WTF_CPU_ARM64 1 -#define WTF_CPU_64BIT 1 -#endif - -/* CPU(MIPS), CPU(MIPS64) */ -#if defined(__mips__) && (__mips == 64) -#define WTF_CPU_MIPS64 1 -#define WTF_CPU_64BIT 1 -#elif defined(__mips__) -#define WTF_CPU_MIPS 1 +#if !defined(WTF_CPU_ARM_NEON) +#define WTF_CPU_ARM_NEON 0 #endif #if defined(__mips_msa) && defined(__mips_isa_rev) && (__mips_isa_rev >= 5) @@ -90,8 +52,4 @@ #define HAVE_MIPS_MSA_INTRINSICS 1 #endif -#if !defined(WTF_CPU_64BIT) -#define WTF_CPU_32BIT 1 -#endif - #endif /* WTF_CPU_h */
diff --git a/third_party/WebKit/Source/platform/wtf/Compiler.h b/third_party/WebKit/Source/platform/wtf/Compiler.h index 1b81bb9..31a3ad3 100644 --- a/third_party/WebKit/Source/platform/wtf/Compiler.h +++ b/third_party/WebKit/Source/platform/wtf/Compiler.h
@@ -27,28 +27,9 @@ #define WTF_Compiler_h #include "base/compiler_specific.h" +#include "build/build_config.h" -/* COMPILER() - the compiler being used to build the project */ -#define COMPILER(WTF_FEATURE) \ - (defined WTF_COMPILER_##WTF_FEATURE && WTF_COMPILER_##WTF_FEATURE) - -/* ==== COMPILER() - the compiler being used to build the project ==== */ - -/* COMPILER(CLANG) - Clang */ -#if defined(__clang__) -#define WTF_COMPILER_CLANG 1 -#endif - -/* COMPILER(MSVC) - Microsoft Visual C++ (and Clang when compiling for Windows). - */ -#if defined(_MSC_VER) -#define WTF_COMPILER_MSVC 1 -#endif - -/* COMPILER(GCC) - GNU Compiler Collection (and Clang when compiling for - * platforms other than Windows). */ #if defined(__GNUC__) -#define WTF_COMPILER_GCC 1 #define GCC_VERSION \ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) #define GCC_VERSION_AT_LEAST(major, minor, patch) \ @@ -79,9 +60,9 @@ /* WTF_PRETTY_FUNCTION */ -#if COMPILER(GCC) +#if defined(COMPILER_GCC) #define WTF_PRETTY_FUNCTION __PRETTY_FUNCTION__ -#elif COMPILER(MSVC) +#elif defined(COMPILER_MSVC) #define WTF_PRETTY_FUNCTION __FUNCSIG__ #else #define WTF_PRETTY_FUNCTION __func__ @@ -90,7 +71,7 @@ /* NO_SANITIZE_UNRELATED_CAST - Disable runtime checks related to casts between * unrelated objects (-fsanitize=cfi-unrelated-cast or -fsanitize=vptr). */ -#if COMPILER(CLANG) +#if defined(__clang__) #define NO_SANITIZE_UNRELATED_CAST \ __attribute__((no_sanitize("cfi-unrelated-cast", "vptr"))) #else
diff --git a/third_party/WebKit/Source/platform/wtf/ContainerAnnotations.h b/third_party/WebKit/Source/platform/wtf/ContainerAnnotations.h index d0b7459d..ac74083 100644 --- a/third_party/WebKit/Source/platform/wtf/ContainerAnnotations.h +++ b/third_party/WebKit/Source/platform/wtf/ContainerAnnotations.h
@@ -5,12 +5,12 @@ #ifndef WTF_ContainerAnnotations_h #define WTF_ContainerAnnotations_h +#include "build/build_config.h" #include "platform/wtf/AddressSanitizer.h" -#include "platform/wtf/CPU.h" -// TODO(ochang): Remove the CPU(X86_64) condition to enable this for X86 once -// the crashes there have been fixed: http://crbug.com/461406 -#if defined(ADDRESS_SANITIZER) && OS(LINUX) && CPU(X86_64) +// TODO(ochang): Remove the ARCH_CPU_X86_64 condition to enable this for X86 +// once the crashes there have been fixed: http://crbug.com/461406 +#if defined(ADDRESS_SANITIZER) && defined(OS_LINUX) && defined(ARCH_CPU_X86_64) #define ANNOTATE_CONTIGUOUS_CONTAINER #define ANNOTATE_NEW_BUFFER(buffer, capacity, newSize) \ if (buffer) { \ @@ -34,11 +34,14 @@ ANNOTATE_DELETE_BUFFER(buffer, oldCapacity, bufferSize); \ ANNOTATE_NEW_BUFFER(buffer, newCapacity, bufferSize); // Annotations require buffers to begin on an 8-byte boundary. -#else // defined(ADDRESS_SANITIZER) && OS(LINUX) && CPU(X86_64) + +#else // ADDRESS_SANITIZER && OS_LINUX && ARCH_CPU_X86_64 + #define ANNOTATE_NEW_BUFFER(buffer, capacity, newSize) #define ANNOTATE_DELETE_BUFFER(buffer, capacity, oldSize) #define ANNOTATE_CHANGE_SIZE(buffer, capacity, oldSize, newSize) #define ANNOTATE_CHANGE_CAPACITY(buffer, oldCapacity, bufferSize, newCapacity) -#endif // defined(ADDRESS_SANITIZER) && OS(LINUX) && CPU(X86_64) + +#endif // ADDRESS_SANITIZER && OS_LINUX && ARCH_CPU_X86_64 #endif // WTF_ContainerAnnotations_h
diff --git a/third_party/WebKit/Source/platform/wtf/DateMath.cpp b/third_party/WebKit/Source/platform/wtf/DateMath.cpp index 479db49..04ef8914 100644 --- a/third_party/WebKit/Source/platform/wtf/DateMath.cpp +++ b/third_party/WebKit/Source/platform/wtf/DateMath.cpp
@@ -71,6 +71,13 @@ #include "platform/wtf/DateMath.h" +#include <limits.h> +#include <math.h> +#include <stdlib.h> +#include <time.h> +#include <algorithm> +#include <limits> +#include "build/build_config.h" #include "platform/wtf/ASCIICType.h" #include "platform/wtf/Assertions.h" #include "platform/wtf/CurrentTime.h" @@ -78,12 +85,6 @@ #include "platform/wtf/StdLibExtras.h" #include "platform/wtf/StringExtras.h" #include "platform/wtf/text/StringBuilder.h" -#include <algorithm> -#include <limits.h> -#include <limits> -#include <math.h> -#include <stdlib.h> -#include <time.h> #if OS(WIN) #include <windows.h> @@ -109,7 +110,7 @@ {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335}}; static inline void GetLocalTime(const time_t* local_time, struct tm* local_tm) { -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) localtime_s(local_tm, local_time); #else localtime_r(local_time, local_tm);
diff --git a/third_party/WebKit/Source/platform/wtf/HashFunctions.h b/third_party/WebKit/Source/platform/wtf/HashFunctions.h index 2d0decb..6dc9939 100644 --- a/third_party/WebKit/Source/platform/wtf/HashFunctions.h +++ b/third_party/WebKit/Source/platform/wtf/HashFunctions.h
@@ -21,11 +21,12 @@ #ifndef WTF_HashFunctions_h #define WTF_HashFunctions_h +#include <stdint.h> +#include <memory> +#include <type_traits> +#include "build/build_config.h" #include "platform/wtf/RefPtr.h" #include "platform/wtf/StdLibExtras.h" -#include <memory> -#include <stdint.h> -#include <type_traits> namespace WTF { @@ -145,13 +146,13 @@ template <typename T> struct PtrHash { static unsigned GetHash(T* key) { -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) #pragma warning(push) // work around what seems to be a bug in MSVC's conversion warnings #pragma warning(disable : 4244) #endif return IntHash<uintptr_t>::GetHash(reinterpret_cast<uintptr_t>(key)); -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) #pragma warning(pop) #endif }
diff --git a/third_party/WebKit/Source/platform/wtf/MathExtras.h b/third_party/WebKit/Source/platform/wtf/MathExtras.h index 53f4cc4..d6e117eb 100644 --- a/third_party/WebKit/Source/platform/wtf/MathExtras.h +++ b/third_party/WebKit/Source/platform/wtf/MathExtras.h
@@ -26,14 +26,15 @@ #ifndef WTF_MathExtras_h #define WTF_MathExtras_h -#include "platform/wtf/Allocator.h" -#include "platform/wtf/Assertions.h" -#include "platform/wtf/CPU.h" #include <cmath> #include <cstddef> #include <limits> +#include "build/build_config.h" +#include "platform/wtf/Allocator.h" +#include "platform/wtf/Assertions.h" +#include "platform/wtf/CPU.h" -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) // Make math.h behave like other platforms. #define _USE_MATH_DEFINES // Even if math.h was already included, including math.h again with @@ -59,7 +60,7 @@ const double twoPiDouble = piDouble * 2.0; const float twoPiFloat = piFloat * 2.0f; -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) // VS2013 has most of the math functions now, but we still need to work // around various differences in behavior of Inf. @@ -103,7 +104,7 @@ #define fmod(x, y) wtf_fmod(x, y) #define pow(x, y) wtf_pow(x, y) -#endif // COMPILER(MSVC) +#endif // defined(COMPILER_MSVC) inline double deg2rad(double d) { return d * piDouble / 180.0; @@ -383,7 +384,7 @@ } #ifndef UINT64_C -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) #define UINT64_C(c) c##ui64 #else #define UINT64_C(c) c##ull
diff --git a/third_party/WebKit/Source/platform/wtf/README.md b/third_party/WebKit/Source/platform/wtf/README.md index 20f537e..7c73693 100644 --- a/third_party/WebKit/Source/platform/wtf/README.md +++ b/third_party/WebKit/Source/platform/wtf/README.md
@@ -65,7 +65,7 @@ * **Compile-time switch macros** [Compiler.h] (e.g. `COMPILER(GCC)`), - [CPU.h] (e.g. `CPU(X86_64)` or `CPU(64BIT)`), + [CPU.h] (e.g. `WTF_CPU_ARM_NEON`), [build_config.h] (e.g. `OS(WIN)`) * **Miscellaneous**
diff --git a/third_party/WebKit/Source/platform/wtf/StackUtil.cpp b/third_party/WebKit/Source/platform/wtf/StackUtil.cpp index c36eb24e4..ef7daac 100644 --- a/third_party/WebKit/Source/platform/wtf/StackUtil.cpp +++ b/third_party/WebKit/Source/platform/wtf/StackUtil.cpp
@@ -86,7 +86,7 @@ #endif } return pthread_get_stacksize_np(pthread_self()); -#elif OS(WIN) && COMPILER(MSVC) +#elif defined(OS_WIN) && defined(COMPILER_MSVC) return WTFThreadData::ThreadStackSize(); #else #error "Stack frame size estimation not supported on this platform." @@ -127,7 +127,7 @@ #endif #elif OS(MACOSX) return pthread_get_stackaddr_np(pthread_self()); -#elif OS(WIN) && COMPILER(MSVC) +#elif defined(OS_WIN) && defined(COMPILER_MSVC) // On Windows stack limits for the current thread are available in // the thread information block (TIB). Its fields can be accessed through // FS segment register on x86 and GS segment register on x86_64. @@ -160,7 +160,7 @@ g_main_thread_underestimated_stack_size = underestimated_stack_size; } -#if OS(WIN) && COMPILER(MSVC) +#if defined(OS_WIN) && defined(COMPILER_MSVC) size_t ThreadStackSize() { // Notice that we cannot use the TIB's StackLimit for the stack end, as i // tracks the end of the committed range. We're after the end of the reserved
diff --git a/third_party/WebKit/Source/platform/wtf/StackUtil.h b/third_party/WebKit/Source/platform/wtf/StackUtil.h index 8a5db2b..50eea5d 100644 --- a/third_party/WebKit/Source/platform/wtf/StackUtil.h +++ b/third_party/WebKit/Source/platform/wtf/StackUtil.h
@@ -5,11 +5,11 @@ #ifndef StackUtil_h #define StackUtil_h -#include "platform/wtf/Compiler.h" -#include "platform/wtf/WTFExport.h" -#include "platform/wtf/build_config.h" #include <stddef.h> #include <stdint.h> +#include "build/build_config.h" +#include "platform/wtf/WTFExport.h" +#include "platform/wtf/build_config.h" namespace WTF { @@ -23,7 +23,7 @@ WTF_EXPORT void InitializeMainThreadStackEstimate(); -#if OS(WIN) && COMPILER(MSVC) +#if defined(OS_WIN) && defined(COMPILER_MSVC) size_t ThreadStackSize(); #endif
diff --git a/third_party/WebKit/Source/platform/wtf/StdLibExtras.h b/third_party/WebKit/Source/platform/wtf/StdLibExtras.h index e30adfd..c4e9d908 100644 --- a/third_party/WebKit/Source/platform/wtf/StdLibExtras.h +++ b/third_party/WebKit/Source/platform/wtf/StdLibExtras.h
@@ -28,8 +28,8 @@ #include <cstddef> #include "base/numerics/safe_conversions.h" +#include "build/build_config.h" #include "platform/wtf/Assertions.h" -#include "platform/wtf/CPU.h" #include "platform/wtf/LeakAnnotations.h" #include "platform/wtf/Noncopyable.h" #include "platform/wtf/TypeTraits.h" @@ -197,7 +197,7 @@ * - https://bugs.webkit.org/show_bug.cgi?id=38045 * - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43976 */ -#if CPU(ARM) && COMPILER(GCC) +#if defined(ARCH_CPU_ARMEL) && defined(COMPILER_GCC) template <typename Type> bool isPointerTypeAlignmentOkay(Type* ptr) { return !(reinterpret_cast<intptr_t>(ptr) % __alignof__(Type)); @@ -286,7 +286,7 @@ template <typename T, size_t Size> char (&ArrayLengthHelperFunction(T (&)[Size]))[Size]; // GCC needs some help to deduce a 0 length array. -#if COMPILER(GCC) +#if defined(COMPILER_GCC) template <typename T> char (&ArrayLengthHelperFunction(T (&)[0]))[0]; #endif
diff --git a/third_party/WebKit/Source/platform/wtf/StringExtras.h b/third_party/WebKit/Source/platform/wtf/StringExtras.h index aafdeb0..20af0cd 100644 --- a/third_party/WebKit/Source/platform/wtf/StringExtras.h +++ b/third_party/WebKit/Source/platform/wtf/StringExtras.h
@@ -26,17 +26,18 @@ #ifndef WTF_StringExtras_h #define WTF_StringExtras_h -#include "platform/wtf/build_config.h" #include <stdarg.h> #include <stdio.h> #include <string.h> +#include "build/build_config.h" +#include "platform/wtf/build_config.h" #if OS(POSIX) #include <strings.h> #endif -#if COMPILER(MSVC) -// FIXME: why a COMPILER check instead of OS? also, these should be HAVE checks +#if defined(COMPILER_MSVC) +// FIXME: why a compiler check instead of OS? also, these should be HAVE checks #if _MSC_VER < 1900 // snprintf is implemented in VS 2015
diff --git a/third_party/WebKit/Source/platform/wtf/TypeTraits.h b/third_party/WebKit/Source/platform/wtf/TypeTraits.h index 025519a..e9b4593 100644 --- a/third_party/WebKit/Source/platform/wtf/TypeTraits.h +++ b/third_party/WebKit/Source/platform/wtf/TypeTraits.h
@@ -25,7 +25,7 @@ #include <cstddef> #include <type_traits> #include <utility> - +#include "build/build_config.h" #include "platform/wtf/Compiler.h" namespace WTF { @@ -203,7 +203,8 @@ typedef T Type; }; -#if (COMPILER(MSVC) || !GCC_VERSION_AT_LEAST(4, 9, 0)) && !COMPILER(CLANG) +#if (defined(COMPILER_MSVC) || !GCC_VERSION_AT_LEAST(4, 9, 0)) && \ + !defined(__clang__) // FIXME: MSVC bug workaround. Remove once MSVC STL is fixed. // FIXME: GCC before 4.9.0 seems to have the same issue. // C++ 2011 Spec (ISO/IEC 14882:2011(E)) 20.9.6.2 Table 51 states that
diff --git a/third_party/WebKit/Source/platform/wtf/TypeTraitsTest.cpp b/third_party/WebKit/Source/platform/wtf/TypeTraitsTest.cpp index 43e38ea..182df4d 100644 --- a/third_party/WebKit/Source/platform/wtf/TypeTraitsTest.cpp +++ b/third_party/WebKit/Source/platform/wtf/TypeTraitsTest.cpp
@@ -21,6 +21,7 @@ #include "platform/wtf/TypeTraits.h" +#include "build/build_config.h" #include "platform/wtf/Noncopyable.h" // No gtest tests; only static_assert checks. @@ -125,7 +126,7 @@ typedef int IntArray[]; typedef int IntArraySized[4]; -#if !COMPILER(MSVC) || COMPILER(CLANG) +#if !defined(COMPILER_MSVC) || defined(__clang__) class AssignmentDeleted final { private: @@ -200,7 +201,7 @@ static_assert(IsMoveAssignable<AssignableImplicit>::value, "AssignableImplicit is move assignable."); -#endif // !COMPILER(MSVC) || COMPILER(CLANG) +#endif // !defined(COMPILER_MSVC) || defined(__clang__) class DefaultConstructorDeleted final { private:
diff --git a/third_party/WebKit/Source/platform/wtf/Vector.h b/third_party/WebKit/Source/platform/wtf/Vector.h index 9813133..3ec3ee8 100644 --- a/third_party/WebKit/Source/platform/wtf/Vector.h +++ b/third_party/WebKit/Source/platform/wtf/Vector.h
@@ -21,6 +21,12 @@ #ifndef WTF_Vector_h #define WTF_Vector_h +#include <string.h> +#include <algorithm> +#include <initializer_list> +#include <iterator> +#include <utility> +#include "build/build_config.h" #include "platform/wtf/Alignment.h" #include "platform/wtf/ConditionalDestructor.h" #include "platform/wtf/ContainerAnnotations.h" @@ -29,11 +35,6 @@ #include "platform/wtf/StdLibExtras.h" #include "platform/wtf/VectorTraits.h" #include "platform/wtf/allocator/PartitionAllocator.h" -#include <algorithm> -#include <initializer_list> -#include <iterator> -#include <string.h> -#include <utility> // For ASAN builds, disable inline buffers completely as they cause various // issues. @@ -244,7 +245,7 @@ STATIC_ONLY(VectorFiller); static void UninitializedFill(T* dst, T* dst_end, const T& val) { static_assert(sizeof(T) == sizeof(char), "size of type should be one"); -#if COMPILER(GCC) && defined(_FORTIFY_SOURCE) +#if defined(COMPILER_GCC) && defined(_FORTIFY_SOURCE) if (!__builtin_constant_p(dst_end - dst) || (!(dst_end - dst))) memset(dst, val, dst_end - dst); #else
diff --git a/third_party/WebKit/Source/platform/wtf/WTFThreadData.cpp b/third_party/WebKit/Source/platform/wtf/WTFThreadData.cpp index dc137a63..952822b 100644 --- a/third_party/WebKit/Source/platform/wtf/WTFThreadData.cpp +++ b/third_party/WebKit/Source/platform/wtf/WTFThreadData.cpp
@@ -47,7 +47,7 @@ WtfThreadData(); } -#if OS(WIN) && COMPILER(MSVC) +#if defined(OS_WIN) && defined(COMPILER_MSVC) size_t WTFThreadData::ThreadStackSize() { // Needed to bootstrap WTFThreadData on Windows, because this value is needed // before the main thread data is fully initialized.
diff --git a/third_party/WebKit/Source/platform/wtf/WTFThreadData.h b/third_party/WebKit/Source/platform/wtf/WTFThreadData.h index 9019e155..f49b9611 100644 --- a/third_party/WebKit/Source/platform/wtf/WTFThreadData.h +++ b/third_party/WebKit/Source/platform/wtf/WTFThreadData.h
@@ -27,6 +27,8 @@ #ifndef WTFThreadData_h #define WTFThreadData_h +#include <memory> +#include "build/build_config.h" #include "platform/wtf/HashMap.h" #include "platform/wtf/HashSet.h" #include "platform/wtf/Noncopyable.h" @@ -34,7 +36,6 @@ #include "platform/wtf/Threading.h" #include "platform/wtf/WTFExport.h" #include "platform/wtf/text/StringHash.h" -#include <memory> namespace WTF { @@ -58,7 +59,7 @@ // Must be called on the main thread before any callers to wtfThreadData(). static void Initialize(); -#if OS(WIN) && COMPILER(MSVC) +#if defined(OS_WIN) && defined(COMPILER_MSVC) static size_t ThreadStackSize(); #endif @@ -68,7 +69,7 @@ ThreadIdentifier thread_id_; -#if OS(WIN) && COMPILER(MSVC) +#if defined(OS_WIN) && defined(COMPILER_MSVC) size_t thread_stack_size_ = 0u; #endif
diff --git a/third_party/WebKit/Source/platform/wtf/text/ASCIIFastPath.h b/third_party/WebKit/Source/platform/wtf/text/ASCIIFastPath.h index 750e141..e475298 100644 --- a/third_party/WebKit/Source/platform/wtf/text/ASCIIFastPath.h +++ b/third_party/WebKit/Source/platform/wtf/text/ASCIIFastPath.h
@@ -22,13 +22,14 @@ #ifndef ASCIIFastPath_h #define ASCIIFastPath_h +#include <stdint.h> +#include "build/build_config.h" #include "platform/wtf/Alignment.h" #include "platform/wtf/CPU.h" #include "platform/wtf/StdLibExtras.h" #include "platform/wtf/text/Unicode.h" -#include <stdint.h> -#if OS(MACOSX) && (CPU(X86) || CPU(X86_64)) +#if defined(OS_MACOSX) && defined(ARCH_CPU_X86_FAMILY) #include <emmintrin.h> #endif @@ -110,7 +111,7 @@ inline void CopyLCharsFromUCharSource(LChar* destination, const UChar* source, size_t length) { -#if OS(MACOSX) && (CPU(X86) || CPU(X86_64)) +#if defined(OS_MACOSX) && defined(ARCH_CPU_X86_FAMILY) const uintptr_t kMemoryAccessSize = 16; // Memory accesses on 16 byte (128 bit) alignment const uintptr_t kMemoryAccessMask = kMemoryAccessSize - 1; @@ -146,7 +147,8 @@ DCHECK(!(source[i] & 0xff00)); destination[i] = static_cast<LChar>(source[i]); } -#elif COMPILER(GCC) && CPU(ARM_NEON) && !CPU(BIG_ENDIAN) && defined(NDEBUG) +#elif defined(COMPILER_GCC) && WTF_CPU_ARM_NEON && \ + !defined(ARCH_CPU_BIG_ENDIAN) && defined(NDEBUG) const LChar* const end = destination + length; const uintptr_t kMemoryAccessSize = 8;
diff --git a/third_party/WebKit/Source/platform/wtf/text/StringOperatorsTest.cpp b/third_party/WebKit/Source/platform/wtf/text/StringOperatorsTest.cpp index 630110a..cd82a55d 100644 --- a/third_party/WebKit/Source/platform/wtf/text/StringOperatorsTest.cpp +++ b/third_party/WebKit/Source/platform/wtf/text/StringOperatorsTest.cpp
@@ -27,6 +27,7 @@ static int wtfStringCopyCount; +#include "build/build_config.h" #include "platform/wtf/text/WTFString.h" #include "testing/gtest/include/gtest/gtest.h" @@ -184,7 +185,7 @@ EXPECT_N_WTF_STRING_COPIES(2, atomic_string + (literal + string + literal)); EXPECT_N_WTF_STRING_COPIES(2, (atomic_string + literal) + (string + literal)); -#if COMPILER(MSVC) +#if defined(COMPILER_MSVC) EXPECT_N_WTF_STRING_COPIES(1, L"wide string" + string); EXPECT_N_WTF_STRING_COPIES(1, string + L"wide string"); EXPECT_N_WTF_STRING_COPIES(1, L"wide string" + atomic_string);
diff --git a/third_party/WebKit/Source/web/BUILD.gn b/third_party/WebKit/Source/web/BUILD.gn index 7f60737..0050f8a3 100644 --- a/third_party/WebKit/Source/web/BUILD.gn +++ b/third_party/WebKit/Source/web/BUILD.gn
@@ -70,7 +70,7 @@ group("webkit_unit_tests_data") { data = [ - "tests/data/", + "../core/testing/data/", "../core/paint/test_data/", ] } @@ -85,14 +85,9 @@ "tests/AccessibilityObjectModelTest.cpp", "tests/ChromeClientImplTest.cpp", - "tests/DeferredLoadingTest.cpp", "tests/HTMLImportSheetsTest.cpp", "tests/LayoutGeometryMapTest.cpp", - "tests/ListenerLeakTest.cpp", "tests/LocalFrameClientImplTest.cpp", - "tests/MHTMLTest.cpp", - "tests/PrerenderingTest.cpp", - "tests/ProgrammaticScrollTest.cpp", "tests/RunAllTests.cpp", "tests/ScrollMetricsTest.cpp", "tests/SmoothScrollTest.cpp", @@ -100,10 +95,6 @@ "tests/VirtualTimeTest.cpp", "tests/WebFrameSerializerSanitizationTest.cpp", "tests/WebFrameTest.cpp", - "tests/WebMeaningfulLayoutsTest.cpp", - "tests/scheduler/ActiveConnectionThrottlingTest.cpp", - "tests/scheduler/FrameThrottlingTest.cpp", - "tests/scheduler/ThrottlingTest.cpp", ] sources += bindings_unittest_files
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp index 4fa7a05..a1a52cb 100644 --- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp +++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -89,6 +89,7 @@ #include <algorithm> #include <memory> +#include <set> #include <utility> #include "bindings/core/v8/BindingSecurity.h" @@ -848,7 +849,7 @@ void WebLocalFrameImpl::Reload(WebFrameLoadType load_type) { // TODO(clamy): Remove this function once RenderFrame calls load for all // requests. - ReloadWithOverrideURL(KURL(), load_type); + ReloadWithOverrideURL(NullURL(), load_type); } void WebLocalFrameImpl::ReloadWithOverrideURL(const WebURL& override_url, @@ -939,10 +940,6 @@ return new WebAssociatedURLLoaderImpl(GetFrame()->GetDocument(), options); } -unsigned WebLocalFrameImpl::UnloadListenerCount() const { - return GetFrame()->DomWindow()->PendingUnloadEventListeners(); -} - void WebLocalFrameImpl::ReplaceSelection(const WebString& text) { // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets // needs to be audited. See http://crbug.com/590369 for more details. @@ -2384,7 +2381,7 @@ return; String url = ToElement(*node).ImageSourceURL(); - if (!KURL(KURL(), url).ProtocolIsData()) + if (!KURL(NullURL(), url).ProtocolIsData()) return; client_->SaveImageFromDataURL(url); @@ -2498,6 +2495,22 @@ } } +void WebLocalFrameImpl::AdvanceFocusInForm(WebFocusType focus_type) { + DCHECK(GetFrame()->GetDocument()); + Element* element = GetFrame()->GetDocument()->FocusedElement(); + if (!element) + return; + + Element* next_element = + GetFrame()->GetPage()->GetFocusController().NextFocusableElementInForm( + element, focus_type); + if (!next_element) + return; + + next_element->scrollIntoViewIfNeeded(true /*centerIfNeeded*/); + next_element->focus(); +} + TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { return *text_checker_client_; }
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.h b/third_party/WebKit/Source/web/WebLocalFrameImpl.h index 6ba0c6b..97bcc35 100644 --- a/third_party/WebKit/Source/web/WebLocalFrameImpl.h +++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.h
@@ -163,7 +163,6 @@ void SetReferrerForRequest(WebURLRequest&, const WebURL& referrer) override; WebAssociatedURLLoader* CreateAssociatedURLLoader( const WebAssociatedURLLoaderOptions&) override; - unsigned UnloadListenerCount() const override; void SetMarkedText(const WebString&, unsigned location, unsigned length) override; @@ -324,6 +323,8 @@ WebString& clip_text, WebString& clip_html) override; + void AdvanceFocusInForm(WebFocusType) override; + void InitializeCoreFrame(Page&, FrameOwner*, const AtomicString& name) override;
diff --git a/third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp b/third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp index 2bc1b10..e48c3d5d 100644 --- a/third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp +++ b/third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp
@@ -164,7 +164,7 @@ void RegisterMockedHttpURLLoad(const std::string& file_name) { URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url_), testing::WebTestDataPath(), + WebString::FromUTF8(base_url_), testing::CoreTestDataPath(), WebString::FromUTF8(file_name)); }
diff --git a/third_party/WebKit/Source/web/tests/ListenerLeakTest.cpp b/third_party/WebKit/Source/web/tests/ListenerLeakTest.cpp deleted file mode 100644 index 345719b..0000000 --- a/third_party/WebKit/Source/web/tests/ListenerLeakTest.cpp +++ /dev/null
@@ -1,120 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "core/frame/FrameTestHelpers.h" -#include "platform/testing/URLTestHelpers.h" -#include "platform/testing/UnitTestHelpers.h" -#include "public/platform/Platform.h" -#include "public/platform/WebURLLoaderMockFactory.h" -#include "public/web/WebView.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "v8/include/v8-profiler.h" -#include "v8/include/v8.h" - -namespace blink { - -const v8::HeapGraphNode* GetProperty(const v8::HeapGraphNode* node, - v8::HeapGraphEdge::Type type, - const char* name) { - for (int i = 0, count = node->GetChildrenCount(); i < count; ++i) { - const v8::HeapGraphEdge* prop = node->GetChild(i); - if (prop->GetType() == type) { - v8::String::Utf8Value prop_name(prop->GetName()); - if (!strcmp(name, *prop_name)) - return prop->GetToNode(); - } - } - return nullptr; -} - -int GetNumObjects(const char* constructor) { - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - v8::HeapProfiler* profiler = isolate->GetHeapProfiler(); - const v8::HeapSnapshot* snapshot = profiler->TakeHeapSnapshot(); - if (!snapshot) - return -1; - int count = 0; - for (int i = 0; i < snapshot->GetNodesCount(); ++i) { - const v8::HeapGraphNode* node = snapshot->GetNode(i); - if (node->GetType() != v8::HeapGraphNode::kObject) - continue; - v8::String::Utf8Value node_name(node->GetName()); - if (!strcmp(constructor, *node_name)) { - const v8::HeapGraphNode* constructor_prop = - GetProperty(node, v8::HeapGraphEdge::kProperty, "constructor"); - // Skip an Object instance named after the constructor. - if (constructor_prop) { - v8::String::Utf8Value constructor_name(constructor_prop->GetName()); - if (!strcmp(constructor, *constructor_name)) - continue; - } - ++count; - } - } - return count; -} - -class ListenerLeakTest : public ::testing::Test { - public: - void RunTest(const std::string& filename) { - std::string base_url("http://www.example.com/"); - std::string file_name(filename); - URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url), blink::testing::WebTestDataPath(), - WebString::FromUTF8(file_name)); - web_view_helper.InitializeAndLoad(base_url + file_name); - } - - void TearDown() override { - Platform::Current() - ->GetURLLoaderMockFactory() - ->UnregisterAllURLsAndClearMemoryCache(); - } - - protected: - FrameTestHelpers::WebViewHelper web_view_helper; -}; - -// This test tries to create a reference cycle between node and its listener. -// See http://crbug/17400. -TEST_F(ListenerLeakTest, ReferenceCycle) { - RunTest("listener/listener_leak1.html"); - ASSERT_EQ(0, GetNumObjects("EventListenerLeakTestObject1")); -} - -// This test sets node onclick many times to expose a possible memory -// leak where all listeners get referenced by the node. -TEST_F(ListenerLeakTest, HiddenReferences) { - RunTest("listener/listener_leak2.html"); - ASSERT_EQ(1, GetNumObjects("EventListenerLeakTestObject2")); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/web/tests/LocalFrameClientImplTest.cpp b/third_party/WebKit/Source/web/tests/LocalFrameClientImplTest.cpp index 2a458b02..5f4cb67b 100644 --- a/third_party/WebKit/Source/web/tests/LocalFrameClientImplTest.cpp +++ b/third_party/WebKit/Source/web/tests/LocalFrameClientImplTest.cpp
@@ -32,7 +32,6 @@ #include "core/frame/FrameTestHelpers.h" #include "core/frame/WebLocalFrameBase.h" -#include "core/loader/FrameLoader.h" #include "platform/weborigin/KURL.h" #include "platform/wtf/text/CString.h" #include "platform/wtf/text/WTFString.h" @@ -86,7 +85,7 @@ Document& GetDocument() { return *MainFrame()->GetFrame()->GetDocument(); } MockWebFrameClient& WebFrameClient() { return web_frame_client_; } LocalFrameClient& GetLocalFrameClient() { - return *ToLocalFrameClientImpl(MainFrame()->GetFrame()->Loader().Client()); + return *ToLocalFrameClientImpl(MainFrame()->GetFrame()->Client()); } private:
diff --git a/third_party/WebKit/Source/web/tests/MHTMLTest.cpp b/third_party/WebKit/Source/web/tests/MHTMLTest.cpp deleted file mode 100644 index c8d88c3..0000000 --- a/third_party/WebKit/Source/web/tests/MHTMLTest.cpp +++ /dev/null
@@ -1,340 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "core/dom/Document.h" -#include "core/dom/Element.h" -#include "core/dom/ElementShadow.h" -#include "core/frame/FrameTestHelpers.h" -#include "core/frame/LocalFrame.h" -#include "core/frame/Location.h" -#include "core/frame/WebLocalFrameBase.h" -#include "core/page/Page.h" -#include "platform/SerializedResource.h" -#include "platform/SharedBuffer.h" -#include "platform/mhtml/MHTMLArchive.h" -#include "platform/mhtml/MHTMLParser.h" -#include "platform/testing/URLTestHelpers.h" -#include "platform/testing/UnitTestHelpers.h" -#include "platform/weborigin/KURL.h" -#include "platform/weborigin/SchemeRegistry.h" -#include "public/platform/Platform.h" -#include "public/platform/WebString.h" -#include "public/platform/WebURL.h" -#include "public/platform/WebURLLoaderMockFactory.h" -#include "public/platform/WebURLRequest.h" -#include "public/platform/WebURLResponse.h" -#include "public/web/WebDocument.h" -#include "public/web/WebFrame.h" -#include "public/web/WebView.h" -#include "testing/gtest/include/gtest/gtest.h" - -using blink::URLTestHelpers::ToKURL; - -namespace blink { - -class LineReader { - public: - LineReader(const std::string& text) : text_(text), index_(0) {} - bool GetNextLine(std::string* line) { - line->clear(); - if (index_ >= text_.length()) - return false; - - size_t end_of_line_index = text_.find("\r\n", index_); - if (end_of_line_index == std::string::npos) { - *line = text_.substr(index_); - index_ = text_.length(); - return true; - } - - *line = text_.substr(index_, end_of_line_index - index_); - index_ = end_of_line_index + 2; - return true; - } - - private: - std::string text_; - size_t index_; -}; - -class MHTMLTest : public ::testing::Test { - public: - MHTMLTest() { file_path_ = testing::WebTestDataPath("mhtml/"); } - - protected: - void SetUp() override { helper_.Initialize(); } - - void TearDown() override { - Platform::Current() - ->GetURLLoaderMockFactory() - ->UnregisterAllURLsAndClearMemoryCache(); - } - - void RegisterMockedURLLoad(const std::string& url, - const std::string& file_name) { - URLTestHelpers::RegisterMockedURLLoad( - ToKURL(url), - testing::WebTestDataPath(WebString::FromUTF8("mhtml/" + file_name)), - WebString::FromUTF8("multipart/related")); - } - - void LoadURLInTopFrame(const WebURL& url) { - FrameTestHelpers::LoadFrame(helper_.WebView()->MainFrameImpl(), - url.GetString().Utf8().data()); - } - - Page* GetPage() const { return helper_.WebView()->GetPage(); } - - void AddResource(const char* url, - const char* mime, - RefPtr<SharedBuffer> data) { - SerializedResource resource(ToKURL(url), mime, std::move(data)); - resources_.push_back(resource); - } - - void AddResource(const char* url, const char* mime, const char* file_name) { - AddResource(url, mime, ReadFile(file_name)); - } - - void AddTestResources() { - AddResource("http://www.test.com", "text/html", "css_test_page.html"); - AddResource("http://www.test.com/link_styles.css", "text/css", - "link_styles.css"); - AddResource("http://www.test.com/import_style_from_link.css", "text/css", - "import_style_from_link.css"); - AddResource("http://www.test.com/import_styles.css", "text/css", - "import_styles.css"); - AddResource("http://www.test.com/red_background.png", "image/png", - "red_background.png"); - AddResource("http://www.test.com/orange_background.png", "image/png", - "orange_background.png"); - AddResource("http://www.test.com/yellow_background.png", "image/png", - "yellow_background.png"); - AddResource("http://www.test.com/green_background.png", "image/png", - "green_background.png"); - AddResource("http://www.test.com/blue_background.png", "image/png", - "blue_background.png"); - AddResource("http://www.test.com/purple_background.png", "image/png", - "purple_background.png"); - AddResource("http://www.test.com/ul-dot.png", "image/png", "ul-dot.png"); - AddResource("http://www.test.com/ol-dot.png", "image/png", "ol-dot.png"); - } - - static PassRefPtr<RawData> GenerateMHTMLData( - const Vector<SerializedResource>& resources, - MHTMLArchive::EncodingPolicy encoding_policy, - const String& title, - const String& mime_type) { - // This boundary is as good as any other. Plus it gets used in almost - // all the examples in the MHTML spec - RFC 2557. - String boundary = String::FromUTF8("boundary-example"); - - RefPtr<RawData> mhtml_data = RawData::Create(); - MHTMLArchive::GenerateMHTMLHeader(boundary, title, mime_type, - *mhtml_data->MutableData()); - for (const auto& resource : resources) { - MHTMLArchive::GenerateMHTMLPart(boundary, String(), encoding_policy, - resource, *mhtml_data->MutableData()); - } - MHTMLArchive::GenerateMHTMLFooterForTesting(boundary, - *mhtml_data->MutableData()); - - // Validate the generated MHTML. - MHTMLParser parser( - SharedBuffer::Create(mhtml_data->data(), mhtml_data->length())); - EXPECT_FALSE(parser.ParseArchive().IsEmpty()) - << "Generated MHTML is malformed"; - - return mhtml_data; - } - - PassRefPtr<RawData> Serialize(const char* title, - const char* mime, - MHTMLArchive::EncodingPolicy encoding_policy) { - return GenerateMHTMLData(resources_, encoding_policy, title, mime); - } - - private: - PassRefPtr<SharedBuffer> ReadFile(const char* file_name) { - String file_path = file_path_ + file_name; - return testing::ReadFromFile(file_path); - } - - String file_path_; - Vector<SerializedResource> resources_; - FrameTestHelpers::WebViewHelper helper_; -}; - -// Checks that the domain is set to the actual MHTML file, not the URL it was -// generated from. -TEST_F(MHTMLTest, CheckDomain) { - const char kFileURL[] = "file:///simple_test.mht"; - - // Register the mocked frame and load it. - WebURL url = ToKURL(kFileURL); - RegisterMockedURLLoad(kFileURL, "simple_test.mht"); - LoadURLInTopFrame(url); - ASSERT_TRUE(GetPage()); - LocalFrame* frame = ToLocalFrame(GetPage()->MainFrame()); - ASSERT_TRUE(frame); - Document* document = frame->GetDocument(); - ASSERT_TRUE(document); - - EXPECT_STREQ(kFileURL, frame->DomWindow()->location()->href().Ascii().data()); - - SecurityOrigin* origin = document->GetSecurityOrigin(); - EXPECT_STRNE("localhost", origin->Domain().Ascii().data()); -} - -TEST_F(MHTMLTest, TestMHTMLEncoding) { - AddTestResources(); - RefPtr<RawData> data = Serialize("Test Serialization", "text/html", - MHTMLArchive::kUseDefaultEncoding); - - // Read the MHTML data line per line and do some pseudo-parsing to make sure - // the right encoding is used for the different sections. - LineReader line_reader(std::string(data->data(), data->length())); - int section_checked_count = 0; - const char* expected_encoding = 0; - std::string line; - while (line_reader.GetNextLine(&line)) { - if (line.compare(0, 13, "Content-Type:") == 0) { - ASSERT_FALSE(expected_encoding); - if (line.find("multipart/related;") != std::string::npos) { - // Skip this one, it's part of the MHTML header. - continue; - } - if (line.find("text/") != std::string::npos) - expected_encoding = "quoted-printable"; - else if (line.find("image/") != std::string::npos) - expected_encoding = "base64"; - else - FAIL() << "Unexpected Content-Type: " << line; - continue; - } - if (line.compare(0, 26, "Content-Transfer-Encoding:") == 0) { - ASSERT_TRUE(expected_encoding); - EXPECT_NE(line.find(expected_encoding), std::string::npos); - expected_encoding = 0; - section_checked_count++; - } - } - EXPECT_EQ(12, section_checked_count); -} - -TEST_F(MHTMLTest, MHTMLFromScheme) { - AddTestResources(); - RefPtr<RawData> raw_data = Serialize("Test Serialization", "text/html", - MHTMLArchive::kUseDefaultEncoding); - - RefPtr<SharedBuffer> data = - SharedBuffer::Create(raw_data->data(), raw_data->length()); - KURL http_url = ToKURL("http://www.example.com"); - KURL content_url = ToKURL("content://foo"); - KURL file_url = ToKURL("file://foo"); - KURL special_scheme_url = ToKURL("fooscheme://bar"); - - // MHTMLArchives can only be initialized from local schemes, http/https - // schemes, and content scheme(Android specific). - EXPECT_NE(nullptr, MHTMLArchive::Create(http_url, data.Get())); -#if OS(ANDROID) - EXPECT_NE(nullptr, MHTMLArchive::Create(content_url, data.Get())); -#else - EXPECT_EQ(nullptr, MHTMLArchive::Create(content_url, data.Get())); -#endif - EXPECT_NE(nullptr, MHTMLArchive::Create(file_url, data.Get())); - EXPECT_EQ(nullptr, MHTMLArchive::Create(special_scheme_url, data.Get())); - SchemeRegistry::RegisterURLSchemeAsLocal("fooscheme"); - EXPECT_NE(nullptr, MHTMLArchive::Create(special_scheme_url, data.Get())); -} - -// Checks that full sandboxing protection has been turned on. -TEST_F(MHTMLTest, EnforceSandboxFlags) { - const char kURL[] = "http://www.example.com"; - - // Register the mocked frame and load it. - RegisterMockedURLLoad(kURL, "page_with_javascript.mht"); - LoadURLInTopFrame(ToKURL(kURL)); - ASSERT_TRUE(GetPage()); - LocalFrame* frame = ToLocalFrame(GetPage()->MainFrame()); - ASSERT_TRUE(frame); - Document* document = frame->GetDocument(); - ASSERT_TRUE(document); - - // Full sandboxing with the exception to new top-level windows should be - // turned on. - EXPECT_EQ(kSandboxAll & ~(kSandboxPopups | - kSandboxPropagatesToAuxiliaryBrowsingContexts), - document->GetSandboxFlags()); - - // MHTML document should be loaded into unique origin. - EXPECT_TRUE(document->GetSecurityOrigin()->IsUnique()); - // Script execution should be disabled. - EXPECT_FALSE(document->CanExecuteScripts(kNotAboutToExecuteScript)); - - // The element to be created by the script is not there. - EXPECT_FALSE(document->getElementById("mySpan")); -} - -TEST_F(MHTMLTest, ShadowDom) { - const char kURL[] = "http://www.example.com"; - - // Register the mocked frame and load it. - RegisterMockedURLLoad(kURL, "shadow.mht"); - LoadURLInTopFrame(ToKURL(kURL)); - ASSERT_TRUE(GetPage()); - LocalFrame* frame = ToLocalFrame(GetPage()->MainFrame()); - ASSERT_TRUE(frame); - Document* document = frame->GetDocument(); - ASSERT_TRUE(document); - - EXPECT_TRUE(IsShadowHost(document->getElementById("h1"))); - EXPECT_TRUE(IsShadowHost(document->getElementById("h2"))); - // The nested shadow DOM tree is created. - EXPECT_TRUE(IsShadowHost(document->getElementById("h2") - ->Shadow() - ->OldestShadowRoot() - .getElementById("h3"))); - - EXPECT_TRUE(IsShadowHost(document->getElementById("h4"))); - // The static element in the shadow dom template is found. - EXPECT_TRUE(document->getElementById("h4") - ->Shadow() - ->OldestShadowRoot() - .getElementById("s1")); - // The element to be created by the script in the shadow dom template is - // not found because the script is blocked. - EXPECT_FALSE(document->getElementById("h4") - ->Shadow() - ->OldestShadowRoot() - .getElementById("s2")); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/web/tests/PrerenderingTest.cpp b/third_party/WebKit/Source/web/tests/PrerenderingTest.cpp deleted file mode 100644 index 87551347..0000000 --- a/third_party/WebKit/Source/web/tests/PrerenderingTest.cpp +++ /dev/null
@@ -1,477 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <functional> -#include <list> -#include <memory> -#include "core/dom/NodeTraversal.h" -#include "core/frame/FrameTestHelpers.h" -#include "core/frame/WebLocalFrameBase.h" -#include "platform/testing/URLTestHelpers.h" -#include "platform/testing/UnitTestHelpers.h" -#include "platform/wtf/PtrUtil.h" -#include "public/platform/Platform.h" -#include "public/platform/WebCache.h" -#include "public/platform/WebPrerender.h" -#include "public/platform/WebPrerenderingSupport.h" -#include "public/platform/WebString.h" -#include "public/platform/WebURLLoaderMockFactory.h" -#include "public/web/WebFrame.h" -#include "public/web/WebPrerendererClient.h" -#include "public/web/WebScriptSource.h" -#include "public/web/WebView.h" -#include "public/web/WebViewClient.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace blink { - -namespace { - -WebURL ToWebURL(const char* url) { - return WebURL(blink::URLTestHelpers::ToKURL(url)); -} - -class TestPrerendererClient : public WebPrerendererClient { - public: - TestPrerendererClient() {} - virtual ~TestPrerendererClient() {} - - void SetExtraDataForNextPrerender(WebPrerender::ExtraData* extra_data) { - DCHECK(!extra_data_); - extra_data_ = WTF::WrapUnique(extra_data); - } - - WebPrerender ReleaseWebPrerender() { - DCHECK(!web_prerenders_.empty()); - WebPrerender retval(web_prerenders_.front()); - web_prerenders_.pop_front(); - return retval; - } - - bool empty() const { return web_prerenders_.empty(); } - - void Clear() { web_prerenders_.clear(); } - - private: - // From WebPrerendererClient: - void WillAddPrerender(WebPrerender* prerender) override { - prerender->SetExtraData(extra_data_.release()); - - DCHECK(!prerender->IsNull()); - web_prerenders_.push_back(*prerender); - } - - bool IsPrefetchOnly() override { return false; } - - std::unique_ptr<WebPrerender::ExtraData> extra_data_; - std::list<WebPrerender> web_prerenders_; -}; - -class TestPrerenderingSupport : public WebPrerenderingSupport { - public: - TestPrerenderingSupport() { Initialize(this); } - - ~TestPrerenderingSupport() override { Shutdown(); } - - void Clear() { - added_prerenders_.clear(); - canceled_prerenders_.clear(); - abandoned_prerenders_.clear(); - } - - size_t TotalCount() const { - return added_prerenders_.size() + canceled_prerenders_.size() + - abandoned_prerenders_.size(); - } - - size_t AddCount(const WebPrerender& prerender) const { - return std::count_if(added_prerenders_.begin(), added_prerenders_.end(), - [&prerender](const WebPrerender& other) { - return other.ToPrerender() == - prerender.ToPrerender(); - }); - } - - size_t CancelCount(const WebPrerender& prerender) const { - return std::count_if( - canceled_prerenders_.begin(), canceled_prerenders_.end(), - [&prerender](const WebPrerender& other) { - return other.ToPrerender() == prerender.ToPrerender(); - }); - } - - size_t AbandonCount(const WebPrerender& prerender) const { - return std::count_if( - abandoned_prerenders_.begin(), abandoned_prerenders_.end(), - [&prerender](const WebPrerender& other) { - return other.ToPrerender() == prerender.ToPrerender(); - }); - } - - private: - // From WebPrerenderingSupport: - void Add(const WebPrerender& prerender) override { - added_prerenders_.push_back(prerender); - } - - void Cancel(const WebPrerender& prerender) override { - canceled_prerenders_.push_back(prerender); - } - - void Abandon(const WebPrerender& prerender) override { - abandoned_prerenders_.push_back(prerender); - } - - void PrefetchFinished() override {} - - Vector<WebPrerender> added_prerenders_; - Vector<WebPrerender> canceled_prerenders_; - Vector<WebPrerender> abandoned_prerenders_; -}; - -class PrerenderingTest : public ::testing::Test { - public: - ~PrerenderingTest() override { - Platform::Current() - ->GetURLLoaderMockFactory() - ->UnregisterAllURLsAndClearMemoryCache(); - } - - void Initialize(const char* base_url, const char* file_name) { - URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url), blink::testing::WebTestDataPath(), - WebString::FromUTF8(file_name)); - web_view_helper_.Initialize(); - web_view_helper_.WebView()->SetPrerendererClient(&prerenderer_client_); - - FrameTestHelpers::LoadFrame(web_view_helper_.WebView()->MainFrameImpl(), - std::string(base_url) + file_name); - } - - void NavigateAway() { - FrameTestHelpers::LoadFrame(web_view_helper_.WebView()->MainFrameImpl(), - "about:blank"); - } - - void Close() { - web_view_helper_.LocalMainFrame()->CollectGarbage(); - web_view_helper_.Reset(); - - WebCache::Clear(); - } - - Element& Console() { - Document* document = - web_view_helper_.LocalMainFrame()->GetFrame()->GetDocument(); - Element* console = document->getElementById("console"); - DCHECK(isHTMLUListElement(console)); - return *console; - } - - unsigned ConsoleLength() { return Console().CountChildren() - 1; } - - WebString ConsoleAt(unsigned i) { - DCHECK_GT(ConsoleLength(), i); - - Node* item = NodeTraversal::ChildAt(Console(), 1 + i); - - DCHECK(item); - DCHECK(isHTMLLIElement(item)); - DCHECK(item->hasChildren()); - - return item->textContent(); - } - - void ExecuteScript(const char* code) { - web_view_helper_.LocalMainFrame()->ExecuteScript( - WebScriptSource(WebString::FromUTF8(code))); - } - - TestPrerenderingSupport* PrerenderingSupport() { - return &prerendering_support_; - } - - TestPrerendererClient* PrerendererClient() { return &prerenderer_client_; } - - private: - TestPrerenderingSupport prerendering_support_; - TestPrerendererClient prerenderer_client_; - - FrameTestHelpers::WebViewHelper web_view_helper_; -}; - -} // namespace - -TEST_F(PrerenderingTest, SinglePrerender) { - Initialize("http://www.foo.com/", "prerender/single_prerender.html"); - - WebPrerender web_prerender = PrerendererClient()->ReleaseWebPrerender(); - EXPECT_FALSE(web_prerender.IsNull()); - EXPECT_EQ(ToWebURL("http://prerender.com/"), web_prerender.Url()); - EXPECT_EQ(kPrerenderRelTypePrerender, web_prerender.RelTypes()); - - EXPECT_EQ(1u, PrerenderingSupport()->AddCount(web_prerender)); - EXPECT_EQ(1u, PrerenderingSupport()->TotalCount()); - - web_prerender.DidStartPrerender(); - EXPECT_EQ(1u, ConsoleLength()); - EXPECT_EQ("webkitprerenderstart", ConsoleAt(0)); - - web_prerender.DidSendDOMContentLoadedForPrerender(); - EXPECT_EQ(2u, ConsoleLength()); - EXPECT_EQ("webkitprerenderdomcontentloaded", ConsoleAt(1)); - - web_prerender.DidSendLoadForPrerender(); - EXPECT_EQ(3u, ConsoleLength()); - EXPECT_EQ("webkitprerenderload", ConsoleAt(2)); - - web_prerender.DidStopPrerender(); - EXPECT_EQ(4u, ConsoleLength()); - EXPECT_EQ("webkitprerenderstop", ConsoleAt(3)); -} - -TEST_F(PrerenderingTest, CancelPrerender) { - Initialize("http://www.foo.com/", "prerender/single_prerender.html"); - - WebPrerender web_prerender = PrerendererClient()->ReleaseWebPrerender(); - EXPECT_FALSE(web_prerender.IsNull()); - - EXPECT_EQ(1u, PrerenderingSupport()->AddCount(web_prerender)); - EXPECT_EQ(1u, PrerenderingSupport()->TotalCount()); - - ExecuteScript("removePrerender()"); - - EXPECT_EQ(1u, PrerenderingSupport()->CancelCount(web_prerender)); - EXPECT_EQ(2u, PrerenderingSupport()->TotalCount()); -} - -TEST_F(PrerenderingTest, AbandonPrerender) { - Initialize("http://www.foo.com/", "prerender/single_prerender.html"); - - WebPrerender web_prerender = PrerendererClient()->ReleaseWebPrerender(); - EXPECT_FALSE(web_prerender.IsNull()); - - EXPECT_EQ(1u, PrerenderingSupport()->AddCount(web_prerender)); - EXPECT_EQ(1u, PrerenderingSupport()->TotalCount()); - - NavigateAway(); - - EXPECT_EQ(1u, PrerenderingSupport()->AbandonCount(web_prerender)); - EXPECT_EQ(2u, PrerenderingSupport()->TotalCount()); - - // Check that the prerender does not emit an extra cancel when - // garbage-collecting everything. - Close(); - - EXPECT_EQ(2u, PrerenderingSupport()->TotalCount()); -} - -TEST_F(PrerenderingTest, ExtraData) { - class TestExtraData : public WebPrerender::ExtraData { - public: - explicit TestExtraData(bool* alive) : alive_(alive) { *alive = true; } - - ~TestExtraData() override { *alive_ = false; } - - private: - bool* alive_; - }; - - bool alive = false; - { - PrerendererClient()->SetExtraDataForNextPrerender( - new TestExtraData(&alive)); - Initialize("http://www.foo.com/", "prerender/single_prerender.html"); - EXPECT_TRUE(alive); - - WebPrerender web_prerender = PrerendererClient()->ReleaseWebPrerender(); - - ExecuteScript("removePrerender()"); - Close(); - PrerenderingSupport()->Clear(); - } - EXPECT_FALSE(alive); -} - -TEST_F(PrerenderingTest, TwoPrerenders) { - Initialize("http://www.foo.com/", "prerender/multiple_prerenders.html"); - - WebPrerender first_prerender = PrerendererClient()->ReleaseWebPrerender(); - EXPECT_FALSE(first_prerender.IsNull()); - EXPECT_EQ(ToWebURL("http://first-prerender.com/"), first_prerender.Url()); - - WebPrerender second_prerender = PrerendererClient()->ReleaseWebPrerender(); - EXPECT_FALSE(first_prerender.IsNull()); - EXPECT_EQ(ToWebURL("http://second-prerender.com/"), second_prerender.Url()); - - EXPECT_EQ(1u, PrerenderingSupport()->AddCount(first_prerender)); - EXPECT_EQ(1u, PrerenderingSupport()->AddCount(second_prerender)); - EXPECT_EQ(2u, PrerenderingSupport()->TotalCount()); - - first_prerender.DidStartPrerender(); - EXPECT_EQ(1u, ConsoleLength()); - EXPECT_EQ("first_webkitprerenderstart", ConsoleAt(0)); - - second_prerender.DidStartPrerender(); - EXPECT_EQ(2u, ConsoleLength()); - EXPECT_EQ("second_webkitprerenderstart", ConsoleAt(1)); -} - -TEST_F(PrerenderingTest, TwoPrerendersRemovingFirstThenNavigating) { - Initialize("http://www.foo.com/", "prerender/multiple_prerenders.html"); - - WebPrerender first_prerender = PrerendererClient()->ReleaseWebPrerender(); - WebPrerender second_prerender = PrerendererClient()->ReleaseWebPrerender(); - - EXPECT_EQ(1u, PrerenderingSupport()->AddCount(first_prerender)); - EXPECT_EQ(1u, PrerenderingSupport()->AddCount(second_prerender)); - EXPECT_EQ(2u, PrerenderingSupport()->TotalCount()); - - ExecuteScript("removeFirstPrerender()"); - - EXPECT_EQ(1u, PrerenderingSupport()->CancelCount(first_prerender)); - EXPECT_EQ(3u, PrerenderingSupport()->TotalCount()); - - NavigateAway(); - - EXPECT_EQ(1u, PrerenderingSupport()->AbandonCount(second_prerender)); - EXPECT_EQ(4u, PrerenderingSupport()->TotalCount()); -} - -TEST_F(PrerenderingTest, TwoPrerendersAddingThird) { - Initialize("http://www.foo.com/", "prerender/multiple_prerenders.html"); - - WebPrerender first_prerender = PrerendererClient()->ReleaseWebPrerender(); - WebPrerender second_prerender = PrerendererClient()->ReleaseWebPrerender(); - - EXPECT_EQ(1u, PrerenderingSupport()->AddCount(first_prerender)); - EXPECT_EQ(1u, PrerenderingSupport()->AddCount(second_prerender)); - EXPECT_EQ(2u, PrerenderingSupport()->TotalCount()); - - ExecuteScript("addThirdPrerender()"); - - WebPrerender third_prerender = PrerendererClient()->ReleaseWebPrerender(); - EXPECT_EQ(1u, PrerenderingSupport()->AddCount(third_prerender)); - EXPECT_EQ(3u, PrerenderingSupport()->TotalCount()); -} - -TEST_F(PrerenderingTest, ShortLivedClient) { - Initialize("http://www.foo.com/", "prerender/single_prerender.html"); - - WebPrerender web_prerender = PrerendererClient()->ReleaseWebPrerender(); - EXPECT_FALSE(web_prerender.IsNull()); - - EXPECT_EQ(1u, PrerenderingSupport()->AddCount(web_prerender)); - EXPECT_EQ(1u, PrerenderingSupport()->TotalCount()); - - NavigateAway(); - Close(); - - // This test passes if this next line doesn't crash. - web_prerender.DidStartPrerender(); -} - -TEST_F(PrerenderingTest, FastRemoveElement) { - Initialize("http://www.foo.com/", "prerender/single_prerender.html"); - - WebPrerender web_prerender = PrerendererClient()->ReleaseWebPrerender(); - EXPECT_FALSE(web_prerender.IsNull()); - - EXPECT_EQ(1u, PrerenderingSupport()->AddCount(web_prerender)); - EXPECT_EQ(1u, PrerenderingSupport()->TotalCount()); - - // Race removing & starting the prerender against each other, as if the - // element was removed very quickly. - ExecuteScript("removePrerender()"); - EXPECT_FALSE(web_prerender.IsNull()); - web_prerender.DidStartPrerender(); - - // The page should be totally disconnected from the Prerender at this point, - // so the console should not have updated. - EXPECT_EQ(0u, ConsoleLength()); -} - -TEST_F(PrerenderingTest, MutateTarget) { - Initialize("http://www.foo.com/", "prerender/single_prerender.html"); - - WebPrerender web_prerender = PrerendererClient()->ReleaseWebPrerender(); - EXPECT_FALSE(web_prerender.IsNull()); - EXPECT_EQ(ToWebURL("http://prerender.com/"), web_prerender.Url()); - - EXPECT_EQ(1u, PrerenderingSupport()->AddCount(web_prerender)); - EXPECT_EQ(0u, PrerenderingSupport()->CancelCount(web_prerender)); - EXPECT_EQ(1u, PrerenderingSupport()->TotalCount()); - - // Change the href of this prerender, make sure this is treated as a remove - // and add. - ExecuteScript("mutateTarget()"); - EXPECT_EQ(1u, PrerenderingSupport()->CancelCount(web_prerender)); - - WebPrerender mutated_prerender = PrerendererClient()->ReleaseWebPrerender(); - EXPECT_EQ(ToWebURL("http://mutated.com/"), mutated_prerender.Url()); - EXPECT_EQ(1u, PrerenderingSupport()->AddCount(web_prerender)); - EXPECT_EQ(1u, PrerenderingSupport()->AddCount(mutated_prerender)); - EXPECT_EQ(3u, PrerenderingSupport()->TotalCount()); -} - -TEST_F(PrerenderingTest, MutateRel) { - Initialize("http://www.foo.com/", "prerender/single_prerender.html"); - - WebPrerender web_prerender = PrerendererClient()->ReleaseWebPrerender(); - EXPECT_FALSE(web_prerender.IsNull()); - EXPECT_EQ(ToWebURL("http://prerender.com/"), web_prerender.Url()); - - EXPECT_EQ(1u, PrerenderingSupport()->AddCount(web_prerender)); - EXPECT_EQ(0u, PrerenderingSupport()->CancelCount(web_prerender)); - EXPECT_EQ(1u, PrerenderingSupport()->TotalCount()); - - // Change the rel of this prerender, make sure this is treated as a remove. - ExecuteScript("mutateRel()"); - EXPECT_EQ(1u, PrerenderingSupport()->CancelCount(web_prerender)); - EXPECT_EQ(2u, PrerenderingSupport()->TotalCount()); -} - -TEST_F(PrerenderingTest, RelNext) { - Initialize("http://www.foo.com/", "prerender/rel_next_prerender.html"); - - WebPrerender rel_next_only = PrerendererClient()->ReleaseWebPrerender(); - EXPECT_EQ(ToWebURL("http://rel-next-only.com/"), rel_next_only.Url()); - EXPECT_EQ(kPrerenderRelTypeNext, rel_next_only.RelTypes()); - - WebPrerender rel_next_and_prerender = - PrerendererClient()->ReleaseWebPrerender(); - EXPECT_EQ(ToWebURL("http://rel-next-and-prerender.com/"), - rel_next_and_prerender.Url()); - EXPECT_EQ( - static_cast<unsigned>(kPrerenderRelTypeNext | kPrerenderRelTypePrerender), - rel_next_and_prerender.RelTypes()); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/web/tests/ProgrammaticScrollTest.cpp b/third_party/WebKit/Source/web/tests/ProgrammaticScrollTest.cpp deleted file mode 100644 index aa35f4f7..0000000 --- a/third_party/WebKit/Source/web/tests/ProgrammaticScrollTest.cpp +++ /dev/null
@@ -1,103 +0,0 @@ -#include "core/exported/WebViewBase.h" -#include "core/frame/FrameTestHelpers.h" -#include "core/frame/LocalFrameView.h" -#include "core/frame/WebLocalFrameBase.h" -#include "core/loader/DocumentLoader.h" -#include "core/loader/FrameLoader.h" -#include "platform/testing/URLTestHelpers.h" -#include "platform/testing/UnitTestHelpers.h" -#include "public/platform/Platform.h" -#include "public/platform/WebInputEvent.h" -#include "public/platform/WebURLLoaderMockFactory.h" -#include "public/web/WebFrame.h" -#include "public/web/WebFrameClient.h" -#include "public/web/WebHistoryItem.h" -#include "public/web/WebScriptSource.h" -#include "public/web/WebSettings.h" -#include "public/web/WebView.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace blink { - -class ProgrammaticScrollTest : public ::testing::Test { - public: - ProgrammaticScrollTest() : base_url_("http://www.test.com/") {} - - void TearDown() override { - Platform::Current() - ->GetURLLoaderMockFactory() - ->UnregisterAllURLsAndClearMemoryCache(); - } - - protected: - void RegisterMockedHttpURLLoad(const std::string& file_name) { - URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url_), testing::WebTestDataPath(), - WebString::FromUTF8(file_name)); - } - - std::string base_url_; -}; - -TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithScale) { - RegisterMockedHttpURLLoad("long_scroll.html"); - - FrameTestHelpers::WebViewHelper web_view_helper; - WebViewBase* web_view = - web_view_helper.InitializeAndLoad(base_url_ + "long_scroll.html"); - web_view->Resize(WebSize(1000, 1000)); - web_view->UpdateAllLifecyclePhases(); - - FrameLoader& loader = web_view->MainFrameImpl()->GetFrame()->Loader(); - loader.GetDocumentLoader()->SetLoadType(kFrameLoadTypeBackForward); - - web_view->SetPageScaleFactor(3.0f); - web_view->MainFrameImpl()->SetScrollOffset(WebSize(0, 500)); - loader.GetDocumentLoader()->GetInitialScrollState().was_scrolled_by_user = - false; - loader.GetDocumentLoader()->GetHistoryItem()->SetPageScaleFactor(2); - loader.GetDocumentLoader()->GetHistoryItem()->SetScrollOffset( - ScrollOffset(0, 200)); - - // Flip back the wasScrolledByUser flag which was set to true by - // setPageScaleFactor because otherwise - // FrameLoader::restoreScrollPositionAndViewState does nothing. - loader.GetDocumentLoader()->GetInitialScrollState().was_scrolled_by_user = - false; - loader.RestoreScrollPositionAndViewState(); - - // Expect that both scroll and scale were restored. - EXPECT_EQ(2.0f, web_view->PageScaleFactor()); - EXPECT_EQ(200, web_view->MainFrameImpl()->GetScrollOffset().height); -} - -TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithoutScale) { - RegisterMockedHttpURLLoad("long_scroll.html"); - - FrameTestHelpers::WebViewHelper web_view_helper; - WebViewBase* web_view = - web_view_helper.InitializeAndLoad(base_url_ + "long_scroll.html"); - web_view->Resize(WebSize(1000, 1000)); - web_view->UpdateAllLifecyclePhases(); - - FrameLoader& loader = web_view->MainFrameImpl()->GetFrame()->Loader(); - loader.GetDocumentLoader()->SetLoadType(kFrameLoadTypeBackForward); - - web_view->SetPageScaleFactor(3.0f); - web_view->MainFrameImpl()->SetScrollOffset(WebSize(0, 500)); - loader.GetDocumentLoader()->GetInitialScrollState().was_scrolled_by_user = - false; - loader.GetDocumentLoader()->GetHistoryItem()->SetPageScaleFactor(0); - loader.GetDocumentLoader()->GetHistoryItem()->SetScrollOffset( - ScrollOffset(0, 400)); - - // FrameLoader::restoreScrollPositionAndViewState flows differently if scale - // is zero. - loader.RestoreScrollPositionAndViewState(); - - // Expect that only the scroll position was restored. - EXPECT_EQ(3.0f, web_view->PageScaleFactor()); - EXPECT_EQ(400, web_view->MainFrameImpl()->GetScrollOffset().height); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/web/tests/WebFrameSerializerSanitizationTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameSerializerSanitizationTest.cpp index 4c5863f..8d34c4f 100644 --- a/third_party/WebKit/Source/web/tests/WebFrameSerializerSanitizationTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebFrameSerializerSanitizationTest.cpp
@@ -178,7 +178,7 @@ const String& file_path, const String& mime_type = "image/png") { URLTestHelpers::RegisterMockedURLLoad( - url, testing::WebTestDataPath(file_path.Utf8().data()), mime_type); + url, testing::CoreTestDataPath(file_path.Utf8().data()), mime_type); } WebViewBase* WebView() { return helper_.WebView(); }
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp index e65cf93..ee41798d 100644 --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -232,7 +232,7 @@ void RegisterMockedURLLoadFromBase(const std::string& base_url, const std::string& file_name) { URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url), testing::WebTestDataPath(), + WebString::FromUTF8(base_url), testing::CoreTestDataPath(), WebString::FromUTF8(file_name)); } @@ -248,13 +248,13 @@ std::string full_string = base_url_ + file_name; URLTestHelpers::RegisterMockedURLLoadWithCustomResponse( ToKURL(full_string), - testing::WebTestDataPath(WebString::FromUTF8(file_name)), response); + testing::CoreTestDataPath(WebString::FromUTF8(file_name)), response); } void RegisterMockedHttpURLLoadWithMimeType(const std::string& file_name, const std::string& mime_type) { URLTestHelpers::RegisterMockedURLLoadFromBase( - WebString::FromUTF8(base_url_), testing::WebTestDataPath(), + WebString::FromUTF8(base_url_), testing::CoreTestDataPath(), WebString::FromUTF8(file_name), WebString::FromUTF8(mime_type)); } @@ -7141,7 +7141,7 @@ } TEST_P(ParameterizedWebFrameTest, FirstPartyForCookiesForRedirect) { - String file_path = testing::WebTestDataPath("first_party.html"); + String file_path = testing::CoreTestDataPath("first_party.html"); WebURL test_url(ToKURL("http://internal.test/first_party_redirect.html")); char redirect[] = "http://internal.test/first_party.html"; @@ -10414,7 +10414,7 @@ std::string url = base_url_ + "image-with-data-url.html"; RegisterMockedURLLoadFromBase(base_url_, "image-with-data-url.html"); URLTestHelpers::RegisterMockedURLLoad( - ToKURL("http://test"), testing::WebTestDataPath("white-1x1.png")); + ToKURL("http://test"), testing::CoreTestDataPath("white-1x1.png")); FrameTestHelpers::WebViewHelper helper; SaveImageFromDataURLWebFrameClient client; @@ -10571,7 +10571,7 @@ std::string redirect_url = base_url_ + "foo.html"; URLTestHelpers::RegisterMockedURLLoad(ToKURL(redirect_url), - testing::WebTestDataPath("foo.html")); + testing::CoreTestDataPath("foo.html")); WebURLRequest request(ToKURL("javascript:location='" + redirect_url + "'")); helper.LocalMainFrame()->LoadRequest(request); @@ -10704,7 +10704,7 @@ TEST_F(WebFrameTest, ImageDocumentDecodeError) { std::string url = base_url_ + "not_an_image.ico"; URLTestHelpers::RegisterMockedURLLoad( - ToKURL(url), testing::WebTestDataPath("not_an_image.ico"), + ToKURL(url), testing::CoreTestDataPath("not_an_image.ico"), "image/x-icon"); MultipleDataChunkDelegate delegate; Platform::Current()->GetURLLoaderMockFactory()->SetLoaderDelegate(&delegate); @@ -11762,7 +11762,7 @@ RegisterMockedHttpURLLoad("single_iframe.html"); URLTestHelpers::RegisterMockedURLLoad( ToKURL(base_url_ + "visible_iframe.html"), - testing::WebTestDataPath("frame_with_frame.html")); + testing::CoreTestDataPath("frame_with_frame.html")); RegisterMockedHttpURLLoad("parent_detaching_frame.html"); FrameTestHelpers::WebViewHelper web_view_helper;
diff --git a/third_party/WebKit/Source/web/tests/scheduler/ActiveConnectionThrottlingTest.cpp b/third_party/WebKit/Source/web/tests/scheduler/ActiveConnectionThrottlingTest.cpp deleted file mode 100644 index fa763ade..0000000 --- a/third_party/WebKit/Source/web/tests/scheduler/ActiveConnectionThrottlingTest.cpp +++ /dev/null
@@ -1,62 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code if governed by a BSD-style license that can be -// found in LICENSE file. - -#include "core/exported/WebViewBase.h" -#include "core/frame/WebLocalFrameBase.h" -#include "core/testing/sim/SimRequest.h" -#include "core/testing/sim/SimTest.h" -#include "modules/peerconnection/testing/TestingPlatformSupportWithWebRTC.h" -#include "platform/scheduler/renderer/web_view_scheduler.h" -#include "platform/testing/TestingPlatformSupport.h" -#include "platform/wtf/PtrUtil.h" -#include "public/web/WebScriptSource.h" -#include "testing/gtest/include/gtest/gtest.h" - -using testing::_; - -namespace blink { - -class ActiveConnectionThrottlingTest : public SimTest {}; - -TEST_F(ActiveConnectionThrottlingTest, WebSocketStopsThrottling) { - SimRequest main_resource("https://example.com/", "text/html"); - - LoadURL("https://example.com/"); - - EXPECT_FALSE(WebView().Scheduler()->HasActiveConnectionForTest()); - - main_resource.Complete( - "(<script>" - " var socket = new WebSocket(\"ws://www.example.com/websocket\");" - "</script>)"); - - EXPECT_TRUE(WebView().Scheduler()->HasActiveConnectionForTest()); - - MainFrame().ExecuteScript(WebString("socket.close();")); - - EXPECT_FALSE(WebView().Scheduler()->HasActiveConnectionForTest()); -} - -TEST_F(ActiveConnectionThrottlingTest, WebRTCStopsThrottling) { - ScopedTestingPlatformSupport<TestingPlatformSupportWithWebRTC> platform; - - SimRequest main_resource("https://example.com/", "text/html"); - - LoadURL("https://example.com/"); - - EXPECT_FALSE(WebView().Scheduler()->HasActiveConnectionForTest()); - - main_resource.Complete( - "(<script>" - " var data_channel = new RTCPeerConnection();" - "</script>)"); - - EXPECT_TRUE(WebView().Scheduler()->HasActiveConnectionForTest()); - - MainFrame().ExecuteScript(WebString("data_channel.close();")); - - EXPECT_FALSE(WebView().Scheduler()->HasActiveConnectionForTest()); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/web/tests/scheduler/FrameThrottlingTest.cpp b/third_party/WebKit/Source/web/tests/scheduler/FrameThrottlingTest.cpp deleted file mode 100644 index 3fc4ec4..0000000 --- a/third_party/WebKit/Source/web/tests/scheduler/FrameThrottlingTest.cpp +++ /dev/null
@@ -1,1234 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "bindings/core/v8/ScriptController.h" -#include "bindings/core/v8/ScriptSourceCode.h" -#include "core/dom/Document.h" -#include "core/dom/Element.h" -#include "core/exported/WebRemoteFrameImpl.h" -#include "core/frame/LocalFrame.h" -#include "core/frame/LocalFrameView.h" -#include "core/frame/WebLocalFrameBase.h" -#include "core/html/HTMLIFrameElement.h" -#include "core/layout/api/LayoutViewItem.h" -#include "core/layout/compositing/CompositedLayerMapping.h" -#include "core/page/FocusController.h" -#include "core/page/Page.h" -#include "core/paint/PaintLayer.h" -#include "core/testing/sim/SimCompositor.h" -#include "core/testing/sim/SimDisplayItemList.h" -#include "core/testing/sim/SimRequest.h" -#include "core/testing/sim/SimTest.h" -#include "platform/graphics/paint/TransformPaintPropertyNode.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" -#include "platform/testing/URLTestHelpers.h" -#include "platform/testing/UnitTestHelpers.h" -#include "public/platform/WebDisplayItemList.h" -#include "public/platform/WebLayer.h" -#include "public/web/WebFrameContentDumper.h" -#include "public/web/WebHitTestResult.h" -#include "public/web/WebSettings.h" -#include "testing/gtest/include/gtest/gtest.h" - -using testing::_; - -namespace blink { - -using namespace HTMLNames; - -// NOTE: This test uses <iframe sandbox> to create cross origin iframes. - -namespace { - -class MockWebDisplayItemList : public WebDisplayItemList { - public: - ~MockWebDisplayItemList() override {} - - MOCK_METHOD3(AppendDrawingItem, - void(const WebRect& visual_rect, - sk_sp<const cc::PaintRecord>, - const WebRect& record_bounds)); -}; - -void PaintRecursively(GraphicsLayer* layer, WebDisplayItemList* display_items) { - if (layer->DrawsContent()) { - layer->SetNeedsDisplay(); - layer->ContentLayerDelegateForTesting()->PaintContents( - display_items, ContentLayerDelegate::kPaintDefaultBehaviorForTest); - } - for (const auto& child : layer->Children()) - PaintRecursively(child, display_items); -} - -} // namespace - -class FrameThrottlingTest : public SimTest, - public ::testing::WithParamInterface<bool>, - private ScopedRootLayerScrollingForTest { - protected: - FrameThrottlingTest() : ScopedRootLayerScrollingForTest(GetParam()) {} - - void SetUp() override { - SimTest::SetUp(); - WebView().Resize(WebSize(640, 480)); - } - - SimDisplayItemList CompositeFrame() { - SimDisplayItemList display_items = Compositor().BeginFrame(); - // Ensure intersection observer notifications get delivered. - testing::RunPendingTasks(); - return display_items; - } - - // Number of rectangles that make up the root layer's touch handler region. - size_t TouchHandlerRegionSize() { - size_t result = 0; - PaintLayer* layer = - WebView().MainFrameImpl()->GetFrame()->ContentLayoutObject()->Layer(); - GraphicsLayer* own_graphics_layer = - layer->GraphicsLayerBacking(&layer->GetLayoutObject()); - if (own_graphics_layer) { - result += - own_graphics_layer->PlatformLayer()->TouchEventHandlerRegion().size(); - } - GraphicsLayer* child_graphics_layer = layer->GraphicsLayerBacking(); - if (child_graphics_layer && child_graphics_layer != own_graphics_layer) { - result += child_graphics_layer->PlatformLayer() - ->TouchEventHandlerRegion() - .size(); - } - return result; - } -}; - -INSTANTIATE_TEST_CASE_P(All, FrameThrottlingTest, ::testing::Bool()); - -TEST_P(FrameThrottlingTest, ThrottleInvisibleFrames) { - SimRequest main_resource("https://example.com/", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe sandbox id=frame></iframe>"); - - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - auto* frame_document = frame_element->contentDocument(); - - // Initially both frames are visible. - EXPECT_FALSE(GetDocument().View()->IsHiddenForThrottling()); - EXPECT_FALSE(frame_document->View()->IsHiddenForThrottling()); - - // Moving the child fully outside the parent makes it invisible. - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - CompositeFrame(); - EXPECT_FALSE(GetDocument().View()->IsHiddenForThrottling()); - EXPECT_TRUE(frame_document->View()->IsHiddenForThrottling()); - - // A partially visible child is considered visible. - frame_element->setAttribute(styleAttr, - "transform: translate(-50px, 0px, 0px)"); - CompositeFrame(); - EXPECT_FALSE(GetDocument().View()->IsHiddenForThrottling()); - EXPECT_FALSE(frame_document->View()->IsHiddenForThrottling()); -} - -TEST_P(FrameThrottlingTest, HiddenSameOriginFramesAreNotThrottled) { - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame src=iframe.html></iframe>"); - frame_resource.Complete("<iframe id=innerFrame></iframe>"); - - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - auto* frame_document = frame_element->contentDocument(); - - HTMLIFrameElement* inner_frame_element = - toHTMLIFrameElement(frame_document->getElementById("innerFrame")); - auto* inner_frame_document = inner_frame_element->contentDocument(); - - EXPECT_FALSE(GetDocument().View()->CanThrottleRendering()); - EXPECT_FALSE(frame_document->View()->CanThrottleRendering()); - EXPECT_FALSE(inner_frame_document->View()->CanThrottleRendering()); - - // Hidden same origin frames are not throttled. - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - CompositeFrame(); - EXPECT_FALSE(GetDocument().View()->CanThrottleRendering()); - EXPECT_FALSE(frame_document->View()->CanThrottleRendering()); - EXPECT_FALSE(inner_frame_document->View()->CanThrottleRendering()); -} - -TEST_P(FrameThrottlingTest, HiddenCrossOriginFramesAreThrottled) { - // Create a document with doubly nested iframes. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame src=iframe.html></iframe>"); - frame_resource.Complete("<iframe id=innerFrame sandbox></iframe>"); - - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - auto* frame_document = frame_element->contentDocument(); - - auto* inner_frame_element = - toHTMLIFrameElement(frame_document->getElementById("innerFrame")); - auto* inner_frame_document = inner_frame_element->contentDocument(); - - EXPECT_FALSE(GetDocument().View()->CanThrottleRendering()); - EXPECT_FALSE(frame_document->View()->CanThrottleRendering()); - EXPECT_FALSE(inner_frame_document->View()->CanThrottleRendering()); - - // Hidden cross origin frames are throttled. - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - CompositeFrame(); - EXPECT_FALSE(GetDocument().View()->CanThrottleRendering()); - EXPECT_FALSE(frame_document->View()->CanThrottleRendering()); - EXPECT_TRUE(inner_frame_document->View()->CanThrottleRendering()); -} - -TEST_P(FrameThrottlingTest, HiddenCrossOriginZeroByZeroFramesAreNotThrottled) { - // Create a document with doubly nested iframes. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame src=iframe.html></iframe>"); - frame_resource.Complete( - "<iframe id=innerFrame width=0 height=0 sandbox></iframe>"); - - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - auto* frame_document = frame_element->contentDocument(); - - auto* inner_frame_element = - toHTMLIFrameElement(frame_document->getElementById("innerFrame")); - auto* inner_frame_document = inner_frame_element->contentDocument(); - - EXPECT_FALSE(GetDocument().View()->CanThrottleRendering()); - EXPECT_FALSE(frame_document->View()->CanThrottleRendering()); - EXPECT_FALSE(inner_frame_document->View()->CanThrottleRendering()); - - // The frame is not throttled because its dimensions are 0x0. - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - CompositeFrame(); - EXPECT_FALSE(GetDocument().View()->CanThrottleRendering()); - EXPECT_FALSE(frame_document->View()->CanThrottleRendering()); - EXPECT_FALSE(inner_frame_document->View()->CanThrottleRendering()); -} - -TEST_P(FrameThrottlingTest, ThrottledLifecycleUpdate) { - SimRequest main_resource("https://example.com/", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe sandbox id=frame></iframe>"); - - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - auto* frame_document = frame_element->contentDocument(); - - // Enable throttling for the child frame. - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - CompositeFrame(); - EXPECT_TRUE(frame_document->View()->CanThrottleRendering()); - EXPECT_EQ(DocumentLifecycle::kPaintClean, - frame_document->Lifecycle().GetState()); - - // Mutating the throttled frame followed by a beginFrame will not result in - // a complete lifecycle update. - // TODO(skyostil): these expectations are either wrong, or the test is - // not exercising the code correctly. PaintClean means the entire lifecycle - // ran. - frame_element->setAttribute(widthAttr, "50"); - CompositeFrame(); - EXPECT_EQ(DocumentLifecycle::kPaintClean, - frame_document->Lifecycle().GetState()); - - // A hit test will not force a complete lifecycle update. - WebView().HitTestResultAt(WebPoint(0, 0)); - EXPECT_EQ(DocumentLifecycle::kPaintClean, - frame_document->Lifecycle().GetState()); -} - -TEST_P(FrameThrottlingTest, UnthrottlingFrameSchedulesAnimation) { - SimRequest main_resource("https://example.com/", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe sandbox id=frame></iframe>"); - - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - - // First make the child hidden to enable throttling. - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - CompositeFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - EXPECT_FALSE(Compositor().NeedsBeginFrame()); - - // Then bring it back on-screen. This should schedule an animation update. - frame_element->setAttribute(styleAttr, ""); - CompositeFrame(); - EXPECT_TRUE(Compositor().NeedsBeginFrame()); -} - -TEST_P(FrameThrottlingTest, MutatingThrottledFrameDoesNotCauseAnimation) { - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); - frame_resource.Complete("<style> html { background: red; } </style>"); - - // Check that the frame initially shows up. - auto display_items1 = CompositeFrame(); - EXPECT_TRUE(display_items1.Contains(SimCanvas::kRect, "red")); - - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - - // Move the frame offscreen to throttle it. - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - CompositeFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - - // Mutating the throttled frame should not cause an animation to be scheduled. - frame_element->contentDocument()->documentElement()->setAttribute( - styleAttr, "background: green"); - EXPECT_FALSE(Compositor().NeedsBeginFrame()); - - // Move the frame back on screen to unthrottle it. - frame_element->setAttribute(styleAttr, ""); - EXPECT_TRUE(Compositor().NeedsBeginFrame()); - - // The first frame we composite after unthrottling won't contain the - // frame's new contents because unthrottling happens at the end of the - // lifecycle update. We need to do another composite to refresh the frame's - // contents. - auto display_items2 = CompositeFrame(); - EXPECT_FALSE(display_items2.Contains(SimCanvas::kRect, "green")); - EXPECT_TRUE(Compositor().NeedsBeginFrame()); - - auto display_items3 = CompositeFrame(); - EXPECT_TRUE(display_items3.Contains(SimCanvas::kRect, "green")); -} - -TEST_P(FrameThrottlingTest, SynchronousLayoutInThrottledFrame) { - // Create a hidden frame which is throttled. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); - frame_resource.Complete("<div id=div></div>"); - - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - CompositeFrame(); - - // Change the size of a div in the throttled frame. - auto* div_element = frame_element->contentDocument()->getElementById("div"); - div_element->setAttribute(styleAttr, "width: 50px"); - - // Querying the width of the div should do a synchronous layout update even - // though the frame is being throttled. - EXPECT_EQ(50, div_element->clientWidth()); -} - -TEST_P(FrameThrottlingTest, UnthrottlingTriggersRepaint) { - // Create a hidden frame which is throttled. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); - frame_resource.Complete("<style> html { background: green; } </style>"); - - // Move the frame offscreen to throttle it. - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); - CompositeFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - - // Scroll down to unthrottle the frame. The first frame we composite after - // scrolling won't contain the frame yet, but will schedule another repaint. - WebView() - .MainFrameImpl() - ->GetFrameView() - ->LayoutViewportScrollableArea() - ->SetScrollOffset(ScrollOffset(0, 480), kProgrammaticScroll); - auto display_items = CompositeFrame(); - EXPECT_FALSE(display_items.Contains(SimCanvas::kRect, "green")); - - // Now the frame contents should be visible again. - auto display_items2 = CompositeFrame(); - EXPECT_TRUE(display_items2.Contains(SimCanvas::kRect, "green")); -} - -TEST_P(FrameThrottlingTest, UnthrottlingTriggersRepaintInCompositedChild) { - // Create a hidden frame with a composited child layer. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); - frame_resource.Complete( - "<style>" - "div { " - " width: 100px;" - " height: 100px;" - " background-color: green;" - " transform: translateZ(0);" - "}" - "</style><div></div>"); - - // Move the frame offscreen to throttle it. - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); - CompositeFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - - // Scroll down to unthrottle the frame. The first frame we composite after - // scrolling won't contain the frame yet, but will schedule another repaint. - WebView() - .MainFrameImpl() - ->GetFrameView() - ->LayoutViewportScrollableArea() - ->SetScrollOffset(ScrollOffset(0, 480), kProgrammaticScroll); - auto display_items = CompositeFrame(); - EXPECT_FALSE(display_items.Contains(SimCanvas::kRect, "green")); - - // Now the composited child contents should be visible again. - auto display_items2 = CompositeFrame(); - EXPECT_TRUE(display_items2.Contains(SimCanvas::kRect, "green")); -} - -TEST_P(FrameThrottlingTest, ChangeStyleInThrottledFrame) { - // Create a hidden frame which is throttled. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); - frame_resource.Complete("<style> html { background: red; } </style>"); - - // Move the frame offscreen to throttle it. - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); - CompositeFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - - // Change the background color of the frame's contents from red to green. - frame_element->contentDocument()->body()->setAttribute(styleAttr, - "background: green"); - - // Scroll down to unthrottle the frame. - WebView() - .MainFrameImpl() - ->GetFrameView() - ->LayoutViewportScrollableArea() - ->SetScrollOffset(ScrollOffset(0, 480), kProgrammaticScroll); - auto display_items = CompositeFrame(); - EXPECT_FALSE(display_items.Contains(SimCanvas::kRect, "red")); - EXPECT_FALSE(display_items.Contains(SimCanvas::kRect, "green")); - - // Make sure the new style shows up instead of the old one. - auto display_items2 = CompositeFrame(); - EXPECT_TRUE(display_items2.Contains(SimCanvas::kRect, "green")); -} - -TEST_P(FrameThrottlingTest, ChangeOriginInThrottledFrame) { - // Create a hidden frame which is throttled. - SimRequest main_resource("http://example.com/", "text/html"); - SimRequest frame_resource("http://sub.example.com/iframe.html", "text/html"); - LoadURL("http://example.com/"); - main_resource.Complete( - "<iframe style='position: absolute; top: 10000px' id=frame " - "src=http://sub.example.com/iframe.html></iframe>"); - frame_resource.Complete(""); - - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - - CompositeFrame(); - - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - EXPECT_TRUE( - frame_element->contentDocument()->GetFrame()->IsCrossOriginSubframe()); - EXPECT_FALSE(frame_element->contentDocument() - ->View() - ->GetLayoutView() - ->NeedsPaintPropertyUpdate()); - - NonThrowableExceptionState exception_state; - - // Security policy requires setting domain on both frames. - GetDocument().setDomain(String("example.com"), exception_state); - frame_element->contentDocument()->setDomain(String("example.com"), - exception_state); - - EXPECT_FALSE( - frame_element->contentDocument()->GetFrame()->IsCrossOriginSubframe()); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); - EXPECT_TRUE(frame_element->contentDocument() - ->View() - ->GetLayoutView() - ->NeedsPaintPropertyUpdate()); -} - -TEST_P(FrameThrottlingTest, ThrottledFrameWithFocus) { - WebView().GetSettings()->SetJavaScriptEnabled(true); - WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); - RuntimeEnabledFeatures::SetCompositedSelectionUpdateEnabled(true); - - // Create a hidden frame which is throttled and has a text selection. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete( - "<iframe id=frame sandbox=allow-scripts src=iframe.html></iframe>"); - frame_resource.Complete( - "some text to select\n" - "<script>\n" - "var range = document.createRange();\n" - "range.selectNode(document.body);\n" - "window.getSelection().addRange(range);\n" - "</script>\n"); - - // Move the frame offscreen to throttle it. - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); - CompositeFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - - // Give the frame focus and do another composite. The selection in the - // compositor should be cleared because the frame is throttled. - EXPECT_FALSE(Compositor().HasSelection()); - GetDocument().GetPage()->GetFocusController().SetFocusedFrame( - frame_element->contentDocument()->GetFrame()); - GetDocument().body()->setAttribute(styleAttr, "background: green"); - CompositeFrame(); - EXPECT_FALSE(Compositor().HasSelection()); -} - -TEST_P(FrameThrottlingTest, ScrollingCoordinatorShouldSkipThrottledFrame) { - WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); - - // Create a hidden frame which is throttled. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); - frame_resource.Complete( - "<style> html { background-image: linear-gradient(red, blue); " - "background-attachment: fixed; } </style>"); - - // Move the frame offscreen to throttle it. - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); - CompositeFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - - // Change style of the frame's content to make it in VisualUpdatePending - // state. - frame_element->contentDocument()->body()->setAttribute(styleAttr, - "background: green"); - // Change root frame's layout so that the next lifecycle update will call - // ScrollingCoordinator::updateAfterCompositingChangeIfNeeded(). - GetDocument().body()->setAttribute(styleAttr, "margin: 20px"); - EXPECT_EQ(DocumentLifecycle::kVisualUpdatePending, - frame_element->contentDocument()->Lifecycle().GetState()); - - DocumentLifecycle::AllowThrottlingScope throttling_scope( - GetDocument().Lifecycle()); - // This will call ScrollingCoordinator::updateAfterCompositingChangeIfNeeded() - // and should not cause assert failure about - // isAllowedToQueryCompositingState() in the throttled frame. - GetDocument().View()->UpdateAllLifecyclePhases(); - testing::RunPendingTasks(); - EXPECT_EQ(DocumentLifecycle::kVisualUpdatePending, - frame_element->contentDocument()->Lifecycle().GetState()); - // The fixed background in the throttled sub frame should not cause main - // thread scrolling. - EXPECT_FALSE(GetDocument() - .View() - ->LayoutViewportScrollableArea() - ->ShouldScrollOnMainThread()); - - // Make the frame visible by changing its transform. This doesn't cause a - // layout, but should still unthrottle the frame. - frame_element->setAttribute(styleAttr, "transform: translateY(0px)"); - CompositeFrame(); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); - // The fixed background in the throttled sub frame should be considered. - EXPECT_TRUE(frame_element->contentDocument() - ->View() - ->LayoutViewportScrollableArea() - ->ShouldScrollOnMainThread()); - EXPECT_FALSE(GetDocument() - .View() - ->LayoutViewportScrollableArea() - ->ShouldScrollOnMainThread()); -} - -TEST_P(FrameThrottlingTest, ScrollingCoordinatorShouldSkipThrottledLayer) { - WebView().GetSettings()->SetJavaScriptEnabled(true); - WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); - WebView().GetSettings()->SetPreferCompositingToLCDTextEnabled(true); - - // Create a hidden frame which is throttled and has a touch handler inside a - // composited layer. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete( - "<iframe id=frame sandbox=allow-scripts src=iframe.html></iframe>"); - frame_resource.Complete( - "<div id=div style='transform: translateZ(0)' ontouchstart='foo()'>touch " - "handler</div>"); - - // Move the frame offscreen to throttle it. - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); - CompositeFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - - // Change style of the frame's content to make it in VisualUpdatePending - // state. - frame_element->contentDocument()->body()->setAttribute(styleAttr, - "background: green"); - // Change root frame's layout so that the next lifecycle update will call - // ScrollingCoordinator::updateAfterCompositingChangeIfNeeded(). - GetDocument().body()->setAttribute(styleAttr, "margin: 20px"); - EXPECT_EQ(DocumentLifecycle::kVisualUpdatePending, - frame_element->contentDocument()->Lifecycle().GetState()); - - DocumentLifecycle::AllowThrottlingScope throttling_scope( - GetDocument().Lifecycle()); - // This will call ScrollingCoordinator::updateAfterCompositingChangeIfNeeded() - // and should not cause assert failure about - // isAllowedToQueryCompositingState() in the throttled frame. - GetDocument().View()->UpdateAllLifecyclePhases(); - testing::RunPendingTasks(); - EXPECT_EQ(DocumentLifecycle::kVisualUpdatePending, - frame_element->contentDocument()->Lifecycle().GetState()); -} - -TEST_P(FrameThrottlingTest, - ScrollingCoordinatorShouldSkipCompositedThrottledFrame) { - WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); - WebView().GetSettings()->SetPreferCompositingToLCDTextEnabled(true); - - // Create a hidden frame which is throttled. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); - frame_resource.Complete("<div style='height: 2000px'></div>"); - - // Move the frame offscreen to throttle it. - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); - CompositeFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - - // Change style of the frame's content to make it in VisualUpdatePending - // state. - frame_element->contentDocument()->body()->setAttribute(styleAttr, - "background: green"); - // Change root frame's layout so that the next lifecycle update will call - // ScrollingCoordinator::updateAfterCompositingChangeIfNeeded(). - GetDocument().body()->setAttribute(styleAttr, "margin: 20px"); - EXPECT_EQ(DocumentLifecycle::kVisualUpdatePending, - frame_element->contentDocument()->Lifecycle().GetState()); - - DocumentLifecycle::AllowThrottlingScope throttling_scope( - GetDocument().Lifecycle()); - // This will call ScrollingCoordinator::updateAfterCompositingChangeIfNeeded() - // and should not cause assert failure about - // isAllowedToQueryCompositingState() in the throttled frame. - CompositeFrame(); - EXPECT_EQ(DocumentLifecycle::kVisualUpdatePending, - frame_element->contentDocument()->Lifecycle().GetState()); - - // Make the frame visible by changing its transform. This doesn't cause a - // layout, but should still unthrottle the frame. - frame_element->setAttribute(styleAttr, "transform: translateY(0px)"); - CompositeFrame(); // Unthrottle the frame. - CompositeFrame(); // Handle the pending visual update of the unthrottled - // frame. - EXPECT_EQ(DocumentLifecycle::kPaintClean, - frame_element->contentDocument()->Lifecycle().GetState()); - EXPECT_TRUE( - frame_element->contentDocument()->View()->UsesCompositedScrolling()); -} - -TEST_P(FrameThrottlingTest, UnthrottleByTransformingWithoutLayout) { - WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); - - // Create a hidden frame which is throttled. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); - frame_resource.Complete(""); - - // Move the frame offscreen to throttle it. - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); - CompositeFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - - // Make the frame visible by changing its transform. This doesn't cause a - // layout, but should still unthrottle the frame. - frame_element->setAttribute(styleAttr, "transform: translateY(0px)"); - CompositeFrame(); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); -} - -TEST_P(FrameThrottlingTest, ThrottledTopLevelEventHandlerIgnored) { - WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); - WebView().GetSettings()->SetJavaScriptEnabled(true); - EXPECT_EQ(0u, TouchHandlerRegionSize()); - - // Create a frame which is throttled and has two different types of - // top-level touchstart handlers. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete( - "<iframe id=frame sandbox=allow-scripts src=iframe.html></iframe>"); - frame_resource.Complete( - "<script>" - "window.addEventListener('touchstart', function(){}, {passive: false});" - "document.addEventListener('touchstart', function(){}, {passive: false});" - "</script>"); - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - CompositeFrame(); // Throttle the frame. - CompositeFrame(); // Update touch handler regions. - - // The touch handlers in the throttled frame should have been ignored. - EXPECT_EQ(0u, TouchHandlerRegionSize()); - - // Unthrottling the frame makes the touch handlers active again. Note that - // both handlers get combined into the same rectangle in the region, so - // there is only one rectangle in total. - frame_element->setAttribute(styleAttr, "transform: translateY(0px)"); - CompositeFrame(); // Unthrottle the frame. - CompositeFrame(); // Update touch handler regions. - EXPECT_EQ(1u, TouchHandlerRegionSize()); -} - -TEST_P(FrameThrottlingTest, ThrottledEventHandlerIgnored) { - WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); - WebView().GetSettings()->SetJavaScriptEnabled(true); - EXPECT_EQ(0u, TouchHandlerRegionSize()); - - // Create a frame which is throttled and has a non-top-level touchstart - // handler. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete( - "<iframe id=frame sandbox=allow-scripts src=iframe.html></iframe>"); - frame_resource.Complete( - "<div id=d>touch handler</div>" - "<script>" - "document.querySelector('#d').addEventListener('touchstart', " - "function(){});" - "</script>"); - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - CompositeFrame(); // Throttle the frame. - CompositeFrame(); // Update touch handler regions. - - // The touch handler in the throttled frame should have been ignored. - EXPECT_EQ(0u, TouchHandlerRegionSize()); - - // Unthrottling the frame makes the touch handler active again. - frame_element->setAttribute(styleAttr, "transform: translateY(0px)"); - CompositeFrame(); // Unthrottle the frame. - CompositeFrame(); // Update touch handler regions. - EXPECT_EQ(1u, TouchHandlerRegionSize()); -} - -TEST_P(FrameThrottlingTest, DumpThrottledFrame) { - WebView().GetSettings()->SetJavaScriptEnabled(true); - - // Create a frame which is throttled. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete( - "main <iframe id=frame sandbox=allow-scripts src=iframe.html></iframe>"); - frame_resource.Complete(""); - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - CompositeFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - - LocalFrame* local_frame = ToLocalFrame(frame_element->ContentFrame()); - local_frame->GetScriptController().ExecuteScriptInMainWorld( - "document.body.innerHTML = 'throttled'"); - EXPECT_FALSE(Compositor().NeedsBeginFrame()); - - // The dumped contents should not include the throttled frame. - DocumentLifecycle::AllowThrottlingScope throttling_scope( - GetDocument().Lifecycle()); - WebString result = WebFrameContentDumper::DeprecatedDumpFrameTreeAsText( - WebView().MainFrameImpl(), 1024); - EXPECT_NE(std::string::npos, result.Utf8().find("main")); - EXPECT_EQ(std::string::npos, result.Utf8().find("throttled")); -} - -TEST_P(FrameThrottlingTest, PaintingViaContentLayerDelegateIsThrottled) { - WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); - WebView().GetSettings()->SetPreferCompositingToLCDTextEnabled(true); - - // Create a hidden frame which is throttled. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); - frame_resource.Complete("throttled"); - CompositeFrame(); - - // Before the iframe is throttled, we should create all drawing items. - MockWebDisplayItemList display_items_not_throttled; - EXPECT_CALL(display_items_not_throttled, AppendDrawingItem(_, _, _)).Times(3); - PaintRecursively(WebView().RootGraphicsLayer(), &display_items_not_throttled); - - // Move the frame offscreen to throttle it and make sure it is backed by a - // graphics layer. - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - frame_element->setAttribute(styleAttr, - "transform: translateY(480px) translateZ(0px)"); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); - CompositeFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - - // If painting of the iframe is throttled, we should only receive two - // drawing items. - MockWebDisplayItemList display_items_throttled; - EXPECT_CALL(display_items_throttled, AppendDrawingItem(_, _, _)).Times(2); - PaintRecursively(WebView().RootGraphicsLayer(), &display_items_throttled); -} - -TEST_P(FrameThrottlingTest, ThrottleInnerCompositedLayer) { - WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); - WebView().GetSettings()->SetPreferCompositingToLCDTextEnabled(true); - - // Create a hidden frame which is throttled. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); - frame_resource.Complete( - "<div id=div style='will-change: transform; background: blue'>DIV</div>"); - CompositeFrame(); - - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - // The inner div is composited. - auto* inner_div = frame_element->contentDocument()->getElementById("div"); - EXPECT_NE(nullptr, - inner_div->GetLayoutBox()->Layer()->GraphicsLayerBacking()); - - // Before the iframe is throttled, we should create all drawing items. - MockWebDisplayItemList display_items_not_throttled; - EXPECT_CALL(display_items_not_throttled, AppendDrawingItem(_, _, _)).Times(4); - PaintRecursively(WebView().RootGraphicsLayer(), &display_items_not_throttled); - - // Move the frame offscreen to throttle it. - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); - CompositeFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - // The inner div should still be composited. - EXPECT_NE(nullptr, - inner_div->GetLayoutBox()->Layer()->GraphicsLayerBacking()); - - // If painting of the iframe is throttled, we should only receive two - // drawing items. - MockWebDisplayItemList display_items_throttled; - EXPECT_CALL(display_items_throttled, AppendDrawingItem(_, _, _)).Times(2); - PaintRecursively(WebView().RootGraphicsLayer(), &display_items_throttled); - - // Remove compositing trigger of inner_div. - inner_div->setAttribute(styleAttr, "background: yellow; overflow: hidden"); - // Do an unthrottled style and layout update, simulating the situation - // triggered by script style/layout access. - GetDocument().View()->UpdateLifecycleToLayoutClean(); - { - // And a throttled full lifecycle update. - DocumentLifecycle::AllowThrottlingScope throttling_scope( - GetDocument().Lifecycle()); - GetDocument().View()->UpdateAllLifecyclePhases(); - } - // The inner div should still be composited because compositing update is - // throttled, though the inner_div's self-painting status has been updated. - EXPECT_FALSE(inner_div->GetLayoutBox()->Layer()->IsSelfPaintingLayer()); - { - DisableCompositingQueryAsserts disabler; - EXPECT_NE(nullptr, - inner_div->GetLayoutBox()->Layer()->GraphicsLayerBacking()); - } - - MockWebDisplayItemList display_items_throttled1; - EXPECT_CALL(display_items_throttled1, AppendDrawingItem(_, _, _)).Times(2); - PaintRecursively(WebView().RootGraphicsLayer(), &display_items_throttled1); - - // Move the frame back on screen. - frame_element->setAttribute(styleAttr, ""); - CompositeFrame(); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); - CompositeFrame(); - // The inner div is no longer composited. - EXPECT_EQ(nullptr, - inner_div->GetLayoutBox()->Layer()->GraphicsLayerBacking()); - - // After the iframe is unthrottled, we should create all drawing items. - MockWebDisplayItemList display_items_not_throttled1; - EXPECT_CALL(display_items_not_throttled1, AppendDrawingItem(_, _, _)) - .Times(4); - PaintRecursively(WebView().RootGraphicsLayer(), - &display_items_not_throttled1); -} - -TEST_P(FrameThrottlingTest, ThrottleSubtreeAtomically) { - // Create two nested frames which are throttled. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - SimRequest child_frame_resource("https://example.com/child-iframe.html", - "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); - frame_resource.Complete( - "<iframe id=child-frame sandbox src=child-iframe.html></iframe>"); - child_frame_resource.Complete(""); - - // Move both frames offscreen, but don't run the intersection observers yet. - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - auto* child_frame_element = toHTMLIFrameElement( - frame_element->contentDocument()->getElementById("child-frame")); - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - Compositor().BeginFrame(); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); - EXPECT_FALSE( - child_frame_element->contentDocument()->View()->CanThrottleRendering()); - - // Only run the intersection observer for the parent frame. Both frames - // should immediately become throttled. This simulates the case where a task - // such as BeginMainFrame runs in the middle of dispatching intersection - // observer notifications. - frame_element->contentDocument() - ->View() - ->UpdateRenderThrottlingStatusForTesting(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - EXPECT_TRUE( - child_frame_element->contentDocument()->View()->CanThrottleRendering()); - - // Both frames should still be throttled after the second notification. - child_frame_element->contentDocument() - ->View() - ->UpdateRenderThrottlingStatusForTesting(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - EXPECT_TRUE( - child_frame_element->contentDocument()->View()->CanThrottleRendering()); - - // Move the frame back on screen but don't update throttling yet. - frame_element->setAttribute(styleAttr, "transform: translateY(0px)"); - Compositor().BeginFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - EXPECT_TRUE( - child_frame_element->contentDocument()->View()->CanThrottleRendering()); - - // Update throttling for the child. It should remain throttled because the - // parent is still throttled. - child_frame_element->contentDocument() - ->View() - ->UpdateRenderThrottlingStatusForTesting(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - EXPECT_TRUE( - child_frame_element->contentDocument()->View()->CanThrottleRendering()); - - // Updating throttling on the parent should unthrottle both frames. - frame_element->contentDocument() - ->View() - ->UpdateRenderThrottlingStatusForTesting(); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); - EXPECT_FALSE( - child_frame_element->contentDocument()->View()->CanThrottleRendering()); -} - -TEST_P(FrameThrottlingTest, SkipPaintingLayersInThrottledFrames) { - WebView().GetSettings()->SetAcceleratedCompositingEnabled(true); - WebView().GetSettings()->SetPreferCompositingToLCDTextEnabled(true); - - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); - frame_resource.Complete( - "<div id=div style='transform: translateZ(0); background: " - "red'>layer</div>"); - auto display_items = CompositeFrame(); - EXPECT_TRUE(display_items.Contains(SimCanvas::kRect, "red")); - - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - CompositeFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - - auto* frame_document = frame_element->contentDocument(); - EXPECT_EQ(DocumentLifecycle::kPaintClean, - frame_document->Lifecycle().GetState()); - - // Simulate the paint for a graphics layer being externally invalidated - // (e.g., by video playback). - frame_document->View() - ->GetLayoutViewItem() - .InvalidatePaintForViewAndCompositedLayers(); - - // The layer inside the throttled frame should not get painted. - auto display_items2 = CompositeFrame(); - EXPECT_FALSE(display_items2.Contains(SimCanvas::kRect, "red")); -} - -TEST_P(FrameThrottlingTest, SynchronousLayoutInAnimationFrameCallback) { - WebView().GetSettings()->SetJavaScriptEnabled(true); - - // Prepare a page with two cross origin frames (from the same origin so they - // are able to access eachother). - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest first_frame_resource("https://thirdparty.com/first.html", - "text/html"); - SimRequest second_frame_resource("https://thirdparty.com/second.html", - "text/html"); - LoadURL("https://example.com/"); - main_resource.Complete( - "<iframe id=first name=first " - "src='https://thirdparty.com/first.html'></iframe>\n" - "<iframe id=second name=second " - "src='https://thirdparty.com/second.html'></iframe>"); - - // The first frame contains just a simple div. This frame will be made - // throttled. - first_frame_resource.Complete("<div id=d>first frame</div>"); - - // The second frame just used to execute a requestAnimationFrame callback. - second_frame_resource.Complete(""); - - // Throttle the first frame. - auto* first_frame_element = - toHTMLIFrameElement(GetDocument().getElementById("first")); - first_frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - CompositeFrame(); - EXPECT_TRUE( - first_frame_element->contentDocument()->View()->CanThrottleRendering()); - - // Run a animation frame callback in the second frame which mutates the - // contents of the first frame and causes a synchronous style update. This - // should not result in an unexpected lifecycle state even if the first - // frame is throttled during the animation frame callback. - auto* second_frame_element = - toHTMLIFrameElement(GetDocument().getElementById("second")); - LocalFrame* local_frame = ToLocalFrame(second_frame_element->ContentFrame()); - local_frame->GetScriptController().ExecuteScriptInMainWorld( - "window.requestAnimationFrame(function() {\n" - " var throttledFrame = window.parent.frames.first;\n" - " throttledFrame.document.documentElement.style = 'margin: 50px';\n" - " throttledFrame.document.querySelector('#d').getBoundingClientRect();\n" - "});\n"); - CompositeFrame(); -} - -TEST_P(FrameThrottlingTest, AllowOneAnimationFrame) { - WebView().GetSettings()->SetJavaScriptEnabled(true); - - // Prepare a page with two cross origin frames (from the same origin so they - // are able to access eachother). - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://thirdparty.com/frame.html", "text/html"); - LoadURL("https://example.com/"); - main_resource.Complete( - "<iframe id=frame style=\"position: fixed; top: -10000px\" " - "src='https://thirdparty.com/frame.html'></iframe>"); - - frame_resource.Complete( - "<script>" - "window.requestAnimationFrame(() => { window.didRaf = true; });" - "</script>"); - - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - CompositeFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - - LocalFrame* local_frame = ToLocalFrame(frame_element->ContentFrame()); - v8::HandleScope scope(v8::Isolate::GetCurrent()); - v8::Local<v8::Value> result = - local_frame->GetScriptController().ExecuteScriptInMainWorldAndReturnValue( - ScriptSourceCode("window.didRaf;")); - EXPECT_TRUE(result->IsTrue()); -} - -TEST_P(FrameThrottlingTest, UpdatePaintPropertiesOnUnthrottling) { - if (!RuntimeEnabledFeatures::SlimmingPaintInvalidationEnabled()) - return; - - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); - frame_resource.Complete("<div id='div'>Inner</div>"); - CompositeFrame(); - - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - auto* frame_document = frame_element->contentDocument(); - auto* inner_div = frame_document->getElementById("div"); - auto* inner_div_object = inner_div->GetLayoutObject(); - EXPECT_FALSE(frame_document->View()->ShouldThrottleRendering()); - - frame_element->setAttribute(HTMLNames::styleAttr, - "transform: translateY(1000px)"); - CompositeFrame(); - EXPECT_TRUE(frame_document->View()->CanThrottleRendering()); - EXPECT_FALSE(inner_div_object->PaintProperties()); - - // Mutating the throttled frame should not cause paint property update. - inner_div->setAttribute(HTMLNames::styleAttr, "transform: translateY(20px)"); - EXPECT_FALSE(Compositor().NeedsBeginFrame()); - EXPECT_TRUE(frame_document->View()->CanThrottleRendering()); - { - DocumentLifecycle::AllowThrottlingScope throttling_scope( - GetDocument().Lifecycle()); - GetDocument().View()->UpdateAllLifecyclePhases(); - } - EXPECT_FALSE(inner_div_object->PaintProperties()); - - // Move the frame back on screen to unthrottle it. - frame_element->setAttribute(HTMLNames::styleAttr, ""); - // The first update unthrottles the frame, the second actually update layout - // and paint properties etc. - CompositeFrame(); - CompositeFrame(); - EXPECT_FALSE(frame_document->View()->CanThrottleRendering()); - EXPECT_EQ( - TransformationMatrix().Translate(0, 20), - inner_div->GetLayoutObject()->PaintProperties()->Transform()->Matrix()); -} - -TEST_P(FrameThrottlingTest, DisplayNoneNotThrottled) { - SimRequest main_resource("https://example.com/", "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete( - "<style>iframe { transform: translateY(480px); }</style>" - "<iframe sandbox id=frame></iframe>"); - - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - auto* frame_document = frame_element->contentDocument(); - - // Initially the frame is throttled as it is offscreen. - CompositeFrame(); - EXPECT_TRUE(frame_document->View()->CanThrottleRendering()); - - // Setting display:none unthrottles the frame. - frame_element->setAttribute(styleAttr, "display: none"); - CompositeFrame(); - EXPECT_FALSE(frame_document->View()->CanThrottleRendering()); -} - -TEST_P(FrameThrottlingTest, DisplayNoneChildrenRemainThrottled) { - // Create two nested frames which are throttled. - SimRequest main_resource("https://example.com/", "text/html"); - SimRequest frame_resource("https://example.com/iframe.html", "text/html"); - SimRequest child_frame_resource("https://example.com/child-iframe.html", - "text/html"); - - LoadURL("https://example.com/"); - main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); - frame_resource.Complete( - "<iframe id=child-frame sandbox src=child-iframe.html></iframe>"); - child_frame_resource.Complete(""); - - // Move both frames offscreen to make them throttled. - auto* frame_element = - toHTMLIFrameElement(GetDocument().getElementById("frame")); - auto* child_frame_element = toHTMLIFrameElement( - frame_element->contentDocument()->getElementById("child-frame")); - frame_element->setAttribute(styleAttr, "transform: translateY(480px)"); - CompositeFrame(); - EXPECT_TRUE(frame_element->contentDocument()->View()->CanThrottleRendering()); - EXPECT_TRUE( - child_frame_element->contentDocument()->View()->CanThrottleRendering()); - - // Setting display:none for the parent frame unthrottles the parent but not - // the child. This behavior matches Safari. - frame_element->setAttribute(styleAttr, "display: none"); - CompositeFrame(); - EXPECT_FALSE( - frame_element->contentDocument()->View()->CanThrottleRendering()); - EXPECT_TRUE( - child_frame_element->contentDocument()->View()->CanThrottleRendering()); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/web/tests/scheduler/README.md b/third_party/WebKit/Source/web/tests/scheduler/README.md deleted file mode 100644 index ed6cb06..0000000 --- a/third_party/WebKit/Source/web/tests/scheduler/README.md +++ /dev/null
@@ -1,3 +0,0 @@ -This directory contains scheduler simulation tests. -They can be considered end-to-end tests for the Blink Scheduler and -unlike other scheduler tests they need to have access to web/ layer.
diff --git a/third_party/WebKit/Source/web/tests/scheduler/ThrottlingTest.cpp b/third_party/WebKit/Source/web/tests/scheduler/ThrottlingTest.cpp deleted file mode 100644 index e31600f..0000000 --- a/third_party/WebKit/Source/web/tests/scheduler/ThrottlingTest.cpp +++ /dev/null
@@ -1,101 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code if governed by a BSD-style license that can be -// found in LICENSE file. - -#include "core/testing/sim/SimRequest.h" -#include "core/testing/sim/SimTest.h" -#include "platform/scheduler/child/web_scheduler.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" -#include "platform/testing/UnitTestHelpers.h" -#include "public/platform/Platform.h" -#include "public/platform/WebThread.h" -#include "public/platform/scheduler/renderer/renderer_scheduler.h" -#include "testing/gtest/include/gtest/gtest.h" - -using testing::ElementsAre; - -namespace blink { - -class DisableBackgroundThrottlingIsRespectedTest : public SimTest { - public: - void SetUp() override { - background_tab_timer_throttling_feature_ = - WTF::MakeUnique<ScopedBackgroundTabTimerThrottlingForTest>(false); - SimTest::SetUp(); - } - - void TearDown() { background_tab_timer_throttling_feature_.reset(); } - - private: - typedef ScopedRuntimeEnabledFeatureForTest< - RuntimeEnabledFeatures::TimerThrottlingForBackgroundTabsEnabled, - RuntimeEnabledFeatures::SetTimerThrottlingForBackgroundTabsEnabled> - ScopedBackgroundTabTimerThrottlingForTest; - - std::unique_ptr<ScopedBackgroundTabTimerThrottlingForTest> - background_tab_timer_throttling_feature_; -}; - -TEST_F(DisableBackgroundThrottlingIsRespectedTest, - DisableBackgroundThrottlingIsRespected) { - SimRequest main_resource("https://example.com/", "text/html"); - - LoadURL("https://example.com/"); - - main_resource.Complete( - "(<script>" - " function f(repetitions) {" - " if (repetitions == 0) return;" - " console.log('called f');" - " setTimeout(f, 10, repetitions - 1);" - " }" - " f(5);" - "</script>)"); - - Platform::Current() - ->CurrentThread() - ->Scheduler() - ->GetRendererSchedulerForTest() - ->SetRendererBackgrounded(true); - - // Run delayed tasks for 1 second. All tasks should be completed - // with throttling disabled. - testing::RunDelayedTasks(1000); - - EXPECT_THAT(ConsoleMessages(), ElementsAre("called f", "called f", "called f", - "called f", "called f")); -} - -class BackgroundRendererThrottlingTest : public SimTest {}; - -TEST_F(BackgroundRendererThrottlingTest, - DISABLED_BackgroundRenderersAreThrottled) { - SimRequest main_resource("https://example.com/", "text/html"); - - LoadURL("https://example.com/"); - - main_resource.Complete( - "(<script>" - " function f(repetitions) {" - " if (repetitions == 0) return;" - " console.log('called f');" - " setTimeout(f, 10, repetitions - 1);" - " }" - " setTimeout(f, 10, 3);" - "</script>)"); - - Platform::Current() - ->CurrentThread() - ->Scheduler() - ->GetRendererSchedulerForTest() - ->SetRendererBackgrounded(true); - - // Make sure that we run a task once a second. - for (int i = 0; i < 3; ++i) { - testing::RunDelayedTasks(1000); - EXPECT_THAT(ConsoleMessages(), ElementsAre("called f")); - ConsoleMessages().clear(); - } -} - -} // namespace blink
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py index b7d5354..40cbdb9 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py
@@ -203,6 +203,13 @@ output_basename = fs.basename(fs.splitext(self._test_name)[0] + '-expected' + extension) output_path = fs.join(output_dir, output_basename) + # Remove |output_path| if it exists and is not the generic expectation to + # avoid extra baseline if the new baseline is the same as the fallback baseline. + generic_dir = fs.join(port.layout_tests_dir(), fs.dirname(self._test_name)) + if output_dir != generic_dir and fs.exists(output_path): + _log.info('Removing the current baseline "%s"', port.relative_test_filename(output_path)) + fs.remove(output_path) + current_expected_path = port.expected_filename(self._test_name, extension) if fs.exists(current_expected_path) and fs.sha1(current_expected_path) == hashlib.sha1(data).hexdigest(): _log.info('Not writing new expected result "%s" because it is the same as the current expected result',
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py index bb66750..3d0dc415 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
@@ -1266,7 +1266,42 @@ self.assert_baselines( file_list, log_stream, 'flag-specific/flag/failures/unexpected/text-image-checksum', - expected_extensions=['.png'], ) + expected_extensions=['.png']) + + def test_new_flag_specific_baseline_optimize(self): + # Test removing existing baselines under flag-specific directory if the + # actual results are the same as the fallback baselines. + host = MockHost() + host.filesystem.write_text_file( + test.LAYOUT_TEST_DIR + + '/failures/unexpected/text-image-checksum-expected.txt', + # This value is the same as actual text result of the test defined + # in webkitpy.layout_tests.port.test. This is added so that we check + # that the flag-specific text baseline is removed if the actual + # result is the same as this fallback baseline. + 'text-image-checksum_fail-txt') + flag_specific_baseline_txt = ( + test.LAYOUT_TEST_DIR + + '/flag-specific/flag/failures/unexpected/text-image-checksum-expected.txt') + host.filesystem.write_text_file( + flag_specific_baseline_txt, 'existing-baseline-different-from-fallback') + + details, log_stream, _ = logging_run( + ['--additional-driver-flag=--flag', + '--new-flag-specific-baseline', + 'failures/unexpected/text-image-checksum.html'], + tests_included=True, host=host) + self.assertEqual(details.exit_code, 0) + self.assertFalse(host.filesystem.exists(flag_specific_baseline_txt)) + file_list = host.filesystem.written_files.keys() + # Exclude the removed file. + file_list.remove(flag_specific_baseline_txt) + self.assertEqual(len(file_list), 8) + # We should create new image baseline only. + self.assert_baselines( + file_list, log_stream, + 'flag-specific/flag/failures/unexpected/text-image-checksum', + expected_extensions=['.png']) class MainTest(unittest.TestCase):
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/style/checker.py b/third_party/WebKit/Tools/Scripts/webkitpy/style/checker.py index 8ceda22..7bb0500b 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/style/checker.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/style/checker.py
@@ -415,6 +415,8 @@ # for this special case. basename = os.path.basename(file_path) if basename == 'TestExpectations': + # TODO(qyearsley): Replace hard-coded "TestExpectations" with a + # list of known "TestExpectations" files. Maybe shared with Port. return False for skipped_file in _SKIPPED_FILES_WITHOUT_WARNING: if self._should_skip_file_path(file_path, skipped_file): @@ -440,14 +442,16 @@ return FileType.JSON elif file_extension == _PYTHON_FILE_EXTENSION: return FileType.PYTHON + elif not file_extension and os.path.dirname(file_path).endswith(os.path.join('Tools', 'Scripts')): + # TODO(qyearsley): Update this when Blink is moved from third_party/WebKit. + return FileType.PYTHON elif file_extension in _XML_FILE_EXTENSIONS: return FileType.XML elif file_extension == _XCODEPROJ_FILE_EXTENSION: return FileType.XCODEPROJ elif file_extension == _PNG_FILE_EXTENSION: return FileType.PNG - elif ((not file_extension and os.path.join('Tools', 'Scripts') in file_path) or - file_extension in _TEXT_FILE_EXTENSIONS or os.path.basename(file_path) == 'TestExpectations'): + elif file_extension in _TEXT_FILE_EXTENSIONS or os.path.basename(file_path) == 'TestExpectations': return FileType.TEXT else: return FileType.NONE
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/style/checker_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/style/checker_unittest.py index 5bc96fb..c89e850a 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/style/checker_unittest.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/style/checker_unittest.py
@@ -432,6 +432,7 @@ paths = [ "foo.py", "Tools/Scripts/modules/text_style.py", + os.path.join("Tools", "Scripts", "check-webkit-style"), ] for path in paths: @@ -469,7 +470,6 @@ "foo.xhtml", "foo.y", os.path.join("Source", "WebCore", "inspector", "front-end", "Main.js"), - os.path.join("Tools", "Scripts", "check-webkit-style"), ] for path in paths:
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py index fd81f11..8828bc7 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py
@@ -8,7 +8,7 @@ import logging import optparse -from webkitpy.common.net.git_cl import GitCL +from webkitpy.common.net.git_cl import GitCL, TryJobStatus from webkitpy.common.path_finder import PathFinder from webkitpy.tool.commands.rebaseline import AbstractParallelRebaselineCommand from webkitpy.tool.commands.rebaseline import TestBaselineSet @@ -183,12 +183,20 @@ jobs: A dict mapping Build objects to TryJobStatus objects. Returns: - A dict mapping Build to LayoutTestResults, or None if any results - were not available. + A dict mapping Build to LayoutTestResults for all completed jobs. """ buildbot = self._tool.buildbot results = {} - for build, _ in jobs.iteritems(): + for build, status in jobs.iteritems(): + if status == TryJobStatus('COMPLETED', 'SUCCESS'): + # Builds with passing try jobs are mapped to None, to indicate + # that there are no baselines to download. + results[build] = None + continue + if status != TryJobStatus('COMPLETED', 'FAILURE'): + # Only completed failed builds will contain actual failed + # layout tests to download baselines for. + continue results_url = buildbot.results_url(build.builder_name, build.build_number) layout_test_results = buildbot.fetch_results(build) if layout_test_results is None: @@ -246,10 +254,22 @@ finder.path_from_chromium_base()) + '/' def _tests_to_rebaseline(self, build, layout_test_results): - """Fetches a list of tests that should be rebaselined for some build.""" + """Fetches a list of tests that should be rebaselined for some build. + + Args: + build: A Build instance. + layout_test_results: A LayoutTestResults instance or None. + + Returns: + A sorted list of tests to rebaseline for this build. + """ + if layout_test_results is None: + return [] + unexpected_results = layout_test_results.didnt_run_as_expected_results() - tests = sorted(r.test_name() for r in unexpected_results - if r.is_missing_baseline() or r.has_mismatch_result()) + tests = sorted( + r.test_name() for r in unexpected_results + if r.is_missing_baseline() or r.has_mismatch_result()) new_failures = self._fetch_tests_with_new_failures(build) if new_failures is None:
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py index 2b893f6..d7eac77 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py
@@ -30,6 +30,7 @@ Build('MOCK Try Linux', 6000): TryJobStatus('COMPLETED', 'FAILURE'), } + # TODO(qyearsley): Add a MockGitCL class to reduce repetition below. git_cl = GitCL(self.tool) git_cl.get_issue_number = lambda: '11112222' git_cl.latest_try_jobs = lambda _: builds @@ -188,7 +189,7 @@ 'INFO: Aborted: no try jobs and --no-trigger-jobs passed.\n', ]) - def test_execute_one_missing_build_(self): + def test_execute_one_missing_build(self): builds = { Build('MOCK Try Win', 5000): TryJobStatus('COMPLETED', 'FAILURE'), Build('MOCK Try Mac', 4000): TryJobStatus('COMPLETED', 'FAILURE'), @@ -209,6 +210,78 @@ 'webkit-patch rebaseline-cl to fetch new baselines.\n', ]) + def test_execute_with_unfinished_jobs(self): + builds = { + Build('MOCK Try Win', 5000): TryJobStatus('COMPLETED', 'FAILURE'), + Build('MOCK Try Mac', 4000): TryJobStatus('STARTED'), + Build('MOCK Try Linux', 6000): TryJobStatus('SCHEDULED'), + } + git_cl = GitCL(self.tool) + git_cl.get_issue_number = lambda: '11112222' + git_cl.latest_try_jobs = lambda _: builds + self.command.git_cl = lambda: git_cl + exit_code = self.command.execute(self.command_options(), [], self.tool) + self.assertEqual(exit_code, 1) + self.assertLog([ + 'INFO: Finished try jobs:\n', + 'INFO: MOCK Try Win\n', + 'INFO: Scheduled or started try jobs:\n', + 'INFO: MOCK Try Linux\n', + 'INFO: MOCK Try Mac\n', + 'INFO: There are some builders with no results:\n', + 'INFO: MOCK Try Linux\n', + 'INFO: MOCK Try Mac\n', + 'INFO: Would you like to try to fill in missing results with\n' + 'available results? This assumes that layout test results\n' + 'for the platforms with missing results are the same as\n' + 'results on other platforms.\n', + 'INFO: Aborting.\n', + ]) + + def test_execute_with_canceled_job(self): + builds = { + Build('MOCK Try Win', 5000): TryJobStatus('COMPLETED', 'FAILURE'), + Build('MOCK Try Mac', 4000): TryJobStatus('COMPLETED', 'FAILURE'), + Build('MOCK Try Linux', 6000): TryJobStatus('COMPLETED', 'CANCELED'), + } + git_cl = GitCL(self.tool) + git_cl.get_issue_number = lambda: '11112222' + git_cl.latest_try_jobs = lambda _: builds + self.command.git_cl = lambda: git_cl + exit_code = self.command.execute(self.command_options(), [], self.tool) + self.assertEqual(exit_code, 1) + self.assertLog([ + 'INFO: Finished try jobs found for all try bots.\n', + 'INFO: There are some builders with no results:\n', + 'INFO: MOCK Try Linux\n', + 'INFO: Would you like to try to fill in missing results with\n' + 'available results? This assumes that layout test results\n' + 'for the platforms with missing results are the same as\n' + 'results on other platforms.\n', + 'INFO: Aborting.\n', + ]) + + def test_execute_with_passing_jobs(self): + builds = { + Build('MOCK Try Win', 5000): TryJobStatus('COMPLETED', 'FAILURE'), + Build('MOCK Try Mac', 4000): TryJobStatus('COMPLETED', 'SUCCESS'), + Build('MOCK Try Linux', 6000): TryJobStatus('COMPLETED', 'SUCCESS'), + } + git_cl = GitCL(self.tool) + git_cl.get_issue_number = lambda: '11112222' + git_cl.latest_try_jobs = lambda _: builds + self.command.git_cl = lambda: git_cl + exit_code = self.command.execute(self.command_options(), [], self.tool) + self.assertEqual(exit_code, 0) + self.assertLog([ + 'INFO: Finished try jobs found for all try bots.\n', + 'INFO: Rebaselining one/flaky-fail.html\n', + 'INFO: Rebaselining one/missing.html\n', + 'INFO: Rebaselining one/slow-fail.html\n', + 'INFO: Rebaselining one/text-fail.html\n', + 'INFO: Rebaselining two/image-fail.html\n' + ]) + def test_execute_with_no_trigger_jobs_option(self): builds = { Build('MOCK Try Win', 5000): TryJobStatus('COMPLETED', 'FAILURE'),
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter.py index de89ed4..a4c8460 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter.py
@@ -225,8 +225,14 @@ cl.post_comment(( 'Exportable changes to web-platform-tests were detected in this CL ' 'and a pull request in the upstream repo has been made: {pr_url}.\n\n' - 'Travis CI has been kicked off and if it fails, we will let you know here. ' - 'If this CL lands and Travis CI is green, we will auto-merge the PR.' + 'If this CL lands and Travis CI upstream is green, we will auto-merge the PR.\n\n' + 'Note: Please check the Travis CI status (at the bottom of the PR) ' + 'before landing this CL and only land this CL if the status is green. ' + 'Otherwise a human needs to step in and resolve it manually, during which time ' + 'the WPT Importer is blocked from operating.\n\n' + '(There is ongoing work to 1. prevent CLs with red upstream PRs from landing ' + '(https://crbug.com/711447) and 2. prevent the importer from being blocked on ' + 'stuck exportable changes (https://crbug.com/734121))' ).format( pr_url='%spull/%d' % (WPT_GH_URL, response_data['number']) ))
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py index 3a39a70..1b038fa 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
@@ -360,7 +360,7 @@ if try_results and all(s == TryJobStatus('COMPLETED', 'SUCCESS') for _, s in try_results.iteritems()): _log.info('CQ appears to have passed; trying to commit.') - self.git_cl.run(['cl', 'upload', '--send-mail']) # Turn off WIP mode. + self.git_cl.run(['upload', '--send-mail']) # Turn off WIP mode. self.git_cl.run(['set-commit']) _log.info('Update completed.') return True
diff --git a/third_party/WebKit/public/BUILD.gn b/third_party/WebKit/public/BUILD.gn index 3607e8b5..410a3b5 100644 --- a/third_party/WebKit/public/BUILD.gn +++ b/third_party/WebKit/public/BUILD.gn
@@ -73,6 +73,7 @@ java_cpp_enum("blink_headers_java_enums_srcjar") { sources = [ "./platform/WebDisplayMode.h", + "./platform/WebFocusType.h", "./platform/WebInputEvent.h", "./platform/WebTextInputMode.h", "./platform/WebTextInputType.h", @@ -435,6 +436,7 @@ "platform/modules/serviceworker/WebServiceWorkerClientsInfo.h", "platform/modules/serviceworker/WebServiceWorkerError.h", "platform/modules/serviceworker/WebServiceWorkerEventResult.h", + "platform/modules/serviceworker/WebServiceWorkerInstalledScriptsManager.h", "platform/modules/serviceworker/WebServiceWorkerNetworkProvider.h", "platform/modules/serviceworker/WebServiceWorkerProvider.h", "platform/modules/serviceworker/WebServiceWorkerProviderClient.h", @@ -705,10 +707,7 @@ } mojom("mojo_bindings") { - visibility = [ - "//components/payments/content/*", - "//content/*", - ] + visibility = [ "//content/*" ] visibility_blink = [ "//content/common:mojo_bindings_blink", "//third_party/WebKit/Source/platform", @@ -736,8 +735,10 @@ "platform/modules/sensitive_input_visibility/sensitive_input_visibility_service.mojom", "platform/modules/serviceworker/service_worker_event_status.mojom", "platform/modules/serviceworker/service_worker_stream_handle.mojom", + "platform/modules/webauth/authenticator.mojom", "platform/modules/websockets/websocket.mojom", "platform/referrer.mojom", + "platform/reporting.mojom", "platform/site_engagement.mojom", "web/console_message.mojom", "web/window_features.mojom",
diff --git a/third_party/WebKit/public/platform/WebFeature.h b/third_party/WebKit/public/platform/WebFeature.h index 3da0b66..bea2b32 100644 --- a/third_party/WebKit/public/platform/WebFeature.h +++ b/third_party/WebKit/public/platform/WebFeature.h
@@ -500,6 +500,7 @@ kFullscreenInsecureOrigin = 766, kDialogInSandboxedContext = 767, kSVGSMILAnimationInImageRegardlessOfCache = 768, + kEncryptedMediaSecureOrigin = 770, kPerformanceFrameTiming = 772, kV8Element_Animate_Method = 773, // The above items are available in M44 branch. @@ -1566,6 +1567,23 @@ kMIDIMessageEvent = 2031, kFetchEventIsReload = 2032, kServiceWorkerClientFrameType = 2033, + kQuirksModeDocument = 2034, + kLimitedQuirksModeDocument = 2035, + kEncryptedMediaCrossOriginIframe = 2036, + kCSSSelectorWebkitMediaControls = 2037, + kCSSSelectorWebkitMediaControlsOverlayEnclosure = 2038, + kCSSSelectorWebkitMediaControlsOverlayPlayButton = 2039, + kCSSSelectorWebkitMediaControlsEnclosure = 2040, + kCSSSelectorWebkitMediaControlsPanel = 2041, + kCSSSelectorWebkitMediaControlsPlayButton = 2042, + kCSSSelectorWebkitMediaControlsCurrentTimeDisplay = 2043, + kCSSSelectorWebkitMediaControlsTimeRemainingDisplay = 2044, + kCSSSelectorWebkitMediaControlsTimeline = 2045, + kCSSSelectorWebkitMediaControlsTimelineContainer = 2046, + kCSSSelectorWebkitMediaControlsMuteButton = 2047, + kCSSSelectorWebkitMediaControlsVolumeSlider = 2048, + kCSSSelectorWebkitMediaControlsFullscreenButton = 2049, + kCSSSelectorWebkitMediaControlsToggleClosedCaptionsButton = 2050, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/WebKit/public/platform/WebFeaturePolicyFeature.h b/third_party/WebKit/public/platform/WebFeaturePolicyFeature.h index d400770c..a90defe 100644 --- a/third_party/WebKit/public/platform/WebFeaturePolicyFeature.h +++ b/third_party/WebKit/public/platform/WebFeaturePolicyFeature.h
@@ -39,16 +39,10 @@ kDocumentDomain, // Controls access to document.write and document.writeln methods. kDocumentWrite, - // Controls access to Notification interface. - kNotifications, - // Controls access to PushManager interface. - kPush, // Controls whether synchronous script elements will run. kSyncScript, // Controls use of synchronous XMLHTTPRequest API. kSyncXHR, - // Controls access to RTCPeerConnection interface. - kWebRTC, // Controls access to the WebUSB API. kUsb, LAST_FEATURE = kUsb
diff --git a/third_party/WebKit/public/platform/WebFocusType.h b/third_party/WebKit/public/platform/WebFocusType.h index 3a9ae3f1..3f15808d 100644 --- a/third_party/WebKit/public/platform/WebFocusType.h +++ b/third_party/WebKit/public/platform/WebFocusType.h
@@ -33,6 +33,9 @@ namespace blink { +// A Java counterpart will be generated for this enum. +// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.blink_public.web +// GENERATED_JAVA_PREFIX_TO_STRIP: WebFocusType enum WebFocusType { // Element::focus(), etc. kWebFocusTypeNone = 0,
diff --git a/third_party/WebKit/public/platform/WebRuntimeFeatures.h b/third_party/WebKit/public/platform/WebRuntimeFeatures.h index e67bf35..1e2cc6d 100644 --- a/third_party/WebKit/public/platform/WebRuntimeFeatures.h +++ b/third_party/WebKit/public/platform/WebRuntimeFeatures.h
@@ -92,6 +92,7 @@ BLINK_PLATFORM_EXPORT static void EnableMediaDocumentDownloadButton(bool); BLINK_PLATFORM_EXPORT static void EnableMediaSession(bool); BLINK_PLATFORM_EXPORT static void EnableMiddleClickAutoscroll(bool); + BLINK_PLATFORM_EXPORT static void EnableModuleScripts(bool); BLINK_PLATFORM_EXPORT static void EnableMojoBlobs(bool); BLINK_PLATFORM_EXPORT static void EnableNavigatorContentUtils(bool); BLINK_PLATFORM_EXPORT static void EnableNetworkInformation(bool); @@ -126,6 +127,7 @@ BLINK_PLATFORM_EXPORT static void EnableTouchpadAndWheelScrollLatching(bool); BLINK_PLATFORM_EXPORT static void EnableV8IdleTasks(bool); BLINK_PLATFORM_EXPORT static void EnableWebAssemblyStreaming(bool); + BLINK_PLATFORM_EXPORT static void EnableWebAuth(bool); BLINK_PLATFORM_EXPORT static void EnableWebBluetooth(bool); BLINK_PLATFORM_EXPORT static void EnableWebFontsInterventionV2With2G(bool); BLINK_PLATFORM_EXPORT static void EnableWebFontsInterventionV2With3G(bool); @@ -158,7 +160,6 @@ BLINK_PLATFORM_EXPORT static void EnableVideoRotateToFullscreen(bool); BLINK_PLATFORM_EXPORT static void EnableVideoFullscreenDetection(bool); BLINK_PLATFORM_EXPORT static void EnableMediaControlsOverlayPlayButton(bool); - BLINK_PLATFORM_EXPORT static void EnableLocationHardReload(bool); BLINK_PLATFORM_EXPORT static void EnableRemotePlaybackBackend(bool); BLINK_PLATFORM_EXPORT static void EnableMediaCastOverlayButton(bool);
diff --git a/third_party/WebKit/public/platform/WebTextInputType.h b/third_party/WebKit/public/platform/WebTextInputType.h index c2a1e6ce..2357830 100644 --- a/third_party/WebKit/public/platform/WebTextInputType.h +++ b/third_party/WebKit/public/platform/WebTextInputType.h
@@ -86,7 +86,9 @@ kWebTextInputFlagAutocapitalizeNone = 1 << 6, kWebTextInputFlagAutocapitalizeCharacters = 1 << 7, kWebTextInputFlagAutocapitalizeWords = 1 << 8, - kWebTextInputFlagAutocapitalizeSentences = 1 << 9 + kWebTextInputFlagAutocapitalizeSentences = 1 << 9, + kWebTextInputFlagHaveNextFocusableElement = 1 << 10, + kWebTextInputFlagHavePreviousFocusableElement = 1 << 11 }; } // namespace blink
diff --git a/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerInstalledScriptsManager.h b/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerInstalledScriptsManager.h new file mode 100644 index 0000000..220dcdf --- /dev/null +++ b/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerInstalledScriptsManager.h
@@ -0,0 +1,68 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebServiceWorkerInstalledScriptsManager_h +#define WebServiceWorkerInstalledScriptsManager_h + +#include "public/platform/WebString.h" +#include "public/platform/WebURL.h" +#include "public/platform/WebVector.h" + +#if INSIDE_BLINK +#include <memory> +#include "platform/network/HTTPHeaderMap.h" +#endif // INSIDE_BLINK + +namespace blink { + +// WebServiceWorkerInstalledScriptsManager provides installed main script and +// imported scripts to the service worker thread. This is used by multiple +// threads, so implementation needs to be thread safe. +class WebServiceWorkerInstalledScriptsManager { + public: + using BytesChunk = WebVector<char>; + // Container of a script. All the fields of this class need to be + // cross-thread-transfer-safe. + class BLINK_PLATFORM_EXPORT RawScriptData { + public: + RawScriptData(WebString encoding, + WebVector<BytesChunk> script_text, + WebVector<BytesChunk> meta_data); + void AddHeader(const WebString& key, const WebString& value); + +#if INSIDE_BLINK + // The encoding of the script text. + const WebString& Encoding() const { return encoding_; } + // An array of raw byte chunks of the script text. + const WebVector<BytesChunk>& ScriptTextChunks() const { + return script_text_; + } + // An array of raw byte chunks of the scripts's meta data from the script's + // V8 code cache. + const WebVector<BytesChunk>& MetaDataChunks() const { return meta_data_; } + // The HTTP headers of the script. + std::unique_ptr<CrossThreadHTTPHeaderMapData> TakeHeaders() { + return std::move(headers_); + } + + private: + WebString encoding_; + WebVector<BytesChunk> script_text_; + WebVector<BytesChunk> meta_data_; + std::unique_ptr<CrossThreadHTTPHeaderMapData> headers_; +#endif // INSIDE_BLINK + }; + + virtual ~WebServiceWorkerInstalledScriptsManager() = default; + + // Called on the main or worker thread. + virtual bool IsScriptInstalled(const blink::WebURL& script_url) const = 0; + // Called on the worker thread. + virtual std::unique_ptr<RawScriptData> GetRawScriptData( + const WebURL& script_url) = 0; +}; + +} // namespace blink + +#endif // WebServiceWorkerInstalledScriptsManager_h
diff --git a/third_party/WebKit/public/platform/modules/webauth/BUILD.gn b/third_party/WebKit/public/platform/modules/webauth/BUILD.gn new file mode 100644 index 0000000..76318f5 --- /dev/null +++ b/third_party/WebKit/public/platform/modules/webauth/BUILD.gn
@@ -0,0 +1,9 @@ +mojom("webauth") { + sources = [ + "authenticator.mojom", + ] + + public_deps = [ + "//mojo/common:common_custom_types", + ] +}
diff --git a/third_party/WebKit/public/platform/modules/webauth/OWNERS b/third_party/WebKit/public/platform/modules/webauth/OWNERS new file mode 100644 index 0000000..dd7ddf4 --- /dev/null +++ b/third_party/WebKit/public/platform/modules/webauth/OWNERS
@@ -0,0 +1,3 @@ +mkwst@chromium.org +per-file *.mojom=set noparent +per-file *.mojom=file://ipc/SECURITY_OWNERS
diff --git a/third_party/WebKit/public/platform/modules/webauth/authenticator.mojom b/third_party/WebKit/public/platform/modules/webauth/authenticator.mojom new file mode 100644 index 0000000..bafa09d --- /dev/null +++ b/third_party/WebKit/public/platform/modules/webauth/authenticator.mojom
@@ -0,0 +1,100 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[JavaPackage="org.chromium.webauth.mojom"] +module webauth.mojom; + +// This file describes the communication between the WebAuthentication renderer +// implementation and browser-side implementations to create scoped credentials +// and use already-created credentials to get assertions. +// See https://w3c.github.io/webauthn/. + +enum AuthenticatorStatus { + SUCCESS, + CANCELLED, + UNKNOWN_ERROR, + NOT_ALLOWED_ERROR, + NOT_SUPPORTED_ERROR, + SECURITY_ERROR, + NOT_IMPLEMENTED, +}; + +// The public key and attestation that is returned by an authenticator's +// call to makeCredential. +struct ScopedCredentialInfo { + // A blob of data containing the JSON serialization of client data passed + // to the authenticator. + array<uint8> client_data; + // A blob of data returned from the authenticator. + array<uint8> attestation; +}; + +// Information about the relying party and the user account held by that +// relying party. This information is used by the authenticator to create +// or retrieve an appropriate scoped credential for this account. +// These fields take arbitrary input. +struct RelyingPartyAccount { + // Friendly name of the Relying Party, e.g. "Acme Corporation" + string relying_party_display_name; + // Friendly name associated with the user account, e.g. "John P. Smith" + string display_name; + // Identifier for the account, corresponding to no more than one credential + // per authenticator and Relying Party. + string id; + // Detailed name for the account, e.g. john.p.smith@example.com + string? name; + // User image, if any. + // TODO(kpaulhamus): make this url.mojom.Url in a followup CL + string? image_url; +}; + +// Parameters that are used to generate an appropriate scoped credential. +struct ScopedCredentialParameters { + ScopedCredentialType type; + // TODO(kpaulhamus): add AlgorithmIdentifier algorithm; +}; + +// Optional parameters that are used during makeCredential. +struct ScopedCredentialOptions { + //TODO(kpaulhamus): Make this mojo.common.mojom.TimeDelta in followup CL + double adjusted_timeout; + string? relying_party_id; + array<ScopedCredentialDescriptor> exclude_list; + // TODO(kpaulhamus): add Extensions +}; + +enum ScopedCredentialType { + SCOPEDCRED, +}; + +// Describes the credentials that the relying party already knows about for +// the given account. If any of these are known to the authenticator, +// it should not create a new credential. +struct ScopedCredentialDescriptor { + ScopedCredentialType type; + // Blob representing a credential key handle. Up to 255 bytes for + // U2F authenticators. + array<uint8> id; + array<Transport> transports; +}; + +enum Transport { + USB, + NFC, + BLE, +}; + +// Interface to direct authenticators to create or use a scoped credential. +interface Authenticator { + // Gets the credential info for a new credential created by an authenticator + // for the given relying party and account. + // |attestation_challenge| is a blob passed from the relying party server. + // [ScopedCredentialInfo] will only be set if status == SUCCESS. + MakeCredential(RelyingPartyAccount account_information, + array<ScopedCredentialParameters> crypto_parameters, + array<uint8> attestation_challenge, + ScopedCredentialOptions options) + => (AuthenticatorStatus status, + ScopedCredentialInfo? scoped_credential); +};
diff --git a/third_party/WebKit/public/platform/reporting.mojom b/third_party/WebKit/public/platform/reporting.mojom new file mode 100644 index 0000000..ab0c201 --- /dev/null +++ b/third_party/WebKit/public/platform/reporting.mojom
@@ -0,0 +1,27 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module content.mojom; + +import "mojo/common/values.mojom"; +import "url/mojo/url.mojom"; + +interface ReportingServiceProxy { + // Attempts to queue a report using the Reporting API. + // + // |url| is the URL that generated the report. + // + // |group| is the endpoint group that should receive the report. This should + // be configured for the feature using Reporting by the site that generated + // the report. + // + // |type| is the type of report (for example, "csp" or "hpkp"). This should be + // set to a fixed value by the feature using Reporting. + // + // |body| is the body. It can be any valid Value. + QueueReport(url.mojom.Url url, + string group, + string type, + mojo.common.mojom.Value body); +};
diff --git a/third_party/WebKit/public/web/WebEmbeddedWorker.h b/third_party/WebKit/public/web/WebEmbeddedWorker.h index 9a60523..be569f3 100644 --- a/third_party/WebKit/public/web/WebEmbeddedWorker.h +++ b/third_party/WebKit/public/web/WebEmbeddedWorker.h
@@ -31,12 +31,15 @@ #ifndef WebEmbeddedWorker_h #define WebEmbeddedWorker_h +#include <memory> + #include "public/platform/WebCommon.h" namespace blink { class WebContentSettingsClient; class WebServiceWorkerContextClient; +class WebServiceWorkerInstalledScriptsManager; class WebString; struct WebConsoleMessage; struct WebEmbeddedWorkerStartData; @@ -49,8 +52,10 @@ // The given WebWorkerContextClient and WebContentSettingsClient are going to // be passed on to the worker thread and is held by a newly created // WorkerGlobalScope. - static WebEmbeddedWorker* Create(WebServiceWorkerContextClient*, - WebContentSettingsClient*); + static std::unique_ptr<WebEmbeddedWorker> Create( + std::unique_ptr<WebServiceWorkerContextClient>, + std::unique_ptr<WebServiceWorkerInstalledScriptsManager>, + std::unique_ptr<WebContentSettingsClient>); virtual ~WebEmbeddedWorker() {}
diff --git a/third_party/WebKit/public/web/WebFrame.h b/third_party/WebKit/public/web/WebFrame.h index 026ba11e..329fffc 100644 --- a/third_party/WebKit/public/web/WebFrame.h +++ b/third_party/WebKit/public/web/WebFrame.h
@@ -209,9 +209,6 @@ virtual WebAssociatedURLLoader* CreateAssociatedURLLoader( const WebAssociatedURLLoaderOptions&) = 0; - // Returns the number of registered unload listeners. - virtual unsigned UnloadListenerCount() const = 0; - // Will return true if between didStartLoading and didStopLoading // notifications. virtual bool IsLoading() const;
diff --git a/third_party/WebKit/public/web/WebLocalFrame.h b/third_party/WebKit/public/web/WebLocalFrame.h index ad5e729..22184190 100644 --- a/third_party/WebKit/public/web/WebLocalFrame.h +++ b/third_party/WebKit/public/web/WebLocalFrame.h
@@ -13,6 +13,7 @@ #include "WebFrameLoadType.h" #include "WebHistoryItem.h" #include "public/platform/WebCachePolicy.h" +#include "public/platform/WebFocusType.h" #include "public/platform/WebSize.h" #include "public/platform/WebURLError.h" #include "public/platform/WebURLRequest.h" @@ -764,6 +765,13 @@ // return true, otherwise return false. virtual bool IsPrintScalingDisabledForPlugin(const WebNode& = WebNode()) = 0; + // Advance the focus of the WebView to next text input element from current + // input field wrt sequential navigation with TAB or Shift + TAB + // WebFocusTypeForward simulates TAB and WebFocusTypeBackward simulates + // Shift + TAB. (Will be extended to other form controls like select element, + // checkbox, radio etc.) + virtual void AdvanceFocusInForm(WebFocusType) = 0; + // Testing ------------------------------------------------------------------ // Dumps the layer tree, used by the accelerated compositor, in
diff --git a/third_party/libjingle_xmpp/BUILD.gn b/third_party/libjingle_xmpp/BUILD.gn index ff717ec7..bf7495e 100644 --- a/third_party/libjingle_xmpp/BUILD.gn +++ b/third_party/libjingle_xmpp/BUILD.gn
@@ -42,7 +42,7 @@ ] deps = [ - "//third_party/webrtc/base:rtc_base", + "//third_party/webrtc/rtc_base:rtc_base", ] public_deps = [ "//third_party/expat", @@ -92,7 +92,7 @@ deps = [ ":rtc_xmllite", - "//third_party/webrtc/base:rtc_base_approved", + "//third_party/webrtc/rtc_base:rtc_base_approved", ] public_deps = [ ":rtc_task_runner", @@ -135,7 +135,7 @@ "//base/test:run_all_unittests", "//base/test:test_support", # TODO(kjellander): Refactor/remove this dependency. It is needed by - # third_party/webrtc_overrides/webrtc/base/win32socketinit.cc. + # third_party/webrtc_overrides/webrtc/rtc_base/win32socketinit.cc. "//net", "//testing/gtest", ]
diff --git a/third_party/libjingle_xmpp/task_runner/DEPS b/third_party/libjingle_xmpp/task_runner/DEPS index 9f9d7f2..abac3e84 100644 --- a/third_party/libjingle_xmpp/task_runner/DEPS +++ b/third_party/libjingle_xmpp/task_runner/DEPS
@@ -1,3 +1,3 @@ include_rules = [ - "+third_party/webrtc/base", + "+third_party/webrtc/rtc_base", ]
diff --git a/third_party/libjingle_xmpp/task_runner/task.cc b/third_party/libjingle_xmpp/task_runner/task.cc index 27eb029..a7316b9 100644 --- a/third_party/libjingle_xmpp/task_runner/task.cc +++ b/third_party/libjingle_xmpp/task_runner/task.cc
@@ -10,7 +10,7 @@ #include "third_party/libjingle_xmpp/task_runner/task.h" #include "third_party/libjingle_xmpp/task_runner/taskrunner.h" -#include "third_party/webrtc/base/checks.h" +#include "third_party/webrtc/rtc_base/checks.h" namespace rtc { @@ -149,7 +149,7 @@ blocked_ = true; error_ = true; - // "done_" is set before calling "Stop()" to ensure that this code + // "done_" is set before calling "Stop()" to ensure that this code // doesn't execute more than once (recursively) for the same task. Stop(); #if RTC_DCHECK_IS_ON
diff --git a/third_party/libjingle_xmpp/task_runner/task.h b/third_party/libjingle_xmpp/task_runner/task.h index 55a8cfe..27c44f5 100644 --- a/third_party/libjingle_xmpp/task_runner/task.h +++ b/third_party/libjingle_xmpp/task_runner/task.h
@@ -16,7 +16,7 @@ #include <string> #include "third_party/libjingle_xmpp/task_runner/taskparent.h" -#include "third_party/webrtc/base/sigslot.h" +#include "third_party/webrtc/rtc_base/sigslot.h" ///////////////////////////////////////////////////////////////////// //
diff --git a/third_party/libjingle_xmpp/task_runner/task_unittest.cc b/third_party/libjingle_xmpp/task_runner/task_unittest.cc index 8618f26..6d4024c 100644 --- a/third_party/libjingle_xmpp/task_runner/task_unittest.cc +++ b/third_party/libjingle_xmpp/task_runner/task_unittest.cc
@@ -17,17 +17,17 @@ #include <iostream> #if defined(WEBRTC_WIN) -#include "third_party/webrtc/base/win32.h" +#include "third_party/webrtc/rtc_base/win32.h" #endif // WEBRTC_WIN #include "third_party/libjingle_xmpp/task_runner/task.h" #include "third_party/libjingle_xmpp/task_runner/taskrunner.h" -#include "third_party/webrtc/base/arraysize.h" -#include "third_party/webrtc/base/constructormagic.h" -#include "third_party/webrtc/base/gunit.h" -#include "third_party/webrtc/base/thread.h" -#include "third_party/webrtc/base/timeutils.h" -#include "third_party/webrtc_overrides/webrtc/base/logging.h" +#include "third_party/webrtc/rtc_base/arraysize.h" +#include "third_party/webrtc/rtc_base/constructormagic.h" +#include "third_party/webrtc/rtc_base/gunit.h" +#include "third_party/webrtc/rtc_base/thread.h" +#include "third_party/webrtc/rtc_base/timeutils.h" +#include "third_party/webrtc_overrides/webrtc/rtc_base/logging.h" namespace rtc {
diff --git a/third_party/libjingle_xmpp/task_runner/taskparent.cc b/third_party/libjingle_xmpp/task_runner/taskparent.cc index d0245ab..302cc39b 100644 --- a/third_party/libjingle_xmpp/task_runner/taskparent.cc +++ b/third_party/libjingle_xmpp/task_runner/taskparent.cc
@@ -14,7 +14,7 @@ #include "third_party/libjingle_xmpp/task_runner/taskrunner.h" #include "third_party/libjingle_xmpp/task_runner/task.h" -#include "third_party/webrtc/base/checks.h" +#include "third_party/webrtc/rtc_base/checks.h" namespace rtc {
diff --git a/third_party/libjingle_xmpp/task_runner/taskparent.h b/third_party/libjingle_xmpp/task_runner/taskparent.h index 38075dd..89dc2ce 100644 --- a/third_party/libjingle_xmpp/task_runner/taskparent.h +++ b/third_party/libjingle_xmpp/task_runner/taskparent.h
@@ -14,8 +14,8 @@ #include <memory> #include <set> -#include "third_party/webrtc/base/checks.h" -#include "third_party/webrtc/base/constructormagic.h" +#include "third_party/webrtc/rtc_base/checks.h" +#include "third_party/webrtc/rtc_base/constructormagic.h" namespace rtc {
diff --git a/third_party/libjingle_xmpp/task_runner/taskrunner.cc b/third_party/libjingle_xmpp/task_runner/taskrunner.cc index 7eae04c..736f822 100644 --- a/third_party/libjingle_xmpp/task_runner/taskrunner.cc +++ b/third_party/libjingle_xmpp/task_runner/taskrunner.cc
@@ -13,8 +13,8 @@ #include "third_party/libjingle_xmpp/task_runner/taskrunner.h" #include "third_party/libjingle_xmpp/task_runner/task.h" -#include "third_party/webrtc/base/checks.h" -#include "third_party/webrtc/base/logging.h" +#include "third_party/webrtc/rtc_base/checks.h" +#include "third_party/webrtc/rtc_base/logging.h" namespace rtc {
diff --git a/third_party/libjingle_xmpp/task_runner/taskrunner.h b/third_party/libjingle_xmpp/task_runner/taskrunner.h index 44ac994..fbdc1e94 100644 --- a/third_party/libjingle_xmpp/task_runner/taskrunner.h +++ b/third_party/libjingle_xmpp/task_runner/taskrunner.h
@@ -16,8 +16,8 @@ #include <vector> #include "third_party/libjingle_xmpp/task_runner/taskparent.h" -#include "third_party/webrtc/base/checks.h" -#include "third_party/webrtc/base/sigslot.h" +#include "third_party/webrtc/rtc_base/checks.h" +#include "third_party/webrtc/rtc_base/sigslot.h" namespace rtc { class Task;
diff --git a/third_party/libjingle_xmpp/xmllite/DEPS b/third_party/libjingle_xmpp/xmllite/DEPS index 063f1fe..4ff34d5 100644 --- a/third_party/libjingle_xmpp/xmllite/DEPS +++ b/third_party/libjingle_xmpp/xmllite/DEPS
@@ -1,4 +1,4 @@ include_rules = [ "+third_party/expat", - "+third_party/webrtc/base", + "+third_party/webrtc/rtc_base", ]
diff --git a/third_party/libjingle_xmpp/xmllite/qname_unittest.cc b/third_party/libjingle_xmpp/xmllite/qname_unittest.cc index e9009a1..4673079 100644 --- a/third_party/libjingle_xmpp/xmllite/qname_unittest.cc +++ b/third_party/libjingle_xmpp/xmllite/qname_unittest.cc
@@ -10,7 +10,7 @@ #include <string> #include "third_party/libjingle_xmpp/xmllite/qname.h" -#include "third_party/webrtc/base/gunit.h" +#include "third_party/webrtc/rtc_base/gunit.h" using buzz::StaticQName; using buzz::QName;
diff --git a/third_party/libjingle_xmpp/xmllite/xmlbuilder_unittest.cc b/third_party/libjingle_xmpp/xmllite/xmlbuilder_unittest.cc index 2d5d0f2..65b8083 100644 --- a/third_party/libjingle_xmpp/xmllite/xmlbuilder_unittest.cc +++ b/third_party/libjingle_xmpp/xmllite/xmlbuilder_unittest.cc
@@ -14,7 +14,7 @@ #include "third_party/libjingle_xmpp/xmllite/xmlbuilder.h" #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" #include "third_party/libjingle_xmpp/xmllite/xmlparser.h" -#include "third_party/webrtc/base/gunit.h" +#include "third_party/webrtc/rtc_base/gunit.h" using buzz::XmlBuilder; using buzz::XmlElement;
diff --git a/third_party/libjingle_xmpp/xmllite/xmlelement.cc b/third_party/libjingle_xmpp/xmllite/xmlelement.cc index 6cdb920e..02d786d 100644 --- a/third_party/libjingle_xmpp/xmllite/xmlelement.cc +++ b/third_party/libjingle_xmpp/xmllite/xmlelement.cc
@@ -20,7 +20,7 @@ #include "third_party/libjingle_xmpp/xmllite/xmlconstants.h" #include "third_party/libjingle_xmpp/xmllite/xmlparser.h" #include "third_party/libjingle_xmpp/xmllite/xmlprinter.h" -#include "third_party/webrtc/base/checks.h" +#include "third_party/webrtc/rtc_base/checks.h" namespace buzz {
diff --git a/third_party/libjingle_xmpp/xmllite/xmlelement_unittest.cc b/third_party/libjingle_xmpp/xmllite/xmlelement_unittest.cc index c74c236..38fc6d2 100644 --- a/third_party/libjingle_xmpp/xmllite/xmlelement_unittest.cc +++ b/third_party/libjingle_xmpp/xmllite/xmlelement_unittest.cc
@@ -12,8 +12,8 @@ #include <sstream> #include <string> #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" -#include "third_party/webrtc/base/gunit.h" -#include "third_party/webrtc/base/thread.h" +#include "third_party/webrtc/rtc_base/gunit.h" +#include "third_party/webrtc/rtc_base/thread.h" using buzz::QName; using buzz::XmlAttr;
diff --git a/third_party/libjingle_xmpp/xmllite/xmlnsstack_unittest.cc b/third_party/libjingle_xmpp/xmllite/xmlnsstack_unittest.cc index 5a0e6a2a..3480e9eb 100644 --- a/third_party/libjingle_xmpp/xmllite/xmlnsstack_unittest.cc +++ b/third_party/libjingle_xmpp/xmllite/xmlnsstack_unittest.cc
@@ -15,7 +15,7 @@ #include <string> #include "third_party/libjingle_xmpp/xmllite/xmlconstants.h" -#include "third_party/webrtc/base/gunit.h" +#include "third_party/webrtc/rtc_base/gunit.h" using buzz::NS_XML; using buzz::NS_XMLNS;
diff --git a/third_party/libjingle_xmpp/xmllite/xmlparser_unittest.cc b/third_party/libjingle_xmpp/xmllite/xmlparser_unittest.cc index 1d1e9ca4..30bdb85 100644 --- a/third_party/libjingle_xmpp/xmllite/xmlparser_unittest.cc +++ b/third_party/libjingle_xmpp/xmllite/xmlparser_unittest.cc
@@ -13,7 +13,7 @@ #include <string> #include "third_party/libjingle_xmpp/xmllite/qname.h" #include "third_party/libjingle_xmpp/xmllite/xmlparser.h" -#include "third_party/webrtc/base/gunit.h" +#include "third_party/webrtc/rtc_base/gunit.h" using buzz::QName; using buzz::XmlParser;
diff --git a/third_party/libjingle_xmpp/xmllite/xmlprinter_unittest.cc b/third_party/libjingle_xmpp/xmllite/xmlprinter_unittest.cc index 5b52731c..4be90be 100644 --- a/third_party/libjingle_xmpp/xmllite/xmlprinter_unittest.cc +++ b/third_party/libjingle_xmpp/xmllite/xmlprinter_unittest.cc
@@ -16,7 +16,7 @@ #include "third_party/libjingle_xmpp/xmllite/qname.h" #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" #include "third_party/libjingle_xmpp/xmllite/xmlnsstack.h" -#include "third_party/webrtc/base/gunit.h" +#include "third_party/webrtc/rtc_base/gunit.h" using buzz::QName; using buzz::XmlElement;
diff --git a/third_party/libjingle_xmpp/xmpp/DEPS b/third_party/libjingle_xmpp/xmpp/DEPS index 30a60a4..7630113a 100644 --- a/third_party/libjingle_xmpp/xmpp/DEPS +++ b/third_party/libjingle_xmpp/xmpp/DEPS
@@ -1,6 +1,6 @@ include_rules = [ "+third_party/expat", - "+third_party/webrtc/base", + "+third_party/webrtc/rtc_base", "+third_party/webrtc/p2p", ] specific_include_rules = {
diff --git a/third_party/libjingle_xmpp/xmpp/asyncsocket.h b/third_party/libjingle_xmpp/xmpp/asyncsocket.h index 9bd9b71..eb19c617 100644 --- a/third_party/libjingle_xmpp/xmpp/asyncsocket.h +++ b/third_party/libjingle_xmpp/xmpp/asyncsocket.h
@@ -13,7 +13,7 @@ #include <string> -#include "third_party/webrtc/base/sigslot.h" +#include "third_party/webrtc/rtc_base/sigslot.h" namespace rtc { class SocketAddress;
diff --git a/third_party/libjingle_xmpp/xmpp/jid.cc b/third_party/libjingle_xmpp/xmpp/jid.cc index 032ce03..16d2d83 100644 --- a/third_party/libjingle_xmpp/xmpp/jid.cc +++ b/third_party/libjingle_xmpp/xmpp/jid.cc
@@ -16,8 +16,8 @@ #include <string> #include "third_party/libjingle_xmpp/xmpp/constants.h" -#include "third_party/webrtc/base/checks.h" -#include "third_party/webrtc_overrides/webrtc/base/logging.h" +#include "third_party/webrtc/rtc_base/checks.h" +#include "third_party/webrtc_overrides/webrtc/rtc_base/logging.h" namespace buzz {
diff --git a/third_party/libjingle_xmpp/xmpp/jid_unittest.cc b/third_party/libjingle_xmpp/xmpp/jid_unittest.cc index 2fd5ded..982abe1 100644 --- a/third_party/libjingle_xmpp/xmpp/jid_unittest.cc +++ b/third_party/libjingle_xmpp/xmpp/jid_unittest.cc
@@ -9,7 +9,7 @@ */ #include "third_party/libjingle_xmpp/xmpp/jid.h" -#include "third_party/webrtc/base/gunit.h" +#include "third_party/webrtc/rtc_base/gunit.h" using buzz::Jid;
diff --git a/third_party/libjingle_xmpp/xmpp/jingleinfotask.cc b/third_party/libjingle_xmpp/xmpp/jingleinfotask.cc index ccad354b..5186c64 100644 --- a/third_party/libjingle_xmpp/xmpp/jingleinfotask.cc +++ b/third_party/libjingle_xmpp/xmpp/jingleinfotask.cc
@@ -13,7 +13,7 @@ #include "third_party/libjingle_xmpp/xmpp/constants.h" #include "third_party/libjingle_xmpp/xmpp/xmppclient.h" #include "third_party/libjingle_xmpp/xmpp/xmpptask.h" -#include "third_party/webrtc/base/socketaddress.h" +#include "third_party/webrtc/rtc_base/socketaddress.h" namespace buzz {
diff --git a/third_party/libjingle_xmpp/xmpp/jingleinfotask.h b/third_party/libjingle_xmpp/xmpp/jingleinfotask.h index da1fa9a81..12dd922 100644 --- a/third_party/libjingle_xmpp/xmpp/jingleinfotask.h +++ b/third_party/libjingle_xmpp/xmpp/jingleinfotask.h
@@ -15,7 +15,7 @@ #include "third_party/libjingle_xmpp/xmpp/xmppengine.h" #include "third_party/libjingle_xmpp/xmpp/xmpptask.h" -#include "third_party/webrtc/base/sigslot.h" +#include "third_party/webrtc/rtc_base/sigslot.h" #include "third_party/webrtc/p2p/client/httpportallocator.h" namespace buzz {
diff --git a/third_party/libjingle_xmpp/xmpp/prexmppauth.h b/third_party/libjingle_xmpp/xmpp/prexmppauth.h index 89d327b..27667cd 100644 --- a/third_party/libjingle_xmpp/xmpp/prexmppauth.h +++ b/third_party/libjingle_xmpp/xmpp/prexmppauth.h
@@ -12,7 +12,7 @@ #define WEBRTC_LIBJINGLE_XMPP_PREXMPPAUTH_H_ #include "third_party/libjingle_xmpp/xmpp/saslhandler.h" -#include "third_party/webrtc/base/sigslot.h" +#include "third_party/webrtc/rtc_base/sigslot.h" namespace rtc { class SocketAddress;
diff --git a/third_party/libjingle_xmpp/xmpp/saslmechanism.cc b/third_party/libjingle_xmpp/xmpp/saslmechanism.cc index 30ac9c77..e9348c92 100644 --- a/third_party/libjingle_xmpp/xmpp/saslmechanism.cc +++ b/third_party/libjingle_xmpp/xmpp/saslmechanism.cc
@@ -11,7 +11,7 @@ #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" #include "third_party/libjingle_xmpp/xmpp/constants.h" #include "third_party/libjingle_xmpp/xmpp/saslmechanism.h" -#include "third_party/webrtc/base/base64.h" +#include "third_party/webrtc/rtc_base/base64.h" using rtc::Base64;
diff --git a/third_party/libjingle_xmpp/xmpp/util_unittest.cc b/third_party/libjingle_xmpp/xmpp/util_unittest.cc index bd2b349..e2af616 100644 --- a/third_party/libjingle_xmpp/xmpp/util_unittest.cc +++ b/third_party/libjingle_xmpp/xmpp/util_unittest.cc
@@ -14,7 +14,7 @@ #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" #include "third_party/libjingle_xmpp/xmpp/util_unittest.h" #include "third_party/libjingle_xmpp/xmpp/xmppengine.h" -#include "third_party/webrtc/base/gunit.h" +#include "third_party/webrtc/rtc_base/gunit.h" namespace buzz {
diff --git a/third_party/libjingle_xmpp/xmpp/xmppclient.cc b/third_party/libjingle_xmpp/xmpp/xmppclient.cc index 97588738..c2a8280 100644 --- a/third_party/libjingle_xmpp/xmpp/xmppclient.cc +++ b/third_party/libjingle_xmpp/xmpp/xmppclient.cc
@@ -14,9 +14,9 @@ #include "third_party/libjingle_xmpp/xmpp/plainsaslhandler.h" #include "third_party/libjingle_xmpp/xmpp/prexmppauth.h" #include "third_party/libjingle_xmpp/xmpp/saslplainmechanism.h" -#include "third_party/webrtc/base/sigslot.h" -#include "third_party/webrtc/base/stringutils.h" -#include "third_party/webrtc_overrides/webrtc/base/logging.h" +#include "third_party/webrtc/rtc_base/sigslot.h" +#include "third_party/webrtc/rtc_base/stringutils.h" +#include "third_party/webrtc_overrides/webrtc/rtc_base/logging.h" #include "xmpptask.h" namespace buzz {
diff --git a/third_party/libjingle_xmpp/xmpp/xmppclient.h b/third_party/libjingle_xmpp/xmpp/xmppclient.h index f486e44a3..6ea7a60f 100644 --- a/third_party/libjingle_xmpp/xmpp/xmppclient.h +++ b/third_party/libjingle_xmpp/xmpp/xmppclient.h
@@ -19,7 +19,7 @@ #include "third_party/libjingle_xmpp/xmpp/xmppclientsettings.h" #include "third_party/libjingle_xmpp/xmpp/xmppengine.h" #include "third_party/libjingle_xmpp/xmpp/xmpptask.h" -#include "third_party/webrtc/base/sigslot.h" +#include "third_party/webrtc/rtc_base/sigslot.h" namespace buzz {
diff --git a/third_party/libjingle_xmpp/xmpp/xmppengine_unittest.cc b/third_party/libjingle_xmpp/xmpp/xmppengine_unittest.cc index 5e399154e..ba18d4f 100644 --- a/third_party/libjingle_xmpp/xmpp/xmppengine_unittest.cc +++ b/third_party/libjingle_xmpp/xmpp/xmppengine_unittest.cc
@@ -19,7 +19,7 @@ #include "third_party/libjingle_xmpp/xmpp/saslplainmechanism.h" #include "third_party/libjingle_xmpp/xmpp/util_unittest.h" #include "third_party/libjingle_xmpp/xmpp/xmppengine.h" -#include "third_party/webrtc/base/gunit.h" +#include "third_party/webrtc/rtc_base/gunit.h" using buzz::Jid; using buzz::QName;
diff --git a/third_party/libjingle_xmpp/xmpp/xmppengineimpl.cc b/third_party/libjingle_xmpp/xmpp/xmppengineimpl.cc index 882bf36..12ed7c5e 100644 --- a/third_party/libjingle_xmpp/xmpp/xmppengineimpl.cc +++ b/third_party/libjingle_xmpp/xmpp/xmppengineimpl.cc
@@ -19,7 +19,7 @@ #include "third_party/libjingle_xmpp/xmpp/constants.h" #include "third_party/libjingle_xmpp/xmpp/saslhandler.h" #include "third_party/libjingle_xmpp/xmpp/xmpplogintask.h" -#include "third_party/webrtc/base/checks.h" +#include "third_party/webrtc/rtc_base/checks.h" namespace buzz {
diff --git a/third_party/libjingle_xmpp/xmpp/xmpplogintask.cc b/third_party/libjingle_xmpp/xmpp/xmpplogintask.cc index ae19b99e..ac705dd 100644 --- a/third_party/libjingle_xmpp/xmpp/xmpplogintask.cc +++ b/third_party/libjingle_xmpp/xmpp/xmpplogintask.cc
@@ -18,7 +18,7 @@ #include "third_party/libjingle_xmpp/xmpp/jid.h" #include "third_party/libjingle_xmpp/xmpp/saslmechanism.h" #include "third_party/libjingle_xmpp/xmpp/xmppengineimpl.h" -#include "third_party/webrtc/base/base64.h" +#include "third_party/webrtc/rtc_base/base64.h" using rtc::ConstantLabel;
diff --git a/third_party/libjingle_xmpp/xmpp/xmpplogintask.h b/third_party/libjingle_xmpp/xmpp/xmpplogintask.h index 82fa3420..98d31f8 100644 --- a/third_party/libjingle_xmpp/xmpp/xmpplogintask.h +++ b/third_party/libjingle_xmpp/xmpp/xmpplogintask.h
@@ -17,7 +17,7 @@ #include "third_party/libjingle_xmpp/xmpp/jid.h" #include "third_party/libjingle_xmpp/xmpp/xmppengine.h" -#include "third_party/webrtc_overrides/webrtc/base/logging.h" +#include "third_party/webrtc_overrides/webrtc/rtc_base/logging.h" namespace buzz {
diff --git a/third_party/libjingle_xmpp/xmpp/xmpplogintask_unittest.cc b/third_party/libjingle_xmpp/xmpp/xmpplogintask_unittest.cc index 99bf934b2..11fc4f9 100644 --- a/third_party/libjingle_xmpp/xmpp/xmpplogintask_unittest.cc +++ b/third_party/libjingle_xmpp/xmpp/xmpplogintask_unittest.cc
@@ -19,7 +19,7 @@ #include "third_party/libjingle_xmpp/xmpp/saslplainmechanism.h" #include "third_party/libjingle_xmpp/xmpp/util_unittest.h" #include "third_party/libjingle_xmpp/xmpp/xmppengine.h" -#include "third_party/webrtc/base/gunit.h" +#include "third_party/webrtc/rtc_base/gunit.h" #include "third_party/webrtc/typedefs.h" using buzz::Jid;
diff --git a/third_party/libjingle_xmpp/xmpp/xmppstanzaparser_unittest.cc b/third_party/libjingle_xmpp/xmpp/xmppstanzaparser_unittest.cc index 2e9b9f5..298d065 100644 --- a/third_party/libjingle_xmpp/xmpp/xmppstanzaparser_unittest.cc +++ b/third_party/libjingle_xmpp/xmpp/xmppstanzaparser_unittest.cc
@@ -13,7 +13,7 @@ #include <string> #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" #include "third_party/libjingle_xmpp/xmpp/xmppstanzaparser.h" -#include "third_party/webrtc/base/gunit.h" +#include "third_party/webrtc/rtc_base/gunit.h" using buzz::QName; using buzz::XmlElement;
diff --git a/third_party/libjingle_xmpp/xmpp/xmpptask.h b/third_party/libjingle_xmpp/xmpp/xmpptask.h index 822091c3..5ad07005 100644 --- a/third_party/libjingle_xmpp/xmpp/xmpptask.h +++ b/third_party/libjingle_xmpp/xmpp/xmpptask.h
@@ -18,8 +18,8 @@ #include "third_party/libjingle_xmpp/task_runner/task.h" #include "third_party/libjingle_xmpp/task_runner/taskparent.h" #include "third_party/libjingle_xmpp/xmpp/xmppengine.h" -#include "third_party/webrtc/base/constructormagic.h" -#include "third_party/webrtc/base/sigslot.h" +#include "third_party/webrtc/rtc_base/constructormagic.h" +#include "third_party/webrtc/rtc_base/sigslot.h" namespace buzz {
diff --git a/third_party/material_design_icons/BUILD.gn b/third_party/material_design_icons/BUILD.gn new file mode 100644 index 0000000..ad6fa40 --- /dev/null +++ b/third_party/material_design_icons/BUILD.gn
@@ -0,0 +1,56 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ios/imageset.gni") + +# List all resources used by Chrome on iOS (including those used by the private +# downstream repository). Not all resources are listed as there are thousands +# of resources in material_design_icons repository. +# +# The image sets are described via strings following the $category/$image_name +# pattern and do not correspond to real paths. +_image_sets = [ + "action/ic_account_circle", + "action/ic_account_circle_48pt", + "action/ic_delete", + "action/ic_info", + "action/ic_lock_18pt", + "action/ic_open_in_browser", + "action/ic_print", + "action/ic_report_problem", + "action/ic_search", + "communication/ic_comment", + "communication/ic_email", + "communication/ic_message", + "content/ic_link", + "editor/ic_mode_edit", + "file/ic_file_download", + "hardware/ic_keyboard_arrow_right", + "image/ic_photo_camera", + "image/ic_photo_library", + "navigation/ic_arrow_back", + "navigation/ic_check", + "navigation/ic_chevron_left", + "navigation/ic_chevron_right", + "navigation/ic_close", + "navigation/ic_more_vert", + "navigation/ic_refresh", +] + +# Define all the imagesets using the description from _image_sets variable. +# All imagesets are assumed to be universal and to include @1x, @2x and @3x +# version of the images. +foreach(_image_set, _image_sets) { + _category = get_path_info(_image_set, "dir") + _image_name = get_path_info(_image_set, "file") + imageset(_image_name) { + _imageset_dir = "src/$_category/ios/$_image_name.imageset" + sources = [ + "$_imageset_dir/${_image_name}.png", + "$_imageset_dir/${_image_name}_2x.png", + "$_imageset_dir/${_image_name}_3x.png", + "$_imageset_dir/Contents.json", + ] + } +}
diff --git a/third_party/mesa/BUILD.gn b/third_party/mesa/BUILD.gn index 0bef730..f799dbaf 100644 --- a/third_party/mesa/BUILD.gn +++ b/third_party/mesa/BUILD.gn
@@ -774,3 +774,26 @@ ] } } + +if (is_linux) { + config("wayland_drm_protocol_config") { + include_dirs = [ "$generated_src_dir/egl/wayland/wayland-drm" ] + } + + static_library("wayland_drm_protocol") { + sources = [ + "$generated_src_dir/egl/wayland/wayland-drm/wayland-drm-client-protocol.h", + "$generated_src_dir/egl/wayland/wayland-drm/wayland-drm-protocol.c", + "$generated_src_dir/egl/wayland/wayland-drm/wayland-drm-server-protocol.h", + ] + + deps = [ + "//third_party/wayland:wayland_util", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + public_configs = [ ":wayland_drm_protocol_config" ] + } +}
diff --git a/third_party/polymer/v1_0/bower.json b/third_party/polymer/v1_0/bower.json index bd9eea1..1e6d06a 100644 --- a/third_party/polymer/v1_0/bower.json +++ b/third_party/polymer/v1_0/bower.json
@@ -36,6 +36,8 @@ "paper-behaviors": "PolymerElements/paper-behaviors#1.0.12", "paper-button": "PolymerElements/paper-button#1.0.13", "paper-checkbox": "PolymerElements/paper-checkbox#1.4.0", + "paper-dialog-behavior": "PolymerElements/paper-dialog-behavior#1.2.7", + "paper-dialog": "PolymerElements/paper-dialog#1.1.0", "paper-drawer-panel": "PolymerElements/paper-drawer-panel#1.0.10", "paper-fab": "PolymerElements/paper-fab#1.2.0", "paper-header-panel": "PolymerElements/paper-header-panel#1.1.6",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/bower.json b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/bower.json new file mode 100644 index 0000000..cbe17d3 --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/bower.json
@@ -0,0 +1,40 @@ +{ + "name": "paper-dialog-behavior", + "version": "1.2.7", + "description": "Implements a behavior used for material design dialogs", + "authors": "The Polymer Authors", + "keywords": [ + "web-components", + "polymer", + "dialog", + "overlay", + "behavior" + ], + "main": "paper-dialog-behavior.html", + "private": true, + "repository": { + "type": "git", + "url": "git://github.com/PolymerElements/paper-dialog-behavior" + }, + "license": "http://polymer.github.io/LICENSE.txt", + "homepage": "https://github.com/PolymerElements/paper-dialog-behavior", + "ignore": [], + "dependencies": { + "iron-overlay-behavior": "PolymerElements/iron-overlay-behavior#^1.0.0", + "paper-styles": "PolymerElements/paper-styles#^1.1.0", + "polymer": "Polymer/polymer#^1.1.0" + }, + "devDependencies": { + "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", + "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0", + "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0", + "paper-button": "PolymerElements/paper-button#^1.0.0", + "paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^1.0.0", + "paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#^1.0.0", + "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0", + "paper-item": "PolymerElements/paper-item#^1.0.0", + "paper-listbox": "PolymerElements/paper-listbox#^1.0.0", + "web-component-tester": "^4.0.0", + "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" + } +}
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/compiled_resources2.gyp b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/compiled_resources2.gyp new file mode 100644 index 0000000..d5a26fd --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/compiled_resources2.gyp
@@ -0,0 +1,16 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# NOTE: Created with generate_compiled_resources_gyp.py, please do not edit. +{ + 'targets': [ + { + 'target_name': 'paper-dialog-behavior-extracted', + 'dependencies': [ + '../iron-overlay-behavior/compiled_resources2.gyp:iron-overlay-behavior-extracted', + ], + 'includes': ['../../../../closure_compiler/compile_js2.gypi'], + }, + ], +}
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior-extracted.js new file mode 100644 index 0000000..0dd39ee --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior-extracted.js
@@ -0,0 +1,123 @@ +/** +Use `Polymer.PaperDialogBehavior` and `paper-dialog-shared-styles.html` to implement a Material Design +dialog. + +For example, if `<paper-dialog-impl>` implements this behavior: + + <paper-dialog-impl> + <h2>Header</h2> + <div>Dialog body</div> + <div class="buttons"> + <paper-button dialog-dismiss>Cancel</paper-button> + <paper-button dialog-confirm>Accept</paper-button> + </div> + </paper-dialog-impl> + +`paper-dialog-shared-styles.html` provide styles for a header, content area, and an action area for buttons. +Use the `<h2>` tag for the header and the `buttons` class for the action area. You can use the +`paper-dialog-scrollable` element (in its own repository) if you need a scrolling content area. + +Use the `dialog-dismiss` and `dialog-confirm` attributes on interactive controls to close the +dialog. If the user dismisses the dialog with `dialog-confirm`, the `closingReason` will update +to include `confirmed: true`. + +### Accessibility + +This element has `role="dialog"` by default. Depending on the context, it may be more appropriate +to override this attribute with `role="alertdialog"`. + +If `modal` is set, the element will prevent the focus from exiting the element. +It will also ensure that focus remains in the dialog. + +@hero hero.svg +@demo demo/index.html +@polymerBehavior Polymer.PaperDialogBehavior +*/ + + Polymer.PaperDialogBehaviorImpl = { + + hostAttributes: { + 'role': 'dialog', + 'tabindex': '-1' + }, + + properties: { + + /** + * If `modal` is true, this implies `no-cancel-on-outside-click`, `no-cancel-on-esc-key` and `with-backdrop`. + */ + modal: { + type: Boolean, + value: false + } + + }, + + observers: [ + '_modalChanged(modal, _readied)' + ], + + listeners: { + 'tap': '_onDialogClick' + }, + + ready: function () { + // Only now these properties can be read. + this.__prevNoCancelOnOutsideClick = this.noCancelOnOutsideClick; + this.__prevNoCancelOnEscKey = this.noCancelOnEscKey; + this.__prevWithBackdrop = this.withBackdrop; + }, + + _modalChanged: function(modal, readied) { + // modal implies noCancelOnOutsideClick, noCancelOnEscKey and withBackdrop. + // We need to wait for the element to be ready before we can read the + // properties values. + if (!readied) { + return; + } + + if (modal) { + this.__prevNoCancelOnOutsideClick = this.noCancelOnOutsideClick; + this.__prevNoCancelOnEscKey = this.noCancelOnEscKey; + this.__prevWithBackdrop = this.withBackdrop; + this.noCancelOnOutsideClick = true; + this.noCancelOnEscKey = true; + this.withBackdrop = true; + } else { + // If the value was changed to false, let it false. + this.noCancelOnOutsideClick = this.noCancelOnOutsideClick && + this.__prevNoCancelOnOutsideClick; + this.noCancelOnEscKey = this.noCancelOnEscKey && + this.__prevNoCancelOnEscKey; + this.withBackdrop = this.withBackdrop && this.__prevWithBackdrop; + } + }, + + _updateClosingReasonConfirmed: function(confirmed) { + this.closingReason = this.closingReason || {}; + this.closingReason.confirmed = confirmed; + }, + + /** + * Will dismiss the dialog if user clicked on an element with dialog-dismiss + * or dialog-confirm attribute. + */ + _onDialogClick: function(event) { + // Search for the element with dialog-confirm or dialog-dismiss, + // from the root target until this (excluded). + var path = Polymer.dom(event).path; + for (var i = 0; i < path.indexOf(this); i++) { + var target = path[i]; + if (target.hasAttribute && (target.hasAttribute('dialog-dismiss') || target.hasAttribute('dialog-confirm'))) { + this._updateClosingReasonConfirmed(target.hasAttribute('dialog-confirm')); + this.close(); + event.stopPropagation(); + break; + } + } + } + + }; + + /** @polymerBehavior */ + Polymer.PaperDialogBehavior = [Polymer.IronOverlayBehavior, Polymer.PaperDialogBehaviorImpl]; \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior.html b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior.html new file mode 100644 index 0000000..0400742f --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior.html
@@ -0,0 +1,12 @@ +<!-- +@license +Copyright (c) 2015 The Polymer Project Authors. All rights reserved. +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt +The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt +Code distributed by Google as part of the polymer project is also +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt +--><html><head><link rel="import" href="../polymer/polymer.html"> +<link rel="import" href="../iron-overlay-behavior/iron-overlay-behavior.html"> + +</head><body><script src="paper-dialog-behavior-extracted.js"></script></body></html> \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-common.css b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-common.css new file mode 100644 index 0000000..560b0a5 --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-common.css
@@ -0,0 +1,57 @@ +/* +@license +Copyright (c) 2015 The Polymer Project Authors. All rights reserved. +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt +The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt +Code distributed by Google as part of the polymer project is also +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt +*/ + +:host { + display: block; + margin: 24px 40px; + + background: var(--paper-dialog-background-color, --primary-background-color); + color: var(--paper-dialog-color, --primary-text-color); + + @apply(--paper-font-body1); + @apply(--shadow-elevation-16dp); + @apply(--paper-dialog); +} + +:host > ::content > * { + margin-top: 20px; + padding: 0 24px; +} + +:host > ::content > .no-padding { + padding: 0; +} + +:host > ::content > *:first-child { + margin-top: 24px; +} + +:host > ::content > *:last-child { + margin-bottom: 24px; +} + +:host > ::content h2 { + position: relative; + margin: 0; + @apply(--paper-font-title); + + @apply(--paper-dialog-title); +} + +:host > ::content .buttons { + position: relative; + padding: 8px 8px 8px 24px; + margin: 0; + + color: var(--paper-dialog-button-color, --primary-color); + + @apply(--layout-horizontal); + @apply(--layout-end-justified); +}
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-shared-styles.html b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-shared-styles.html new file mode 100644 index 0000000..35ea74b --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-shared-styles.html
@@ -0,0 +1,83 @@ +<!-- +@license +Copyright (c) 2015 The Polymer Project Authors. All rights reserved. +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt +The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt +Code distributed by Google as part of the polymer project is also +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt +--> + +<link rel="import" href="../polymer/polymer.html"> +<link rel="import" href="../iron-flex-layout/iron-flex-layout.html"> +<link rel="import" href="../paper-styles/default-theme.html"> +<link rel="import" href="../paper-styles/typography.html"> +<link rel="import" href="../paper-styles/shadow.html"> + +<!-- +### Styling + +The following custom properties and mixins are available for styling. + +Custom property | Description | Default +----------------|-------------|---------- +`--paper-dialog-background-color` | Dialog background color | `--primary-background-color` +`--paper-dialog-color` | Dialog foreground color | `--primary-text-color` +`--paper-dialog` | Mixin applied to the dialog | `{}` +`--paper-dialog-title` | Mixin applied to the title (`<h2>`) element | `{}` +`--paper-dialog-button-color` | Button area foreground color | `--default-primary-color` +--> + +<dom-module id="paper-dialog-shared-styles"> + <template> + <style> + :host { + display: block; + margin: 24px 40px; + + background: var(--paper-dialog-background-color, --primary-background-color); + color: var(--paper-dialog-color, --primary-text-color); + + @apply(--paper-font-body1); + @apply(--shadow-elevation-16dp); + @apply(--paper-dialog); + } + + :host > ::content > * { + margin-top: 20px; + padding: 0 24px; + } + + :host > ::content > .no-padding { + padding: 0; + } + + :host > ::content > *:first-child { + margin-top: 24px; + } + + :host > ::content > *:last-child { + margin-bottom: 24px; + } + + :host > ::content h2 { + position: relative; + margin: 0; + @apply(--paper-font-title); + + @apply(--paper-dialog-title); + } + + :host > ::content .buttons { + position: relative; + padding: 8px 8px 8px 24px; + margin: 0; + + color: var(--paper-dialog-button-color, --primary-color); + + @apply(--layout-horizontal); + @apply(--layout-end-justified); + } + </style> + </template> +</dom-module>
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog/bower.json b/third_party/polymer/v1_0/components-chromium/paper-dialog/bower.json new file mode 100644 index 0000000..e7882a55 --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/paper-dialog/bower.json
@@ -0,0 +1,40 @@ +{ + "name": "paper-dialog", + "description": "A Material Design dialog", + "version": "1.1.0", + "authors": "The Polymer Authors", + "keywords": [ + "web-components", + "polymer", + "dialog", + "overlay" + ], + "main": "paper-dialog.html", + "private": true, + "repository": { + "type": "git", + "url": "git://github.com/PolymerElements/paper-dialog" + }, + "license": "http://polymer.github.io/LICENSE.txt", + "homepage": "https://github.com/PolymerElements/paper-dialog", + "ignore": [], + "dependencies": { + "neon-animation": "PolymerElements/neon-animation#^1.0.0", + "paper-dialog-behavior": "PolymerElements/paper-dialog-behavior#^1.0.0", + "iron-overlay-behavior": "PolymerElements/iron-overlay-behavior#^1.7.0", + "paper-styles": "PolymerElements/paper-styles#^1.0.0", + "polymer": "Polymer/polymer#^1.1.0" + }, + "devDependencies": { + "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", + "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0", + "paper-button": "PolymerElements/paper-button#^1.0.0", + "paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^1.0.0", + "paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#^1.0.0", + "paper-item": "PolymerElements/paper-item#^1.0.0", + "paper-menu": "PolymerElements/paper-menu#^1.0.0", + "test-fixture": "PolymerElements/test-fixture#^1.0.0", + "web-component-tester": "^4.0.0", + "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" + } +}
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog/compiled_resources2.gyp b/third_party/polymer/v1_0/components-chromium/paper-dialog/compiled_resources2.gyp new file mode 100644 index 0000000..f7d3cd7 --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/paper-dialog/compiled_resources2.gyp
@@ -0,0 +1,17 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# NOTE: Created with generate_compiled_resources_gyp.py, please do not edit. +{ + 'targets': [ + { + 'target_name': 'paper-dialog-extracted', + 'dependencies': [ + '../neon-animation/compiled_resources2.gyp:neon-animation-runner-behavior-extracted', + '../paper-dialog-behavior/compiled_resources2.gyp:paper-dialog-behavior-extracted', + ], + 'includes': ['../../../../closure_compiler/compile_js2.gypi'], + }, + ], +}
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog/paper-dialog-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-dialog/paper-dialog-extracted.js new file mode 100644 index 0000000..570cf42 --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/paper-dialog/paper-dialog-extracted.js
@@ -0,0 +1,36 @@ +(function() { + + Polymer({ + + is: 'paper-dialog', + + behaviors: [ + Polymer.PaperDialogBehavior, + Polymer.NeonAnimationRunnerBehavior + ], + + listeners: { + 'neon-animation-finish': '_onNeonAnimationFinish' + }, + + _renderOpened: function() { + this.cancelAnimation(); + this.playAnimation('entry'); + }, + + _renderClosed: function() { + this.cancelAnimation(); + this.playAnimation('exit'); + }, + + _onNeonAnimationFinish: function() { + if (this.opened) { + this._finishRenderOpened(); + } else { + this._finishRenderClosed(); + } + } + + }); + +})(); \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog/paper-dialog.html b/third_party/polymer/v1_0/components-chromium/paper-dialog/paper-dialog.html new file mode 100644 index 0000000..8c40551 --- /dev/null +++ b/third_party/polymer/v1_0/components-chromium/paper-dialog/paper-dialog.html
@@ -0,0 +1,76 @@ +<!-- +@license +Copyright (c) 2015 The Polymer Project Authors. All rights reserved. +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt +The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt +Code distributed by Google as part of the polymer project is also +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt +--><html><head><link rel="import" href="../polymer/polymer.html"> +<link rel="import" href="../neon-animation/neon-animation-runner-behavior.html"> +<link rel="import" href="../paper-dialog-behavior/paper-dialog-behavior.html"> +<link rel="import" href="../paper-dialog-behavior/paper-dialog-shared-styles.html"> +<!-- +Material design: [Dialogs](https://www.google.com/design/spec/components/dialogs.html) + +`<paper-dialog>` is a dialog with Material Design styling and optional animations when it is +opened or closed. It provides styles for a header, content area, and an action area for buttons. +You can use the `<paper-dialog-scrollable>` element (in its own repository) if you need a scrolling +content area. To autofocus a specific child element after opening the dialog, give it the `autofocus` +attribute. See `Polymer.PaperDialogBehavior` and `Polymer.IronOverlayBehavior` for specifics. + +For example, the following code implements a dialog with a header, scrolling content area and +buttons. Focus will be given to the `dialog-confirm` button when the dialog is opened. + + <paper-dialog> + <h2>Header</h2> + <paper-dialog-scrollable> + Lorem ipsum... + </paper-dialog-scrollable> + <div class="buttons"> + <paper-button dialog-dismiss>Cancel</paper-button> + <paper-button dialog-confirm autofocus>Accept</paper-button> + </div> + </paper-dialog> + +### Styling + +See the docs for `Polymer.PaperDialogBehavior` for the custom properties available for styling +this element. + +### Animations + +Set the `entry-animation` and/or `exit-animation` attributes to add an animation when the dialog +is opened or closed. See the documentation in +[PolymerElements/neon-animation](https://github.com/PolymerElements/neon-animation) for more info. + +For example: + + <link rel="import" href="components/neon-animation/animations/scale-up-animation.html"> + <link rel="import" href="components/neon-animation/animations/fade-out-animation.html"> + + <paper-dialog entry-animation="scale-up-animation" + exit-animation="fade-out-animation"> + <h2>Header</h2> + <div>Dialog body</div> + </paper-dialog> + +### Accessibility + +See the docs for `Polymer.PaperDialogBehavior` for accessibility features implemented by this +element. + +@group Paper Elements +@element paper-dialog +@hero hero.svg +@demo demo/index.html +--> + +</head><body><dom-module id="paper-dialog"> + <template> + <style include="paper-dialog-shared-styles"></style> + <content></content> + </template> +</dom-module> + +<script src="paper-dialog-extracted.js"></script></body></html> \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components_summary.txt b/third_party/polymer/v1_0/components_summary.txt index e63da14..61752d35 100644 --- a/third_party/polymer/v1_0/components_summary.txt +++ b/third_party/polymer/v1_0/components_summary.txt
@@ -202,6 +202,18 @@ Revision: 1d1c9439fe3a056356233e04171fd9c62f0857fb Tree link: https://github.com/PolymerElements/paper-checkbox/tree/v1.4.0 +Name: paper-dialog +Repository: https://github.com/PolymerElements/paper-dialog.git +Tree: v1.1.0 +Revision: 7f31fa918fbd562b516eb262f1ed527dcaf7b7c0 +Tree link: https://github.com/PolymerElements/paper-dialog/tree/v1.1.0 + +Name: paper-dialog-behavior +Repository: https://github.com/PolymerElements/paper-dialog-behavior.git +Tree: v1.2.7 +Revision: decc77ca55c0381cf01d7409ddf1eb966543e84e +Tree link: https://github.com/PolymerElements/paper-dialog-behavior/tree/v1.2.7 + Name: paper-drawer-panel Repository: https://github.com/PolymerElements/paper-drawer-panel.git Tree: v1.0.10
diff --git a/third_party/snappy/OWNERS b/third_party/snappy/OWNERS index 13f203d..c6b9aa9f 100644 --- a/third_party/snappy/OWNERS +++ b/third_party/snappy/OWNERS
@@ -1,5 +1,8 @@ +# Primary +pwnall@chromium.org + +# Secondary jsbell@chromium.org -kinuko@chromium.org michaeln@chromium.org # TEAM: storage-dev@chromium.org
diff --git a/third_party/snappy/README.chromium b/third_party/snappy/README.chromium index b9808e9..f0a0ec3 100644 --- a/third_party/snappy/README.chromium +++ b/third_party/snappy/README.chromium
@@ -1,7 +1,7 @@ Name: Snappy: A fast compressor/decompressor Short Name: snappy URL: http://google.github.io/snappy/ -Version: 1.1.4-head +Version: 1.1.5 License: New BSD License File: src/COPYING Security Critical: yes @@ -10,7 +10,9 @@ Compression library used by LevelDB. Local Additions: -* gyp file for building in chromium +* gn file for building in chromium * Suppress MSVC signed/unsigned warning - https://code.google.com/p/snappy/issues/detail?id=71 * Suppress MSVC x64 size_t warnings - https://code.google.com/p/snappy/issues/detail?id=75 -* {mac,linux,win32}/snappy-stubs-public.h autogenerated public headers +* {mac,linux,win32}/{config,snappy-stubs-public}.h autogenerated public headers + * generated using: mkdir -p out && cd out && cmake .. && cmake --build . + * output in out/{config,snappy-stubs-public}.h
diff --git a/third_party/snappy/linux/config.h b/third_party/snappy/linux/config.h index 13a6289..80e39be9 100644 --- a/third_party/snappy/linux/config.h +++ b/third_party/snappy/linux/config.h
@@ -1,8 +1,5 @@ -/* config.h. Generated from config.h.in by configure. */ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define if building universal (internal helper macro) */ -/* #undef AC_APPLE_UNIVERSAL_BUILD */ +#ifndef SNAPPY_CONFIG_H +#define SNAPPY_CONFIG_H 1 /* Define to 1 if the compiler supports __builtin_ctz and friends. */ #define HAVE_BUILTIN_CTZ 1 @@ -25,21 +22,15 @@ /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 -/* Define to 1 if you have the `fastlz' library (-lfastlz). */ -/* #undef HAVE_LIBFASTLZ */ - -/* Define to 1 if you have the `lzf' library (-llzf). */ -/* #undef HAVE_LIBLZF */ - /* Define to 1 if you have the `lzo2' library (-llzo2). */ /* #undef HAVE_LIBLZO2 */ -/* Define to 1 if you have the `quicklz' library (-lquicklz). */ -/* #undef HAVE_LIBQUICKLZ */ - /* Define to 1 if you have the `z' library (-lz). */ #define HAVE_LIBZ 1 +/* Define to 1 if you have the <sys/uio.h> header file. */ +#define HAVE_SYS_UIO_H 1 + /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 @@ -85,51 +76,15 @@ /* Define to 1 if you have the <windows.h> header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#define LT_OBJDIR ".libs/" - -/* Name of package */ -#define PACKAGE "snappy" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "snappy" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "snappy 1.1.4" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "snappy" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "1.1.4" - /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 -/* Version number of package */ -#define VERSION "1.1.4" - /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -/* # undef WORDS_BIGENDIAN */ -# endif + significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +#if defined(_MSC_VER) && (_MSC_VER <= 1900) +typedef __int64 ssize_t; #endif -/* Define to `unsigned int' if <sys/types.h> does not define. */ -/* #undef size_t */ - -/* Define to `int' if <sys/types.h> does not define. */ -/* #undef ssize_t */ +#endif
diff --git a/third_party/snappy/linux/snappy-stubs-public.h b/third_party/snappy/linux/snappy-stubs-public.h index 253d4c3..b8a60c6 100644 --- a/third_party/snappy/linux/snappy-stubs-public.h +++ b/third_party/snappy/linux/snappy-stubs-public.h
@@ -50,7 +50,7 @@ #define SNAPPY_MAJOR 1 #define SNAPPY_MINOR 1 -#define SNAPPY_PATCHLEVEL 4 +#define SNAPPY_PATCHLEVEL 5 #define SNAPPY_VERSION \ ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL) @@ -86,7 +86,7 @@ void operator=(const TypeName&) #endif -#if 0 +#if !1 // Windows does not have an iovec type, yet the concept is universally useful. // It is simple to define it ourselves, so we put it inside our own namespace. struct iovec {
diff --git a/third_party/snappy/mac/config.h b/third_party/snappy/mac/config.h index c4795f8..4b29b41 100644 --- a/third_party/snappy/mac/config.h +++ b/third_party/snappy/mac/config.h
@@ -1,8 +1,5 @@ -/* config.h. Generated from config.h.in by configure. */ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define if building universal (internal helper macro) */ -/* #undef AC_APPLE_UNIVERSAL_BUILD */ +#ifndef SNAPPY_CONFIG_H +#define SNAPPY_CONFIG_H 1 /* Define to 1 if the compiler supports __builtin_ctz and friends. */ #define HAVE_BUILTIN_CTZ 1 @@ -25,21 +22,15 @@ /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 -/* Define to 1 if you have the `fastlz' library (-lfastlz). */ -/* #undef HAVE_LIBFASTLZ */ - -/* Define to 1 if you have the `lzf' library (-llzf). */ -/* #undef HAVE_LIBLZF */ - /* Define to 1 if you have the `lzo2' library (-llzo2). */ /* #undef HAVE_LIBLZO2 */ -/* Define to 1 if you have the `quicklz' library (-lquicklz). */ -/* #undef HAVE_LIBQUICKLZ */ - /* Define to 1 if you have the `z' library (-lz). */ #define HAVE_LIBZ 1 +/* Define to 1 if you have the <sys/uio.h> header file. */ +#define HAVE_SYS_UIO_H 1 + /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 @@ -85,50 +76,15 @@ /* Define to 1 if you have the <windows.h> header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#define LT_OBJDIR ".libs/" - -/* Name of package */ -#define PACKAGE "snappy" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "snappy" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "snappy 1.1.4" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "snappy" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "1.1.4" - /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 -/* Version number of package */ -#define VERSION "1.1.4" - /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -/* # undef WORDS_BIGENDIAN */ -# endif + significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +#if defined(_MSC_VER) && (_MSC_VER <= 1900) +typedef __int64 ssize_t; #endif -/* Define to `unsigned int' if <sys/types.h> does not define. */ -/* #undef size_t */ - -/* Define to `int' if <sys/types.h> does not define. */ -/* #undef ssize_t */ +#endif
diff --git a/third_party/snappy/mac/snappy-stubs-public.h b/third_party/snappy/mac/snappy-stubs-public.h index 253d4c3..b8a60c6 100644 --- a/third_party/snappy/mac/snappy-stubs-public.h +++ b/third_party/snappy/mac/snappy-stubs-public.h
@@ -50,7 +50,7 @@ #define SNAPPY_MAJOR 1 #define SNAPPY_MINOR 1 -#define SNAPPY_PATCHLEVEL 4 +#define SNAPPY_PATCHLEVEL 5 #define SNAPPY_VERSION \ ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL) @@ -86,7 +86,7 @@ void operator=(const TypeName&) #endif -#if 0 +#if !1 // Windows does not have an iovec type, yet the concept is universally useful. // It is simple to define it ourselves, so we put it inside our own namespace. struct iovec {
diff --git a/third_party/snappy/win32/config.h b/third_party/snappy/win32/config.h index 583780c0..71fd1d8 100644 --- a/third_party/snappy/win32/config.h +++ b/third_party/snappy/win32/config.h
@@ -1,8 +1,5 @@ -/* config.h. Generated from config.h.in by configure. */ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define if building universal (internal helper macro) */ -/* #undef AC_APPLE_UNIVERSAL_BUILD */ +#ifndef SNAPPY_CONFIG_H +#define SNAPPY_CONFIG_H 1 /* Define to 1 if the compiler supports __builtin_ctz and friends. */ /* #undef HAVE_BUILTIN_CTZ */ @@ -25,20 +22,14 @@ /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 -/* Define to 1 if you have the `fastlz' library (-lfastlz). */ -/* #undef HAVE_LIBFASTLZ */ - -/* Define to 1 if you have the `lzf' library (-llzf). */ -/* #undef HAVE_LIBLZF */ - /* Define to 1 if you have the `lzo2' library (-llzo2). */ /* #undef HAVE_LIBLZO2 */ -/* Define to 1 if you have the `quicklz' library (-lquicklz). */ -/* #undef HAVE_LIBQUICKLZ */ - /* Define to 1 if you have the `z' library (-lz). */ -#define HAVE_LIBZ 1 +/* #undef HAVE_LIBZ */ + +/* Define to 1 if you have the <sys/uio.h> header file. */ +/* #undef HAVE_SYS_UIO_H */ /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 @@ -53,7 +44,7 @@ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the <strings.h> header file. */ -#define HAVE_STRINGS_H 1 +/* #undef HAVE_STRINGS_H */ /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 @@ -74,67 +65,26 @@ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the <sys/time.h> header file. */ -#define HAVE_SYS_TIME_H 1 +/* #undef HAVE_SYS_TIME_H */ /* Define to 1 if you have the <sys/types.h> header file. */ -#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_TYPES_H /* Define to 1 if you have the <unistd.h> header file. */ -#define HAVE_UNISTD_H 1 +/* #undef HAVE_UNISTD_H */ /* Define to 1 if you have the <windows.h> header file. */ #define HAVE_WINDOWS_H 1 -/* Define if running the test suite so that test #27 works on MinGW. */ -/* #undef LT_MINGW_STATIC_TESTSUITE_HACK */ - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#define LT_OBJDIR ".libs/" - -/* Name of package */ -#define PACKAGE "snappy" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "snappy" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "snappy 1.1.4" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "snappy" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "1.1.4" - /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 -/* Version number of package */ -#define VERSION "1.1.4" - /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -#if defined __BIG_ENDIAN__ -#define WORDS_BIGENDIAN 1 -#endif -#else -#ifndef WORDS_BIGENDIAN -/* # undef WORDS_BIGENDIAN */ -#endif + significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +#if defined(_MSC_VER) && (_MSC_VER <= 1900) +typedef __int64 ssize_t; #endif -/* Define to `unsigned int' if <sys/types.h> does not define. */ -/* #undef size_t */ - -/* Define to `int' if <sys/types.h> does not define. */ -#include <Windows.h> - -#include <BaseTsd.h> -typedef SSIZE_T ssize_t; +#endif
diff --git a/third_party/snappy/win32/snappy-stubs-public.h b/third_party/snappy/win32/snappy-stubs-public.h index 1ea7baf..7c71efb 100644 --- a/third_party/snappy/win32/snappy-stubs-public.h +++ b/third_party/snappy/win32/snappy-stubs-public.h
@@ -50,7 +50,7 @@ #define SNAPPY_MAJOR 1 #define SNAPPY_MINOR 1 -#define SNAPPY_PATCHLEVEL 4 +#define SNAPPY_PATCHLEVEL 5 #define SNAPPY_VERSION \ ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL)
diff --git a/third_party/webrtc_overrides/BUILD.gn b/third_party/webrtc_overrides/BUILD.gn index dfe4647..f9dfe70 100644 --- a/third_party/webrtc_overrides/BUILD.gn +++ b/third_party/webrtc_overrides/BUILD.gn
@@ -48,7 +48,7 @@ # https://codereview.chromium.org/2022833002/ is landed. The target should # be removed entirely if possible. "//third_party/libjingle_xmpp:rtc_task_runner", - "//third_party/webrtc/base:rtc_base_approved", + "//third_party/webrtc/rtc_base:rtc_base_approved", ] deps = [ "//third_party/webrtc/p2p:rtc_p2p",
diff --git a/third_party/webrtc_overrides/init_webrtc.cc b/third_party/webrtc_overrides/init_webrtc.cc index f51455ec..41fd0f6 100644 --- a/third_party/webrtc_overrides/init_webrtc.cc +++ b/third_party/webrtc_overrides/init_webrtc.cc
@@ -12,9 +12,9 @@ #include "base/native_library.h" #include "base/path_service.h" #include "base/trace_event/trace_event.h" -#include "third_party/webrtc/base/event_tracer.h" +#include "third_party/webrtc/rtc_base/event_tracer.h" #include "third_party/webrtc/system_wrappers/include/cpu_info.h" -#include "third_party/webrtc_overrides/webrtc/base/logging.h" +#include "third_party/webrtc_overrides/webrtc/rtc_base/logging.h" const unsigned char* GetCategoryGroupEnabled(const char* category_group) { return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group);
diff --git a/third_party/webrtc_overrides/webrtc/base/diagnostic_logging.h b/third_party/webrtc_overrides/webrtc/base/diagnostic_logging.h deleted file mode 100644 index 3a29c3af..0000000 --- a/third_party/webrtc_overrides/webrtc/base/diagnostic_logging.h +++ /dev/null
@@ -1,153 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_DIAGNOSTIC_LOGGING_H_ -#define THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_DIAGNOSTIC_LOGGING_H_ - -#include <sstream> -#include <string> - -#include "third_party/webrtc/base/checks.h" -#include "third_party/webrtc/base/scoped_ref_ptr.h" - -namespace rtc { - -/////////////////////////////////////////////////////////////////////////////// -// ConstantLabel can be used to easily generate string names from constant -// values. This can be useful for logging descriptive names of error messages. -// Usage: -// const ConstantLabel LIBRARY_ERRORS[] = { -// KLABEL(SOME_ERROR), -// KLABEL(SOME_OTHER_ERROR), -// ... -// LASTLABEL -// } -// -// int err = LibraryFunc(); -// LOG(LS_ERROR) << "LibraryFunc returned: " -// << ErrorName(err, LIBRARY_ERRORS); - -struct ConstantLabel { - int value; - const char* label; -}; -#define KLABEL(x) { x, #x } -#define LASTLABEL { 0, 0 } - -const char* FindLabel(int value, const ConstantLabel entries[]); -std::string ErrorName(int err, const ConstantLabel* err_table); - -////////////////////////////////////////////////////////////////////// -// Note that the non-standard LoggingSeverity aliases exist because they are -// still in broad use. The meanings of the levels are: -// LS_SENSITIVE: Information which should only be logged with the consent -// of the user, due to privacy concerns. -// LS_VERBOSE: This level is for data which we do not want to appear in the -// normal debug log, but should appear in diagnostic logs. -// LS_INFO: Chatty level used in debugging for all sorts of things, the default -// in debug builds. -// LS_WARNING: Something that may warrant investigation. -// LS_ERROR: Something that should not have occurred. -// Note that LoggingSeverity is mapped over to chromiums verbosity levels where -// anything lower than or equal to the current verbosity level is written to -// file which is the opposite of logging severity in libjingle where higher -// severity numbers than or equal to the current severity level are written to -// file. Also, note that the values are explicitly defined here for convenience -// since the command line flag must be set using numerical values. -// TODO(tommi): To keep things simple, we should just use the same values for -// these constants as Chrome does. -enum LoggingSeverity { LS_ERROR = 1, - LS_WARNING = 2, - LS_INFO = 3, - LS_VERBOSE = 4, - LS_SENSITIVE = 5, - INFO = LS_INFO, - WARNING = LS_WARNING, - LERROR = LS_ERROR }; - -// LogErrorContext assists in interpreting the meaning of an error value. -enum LogErrorContext { - ERRCTX_NONE, - ERRCTX_ERRNO, // System-local errno - ERRCTX_HRESULT, // Windows HRESULT - ERRCTX_OSSTATUS, // MacOS OSStatus - - // Abbreviations for LOG_E macro - ERRCTX_EN = ERRCTX_ERRNO, // LOG_E(sev, EN, x) - ERRCTX_HR = ERRCTX_HRESULT, // LOG_E(sev, HR, x) - ERRCTX_OS = ERRCTX_OSSTATUS, // LOG_E(sev, OS, x) -}; - -// Class that writes a log message to the logging delegate ("WebRTC logging -// stream" in Chrome) and to Chrome's logging stream. -class DiagnosticLogMessage { - public: - DiagnosticLogMessage(const char* file, int line, LoggingSeverity severity, - LogErrorContext err_ctx, int err); - DiagnosticLogMessage(const char* file, int line, LoggingSeverity severity, - LogErrorContext err_ctx, int err, const char* module); - ~DiagnosticLogMessage(); - - void CreateTimestamp(); - - std::ostream& stream() { return print_stream_; } - - private: - const char* file_name_; - const int line_; - const LoggingSeverity severity_; - const LogErrorContext err_ctx_; - const int err_; - const char* const module_; - const bool log_to_chrome_; - - std::ostringstream print_stream_; -}; - -// This class is used to explicitly ignore values in the conditional -// logging macros. This avoids compiler warnings like "value computed -// is not used" and "statement has no effect". -class LogMessageVoidify { - public: - LogMessageVoidify() { } - // This has to be an operator with a precedence lower than << but - // higher than ?: - void operator&(std::ostream&) { } -}; - -////////////////////////////////////////////////////////////////////// -// Logging Helpers -////////////////////////////////////////////////////////////////////// - -class LogMultilineState { - public: - size_t unprintable_count_[2]; - LogMultilineState() { - unprintable_count_[0] = unprintable_count_[1] = 0; - } -}; - -class LogMessage { - public: - static void LogToDebug(int min_sev); -}; - -// When possible, pass optional state variable to track various data across -// multiple calls to LogMultiline. Otherwise, pass NULL. -void LogMultiline(LoggingSeverity level, const char* label, bool input, - const void* data, size_t len, bool hex_mode, - LogMultilineState* state); - -// TODO(grunell): Change name to InitDiagnosticLoggingDelegate or -// InitDiagnosticLogging. Change also in init_webrtc.h/cc. -// TODO(grunell): typedef the delegate function. -void InitDiagnosticLoggingDelegateFunction( - void (*delegate)(const std::string&)); - -void SetExtraLoggingInit( - void (*function)(void (*delegate)(const std::string&))); - -} // namespace rtc - -#endif // THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_DIAGNOSTIC_LOGGING_H_
diff --git a/third_party/webrtc_overrides/webrtc/base/logging.cc b/third_party/webrtc_overrides/webrtc/base/logging.cc index 2907c2a..cae52041 100644 --- a/third_party/webrtc_overrides/webrtc/base/logging.cc +++ b/third_party/webrtc_overrides/webrtc/base/logging.cc
@@ -4,7 +4,7 @@ // NOTE: // Since this file includes Chromium headers, it must not include -// third_party/webrtc/base/logging.h since it defines some of the same macros as +// third_party/webrtc/rtc_base/logging.h since it defines some of the same macros as // Chromium does and we'll run into conflicts. #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) @@ -18,12 +18,12 @@ #include "base/logging.h" #include "base/strings/string_util.h" #include "base/threading/platform_thread.h" -#include "third_party/webrtc/base/stringencode.h" -#include "third_party/webrtc/base/stringutils.h" +#include "third_party/webrtc/rtc_base/stringencode.h" +#include "third_party/webrtc/rtc_base/stringutils.h" // This needs to be included after base/logging.h. -#include "third_party/webrtc_overrides/webrtc/base/diagnostic_logging.h" -#include "third_party/webrtc_overrides/webrtc/base/logging.h" +#include "third_party/webrtc_overrides/webrtc/rtc_base/diagnostic_logging.h" +#include "third_party/webrtc_overrides/webrtc/rtc_base/logging.h" #if defined(WEBRTC_MAC) #include "base/mac/mac_logging.h"
diff --git a/third_party/webrtc_overrides/webrtc/base/logging.h b/third_party/webrtc_overrides/webrtc/base/logging.h index e9ca47e0..2442cf1 100644 --- a/third_party/webrtc_overrides/webrtc/base/logging.h +++ b/third_party/webrtc_overrides/webrtc/base/logging.h
@@ -1,95 +1,8 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file overrides the logging macros in WebRTC (webrtc/base/logging.h). -// Instead of using WebRTC's logging implementation, the WebRTC macros are -// mapped to DIAGNOSTIC_LOGING. In it's implementation (DiagnosticLogMessage in -// third_party/webrtc_overrides/webrtc/base/logging.h), the corresponding -// base/logging.h macros (e.g. Chromium's VLOG) are used. -// If this file is included outside of WebRTC/libjingle it should be included -// after base/logging.h (if any) or compiler error or unexpected behavior may -// occur (macros that have the same name in WebRTC as in Chromium will use -// the WebRTC definition if this file is included first). - -// Setting the LoggingSeverity (and lower) that should be written to file should -// be done via command line by specifying the flags: -// --vmodule or --v please see base/logging.h for details on how to use them. -// Specifying what file to write to is done using InitLogging also in -// base/logging.h. - -// The macros and classes declared in here are not described as they are -// NOT TO BE USED outside of WebRTC/libjingle. - #ifndef THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_LOGGING_H_ #define THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_LOGGING_H_ -#include "third_party/webrtc_overrides/webrtc/base/diagnostic_logging.h" - -////////////////////////////////////////////////////////////////////// -// WebRTC macros which in DiagnosticLogMessage are mapped over to -// their VLOG equivalent in base/logging.h. -////////////////////////////////////////////////////////////////////// - -#if defined(LOGGING_INSIDE_WEBRTC) - -#include <errno.h> - -namespace rtc { - -// Note that |N| is the size *with* the null terminator. -bool CheckVlogIsOnHelper(LoggingSeverity severity, - const char* file, size_t N); - -template <size_t N> -bool CheckVlogIsOn(LoggingSeverity severity, const char (&file)[N]) { - return CheckVlogIsOnHelper(severity, file, N); -} - -} // namespace rtc - -#define DIAGNOSTIC_LOG(sev, ctx, err, ...) \ - rtc::DiagnosticLogMessage( \ - __FILE__, __LINE__, sev, rtc::ERRCTX_ ## ctx, err, ##__VA_ARGS__).stream() - -#define LOG_CHECK_LEVEL(sev) CheckVlogIsOn(rtc::sev, __FILE__) -#define LOG_CHECK_LEVEL_V(sev) CheckVlogIsOn(sev, __FILE__) - -#define LOG_V(sev) DIAGNOSTIC_LOG(sev, NONE, 0) -#undef LOG -#define LOG(sev) DIAGNOSTIC_LOG(rtc::sev, NONE, 0) - -// The _F version prefixes the message with the current function name. -#if defined(__GNUC__) && defined(_DEBUG) -#define LOG_F(sev) LOG(sev) << __PRETTY_FUNCTION__ << ": " -#else -#define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": " -#endif - -#define LOG_E(sev, ctx, err, ...) \ - DIAGNOSTIC_LOG(rtc::sev, ctx, err, ##__VA_ARGS__) - -#undef LOG_ERRNO_EX -#define LOG_ERRNO_EX(sev, err) LOG_E(sev, ERRNO, err) -#undef LOG_ERRNO -#define LOG_ERRNO(sev) LOG_ERRNO_EX(sev, errno) - -#if defined(WEBRTC_WIN) -#define LOG_GLE_EX(sev, err) LOG_E(sev, HRESULT, err) -#define LOG_GLE(sev) LOG_GLE_EX(sev, GetLastError()) -#define LOG_GLEM(sev, mod) LOG_E(sev, HRESULT, GetLastError(), mod) -#define LOG_ERR_EX(sev, err) LOG_GLE_EX(sev, err) -#define LOG_ERR(sev) LOG_GLE(sev) -#define LAST_SYSTEM_ERROR (::GetLastError()) -#else -#define LOG_ERR_EX(sev, err) LOG_ERRNO_EX(sev, err) -#define LOG_ERR(sev) LOG_ERRNO(sev) -#define LAST_SYSTEM_ERROR (errno) -#endif // OS_WIN - -#undef PLOG -#define PLOG(sev, err) LOG_ERR_EX(sev, err) - -#endif // LOGGING_INSIDE_WEBRTC +// This header is deprecated and is just left here temporarily during +// refactoring. See https://bugs.webrtc.org/7634 for more details. +#include "third_party/webrtc_overrides/webrtc/rtc_base/logging.h" #endif // THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_LOGGING_H_
diff --git a/third_party/webrtc_overrides/webrtc/base/task_queue.cc b/third_party/webrtc_overrides/webrtc/base/task_queue.cc index aea7d45..a51fc1e 100644 --- a/third_party/webrtc_overrides/webrtc/base/task_queue.cc +++ b/third_party/webrtc_overrides/webrtc/base/task_queue.cc
@@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "third_party/webrtc_overrides/webrtc/base/task_queue.h" +#include "third_party/webrtc_overrides/webrtc/rtc_base/task_queue.h" #include "base/bind.h" #include "base/lazy_instance.h"
diff --git a/third_party/webrtc_overrides/webrtc/base/task_queue.h b/third_party/webrtc_overrides/webrtc/base/task_queue.h deleted file mode 100644 index 22d95f5..0000000 --- a/third_party/webrtc_overrides/webrtc/base/task_queue.h +++ /dev/null
@@ -1,230 +0,0 @@ -/* - * Copyright 2016 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_BASE_TASK_QUEUE_H_ -#define WEBRTC_BASE_TASK_QUEUE_H_ - -#include <stdint.h> -#include <memory> - -#include "base/macros.h" -#include "third_party/webrtc/base/thread_annotations.h" - -namespace rtc { - -// Base interface for asynchronously executed tasks. -// The interface basically consists of a single function, Run(), that executes -// on the target queue. For more details see the Run() method and TaskQueue. -class QueuedTask { - public: - QueuedTask() {} - virtual ~QueuedTask() {} - - // Main routine that will run when the task is executed on the desired queue. - // The task should return |true| to indicate that it should be deleted or - // |false| to indicate that the queue should consider ownership of the task - // having been transferred. Returning |false| can be useful if a task has - // re-posted itself to a different queue or is otherwise being re-used. - virtual bool Run() = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(QueuedTask); -}; - -// Simple implementation of QueuedTask for use with rtc::Bind and lambdas. -template <class Closure> -class ClosureTask : public QueuedTask { - public: - explicit ClosureTask(const Closure& closure) : closure_(closure) {} - - private: - bool Run() override { - closure_(); - return true; - } - - Closure closure_; -}; - -// Extends ClosureTask to also allow specifying cleanup code. -// This is useful when using lambdas if guaranteeing cleanup, even if a task -// was dropped (queue is too full), is required. -template <class Closure, class Cleanup> -class ClosureTaskWithCleanup : public ClosureTask<Closure> { - public: - ClosureTaskWithCleanup(const Closure& closure, Cleanup cleanup) - : ClosureTask<Closure>(closure), cleanup_(cleanup) {} - ~ClosureTaskWithCleanup() { cleanup_(); } - - private: - Cleanup cleanup_; -}; - -// Convenience function to construct closures that can be passed directly -// to methods that support std::unique_ptr<QueuedTask> but not template -// based parameters. -template <class Closure> -static std::unique_ptr<QueuedTask> NewClosure(const Closure& closure) { - return std::unique_ptr<QueuedTask>(new ClosureTask<Closure>(closure)); -} - -template <class Closure, class Cleanup> -static std::unique_ptr<QueuedTask> NewClosure(const Closure& closure, - const Cleanup& cleanup) { - return std::unique_ptr<QueuedTask>( - new ClosureTaskWithCleanup<Closure, Cleanup>(closure, cleanup)); -} - -// Implements a task queue that asynchronously executes tasks in a way that -// guarantees that they're executed in FIFO order and that tasks never overlap. -// Tasks may always execute on the same worker thread and they may not. -// To DCHECK that tasks are executing on a known task queue, use IsCurrent(). -// -// Here are some usage examples: -// -// 1) Asynchronously running a lambda: -// -// class MyClass { -// ... -// TaskQueue queue_("MyQueue"); -// }; -// -// void MyClass::StartWork() { -// queue_.PostTask([]() { Work(); }); -// ... -// -// 2) Doing work asynchronously on a worker queue and providing a notification -// callback on the current queue, when the work has been done: -// -// void MyClass::StartWorkAndLetMeKnowWhenDone( -// std::unique_ptr<QueuedTask> callback) { -// DCHECK(TaskQueue::Current()) << "Need to be running on a queue"; -// queue_.PostTaskAndReply([]() { Work(); }, std::move(callback)); -// } -// ... -// my_class->StartWorkAndLetMeKnowWhenDone( -// NewClosure([]() { LOG(INFO) << "The work is done!";})); -// -// 3) Posting a custom task on a timer. The task posts itself again after -// every running: -// -// class TimerTask : public QueuedTask { -// public: -// TimerTask() {} -// private: -// bool Run() override { -// ++count_; -// TaskQueue::Current()->PostDelayedTask( -// std::unique_ptr<QueuedTask>(this), 1000); -// // Ownership has been transferred to the next occurance, -// // so return false to prevent from being deleted now. -// return false; -// } -// int count_ = 0; -// }; -// ... -// queue_.PostDelayedTask( -// std::unique_ptr<QueuedTask>(new TimerTask()), 1000); -// -// For more examples, see task_queue_unittests.cc. -// -// A note on destruction: -// -// When a TaskQueue is deleted, pending tasks will not be executed but they will -// be deleted. The deletion of tasks may happen asynchronously after the -// TaskQueue itself has been deleted or it may happen synchronously while the -// TaskQueue instance is being deleted. This may vary from one OS to the next -// so assumptions about lifetimes of pending tasks should not be made. -class LOCKABLE TaskQueue { - public: - // TaskQueue priority levels. On some platforms these will map to thread - // priorities, on others such as Mac and iOS, GCD queue priorities. - enum class Priority { - NORMAL = 0, - HIGH, - LOW, - }; - - explicit TaskQueue(const char* queue_name, - Priority priority = Priority::NORMAL); - ~TaskQueue(); - - static TaskQueue* Current(); - - // Used for DCHECKing the current queue. - static bool IsCurrent(const char* queue_name); - bool IsCurrent() const; - - // TODO(tommi): For better debuggability, implement RTC_FROM_HERE. - - // Ownership of the task is passed to PostTask. - void PostTask(std::unique_ptr<QueuedTask> task); - void PostTaskAndReply(std::unique_ptr<QueuedTask> task, - std::unique_ptr<QueuedTask> reply, - TaskQueue* reply_queue); - void PostTaskAndReply(std::unique_ptr<QueuedTask> task, - std::unique_ptr<QueuedTask> reply); - - void PostDelayedTask(std::unique_ptr<QueuedTask> task, uint32_t milliseconds); - - template <class Closure> - void PostTask(const Closure& closure) { - PostTask(std::unique_ptr<QueuedTask>(new ClosureTask<Closure>(closure))); - } - - template <class Closure> - void PostDelayedTask(const Closure& closure, uint32_t milliseconds) { - PostDelayedTask( - std::unique_ptr<QueuedTask>(new ClosureTask<Closure>(closure)), - milliseconds); - } - - template <class Closure1, class Closure2> - void PostTaskAndReply(const Closure1& task, - const Closure2& reply, - TaskQueue* reply_queue) { - PostTaskAndReply( - std::unique_ptr<QueuedTask>(new ClosureTask<Closure1>(task)), - std::unique_ptr<QueuedTask>(new ClosureTask<Closure2>(reply)), - reply_queue); - } - - template <class Closure> - void PostTaskAndReply(std::unique_ptr<QueuedTask> task, - const Closure& reply) { - PostTaskAndReply(std::move(task), std::unique_ptr<QueuedTask>( - new ClosureTask<Closure>(reply))); - } - - template <class Closure> - void PostTaskAndReply(const Closure& task, - std::unique_ptr<QueuedTask> reply) { - PostTaskAndReply( - std::unique_ptr<QueuedTask>(new ClosureTask<Closure>(task)), - std::move(reply)); - } - - template <class Closure1, class Closure2> - void PostTaskAndReply(const Closure1& task, const Closure2& reply) { - PostTaskAndReply( - std::unique_ptr<QueuedTask>(new ClosureTask<Closure1>(task)), - std::unique_ptr<QueuedTask>(new ClosureTask<Closure2>(reply))); - } - - private: - class WorkerThread; - - std::unique_ptr<WorkerThread> thread_; - DISALLOW_COPY_AND_ASSIGN(TaskQueue); -}; - -} // namespace rtc - -#endif // WEBRTC_BASE_TASK_QUEUE_H_
diff --git a/third_party/webrtc_overrides/webrtc/base/win32socketinit.cc b/third_party/webrtc_overrides/webrtc/base/win32socketinit.cc index 770f8f22..6cd6f6ee 100644 --- a/third_party/webrtc_overrides/webrtc/base/win32socketinit.cc +++ b/third_party/webrtc_overrides/webrtc/base/win32socketinit.cc
@@ -5,7 +5,7 @@ // Redirect WebRTC's winsock initialization activity into Chromium's // singleton object that managest precisely that for the browser. -#include "third_party/webrtc/base/win32socketinit.h" +#include "third_party/webrtc/rtc_base/win32socketinit.h" #include "net/base/winsock_init.h"
diff --git a/third_party/webrtc_overrides/webrtc/rtc_base/diagnostic_logging.h b/third_party/webrtc_overrides/webrtc/rtc_base/diagnostic_logging.h new file mode 100644 index 0000000..2633e6a --- /dev/null +++ b/third_party/webrtc_overrides/webrtc/rtc_base/diagnostic_logging.h
@@ -0,0 +1,153 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_RTC_BASE_DIAGNOSTIC_LOGGING_H_ +#define THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_RTC_BASE_DIAGNOSTIC_LOGGING_H_ + +#include <sstream> +#include <string> + +#include "third_party/webrtc/rtc_base/checks.h" +#include "third_party/webrtc/rtc_base/scoped_ref_ptr.h" + +namespace rtc { + +/////////////////////////////////////////////////////////////////////////////// +// ConstantLabel can be used to easily generate string names from constant +// values. This can be useful for logging descriptive names of error messages. +// Usage: +// const ConstantLabel LIBRARY_ERRORS[] = { +// KLABEL(SOME_ERROR), +// KLABEL(SOME_OTHER_ERROR), +// ... +// LASTLABEL +// } +// +// int err = LibraryFunc(); +// LOG(LS_ERROR) << "LibraryFunc returned: " +// << ErrorName(err, LIBRARY_ERRORS); + +struct ConstantLabel { + int value; + const char* label; +}; +#define KLABEL(x) { x, #x } +#define LASTLABEL { 0, 0 } + +const char* FindLabel(int value, const ConstantLabel entries[]); +std::string ErrorName(int err, const ConstantLabel* err_table); + +////////////////////////////////////////////////////////////////////// +// Note that the non-standard LoggingSeverity aliases exist because they are +// still in broad use. The meanings of the levels are: +// LS_SENSITIVE: Information which should only be logged with the consent +// of the user, due to privacy concerns. +// LS_VERBOSE: This level is for data which we do not want to appear in the +// normal debug log, but should appear in diagnostic logs. +// LS_INFO: Chatty level used in debugging for all sorts of things, the default +// in debug builds. +// LS_WARNING: Something that may warrant investigation. +// LS_ERROR: Something that should not have occurred. +// Note that LoggingSeverity is mapped over to chromiums verbosity levels where +// anything lower than or equal to the current verbosity level is written to +// file which is the opposite of logging severity in libjingle where higher +// severity numbers than or equal to the current severity level are written to +// file. Also, note that the values are explicitly defined here for convenience +// since the command line flag must be set using numerical values. +// TODO(tommi): To keep things simple, we should just use the same values for +// these constants as Chrome does. +enum LoggingSeverity { LS_ERROR = 1, + LS_WARNING = 2, + LS_INFO = 3, + LS_VERBOSE = 4, + LS_SENSITIVE = 5, + INFO = LS_INFO, + WARNING = LS_WARNING, + LERROR = LS_ERROR }; + +// LogErrorContext assists in interpreting the meaning of an error value. +enum LogErrorContext { + ERRCTX_NONE, + ERRCTX_ERRNO, // System-local errno + ERRCTX_HRESULT, // Windows HRESULT + ERRCTX_OSSTATUS, // MacOS OSStatus + + // Abbreviations for LOG_E macro + ERRCTX_EN = ERRCTX_ERRNO, // LOG_E(sev, EN, x) + ERRCTX_HR = ERRCTX_HRESULT, // LOG_E(sev, HR, x) + ERRCTX_OS = ERRCTX_OSSTATUS, // LOG_E(sev, OS, x) +}; + +// Class that writes a log message to the logging delegate ("WebRTC logging +// stream" in Chrome) and to Chrome's logging stream. +class DiagnosticLogMessage { + public: + DiagnosticLogMessage(const char* file, int line, LoggingSeverity severity, + LogErrorContext err_ctx, int err); + DiagnosticLogMessage(const char* file, int line, LoggingSeverity severity, + LogErrorContext err_ctx, int err, const char* module); + ~DiagnosticLogMessage(); + + void CreateTimestamp(); + + std::ostream& stream() { return print_stream_; } + + private: + const char* file_name_; + const int line_; + const LoggingSeverity severity_; + const LogErrorContext err_ctx_; + const int err_; + const char* const module_; + const bool log_to_chrome_; + + std::ostringstream print_stream_; +}; + +// This class is used to explicitly ignore values in the conditional +// logging macros. This avoids compiler warnings like "value computed +// is not used" and "statement has no effect". +class LogMessageVoidify { + public: + LogMessageVoidify() { } + // This has to be an operator with a precedence lower than << but + // higher than ?: + void operator&(std::ostream&) { } +}; + +////////////////////////////////////////////////////////////////////// +// Logging Helpers +////////////////////////////////////////////////////////////////////// + +class LogMultilineState { + public: + size_t unprintable_count_[2]; + LogMultilineState() { + unprintable_count_[0] = unprintable_count_[1] = 0; + } +}; + +class LogMessage { + public: + static void LogToDebug(int min_sev); +}; + +// When possible, pass optional state variable to track various data across +// multiple calls to LogMultiline. Otherwise, pass NULL. +void LogMultiline(LoggingSeverity level, const char* label, bool input, + const void* data, size_t len, bool hex_mode, + LogMultilineState* state); + +// TODO(grunell): Change name to InitDiagnosticLoggingDelegate or +// InitDiagnosticLogging. Change also in init_webrtc.h/cc. +// TODO(grunell): typedef the delegate function. +void InitDiagnosticLoggingDelegateFunction( + void (*delegate)(const std::string&)); + +void SetExtraLoggingInit( + void (*function)(void (*delegate)(const std::string&))); + +} // namespace rtc + +#endif // THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_RTC_BASE_DIAGNOSTIC_LOGGING_H_
diff --git a/third_party/webrtc_overrides/webrtc/rtc_base/logging.cc b/third_party/webrtc_overrides/webrtc/rtc_base/logging.cc new file mode 100644 index 0000000..cae52041 --- /dev/null +++ b/third_party/webrtc_overrides/webrtc/rtc_base/logging.cc
@@ -0,0 +1,374 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// NOTE: +// Since this file includes Chromium headers, it must not include +// third_party/webrtc/rtc_base/logging.h since it defines some of the same macros as +// Chromium does and we'll run into conflicts. + +#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) +#include <CoreServices/CoreServices.h> +#endif // OS_MACOSX + +#include <algorithm> +#include <iomanip> + +#include "base/atomicops.h" +#include "base/logging.h" +#include "base/strings/string_util.h" +#include "base/threading/platform_thread.h" +#include "third_party/webrtc/rtc_base/stringencode.h" +#include "third_party/webrtc/rtc_base/stringutils.h" + +// This needs to be included after base/logging.h. +#include "third_party/webrtc_overrides/webrtc/rtc_base/diagnostic_logging.h" +#include "third_party/webrtc_overrides/webrtc/rtc_base/logging.h" + +#if defined(WEBRTC_MAC) +#include "base/mac/mac_logging.h" +#endif + +// Disable logging when fuzzing, for performance reasons. +// WEBRTC_UNSAFE_FUZZER_MODE is defined by WebRTC's BUILD.gn when +// built with use_libfuzzer or use_drfuzz. +#if defined(WEBRTC_UNSAFE_FUZZER_MODE) +#define WEBRTC_ENABLE_LOGGING false +#else +#define WEBRTC_ENABLE_LOGGING true +#endif + +// From this file we can't use VLOG since it expands into usage of the __FILE__ +// macro (for correct filtering). The actual logging call from DIAGNOSTIC_LOG in +// ~DiagnosticLogMessage. Note that the second parameter to the LAZY_STREAM +// macro is not used since the filter check has already been done for +// DIAGNOSTIC_LOG. +#define LOG_LAZY_STREAM_DIRECT(file_name, line_number, sev) \ + LAZY_STREAM(logging::LogMessage(file_name, line_number, sev).stream(), \ + WEBRTC_ENABLE_LOGGING) + +namespace rtc { + +void (*g_logging_delegate_function)(const std::string&) = NULL; +void (*g_extra_logging_init_function)( + void (*logging_delegate_function)(const std::string&)) = NULL; +#ifndef NDEBUG +static_assert(sizeof(base::subtle::Atomic32) == sizeof(base::PlatformThreadId), + "Atomic32 not same size as PlatformThreadId"); +base::subtle::Atomic32 g_init_logging_delegate_thread_id = 0; +#endif + +///////////////////////////////////////////////////////////////////////////// +// Constant Labels +///////////////////////////////////////////////////////////////////////////// + +const char* FindLabel(int value, const ConstantLabel entries[]) { + for (int i = 0; entries[i].label; ++i) { + if (value == entries[i].value) return entries[i].label; + } + return 0; +} + +std::string ErrorName(int err, const ConstantLabel* err_table) { + if (err == 0) + return "No error"; + + if (err_table != 0) { + if (const char * value = FindLabel(err, err_table)) + return value; + } + + char buffer[16]; + base::snprintf(buffer, sizeof(buffer), "0x%08x", err); + return buffer; +} + +///////////////////////////////////////////////////////////////////////////// +// Log helper functions +///////////////////////////////////////////////////////////////////////////// + +inline int WebRtcSevToChromeSev(LoggingSeverity sev) { + switch (sev) { + case LS_ERROR: + return ::logging::LOG_ERROR; + case LS_WARNING: + return ::logging::LOG_WARNING; + case LS_INFO: + return ::logging::LOG_INFO; + case LS_VERBOSE: + case LS_SENSITIVE: + return ::logging::LOG_VERBOSE; + default: + NOTREACHED(); + return ::logging::LOG_FATAL; + } +} + +inline int WebRtcVerbosityLevel(LoggingSeverity sev) { + switch (sev) { + case LS_ERROR: + return -2; + case LS_WARNING: + return -1; + case LS_INFO: // We treat 'info' and 'verbose' as the same verbosity level. + case LS_VERBOSE: + return 1; + case LS_SENSITIVE: + return 2; + default: + NOTREACHED(); + return 0; + } +} + +// Logs extra information for LOG_E. +static void LogExtra(std::ostringstream* print_stream, + LogErrorContext err_ctx, + int err, + const char* module) { + if (err_ctx == ERRCTX_NONE) + return; + + (*print_stream) << ": "; + (*print_stream) << "[0x" << std::setfill('0') << std::hex << std::setw(8) + << err << "]"; + switch (err_ctx) { + case ERRCTX_ERRNO: + (*print_stream) << " " << strerror(err); + break; +#if defined(WEBRTC_WIN) + case ERRCTX_HRESULT: { + char msgbuf[256]; + DWORD flags = FORMAT_MESSAGE_FROM_SYSTEM; + HMODULE hmod = GetModuleHandleA(module); + if (hmod) + flags |= FORMAT_MESSAGE_FROM_HMODULE; + if (DWORD len = FormatMessageA( + flags, hmod, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + msgbuf, sizeof(msgbuf) / sizeof(msgbuf[0]), NULL)) { + while ((len > 0) && + isspace(static_cast<unsigned char>(msgbuf[len - 1]))) { + msgbuf[--len] = 0; + } + (*print_stream) << " " << msgbuf; + } + break; + } +#elif defined(WEBRTC_IOS) + case ERRCTX_OSSTATUS: + (*print_stream) << " " + << "Unknown LibJingle error: " << err; + break; +#elif defined(WEBRTC_MAC) + case ERRCTX_OSSTATUS: { + (*print_stream) << " " << logging::DescriptionFromOSStatus(err); + break; + } +#endif // defined(WEBRTC_WIN) + default: + break; + } +} + +DiagnosticLogMessage::DiagnosticLogMessage(const char* file, + int line, + LoggingSeverity severity, + LogErrorContext err_ctx, + int err) + : DiagnosticLogMessage(file, line, severity, err_ctx, err, nullptr) {} + +DiagnosticLogMessage::DiagnosticLogMessage(const char* file, + int line, + LoggingSeverity severity, + LogErrorContext err_ctx, + int err, + const char* module) + : file_name_(file), + line_(line), + severity_(severity), + err_ctx_(err_ctx), + err_(err), + module_(module), + log_to_chrome_(CheckVlogIsOnHelper(severity, file, strlen(file) + 1)) {} + +DiagnosticLogMessage::~DiagnosticLogMessage() { + const bool call_delegate = + g_logging_delegate_function && severity_ <= LS_INFO; + + if (call_delegate || log_to_chrome_) { + LogExtra(&print_stream_, err_ctx_, err_, module_); + const std::string& str = print_stream_.str(); + if (log_to_chrome_) { + LOG_LAZY_STREAM_DIRECT(file_name_, line_, + rtc::WebRtcSevToChromeSev(severity_)) << str; + } + + if (g_logging_delegate_function && severity_ <= LS_INFO) { + g_logging_delegate_function(str); + } + } +} + +// static +void LogMessage::LogToDebug(int min_sev) { + logging::SetMinLogLevel(min_sev); +} + +// Note: this function is a copy from the overriden libjingle implementation. +void LogMultiline(LoggingSeverity level, const char* label, bool input, + const void* data, size_t len, bool hex_mode, + LogMultilineState* state) { + // TODO(grunell): This will not do the expected verbosity level checking. We + // need a macro for the multiline logging. + // https://code.google.com/p/webrtc/issues/detail?id=5011 + if (!LOG_CHECK_LEVEL_V(level)) + return; + + const char * direction = (input ? " << " : " >> "); + + // NULL data means to flush our count of unprintable characters. + if (!data) { + if (state && state->unprintable_count_[input]) { + LOG_V(level) << label << direction << "## " + << state->unprintable_count_[input] + << " consecutive unprintable ##"; + state->unprintable_count_[input] = 0; + } + return; + } + + // The ctype classification functions want unsigned chars. + const unsigned char* udata = static_cast<const unsigned char*>(data); + + if (hex_mode) { + const size_t LINE_SIZE = 24; + char hex_line[LINE_SIZE * 9 / 4 + 2], asc_line[LINE_SIZE + 1]; + while (len > 0) { + memset(asc_line, ' ', sizeof(asc_line)); + memset(hex_line, ' ', sizeof(hex_line)); + size_t line_len = std::min(len, LINE_SIZE); + for (size_t i = 0; i < line_len; ++i) { + unsigned char ch = udata[i]; + asc_line[i] = isprint(ch) ? ch : '.'; + hex_line[i*2 + i/4] = hex_encode(ch >> 4); + hex_line[i*2 + i/4 + 1] = hex_encode(ch & 0xf); + } + asc_line[sizeof(asc_line)-1] = 0; + hex_line[sizeof(hex_line)-1] = 0; + LOG_V(level) << label << direction + << asc_line << " " << hex_line << " "; + udata += line_len; + len -= line_len; + } + return; + } + + size_t consecutive_unprintable = state ? state->unprintable_count_[input] : 0; + + const unsigned char* end = udata + len; + while (udata < end) { + const unsigned char* line = udata; + const unsigned char* end_of_line = strchrn<unsigned char>(udata, + end - udata, + '\n'); + if (!end_of_line) { + udata = end_of_line = end; + } else { + udata = end_of_line + 1; + } + + bool is_printable = true; + + // If we are in unprintable mode, we need to see a line of at least + // kMinPrintableLine characters before we'll switch back. + const ptrdiff_t kMinPrintableLine = 4; + if (consecutive_unprintable && ((end_of_line - line) < kMinPrintableLine)) { + is_printable = false; + } else { + // Determine if the line contains only whitespace and printable + // characters. + bool is_entirely_whitespace = true; + for (const unsigned char* pos = line; pos < end_of_line; ++pos) { + if (isspace(*pos)) + continue; + is_entirely_whitespace = false; + if (!isprint(*pos)) { + is_printable = false; + break; + } + } + // Treat an empty line following unprintable data as unprintable. + if (consecutive_unprintable && is_entirely_whitespace) { + is_printable = false; + } + } + if (!is_printable) { + consecutive_unprintable += (udata - line); + continue; + } + // Print out the current line, but prefix with a count of prior unprintable + // characters. + if (consecutive_unprintable) { + LOG_V(level) << label << direction << "## " << consecutive_unprintable + << " consecutive unprintable ##"; + consecutive_unprintable = 0; + } + // Strip off trailing whitespace. + while ((end_of_line > line) && isspace(*(end_of_line-1))) { + --end_of_line; + } + // Filter out any private data + std::string substr(reinterpret_cast<const char*>(line), end_of_line - line); + std::string::size_type pos_private = substr.find("Email"); + if (pos_private == std::string::npos) { + pos_private = substr.find("Passwd"); + } + if (pos_private == std::string::npos) { + LOG_V(level) << label << direction << substr; + } else { + LOG_V(level) << label << direction << "## omitted for privacy ##"; + } + } + + if (state) { + state->unprintable_count_[input] = consecutive_unprintable; + } +} + +void InitDiagnosticLoggingDelegateFunction( + void (*delegate)(const std::string&)) { +#ifndef NDEBUG + // Ensure that this function is always called from the same thread. + base::subtle::NoBarrier_CompareAndSwap(&g_init_logging_delegate_thread_id, 0, + static_cast<base::subtle::Atomic32>(base::PlatformThread::CurrentId())); + DCHECK_EQ( + g_init_logging_delegate_thread_id, + static_cast<base::subtle::Atomic32>(base::PlatformThread::CurrentId())); +#endif + CHECK(delegate); + // This function may be called with the same argument several times if the + // page is reloaded or there are several PeerConnections on one page with + // logging enabled. This is OK, we simply don't have to do anything. + if (delegate == g_logging_delegate_function) + return; + CHECK(!g_logging_delegate_function); + g_logging_delegate_function = delegate; + + if (g_extra_logging_init_function) + g_extra_logging_init_function(delegate); +} + +void SetExtraLoggingInit( + void (*function)(void (*delegate)(const std::string&))) { + CHECK(function); + CHECK(!g_extra_logging_init_function); + g_extra_logging_init_function = function; +} + +bool CheckVlogIsOnHelper( + rtc::LoggingSeverity severity, const char* file, size_t N) { + return rtc::WebRtcVerbosityLevel(severity) <= + ::logging::GetVlogLevelHelper(file, N); +} + +} // namespace rtc
diff --git a/third_party/webrtc_overrides/webrtc/rtc_base/logging.h b/third_party/webrtc_overrides/webrtc/rtc_base/logging.h new file mode 100644 index 0000000..6d9fa562 --- /dev/null +++ b/third_party/webrtc_overrides/webrtc/rtc_base/logging.h
@@ -0,0 +1,95 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file overrides the logging macros in WebRTC (webrtc/rtc_base/logging.h). +// Instead of using WebRTC's logging implementation, the WebRTC macros are +// mapped to DIAGNOSTIC_LOGING. In it's implementation (DiagnosticLogMessage in +// third_party/webrtc_overrides/webrtc/rtc_base/logging.h), the corresponding +// base/logging.h macros (e.g. Chromium's VLOG) are used. +// If this file is included outside of WebRTC/libjingle it should be included +// after base/logging.h (if any) or compiler error or unexpected behavior may +// occur (macros that have the same name in WebRTC as in Chromium will use +// the WebRTC definition if this file is included first). + +// Setting the LoggingSeverity (and lower) that should be written to file should +// be done via command line by specifying the flags: +// --vmodule or --v please see base/logging.h for details on how to use them. +// Specifying what file to write to is done using InitLogging also in +// base/logging.h. + +// The macros and classes declared in here are not described as they are +// NOT TO BE USED outside of WebRTC/libjingle. + +#ifndef THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_RTC_BASE_LOGGING_H_ +#define THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_RTC_BASE_LOGGING_H_ + +#include "third_party/webrtc_overrides/webrtc/rtc_base/diagnostic_logging.h" + +////////////////////////////////////////////////////////////////////// +// WebRTC macros which in DiagnosticLogMessage are mapped over to +// their VLOG equivalent in base/logging.h. +////////////////////////////////////////////////////////////////////// + +#if defined(LOGGING_INSIDE_WEBRTC) + +#include <errno.h> + +namespace rtc { + +// Note that |N| is the size *with* the null terminator. +bool CheckVlogIsOnHelper(LoggingSeverity severity, + const char* file, size_t N); + +template <size_t N> +bool CheckVlogIsOn(LoggingSeverity severity, const char (&file)[N]) { + return CheckVlogIsOnHelper(severity, file, N); +} + +} // namespace rtc + +#define DIAGNOSTIC_LOG(sev, ctx, err, ...) \ + rtc::DiagnosticLogMessage( \ + __FILE__, __LINE__, sev, rtc::ERRCTX_ ## ctx, err, ##__VA_ARGS__).stream() + +#define LOG_CHECK_LEVEL(sev) CheckVlogIsOn(rtc::sev, __FILE__) +#define LOG_CHECK_LEVEL_V(sev) CheckVlogIsOn(sev, __FILE__) + +#define LOG_V(sev) DIAGNOSTIC_LOG(sev, NONE, 0) +#undef LOG +#define LOG(sev) DIAGNOSTIC_LOG(rtc::sev, NONE, 0) + +// The _F version prefixes the message with the current function name. +#if defined(__GNUC__) && defined(_DEBUG) +#define LOG_F(sev) LOG(sev) << __PRETTY_FUNCTION__ << ": " +#else +#define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": " +#endif + +#define LOG_E(sev, ctx, err, ...) \ + DIAGNOSTIC_LOG(rtc::sev, ctx, err, ##__VA_ARGS__) + +#undef LOG_ERRNO_EX +#define LOG_ERRNO_EX(sev, err) LOG_E(sev, ERRNO, err) +#undef LOG_ERRNO +#define LOG_ERRNO(sev) LOG_ERRNO_EX(sev, errno) + +#if defined(WEBRTC_WIN) +#define LOG_GLE_EX(sev, err) LOG_E(sev, HRESULT, err) +#define LOG_GLE(sev) LOG_GLE_EX(sev, GetLastError()) +#define LOG_GLEM(sev, mod) LOG_E(sev, HRESULT, GetLastError(), mod) +#define LOG_ERR_EX(sev, err) LOG_GLE_EX(sev, err) +#define LOG_ERR(sev) LOG_GLE(sev) +#define LAST_SYSTEM_ERROR (::GetLastError()) +#else +#define LOG_ERR_EX(sev, err) LOG_ERRNO_EX(sev, err) +#define LOG_ERR(sev) LOG_ERRNO(sev) +#define LAST_SYSTEM_ERROR (errno) +#endif // OS_WIN + +#undef PLOG +#define PLOG(sev, err) LOG_ERR_EX(sev, err) + +#endif // LOGGING_INSIDE_WEBRTC + +#endif // THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_RTC_BASE_LOGGING_H_
diff --git a/third_party/webrtc_overrides/webrtc/rtc_base/task_queue.cc b/third_party/webrtc_overrides/webrtc/rtc_base/task_queue.cc new file mode 100644 index 0000000..a51fc1e --- /dev/null +++ b/third_party/webrtc_overrides/webrtc/rtc_base/task_queue.cc
@@ -0,0 +1,149 @@ +/* + * Copyright 2016 The WebRTC Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "third_party/webrtc_overrides/webrtc/rtc_base/task_queue.h" + +#include "base/bind.h" +#include "base/lazy_instance.h" +#include "base/threading/thread.h" +#include "base/threading/thread_local.h" + +namespace rtc { +namespace { + +void RunTask(std::unique_ptr<QueuedTask> task) { + if (!task->Run()) + task.release(); +} + +class PostAndReplyTask : public QueuedTask { + public: + PostAndReplyTask( + std::unique_ptr<QueuedTask> task, + std::unique_ptr<QueuedTask> reply, + const scoped_refptr<base::SingleThreadTaskRunner>& reply_task_runner) + : task_(std::move(task)), + reply_(std::move(reply)), + reply_task_runner_(reply_task_runner) {} + + ~PostAndReplyTask() override {} + + private: + bool Run() override { + if (!task_->Run()) + task_.release(); + + reply_task_runner_->PostTask(FROM_HERE, + base::Bind(&RunTask, base::Passed(&reply_))); + return true; + } + + std::unique_ptr<QueuedTask> task_; + std::unique_ptr<QueuedTask> reply_; + scoped_refptr<base::SingleThreadTaskRunner> reply_task_runner_; +}; + +// A lazily created thread local storage for quick access to a TaskQueue. +base::LazyInstance<base::ThreadLocalPointer<TaskQueue>>::Leaky lazy_tls_ptr = + LAZY_INSTANCE_INITIALIZER; + +} // namespace + +bool TaskQueue::IsCurrent() const { + return Current() == this; +} + +class TaskQueue::WorkerThread : public base::Thread { + public: + WorkerThread(const char* queue_name, TaskQueue* queue); + ~WorkerThread() override; + + private: + virtual void Init() override; + + TaskQueue* const queue_; +}; + +TaskQueue::WorkerThread::WorkerThread(const char* queue_name, TaskQueue* queue) + : base::Thread(queue_name), queue_(queue) {} + +void TaskQueue::WorkerThread::Init() { + lazy_tls_ptr.Pointer()->Set(queue_); +} + +TaskQueue::WorkerThread::~WorkerThread() { + DCHECK(!Thread::IsRunning()); +} + +TaskQueue::TaskQueue(const char* queue_name, + Priority priority /*= Priority::NORMAL*/) + : thread_( + std::unique_ptr<WorkerThread>(new WorkerThread(queue_name, this))) { + DCHECK(queue_name); + base::Thread::Options options; + switch (priority) { + case Priority::HIGH: + options.priority = base::ThreadPriority::REALTIME_AUDIO; + break; + case Priority::LOW: + options.priority = base::ThreadPriority::BACKGROUND; + break; + case Priority::NORMAL: + default: + options.priority = base::ThreadPriority::NORMAL; + break; + } + bool result = thread_->StartWithOptions(options); + CHECK(result); +} + +TaskQueue::~TaskQueue() { + DCHECK(!IsCurrent()); + thread_->Stop(); +} + +// static +TaskQueue* TaskQueue::Current() { + return lazy_tls_ptr.Pointer()->Get(); +} + +// static +bool TaskQueue::IsCurrent(const char* queue_name) { + TaskQueue* current = Current(); + return current && current->thread_->thread_name().compare(queue_name) == 0; +} + +void TaskQueue::PostTask(std::unique_ptr<QueuedTask> task) { + thread_->task_runner()->PostTask(FROM_HERE, + base::Bind(&RunTask, base::Passed(&task))); +} + +void TaskQueue::PostDelayedTask(std::unique_ptr<QueuedTask> task, + uint32_t milliseconds) { + thread_->task_runner()->PostDelayedTask( + FROM_HERE, base::Bind(&RunTask, base::Passed(&task)), + base::TimeDelta::FromMilliseconds(milliseconds)); +} + +void TaskQueue::PostTaskAndReply(std::unique_ptr<QueuedTask> task, + std::unique_ptr<QueuedTask> reply, + TaskQueue* reply_queue) { + PostTask(std::unique_ptr<QueuedTask>(new PostAndReplyTask( + std::move(task), std::move(reply), reply_queue->thread_->task_runner()))); +} + +void TaskQueue::PostTaskAndReply(std::unique_ptr<QueuedTask> task, + std::unique_ptr<QueuedTask> reply) { + thread_->task_runner()->PostTaskAndReply( + FROM_HERE, base::Bind(&RunTask, base::Passed(&task)), + base::Bind(&RunTask, base::Passed(&reply))); +} + +} // namespace rtc
diff --git a/third_party/webrtc_overrides/webrtc/rtc_base/task_queue.h b/third_party/webrtc_overrides/webrtc/rtc_base/task_queue.h new file mode 100644 index 0000000..46be1420 --- /dev/null +++ b/third_party/webrtc_overrides/webrtc/rtc_base/task_queue.h
@@ -0,0 +1,230 @@ +/* + * Copyright 2016 The WebRTC Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef WEBRTC_RTC_BASE_TASK_QUEUE_H_ +#define WEBRTC_RTC_BASE_TASK_QUEUE_H_ + +#include <stdint.h> +#include <memory> + +#include "base/macros.h" +#include "third_party/webrtc/rtc_base/thread_annotations.h" + +namespace rtc { + +// Base interface for asynchronously executed tasks. +// The interface basically consists of a single function, Run(), that executes +// on the target queue. For more details see the Run() method and TaskQueue. +class QueuedTask { + public: + QueuedTask() {} + virtual ~QueuedTask() {} + + // Main routine that will run when the task is executed on the desired queue. + // The task should return |true| to indicate that it should be deleted or + // |false| to indicate that the queue should consider ownership of the task + // having been transferred. Returning |false| can be useful if a task has + // re-posted itself to a different queue or is otherwise being re-used. + virtual bool Run() = 0; + + private: + DISALLOW_COPY_AND_ASSIGN(QueuedTask); +}; + +// Simple implementation of QueuedTask for use with rtc::Bind and lambdas. +template <class Closure> +class ClosureTask : public QueuedTask { + public: + explicit ClosureTask(const Closure& closure) : closure_(closure) {} + + private: + bool Run() override { + closure_(); + return true; + } + + Closure closure_; +}; + +// Extends ClosureTask to also allow specifying cleanup code. +// This is useful when using lambdas if guaranteeing cleanup, even if a task +// was dropped (queue is too full), is required. +template <class Closure, class Cleanup> +class ClosureTaskWithCleanup : public ClosureTask<Closure> { + public: + ClosureTaskWithCleanup(const Closure& closure, Cleanup cleanup) + : ClosureTask<Closure>(closure), cleanup_(cleanup) {} + ~ClosureTaskWithCleanup() { cleanup_(); } + + private: + Cleanup cleanup_; +}; + +// Convenience function to construct closures that can be passed directly +// to methods that support std::unique_ptr<QueuedTask> but not template +// based parameters. +template <class Closure> +static std::unique_ptr<QueuedTask> NewClosure(const Closure& closure) { + return std::unique_ptr<QueuedTask>(new ClosureTask<Closure>(closure)); +} + +template <class Closure, class Cleanup> +static std::unique_ptr<QueuedTask> NewClosure(const Closure& closure, + const Cleanup& cleanup) { + return std::unique_ptr<QueuedTask>( + new ClosureTaskWithCleanup<Closure, Cleanup>(closure, cleanup)); +} + +// Implements a task queue that asynchronously executes tasks in a way that +// guarantees that they're executed in FIFO order and that tasks never overlap. +// Tasks may always execute on the same worker thread and they may not. +// To DCHECK that tasks are executing on a known task queue, use IsCurrent(). +// +// Here are some usage examples: +// +// 1) Asynchronously running a lambda: +// +// class MyClass { +// ... +// TaskQueue queue_("MyQueue"); +// }; +// +// void MyClass::StartWork() { +// queue_.PostTask([]() { Work(); }); +// ... +// +// 2) Doing work asynchronously on a worker queue and providing a notification +// callback on the current queue, when the work has been done: +// +// void MyClass::StartWorkAndLetMeKnowWhenDone( +// std::unique_ptr<QueuedTask> callback) { +// DCHECK(TaskQueue::Current()) << "Need to be running on a queue"; +// queue_.PostTaskAndReply([]() { Work(); }, std::move(callback)); +// } +// ... +// my_class->StartWorkAndLetMeKnowWhenDone( +// NewClosure([]() { LOG(INFO) << "The work is done!";})); +// +// 3) Posting a custom task on a timer. The task posts itself again after +// every running: +// +// class TimerTask : public QueuedTask { +// public: +// TimerTask() {} +// private: +// bool Run() override { +// ++count_; +// TaskQueue::Current()->PostDelayedTask( +// std::unique_ptr<QueuedTask>(this), 1000); +// // Ownership has been transferred to the next occurance, +// // so return false to prevent from being deleted now. +// return false; +// } +// int count_ = 0; +// }; +// ... +// queue_.PostDelayedTask( +// std::unique_ptr<QueuedTask>(new TimerTask()), 1000); +// +// For more examples, see task_queue_unittests.cc. +// +// A note on destruction: +// +// When a TaskQueue is deleted, pending tasks will not be executed but they will +// be deleted. The deletion of tasks may happen asynchronously after the +// TaskQueue itself has been deleted or it may happen synchronously while the +// TaskQueue instance is being deleted. This may vary from one OS to the next +// so assumptions about lifetimes of pending tasks should not be made. +class LOCKABLE TaskQueue { + public: + // TaskQueue priority levels. On some platforms these will map to thread + // priorities, on others such as Mac and iOS, GCD queue priorities. + enum class Priority { + NORMAL = 0, + HIGH, + LOW, + }; + + explicit TaskQueue(const char* queue_name, + Priority priority = Priority::NORMAL); + ~TaskQueue(); + + static TaskQueue* Current(); + + // Used for DCHECKing the current queue. + static bool IsCurrent(const char* queue_name); + bool IsCurrent() const; + + // TODO(tommi): For better debuggability, implement RTC_FROM_HERE. + + // Ownership of the task is passed to PostTask. + void PostTask(std::unique_ptr<QueuedTask> task); + void PostTaskAndReply(std::unique_ptr<QueuedTask> task, + std::unique_ptr<QueuedTask> reply, + TaskQueue* reply_queue); + void PostTaskAndReply(std::unique_ptr<QueuedTask> task, + std::unique_ptr<QueuedTask> reply); + + void PostDelayedTask(std::unique_ptr<QueuedTask> task, uint32_t milliseconds); + + template <class Closure> + void PostTask(const Closure& closure) { + PostTask(std::unique_ptr<QueuedTask>(new ClosureTask<Closure>(closure))); + } + + template <class Closure> + void PostDelayedTask(const Closure& closure, uint32_t milliseconds) { + PostDelayedTask( + std::unique_ptr<QueuedTask>(new ClosureTask<Closure>(closure)), + milliseconds); + } + + template <class Closure1, class Closure2> + void PostTaskAndReply(const Closure1& task, + const Closure2& reply, + TaskQueue* reply_queue) { + PostTaskAndReply( + std::unique_ptr<QueuedTask>(new ClosureTask<Closure1>(task)), + std::unique_ptr<QueuedTask>(new ClosureTask<Closure2>(reply)), + reply_queue); + } + + template <class Closure> + void PostTaskAndReply(std::unique_ptr<QueuedTask> task, + const Closure& reply) { + PostTaskAndReply(std::move(task), std::unique_ptr<QueuedTask>( + new ClosureTask<Closure>(reply))); + } + + template <class Closure> + void PostTaskAndReply(const Closure& task, + std::unique_ptr<QueuedTask> reply) { + PostTaskAndReply( + std::unique_ptr<QueuedTask>(new ClosureTask<Closure>(task)), + std::move(reply)); + } + + template <class Closure1, class Closure2> + void PostTaskAndReply(const Closure1& task, const Closure2& reply) { + PostTaskAndReply( + std::unique_ptr<QueuedTask>(new ClosureTask<Closure1>(task)), + std::unique_ptr<QueuedTask>(new ClosureTask<Closure2>(reply))); + } + + private: + class WorkerThread; + + std::unique_ptr<WorkerThread> thread_; + DISALLOW_COPY_AND_ASSIGN(TaskQueue); +}; + +} // namespace rtc + +#endif // WEBRTC_RTC_BASE_TASK_QUEUE_H_
diff --git a/third_party/webrtc_overrides/webrtc/rtc_base/win32socketinit.cc b/third_party/webrtc_overrides/webrtc/rtc_base/win32socketinit.cc new file mode 100644 index 0000000..6cd6f6ee --- /dev/null +++ b/third_party/webrtc_overrides/webrtc/rtc_base/win32socketinit.cc
@@ -0,0 +1,22 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Redirect WebRTC's winsock initialization activity into Chromium's +// singleton object that managest precisely that for the browser. + +#include "third_party/webrtc/rtc_base/win32socketinit.h" + +#include "net/base/winsock_init.h" + +#if !defined(WEBRTC_WIN) +#error "Only compile this on Windows" +#endif + +namespace rtc { + +void EnsureWinsockInit() { + net::EnsureWinsockInit(); +} + +} // namespace rtc
diff --git a/tools/clang/scripts/run_tool.py b/tools/clang/scripts/run_tool.py index 5f3fefa6..d55275a0 100755 --- a/tools/clang/scripts/run_tool.py +++ b/tools/clang/scripts/run_tool.py
@@ -56,6 +56,7 @@ import subprocess import sys + script_dir = os.path.dirname(os.path.realpath(__file__)) tool_dir = os.path.abspath(os.path.join(script_dir, '../pylib')) sys.path.insert(0, tool_dir) @@ -63,6 +64,40 @@ from clang import compile_db +def _PruneGitFiles(git_files, paths): + """Prunes the list of files from git to include only those that are either in + |paths| or start with one item in |paths|. + + Args: + git_files: List of all repository files. + paths: Prefix filter for the returned paths. May contain multiple entries. + + Returns: + Pruned list of files. + """ + pruned_list = [] + paths = [os.path.realpath(p) for p in sorted(paths)] + git_index = 0 + for path in paths: + least = git_index + most = len(git_files) - 1 + while least <= most: + middle = (least + most ) / 2 + if git_files[middle] == path: + least = middle + break + elif git_files[middle] > path: + most = middle - 1 + else: + least = middle + 1 + while git_files[least].startswith(path): + pruned_list.append(git_files[least]) + least += 1 + git_index = least + + return pruned_list + + def _GetFilesFromGit(paths=None): """Gets the list of files in the git repository. @@ -75,11 +110,12 @@ else: args.append('git') args.append('ls-files') - if paths: - args.extend(paths) command = subprocess.Popen(args, stdout=subprocess.PIPE) output, _ = command.communicate() - return [os.path.realpath(p) for p in output.splitlines()] + git_files = [os.path.realpath(p) for p in output.splitlines()] + if paths: + git_files = _PruneGitFiles(git_files, paths) + return git_files def _GetFilesFromCompileDB(build_directory):
diff --git a/tools/gn/bootstrap/bootstrap.py b/tools/gn/bootstrap/bootstrap.py index 7d77264..0721c68 100755 --- a/tools/gn/bootstrap/bootstrap.py +++ b/tools/gn/bootstrap/bootstrap.py
@@ -562,7 +562,6 @@ 'base/trace_event/trace_event_filter.cc', 'base/trace_event/trace_event_impl.cc', 'base/trace_event/trace_event_memory_overhead.cc', - 'base/trace_event/trace_event_synthetic_delay.cc', 'base/trace_event/trace_log.cc', 'base/trace_event/trace_log_constants.cc', 'base/trace_event/tracing_agent.cc',
diff --git a/tools/gritsettings/resource_ids b/tools/gritsettings/resource_ids index 19089bf..4f60af6a 100644 --- a/tools/gritsettings/resource_ids +++ b/tools/gritsettings/resource_ids
@@ -246,6 +246,9 @@ "ios/web/ios_web_resources.grd": { "includes": [20000], }, + "ios/web/shell/shell_resources.grd": { + "includes": [21500], + }, "ios/web/test/test_resources.grd": { "includes": [22000], },
diff --git a/tools/idl_parser/idl_lexer.py b/tools/idl_parser/idl_lexer.py index 6de4364d..6428df8 100755 --- a/tools/idl_parser/idl_lexer.py +++ b/tools/idl_parser/idl_lexer.py
@@ -66,7 +66,6 @@ 'DOMString' : 'DOMSTRING', 'double' : 'DOUBLE', 'enum' : 'ENUM', - 'exception' : 'EXCEPTION', 'false' : 'FALSE', 'float' : 'FLOAT', 'FrozenArray' : 'FROZENARRAY',
diff --git a/tools/idl_parser/idl_parser.py b/tools/idl_parser/idl_parser.py index bbc4347..8f2c120 100755 --- a/tools/idl_parser/idl_parser.py +++ b/tools/idl_parser/idl_parser.py
@@ -205,7 +205,6 @@ """Definition : CallbackOrInterface | Partial | Dictionary - | Exception | Enum | Typedef | ImplementsStatement""" @@ -350,24 +349,6 @@ else: p[0] = p[1] - # Not specified in the current spec - def p_Exception(self, p): - """Exception : EXCEPTION identifier Inheritance '{' ExceptionMembers '}' ';'""" - p[0] = self.BuildNamed('Exception', p, 2, ListFromConcat(p[3], p[5])) - - # Not specified in the current spec - def p_ExceptionMembers(self, p): - """ExceptionMembers : ExtendedAttributeList ExceptionMember ExceptionMembers - |""" - if len(p) > 1: - p[2].AddChildren(p[1]) - p[0] = ListFromConcat(p[2], p[3]) - - # Error recovery for ExceptionMembers - Not specified in the current spec - def p_ExceptionMembersError(self, p): - """ExceptionMembers : error""" - p[0] = self.BuildError(p, 'ExceptionMembers') - def p_Inheritance(self, p): """Inheritance : ':' identifier |""" @@ -680,39 +661,6 @@ p[0] = self.BuildNamed('Argument', p, 1) p[0].AddChildren(self.BuildTrue('ELLIPSIS')) - # Not specified in the current spec - def p_ExceptionMember(self, p): - """ExceptionMember : Const - | ExceptionField - | ExceptionAttribute - | ExceptionOperation""" - p[0] = p[1] - - # Not specified in the current spec - def p_ExceptionField(self, p): - """ExceptionField : Type identifier ';'""" - p[0] = self.BuildNamed('ExceptionField', p, 2, p[1]) - - # Error recovery for ExceptionMembers - Not specified in the current spec - def p_ExceptionFieldError(self, p): - """ExceptionField : error""" - p[0] = self.BuildError(p, 'ExceptionField') - - # Not specified in the current spec - def p_ExceptionAttribute(self, p): - """ExceptionAttribute : ReadOnly ATTRIBUTE Type identifier ';'""" - p[0] = self.BuildNamed('Attribute', p, 4, - ListFromConcat(p[1], p[3])) - - # Not specified in the current spec - def p_ExceptionOperation(self, p): - """ExceptionOperation : Type identifier '(' ')' ';'""" - # Needed to handle one case in DOMException.idl: - # // Override in a Mozilla compatible format - # [NotEnumerable] DOMString toString(); - # Limited form of Operation to prevent others from being added. - p[0] = self.BuildNamed('ExceptionOperation', p, 2, p[1]) - def p_Iterable(self, p): """Iterable : ITERABLE '<' Type OptionalType '>' ';'""" childlist = ListFromConcat(p[3], p[4]) @@ -788,7 +736,6 @@ | DELETER | DICTIONARY | ENUM - | EXCEPTION | GETTER | IMPLEMENTS | INHERIT
diff --git a/tools/idl_parser/test_lexer/keywords.in b/tools/idl_parser/test_lexer/keywords.in index 32dd8d1..b695a57 100644 --- a/tools/idl_parser/test_lexer/keywords.in +++ b/tools/idl_parser/test_lexer/keywords.in
@@ -12,7 +12,6 @@ DOMSTRING DOMString DOUBLE double ENUM enum -EXCEPTION exception FALSE false FLOAT float GETTER getter
diff --git a/tools/idl_parser/test_parser/exception_web.idl b/tools/idl_parser/test_parser/exception_web.idl deleted file mode 100644 index 2e28107d..0000000 --- a/tools/idl_parser/test_parser/exception_web.idl +++ /dev/null
@@ -1,87 +0,0 @@ -/* Copyright (c) 2013 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. */ - -/* Test Exception productions - -Run with --test to generate an AST and verify that all comments accurately -reflect the state of the Nodes. - -BUILD Type(Name) -This comment signals that a node of type <Type> is created with the -name <Name>. - -ERROR Error String -This comment signals that a error of <Error String> is generated. The error -is not assigned to a node, but are expected in order. - -PROP Key=Value -This comment signals that a property has been set on the Node such that -<Key> = <Value>. - -TREE -Type(Name) - Type(Name) - Type(Name) - Type(Name) - ... -This comment signals that a tree of nodes matching the BUILD comment -symatics should exist. This is an exact match. -*/ - - -/* TREE - *Exception(MyExc) - */ -exception MyExc { }; - -/* TREE - *Exception(MyExcInherit) - * Inherit(Foo) - */ -exception MyExcInherit : Foo {}; - -/* ERROR Unexpected keyword "exception" after keyword "partial". */ -partial exception MyExcPartial { }; - -/* TREE - *Exception(MyExcBig) - * ExceptionField(MyString) - * Type() - * StringType(DOMString) - * Error(Unexpected "=" after identifier "ErrorSetLong".) - * ExceptionField(MyLong) - * Type() - * PrimitiveType(long) - */ -exception MyExcBig { - DOMString MyString; - unsigned long long ErrorSetLong = 123; - long MyLong; -}; - - -/* ERROR Unexpected "{" after keyword "exception". */ -exception { - DOMString? setString = null; -}; - - -/* ERROR Unexpected identifier "NoColon" after identifier "ForParent". */ -exception ForParent NoColon { - DOMString? setString = null; -}; - -/* TREE - *Exception(MyExcConst) - * Const(setString) - * StringType(DOMString) - * Value(NULL) - */ -exception MyExcConst { - const DOMString? setString = null; -}; - - - -
diff --git a/tools/mb/docs/user_guide.md b/tools/mb/docs/user_guide.md index 9817553b..d31ea67 100644 --- a/tools/mb/docs/user_guide.md +++ b/tools/mb/docs/user_guide.md
@@ -45,12 +45,12 @@ reflect the stuff we might want to build *in addition to* the list passed in `test_targets`. Targets in this list will be treated specially, in the following way: if a given target is a "meta" - (GN: group, GYP: none) target like 'blink_tests' or - 'chromium_builder_tests', or even the ninja-specific 'all' target, - then only the *dependencies* of the target that are affected by - the modified files will be rebuilt (not the target itself, which - might also cause unaffected dependencies to be rebuilt). An empty - list will be treated as if there are no additional targets to build. + (GN: group, GYP: none) target like 'blink_tests' or or even the + ninja-specific 'all' target, then only the *dependencies* of the + target that are affected by the modified files will be rebuilt + (not the target itself, which might also cause unaffected dependencies + to be rebuilt). An empty list will be treated as if there are no additional + targets to build. Empty lists for both `test_targets` and `additional_compile_targets` would cause no work to be done, so will result in an error. * `targets`: a legacy field that resembled a union of `compile_targets`
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 120f787b..c8e9e86 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -7136,6 +7136,25 @@ <int value="3" label="Enabled from second screen"/> </enum> +<enum name="DataReductionProxyProtocolAcceptTransformEvent"> + <int value="0" label="Lite page requested"/> + <int value="1" label="Lite page transform received"/> + <int value="2" label="Empty image page policy directive received"/> + <int value="3" label="Empty image requested"/> + <int value="4" label="Empty image transform received"/> + <int value="5" label="Compressed-video requested"/> +</enum> + +<enum name="DataReductionProxyProtocolNotAcceptingTransformReason"> + <int value="0" + label="Not accepting proxy transforms, transforms disabled on client"/> + <int value="1" + label="Not accepting proxy transforms, page blacklisted on client"/> + <int value="2" + label="Not accepting proxy transforms, not on cellular in cellular-only + mode"/> +</enum> + <enum name="DataReductionProxyProxyPrefMigrationResult"> <int value="0" label="Proxy pref not cleared"/> <int value="1" label="Empty proxy pref was cleared"/> @@ -7814,6 +7833,8 @@ <int value="8" label="Resumed migration failed (file error)"/> <int value="9" label="New migration failed (file error EIO on open)"/> <int value="10" label="Resumed migration failed (file error EIO on open)"/> + <int value="11" label="New migration cancelled"/> + <int value="12" label="Resumed migration cancelled"/> </enum> <enum name="DircryptoMigrationFailedOperationType"> @@ -15625,6 +15646,24 @@ <int value="2031" label="MIDIMessageEvent"/> <int value="2032" label="FetchEventIsReload"/> <int value="2033" label="ServiceWorkerClientFrameType"/> + <int value="2034" label="QuirksModeDocument"/> + <int value="2035" label="LimitedQuirksModeDocument"/> + <int value="2036" label="EncryptedMediaCrossOriginIframe"/> + <int value="2037" label="CSSSelectorWebkitMediaControls"/> + <int value="2038" label="CSSSelectorWebkitMediaControlsOverlayEnclosure"/> + <int value="2039" label="CSSSelectorWebkitMediaControlsOverlayPlayButton"/> + <int value="2040" label="CSSSelectorWebkitMediaControlsEnclosure"/> + <int value="2041" label="CSSSelectorWebkitMediaControlsPanel"/> + <int value="2042" label="CSSSelectorWebkitMediaControlsPlayButton"/> + <int value="2043" label="CSSSelectorWebkitMediaControlsCurrentTimeDisplay"/> + <int value="2044" label="CSSSelectorWebkitMediaControlsTimeRemainingDisplay"/> + <int value="2045" label="CSSSelectorWebkitMediaControlsTimeline"/> + <int value="2046" label="CSSSelectorWebkitMediaControlsTimelineContainer"/> + <int value="2047" label="CSSSelectorWebkitMediaControlsMuteButton"/> + <int value="2048" label="CSSSelectorWebkitMediaControlsVolumeSlider"/> + <int value="2049" label="CSSSelectorWebkitMediaControlsFullscreenButton"/> + <int value="2050" + label="CSSSelectorWebkitMediaControlsToggleClosedCaptionsButton"/> </enum> <enum name="FeedbackSource"> @@ -18806,7 +18845,16 @@ <summary> These numbers are the lower 32 bits of the hash of the metric name. </summary> + <int value="-2055973512" label="Login.ConsumerNewUsersAllowed"/> + <int value="-1286300074" + label="Network.Shill.Wifi.ExpiredLeaseLengthSeconds"/> <int value="0" label="Missing hash value"/> + <int value="424952287" + label="Network.Shill.Wifi.LinkMonitorResponseTimeSample"/> + <int value="628921860" + label="Network.Shill.Ethernet.LinkMonitorResponseTimeSample"/> + <int value="662206917" + label="Network.Shill.Ethernet.ExpiredLeaseLengthSeconds"/> </enum> <enum name="HistoryFaviconsRecoveryEnum"> @@ -22117,6 +22165,7 @@ <int value="-2143328006" label="enable-fill-on-account-select-no-highlighting"/> <int value="-2143113994" label="enable-ephemeral-apps-in-webstore"/> + <int value="-2134717874" label="Multidevice:disabled"/> <int value="-2134333982" label="ShowArcFilesApp:enabled"/> <int value="-2134244069" label="HttpFormWarning:enabled"/> <int value="-2132591642" label="enable-input-view"/> @@ -22467,6 +22516,7 @@ <int value="-1033738911" label="enable-mac-views-dialogs"/> <int value="-1029920490" label="IdleTimeSpellChecking:enabled"/> <int value="-1028733699" label="MacViewsWebUIDialogs:disabled"/> + <int value="-1027022706" label="ContentSuggestionsVideoOverlay:disabled"/> <int value="-1022971520" label="enable-search-button-in-omnibox-for-str"/> <int value="-1020450980" label="gesture-deletion"/> <int value="-1016202433" label="disable-add-to-shelf"/> @@ -22780,6 +22830,7 @@ <int value="98134240" label="material-design-ink-drop-animation-speed"/> <int value="103932290" label="show-autofill-type-predictions"/> <int value="106840653" label="mus"/> + <int value="112420129" label="ContentSuggestionsVideoOverlay:enabled"/> <int value="118991027" label="enable-accelerated-fixed-root-background"/> <int value="119185738" label="OmniboxUIExperimentMaxAutocompleteMatches:disabled"/> @@ -23189,8 +23240,10 @@ <int value="1510476448" label="disable-prefixed-encrypted-media"/> <int value="1511140997" label="OfflinePagesAsyncDownload:disabled"/> <int value="1511161758" label="BackgroundLoader:enabled"/> + <int value="1512249489" label="ModuleScripts:disabled"/> <int value="1515196403" label="fast-user-switching"/> <int value="1517863401" label="history-entry-requires-user-gesture"/> + <int value="1533111748" label="Multidevice:enabled"/> <int value="1538690515" label="OneGoogleBarOnLocalNtp:enabled"/> <int value="1541723759" label="ServiceWorkerNavigationPreload:disabled"/> <int value="1548776701" label="AllBookmarks:disabled"/> @@ -23333,6 +23386,7 @@ <int value="2059322877" label="new-avatar-menu"/> <int value="2063091429" label="OfflinePagesSharing:enabled"/> <int value="2067634730" label="LsdPermissionPrompt:disabled"/> + <int value="2067923510" label="ModuleScripts:enabled"/> <int value="2071340353" label="progress-bar-completion"/> <int value="2071461362" label="disable-credit-card-scan"/> <int value="2076787478" label="OmniboxDisplayTitleForCurrentUrl:disabled"/> @@ -26908,11 +26962,17 @@ </enum> <enum name="OfflinePagesOfflineUsage"> - <int value="0" label="Not used"/> - <int value="1" label="Started, but no pages loaded successfully"/> - <int value="2" label="Offline pages loaded only"/> - <int value="3" label="Online pages loaded only"/> - <int value="4" label="Both offlilne and online pages loaded"/> + <int value="0" label="Not used">Not used at all during whole day.</int> + <int value="1" label="Started, but no pages loaded successfully"> + Started, but failed to successfully navigate. + </int> + <int value="2" label="Offline pages loaded only"> + Only navigated to offline pages locally saved on the device. + </int> + <int value="3" label="Online pages loaded only">Only navigated online.</int> + <int value="4" label="Both offlilne and online pages loaded"> + Navigated to both online and offline pages. + </int> </enum> <enum name="OfflinePagesRedirectResult"> @@ -30583,6 +30643,7 @@ <int value="5" label="INVALID_FORM"/> <int value="6" label="AUTOCOMPLETE_OFF"/> <int value="7" label="SYNC_CREDENTIALS"/> + <int value="8" label="SAVING_ON_HTTP_AFTER_HTTPS"/> </enum> <enum name="ProxyStatus"> @@ -30904,6 +30965,7 @@ <int value="7" label="Service Worker unregistered"/> <int value="8" label="subscribe() storage corrupt"/> <int value="9" label="getSubscription() storage corrupt"/> + <int value="10" label="Service Worker database got wiped"/> </enum> <enum name="PushUnregistrationStatus"> @@ -36508,6 +36570,20 @@ <int value="2051" label="TPM_E_DEFEND_LOCK_RUNNING"/> </enum> +<enum name="TPMVersionFingerprint"> + <int value="305524852" label="IFX 4.32 build 0x36f variant 1"/> + <int value="517482723" label="IFX 4.32 build 0x36f variant 2"/> + <int value="987235505" label="CROS 0dc5c85b01a68fe6"/> + <int value="987973414" label="IFX 6.40 build 0xbe"/> + <int value="1353576267" label="IFX 3.18 build 0x9"/> + <int value="1437720528" label="IFX 133.32 build 0x5 variant 1"/> + <int value="1451134301" label="IFX 147.18 build 0xf"/> + <int value="1490841853" label="IFX 133.32 build 0x5 variant 2"/> + <int value="1716634300" label="IFX 133.32 build 0x5 variant 3"/> + <int value="1828625721" label="IFX 4.31 build 0x2c2"/> + <int value="1887455524" label="CROS 0fd788bd01a68fe6"/> +</enum> + <enum name="TrackedPreference"> <int value="0" label="kShowHomeButton"/> <int value="1" label="kHomePageIsNewTabPage"/>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 6862fda..636257b9 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -11083,6 +11083,26 @@ </summary> </histogram> +<histogram name="DataReductionProxy.Protocol.AcceptTransform" + enum="DataReductionProxyProtocolAcceptTransformEvent"> + <owner>dougarnett@chromium.org</owner> + <summary> + Records the sending of accepted transform headers to the data reduction + proxy and also receiving transforms and policies from the data reduction + proxy. Recorded on a per page request basis and possibly on a per image + subresource request basis for empty-image transforms. + </summary> +</histogram> + +<histogram name="DataReductionProxy.Protocol.NotAcceptingTransform" + enum="DataReductionProxyProtocolNotAcceptingTransformReason"> + <owner>dougarnett@chromium.org</owner> + <summary> + Records the reason that a page request is not accepting proxy server + transforms. Recorded on a per page request basis. + </summary> +</histogram> + <histogram name="DataReductionProxy.ProxyPrefMigrationResult" enum="DataReductionProxyProxyPrefMigrationResult"> <owner>sclittle@chromium.org</owner> @@ -22133,7 +22153,8 @@ <summary>Records the source that requested showing the feedback app.</summary> </histogram> -<histogram name="FileBrowser.ChangeDirectory.RootType" enum="FileManagerRootType"> +<histogram name="FileBrowser.ChangeDirectory.RootType" + enum="FileManagerRootType"> <owner>yamaguchi@chromium.com</owner> <summary> Chrome OS File Browser: Counts the number of directory-changed events, @@ -31263,6 +31284,15 @@ </summary> </histogram> +<histogram name="MediaRouter.Source.FileFormat" enum="MediaContainers"> + <owner>paezagon@chromium.org</owner> + <summary> + The file format of a local media Media Router session. This is recorded when + a casting session begins to keep track of what kind of media is being + streamed. + </summary> +</histogram> + <histogram name="MediaRouter.Ui.Action.CloseLatency" units="ms"> <owner>apacible@chromium.org</owner> <summary> @@ -38744,6 +38774,9 @@ <histogram name="Net.ProxyService.GetProxyUsingScriptResult" enum="NetErrorCodes"> + <obsolete> + Deprecated as of Chrome 61. + </obsolete> <owner>eroman@chromium.org</owner> <summary> The network error code of resolving a URL by forwarding the request to the @@ -38753,6 +38786,9 @@ <histogram name="Net.ProxyService.GetProxyUsingScriptTime" units="100s of microseconds"> + <obsolete> + Deprecated as of Chrome 61. + </obsolete> <owner>eroman@chromium.org</owner> <summary> The time taken to resolve a URL by forwarding the request to the proxy @@ -38763,6 +38799,9 @@ </histogram> <histogram name="Net.ProxyService.ResolvedUsingScript" enum="Boolean"> + <obsolete> + Deprecated as of Chrome 61. + </obsolete> <owner>eroman@chromium.org</owner> <summary> Whether proxy resolution occured by forwarding the request to the proxy @@ -38778,6 +38817,9 @@ <histogram name="Net.ProxyService.ResolveProxyTime" units="100s of microseconds"> + <obsolete> + Deprecated as of Chrome 61. + </obsolete> <owner>eroman@chromium.org</owner> <summary> The total time taken to resolve a URL. This includes PAC script execution, @@ -38787,6 +38829,9 @@ </histogram> <histogram name="Net.ProxyService.ScriptTerminated" enum="BooleanTerminated"> + <obsolete> + Deprecated as of Chrome 61. + </obsolete> <owner>eroman@chromium.org</owner> <summary> Whether a proxy resolution resulted in the PAC script terminating @@ -38798,6 +38843,9 @@ <histogram name="Net.ProxyService.ScriptTerminatedOnInit" enum="BooleanTerminated"> + <obsolete> + Deprecated as of Chrome 61. + </obsolete> <owner>eroman@chromium.org</owner> <summary> Whether the creation of a new proxy resolver resulted in the PAC script @@ -47870,14 +47918,8 @@ <owner>dimich@chromium.org</owner> <summary> Enum-based buckets reflect the number of days the Chrome was used in each - specific way: - - Not used at all during whole day. - - Started, but failed to successfully navigate. - - Only navigated to offline pages locally saved on the device. - - Only navigated online. - - Navigated to both online and offline pages. - This data is accumulated locally and reported when connection is likely to - succeed (usually after successful online navigation). + specific way. This data is accumulated locally and reported when connection + is likely to succeed (usually after successful online navigation). </summary> </histogram> @@ -54926,6 +54968,14 @@ </summary> </histogram> +<histogram name="Platform.TPM.VersionFingerprint" enum="TPMVersionFingerprint"> + <owner>mnissler@chromium.org</owner> + <summary> + Indicates a fingerprint of hardware + firmware versions for the TPM chip + present in a Chrome OS device. + </summary> +</histogram> + <histogram name="Platform.TPMForcedReboot" units="reboots"> <owner>dkrahn@chromium.org</owner> <summary> @@ -80045,6 +80095,25 @@ </summary> </histogram> +<histogram name="UMA.FileMetricsProvider.EmbeddedProfile.DroppedFileAge" + units="minutes"> + <owner>asvitkine@chromium.org</owner> + <owner>bcwhite@chromium.org</owner> + <summary> + Records the last-modified age of a file that was dropped for lack of an + embedded profile. + </summary> +</histogram> + +<histogram name="UMA.FileMetricsProvider.EmbeddedProfile.DroppedHistogramCount"> + <owner>asvitkine@chromium.org</owner> + <owner>bcwhite@chromium.org</owner> + <summary> + Records the number of histograms present in a file that was dropped for lack + of an embedded profile. + </summary> +</histogram> + <histogram name="UMA.FileMetricsProvider.EmbeddedProfileResult" enum="FileMetricsProviderEmbeddedProfileResult"> <owner>asvitkine@chromium.org</owner> @@ -80578,6 +80647,16 @@ </summary> </histogram> +<histogram name="UpdateClient.BackgroundDownloaderJobs" units="jobs"> + <owner>sorin@chromium.org</owner> + <summary> + The number of download jobs found in the Windows BITS queue. This value is + expected to be zero in most cases, or a small number otherwise. Large values + indicate a problem with the job creation or clean up code. The metric is + recorded before a new BITS job is created and inserted into BITS queue. + </summary> +</histogram> + <histogram name="UpdateEngine.Attempt.ConnectionType" enum="UpdateEngineConnectionType"> <owner>zeuthen@chromium.org</owner> @@ -81264,6 +81343,15 @@ </summary> </histogram> +<histogram name="UserManager.ProfileEverInitializedMigrationCompleted" + enum="BooleanCompleted"> + <owner>atwilson@chromium.org</owner> + <summary> + Whether the profile_ever_initialized() user attribute migration has + completed for the current user. + </summary> +</histogram> + <histogram name="UserSessionManager.RestoreOnCrash.AccountIdValid" enum="BooleanValid"> <owner>msarda@chromium.org</owner> @@ -82400,6 +82488,13 @@ </summary> </histogram> +<histogram name="Variations.StoreSeed.HasCountry" enum="Boolean"> + <owner>asvitkine@chromium.org</owner> + <summary> + Records whether a country code was present when storing the variations seed. + </summary> +</histogram> + <histogram name="Variations.StoreSeed.Size" units="KiB"> <owner>asvitkine@chromium.org</owner> <summary> @@ -95242,18 +95337,42 @@ <suffix name="Background" label="Time spend in tasks of a particular type when the renderer is in the background."/> - <suffix name="Foreground" - label="Time spent in tasks of a particular type when the renderer is in - the foreground. Please note that individual tabs in this - renderer can be backgrounded."/> <suffix name="Background.FirstMinute" label="Time spent in tasks of a particular type during the first minute after backgrounding the renderer. A large amount of loading tasks are expected during this period."/> - <suffix name="Background.AfterFirstMinute" - label="Time spent in tasks of a particular type starting from the first + <suffix name="Background.SecondMinute" + label="Time spent in tasks of a particular type during the second + minute after backgrounding the renderer."/> + <suffix name="Background.ThirdMinute" + label="Time spent in tasks of a particular type during the third minute + after backgrounding the renderer."/> + <suffix name="Background.FourthMinute" + label="Time spent in tasks of a particular type during the fourth + minute after backgrounding the renderer."/> + <suffix name="Background.FifthMinute" + label="Time spent in tasks of a particular type during the fifth minute + after backgrounding the renderer."/> + <suffix name="Background.AfterFifthMinute" + label="Time spent in tasks of a particular type starting from the sixth minute after backgrounding the renderer. The renderer is expected to be mostly idle during this period."/> + <suffix name="Foreground" + label="Time spent in tasks of a particular type when the renderer is in + the foreground. Please note that individual tabs in this + renderer can be backgrounded."/> + <suffix name="Foreground.FirstMinute" + label="Time spent in tasks of a particular type during the first minute + after foregrounding the renderer."/> + <suffix name="Foreground.SecondMinute" + label="Time spent in tasks of a particular type during the second + minute after foregrounding the renderer."/> + <suffix name="Foreground.ThirdMinute" + label="Time spent in tasks of a particular type during the third minute + after foregrounding the renderer."/> + <suffix name="Foreground.AfterThirdMinute" + label="Time spent in tasks of a particular type starting from the + fourth minute after foregrounding the renderer."/> <suffix name="Hidden" label="Time spent in tasks of a particular type when the renderer is hidden."/> @@ -95916,7 +96035,6 @@ </histogram_suffixes> <histogram_suffixes name="ServiceWorker.StartSituation" separator="_"> - <affected-histogram name="EmbeddedWorkerInstance.Start.StartMessageLatency"/> <suffix name="DuringStartup" label="The worker started up during browser startup."/> <suffix name="NewProcess" @@ -95924,6 +96042,7 @@ created, depending on the histogram)."/> <suffix name="ExistingProcess" label="An existing process was used for the worker."/> + <affected-histogram name="EmbeddedWorkerInstance.Start.StartMessageLatency"/> <affected-histogram name="EmbeddedWorkerInstance.Start.TimeToEvaluateScript"/> <affected-histogram name="EmbeddedWorkerInstance.Start.TimeToLoad.HttpCache"/> <affected-histogram
diff --git a/tools/metrics/ukm/ukm.xml b/tools/metrics/ukm/ukm.xml index 4e330d2..a983545 100644 --- a/tools/metrics/ukm/ukm.xml +++ b/tools/metrics/ukm/ukm.xml
@@ -564,6 +564,102 @@ metric is recorded for kSubmittedFormTypeUnspecified. </summary> </metric> + <metric name="SuppressedAccount.Generated.HTTPSNotHTTP"> + <summary> + Records, for each password form seen by the password manager, whether + there were `suppressed` credentials, meaning stored credentials that were + not filled, that were suppressed because they were stored for an HTTPS + origin while the password form was seen on an HTTP origin. If there were + such credentials, the histogram also records whether the username and + password of such suppressed credentials matched those submitted. This + recording happens only for credentials that were originally auto-generated + (as opposed to user typed). Recorded values correspond to the enum + SuppressedAccountExistence. + </summary> + </metric> + <metric name="SuppressedAccount.Generated.PSLMatching"> + <summary> + Records, for each password form seen by the password manager, whether + there were `suppressed` credentials, meaning stored credentials that were + not filled, that were suppressed because they were for an origin that was + only PSL-matching the origin of the observed form (see the suffix + description for the possible classes of such near-matches). If there were + such credentials, the histogram also records whether the username and + password of such suppressed credentials matched those submitted. This + recording happens only for credentials that were originally auto-generated + (as opposed to user typed). Recorded values correspond to the enum + SuppressedAccountExistence. + </summary> + </metric> + <metric name="SuppressedAccount.Generated.SameOrganizationName"> + <summary> + Records, for each password form seen by the password manager, whether + there were `suppressed` credentials, meaning stored credentials that were + not filled, that were suppressed because they were for an origin that was + only matching the visited origin if the TLD is stripped. If there were + such credentials, the histogram also records whether the username and + password of such suppressed credentials matched those submitted. This + recording happens only for credentials that were originally auto-generated + (as opposed to user typed). Recorded values correspond to the enum + SuppressedAccountExistence. + </summary> + </metric> + <metric name="SuppressedAccount.Manual.HTTPSNotHTTP"> + <summary> + Records, for each password form seen by the password manager, whether + there were `suppressed` credentials, meaning stored credentials that were + not filled, that were suppressed because they were stored for an HTTPS + origin while the password form was seen on an HTTP origin. If there were + such credentials, the histogram also records whether the username and + password of such suppressed credentials matched those submitted. This + recording happens only for credentials that were originally entered by the + user (as opposed to auto-generated). Recorded values correspond to the + enum SuppressedAccountExistence. + </summary> + </metric> + <metric name="SuppressedAccount.Manual.PSLMatching"> + <summary> + Records, for each password form seen by the password manager, whether + there were `suppressed` credentials, meaning stored credentials that were + not filled, that were suppressed because they were for an origin that was + only PSL-matching the origin of the observed form (see the suffix + description for the possible classes of such near-matches). If there were + such credentials, the histogram also records whether the username and + password of such suppressed credentials matched those submitted. This + recording happens only for credentials that were originally entered by the + user (as opposed to auto-generated). Recorded values correspond to the + enum SuppressedAccountExistence. + </summary> + </metric> + <metric name="SuppressedAccount.Manual.SameOrganizationName"> + <summary> + Records, for each password form seen by the password manager, whether + there were `suppressed` credentials, meaning stored credentials that were + not filled, that were suppressed because they were for an origin that was + only matching the visited origin if the TLD is stripped. If there were + such credentials, the histogram also records whether the username and + password of such suppressed credentials matched those submitted. This + recording happens only for credentials that were originally entered by the + user (as opposed to auto-generated). Recorded values correspond to the + enum SuppressedAccountExistence. + </summary> + </metric> +</event> + +<event name="PageWithPassword"> + <owner>battre@chromium.org</owner> + <summary> + Metrics about websites that contain password forms and the user's + interactions with them. No events are created for pages that don't contain + password forms. + </summary> + <metric name="UserModifiedPasswordField"> + <summary> + Records a 1 for every page on which a user has modified a password text + field - regardless of how many password fields a page contains or the user + modifies. + </summary> + </metric> </event> <event name="PaymentRequest.CheckoutEvents">
diff --git a/tools/perf/benchmarks/blink_perf.py b/tools/perf/benchmarks/blink_perf.py index 4362de7..761f747 100644 --- a/tools/perf/benchmarks/blink_perf.py +++ b/tools/perf/benchmarks/blink_perf.py
@@ -314,6 +314,8 @@ def SetExpectations(self): self.PermanentlyDisableBenchmark( [story.expectations.ANDROID_SVELTE], 'crbug.com/593973') + self.DisableStory('putImageData.html', + [story.expectations.ANDROID_NEXUS6], 'crbug.com/738453') return StoryExpectations() def SetExtraBrowserOptions(self, options):
diff --git a/tools/perf/benchmarks/blob_storage.py b/tools/perf/benchmarks/blob_storage.py index 5df337cb..951cffb5 100644 --- a/tools/perf/benchmarks/blob_storage.py +++ b/tools/perf/benchmarks/blob_storage.py
@@ -4,7 +4,6 @@ from core import perf_benchmark -from telemetry import benchmark from telemetry.timeline import chrome_trace_category_filter from telemetry.web_perf import timeline_based_measurement @@ -15,9 +14,6 @@ TIMELINE_REQUIRED_CATEGORY = 'blink.console' -# http://crbug.com/499325 -# http://crbug.com/595069 -@benchmark.Disabled('android', 'win') class BlobStorage(perf_benchmark.PerfBenchmark): """Timeline based measurement benchmark for Blob Storage."""
diff --git a/tools/perf/benchmarks/smoothness.py b/tools/perf/benchmarks/smoothness.py index fa2a3126..01049de4 100644 --- a/tools/perf/benchmarks/smoothness.py +++ b/tools/perf/benchmarks/smoothness.py
@@ -752,20 +752,3 @@ # has been named this way for long time, we keep the name as-is to avoid # data migration. return 'scheduler.tough_scheduling_cases' - - def GetExpectations(self): - class StoryExpectations(story_module.expectations.StoryExpectations): - def SetExpectations(self): - - self.DisableStory('simple_text_page.html?medium_raster', - [story_module.expectations.ALL], 'crbug.com/413829') - self.DisableStory('simple_text_page.html?heavy_raster', - [story_module.expectations.ALL], - 'crbug.com/413829 and crbug.com/368532') - self.DisableStory('raf.html?medium_handler', - [story_module.expectations.ALL], - 'crbug.com/413829') - self.DisableStory('raf.html?heavy_handler', - [story_module.expectations.ALL], - 'crbug.com/413829 and crbug.com/368532') - return StoryExpectations()
diff --git a/tools/perf/benchmarks/speedometer2.py b/tools/perf/benchmarks/speedometer2.py index 9645c85..9f056b660 100644 --- a/tools/perf/benchmarks/speedometer2.py +++ b/tools/perf/benchmarks/speedometer2.py
@@ -82,7 +82,6 @@ key=suite_name), important=False)) -@benchmark.Disabled('all') # Schedule this benchmark in crbug.com/734061 @benchmark.Owner(emails=['verwaest@chromium.org, mvstanton@chromium.org']) class Speedometer2(perf_benchmark.PerfBenchmark): test = Speedometer2Measurement
diff --git a/tools/perf/contrib/vr_benchmarks/OWNERS b/tools/perf/contrib/vr_benchmarks/OWNERS new file mode 100644 index 0000000..a552bdf --- /dev/null +++ b/tools/perf/contrib/vr_benchmarks/OWNERS
@@ -0,0 +1,5 @@ +nednguyen@chromium.org + +# These users are familiar with the code, but not actually committers +bsheedy@chromium.org +leilei@chromium.org
diff --git a/tools/perf/core/benchmark_sharding_map.json b/tools/perf/core/benchmark_sharding_map.json index 1ba10042..f4377cf 100644 --- a/tools/perf/core/benchmark_sharding_map.json +++ b/tools/perf/core/benchmark_sharding_map.json
@@ -76,7 +76,8 @@ "jetstream", "page_cycler_v2.intl_hi_ru", "smoothness.tough_texture_upload_cases", - "speedometer" + "speedometer", + "speedometer2" ] }, "build14-b1--device3": { @@ -306,7 +307,8 @@ "jetstream", "page_cycler_v2.intl_hi_ru", "smoothness.tough_texture_upload_cases", - "speedometer" + "speedometer", + "speedometer2" ] }, "build74-b1--device3": { @@ -617,6 +619,7 @@ "smoothness.desktop_tough_pinch_zoom_cases", "smoothness.sync_scroll.key_mobile_sites_smooth", "speedometer", + "speedometer2", "tab_switching.typical_25" ] }, @@ -741,7 +744,8 @@ "jetstream", "page_cycler_v2.intl_hi_ru", "smoothness.tough_texture_upload_cases", - "speedometer" + "speedometer", + "speedometer2" ] }, "build16-b1--device3": { @@ -1052,6 +1056,7 @@ "smoothness.desktop_tough_pinch_zoom_cases", "smoothness.sync_scroll.key_mobile_sites_smooth", "speedometer", + "speedometer2", "tab_switching.typical_25" ] }, @@ -1122,6 +1127,7 @@ "smoothness.tough_scrolling_cases", "smoothness.tough_texture_upload_cases", "speedometer", + "speedometer2", "storage.indexeddb_endure_tracing" ] }, @@ -1480,6 +1486,7 @@ "media.android.tough_video_cases_tbmv2", "power.trivial_pages", "speedometer", + "speedometer2", "thread_times.tough_compositor_cases", "v8.infinite_scroll_tbmv2" ] @@ -1636,7 +1643,8 @@ "jetstream", "page_cycler_v2.intl_hi_ru", "smoothness.tough_texture_upload_cases", - "speedometer" + "speedometer", + "speedometer2" ] }, "build248-m4--device3": { @@ -1869,6 +1877,7 @@ "smoothness.tough_path_rendering_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "speedometer-turbo", "tab_switching.typical_25", "thread_times.tough_compositor_cases", @@ -2037,6 +2046,7 @@ "smoothness.tough_path_rendering_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "speedometer-turbo", "tab_switching.typical_25", "thread_times.tough_compositor_cases", @@ -2204,6 +2214,7 @@ "smoothness.tough_path_rendering_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "speedometer-turbo", "tab_switching.typical_25", "thread_times.tough_compositor_cases", @@ -2369,6 +2380,7 @@ "smoothness.tough_path_rendering_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "speedometer-turbo", "tab_switching.typical_25", "thread_times.tough_compositor_cases", @@ -2536,6 +2548,7 @@ "smoothness.tough_path_rendering_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "speedometer-turbo", "tab_switching.typical_25", "thread_times.tough_compositor_cases", @@ -2702,6 +2715,7 @@ "smoothness.tough_path_rendering_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "speedometer-turbo", "tab_switching.typical_25", "thread_times.tough_compositor_cases", @@ -2906,6 +2920,7 @@ "smoothness.tough_path_rendering_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "speedometer-turbo", "tab_switching.typical_25", "thread_times.tough_compositor_cases", @@ -3180,6 +3195,7 @@ "smoothness.tough_filters_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "startup.warm.chrome_signin", "v8.runtimestats.browsing_mobile_turbo" ] @@ -3268,6 +3284,7 @@ "smoothness.tough_path_rendering_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "speedometer-turbo", "tab_switching.typical_25", "thread_times.tough_compositor_cases", @@ -3580,6 +3597,7 @@ "smoothness.tough_filters_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "startup.warm.chrome_signin", "v8.runtimestats.browsing_mobile_turbo" ] @@ -3669,6 +3687,7 @@ "smoothness.tough_path_rendering_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "speedometer-turbo", "tab_switching.typical_25", "thread_times.tough_compositor_cases", @@ -3833,6 +3852,7 @@ "smoothness.tough_path_rendering_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "speedometer-turbo", "tab_switching.typical_25", "thread_times.tough_compositor_cases", @@ -4000,6 +4020,7 @@ "smoothness.tough_path_rendering_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "speedometer-turbo", "tab_switching.typical_25", "thread_times.tough_compositor_cases", @@ -4166,6 +4187,7 @@ "smoothness.tough_path_rendering_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "speedometer-turbo", "tab_switching.typical_25", "thread_times.tough_compositor_cases", @@ -4331,6 +4353,7 @@ "smoothness.tough_path_rendering_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "speedometer-turbo", "tab_switching.typical_25", "thread_times.tough_compositor_cases", @@ -4495,6 +4518,7 @@ "smoothness.tough_path_rendering_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "speedometer-turbo", "tab_switching.typical_25", "thread_times.tough_compositor_cases", @@ -4664,6 +4688,7 @@ "smoothness.tough_path_rendering_cases", "smoothness.tough_scrolling_cases", "speedometer", + "speedometer2", "speedometer-turbo", "tab_switching.typical_25", "thread_times.tough_compositor_cases", @@ -4830,6 +4855,7 @@ "smoothness.tough_webgl_ad_cases", "smoothness.tough_webgl_cases", "speedometer", + "speedometer2", "start_with_ext.cold.blank_page", "start_with_ext.warm.blank_page", "start_with_url.cold.startup_pages", @@ -4868,4 +4894,4 @@ "v8.runtimestats.browsing_mobile", "webrtc" ] -} \ No newline at end of file +}
diff --git a/tools/perf/core/desktop_benchmark_avg_times.json b/tools/perf/core/desktop_benchmark_avg_times.json index d401d88..1cf1e62 100644 --- a/tools/perf/core/desktop_benchmark_avg_times.json +++ b/tools/perf/core/desktop_benchmark_avg_times.json
@@ -85,6 +85,7 @@ "smoothness.tough_webgl_ad_cases": 276.34991042891215, "smoothness.tough_webgl_cases": 176.61726460002717, "speedometer": 67.36228357814252, + "speedometer2": 120, "speedometer-ignition": 73.98038034345589, "startup.cold.blank_page": 644.8810393966897, "startup.large_profile.cold.blank_page": 1280.4007164489933,
diff --git a/tools/perf/core/perf_data_generator.py b/tools/perf/core/perf_data_generator.py index 01c2e71..59978643 100755 --- a/tools/perf/core/perf_data_generator.py +++ b/tools/perf/core/perf_data_generator.py
@@ -483,7 +483,10 @@ 'pool': 'Chrome-perf', 'device_ids': [ 'build158-m1', 'build159-m1', 'build160-m1', - 'build161-m1', 'build162-m1'] + 'build161-m1', 'build162-m1'], + 'perf_tests': [ + ('net_perftests', 'build159-m1'), + ] } ]) waterfall = add_tester( @@ -754,6 +757,8 @@ # Please add a comment with a bug for replacing the device. BLACKLISTED_DEVICES = [ 'build152-m1', # crbug.com/736593 + # All Linux perf bots (crbug.com/732463) + 'build148-m1', 'build149-m1', 'build150-m1', 'build151-m1', 'build152-m1', ]
diff --git a/tools/perf/measurements/smoothness.py b/tools/perf/measurements/smoothness.py index 198087b0..0fe711a 100644 --- a/tools/perf/measurements/smoothness.py +++ b/tools/perf/measurements/smoothness.py
@@ -52,8 +52,6 @@ options = timeline_based_measurement.Options(category_filter) options.config.enable_platform_display_trace = True options.SetLegacyTimelineBasedMetrics([smoothness.SmoothnessMetric()]) - for delay in page.GetSyntheticDelayCategories(): - options.category_filter.AddSyntheticDelay(delay) self._tbm = timeline_based_measurement.TimelineBasedMeasurement( options, self._results_wrapper) self._tbm.WillRunStory(tab.browser.platform)
diff --git a/tools/perf/measurements/smoothness_unittest.py b/tools/perf/measurements/smoothness_unittest.py index 2e22a03..d19636de 100644 --- a/tools/perf/measurements/smoothness_unittest.py +++ b/tools/perf/measurements/smoothness_unittest.py
@@ -1,7 +1,6 @@ # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import sys import unittest from telemetry import decorators @@ -81,35 +80,6 @@ self._options = options_for_unittests.GetCopy() self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF - def testSyntheticDelayConfiguration(self): - test_page = page.Page('http://dummy', None, name='http://dummy') - test_page.synthetic_delays = { - 'cc.BeginMainFrame': {'target_duration': 0.012}, - 'cc.DrawAndSwap': {'target_duration': 0.012, 'mode': 'alternating'}, - 'gpu.PresentingFrame': {'target_duration': 0.012} - } - - tab = FakeTab() - measurement = smoothness.Smoothness() - measurement.WillStartBrowser(tab.browser.platform) - measurement.WillNavigateToPage(test_page, tab) - - expected_synthetic_delay = set([ - 'DELAY(cc.BeginMainFrame;0.012000;static)', - 'DELAY(cc.DrawAndSwap;0.012000;alternating)', - 'DELAY(gpu.PresentingFrame;0.012000;static)', - ]) - config = tab.browser.platform.tracing_controller.config - actual_synthetic_delay = ( - config.chrome_trace_config.category_filter.synthetic_delays) - - if expected_synthetic_delay != actual_synthetic_delay: - sys.stderr.write('Expected category filter: %s\n' % - repr(expected_synthetic_delay)) - sys.stderr.write('Actual category filter filter: %s\n' % - repr(actual_synthetic_delay)) - self.assertEquals(expected_synthetic_delay, actual_synthetic_delay) - # crbug.com/483212 @decorators.Disabled('chromeos') def testSmoothness(self):
diff --git a/tools/perf/measurements/timeline_controller.py b/tools/perf/measurements/timeline_controller.py index f03bee0..8995cab 100644 --- a/tools/perf/measurements/timeline_controller.py +++ b/tools/perf/measurements/timeline_controller.py
@@ -28,6 +28,7 @@ """Starts gathering timeline data. """ + del page # unused # Resets these member variables incase this object is reused. self._model = None self._renderer_process = None @@ -36,9 +37,6 @@ config = tracing_config.TracingConfig() config.chrome_trace_config.category_filter.AddFilterString( self.trace_categories) - for delay in page.GetSyntheticDelayCategories(): - config.chrome_trace_config.category_filter.AddSyntheticDelay( - delay) config.enable_chrome_trace = True tab.browser.platform.tracing_controller.StartTracing(config)
diff --git a/tools/perf/page_sets/data/key_desktop_move_cases.json b/tools/perf/page_sets/data/key_desktop_move_cases.json index 16eaa69..40eafb5 100644 --- a/tools/perf/page_sets/data/key_desktop_move_cases.json +++ b/tools/perf/page_sets/data/key_desktop_move_cases.json
@@ -4,7 +4,7 @@ "DEFAULT": "key_desktop_move_cases_000.wpr" }, "https://mail.google.com/mail/": { - "DEFAULT": "key_desktop_move_cases_001.wpr" + "DEFAULT": "key_desktop_move_cases_002.wpr" } }, "description": "Describes the Web Page Replay archives for a story set. Don't edit by hand! Use record_wpr for updating.",
diff --git a/tools/perf/page_sets/data/key_desktop_move_cases_002.wpr.sha1 b/tools/perf/page_sets/data/key_desktop_move_cases_002.wpr.sha1 new file mode 100644 index 0000000..21eb8d3 --- /dev/null +++ b/tools/perf/page_sets/data/key_desktop_move_cases_002.wpr.sha1
@@ -0,0 +1 @@ +2f03166ecdd325bacaf5ce2ab411d5f533d1b67a \ No newline at end of file
diff --git a/tools/perf/page_sets/data/top_25_006.wpr.sha1 b/tools/perf/page_sets/data/top_25_006.wpr.sha1 new file mode 100644 index 0000000..90abc0e --- /dev/null +++ b/tools/perf/page_sets/data/top_25_006.wpr.sha1
@@ -0,0 +1 @@ +40e33f5bf75bff827bd5a791f82e5d1e99170d18 \ No newline at end of file
diff --git a/tools/perf/page_sets/data/top_25_smooth.json b/tools/perf/page_sets/data/top_25_smooth.json index 98cb969..554e0240 100644 --- a/tools/perf/page_sets/data/top_25_smooth.json +++ b/tools/perf/page_sets/data/top_25_smooth.json
@@ -67,7 +67,7 @@ "DEFAULT": "top_25_000.wpr" }, "https://mail.google.com/mail/": { - "DEFAULT": "top_25_005.wpr" + "DEFAULT": "top_25_006.wpr" }, "https://plus.google.com/110031535020051778989/posts": { "DEFAULT": "top_25_001.wpr"
diff --git a/tools/perf/page_sets/key_desktop_move_cases.py b/tools/perf/page_sets/key_desktop_move_cases.py index 180cdc9..95643a5 100644 --- a/tools/perf/page_sets/key_desktop_move_cases.py +++ b/tools/perf/page_sets/key_desktop_move_cases.py
@@ -5,6 +5,8 @@ from telemetry.page import shared_page_state from telemetry import story +from page_sets.login_helpers import google_login + class KeyDesktopMoveCasesPage(page_module.Page): @@ -34,9 +36,10 @@ callback(api.getScrollableElement()); }); }''' - self.credentials = 'google' def RunNavigateSteps(self, action_runner): + google_login.LoginGoogleAccount(action_runner, 'googletest', + self.credentials_path) super(GmailMouseScrollPage, self).RunNavigateSteps(action_runner) action_runner.WaitForJavaScriptCondition( 'window.gmonkey !== undefined &&'
diff --git a/tools/perf/page_sets/login_helpers/google_login.py b/tools/perf/page_sets/login_helpers/google_login.py index a1108e4..e1e5077 100644 --- a/tools/perf/page_sets/login_helpers/google_login.py +++ b/tools/perf/page_sets/login_helpers/google_login.py
@@ -3,13 +3,28 @@ # found in the LICENSE file. from page_sets.login_helpers import login_utils +# Selectors for the email, password, and next buttons for google login flow. +# Use multiple selectors to allow for different versions of the site. +_EMAIL_SELECTOR = ','.join([ + 'input[type=email]:not([aria-hidden=true])', + '#Email:not(.hidden)']) +_EMAIL_NEXT_SELECTOR = ','.join([ + '#identifierNext', + '#gaia_firstform #next']) +_PASSWORD_SELECTOR = ','.join([ + 'input[type=password]:not([aria-hidden=true])', + '#Passwd:not(.hidden)']) +_SIGNIN_SELECTOR = ','.join([ + '#passwordNext', + '#signIn']) + # JavaScript conditions which are true when the email and password inputs on # the Google Login page are visible respectively. _EMAIL_INPUT_VISIBLE_CONDITION = ( - 'document.querySelector("#Email:not(.hidden)") !== null') + 'document.querySelector("%s") !== null' % (_EMAIL_SELECTOR)) _PASSWORD_INPUT_VISIBLE_CONDITION = ( - 'document.querySelector("#Passwd:not(.hidden)") !== null') + 'document.querySelector("%s") !== null' % (_PASSWORD_SELECTOR)) def LoginGoogleAccount(action_runner, @@ -50,10 +65,9 @@ # browser session, so we must enter both email and password. Otherwise, only # password is required. if action_runner.EvaluateJavaScript(_EMAIL_INPUT_VISIBLE_CONDITION): - login_utils.InputForm(action_runner, account_name, input_id='Email', - form_id='gaia_firstform') - action_runner.ClickElement(selector='#gaia_firstform #next') + login_utils.InputWithSelector(action_runner, account_name, _EMAIL_SELECTOR) + action_runner.ClickElement(selector=_EMAIL_NEXT_SELECTOR) - login_utils.InputForm(action_runner, password, input_id='Passwd') - action_runner.ClickElement(selector='#signIn') + login_utils.InputWithSelector(action_runner, password, _PASSWORD_SELECTOR) + action_runner.ClickElement(selector=_SIGNIN_SELECTOR) action_runner.WaitForElement(text='My Account')
diff --git a/tools/perf/page_sets/story_set_unittest.py b/tools/perf/page_sets/story_set_unittest.py index 0a3e0f9..2854204 100644 --- a/tools/perf/page_sets/story_set_unittest.py +++ b/tools/perf/page_sets/story_set_unittest.py
@@ -4,10 +4,7 @@ import os -import page_sets - from telemetry import decorators -from telemetry import page from telemetry.testing import story_set_smoke_test @@ -22,23 +19,6 @@ def testSmoke(self): self.RunSmokeTest(self.story_sets_dir, self.top_level_dir) - # TODO(nednguyen): Remove this test once crbug.com/508538 is fixed. - # TODO(tbarzic): crbug.com/386416. - @decorators.Disabled('chromeos') - def testNoPageDefinedSyntheticDelay(self): - for story_set_class in self.GetAllStorySetClasses(self.story_sets_dir, - self.top_level_dir): - if story_set_class is page_sets.ToughSchedulingCasesPageSet: - continue - story_set = story_set_class() - for story in story_set: - if isinstance(story, page.Page): - self.assertFalse( - story.synthetic_delays, - 'Page %s in page set %s has non empty synthetic delay. ' - 'Synthetic delay is no longer supported. See crbug.com/508538.' % - (story.name, story_set.Name())) - def testNoStorySetDefinedWithUnnamedStories(self): for story_set_class in self.GetAllStorySetClasses(self.story_sets_dir, self.top_level_dir):
diff --git a/tools/perf/page_sets/system_health/expectations.py b/tools/perf/page_sets/system_health/expectations.py index cf751d5..66a82ee 100644 --- a/tools/perf/page_sets/system_health/expectations.py +++ b/tools/perf/page_sets/system_health/expectations.py
@@ -88,6 +88,10 @@ [expectations.ALL], 'crbug.com/728152') self.DisableStory('browse:media:flickr_infinite_scroll', [expectations.ALL], 'crbug.com/728785') + self.DisableStory( + 'load:tools:drive', + [expectations.ANDROID_NEXUS5X, expectations.ANDROID_WEBVIEW], + 'crbug.com/738854') # TODO(rnephew): This disabling should move to CanRunOnBrowser. self.DisableStory('browse:chrome:omnibox', [expectations.ANDROID_WEBVIEW], @@ -124,6 +128,10 @@ [expectations.ALL], 'crbug.com/728152') self.DisableStory('browse:media:flickr_infinite_scroll', [expectations.ALL], 'crbug.com/728785') + self.DisableStory( + 'load:tools:drive', + [expectations.ANDROID_NEXUS5X, expectations.ANDROID_WEBVIEW], + 'crbug.com/738854') # TODO(rnephew): This disabling should move to CanRunOnBrowser. self.DisableStory('browse:chrome:omnibox', [expectations.ANDROID_WEBVIEW],
diff --git a/tools/perf/page_sets/top_25_smooth.py b/tools/perf/page_sets/top_25_smooth.py index bb20391..42296c5 100644 --- a/tools/perf/page_sets/top_25_smooth.py +++ b/tools/perf/page_sets/top_25_smooth.py
@@ -5,7 +5,6 @@ from telemetry.page import shared_page_state from telemetry import story -from page_sets.login_helpers import google_login from page_sets import top_pages @@ -39,31 +38,16 @@ _IssueMarkerAndScroll(action_runner) -class GmailSmoothPage(top_pages.TopPages): +class GmailSmoothPage(top_pages.GmailPage): """ Why: productivity, top google properties """ def __init__(self, page_set, shared_page_state_class=shared_page_state.SharedPageState): - # TODO(flackr): This is duplicating page logic from top_pages.py but is - # the only way to update https://mail.google.com/mail/ for this test without - # updating the 14 other recordings, as the gmail login flow has changed. - # https://crbug.com/590766 tracks updating google_login.py to support - # legacy and new login flow. super(GmailSmoothPage, self).__init__( - url='https://mail.google.com/mail/', page_set=page_set, shared_page_state_class=shared_page_state_class) - def RunNavigateSteps(self, action_runner): - google_login.LoginGoogleAccount(action_runner, 'google3', - self.credentials_path) - super(GmailSmoothPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( - 'window.gmonkey !== undefined &&' - 'document.getElementById("gb") !== null', - timeout=120) - def RunPageInteractions(self, action_runner): action_runner.ExecuteJavaScript(''' gmonkey.load('2.0', function(api) {
diff --git a/tools/perf/page_sets/top_pages.py b/tools/perf/page_sets/top_pages.py index d27d519..58644172 100644 --- a/tools/perf/page_sets/top_pages.py +++ b/tools/perf/page_sets/top_pages.py
@@ -4,6 +4,8 @@ from telemetry.page import page as page_module from telemetry.page import shared_page_state +from page_sets.login_helpers import google_login + class TopPages(page_module.Page): @@ -56,10 +58,11 @@ super(GmailPage, self).__init__( url='https://mail.google.com/mail/', page_set=page_set, - credentials='google', shared_page_state_class=shared_page_state_class) def RunNavigateSteps(self, action_runner): + google_login.LoginGoogleAccount(action_runner, 'googletest', + self.credentials_path) super(GmailPage, self).RunNavigateSteps(action_runner) action_runner.WaitForJavaScriptCondition( 'window.gmonkey !== undefined &&'
diff --git a/tools/perf/page_sets/tough_scheduling_cases.py b/tools/perf/page_sets/tough_scheduling_cases.py index a86b516..c8a1c345 100644 --- a/tools/perf/page_sets/tough_scheduling_cases.py +++ b/tools/perf/page_sets/tough_scheduling_cases.py
@@ -20,291 +20,12 @@ action_runner.ScrollPage() -class Page1(ToughSchedulingCasesPage): - - """Why: Simulate oversubscribed main thread.""" - - def __init__(self, page_set): - super(Page1, self).__init__( - url='file://tough_scheduling_cases/simple_text_page.html?main_busy', - page_set=page_set) - - self.synthetic_delays = {'cc.BeginMainFrame': {'target_duration': 0.008}} - - -class Page2(ToughSchedulingCasesPage): - - """Why: Simulate oversubscribed main thread.""" - - def __init__(self, page_set): - super(Page2, self).__init__( - # pylint: disable=line-too-long - url='file://tough_scheduling_cases/simple_text_page.html?main_very_busy', - page_set=page_set) - - self.synthetic_delays = {'cc.BeginMainFrame': {'target_duration': 0.024}} - - -class Page3(ToughSchedulingCasesPage): - - """Why: Simulate a page with a a few graphics layers.""" - - def __init__(self, page_set): - super(Page3, self).__init__( - # pylint: disable=line-too-long - url='file://tough_scheduling_cases/simple_text_page.html?medium_layers', - page_set=page_set) - - self.synthetic_delays = { - 'cc.DrawAndSwap': {'target_duration': 0.004}, - 'gpu.PresentingFrame': {'target_duration': 0.004}, - 'cc.BeginMainFrame': {'target_duration': 0.004} - } - - -class Page4(ToughSchedulingCasesPage): - - """Why: Simulate a page with many graphics layers.""" - - def __init__(self, page_set): - super(Page4, self).__init__( - # pylint: disable=line-too-long - url='file://tough_scheduling_cases/simple_text_page.html?many_layers', - page_set=page_set) - - self.synthetic_delays = { - 'cc.DrawAndSwap': {'target_duration': 0.012}, - 'gpu.PresentingFrame': {'target_duration': 0.012}, - 'cc.BeginMainFrame': {'target_duration': 0.012} - } - - -class Page5(ToughSchedulingCasesPage): - - """Why: Simulate a page with expensive recording and rasterization.""" - - def __init__(self, page_set): - super(Page5, self).__init__( - # pylint: disable=line-too-long - url='file://tough_scheduling_cases/simple_text_page.html?medium_raster', - page_set=page_set) - - self.synthetic_delays = { - 'cc.RasterRequiredForActivation': {'target_duration': 0.004}, - 'cc.BeginMainFrame': {'target_duration': 0.004}, - 'gpu.AsyncTexImage': {'target_duration': 0.004} - } - - -class Page6(ToughSchedulingCasesPage): - - """Why: Simulate a page with expensive recording and rasterization.""" - - def __init__(self, page_set): - super(Page6, self).__init__( - # pylint: disable=line-too-long - url='file://tough_scheduling_cases/simple_text_page.html?heavy_raster', - page_set=page_set) - - self.synthetic_delays = { - 'cc.RasterRequiredForActivation': {'target_duration': 0.024}, - 'cc.BeginMainFrame': {'target_duration': 0.024}, - 'gpu.AsyncTexImage': {'target_duration': 0.024} - } - - -class Page7(ToughSchedulingCasesPage): - - """Why: Medium cost touch handler.""" - - def __init__(self, page_set): - super(Page7, self).__init__( - # pylint: disable=line-too-long - url='file://tough_scheduling_cases/touch_handler_scrolling.html?medium_handler', - page_set=page_set) - - self.synthetic_delays = {'blink.HandleInputEvent': - {'target_duration': 0.008}} - - -class Page8(ToughSchedulingCasesPage): - - """Why: Slow touch handler.""" - - def __init__(self, page_set): - super(Page8, self).__init__( - # pylint: disable=line-too-long - url='file://tough_scheduling_cases/touch_handler_scrolling.html?slow_handler', - page_set=page_set) - - self.synthetic_delays = {'blink.HandleInputEvent': - {'target_duration': 0.024}} - - -class Page9(ToughSchedulingCasesPage): - - """Why: Touch handler that often takes a long time.""" - - def __init__(self, page_set): - super(Page9, self).__init__( - # pylint: disable=line-too-long - url='file://tough_scheduling_cases/touch_handler_scrolling.html?janky_handler', - page_set=page_set) - - self.synthetic_delays = {'blink.HandleInputEvent': - {'target_duration': 0.024, 'mode': 'alternating'} - } - - -class Page10(ToughSchedulingCasesPage): - - """Why: Touch handler that occasionally takes a long time.""" - - def __init__(self, page_set): - super(Page10, self).__init__( - # pylint: disable=line-too-long - url='file://tough_scheduling_cases/touch_handler_scrolling.html?occasionally_janky_handler', - page_set=page_set) - - self.synthetic_delays = {'blink.HandleInputEvent': - {'target_duration': 0.024, 'mode': 'oneshot'}} - - -class Page11(ToughSchedulingCasesPage): - - """Why: Super expensive touch handler causes browser to scroll after a - timeout.""" - - def __init__(self, page_set): - super(Page11, self).__init__( - # pylint: disable=line-too-long - url='file://tough_scheduling_cases/touch_handler_scrolling.html?super_slow_handler', - page_set=page_set) - - self.synthetic_delays = {'blink.HandleInputEvent': - {'target_duration': 0.2}} - - -class Page12(ToughSchedulingCasesPage): - - """Why: Super expensive touch handler that only occupies a part of the page. - """ - - def __init__(self, page_set): - super(Page12, self).__init__( - url='file://tough_scheduling_cases/div_touch_handler.html', - page_set=page_set) - - self.synthetic_delays = {'blink.HandleInputEvent': {'target_duration': 0.2}} - - -class Page13(ToughSchedulingCasesPage): - - """Why: Test a moderately heavy requestAnimationFrame handler.""" - - def __init__(self, page_set): - super(Page13, self).__init__( - url='file://tough_scheduling_cases/raf.html?medium_handler', - page_set=page_set) - - self.synthetic_delays = { - 'cc.RasterRequiredForActivation': {'target_duration': 0.004}, - 'cc.BeginMainFrame': {'target_duration': 0.004}, - 'gpu.AsyncTexImage': {'target_duration': 0.004} - } - - -class Page14(ToughSchedulingCasesPage): - - """Why: Test a moderately heavy requestAnimationFrame handler.""" - - def __init__(self, page_set): - super(Page14, self).__init__( - url='file://tough_scheduling_cases/raf.html?heavy_handler', - page_set=page_set) - - self.synthetic_delays = { - 'cc.RasterRequiredForActivation': {'target_duration': 0.024}, - 'cc.BeginMainFrame': {'target_duration': 0.024}, - 'gpu.AsyncTexImage': {'target_duration': 0.024} - } - - -class Page15(ToughSchedulingCasesPage): - - """Why: Simulate a heavily GPU bound page.""" - - def __init__(self, page_set): - super(Page15, self).__init__( - url='file://tough_scheduling_cases/raf.html?gpu_bound', - page_set=page_set) - - self.synthetic_delays = {'gpu.PresentingFrame': {'target_duration': 0.1}} - - -class Page16(ToughSchedulingCasesPage): - - """Why: Test a requestAnimationFrame handler with a heavy first frame.""" - - def __init__(self, page_set): - super(Page16, self).__init__( - url='file://tough_scheduling_cases/raf.html?heavy_first_frame', - page_set=page_set) - - self.synthetic_delays = {'cc.BeginMainFrame': {'target_duration': 0.15, - 'mode': 'oneshot'}} - - -class Page17(ToughSchedulingCasesPage): - - """Why: Medium stress test for the scheduler.""" - - def __init__(self, page_set): - super(Page17, self).__init__( - url='file://tough_scheduling_cases/raf_touch_animation.html?medium', - page_set=page_set) - - self.synthetic_delays = { - 'cc.DrawAndSwap': {'target_duration': 0.004}, - 'cc.BeginMainFrame': {'target_duration': 0.004} - } - - -class Page18(ToughSchedulingCasesPage): - - """Why: Heavy stress test for the scheduler.""" - - def __init__(self, page_set): - super(Page18, self).__init__( - url='file://tough_scheduling_cases/raf_touch_animation.html?heavy', - page_set=page_set) - - self.synthetic_delays = { - 'cc.DrawAndSwap': {'target_duration': 0.012}, - 'cc.BeginMainFrame': {'target_duration': 0.012} - } - - -class Page19(ToughSchedulingCasesPage): - - """Why: Both main and impl thread animating concurrently.""" - - def __init__(self, page_set): - super(Page19, self).__init__( - url='file://tough_scheduling_cases/split_animation.html', - page_set=page_set) - - def RunPageInteractions(self, action_runner): - with action_runner.CreateInteraction('SplitAnimation'): - action_runner.Wait(3) - - -class Page20(ToughSchedulingCasesPage): +class TouchDraggingPage(ToughSchedulingCasesPage): """Why: Simple JS touch dragging.""" def __init__(self, page_set): - super(Page20, self).__init__( + super(TouchDraggingPage, self).__init__( url='file://tough_scheduling_cases/simple_touch_drag.html', page_set=page_set) @@ -318,36 +39,6 @@ distance=400) -class EmptyTouchHandlerPage(ToughSchedulingCasesPage): - - """Why: Scrolling on a page with a touch handler that consumes no events but - may be slow.""" - - def __init__(self, name, desktop, slow_handler, bounce, page_set): - super(EmptyTouchHandlerPage, self).__init__( - url='file://tough_scheduling_cases/empty_touch_handler' + - ('_desktop' if desktop else '') + '.html?' + name, - page_set=page_set) - - if slow_handler: - self.synthetic_delays = { - 'blink.HandleInputEvent': {'target_duration': 0.2} - } - - self.bounce = bounce - - def RunPageInteractions(self, action_runner): - if self.bounce: - with action_runner.CreateGestureInteraction('ScrollBounceAction'): - action_runner.ScrollBouncePage() - else: - with action_runner.CreateGestureInteraction('ScrollAction'): - # Speed and distance are tuned to run exactly as long as a scroll - # bounce. - action_runner.ScrollPage(use_touch=True, speed_in_pixels_per_second=400, - distance=2100) - - class SynchronizedScrollOffsetPage(ToughSchedulingCasesPage): """Why: For measuring the latency of scroll-synchronized effects.""" @@ -403,22 +94,10 @@ self.AddStory(ToughSchedulingCasesPage( 'file://tough_scheduling_cases/simple_text_page.html', self)) - self.AddStory(Page1(self)) - self.AddStory(Page2(self)) - self.AddStory(Page3(self)) - self.AddStory(Page4(self)) - self.AddStory(Page5(self)) - self.AddStory(Page6(self)) # Why: Touch handler scrolling baseline self.AddStory(ToughSchedulingCasesPage( 'file://tough_scheduling_cases/touch_handler_scrolling.html', self)) - self.AddStory(Page7(self)) - self.AddStory(Page8(self)) - self.AddStory(Page9(self)) - self.AddStory(Page10(self)) - self.AddStory(Page11(self)) - self.AddStory(Page12(self)) # Why: requestAnimationFrame scrolling baseline self.AddStory(ToughSchedulingCasesPage( 'file://tough_scheduling_cases/raf.html', @@ -427,10 +106,6 @@ self.AddStory(ToughSchedulingCasesPage( 'file://tough_scheduling_cases/raf_canvas.html', self)) - self.AddStory(Page13(self)) - self.AddStory(Page14(self)) - self.AddStory(Page15(self)) - self.AddStory(Page16(self)) # Why: Test a requestAnimationFrame handler with concurrent CSS animation self.AddStory(ToughSchedulingCasesPage( 'file://tough_scheduling_cases/raf_animation.html', @@ -439,55 +114,7 @@ self.AddStory(ToughSchedulingCasesPage( 'file://tough_scheduling_cases/raf_touch_animation.html', self)) - self.AddStory(Page17(self)) - self.AddStory(Page18(self)) - self.AddStory(Page19(self)) - self.AddStory(Page20(self)) - # Why: Baseline for scrolling in the presence of a no-op touch handler - self.AddStory(EmptyTouchHandlerPage( - name='baseline', - desktop=False, - slow_handler=False, - bounce=False, - page_set=self)) - # Why: Slow handler blocks scroll start - self.AddStory(EmptyTouchHandlerPage( - name='slow_handler', - desktop=False, - slow_handler=True, - bounce=False, - page_set=self)) - # Why: Slow handler blocks scroll start until touch ACK timeout - self.AddStory(EmptyTouchHandlerPage( - name='desktop_slow_handler', - desktop=True, - slow_handler=True, - bounce=False, - page_set=self)) - # Why: Scroll bounce showing repeated transitions between scrolling and - # sending synchronous touchmove events. Should be nearly as fast as - # scroll baseline. - self.AddStory(EmptyTouchHandlerPage( - name='bounce', - desktop=False, - slow_handler=False, - bounce=True, - page_set=self)) - # Why: Scroll bounce with slow handler, repeated blocking. - self.AddStory(EmptyTouchHandlerPage( - name='bounce_slow_handler', - desktop=False, - slow_handler=True, - bounce=True, - page_set=self)) - # Why: Scroll bounce with slow handler on desktop, blocks only once until - # ACK timeout. - self.AddStory(EmptyTouchHandlerPage( - name='bounce_desktop_slow_handler', - desktop=True, - slow_handler=True, - bounce=True, - page_set=self)) + self.AddStory(TouchDraggingPage(self)) # Why: For measuring the latency of scroll-synchronized effects. self.AddStory(SynchronizedScrollOffsetPage(page_set=self)) # Why: Test loading a large amount of Javascript.
diff --git a/tools/perf/page_sets/tough_scheduling_cases/div_touch_handler.html b/tools/perf/page_sets/tough_scheduling_cases/div_touch_handler.html deleted file mode 100644 index c85d853..0000000 --- a/tools/perf/page_sets/tough_scheduling_cases/div_touch_handler.html +++ /dev/null
@@ -1,282 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta name="viewport" content="width=device-width"> - <title>Div touch handler</title> - <style type="text/css"> - body { - height: 10000px; - margin: 0px; - background-color: #ff2; - background-image: linear-gradient(rgba(0, 0, 0, .1) 50%, transparent 50%, transparent); - background-size: 100px 100px; - } - #handler { - position: absolute; - width: 100px; - height: 10000px; - background: red; - } - </style> - <script type="text/javascript"> - function eatEvent(e) { - e.preventDefault(); - } - - function startExperiment() { - var div = document.getElementById('handler'); - div.addEventListener('touchstart', eatEvent); - div.addEventListener('touchmove', eatEvent); - div.addEventListener('touchend', eatEvent); - div.addEventListener('touchleave', eatEvent); - div.addEventListener('touchcancel', eatEvent); - } - - window.addEventListener('load', startExperiment); - </script> -</head> -<body> - <h2>Div touch handler</h2> - <div id="handler">om nom I eat touches</div> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> -</body> -</html>
diff --git a/tools/perf/page_sets/tough_scheduling_cases/empty_touch_handler.html b/tools/perf/page_sets/tough_scheduling_cases/empty_touch_handler.html deleted file mode 100644 index ec45cb0..0000000 --- a/tools/perf/page_sets/tough_scheduling_cases/empty_touch_handler.html +++ /dev/null
@@ -1,274 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta name="viewport" content="width=device-width"> - <title>Empty touch handler</title> - <style type="text/css"> - body { - height: 10000px; - margin: 0px; - background-image: linear-gradient(rgba(0, 0, 0, .1) 50%, transparent 50%, transparent); - background-size: 100px 100px; - } - </style> - <script type="text/javascript"> - function empty(e) { - } - - function startExperiment() { - window.addEventListener('touchstart', empty); - window.addEventListener('touchmove', empty); - window.addEventListener('touchend', empty); - window.addEventListener('touchcancel', empty); - window.addEventListener('wheel', empty); - } - - window.addEventListener('load', startExperiment); - </script> -</head> -<body> - <h2>Touch handler scrolling</h2> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> -</body> -</html> - -
diff --git a/tools/perf/page_sets/tough_scheduling_cases/empty_touch_handler_desktop.html b/tools/perf/page_sets/tough_scheduling_cases/empty_touch_handler_desktop.html deleted file mode 100644 index 9176cab7..0000000 --- a/tools/perf/page_sets/tough_scheduling_cases/empty_touch_handler_desktop.html +++ /dev/null
@@ -1,273 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <title>Empty touch handler</title> - <style type="text/css"> - body { - height: 10000px; - margin: 0px; - background-image: linear-gradient(rgba(0, 0, 0, .1) 50%, transparent 50%, transparent); - background-size: 100px 100px; - } - </style> - <script type="text/javascript"> - function empty(e) { - } - - function startExperiment() { - window.addEventListener('touchstart', empty); - window.addEventListener('touchmove', empty); - window.addEventListener('touchend', empty); - window.addEventListener('touchcancel', empty); - window.addEventListener('wheel', empty); - } - - window.addEventListener('load', startExperiment); - </script> -</head> -<body> - <h2>Touch handler scrolling</h2> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> - <p>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps.</p> - <p>Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz.</p> - <p>Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p> - <p>Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.</p> - <p>Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.</p> - <p>A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox.</p> - <p>The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck.</p> - <p>A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz.</p> - <p>Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show.</p> - <p>Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz.</p> - <p>Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl.</p> - <p>Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels.</p> - <p>Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats.</p> - <p>All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog.</p> - <p>DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex!</p> - <p>Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim.</p> - <p>Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz.</p> - <p>Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq.</p> - <p>Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV</p> -</body> -</html> - -
diff --git a/tools/perf/page_sets/tough_scheduling_cases/split_animation.html b/tools/perf/page_sets/tough_scheduling_cases/split_animation.html deleted file mode 100644 index 7d73b589..0000000 --- a/tools/perf/page_sets/tough_scheduling_cases/split_animation.html +++ /dev/null
@@ -1,83 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta charset="utf-8"> - <meta name="viewport" content="width=device-width"> - - <title>Main and impl thread CSS animation</title> - - <style> - #outer { - width: 200px; - height: 200px; - background: orange; - overflow: hidden; - -webkit-animation: anim-size 2s alternate infinite; - - font-size: 8px; - } - #inner { - width: 100px; - height: 100px; - background: teal; - -webkit-animation: anim-xform 2s alternate infinite; - - position: absolute; - } - - @-webkit-keyframes anim-size - { - from {-webkit-transform: translate3d(50px, 50px, 0px);} - to {height: 300px; width: 300px; -webkit-transform: translate3d(0px, 0px, 0px);} - } - - @-webkit-keyframes anim-xform - { - from {-webkit-transform: translate3d(50px, 50px, 0px);} - to {-webkit-transform: translate3d(100px, 100px, 0px);} - } -</style> -</head> -<body> - -<h1>Main and impl thread CSS animation</h1> - -<div id="outer"> - <div id="inner"> - This box shouldn't move. - </div> -The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. - -Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz. - -Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim. - -Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. - -Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled. - -Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk. - -A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. - -The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck. - -A wizard's job is to vex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz. - -Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show. - -Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz. - -Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl. - -Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels. - -Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats. - -All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog. - - -</div> - -</body> -</html>
diff --git a/tools/perf/page_sets/webrtc_cases.py b/tools/perf/page_sets/webrtc_cases.py index 582dc53..456e572 100644 --- a/tools/perf/page_sets/webrtc_cases.py +++ b/tools/perf/page_sets/webrtc_cases.py
@@ -51,20 +51,18 @@ class DataChannel(WebrtcPage): - """Why: Transfer as much data as possible through a data channel in 20s.""" + """Why: Transfer as much data as possible through a data channel in 10s.""" def __init__(self, page_set, tags): super(DataChannel, self).__init__( url='file://webrtc_cases/datatransfer.html', - name='30s_datachannel_transfer', + name='10s_datachannel_transfer', page_set=page_set, tags=tags) def RunPageInteractions(self, action_runner): - # It won't have time to finish the 512 MB, but we're only interested in - # cpu + memory anyway rather than how much data we manage to transfer. - action_runner.ExecuteJavaScript('megsToSend.value = 512;') + action_runner.ExecuteJavaScript('megsToSend.value = 100;') action_runner.ClickElement('button[id="sendTheData"]') - action_runner.Wait(30) + action_runner.Wait(10) class AudioCall(WebrtcPage): @@ -152,7 +150,3 @@ self.DisableStory('audio_call_isac/1600_10s', [story.expectations.ALL], 'crbug.com/468732') - - self.DisableStory('30s_datachannel_transfer', - [story.expectations.ALL_DESKTOP], - 'crbug.com/726811')
diff --git a/tools/resources/generate_resource_whitelist.gni b/tools/resources/generate_resource_whitelist.gni index 6740325..33bc4b87a 100644 --- a/tools/resources/generate_resource_whitelist.gni +++ b/tools/resources/generate_resource_whitelist.gni
@@ -37,11 +37,11 @@ ] args = [ - "-i", + "--input", rebase_path(invoker.input, root_build_dir), - "-o", + "--output", rebase_path(invoker.output, root_build_dir), - "--out-dir=.", + "--output-directory=.", ] } }
diff --git a/tools/resources/generate_resource_whitelist.py b/tools/resources/generate_resource_whitelist.py index 1a7d782..7f922cde 100755 --- a/tools/resources/generate_resource_whitelist.py +++ b/tools/resources/generate_resource_whitelist.py
@@ -3,12 +3,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import argparse -import os -import re -import sys - -USAGE = """generate_resource_whitelist.py [-h] [-i INPUT] [-o OUTPUT] +__doc__ = """generate_resource_whitelist.py [-h] [--input INPUT] +[--output OUTPUT] INPUT specifies a file containing existing resource IDs that should be whitelisted, where each line of INPUT contains a single resource ID. @@ -27,9 +23,14 @@ [-Wunknown-pragmas] On Windows, the message is simply a message via __pragma(message(...)). - """ +import argparse +import os +import re +import sys + + COMPONENTS_STRINGS_HEADER = 'gen/components/strings/grit/components_strings.h' # We don't want the resources are different between 32-bit and 64-bit build, @@ -56,22 +57,22 @@ def main(): - parser = argparse.ArgumentParser(usage=USAGE) + parser = argparse.ArgumentParser(usage=__doc__) parser.add_argument( - '-i', '--input', type=argparse.FileType('r'), default=sys.stdin, + '--input', type=argparse.FileType('r'), default=sys.stdin, help='A resource whitelist where each line contains one resource ID') parser.add_argument( - '-o', '--output', type=argparse.FileType('w'), default=sys.stdout, + '--output', type=argparse.FileType('w'), default=sys.stdout, help='The resource list path to write (default stdout)') parser.add_argument( - '--out-dir', required=True, - help='The out target directory, for example out/Release') + '--output-directory', required=True, + help='The output target directory, for example out/Release') args = parser.parse_args() used_resources = set(int(resource_id) for resource_id in args.input) used_resources |= _FindResourceIds( - os.path.join(args.out_dir, COMPONENTS_STRINGS_HEADER), + os.path.join(args.output_directory, COMPONENTS_STRINGS_HEADER), ARCH_SPECIFIC_RESOURCES) for resource_id in sorted(used_resources):
diff --git a/tools/traffic_annotation/auditor/traffic_annotation_auditor.cc b/tools/traffic_annotation/auditor/traffic_annotation_auditor.cc index fb9c3b6..40c2ab2a 100644 --- a/tools/traffic_annotation/auditor/traffic_annotation_auditor.cc +++ b/tools/traffic_annotation/auditor/traffic_annotation_auditor.cc
@@ -14,6 +14,7 @@ #include "base/strings/utf_string_conversions.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" +#include "third_party/protobuf/src/google/protobuf/io/tokenizer.h" #include "third_party/protobuf/src/google/protobuf/text_format.h" #include "tools/traffic_annotation/auditor/traffic_annotation_file_filter.h" @@ -28,10 +29,97 @@ return (recursive_hash(str, N - 1) * 31 + str[N - 1]) % 138003713; } +// This class receives parsing errors from google::protobuf::TextFormat::Parser +// which is used during protobuf deserialization. +class SimpleErrorCollector : public google::protobuf::io::ErrorCollector { + public: + SimpleErrorCollector(int proto_starting_line) + : google::protobuf::io::ErrorCollector(), + line_offset_(proto_starting_line) {} + + ~SimpleErrorCollector() override {} + + void AddError(int line, + google::protobuf::io::ColumnNumber column, + const std::string& message) override { + AddMessage(line, column, message); + } + + void AddWarning(int line, + google::protobuf::io::ColumnNumber column, + const std::string& message) override { + AddMessage(line, column, message); + } + + std::string GetMessage() { return message_; } + + private: + void AddMessage(int line, + google::protobuf::io::ColumnNumber column, + const std::string& message) { + message_ += base::StringPrintf( + "%sLine %i, column %i, %s", message_.length() ? " " : "", + line_offset_ + line, static_cast<int>(column), message.c_str()); + } + + std::string message_; + int line_offset_; +}; + } // namespace namespace traffic_annotation_auditor { +const int AuditorResult::kNoCodeLineSpecified = -1; + +AuditorResult::AuditorResult(ResultType type, + const std::string& message, + const std::string& file_path, + int line) + : type_(type), message_(message), file_path_(file_path), line_(line) { + DCHECK(type == AuditorResult::ResultType::RESULT_OK || + type == AuditorResult::ResultType::RESULT_IGNORE || + type == AuditorResult::ResultType::ERROR_FATAL || + line != kNoCodeLineSpecified); +}; + +AuditorResult::AuditorResult(ResultType type, const std::string& message) + : AuditorResult::AuditorResult(type, + message, + std::string(), + kNoCodeLineSpecified) {} + +AuditorResult::AuditorResult(ResultType type) + : AuditorResult::AuditorResult(type, + std::string(), + std::string(), + kNoCodeLineSpecified) {} + +std::string AuditorResult::ToText() const { + switch (type_) { + case AuditorResult::ResultType::ERROR_FATAL: + return message_; + + case AuditorResult::ResultType::ERROR_MISSING: + return base::StringPrintf("Missing annotation in '%s', line %i.", + file_path_.c_str(), line_); + + case AuditorResult::ResultType::ERROR_NO_ANNOTATION: + return base::StringPrintf("Empty annotation in '%s', line %i.", + file_path_.c_str(), line_); + + case AuditorResult::ResultType::ERROR_SYNTAX: { + std::string flat_message(message_); + std::replace(flat_message.begin(), flat_message.end(), '\n', ' '); + return base::StringPrintf("Syntax error in '%s': %s", file_path_.c_str(), + flat_message.c_str()); + } + + default: + return std::string(); + } +} + AnnotationInstance::AnnotationInstance() : annotation_type(AnnotationType::ANNOTATION_COMPLETE) {} @@ -42,15 +130,13 @@ unique_id_hash_code(other.unique_id_hash_code), extra_id_hash_code(other.extra_id_hash_code){}; -bool AnnotationInstance::Deserialize( +AuditorResult AnnotationInstance::Deserialize( const std::vector<std::string>& serialized_lines, int start_line, - int end_line, - std::string* error_text) { + int end_line) { if (end_line - start_line < 7) { - LOG(ERROR) << "Not enough lines to deserialize annotation."; - *error_text = "FATAL"; - return false; + return AuditorResult(AuditorResult::ResultType::ERROR_FATAL, + "Not enough lines to deserialize annotation."); } // Extract header lines. @@ -72,9 +158,9 @@ } else if (function_type == "BranchedCompleting") { annotation_type = AnnotationType::ANNOTATION_BRANCHED_COMPLETING; } else { - LOG(ERROR) << "Unexpected function type: " << function_type; - *error_text = "FATAL"; - return false; + return AuditorResult(AuditorResult::ResultType::ERROR_FATAL, + base::StringPrintf("Unexpected function type: %s", + function_type.c_str())); } // Process test tags. @@ -82,41 +168,36 @@ if (unique_id_hash_code == TRAFFIC_ANNOTATION_FOR_TESTS.unique_id_hash_code || unique_id_hash_code == PARTIAL_TRAFFIC_ANNOTATION_FOR_TESTS.unique_id_hash_code) { - return false; + return AuditorResult(AuditorResult::ResultType::RESULT_IGNORE); } // Process undefined tags. if (unique_id_hash_code == NO_TRAFFIC_ANNOTATION_YET.unique_id_hash_code || unique_id_hash_code == NO_PARTIAL_TRAFFIC_ANNOTATION_YET.unique_id_hash_code) { - *error_text = base::StringPrintf( - "Annotation is defined with temporary tag for file '%s', line %i.", - file_path.c_str(), line_number); - return false; + return AuditorResult(AuditorResult::ResultType::ERROR_NO_ANNOTATION, "", + file_path, line_number); } // Process missing tag. - if (unique_id_hash_code == MISSING_TRAFFIC_ANNOTATION.unique_id_hash_code) { - *error_text = - base::StringPrintf("Missing annotation in file '%s', line %i.", - file_path.c_str(), line_number); - return false; - } + if (unique_id_hash_code == MISSING_TRAFFIC_ANNOTATION.unique_id_hash_code) + return AuditorResult(AuditorResult::ResultType::ERROR_MISSING, "", + file_path, line_number); // Decode serialized proto. std::string annotation_text = ""; while (start_line < end_line) { annotation_text += serialized_lines[start_line++] + "\n"; } - if (!google::protobuf::TextFormat::ParseFromString( - annotation_text, (google::protobuf::Message*)&proto)) { - // TODO(rhalavati@): Find exact error message using: - // google::protobuf::io::ErrorCollector error_collector; - // google::protobuf::TextFormat::Parser::RecordErrorsTo(&error_collector); - *error_text = - base::StringPrintf("Could not parse protobuf for file '%s', line %i.", - file_path.c_str(), line_number); - return false; + + SimpleErrorCollector error_collector(line_number); + google::protobuf::TextFormat::Parser parser; + parser.RecordErrorsTo(&error_collector); + if (!parser.ParseFromString(annotation_text, + (google::protobuf::Message*)&proto)) { + return AuditorResult(AuditorResult::ResultType::ERROR_SYNTAX, + error_collector.GetMessage().c_str(), file_path, + line_number); } // Add other fields. @@ -128,7 +209,7 @@ proto.set_unique_id(unique_id); extra_id_hash_code = ComputeHashValue(extra_id); - return true; + return AuditorResult(AuditorResult::ResultType::RESULT_OK); } CallInstance::CallInstance() : line_number(0), is_annotated(false) {} @@ -140,14 +221,13 @@ function_name(other.function_name), is_annotated(other.is_annotated){}; -bool CallInstance::Deserialize(const std::vector<std::string>& serialized_lines, - int start_line, - int end_line, - std::string* error_text) { +AuditorResult CallInstance::Deserialize( + const std::vector<std::string>& serialized_lines, + int start_line, + int end_line) { if (end_line - start_line != 5) { - LOG(ERROR) << "Incorrect number of lines to deserialize call."; - *error_text = "FATAL"; - return false; + return AuditorResult(AuditorResult::ResultType::ERROR_FATAL, + "Not enough lines to deserialize call."); } file_path = serialized_lines[start_line++]; @@ -159,7 +239,7 @@ int is_annotated_int; base::StringToInt(serialized_lines[start_line++], &is_annotated_int); is_annotated = is_annotated_int != 0; - return true; + return AuditorResult(AuditorResult::ResultType::RESULT_OK); } int ComputeHashValue(const std::string& unique_id) { @@ -247,7 +327,7 @@ bool ParseClangToolRawOutput(const std::string& clang_output, std::vector<AnnotationInstance>* annotations, std::vector<CallInstance>* calls, - std::vector<std::string>* errors) { + std::vector<AuditorResult>* errors) { // Remove possible carriage return characters before splitting lines. std::string trimmed_input; base::RemoveChars(clang_output, "\r", &trimmed_input); @@ -281,22 +361,31 @@ } // Deserialize and handle errors. - std::string error_text; - if (annotation_block) { - AnnotationInstance new_annotation; - if (new_annotation.Deserialize(lines, current, end_line, &error_text)) - annotations->push_back(new_annotation); - } else { - CallInstance new_call; - if (new_call.Deserialize(lines, current, end_line, &error_text)) - calls->push_back(new_call); - } - if (!error_text.empty()) { - if (error_text == "FATAL") { - LOG(ERROR) << "Aborting after line " << current << "."; + AnnotationInstance new_annotation; + CallInstance new_call; + AuditorResult result(AuditorResult::ResultType::RESULT_OK); + + result = annotation_block + ? new_annotation.Deserialize(lines, current, end_line) + : new_call.Deserialize(lines, current, end_line); + + switch (result.type()) { + case AuditorResult::ResultType::RESULT_OK: { + if (annotation_block) + annotations->push_back(new_annotation); + else + calls->push_back(new_call); + break; + } + case AuditorResult::ResultType::RESULT_IGNORE: + break; + case AuditorResult::ResultType::ERROR_FATAL: { + LOG(ERROR) << "Aborting after line " << current + << " because: " << result.ToText().c_str(); return false; } - errors->push_back(error_text); + default: + errors->push_back(result); } current = end_line;
diff --git a/tools/traffic_annotation/auditor/traffic_annotation_auditor.h b/tools/traffic_annotation/auditor/traffic_annotation_auditor.h index 2a1b9055..bb23738 100644 --- a/tools/traffic_annotation/auditor/traffic_annotation_auditor.h +++ b/tools/traffic_annotation/auditor/traffic_annotation_auditor.h
@@ -11,11 +11,46 @@ namespace traffic_annotation_auditor { +// Holds the auditor processing results on one unit of annotation or function. +class AuditorResult { + public: + enum class ResultType { + RESULT_OK, // No error + RESULT_IGNORE, // The item does not require furthure processing. + ERROR_FATAL, // A fatal error that should stop process. + ERROR_MISSING, // A function is called without annotation. + ERROR_NO_ANNOTATION, // A function is called with NO_ANNOTATION tag. + ERROR_SYNTAX // Annotation syntax is not right. + }; + + static const int kNoCodeLineSpecified; + + AuditorResult(ResultType type, + const std::string& message, + const std::string& file_path, + int line); + + AuditorResult(ResultType type, const std::string& message); + + AuditorResult(ResultType type); + + ResultType type() const { return type_; }; + + // Formats the error message into one line of text. + std::string ToText() const; + + private: + ResultType type_; + std::string message_; + std::string file_path_; + int line_; +}; + // Holds an instance of network traffic annotation. // TODO(rhalavati): Check if this class can also be reused in clang tool. class AnnotationInstance { public: - // Annotation Type + // Annotation Type. enum class AnnotationType { ANNOTATION_COMPLETE, ANNOTATION_PARTIAL, @@ -41,10 +76,9 @@ // not available, or missing), returns true, otherwise false. // If any error happens, |error_text| will be set. If it would be set to // FATAL, furthur processing of the text should be stopped. - bool Deserialize(const std::vector<std::string>& serialized_lines, - int start_line, - int end_line, - std::string* error_text); + AuditorResult Deserialize(const std::vector<std::string>& serialized_lines, + int start_line, + int end_line); // Protobuf of the annotation. traffic_annotation::NetworkTrafficAnnotation proto; @@ -79,10 +113,9 @@ // If the call instance is correctly read returns true, otherwise false. // If any error happens, |error_text| will be set. If it would be set to // FATAL, further processing of the text should be stopped. - bool Deserialize(const std::vector<std::string>& serialized_lines, - int start_line, - int end_line, - std::string* error_text); + AuditorResult Deserialize(const std::vector<std::string>& serialized_lines, + int start_line, + int end_line); std::string file_path; uint32_t line_number; @@ -109,7 +142,7 @@ bool ParseClangToolRawOutput(const std::string& clang_output, std::vector<AnnotationInstance>* annotations, std::vector<CallInstance>* calls, - std::vector<std::string>* errors); + std::vector<AuditorResult>* errors); // Computes the hash value of a traffic annotation unique id. int ComputeHashValue(const std::string& unique_id);
diff --git a/tools/traffic_annotation/auditor/traffic_annotation_auditor_ui.cc b/tools/traffic_annotation/auditor/traffic_annotation_auditor_ui.cc index d7f0bd5..f3299549 100644 --- a/tools/traffic_annotation/auditor/traffic_annotation_auditor_ui.cc +++ b/tools/traffic_annotation/auditor/traffic_annotation_auditor_ui.cc
@@ -106,7 +106,7 @@ std::vector<traffic_annotation_auditor::AnnotationInstance> annotation_instances; std::vector<traffic_annotation_auditor::CallInstance> call_instances; - std::vector<std::string> errors; + std::vector<traffic_annotation_auditor::AuditorResult> errors; if (!traffic_annotation_auditor::ParseClangToolRawOutput( raw_output, &annotation_instances, &call_instances, &errors)) { @@ -119,11 +119,14 @@ std::vector<std::string> items; report = "[Errors]\n"; - std::sort(errors.begin(), errors.end()); - for (const std::string& error : errors) - report += error + "\n"; + for (const auto& error : errors) + items.push_back(error.ToText()); + std::sort(items.begin(), items.end()); + for (const std::string& item : items) + report += item + "\n"; report += "\n[Annotations]\n"; + items.clear(); for (const auto& instance : annotation_instances) { std::string serialized; google::protobuf::TextFormat::PrintToString(instance.proto, &serialized); @@ -184,9 +187,15 @@ } } - LOG(INFO) << "Extracted " << annotation_instances.size() << " annotations & " - << call_instances.size() << " calls, with " << errors.size() - << " errors."; + // Dump Errors and Warnings to stdout. + // TODO(rhalavati@): The outputs are now limited to syntax errors. Will be + // expanded when repository is full compatible. + for (const auto& error : errors) { + if (error.type() == + traffic_annotation_auditor::AuditorResult::ResultType::ERROR_SYNTAX) { + printf("Error: %s\n", error.ToText().c_str()); + } + } return 0; }
diff --git a/ui/accessibility/platform/ax_platform_node_mac.h b/ui/accessibility/platform/ax_platform_node_mac.h index 26dbb0f..73657fb 100644 --- a/ui/accessibility/platform/ax_platform_node_mac.h +++ b/ui/accessibility/platform/ax_platform_node_mac.h
@@ -41,8 +41,14 @@ AX_EXPORT @interface AXPlatformNodeCocoa : NSObject +// Maps AX roles to native roles. Returns NSAccessibilityUnknownRole if not +// found. + (NSString*)nativeRoleFromAXRole:(ui::AXRole)role; + +// Maps AX roles to native subroles. Returns nil if not found. + (NSString*)nativeSubroleFromAXRole:(ui::AXRole)role; + +// Maps AX events to native notifications. Returns nil if not found. + (NSString*)nativeNotificationFromAXEvent:(ui::AXEvent)event; - (instancetype)initWithNode:(ui::AXPlatformNodeBase*)node;
diff --git a/ui/accessibility/platform/ax_platform_node_mac.mm b/ui/accessibility/platform/ax_platform_node_mac.mm index b02eecc..2b09d34d 100644 --- a/ui/accessibility/platform/ax_platform_node_mac.mm +++ b/ui/accessibility/platform/ax_platform_node_mac.mm
@@ -20,21 +20,12 @@ namespace { -struct RoleMapEntry { - ui::AXRole value; - NSString* nativeValue; -}; - -struct EventMapEntry { - ui::AXEvent value; - NSString* nativeValue; -}; - -typedef std::map<ui::AXRole, NSString*> RoleMap; -typedef std::map<ui::AXEvent, NSString*> EventMap; +using RoleMap = std::map<ui::AXRole, NSString*>; +using EventMap = std::map<ui::AXEvent, NSString*>; +using ActionList = std::vector<std::pair<ui::AXAction, NSString*>>; RoleMap BuildRoleMap() { - const RoleMapEntry roles[] = { + const RoleMap::value_type roles[] = { {ui::AX_ROLE_ABBR, NSAccessibilityGroupRole}, {ui::AX_ROLE_ALERT, NSAccessibilityGroupRole}, {ui::AX_ROLE_ALERT_DIALOG, NSAccessibilityGroupRole}, @@ -161,14 +152,11 @@ // { ui::AX_ROLE_SCROLL_AREA, NSAccessibilityScrollAreaRole }, }; - RoleMap role_map; - for (size_t i = 0; i < arraysize(roles); ++i) - role_map[roles[i].value] = roles[i].nativeValue; - return role_map; + return RoleMap(begin(roles), end(roles)); } RoleMap BuildSubroleMap() { - const RoleMapEntry subroles[] = { + const RoleMap::value_type subroles[] = { {ui::AX_ROLE_ALERT, @"AXApplicationAlert"}, {ui::AX_ROLE_ALERT_DIALOG, @"AXApplicationAlertDialog"}, {ui::AX_ROLE_APPLICATION, @"AXLandmarkApplication"}, @@ -202,14 +190,11 @@ {ui::AX_ROLE_TREE_ITEM, NSAccessibilityOutlineRowSubrole}, }; - RoleMap subrole_map; - for (size_t i = 0; i < arraysize(subroles); ++i) - subrole_map[subroles[i].value] = subroles[i].nativeValue; - return subrole_map; + return RoleMap(begin(subroles), end(subroles)); } EventMap BuildEventMap() { - const EventMapEntry events[] = { + const EventMap::value_type events[] = { {ui::AX_EVENT_FOCUS, NSAccessibilityFocusedUIElementChangedNotification}, {ui::AX_EVENT_TEXT_CHANGED, NSAccessibilityTitleChangedNotification}, {ui::AX_EVENT_VALUE_CHANGED, NSAccessibilityValueChangedNotification}, @@ -218,10 +203,24 @@ // TODO(patricialor): Add more events. }; - EventMap event_map; - for (size_t i = 0; i < arraysize(events); ++i) - event_map[events[i].value] = events[i].nativeValue; - return event_map; + return EventMap(begin(events), end(events)); +} + +ActionList BuildActionList() { + const ActionList::value_type entries[] = { + // NSAccessibilityPressAction must come first in this list. + {ui::AX_ACTION_DO_DEFAULT, NSAccessibilityPressAction}, + + {ui::AX_ACTION_DECREMENT, NSAccessibilityDecrementAction}, + {ui::AX_ACTION_INCREMENT, NSAccessibilityIncrementAction}, + {ui::AX_ACTION_SHOW_CONTEXT_MENU, NSAccessibilityShowMenuAction}, + }; + return ActionList(begin(entries), end(entries)); +} + +const ActionList& GetActionList() { + CR_DEFINE_STATIC_LOCAL(const ActionList, action_map, (BuildActionList())); + return action_map; } void NotifyMacEvent(AXPlatformNodeCocoa* target, ui::AXEvent event_type) { @@ -229,6 +228,20 @@ target, [AXPlatformNodeCocoa nativeNotificationFromAXEvent:event_type]); } +// Returns true if |action| should be added implicitly for |data|. +bool HasImplicitAction(const ui::AXNodeData& data, ui::AXAction action) { + return action == ui::AX_ACTION_DO_DEFAULT && ui::IsRoleClickable(data.role); +} + +// For roles that show a menu for the default action, ensure "show menu" also +// appears in available actions, but only if that's not already used for a +// context menu. It will be mapped back to the default action when performed. +bool AlsoUseShowMenuActionForDefaultAction(const ui::AXNodeData& data) { + return HasImplicitAction(data, ui::AX_ACTION_DO_DEFAULT) && + !data.HasAction(ui::AX_ACTION_SHOW_CONTEXT_MENU) && + data.role == ui::AX_ROLE_POP_UP_BUTTON; +} + } // namespace @interface AXPlatformNodeCocoa () @@ -244,24 +257,21 @@ @synthesize node = node_; -// A mapping of AX roles to native roles. + (NSString*)nativeRoleFromAXRole:(ui::AXRole)role { - CR_DEFINE_STATIC_LOCAL(RoleMap, role_map, (BuildRoleMap())); - RoleMap::iterator it = role_map.find(role); + CR_DEFINE_STATIC_LOCAL(const RoleMap, role_map, (BuildRoleMap())); + RoleMap::const_iterator it = role_map.find(role); return it != role_map.end() ? it->second : NSAccessibilityUnknownRole; } -// A mapping of AX roles to native subroles. + (NSString*)nativeSubroleFromAXRole:(ui::AXRole)role { - CR_DEFINE_STATIC_LOCAL(RoleMap, subrole_map, (BuildSubroleMap())); - RoleMap::iterator it = subrole_map.find(role); + CR_DEFINE_STATIC_LOCAL(const RoleMap, subrole_map, (BuildSubroleMap())); + RoleMap::const_iterator it = subrole_map.find(role); return it != subrole_map.end() ? it->second : nil; } -// A mapping of AX events to native notifications. + (NSString*)nativeNotificationFromAXEvent:(ui::AXEvent)event { - CR_DEFINE_STATIC_LOCAL(EventMap, event_map, (BuildEventMap())); - EventMap::iterator it = event_map.find(event); + CR_DEFINE_STATIC_LOCAL(const EventMap, event_map, (BuildEventMap())); + EventMap::const_iterator it = event_map.find(event); return it != event_map.end() ? it->second : nil; } @@ -301,6 +311,9 @@ // NSAccessibility informal protocol implementation. - (BOOL)accessibilityIsIgnored { + if (!node_) + return YES; + return [[self AXRole] isEqualToString:NSAccessibilityUnknownRole] || node_->GetData().HasState(ui::AX_STATE_INVISIBLE); } @@ -320,25 +333,51 @@ } - (id)accessibilityFocusedUIElement { - return node_->GetDelegate()->GetFocus(); + return node_ ? node_->GetDelegate()->GetFocus() : nil; } - (NSArray*)accessibilityActionNames { + if (!node_) + return @[]; + base::scoped_nsobject<NSMutableArray> axActions( [[NSMutableArray alloc] init]); - // VoiceOver expects the "press" action to be first. - if (ui::IsRoleClickable(node_->GetData().role)) - [axActions addObject:NSAccessibilityPressAction]; + const ui::AXNodeData& data = node_->GetData(); + const ActionList& action_list = GetActionList(); + + // VoiceOver expects the "press" action to be first. Note that some roles + // should be given a press action implicitly. + DCHECK([action_list[0].second isEqualToString:NSAccessibilityPressAction]); + for (const auto item : action_list) { + if (data.HasAction(item.first) || HasImplicitAction(data, item.first)) + [axActions addObject:item.second]; + } + + if (AlsoUseShowMenuActionForDefaultAction(data)) + [axActions addObject:NSAccessibilityShowMenuAction]; return axActions.autorelease(); } - (void)accessibilityPerformAction:(NSString*)action { - DCHECK([[self accessibilityActionNames] containsObject:action]); + // Actions are performed asynchronously, so it's always possible for an object + // to change its mind after previously reporting an action as available. + if (![[self accessibilityActionNames] containsObject:action]) + return; + ui::AXActionData data; - if ([action isEqualToString:NSAccessibilityPressAction]) + if ([action isEqualToString:NSAccessibilityShowMenuAction] && + AlsoUseShowMenuActionForDefaultAction(node_->GetData())) { data.action = ui::AX_ACTION_DO_DEFAULT; + } else { + for (const ActionList::value_type& entry : GetActionList()) { + if ([action isEqualToString:entry.second]) { + data.action = entry.first; + break; + } + } + } // Note ui::AX_ACTIONs which are just overwriting an accessibility attribute // are already implemented in -accessibilitySetValue:forAttribute:, so ignore @@ -349,6 +388,9 @@ } - (NSArray*)accessibilityAttributeNames { + if (!node_) + return @[]; + // These attributes are required on all accessibility objects. NSArray* const kAllRoleAttributes = @[ NSAccessibilityChildrenAttribute, @@ -418,7 +460,7 @@ - (NSArray*)accessibilityParameterizedAttributeNames { if (!node_) - return nil; + return @[]; static NSArray* const kSelectableTextAttributes = [@[ NSAccessibilityLineForIndexParameterizedAttribute, @@ -443,6 +485,9 @@ } - (BOOL)accessibilityIsAttributeSettable:(NSString*)attributeName { + if (!node_) + return NO; + if (node_->GetData().HasState(ui::AX_STATE_DISABLED)) return NO; @@ -480,6 +525,9 @@ } - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute { + if (!node_) + return; + ui::AXActionData data; // Check for attributes first. Only the |data.action| should be set here - any @@ -518,6 +566,9 @@ } - (id)accessibilityAttributeValue:(NSString*)attribute { + if (!node_) + return nil; // Return nil when detached. Even for AXRole. + SEL selector = NSSelectorFromString(attribute); if ([self respondsToSelector:selector]) return [self performSelector:selector]; @@ -526,6 +577,9 @@ - (id)accessibilityAttributeValue:(NSString*)attribute forParameter:(id)parameter { + if (!node_) + return nil; + SEL selector = NSSelectorFromString([attribute stringByAppendingString:@":"]); if ([self respondsToSelector:selector]) return [self performSelector:selector withObject:parameter]; @@ -538,6 +592,7 @@ - (NSString*)AXRole { if (!node_) return nil; + return [[self class] nativeRoleFromAXRole:node_->GetData().role]; } @@ -605,7 +660,8 @@ - (NSArray*)AXChildren { if (!node_) - return nil; + return @[]; + int count = node_->GetChildCount(); NSMutableArray* children = [NSMutableArray arrayWithCapacity:count]; for (int i = 0; i < count; ++i)
diff --git a/ui/app_list/views/expand_arrow_view.cc b/ui/app_list/views/expand_arrow_view.cc index 632d3e18..69d4877 100644 --- a/ui/app_list/views/expand_arrow_view.cc +++ b/ui/app_list/views/expand_arrow_view.cc
@@ -9,6 +9,7 @@ #include "ui/app_list/vector_icons/vector_icons.h" #include "ui/app_list/views/app_list_view.h" #include "ui/app_list/views/contents_view.h" +#include "ui/gfx/canvas.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/animation/flood_fill_ink_drop_ripple.h" #include "ui/views/animation/ink_drop_highlight.h" @@ -24,6 +25,7 @@ constexpr int kExpandArrowTileSize = 36; constexpr int kExpandArrowIconSize = 12; constexpr int kInkDropRadius = 18; +constexpr int kSelectedRadius = 18; constexpr SkColor kExpandArrowColor = SK_ColorWHITE; constexpr SkColor kInkDropRippleColor = @@ -47,7 +49,30 @@ SetInkDropMode(InkDropHostView::InkDropMode::ON); } -ExpandArrowView::~ExpandArrowView() {} +ExpandArrowView::~ExpandArrowView() = default; + +void ExpandArrowView::SetSelected(bool selected) { + if (selected == selected_) + return; + + selected_ = selected; + SchedulePaint(); + + if (selected) + NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true); +} + +void ExpandArrowView::PaintButtonContents(gfx::Canvas* canvas) { + if (!selected_) + return; + + gfx::Rect rect(GetContentsBounds()); + cc::PaintFlags flags; + flags.setAntiAlias(true); + flags.setColor(kGridSelectedColor); + flags.setStyle(cc::PaintFlags::kFill_Style); + canvas->DrawCircle(gfx::PointF(rect.CenterPoint()), kSelectedRadius, flags); +} void ExpandArrowView::ButtonPressed(views::Button* sender, const ui::Event& event) {
diff --git a/ui/app_list/views/expand_arrow_view.h b/ui/app_list/views/expand_arrow_view.h index b1064ad4..c0f6bd6 100644 --- a/ui/app_list/views/expand_arrow_view.h +++ b/ui/app_list/views/expand_arrow_view.h
@@ -28,6 +28,12 @@ ExpandArrowView(ContentsView* contents_view, AppListView* app_list_view); ~ExpandArrowView() override; + bool selected() { return selected_; } + void SetSelected(bool selected); + + // Overridden from views::CustomButton: + void PaintButtonContents(gfx::Canvas* canvas) override; + // Overridden from views::ButtonListener: void ButtonPressed(views::Button* sender, const ui::Event& event) override; @@ -48,6 +54,8 @@ views::ImageView* icon_; + bool selected_ = false; + DISALLOW_COPY_AND_ASSIGN(ExpandArrowView); };
diff --git a/ui/app_list/views/start_page_view.cc b/ui/app_list/views/start_page_view.cc index 8427adb..d7c374b 100644 --- a/ui/app_list/views/start_page_view.cc +++ b/ui/app_list/views/start_page_view.cc
@@ -283,6 +283,27 @@ const int forward_dir = base::i18n::IsRTL() ? -1 : 1; int selected_index = suggestions_container_->selected_index(); + if (expand_arrow_view_ && expand_arrow_view_->selected()) { + if (expand_arrow_view_->OnKeyPressed(event)) { + expand_arrow_view_->SetSelected(false); + return true; + } + + if (event.key_code() == ui::VKEY_RIGHT || + (event.key_code() == ui::VKEY_TAB && !event.IsShiftDown())) { + expand_arrow_view_->SetSelected(false); + suggestions_container_->SetSelectedIndex(0); + } else if (event.key_code() == ui::VKEY_LEFT || + event.key_code() == ui::VKEY_UP || + (event.key_code() == ui::VKEY_TAB && event.IsShiftDown())) { + expand_arrow_view_->SetSelected(false); + suggestions_container_->SetSelectedIndex( + suggestions_container_->num_results() - 1); + } + + return true; + } + if (custom_launcher_page_background_->selected()) { selected_index = suggestions_container_->num_results(); switch (event.key_code()) { @@ -304,9 +325,13 @@ dir = -forward_dir; break; case ui::VKEY_RIGHT: - // Don't go to the custom launcher page from the All apps tile. - if (selected_index != suggestions_container_->num_results() - 1) + // For non-fullscreen app list, don't go to the custom launcher page from + // the All apps tile. For fullscreen app list, allow this so that expand + // arrow is selected. + if (is_fullscreen_app_list_enabled_ || + selected_index != suggestions_container_->num_results() - 1) { dir = forward_dir; + } break; case ui::VKEY_UP: // Up selects the first tile if the custom launcher is selected. @@ -318,7 +343,8 @@ case ui::VKEY_DOWN: // Down selects the first tile if nothing is selected. dir = 1; - // If something is selected, select the custom launcher page. + // If something is selected, for non-fullscreen app list, it selects the + // custom launcher page; for fullscreen app list, it selects expand arrow. if (suggestions_container_->IsValidSelectionIndex(selected_index)) selected_index = suggestions_container_->num_results() - 1; break; @@ -346,6 +372,13 @@ return true; } + if (expand_arrow_view_ && + selection_index == suggestions_container_->num_results()) { + expand_arrow_view_->SetSelected(true); + suggestions_container_->ClearSelectedIndex(); + return true; + } + if (selection_index == suggestions_container_->num_results() && app_list_main_view_->ShouldShowCustomLauncherPage()) { custom_launcher_page_background_->SetSelected(true);
diff --git a/ui/base/ime/chromeos/input_method_manager.h b/ui/base/ime/chromeos/input_method_manager.h index be32e0d..653319e 100644 --- a/ui/base/ime/chromeos/input_method_manager.h +++ b/ui/base/ime/chromeos/input_method_manager.h
@@ -64,6 +64,13 @@ std::vector<MenuItem> children; }; + enum ImeMenuFeature { + FEATURE_EMOJI = 1 << 0, + FEATURE_HANDWRITING = 1 << 1, + FEATURE_VOICE = 1 << 2, + FEATURE_ALL = ~0, + }; + class Observer { public: virtual ~Observer() {} @@ -306,6 +313,13 @@ // Returns whether the extra inputs: emoji, handwriting and voice inputs on // opt-in IME menu has been enabled. virtual bool IsEmojiHandwritingVoiceOnImeMenuEnabled() = 0; + + // Enables or disables some advanced features, e.g. handwiring, voices input. + virtual void SetImeMenuFeatureEnabled(ImeMenuFeature feature, + bool enabled) = 0; + + // Returns the true if the given feature is enabled. + virtual bool GetImeMenuFeatureEnabled(ImeMenuFeature feature) const = 0; }; } // namespace input_method
diff --git a/ui/base/ime/chromeos/mock_input_method_manager.cc b/ui/base/ime/chromeos/mock_input_method_manager.cc index f40d0798..a66aeeb 100644 --- a/ui/base/ime/chromeos/mock_input_method_manager.cc +++ b/ui/base/ime/chromeos/mock_input_method_manager.cc
@@ -99,7 +99,8 @@ MockInputMethodManager::State::~State() {} -MockInputMethodManager::MockInputMethodManager() {} +MockInputMethodManager::MockInputMethodManager() + : features_enabled_state_(InputMethodManager::FEATURE_ALL) {} MockInputMethodManager::~MockInputMethodManager() {} @@ -190,5 +191,18 @@ return true; } +void MockInputMethodManager::SetImeMenuFeatureEnabled(ImeMenuFeature feature, + bool enabled) { + if (enabled) + features_enabled_state_ |= feature; + else + features_enabled_state_ &= ~feature; +} + +bool MockInputMethodManager::GetImeMenuFeatureEnabled( + ImeMenuFeature feature) const { + return features_enabled_state_ & feature; +} + } // namespace input_method } // namespace chromeos
diff --git a/ui/base/ime/chromeos/mock_input_method_manager.h b/ui/base/ime/chromeos/mock_input_method_manager.h index 62ae04c..d59c288 100644 --- a/ui/base/ime/chromeos/mock_input_method_manager.h +++ b/ui/base/ime/chromeos/mock_input_method_manager.h
@@ -105,8 +105,12 @@ void MaybeNotifyImeMenuActivationChanged() override; void OverrideKeyboardUrlRef(const std::string& keyset) override; bool IsEmojiHandwritingVoiceOnImeMenuEnabled() override; + void SetImeMenuFeatureEnabled(ImeMenuFeature feature, bool enabled) override; + bool GetImeMenuFeatureEnabled(ImeMenuFeature feature) const override; private: + uint32_t features_enabled_state_; + DISALLOW_COPY_AND_ASSIGN(MockInputMethodManager); };
diff --git a/ui/chromeos/ime/mode_indicator_view.cc b/ui/chromeos/ime/mode_indicator_view.cc index b73d5de..e85770c9 100644 --- a/ui/chromeos/ime/mode_indicator_view.cc +++ b/ui/chromeos/ime/mode_indicator_view.cc
@@ -44,15 +44,15 @@ } // namespace - -ModeIndicatorView::ModeIndicatorView(gfx::NativeView parent, +ModeIndicatorView::ModeIndicatorView(Delegate* delegate, const gfx::Rect& cursor_bounds, const base::string16& label) - : cursor_bounds_(cursor_bounds), + : delegate_(delegate), + cursor_bounds_(cursor_bounds), label_view_(new views::Label(label)) { + DCHECK(delegate_); set_can_activate(false); set_accept_events(false); - set_parent_window(parent); set_shadow(views::BubbleBorder::NO_SHADOW); set_arrow(views::BubbleBorder::TOP_CENTER); } @@ -70,6 +70,12 @@ &views::Widget::Close); } +void ModeIndicatorView::OnBeforeBubbleWidgetInit( + views::Widget::InitParams* params, + views::Widget* widget) const { + delegate_->InitWidgetContainer(params); +} + gfx::Size ModeIndicatorView::CalculatePreferredSize() const { gfx::Size size = label_view_->GetPreferredSize(); size.SetToMax(gfx::Size(kMinSize, kMinSize));
diff --git a/ui/chromeos/ime/mode_indicator_view.h b/ui/chromeos/ime/mode_indicator_view.h index 91f1433..b976a5c 100644 --- a/ui/chromeos/ime/mode_indicator_view.h +++ b/ui/chromeos/ime/mode_indicator_view.h
@@ -10,21 +10,30 @@ #include "base/timer/timer.h" #include "ui/chromeos/ui_chromeos_export.h" #include "ui/gfx/geometry/rect.h" -#include "ui/gfx/native_widget_types.h" #include "ui/views/bubble/bubble_dialog_delegate.h" +#include "ui/views/widget/widget.h" namespace views { class Label; -class Widget; } // namespace views namespace ui { namespace ime { +// A small bubble that shows the short name of the current IME (e.g. "DV" for +// Dvorak) after switching IMEs with an accelerator (e.g. Ctrl-Space). class UI_CHROMEOS_EXPORT ModeIndicatorView : public views::BubbleDialogDelegateView { public: - ModeIndicatorView(gfx::NativeView parent, + class Delegate { + public: + virtual ~Delegate() = default; + + // Configures the InitParams to place the bubble in the right container. + virtual void InitWidgetContainer(views::Widget::InitParams* params) = 0; + }; + + ModeIndicatorView(Delegate* delegate, const gfx::Rect& cursor_bounds, const base::string16& label); ~ModeIndicatorView() override; @@ -33,6 +42,8 @@ void ShowAndFadeOut(); // views::BubbleDialogDelegateView override: + void OnBeforeBubbleWidgetInit(views::Widget::InitParams* params, + views::Widget* widget) const override; gfx::Size CalculatePreferredSize() const override; const char* GetClassName() const override; int GetDialogButtons() const override; @@ -44,6 +55,7 @@ views::Widget* widget) override; private: + Delegate* delegate_; gfx::Rect cursor_bounds_; views::Label* label_view_; base::OneShotTimer timer_;
diff --git a/ui/display/display_change_notifier.cc b/ui/display/display_change_notifier.cc index 626c86ee..3a5cfd0c 100644 --- a/ui/display/display_change_notifier.cc +++ b/ui/display/display_change_notifier.cc
@@ -80,6 +80,9 @@ if (new_it->device_scale_factor() != old_it->device_scale_factor()) metrics |= DisplayObserver::DISPLAY_METRIC_DEVICE_SCALE_FACTOR; + if (new_it->color_space() != old_it->color_space()) + metrics |= DisplayObserver::DISPLAY_METRIC_COLOR_SPACE; + if (metrics != DisplayObserver::DISPLAY_METRIC_NONE) { for (DisplayObserver& observer : observer_list_) observer.OnDisplayMetricsChanged(*new_it, metrics);
diff --git a/ui/display/display_observer.h b/ui/display/display_observer.h index df86654..3398b50 100644 --- a/ui/display/display_observer.h +++ b/ui/display/display_observer.h
@@ -25,6 +25,7 @@ DISPLAY_METRIC_ROTATION = 1 << 3, DISPLAY_METRIC_PRIMARY = 1 << 4, DISPLAY_METRIC_MIRROR_STATE = 1 << 5, + DISPLAY_METRIC_COLOR_SPACE = 1 << 6, }; // Called when |new_display| has been added.
diff --git a/ui/keyboard/content/keyboard_ui_content.cc b/ui/keyboard/content/keyboard_ui_content.cc index 5e6f4dd..1527e6c 100644 --- a/ui/keyboard/content/keyboard_ui_content.cc +++ b/ui/keyboard/content/keyboard_ui_content.cc
@@ -174,15 +174,6 @@ ResetInsets(); } -void KeyboardUIContent::LoadSystemKeyboard() { - DCHECK(keyboard_contents_); - if (keyboard_contents_->GetURL() != default_url_) { - // TODO(bshe): The height of system virtual keyboard and IME virtual - // keyboard may different. The height needs to be restored too. - LoadContents(default_url_); - } -} - void KeyboardUIContent::UpdateInsetsForWindow(aura::Window* window) { aura::Window* keyboard_container = keyboard_controller()->GetContainerWindow();
diff --git a/ui/keyboard/content/keyboard_ui_content.h b/ui/keyboard/content/keyboard_ui_content.h index f86e07a..9548a4d 100644 --- a/ui/keyboard/content/keyboard_ui_content.h +++ b/ui/keyboard/content/keyboard_ui_content.h
@@ -59,10 +59,6 @@ const content::MediaStreamRequest& request, const content::MediaResponseCallback& callback) = 0; - // Loads system virtual keyboard. Noop if the current virtual keyboard is - // system virtual keyboard. - virtual void LoadSystemKeyboard(); - // Called when a window being observed changes bounds, to update its insets. void UpdateInsetsForWindow(aura::Window* window);
diff --git a/ui/message_center/views/notification_header_view.cc b/ui/message_center/views/notification_header_view.cc index 7a4fa5d..8ce5827 100644 --- a/ui/message_center/views/notification_header_view.cc +++ b/ui/message_center/views/notification_header_view.cc
@@ -43,6 +43,46 @@ // Highlight (hover) ink drop opacity of action buttons. constexpr float kInkDropHighlightVisibleOpacity = 0.08f; +// ExpandButtton forwards all mouse and key events to NotificationHeaderView, +// but takes tab focus for accessibility purpose. +class ExpandButton : public views::ImageView { + public: + ExpandButton(); + ~ExpandButton() override; + + void OnPaint(gfx::Canvas* canvas) override; + void OnFocus() override; + void OnBlur() override; + + private: + std::unique_ptr<views::Painter> focus_painter_; +}; + +ExpandButton::ExpandButton() { + SetImage(gfx::CreateVectorIcon(kNotificationExpandMoreIcon, kExpandIconSize, + gfx::kChromeIconGrey)); + focus_painter_ = views::Painter::CreateSolidFocusPainter( + kFocusBorderColor, gfx::Insets(1, 2, 2, 2)); + SetFocusBehavior(FocusBehavior::ALWAYS); +} + +ExpandButton::~ExpandButton() = default; + +void ExpandButton::OnPaint(gfx::Canvas* canvas) { + views::ImageView::OnPaint(canvas); + views::Painter::PaintFocusPainter(this, canvas, focus_painter_.get()); +} + +void ExpandButton::OnFocus() { + views::ImageView::OnFocus(); + SchedulePaint(); +} + +void ExpandButton::OnBlur() { + views::ImageView::OnBlur(); + SchedulePaint(); +} + } // namespace NotificationHeaderView::NotificationHeaderView(views::ButtonListener* listener) @@ -101,14 +141,7 @@ app_info_container->AddChildView(summary_text_view_); // Expand button view - expand_button_ = new views::ImageButton(listener); - expand_button_->SetImage( - views::Button::STATE_NORMAL, - gfx::CreateVectorIcon(kNotificationExpandMoreIcon, kExpandIconSize, - gfx::kChromeIconGrey)); - expand_button_->SetFocusForPlatform(); - expand_button_->SetFocusPainter(views::Painter::CreateSolidFocusPainter( - kFocusBorderColor, gfx::Insets(1, 2, 2, 2))); + expand_button_ = new ExpandButton(); app_info_container->AddChildView(expand_button_); // Spacer between left-aligned views and right-aligned views @@ -147,22 +180,42 @@ void NotificationHeaderView::SetProgress(int progress) { summary_text_view_->SetText(l10n_util::GetStringFUTF16Int( IDS_MESSAGE_CENTER_NOTIFICATION_PROGRESS_PERCENTAGE, progress)); - has_summary_text_ = true; + has_progress_ = true; UpdateSummaryTextVisibility(); } void NotificationHeaderView::ClearProgress() { - has_summary_text_ = false; + has_progress_ = false; + UpdateSummaryTextVisibility(); +} + +void NotificationHeaderView::SetOverflowIndicator(int count) { + if (count > 0) { + summary_text_view_->SetText(l10n_util::GetStringFUTF16Int( + IDS_MESSAGE_CENTER_LIST_NOTIFICATION_HEADER_OVERFLOW_INDICATOR, count)); + has_overflow_indicator_ = true; + } else { + has_overflow_indicator_ = false; + } + UpdateSummaryTextVisibility(); +} + +void NotificationHeaderView::ClearOverflowIndicator() { + has_overflow_indicator_ = false; UpdateSummaryTextVisibility(); } void NotificationHeaderView::SetExpandButtonEnabled(bool enabled) { + // SetInkDropMode iff. the visibility changed. + // Otherwise, the ink drop animation cannot finish. + if (expand_button_->visible() != enabled) + SetInkDropMode(enabled ? InkDropMode::ON : InkDropMode::OFF); + expand_button_->SetVisible(enabled); } void NotificationHeaderView::SetExpanded(bool expanded) { expand_button_->SetImage( - views::Button::STATE_NORMAL, gfx::CreateVectorIcon( expanded ? kNotificationExpandLessIcon : kNotificationExpandMoreIcon, kExpandIconSize, gfx::kChromeIconGrey)); @@ -234,8 +287,9 @@ } void NotificationHeaderView::UpdateSummaryTextVisibility() { - summary_text_divider_->SetVisible(has_summary_text_); - summary_text_view_->SetVisible(has_summary_text_); + const bool visible = has_progress_ || has_overflow_indicator_; + summary_text_divider_->SetVisible(visible); + summary_text_view_->SetVisible(visible); Layout(); }
diff --git a/ui/message_center/views/notification_header_view.h b/ui/message_center/views/notification_header_view.h index addc8d19..0d3f0c3 100644 --- a/ui/message_center/views/notification_header_view.h +++ b/ui/message_center/views/notification_header_view.h
@@ -23,12 +23,14 @@ void SetAppIcon(const gfx::ImageSkia& img); void SetAppName(const base::string16& name); void SetProgress(int progress); + void SetOverflowIndicator(int count); void SetExpandButtonEnabled(bool enabled); void SetExpanded(bool expanded); void SetSettingsButtonEnabled(bool enabled); void SetCloseButtonEnabled(bool enabled); void SetControlButtonsVisible(bool visible); void ClearProgress(); + void ClearOverflowIndicator(); bool IsExpandButtonEnabled(); bool IsSettingsButtonEnabled(); bool IsCloseButtonEnabled(); @@ -40,7 +42,7 @@ std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() const override; - views::ImageButton* expand_button() { return expand_button_; } + views::ImageView* expand_button() { return expand_button_; } views::ImageButton* settings_button() { return settings_button_; } views::ImageButton* close_button() { return close_button_; } @@ -52,14 +54,15 @@ views::Label* summary_text_divider_ = nullptr; views::Label* summary_text_view_ = nullptr; views::ImageView* app_icon_view_ = nullptr; - views::ImageButton* expand_button_ = nullptr; + views::ImageView* expand_button_ = nullptr; PaddedButton* settings_button_ = nullptr; PaddedButton* close_button_ = nullptr; bool settings_button_enabled_ = false; bool close_button_enabled_ = false; bool is_control_buttons_visible_ = false; - bool has_summary_text_ = false; + bool has_progress_ = false; + bool has_overflow_indicator_ = false; DISALLOW_COPY_AND_ASSIGN(NotificationHeaderView); };
diff --git a/ui/message_center/views/notification_view_md.cc b/ui/message_center/views/notification_view_md.cc index 2f9e2c5..551a8b0 100644 --- a/ui/message_center/views/notification_view_md.cc +++ b/ui/message_center/views/notification_view_md.cc
@@ -72,7 +72,6 @@ constexpr int kMaxLinesForMessageView = 1; constexpr int kMaxLinesForExpandedMessageView = 4; -constexpr int kListNotificationOverflowIndicatorSpacing = 4; constexpr int kCompactTitleMessageViewSpacing = 12; constexpr int kProgressBarHeight = 4; @@ -117,85 +116,31 @@ explicit ItemView(const message_center::NotificationItem& item); ~ItemView() override; - void SetRemainingCount(int num_remaining); - void SetRemainingCountVisible(bool visible); - private: - class LayoutManager : public views::FillLayout { - public: - LayoutManager(ItemView* item_view) - : views::FillLayout(), item_view_(item_view) {} - - void Layout(View* host) override { - gfx::Rect container_bounds = host->GetContentsBounds(); - if (item_view_->remaining_count_->visible()) { - // Show the full content of the overflow indicator and collapse the - // message container. - container_bounds.set_width( - container_bounds.width() - - item_view_->remaining_count_->GetPreferredSize().width() - - kListNotificationOverflowIndicatorSpacing); - } - item_view_->container_->SetBoundsRect(container_bounds); - item_view_->remaining_count_->SetBoundsRect(host->GetContentsBounds()); - } - - private: - ItemView* item_view_; - }; - - // Container of the title and the message. - views::View* container_; - // Overflow indicator e.g. "+3" shown on the right bottom. - views::Label* remaining_count_; - DISALLOW_COPY_AND_ASSIGN(ItemView); }; ItemView::ItemView(const message_center::NotificationItem& item) { - SetLayoutManager(new ItemView::LayoutManager(this)); - - container_ = new views::View; - AddChildView(container_); - container_->SetLayoutManager( - new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(), - message_center::kItemTitleToMessagePadding)); + SetLayoutManager( + new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(), 0)); views::Label* title = new views::Label(item.title); title->set_collapse_when_hidden(true); title->SetHorizontalAlignment(gfx::ALIGN_LEFT); title->SetEnabledColor(message_center::kRegularTextColor); title->SetBackgroundColor(message_center::kDimTextBackgroundColor); - container_->AddChildView(title); + AddChildView(title); - views::Label* message = new views::Label(item.message); + views::Label* message = new views::Label(l10n_util::GetStringFUTF16( + IDS_MESSAGE_CENTER_LIST_NOTIFICATION_MESSAGE_WITH_DIVIDER, item.message)); message->set_collapse_when_hidden(true); message->SetHorizontalAlignment(gfx::ALIGN_LEFT); message->SetEnabledColor(message_center::kDimTextColor); message->SetBackgroundColor(message_center::kDimTextBackgroundColor); - container_->AddChildView(message); - - remaining_count_ = new views::Label(); - remaining_count_->SetHorizontalAlignment(gfx::ALIGN_RIGHT); - remaining_count_->SetEnabledColor(message_center::kDimTextColor); - remaining_count_->SetBackgroundColor(message_center::kDimTextBackgroundColor); - remaining_count_->SetVisible(false); - AddChildView(remaining_count_); + AddChildView(message); } -ItemView::~ItemView() {} - -void ItemView::SetRemainingCount(int num_remaining) { - if (num_remaining > 0) { - remaining_count_->SetText(l10n_util::GetStringFUTF16Int( - IDS_MESSAGE_CENTER_LIST_NOTIFICATION_OVERFLOW_INDICATOR, - num_remaining)); - } -} - -void ItemView::SetRemainingCountVisible(bool visible) { - remaining_count_->SetVisible(visible); -} +ItemView::~ItemView() = default; // CompactTitleMessageView ///////////////////////////////////////////////////// @@ -489,8 +434,7 @@ // Tapping anywhere on |header_row_| can expand the notification, though only // |expand_button| can be focused by TAB. - if (IsExpandable() && - (sender == header_row_ || sender == header_row_->expand_button())) { + if (IsExpandable() && sender == header_row_) { ToggleExpanded(); Layout(); SchedulePaint(); @@ -637,13 +581,11 @@ left_content_->AddChildView(item_view); } - if (!item_views_.empty()) { - item_views_.front()->SetRemainingCount(items.size() - 1); - item_views_.back()->SetRemainingCount(items.size() - item_views_.size()); + list_items_count_ = items.size(); - // Needed when CreateOrUpdateViews is called for update. + // Needed when CreateOrUpdateViews is called for update. + if (!item_views_.empty()) left_content_->InvalidateLayout(); - } } void NotificationViewMD::CreateOrUpdateIconView( @@ -811,13 +753,12 @@ if (image_container_) image_container_->SetVisible(expanded); actions_row_->SetVisible(expanded && actions_row_->has_children()); - for (size_t i = 1; i < item_views_.size(); ++i) { + for (size_t i = kMaxLinesForMessageView; i < item_views_.size(); ++i) { item_views_[i]->SetVisible(expanded); } - if (!item_views_.empty()) { - item_views_.front()->SetRemainingCountVisible(!expanded); - item_views_.back()->SetRemainingCountVisible(expanded); - } + header_row_->SetOverflowIndicator( + list_items_count_ - + (expanded ? item_views_.size() : kMaxLinesForMessageView)); } void NotificationViewMD::UpdateControlButtonsVisibility() {
diff --git a/ui/message_center/views/notification_view_md.h b/ui/message_center/views/notification_view_md.h index 35fdbba..890165a 100644 --- a/ui/message_center/views/notification_view_md.h +++ b/ui/message_center/views/notification_view_md.h
@@ -86,6 +86,9 @@ // Whether this notification is expanded or not. bool expanded_ = false; + // Number of total list items in the given Notification class. + int list_items_count_ = 0; + // Describes whether the view should display a hand pointer or not. bool clickable_;
diff --git a/ui/ozone/demo/ozone_demo.cc b/ui/ozone/demo/ozone_demo.cc index 1977457..bf9aa69 100644 --- a/ui/ozone/demo/ozone_demo.cc +++ b/ui/ozone/demo/ozone_demo.cc
@@ -208,8 +208,7 @@ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (!command_line->HasSwitch(kDisableGpu) && gl::init::InitializeGLOneOff() && - gpu_helper_.Initialize(base::ThreadTaskRunnerHandle::Get(), - base::ThreadTaskRunnerHandle::Get())) { + gpu_helper_.Initialize(base::ThreadTaskRunnerHandle::Get())) { type_ = GL; } else { type_ = SOFTWARE;
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.cc b/ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.cc index ccc82dc..fd8f87ff 100644 --- a/ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.cc +++ b/ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.cc
@@ -90,6 +90,13 @@ if (transform != gfx::OVERLAY_TRANSFORM_NONE && !rotation_prop_.id) return false; +// TODO(dcastagna): On rk3399 downscaling by a factor of two is not working +// correctly. Remove this hack once crbug.com/709105 is fixed. +#if defined(ARCH_CPU_ARM_FAMILY) + if ((src_rect.width() >> 16) / crtc_rect.width() == 2) + return false; +#endif + int plane_set_succeeded = drmModeAtomicAddProperty(property_set, plane_id_, crtc_prop_.id, crtc_id) &&
diff --git a/ui/ozone/public/ozone_gpu_test_helper.cc b/ui/ozone/public/ozone_gpu_test_helper.cc index 1e8ba71..cc89a0e 100644 --- a/ui/ozone/public/ozone_gpu_test_helper.cc +++ b/ui/ozone/public/ozone_gpu_test_helper.cc
@@ -73,9 +73,9 @@ class FakeGpuProcessHost { public: FakeGpuProcessHost( - const scoped_refptr<base::SingleThreadTaskRunner>& gpu_task_runner, + const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& gpu_io_task_runner) - : gpu_task_runner_(gpu_task_runner), + : ui_task_runner_(ui_task_runner), gpu_io_task_runner_(gpu_io_task_runner) {} ~FakeGpuProcessHost() {} @@ -85,12 +85,12 @@ ui::OzonePlatform::GetInstance() ->GetGpuPlatformSupportHost() - ->OnGpuProcessLaunched(kGpuProcessHostId, gpu_task_runner_, + ->OnGpuProcessLaunched(kGpuProcessHostId, ui_task_runner_, gpu_io_task_runner_, sender); } private: - scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner_; + scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> gpu_io_task_runner_; }; @@ -101,8 +101,7 @@ } bool OzoneGpuTestHelper::Initialize( - const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner, - const scoped_refptr<base::SingleThreadTaskRunner>& gpu_task_runner) { + const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) { io_helper_thread_.reset(new base::Thread("IOHelperThread")); if (!io_helper_thread_->StartWithOptions( base::Thread::Options(base::MessageLoop::TYPE_IO, 0))) @@ -114,7 +113,7 @@ base::Unretained(fake_gpu_process_.get()))); fake_gpu_process_host_.reset(new FakeGpuProcessHost( - gpu_task_runner, io_helper_thread_->task_runner())); + ui_task_runner, io_helper_thread_->task_runner())); io_helper_thread_->task_runner()->PostTask( FROM_HERE, base::Bind(&FakeGpuProcessHost::InitOnIO, base::Unretained(fake_gpu_process_host_.get())));
diff --git a/ui/ozone/public/ozone_gpu_test_helper.h b/ui/ozone/public/ozone_gpu_test_helper.h index 5e92b03c..363a942 100644 --- a/ui/ozone/public/ozone_gpu_test_helper.h +++ b/ui/ozone/public/ozone_gpu_test_helper.h
@@ -29,13 +29,10 @@ OzoneGpuTestHelper(); virtual ~OzoneGpuTestHelper(); - // Start processing gpu messages. The host process will be using the - // |gpu_task_runner| to post messages intended for the GPU thread. The "gpu" - // process will be using the |ui_task_runner| to post messages intended for - // the "ui" thread. + // Start processing gpu messages. The "gpu" process will be using the + // |ui_task_runner| to post messages intended for the "ui" thread. bool Initialize( - const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner, - const scoped_refptr<base::SingleThreadTaskRunner>& gpu_task_runner); + const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner); private: std::unique_ptr<FakeGpuProcess> fake_gpu_process_;
diff --git a/ui/strings/ui_strings.grd b/ui/strings/ui_strings.grd index 3fa60fc..8c97333 100644 --- a/ui/strings/ui_strings.grd +++ b/ui/strings/ui_strings.grd
@@ -634,8 +634,11 @@ <message name="IDS_MESSAGE_CENTER_CLEAR_ALL" desc="The button for clearing all notifications."> Clear All </message> - <message name="IDS_MESSAGE_CENTER_LIST_NOTIFICATION_OVERFLOW_INDICATOR" desc="The overflow indicator shown when a list notification has more list items than visible ones. Should be same as AndroidPlatform msgId 1863231301642314183. (frameworks/base/packages/SystemUI/res/values/strings.xml:notification_group_overflow_indicator)"> - + <ph name="NUMBER">$1<ex>3</ex></ph> + <message name="IDS_MESSAGE_CENTER_LIST_NOTIFICATION_MESSAGE_WITH_DIVIDER" desc="The divider symbol of the title and the message of a sub item in list notification. In English, the title is on the left of this text. In RTL languages, the title is on the right of this message."> + ''' - <ph name="message">$1<ex>This is the message!</ex></ph>''' + </message> + <message name="IDS_MESSAGE_CENTER_LIST_NOTIFICATION_HEADER_OVERFLOW_INDICATOR" desc="The overflow indicator shown on the notification header when a list notification has more list items than visible ones."> + +<ph name="NUMBER">$1<ex>3</ex></ph> more </message> <message name="IDS_MESSAGE_CENTER_NOTIFICATION_PROGRESS_PERCENTAGE" desc="The summary text in a notification that is shown with progress bar."> <ph name="NUMBER">$1<ex>75</ex></ph> %
diff --git a/ui/views/accessibility/native_view_accessibility_base.cc b/ui/views/accessibility/native_view_accessibility_base.cc index 3b5789f..191945f 100644 --- a/ui/views/accessibility/native_view_accessibility_base.cc +++ b/ui/views/accessibility/native_view_accessibility_base.cc
@@ -89,6 +89,9 @@ if (!view_->IsDrawn()) data_.AddState(ui::AX_STATE_INVISIBLE); + if (view_->context_menu_controller()) + data_.AddAction(ui::AX_ACTION_SHOW_CONTEXT_MENU); + // Make sure this element is excluded from the a11y tree if there's a // focusable parent. All keyboard focusable elements should be leaf nodes. // Exceptions to this rule will themselves be accessibility focusable.
diff --git a/ui/views/cocoa/bridged_native_widget_unittest.mm b/ui/views/cocoa/bridged_native_widget_unittest.mm index 393afaf..a500e998 100644 --- a/ui/views/cocoa/bridged_native_widget_unittest.mm +++ b/ui/views/cocoa/bridged_native_widget_unittest.mm
@@ -29,6 +29,7 @@ #import "ui/views/cocoa/views_nswindow_delegate.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/controls/textfield/textfield_model.h" +#include "ui/views/test/test_views_delegate.h" #include "ui/views/view.h" #include "ui/views/widget/native_widget_mac.h" #include "ui/views/widget/root_view.h" @@ -287,6 +288,11 @@ // Make the InitParams available to tests to cover initialization codepaths. Widget::InitParams init_params_; + + private: + TestViewsDelegate test_views_delegate_; + + DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidgetTestBase); }; class BridgedNativeWidgetTest : public BridgedNativeWidgetTestBase {
diff --git a/ui/views/controls/button/checkbox.cc b/ui/views/controls/button/checkbox.cc index ddf64ece..0c7a721 100644 --- a/ui/views/controls/button/checkbox.cc +++ b/ui/views/controls/button/checkbox.cc
@@ -16,7 +16,6 @@ #include "ui/gfx/paint_vector_icon.h" #include "ui/views/animation/ink_drop_impl.h" #include "ui/views/animation/ink_drop_ripple.h" -#include "ui/views/animation/square_ink_drop_ripple.h" #include "ui/views/controls/button/label_button_border.h" #include "ui/views/painter.h" #include "ui/views/resources/grit/views_resources.h" @@ -146,23 +145,19 @@ // Completely removes the highlight. std::unique_ptr<InkDropImpl> ink_drop = CreateDefaultInkDropImpl(); ink_drop->SetShowHighlightOnHover(false); - ink_drop->SetAutoHighlightMode(views::InkDropImpl::AutoHighlightMode::NONE); + ink_drop->SetAutoHighlightMode(InkDropImpl::AutoHighlightMode::NONE); return ink_drop; } std::unique_ptr<InkDropRipple> Checkbox::CreateInkDropRipple() const { // The "small" size is 21dp, the large size is 1.33 * 21dp = 28dp. - const gfx::Size size(21, 21); - std::unique_ptr<InkDropRipple> ripple(new SquareInkDropRipple( - CalculateLargeInkDropSize(size), kInkDropLargeCornerRadius, size, - kInkDropSmallCornerRadius, image()->GetMirroredBounds().CenterPoint(), - GetInkDropBaseColor(), ink_drop_visible_opacity())); - return ripple; + return CreateDefaultInkDropRipple(image()->GetMirroredBounds().CenterPoint(), + gfx::Size(21, 21)); } SkColor Checkbox::GetInkDropBaseColor() const { return GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_ButtonEnabledColor); + ui::NativeTheme::kColorId_LabelEnabledColor); } void Checkbox::PaintButtonContents(gfx::Canvas* canvas) { @@ -187,7 +182,7 @@ // When not checked, the icon color matches the button text color. GetNativeTheme()->GetSystemColor( checked_ ? ui::NativeTheme::kColorId_FocusedBorderColor - : ui::NativeTheme::kColorId_ButtonEnabledColor)); + : ui::NativeTheme::kColorId_LabelEnabledColor)); } const size_t checked_index = checked_ ? 1 : 0;
diff --git a/ui/views/controls/button/md_text_button.cc b/ui/views/controls/button/md_text_button.cc index 43c0b48b..8aa0a62 100644 --- a/ui/views/controls/button/md_text_button.cc +++ b/ui/views/controls/button/md_text_button.cc
@@ -238,21 +238,21 @@ } void MdTextButton::UpdateColors() { - ui::NativeTheme::ColorId fg_color_id = - is_prominent_ ? ui::NativeTheme::kColorId_TextOnProminentButtonColor - : ui::NativeTheme::kColorId_ButtonEnabledColor; - ui::NativeTheme* theme = GetNativeTheme(); + SkColor enabled_text_color = style::GetColor( + label()->text_context(), + is_prominent_ ? style::STYLE_DIALOG_BUTTON_DEFAULT : style::STYLE_PRIMARY, + theme); if (!explicitly_set_normal_color()) { const auto colors = explicitly_set_colors(); - LabelButton::SetEnabledTextColors(theme->GetSystemColor(fg_color_id)); + LabelButton::SetEnabledTextColors(enabled_text_color); set_explicitly_set_colors(colors); } // Prominent buttons keep their enabled text color; disabled state is conveyed // by shading the background instead. if (is_prominent_) - SetTextColor(STATE_DISABLED, theme->GetSystemColor(fg_color_id)); + SetTextColor(STATE_DISABLED, enabled_text_color); SkColor text_color = label()->enabled_color(); SkColor bg_color =
diff --git a/ui/views/controls/combobox/combobox.cc b/ui/views/controls/combobox/combobox.cc index 615318fe..195114d 100644 --- a/ui/views/controls/combobox/combobox.cc +++ b/ui/views/controls/combobox/combobox.cc
@@ -11,6 +11,7 @@ #include "base/logging.h" #include "base/macros.h" #include "build/build_config.h" +#include "ui/accessibility/ax_action_data.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/default_style.h" #include "ui/base/ime/input_method.h" @@ -95,6 +96,12 @@ return ui::MaterialDesignController::IsSecondaryUiMaterial(); } +SkColor GetTextColorForEnableState(bool enabled, ui::NativeTheme* theme) { + return style::GetColor(style::CONTEXT_TEXTFIELD, + enabled ? style::STYLE_PRIMARY : style::STYLE_DISABLED, + theme); +} + gfx::Rect PositionArrowWithinContainer(const gfx::Rect& container_bounds, const gfx::Size& arrow_size, Combobox::Style style) { @@ -766,6 +773,20 @@ node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, model_->GetItemCount()); } +bool Combobox::HandleAccessibleAction(const ui::AXActionData& action_data) { + // The action handling in View would generate a mouse event and send it to + // |this|. However, mouse events for Combobox are handled by |arrow_button_|, + // which is hidden from the a11y tree (so can't expose actions). Rather than + // forwarding AX_ACTION_DO_DEFAULT to View and then forwarding the mouse event + // it generates to |arrow_button_| to have it forward back to |this| (as its + // ButtonListener), just handle the action explicitly here and bypass View. + if (enabled() && action_data.action == ui::AX_ACTION_DO_DEFAULT) { + ShowDropDownMenu(ui::MENU_SOURCE_KEYBOARD); + return true; + } + return View::HandleAccessibleAction(action_data); +} + void Combobox::ButtonPressed(Button* sender, const ui::Event& event) { if (!enabled()) return; @@ -815,12 +836,7 @@ int x = insets.left(); int y = insets.top(); int text_height = height() - insets.height(); - SkColor text_color = GetNativeTheme()->GetSystemColor( - UseMd() ? (enabled() ? ui::NativeTheme::kColorId_TextfieldDefaultColor - : ui::NativeTheme::kColorId_TextfieldReadOnlyColor) - : (enabled() ? ui::NativeTheme::kColorId_LabelEnabledColor - : ui::NativeTheme::kColorId_LabelDisabledColor)); - + SkColor text_color = GetTextColorForEnableState(enabled(), GetNativeTheme()); DCHECK_GE(selected_index_, 0); DCHECK_LT(selected_index_, model()->GetItemCount()); if (selected_index_ < 0 || selected_index_ > model()->GetItemCount()) @@ -863,8 +879,7 @@ path.rLineTo(height, -height); path.close(); cc::PaintFlags flags; - SkColor arrow_color = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_ButtonEnabledColor); + SkColor arrow_color = GetTextColorForEnableState(true, GetNativeTheme()); if (!enabled()) arrow_color = SkColorSetA(arrow_color, gfx::kDisabledControlAlpha); flags.setColor(arrow_color);
diff --git a/ui/views/controls/combobox/combobox.h b/ui/views/controls/combobox/combobox.h index 33a8f41..42a2051f 100644 --- a/ui/views/controls/combobox/combobox.h +++ b/ui/views/controls/combobox/combobox.h
@@ -100,6 +100,7 @@ void OnFocus() override; void OnBlur() override; void GetAccessibleNodeData(ui::AXNodeData* node_data) override; + bool HandleAccessibleAction(const ui::AXActionData& action_data) override; void Layout() override; void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
diff --git a/ui/views/controls/combobox/combobox_unittest.cc b/ui/views/controls/combobox/combobox_unittest.cc index 31a0c15..93d0d986 100644 --- a/ui/views/controls/combobox/combobox_unittest.cc +++ b/ui/views/controls/combobox/combobox_unittest.cc
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" +#include "ui/accessibility/ax_action_data.h" #include "ui/base/ime/input_method.h" #include "ui/base/ime/text_input_client.h" #include "ui/base/models/combobox_model.h" @@ -642,6 +643,36 @@ EXPECT_FALSE(listener.on_perform_action_called()); } +// Test that accessibility action events show the combobox dropdown. +TEST_F(ComboboxTest, ShowViaAccessibleAction) { + InitCombobox(nullptr, Combobox::STYLE_NORMAL); + + ui::AXActionData data; + data.action = ui::AX_ACTION_DO_DEFAULT; + + EXPECT_EQ(0, menu_show_count_); + combobox_->HandleAccessibleAction(data); + EXPECT_EQ(1, menu_show_count_); + + // AX_ACTION_SHOW_CONTEXT_MENU is specifically for a context menu (e.g. right- + // click). Combobox should ignore it. + data.action = ui::AX_ACTION_SHOW_CONTEXT_MENU; + combobox_->HandleAccessibleAction(data); + EXPECT_EQ(1, menu_show_count_); // No change. + + data.action = ui::AX_ACTION_BLUR; + combobox_->HandleAccessibleAction(data); + EXPECT_EQ(1, menu_show_count_); // No change. + + combobox_->SetEnabled(false); + combobox_->HandleAccessibleAction(data); + EXPECT_EQ(1, menu_show_count_); // No change. + + data.action = ui::AX_ACTION_SHOW_CONTEXT_MENU; + combobox_->HandleAccessibleAction(data); + EXPECT_EQ(1, menu_show_count_); // No change. +} + TEST_F(ComboboxTest, NotifyOnClickWithSpaceKeyActionStyle) { InitCombobox(nullptr, Combobox::STYLE_ACTION);
diff --git a/ui/views/controls/label.h b/ui/views/controls/label.h index 41f6a67..38eb5f3cd 100644 --- a/ui/views/controls/label.h +++ b/ui/views/controls/label.h
@@ -73,6 +73,10 @@ const base::string16& text() const { return render_text_->text(); } virtual void SetText(const base::string16& text); + // Where the label appears in the UI. Passed in from the constructor. This is + // a value from views::style::TextContext or an enum that extends it. + int text_context() const { return text_context_; } + // Enables or disables auto-color-readability (enabled by default). If this // is enabled, then calls to set any foreground or background color will // trigger an automatic mapper that uses color_utils::GetReadableColor() to @@ -228,8 +232,6 @@ void PaintText(gfx::Canvas* canvas); - int text_context() const { return text_context_; } - // View: void OnBoundsChanged(const gfx::Rect& previous_bounds) override; void VisibilityChanged(View* starting_from, bool is_visible) override; @@ -325,8 +327,6 @@ // Builds |context_menu_contents_|. void BuildContextMenuContents(); - // Where the label appears in the UI. Passed in from the constructor. This is - // a value from views::style::TextContext or an enum that extends it. const int text_context_; // An un-elided and single-line RenderText object used for preferred sizing.
diff --git a/ui/views/controls/menu/menu_runner_impl_cocoa.mm b/ui/views/controls/menu/menu_runner_impl_cocoa.mm index 02d6a95..316de4df 100644 --- a/ui/views/controls/menu/menu_runner_impl_cocoa.mm +++ b/ui/views/controls/menu/menu_runner_impl_cocoa.mm
@@ -5,6 +5,7 @@ #import "ui/views/controls/menu/menu_runner_impl_cocoa.h" #include "base/mac/sdk_forward_declarations.h" +#import "ui/base/cocoa/cocoa_base_utils.h" #import "ui/base/cocoa/menu_controller.h" #include "ui/base/models/menu_model.h" #include "ui/events/base_event_utils.h" @@ -79,6 +80,36 @@ return anchor_view; } +// Returns an appropriate event (with a location) suitable for showing a context +// menu. Uses [NSApp currentEvent] if it's a non-nil mouse click event, +// otherwise creates an autoreleased dummy event located at |anchor|. +NSEvent* EventForPositioningContextMenu(const gfx::Rect& anchor, + NSWindow* window) { + NSEvent* event = [NSApp currentEvent]; + switch ([event type]) { + case NSLeftMouseDown: + case NSLeftMouseUp: + case NSRightMouseDown: + case NSRightMouseUp: + case NSOtherMouseDown: + case NSOtherMouseUp: + return event; + default: + break; + } + NSPoint location_in_window = ui::ConvertPointFromScreenToWindow( + window, gfx::ScreenPointToNSPoint(anchor.CenterPoint())); + return [NSEvent mouseEventWithType:NSRightMouseDown + location:location_in_window + modifierFlags:0 + timestamp:0 + windowNumber:[window windowNumber] + context:nil + eventNumber:0 + clickCount:1 + pressure:0]; +} + } // namespace // static @@ -133,14 +164,15 @@ closing_event_time_ = base::TimeTicks(); running_ = true; + NSWindow* window = parent->GetNativeWindow(); if (run_types & MenuRunner::CONTEXT_MENU) { [NSMenu popUpContextMenu:[menu_controller_ menu] - withEvent:[NSApp currentEvent] + withEvent:EventForPositioningContextMenu(bounds, window) forView:parent->GetNativeView()]; } else if (run_types & MenuRunner::COMBOBOX) { NSMenuItem* checked_item = FirstCheckedItem(menu_controller_); base::scoped_nsobject<NSView> anchor_view( - CreateMenuAnchorView(parent->GetNativeWindow(), bounds, checked_item)); + CreateMenuAnchorView(window, bounds, checked_item)); NSMenu* menu = [menu_controller_ menu]; [menu setMinimumWidth:bounds.width() + kNativeCheckmarkWidth]; [menu popUpMenuPositioningItem:checked_item
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc index b556dbc..44940195 100644 --- a/ui/views/controls/textfield/textfield.cc +++ b/ui/views/controls/textfield/textfield.cc
@@ -377,9 +377,9 @@ if (!use_default_text_color_) return text_color_; - return GetNativeTheme()->GetSystemColor(read_only() || !enabled() ? - ui::NativeTheme::kColorId_TextfieldReadOnlyColor : - ui::NativeTheme::kColorId_TextfieldDefaultColor); + int style = (read_only() || !enabled()) ? style::STYLE_DISABLED + : style::STYLE_PRIMARY; + return style::GetColor(style::CONTEXT_TEXTFIELD, style, GetNativeTheme()); } void Textfield::SetTextColor(SkColor color) {
diff --git a/ui/views/style/typography_provider.cc b/ui/views/style/typography_provider.cc index 11bce4e..f8f7f377 100644 --- a/ui/views/style/typography_provider.cc +++ b/ui/views/style/typography_provider.cc
@@ -52,10 +52,28 @@ int context, int style, const ui::NativeTheme& theme) const { - return theme.GetSystemColor( - (style == style::STYLE_DISABLED) - ? ui::NativeTheme::kColorId_LabelDisabledColor - : ui::NativeTheme::kColorId_LabelEnabledColor); + ui::NativeTheme::ColorId color_id = + ui::NativeTheme::kColorId_LabelEnabledColor; + if (context == style::CONTEXT_BUTTON_MD) { + switch (style) { + case views::style::STYLE_DIALOG_BUTTON_DEFAULT: + color_id = ui::NativeTheme::kColorId_TextOnProminentButtonColor; + break; + case views::style::STYLE_DISABLED: + color_id = ui::NativeTheme::kColorId_ButtonDisabledColor; + break; + default: + color_id = ui::NativeTheme::kColorId_ButtonEnabledColor; + break; + } + } else if (context == style::CONTEXT_TEXTFIELD) { + color_id = style == style::STYLE_DISABLED + ? ui::NativeTheme::kColorId_TextfieldReadOnlyColor + : ui::NativeTheme::kColorId_TextfieldDefaultColor; + } else if (style == style::STYLE_DISABLED) { + color_id = ui::NativeTheme::kColorId_LabelDisabledColor; + } + return theme.GetSystemColor(color_id); } int DefaultTypographyProvider::GetLineHeight(int context, int style) const {
diff --git a/ui/views/widget/native_widget_mac_accessibility_unittest.mm b/ui/views/widget/native_widget_mac_accessibility_unittest.mm index 14c66da..7988061f 100644 --- a/ui/views/widget/native_widget_mac_accessibility_unittest.mm +++ b/ui/views/widget/native_widget_mac_accessibility_unittest.mm
@@ -18,6 +18,7 @@ #include "ui/base/ime/text_input_type.h" #import "ui/gfx/mac/coordinate_conversion.h" #include "ui/views/controls/button/label_button.h" +#include "ui/views/controls/combobox/combobox.h" #include "ui/views/controls/label.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/test/widget_test.h" @@ -139,6 +140,86 @@ } // namespace +// Test that all methods in the NSAccessibility informal protocol can be called +// on a retained accessibility object after the source view is deleted. +TEST_F(NativeWidgetMacAccessibilityTest, Lifetime) { + Textfield* view = AddChildTextfield(widget()->GetContentsView()->size()); + base::scoped_nsobject<NSObject> ax_node(view->GetNativeViewAccessible(), + base::scoped_policy::RETAIN); + + NSString* kAttribute = NSAccessibilityValueAttribute; + NSString* kParamAttribute = + NSAccessibilityStringForRangeParameterizedAttribute; + NSString* kAction = NSAccessibilityShowMenuAction; + + EXPECT_TRUE( + [[ax_node accessibilityAttributeNames] containsObject:kAttribute]); + EXPECT_NSEQ(kTestStringValue, + [ax_node accessibilityAttributeValue:kAttribute]); + EXPECT_TRUE([ax_node accessibilityIsAttributeSettable:kAttribute]); + EXPECT_TRUE([[ax_node accessibilityActionNames] containsObject:kAction]); + EXPECT_FALSE([ax_node accessibilityIsIgnored]); + + // Not implemented, but be sure to update this test if it ever is. + EXPECT_FALSE( + [ax_node respondsToSelector:@selector(accessibilityActionDescription:)]); + + EXPECT_TRUE([[ax_node accessibilityParameterizedAttributeNames] + containsObject:kParamAttribute]); + NSValue* range = [NSValue valueWithRange:NSMakeRange(0, kTestStringLength)]; + EXPECT_NSEQ( + kTestStringValue, + [ax_node accessibilityAttributeValue:kParamAttribute forParameter:range]); + + // The following is also "not implemented", but the informal protocol category + // provides a default implementation. + EXPECT_EQ(NSNotFound, [ax_node accessibilityIndexOfChild:nil]); + + // The only usually available array attribute is AXChildren, so go up a level + // to the Widget to test that a bit. The default implementation just gets the + // attribute normally and returns its size (if it's an array). + NSString* kChildren = NSAccessibilityChildrenAttribute; + base::scoped_nsobject<NSObject> ax_parent( + [ax_node accessibilityAttributeValue:NSAccessibilityParentAttribute], + base::scoped_policy::RETAIN); + EXPECT_EQ(1u, [ax_parent accessibilityArrayAttributeCount:kChildren]); + EXPECT_EQ( + ax_node.get(), + [ax_parent accessibilityArrayAttributeValues:kChildren index:0 + maxCount:1][0]); + + // If it is not an array, the default implementation throws an exception, so + // it's impossible to test these methods further on |ax_node|, apart from the + // following, before deleting the view. + EXPECT_EQ(0u, [ax_node accessibilityArrayAttributeCount:kChildren]); + + delete view; + + EXPECT_TRUE( + [ax_node respondsToSelector:@selector(accessibilityAttributeNames)]); + EXPECT_EQ(@[], [ax_node accessibilityAttributeNames]); + EXPECT_EQ(nil, [ax_node accessibilityAttributeValue:kAttribute]); + EXPECT_FALSE([ax_node accessibilityIsAttributeSettable:kAttribute]); + [ax_node accessibilitySetValue:kTestStringValue forAttribute:kAttribute]; + + EXPECT_EQ(@[], [ax_node accessibilityActionNames]); + [ax_node accessibilityPerformAction:kAction]; + + EXPECT_TRUE([ax_node accessibilityIsIgnored]); + EXPECT_EQ(nil, [ax_node accessibilityHitTest:NSZeroPoint]); + EXPECT_EQ(nil, [ax_node accessibilityFocusedUIElement]); + + EXPECT_EQ(@[], [ax_node accessibilityParameterizedAttributeNames]); + EXPECT_NSEQ(nil, [ax_node accessibilityAttributeValue:kParamAttribute + forParameter:range]); + + // Test the attributes with default implementations provided. + EXPECT_EQ(NSNotFound, [ax_node accessibilityIndexOfChild:nil]); + + // The Widget is currently still around, but the child should be gone. + EXPECT_EQ(0u, [ax_parent accessibilityArrayAttributeCount:kChildren]); +} + // Check that potentially keyboard-focusable elements are always leaf nodes. TEST_F(NativeWidgetMacAccessibilityTest, FocusableElementsAreLeafNodes) { // LabelButtons will have a label inside the button. The label should be @@ -320,6 +401,10 @@ EXPECT_NSEQ(role_description, AttributeValueAtMidpoint( NSAccessibilityRoleDescriptionAttribute)); + // Expect to see the action to show a context menu. + EXPECT_NSEQ(@[ NSAccessibilityShowMenuAction ], + [A11yElementAtMidpoint() accessibilityActionNames]); + // Prevent the textfield from interfering with hit tests on the widget itself. widget()->GetContentsView()->RemoveChildView(textfield); @@ -733,4 +818,41 @@ EXPECT_EQ(0, [[ax_node AXInsertionPointLineNumber] intValue]); } +class TestComboboxModel : public ui::ComboboxModel { + public: + TestComboboxModel() = default; + + // ui::ComboboxModel: + int GetItemCount() const override { return 2; } + base::string16 GetItemAt(int index) override { + return index == 0 ? base::SysNSStringToUTF16(kTestStringValue) + : base::ASCIIToUTF16("Second Item"); + } + + private: + DISALLOW_COPY_AND_ASSIGN(TestComboboxModel); +}; + +// Test a11y attributes of Comboboxes. +TEST_F(NativeWidgetMacAccessibilityTest, Combobox) { + Combobox* combobox = new Combobox(base::MakeUnique<TestComboboxModel>()); + combobox->SetSize(GetWidgetBounds().size()); + widget()->GetContentsView()->AddChildView(combobox); + + id ax_node = A11yElementAtMidpoint(); + EXPECT_TRUE(ax_node); + + EXPECT_NSEQ(NSAccessibilityPopUpButtonRole, [ax_node AXRole]); + + // The initial value should be the first item in the menu. + EXPECT_NSEQ(kTestStringValue, [ax_node AXValue]); + combobox->SetSelectedIndex(1); + EXPECT_NSEQ(@"Second Item", [ax_node AXValue]); + + // Expect to see both a press action and a show menu action. This matches + // Cocoa behavior. + EXPECT_NSEQ((@[ NSAccessibilityPressAction, NSAccessibilityShowMenuAction ]), + [ax_node accessibilityActionNames]); +} + } // namespace views
diff --git a/chrome/browser/resources/settings/images/settings_icon_camera_alt.svg b/ui/webui/resources/cr_elements/chromeos/change_picture/camera_alt_icon.svg similarity index 100% copy from chrome/browser/resources/settings/images/settings_icon_camera_alt.svg copy to ui/webui/resources/cr_elements/chromeos/change_picture/camera_alt_icon.svg
diff --git a/chrome/browser/resources/settings/images/settings_icon_flip.svg b/ui/webui/resources/cr_elements/chromeos/change_picture/camera_flip_icon.svg similarity index 100% copy from chrome/browser/resources/settings/images/settings_icon_flip.svg copy to ui/webui/resources/cr_elements/chromeos/change_picture/camera_flip_icon.svg
diff --git a/ui/webui/resources/cr_elements/chromeos/change_picture/compiled_resources2.gyp b/ui/webui/resources/cr_elements/chromeos/change_picture/compiled_resources2.gyp new file mode 100644 index 0000000..373a0a4 --- /dev/null +++ b/ui/webui/resources/cr_elements/chromeos/change_picture/compiled_resources2.gyp
@@ -0,0 +1,15 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +{ + 'targets': [ + { + 'target_name': 'cr_camera', + 'dependencies': [ + '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data', + '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:util', + ], + 'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'], + }, + ], +}
diff --git a/ui/webui/resources/cr_elements/chromeos/change_picture/cr_camera.html b/ui/webui/resources/cr_elements/chromeos/change_picture/cr_camera.html new file mode 100644 index 0000000..d3c588b6 --- /dev/null +++ b/ui/webui/resources/cr_elements/chromeos/change_picture/cr_camera.html
@@ -0,0 +1,87 @@ +<link rel="import" href="chrome://resources/html/polymer.html"> + +<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner.html"> + +<dom-module id="cr-camera"> + <template> + <style include="cr-shared-style"> + #perspectiveBox { + height: 228px; + perspective: 600px; + width: 228px; + } + + #userImageStreamCrop { + height: 228px; + overflow: hidden; + position: relative; + width: 228px; + } + + #userImageStreamCrop.flip-x { + transform: rotateY(180deg); + } + + paper-spinner { + bottom: 0; + left: 0; + margin: auto auto; + position: absolute; + right: 0; + top: 0; + } + + #cameraVideo { + height: 228px; + /* Center image for 4:3 aspect ratio. */ + left: -16.6%; + position: absolute; + } + + #cameraControls { + background-color: var(--paper-grey-800); + border-bottom-left-radius: 2px; + border-bottom-right-radius: 2px; + padding: 8px; + } + + #flipPhoto { + background-image: url(camera_flip_icon.svg); + float: right; + } + + :host-context([dir=rtl]) #flipPhoto { + float: left; + } + + #takePhoto { + background-color: var(--paper-green-500); + background-image: url(camera_alt_icon.svg); + border-radius: 50%; + display: block; + margin: 0 auto 0 auto; + } + </style> + <div hidden="[[!cameraActive]]"> + <div id="perspectiveBox"> + <div id="userImageStreamCrop"> + <video id="cameraVideo" autoplay hidden="[[!cameraOnline_]]"></video> + <paper-spinner active="[[!cameraOnline_]]"></paper-spinner> + </div> + </div> + <div id="cameraControls"> + <button is="paper-icon-button-light" id="flipPhoto" tabindex="2" + title="[[flipPhotoLabel]]" on-tap="onTapFlipPhoto_" + disabled="[[!cameraOnline_]]"> + </button> + <button is="paper-icon-button-light" id="takePhoto" tabindex="1" + title="[[takePhotoLabel]]" on-tap="takePhoto" + disabled="[[!cameraOnline_]]"> + </button> + </div> + </div> + </template> + <script src="cr_camera.js"></script> +</dom-module>
diff --git a/ui/webui/resources/cr_elements/chromeos/change_picture/cr_camera.js b/ui/webui/resources/cr_elements/chromeos/change_picture/cr_camera.js new file mode 100644 index 0000000..77c6120 --- /dev/null +++ b/ui/webui/resources/cr_elements/chromeos/change_picture/cr_camera.js
@@ -0,0 +1,208 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview + * 'cr-camera' is a Polymer element used to take a picture from the + * user webcam to use as a Chrome OS profile picture. + */ +(function() { + +/** + * Dimensions for camera capture. + * @const + */ +var CAPTURE_SIZE = {height: 480, width: 480}; + +Polymer({ + is: 'cr-camera', + + properties: { + /** + * True if the user has selected the camera as the user image source. + * @type {boolean} + */ + cameraActive: { + type: Boolean, + observer: 'cameraActiveChanged_', + value: false, + }, + + /** Strings provided by host */ + flipPhotoLabel: String, + takePhotoLabel: String, + + /** + * True when the camera is actually streaming video. May be false even when + * the camera is present and shown, but still initializing. + * @private {boolean} + */ + cameraOnline_: { + type: Boolean, + value: false, + }, + + /** + * True if the photo is currently marked flipped. + * @private {boolean} + */ + isFlipped_: { + type: Boolean, + value: false, + }, + }, + + /** @override */ + attached: function() { + this.$.cameraVideo.addEventListener('canplay', function() { + this.cameraOnline_ = true; + }.bind(this)); + if (this.cameraActive) + this.startCamera_(); + }, + + /** @override */ + detached: function() { + this.stopCamera_(); + }, + + /** + * Performs photo capture from the live camera stream. A 'photo-taken' event + * will be fired as soon as captured photo is available, with the + * 'photoDataURL' property containing the photo encoded as a data URL. + */ + takePhoto: function() { + if (!this.cameraOnline_) + return; + var canvas = + /** @type {HTMLCanvasElement} */ (document.createElement('canvas')); + canvas.width = CAPTURE_SIZE.width; + canvas.height = CAPTURE_SIZE.height; + this.captureFrame_( + this.$.cameraVideo, + /** @type {!CanvasRenderingContext2D} */ (canvas.getContext('2d'))); + + var photoDataUrl = this.isFlipped_ ? this.flipFrame_(canvas) : + canvas.toDataURL('image/png'); + this.fire('photo-taken', {photoDataUrl: photoDataUrl}); + }, + + /** @private */ + cameraActiveChanged_: function() { + if (this.cameraActive) + this.startCamera_(); + else + this.stopCamera_(); + }, + + /** + * Tries to start the camera stream capture. + * @private + */ + startCamera_: function() { + this.stopCamera_(); + this.cameraStartInProgress_ = true; + + var successCallback = function(stream) { + if (this.cameraStartInProgress_) { + this.$.cameraVideo.src = URL.createObjectURL(stream); + this.cameraStream_ = stream; + } else { + this.stopVideoTracks_(stream); + } + this.cameraStartInProgress_ = false; + }.bind(this); + + var errorCallback = function() { + this.cameraOnline_ = false; + this.cameraStartInProgress_ = false; + }.bind(this); + + navigator.webkitGetUserMedia({video: true}, successCallback, errorCallback); + }, + + /** + * Stops camera capture, if it's currently active. + * @private + */ + stopCamera_: function() { + this.cameraOnline_ = false; + this.$.cameraVideo.src = ''; + if (this.cameraStream_) + this.stopVideoTracks_(this.cameraStream_); + // Cancel any pending getUserMedia() checks. + this.cameraStartInProgress_ = false; + }, + + /** + * Stops all video tracks associated with a MediaStream object. + * @param {!MediaStream} stream + * @private + */ + stopVideoTracks_: function(stream) { + var tracks = stream.getVideoTracks(); + for (var i = 0; i < tracks.length; i++) + tracks[i].stop(); + }, + + /** + * Flip the live camera stream. + * @private + */ + onTapFlipPhoto_: function() { + this.isFlipped_ = !this.isFlipped_; + this.$.userImageStreamCrop.classList.toggle('flip-x', this.isFlipped_); + this.fire('photo-flipped', this.isFlipped_); + }, + + /** + * Captures a single still frame from a <video> element, placing it at the + * current drawing origin of a canvas context. + * @param {!HTMLVideoElement} video Video element to capture from. + * @param {!CanvasRenderingContext2D} ctx Canvas context to draw onto. + * @private + */ + captureFrame_: function(video, ctx) { + var width = video.videoWidth; + var height = video.videoHeight; + if (width < CAPTURE_SIZE.width || height < CAPTURE_SIZE.height) { + console.error( + 'Video capture size too small: ' + width + 'x' + height + '!'); + } + var src = {}; + if (width / CAPTURE_SIZE.width > height / CAPTURE_SIZE.height) { + // Full height, crop left/right. + src.height = height; + src.width = height * CAPTURE_SIZE.width / CAPTURE_SIZE.height; + } else { + // Full width, crop top/bottom. + src.width = width; + src.height = width * CAPTURE_SIZE.height / CAPTURE_SIZE.width; + } + src.x = (width - src.width) / 2; + src.y = (height - src.height) / 2; + ctx.drawImage( + video, src.x, src.y, src.width, src.height, 0, 0, CAPTURE_SIZE.width, + CAPTURE_SIZE.height); + }, + + /** + * Flips frame horizontally. + * @param {!(HTMLImageElement|HTMLCanvasElement|HTMLVideoElement)} source + * Frame to flip. + * @return {string} Flipped frame as data URL. + */ + flipFrame_: function(source) { + var canvas = document.createElement('canvas'); + canvas.width = CAPTURE_SIZE.width; + canvas.height = CAPTURE_SIZE.height; + var ctx = canvas.getContext('2d'); + ctx.translate(CAPTURE_SIZE.width, 0); + ctx.scale(-1.0, 1.0); + ctx.drawImage(source, 0, 0); + return canvas.toDataURL('image/png'); + }, +}); + +})();
diff --git a/ui/webui/resources/cr_elements/compiled_resources2.gyp b/ui/webui/resources/cr_elements/compiled_resources2.gyp index 7183950..74cbbfe6 100644 --- a/ui/webui/resources/cr_elements/compiled_resources2.gyp +++ b/ui/webui/resources/cr_elements/compiled_resources2.gyp
@@ -7,6 +7,7 @@ 'target_name': 'cr_elements_resources', 'type': 'none', 'dependencies': [ + 'chromeos/change_picture/compiled_resources2.gyp:*', 'chromeos/network/compiled_resources2.gyp:*', 'cr_action_menu/compiled_resources2.gyp:*', 'cr_dialog/compiled_resources2.gyp:*',
diff --git a/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js b/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js index 5979235..33414bd3 100644 --- a/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js +++ b/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js
@@ -39,37 +39,40 @@ * @private * @param {number} start * @param {number} end - * @param {number} length + * @param {number} menuLength * @param {AnchorAlignment} anchorAlignment * @param {number} min * @param {number} max * @return {number} */ function getStartPointWithAnchor( - start, end, length, anchorAlignment, min, max) { + start, end, menuLength, anchorAlignment, min, max) { var startPoint = 0; switch (anchorAlignment) { case AnchorAlignment.BEFORE_START: - startPoint = -length; + startPoint = -menuLength; break; case AnchorAlignment.AFTER_START: startPoint = start; break; case AnchorAlignment.CENTER: - startPoint = (start + end - length) / 2; + startPoint = (start + end - menuLength) / 2; break; case AnchorAlignment.BEFORE_END: - startPoint = end - length; + startPoint = end - menuLength; break; case AnchorAlignment.AFTER_END: startPoint = end; break; } - if (startPoint + length > max) - startPoint = end - length; + if (startPoint + menuLength > max) + startPoint = end - menuLength; if (startPoint < min) startPoint = start; + + startPoint = Math.max(min, Math.min(startPoint, max - menuLength)); + return startPoint; }
diff --git a/ui/webui/resources/cr_elements/icons.html b/ui/webui/resources/cr_elements/icons.html index 07b4adf..40e08ef7 100644 --- a/ui/webui/resources/cr_elements/icons.html +++ b/ui/webui/resources/cr_elements/icons.html
@@ -31,6 +31,7 @@ <g id="arrow-drop-up"><path d="M7 14l5-5 5 5z"></g> <g id="arrow-drop-down"><path d="M7 10l5 5 5-5z"></path></g> <if expr="chromeos"> + <g id="camera-alt"><circle cx="12" cy="12" r="3.2"></circle><path d="M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"></path></g> <g id="check"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"></path></g> </if> <g id="chevron-right"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"></path></g>
diff --git a/ui/webui/resources/cr_elements_images.grdp b/ui/webui/resources/cr_elements_images.grdp index b6f13a0..9cf3cab 100644 --- a/ui/webui/resources/cr_elements_images.grdp +++ b/ui/webui/resources/cr_elements_images.grdp
@@ -25,6 +25,12 @@ <include name="IDR_WEBUI_IMAGES_ICON_ARROW_DROPDOWN" file="images/icon_arrow_dropdown.svg" type="BINDATA" /> <if expr="chromeos"> + <include name="IDR_CR_ELEMENTS_CAMERA_ALT_ICON_SVG" + file="cr_elements/chromeos/change_picture/camera_alt_icon.svg" + type="BINDATA" /> + <include name="IDR_CR_ELEMENTS_CAMERA_FLIP_ICON_SVG" + file="cr_elements/chromeos/change_picture/camera_flip_icon.svg" + type="BINDATA" /> <include name="IDR_CR_ELEMENTS_CELLULAR_0_SVG" file="cr_elements/chromeos/network/cellular_0.svg" type="BINDATA" />
diff --git a/ui/webui/resources/cr_elements_resources.grdp b/ui/webui/resources/cr_elements_resources.grdp index 843031b8..3b5bf6d0 100644 --- a/ui/webui/resources/cr_elements_resources.grdp +++ b/ui/webui/resources/cr_elements_resources.grdp
@@ -42,6 +42,12 @@ file="../../webui/resources/cr_elements/cr_lazy_render/cr_lazy_render.js" type="chrome_html" /> <if expr="chromeos"> + <structure name="IDR_CR_ELEMENTS_CHROMEOS_CHANGE_PICTURE_CR_CAMERA_HTML" + file="../../webui/resources/cr_elements/chromeos/change_picture/cr_camera.html" + type="chrome_html" /> + <structure name="IDR_CR_ELEMENTS_CHROMEOS_CHANGE_PICTURE_CR__CAMERA_JS" + file="../../webui/resources/cr_elements/chromeos/change_picture/cr_camera.js" + type="chrome_html" /> <structure name="IDR_CR_ELEMENTS_CHROMEOS_CR_NETWORK_ICON_HTML" file="../../webui/resources/cr_elements/chromeos/network/cr_network_icon.html" type="chrome_html" />
diff --git a/ui/webui/resources/polymer_resources.grdp b/ui/webui/resources/polymer_resources.grdp index 8f86138..938d6961 100644 --- a/ui/webui/resources/polymer_resources.grdp +++ b/ui/webui/resources/polymer_resources.grdp
@@ -449,6 +449,26 @@ <structure name="IDR_POLYMER_1_0_PAPER_CHECKBOX_PAPER_CHECKBOX_HTML" file="../../../third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox.html" type="chrome_html" /> + <if expr="chromeos"> + <structure name="IDR_POLYMER_1_0_PAPER_DIALOG_BEHAVIOR_PAPER_DIALOG_BEHAVIOR_EXTRACTED_JS" + file="../../../third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior-extracted.js" + type="chrome_html" /> + <structure name="IDR_POLYMER_1_0_PAPER_DIALOG_BEHAVIOR_PAPER_DIALOG_BEHAVIOR_HTML" + file="../../../third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior.html" + type="chrome_html" /> + <structure name="IDR_POLYMER_1_0_PAPER_DIALOG_BEHAVIOR_PAPER_DIALOG_COMMON_CSS" + file="../../../third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-common.css" + type="chrome_html" /> + <structure name="IDR_POLYMER_1_0_PAPER_DIALOG_BEHAVIOR_PAPER_DIALOG_SHARED_STYLES_HTML" + file="../../../third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-shared-styles.html" + type="chrome_html" /> + <structure name="IDR_POLYMER_1_0_PAPER_DIALOG_PAPER_DIALOG_EXTRACTED_JS" + file="../../../third_party/polymer/v1_0/components-chromium/paper-dialog/paper-dialog-extracted.js" + type="chrome_html" /> + <structure name="IDR_POLYMER_1_0_PAPER_DIALOG_PAPER_DIALOG_HTML" + file="../../../third_party/polymer/v1_0/components-chromium/paper-dialog/paper-dialog.html" + type="chrome_html" /> + </if> <structure name="IDR_POLYMER_1_0_PAPER_DRAWER_PANEL_PAPER_DRAWER_PANEL_EXTRACTED_JS" file="../../../third_party/polymer/v1_0/components-chromium/paper-drawer-panel/paper-drawer-panel-extracted.js" type="chrome_html" />
diff --git a/url/gurl.cc b/url/gurl.cc index 1fe48db3..128652fe 100644 --- a/url/gurl.cc +++ b/url/gurl.cc
@@ -452,13 +452,17 @@ } std::string GURL::HostNoBrackets() const { + return HostNoBracketsPiece().as_string(); +} + +base::StringPiece GURL::HostNoBracketsPiece() const { // If host looks like an IPv6 literal, strip the square brackets. url::Component h(parsed_.host); if (h.len >= 2 && spec_[h.begin] == '[' && spec_[h.end() - 1] == ']') { h.begin++; h.len -= 2; } - return ComponentString(h); + return ComponentStringPiece(h); } std::string GURL::GetContent() const {
diff --git a/url/gurl.h b/url/gurl.h index 74efbb5..6f4536d 100644 --- a/url/gurl.h +++ b/url/gurl.h
@@ -380,6 +380,9 @@ // literals. This can be useful for passing to getaddrinfo(). std::string HostNoBrackets() const; + // Returns the same characters as HostNoBrackets(), avoiding a copy. + base::StringPiece HostNoBracketsPiece() const; + // Returns true if this URL's host matches or is in the same domain as // the given input string. For example, if the hostname of the URL is // "www.google.com", this will return true for "com", "google.com", and
diff --git a/url/gurl_unittest.cc b/url/gurl_unittest.cc index a20472d..30db59eb 100644 --- a/url/gurl_unittest.cc +++ b/url/gurl_unittest.cc
@@ -584,6 +584,7 @@ GURL url(cases[i].input); EXPECT_EQ(cases[i].expected_host, url.host()); EXPECT_EQ(cases[i].expected_plainhost, url.HostNoBrackets()); + EXPECT_EQ(cases[i].expected_plainhost, url.HostNoBracketsPiece()); } }